text:
#ifndef dp_planner_CORE_H
#define dp_planner_CORE_H

// ROS includes
#include <ros/ros.h>

#include <geometry_msgs/Vector3Stamped.h>
#include <geometry_msgs/PoseWithCovarianceStamped.h>
#include <geometry_msgs/PoseStamped.h>
#include <geometry_msgs/PoseArray.h>
#include <nav_msgs/Odometry.h>
#include <nav_msgs/OccupancyGrid.h>

#include <tf/transform_broadcaster.h>
#include <tf/transform_listener.h>
#include <tf/tf.h>
#include <std_msgs/Int8.h>
#include <std_msgs/Int32.h>
#include "waypoint_follower/libwaypoint_follower.h"
#include "autoware_msgs/LaneArray.h"
#include "autoware_msgs/CanInfo.h"

#include "autoware_msgs/CloudCluster.h"
#include "autoware_msgs/CloudClusterArray.h"

#include <jsk_recognition_msgs/BoundingBox.h>
#include <jsk_recognition_msgs/BoundingBoxArray.h>

#include "op_planner/RoadNetwork.h"
#include "op_planner/MappingHelpers.h"
#include "op_planner/PlanningHelpers.h"
//#include "CarState.h"
#include "op_planner/LocalPlannerH.h"
#include "RosHelpers.h"
#include "op_simu/SimpleTracker.h"

#include <opencv/cv.h>
#include <cv_bridge/cv_bridge.h>
#include <opencv2/core/core.hpp>
#include <opencv2/objdetect/objdetect.hpp>
#include <opencv/highgui.h>
#include <opencv2/imgproc/imgproc.hpp>

#if (CV_MAJOR_VERSION < 3)
#include <opencv2/contrib/contrib.hpp>
#endif

namespace PlannerXNS
{

#define _DATASET_GENERATION_BLOCK
#define SIMU_OBSTACLE_WIDTH 3.5
#define SIMU_OBSTACLE_HEIGHT 0.5
#define SIMU_OBSTACLE_LENGTH 2.0

enum SIGNAL_TYPE{SIMULATION_SIGNAL, ROBOT_SIGNAL};
enum MAP_SOURCE_TYPE{MAP_AUTOWARE, MAP_FOLDER, MAP_KML_FILE};

class PlannerX
{
protected:
	//For Testing
	double m_TrackingTime;
	int m_nTrackObjects;
	int m_nContourPoints;
	int m_nOriginalPoints;

	timespec m_Timer;
	timespec m_TrafficLightTimer;
	int m_counter;
	int m_frequency;

protected:
	SimulationNS::SimpleTracker m_ObstacleTracking;
	//SimulationNS::CarState m_State;
	PlannerHNS::LocalPlannerH m_LocalPlanner;

	geometry_msgs::Pose m_OriginPos;

	PlannerHNS::WayPoint m_InitPos;
	bool bInitPos;

	PlannerHNS::WayPoint m_CurrentPos;
	bool bNewCurrentPos;

	std::vector<PlannerHNS::DetectedObject> m_OriginalClusters;
	std::vector<PlannerHNS::DetectedObject> m_TrackedClusters;
	std::vector<PlannerHNS::DetectedObject> m_DetectedBoxes;
	bool bNewClusters;
	jsk_recognition_msgs::BoundingBoxArray m_BoundingBoxes;
	bool bNewBoxes;

	PlannerHNS::VehicleState m_VehicleState;
	bool bVehicleState;

	bool bNewEmergency;
	int m_bEmergencyStop;

	bool bNewTrafficLigh;
	bool m_bGreenLight;

	bool bNewOutsideControl;
	int m_bOutsideControl;

	std::vector<PlannerHNS::WayPoint> m_AStarPath;
	bool bNewAStarPath;
	timespec m_AStartPlanningTimer;

	std::vector<std::vector<PlannerHNS::WayPoint> > m_WayPlannerPaths;
	bool bWayPlannerPath;

	//Planning Related variables
	PlannerHNS::BehaviorState m_CurrentBehavior;
	PlannerHNS::BehaviorState m_PrevBehavior;
	//PlannerHNS::WayPoint m_CurrentGoal;
	struct timespec m_PlanningTimer;
	AutowareRoadNetwork m_AwMap;
  	PlannerHNS::RoadNetwork m_Map;
  	MAP_SOURCE_TYPE	m_MapSource;
  	bool	bKmlMapLoaded;
  	std::string m_KmlMapPath;

  	bool m_bEnableTracking;
  	bool m_bEnableOutsideControl;

  	std::vector<std::string>    m_LogData;

	bool  enablePlannerDynamicSwitch;

protected:
	//ROS messages (topics)

	ros::NodeHandle nh;

	//define publishers
	ros::Publisher pub_LocalPath;
	ros::Publisher pub_LocalBasePath;
	ros::Publisher pub_ClosestIndex;
	ros::Publisher pub_BehaviorState;
	ros::Publisher pub_GlobalPlanNodes;
	ros::Publisher pub_StartPoint;
	ros::Publisher pub_GoalPoint;
	ros::Publisher pub_AStarStartPoint;
	ros::Publisher pub_AStarGoalPoint;
	ros::Publisher pub_EnableLattice;

	ros::Publisher pub_DetectedPolygonsRviz;
	ros::Publisher pub_TrackedObstaclesRviz;
	ros::Publisher pub_LocalTrajectoriesRviz;
	ros::Publisher pub_LocalTrajectoriesRviz_dynamic;
	ros::Publisher pub_TestLineRviz;
	ros::Publisher pub_BehaviorStateRviz;
	ros::Publisher pub_SafetyBorderRviz;
	ros::Publisher pub_cluster_cloud;
	ros::Publisher pub_SimuBoxPose;

	// define subscribers.
	ros::Subscriber sub_initialpose			;
	ros::Subscriber sub_current_pose 		;
	ros::Subscriber sub_current_velocity	;
	ros::Subscriber sub_cluster_cloud		;
	ros::Subscriber sub_bounding_boxs		;
	ros::Subscriber sub_vehicle_simu_status ;
	ros::Subscriber sub_robot_odom			;
	ros::Subscriber sub_can_info			;
	ros::Subscriber sub_EmergencyStop		;
	ros::Subscriber sub_TrafficLight		;
	ros::Subscriber sub_OutsideControl		;
	ros::Subscriber sub_AStarPath			;
	ros::Subscriber sub_WayPlannerPaths		;

	ros::Subscriber sub_CostMap				;

	//vector map subscription
	ros::Subscriber sub_map_points;
	ros::Subscriber sub_map_lanes;
	ros::Subscriber sub_map_nodes;
	ros::Subscriber sup_stop_lines;
	ros::Subscriber sub_dtlanes;

	ros::Subscriber sub_simulated_obstacle_pose_rviz;

	// Callback function for subscriber.
	void callbackGetInitPose(const geometry_msgs::PoseWithCovarianceStampedConstPtr &input);
	void callbackGetCurrentPose(const geometry_msgs::PoseStampedConstPtr& msg);
	void callbackGetCloudClusters(const autoware_msgs::CloudClusterArrayConstPtr& msg);
	void callbackGetBoundingBoxes(const jsk_recognition_msgs::BoundingBoxArrayConstPtr& msg);
	void callbackGetVehicleStatus(const geometry_msgs::TwistStampedConstPtr& msg);
	void callbackGetCanInfo(const autoware_msgs::CanInfoConstPtr &msg);
	void callbackGetRobotOdom(const nav_msgs::OdometryConstPtr& msg);
	void callbackGetEmergencyStop(const std_msgs::Int8& msg);
	void callbackGetTrafficLight(const std_msgs::Int8& msg);
	void callbackGetOutsideControl(const std_msgs::Int8& msg);
	void callbackGetAStarPath(const autoware_msgs::LaneArrayConstPtr& msg);
	void callbackGetWayPlannerPath(const autoware_msgs::LaneArrayConstPtr& msg);
	void callbackGetCostMap(const nav_msgs::OccupancyGrid& msg);

	//Vector map callbacks
	void callbackGetVMPoints(const vector_map_msgs::PointArray& msg);
	void callbackGetVMLanes(const vector_map_msgs::LaneArray& msg);
	void callbackGetVMNodes(const vector_map_msgs::NodeArray& msg);
	void callbackGetVMStopLines(const vector_map_msgs::StopLineArray& msg);
	void callbackGetVMCenterLines(const vector_map_msgs::DTLaneArray& msg);

	//for simulation
	void callbackGetRvizPoint(const geometry_msgs::PointStampedConstPtr& msg);

public:
  PlannerX();
  ~PlannerX();
  void PlannerMainLoop();

protected:
  //Helper Functions
  void UpdatePlanningParams();

  autoware_msgs::CloudCluster GenerateSimulatedObstacleCluster(const double& x_rand, const double& y_rand, const double& z_rand, const int& nPoints, const geometry_msgs::PointStamped& centerPose);

#ifdef DATASET_GENERATION_BLOCK
private:
  struct DataPairs
  {
	  cv::Mat image;
	  PlannerHNS::VehicleState vehicleState;
	  PlannerHNS::WayPoint currentPos;
	  std::vector<PlannerHNS::WayPoint> path;
	  std::vector< std::vector<PlannerHNS::WayPoint> > predictedPaths;
  };

  int m_iRecordNumber;
  cv::Mat m_CurrImage;
  std::vector<DataPairs> m_DrivePoints;

  //tf::TransformListener m_Transformation;
  std::ofstream m_ImagesVectors;
  std::ofstream m_TrajVectors;

  ros::Subscriber sub_image_reader;
  void callbackReadImage(const sensor_msgs::ImageConstPtr& msg);
  void ExtractPathFromDriveData(double max_extraction = 50);
  void WritePathCSV(const std::string& fName, std::vector<PlannerHNS::WayPoint>& path);
  void WriteImageAndPathCSV(cv::Mat img, std::vector<PlannerHNS::WayPoint>& path);

#endif

};

}

#endif  // dp_planner_H


text:
package grpc_recovery2

import (
	"context"
	"fmt"
	"github.com/nebulaim/telegramd/baselib/grpc_util/middleware/examples/zproto"
	"google.golang.org/grpc"
	"google.golang.org/grpc/codes"
	"google.golang.org/grpc/status"
	"net"
	"testing"
)

type ChatTestServiceImpl struct {
}

func (s *ChatTestServiceImpl) Connect(request *zproto.ChatSession, stream zproto.ChatTest_ConnectServer) (err error) {
	return
}

func (s *ChatTestServiceImpl) SendChat(ctx context.Context, request *zproto.ChatMessage) (reply *zproto.VoidRsp2, err error) {
	fmt.Printf("%v.SendChat(_) = _, %v\n", ctx, request)

	switch request.MessageData {
	case "panic":
		panic("very bad thing happened")
	case "nil":
		panic("nil thing happened")
	}
	return &zproto.VoidRsp2{}, nil
}

func unaryRecoveryHandler(ctx context.Context, p interface{}) (err error) {
	return status.Errorf(codes.Unknown, "panic triggered: %v", p)
}

func unaryRecoveryHandler2(ctx context.Context, p interface{}) (err error) {
	return status.Errorf(codes.Unknown, "panic triggered: %v", p)
}

func streamRecoveryHandler(stream grpc.ServerStream, p interface{}) (err error) {
	return
}

func TestRecoveryServer(t *testing.T) {
	lis, err := net.Listen("tcp", "0.0.0.0:22345")
	if err != nil {
		panic(err)
		// glog.Fatalf("failed to listen: %v", err)
	}

	server := NewRecoveryServer2(unaryRecoveryHandler, unaryRecoveryHandler2, streamRecoveryHandler)
	zproto.RegisterChatTestServer(server, &ChatTestServiceImpl{})
	server.Serve(lis)
}

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="CP850"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

  <meta content="text/html; charset=CP850" http-equiv="Content-Type" />

  <title>Class: RHC::Vendor::ParseConfig</title>

  <link rel="stylesheet" href="../../rdoc.css" type="text/css" media="screen" />

          Home
          Classes
          Methods

In Files

lib/rhc/vendor/parseconfig.rb

Parent

Object

Methods

::new

#[]

#add

#add_to_group

#get_groups

#get_params

#get_value

#import_config

#validate_config

#write

Class/Module Index

        <form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
        <fieldset>
          <legend>Quicksearch</legend>
          <input type="text" name="quicksearch" value=""
            class="quicksearch-field" />
        </fieldset>
        </form>

RHC

RHC::AdditionalStorageArgumentsException

RHC::AdditionalStorageRemoveException

RHC::AdditionalStorageValueException

RHC::AliasNotFoundException

RHC::AppCloneNotSupportedException

RHC::ArgumentNotValid

RHC::Auth

RHC::Auth::Basic

RHC::Auth::Token

RHC::Auth::TokenStore

RHC::Auth::X509

RHC::AutoComplete

RHC::AutoCompleteBindings

RHC::CLI

RHC::CartridgeHelpers

RHC::CartridgeNotFoundException

RHC::CartridgeNotScalableException

RHC::ChangeMembersOnResourceNotSupported

RHC::CommandHelpBindings

RHC::CommandRunner

RHC::Commands

RHC::Commands::Account

RHC::Commands::Alias

RHC::Commands::App

RHC::Commands::Apps

RHC::Commands::Authorization

RHC::Commands::Base

RHC::Commands::Base::InvalidCommand

RHC::Commands::Cartridge

RHC::Commands::Deployment

RHC::Commands::Domain

RHC::Commands::Env

RHC::Commands::ForwardingSpec

RHC::Commands::GitClone

RHC::Commands::Logout

RHC::Commands::Member

RHC::Commands::PortForward

RHC::Commands::Region

RHC::Commands::Scp

RHC::Commands::Server

RHC::Commands::Setup

RHC::Commands::Snapshot

RHC::Commands::Ssh

RHC::Commands::Sshkey

RHC::Commands::Tail

RHC::Commands::Team

RHC::Commands::Threaddump

RHC::Config

RHC::ConfigEnv

RHC::ConfirmationError

RHC::ConnectionFailed

RHC::ContextHelpers

RHC::DeploymentHelpers

RHC::DeploymentNotFoundException

RHC::DeploymentsNotSupportedException

RHC::DeprecatedError

RHC::DomainWizard

RHC::EmbeddedWizard

RHC::EnvironmentVariableNotFoundException

RHC::EnvironmentVariableNotProvidedException

RHC::EnvironmentVariablesNotSupportedException

RHC::Exception

RHC::FileOrPathNotFound

RHC::GitDirectoryExists

RHC::GitException

RHC::GitHelpers

RHC::GitPermissionDenied

RHC::HelpFormatter

RHC::Helpers

RHC::HighAvailabilityNotSupportedException

RHC::IncompatibleDeploymentTypeException

RHC::InvalidSSHExecutableException

RHC::InvalidURIException

RHC::JenkinsNotInstalledOnServer

RHC::Json

RHC::JsonError

RHC::KeyDataInvalidException

RHC::KeyFileAccessDeniedException

RHC::KeyFileNotExistentException

RHC::KeyNotFoundException

RHC::MemberNotFoundException

RHC::MembersNotSupported

RHC::MissingScalingValueException

RHC::MultipleCartridgesException

RHC::NoDomainsForUser

RHC::NoPerGearOperations

RHC::NoPortsToForwardException

RHC::NoRegionConfiguredException

RHC::OperationNotSupportedException

RHC::OutputHelpers

RHC::PermissionDeniedException

RHC::PortForwardFailedException

RHC::RegionsAndZonesNotSupportedException

RHC::RemoteFileOrPathNotFound

RHC::RerunWizard

RHC::Rest

RHC::Rest::Activation

RHC::Rest::Alias

RHC::Rest::Api

RHC::Rest::ApiEndpointNotFound

RHC::Rest::ApiMethods

RHC::Rest::Application

RHC::Rest::ApplicationNotFoundException

RHC::Rest::Attributes

RHC::Rest::AttributesClass

RHC::Rest::Authorization

RHC::Rest::AuthorizationsNotSupported

RHC::Rest::Base

RHC::Rest::Cartridge

RHC::Rest::CertificateVerificationFailed

RHC::Rest::Client

RHC::Rest::ClientErrorException

RHC::Rest::ConnectionException

RHC::Rest::Deployment

RHC::Rest::Domain

RHC::Rest::DomainNotFoundException

RHC::Rest::DownloadingCartridgesNotSupported

RHC::Rest::EnvironmentVariable

RHC::Rest::Exception

RHC::Rest::GearGroup

RHC::Rest::HTTPClient

RHC::Rest::InitialGitUrlNotSupported

RHC::Rest::Key

RHC::Rest::Membership

RHC::Rest::Membership::Member

RHC::Rest::Mock

RHC::Rest::Mock::Helpers

RHC::Rest::Mock::MockRestActivation

RHC::Rest::Mock::MockRestAlias

RHC::Rest::Mock::MockRestApi

RHC::Rest::Mock::MockRestApplication

RHC::Rest::Mock::MockRestCartridge

RHC::Rest::Mock::MockRestClient

RHC::Rest::Mock::MockRestDeployment

RHC::Rest::Mock::MockRestDomain

RHC::Rest::Mock::MockRestGearGroup

RHC::Rest::Mock::MockRestKey

RHC::Rest::Mock::MockRestTeam

RHC::Rest::Mock::MockRestUser

RHC::Rest::MultipleCartridgeCreationNotSupported

RHC::Rest::Region

RHC::Rest::RequestDeniedException

RHC::Rest::ResourceAccessException

RHC::Rest::ResourceNotFoundException

RHC::Rest::SSLConnectionFailed

RHC::Rest::SSLVersionRejected

RHC::Rest::SelfSignedCertificate

RHC::Rest::ServerErrorException

RHC::Rest::ServiceUnavailableException

RHC::Rest::SslCertificatesNotSupported

RHC::Rest::Team

RHC::Rest::TimeoutException

RHC::Rest::TokenExpiredOrInvalid

RHC::Rest::UnAuthorizedException

RHC::Rest::User

RHC::Rest::ValidationException

RHC::Rest::WWWAuth

RHC::Rest::WWWAuth::DeferredBasic

RHC::Rest::WWWAuth::DeferredCredential

RHC::Rest::WWWAuth::OAuth2

RHC::RunnerHelpBindings

RHC::SCPHelpers

RHC::SSHAuthenticationFailed

RHC::SSHCommandFailed

RHC::SSHConnectionRefused

RHC::SSHHelpers

RHC::SSHHelpers::MultipleGearTask

RHC::SSHWizard

RHC::Server

RHC::ServerAPINotSupportedException

RHC::ServerHelpers

RHC::ServerHostnameExistsException

RHC::ServerInUseException

RHC::ServerNicknameExistsException

RHC::ServerNotConfiguredException

RHC::ServerWizard

RHC::Servers

RHC::SnapshotRestoreException

RHC::SnapshotSaveException

RHC::StringTee

RHC::TarGz

RHC::TeamNotFoundException

RHC::TeamsNotSupportedException

RHC::UnsupportedError

RHC::VERSION

RHC::Vendor

RHC::Vendor::OkJson

RHC::Vendor::OkJson::Error

RHC::Vendor::OkJson::Utf8Error

RHC::Vendor::ParseConfig

RHC::Vendor::SSHKey

RHC::Vendor::Zlib

RHC::Vendor::Zlib::GzipFile

RHC::Vendor::Zlib::GzipFile::Error

RHC::Vendor::Zlib::GzipReader

RHC::Vendor::Zlib::GzipReader::DataError

RHC::Vendor::Zlib::GzipReader::Error

RHC::Vendor::Zlib::GzipReader::NeedDict

RHC::Vendor::Zlib::Inflate

RHC::Vendor::Zlib::Inflate::HuffmanTree

RHC::Vendor::Zlib::ZStream

RHC::Wizard

Commander

Commander::Command

Commander::Command::Options

HighLine

HighLine::Header

HighLine::Table

HTTP

HTTP::Message

HTTPClient

HTTPClient::SSPINegotiateAuth

Array

DateTime

File

Hash

HighLineExtension

Object

OpenURI

RowBased

String

UNIXServer

No matching classes.

RHC::Vendor::ParseConfig

Constants

Version

Attributes

            config_file[RW]

            groups[RW]

            params[RW]

Public Class Methods

            new(config_file=nil)
            click to toggle source

Initialize the class with the path to the 'config_file' The class
objects are dynamically generated by the name of the 'param' in the config
file.  Therefore, if the config file is 'param = value' then the itializer
will eval "@param = value"

# File lib/rhc/vendor/parseconfig.rb, line 34
def initialize(config_file=nil)
  @config_file = config_file
  @params = {}
  @groups = []

  if(self.config_file)
    self.validate_config()
    self.import_config()
  end
end

Public Instance Methods

            [](param)
            click to toggle source

This method is a shortcut to accessing the @params variable

# File lib/rhc/vendor/parseconfig.rb, line 105
def [](param)
  return self.params[param]
end

            add(param_name, value)
            click to toggle source

This method adds an element to the config object (not the config file) By
adding a Hash, you create a new group

# File lib/rhc/vendor/parseconfig.rb, line 121
def add(param_name, value)
  if value.class == Hash
    if self.params.has_key?(param_name)
      if self.params[param_name].class == Hash
        self.params[param_name].merge!(value)
      elsif self.params.has_key?(param_name)
        if self.params[param_name].class != value.class
          raise ArgumentError, "#{param_name} already exists, and is of different type!"
        end
      end
    else
      self.params[param_name] = value
    end
    if ! self.groups.include?(param_name)
      self.groups.push(param_name)
    end
  else
    self.params[param_name] = value
  end
end

            add_to_group(group, param_name, value)
            click to toggle source

Add parameters to a group. Note that parameters with the same name could be
placed in different groups

# File lib/rhc/vendor/parseconfig.rb, line 144
def add_to_group(group, param_name, value)
  if ! self.groups.include?(group)
    self.add(group, {})
  end
  self.params[group][param_name] = value
end

            get_groups()
            click to toggle source

List available sub-groups of the config.

# File lib/rhc/vendor/parseconfig.rb, line 115
def get_groups()
  return self.groups
end

            get_params()
            click to toggle source

This method returns all parameters/groups defined in a config file.

# File lib/rhc/vendor/parseconfig.rb, line 110
def get_params()
  return self.params.keys
end

            get_value(param)
            click to toggle source

This method will provide the value held by the object "@param" where
"@param" is actually the name of the param in the config  file.

DEPRECATED - will be removed in future versions

# File lib/rhc/vendor/parseconfig.rb, line 98
def get_value(param)
  puts "ParseConfig Deprecation Warning: get_value() is deprecated. Use " +               "config['param'] or config['group']['param'] instead."
  return self.params[param]
end

            import_config()
            click to toggle source

Import data from the config to our config object.

# File lib/rhc/vendor/parseconfig.rb, line 55
def import_config()
  # The config is top down.. anything after a [group] gets added as part
  # of that group until a new [group] is found.
  group = nil
  File.open(self.config_file) { |f| f.each do |line|
    line.strip!
    unless (/^\#/.match(line))
      if(/\s*=\s*/.match(line))
        param, value = line.split(/\s*=\s*/, 2)
        var_name = "#{param}".chomp.strip
        value = value.chomp.strip
        new_value = ''
        if (value)
          if value =~ /^['"](.*)['"]$/
            new_value = $1
          else
            new_value = value
          end
        else
          new_value = ''
        end

        if group
          self.add_to_group(group, var_name, new_value)
        else
          self.add(var_name, new_value)
        end

      elsif(/^\[(.+)\]$/.match(line).to_a != [])
        group = /^\[(.+)\]$/.match(line).to_a[1]
        self.add(group, {})

      end
    end
  end }
end

            validate_config()
            click to toggle source

Validate the config file, and contents

# File lib/rhc/vendor/parseconfig.rb, line 46
def validate_config()
  if !File.readable?(self.config_file)
    raise Errno::EACCES, "#{self.config_file} is not readable"
  end

  # FIX ME: need to validate contents/structure?
end

            write(output_stream=STDOUT)
            click to toggle source

Writes out the config file to output_stream

# File lib/rhc/vendor/parseconfig.rb, line 152
def write(output_stream=STDOUT)
  self.params.each do |name,value|
    if value.class.to_s != 'Hash'
      if value.scan(/\w+/).length > 1
        output_stream.puts "#{name} = \"#{value}\""
      else
        output_stream.puts "#{name} = #{value}"
      end
    end
  end
  output_stream.puts "\n"

  self.groups.each do |group|
    output_stream.puts "[#{group}]"
    self.params[group].each do |param, value|
      if value.scan(/\w+/).length > 1
        output_stream.puts "#{param} = \"#{value}\""
      else
        output_stream.puts "#{param} = #{value}"
      end
    end
    output_stream.puts "\n"
  end
end

[Validate]

Generated with the Darkfish
      Rdoc Generator 2.


text:
package ctci;

import java.io.InputStreamReader;
import java.util.Scanner;

/*Implementation of Quick Sort*/
public class _34AlgoQuickSort{

	public static void main(String[] args) {
		Scanner scanner=new Scanner(new InputStreamReader(System.in));
		scanner.close();

	}
}


text:
package aries.reference.model;

import org.eclipse.emf.ecore.EModelElement;

/**
 *
 * A representation of the model object 'Gen Typed Element'.
 *
 *
 *
 * @see org.eclipse.emf.codegen.ecore.genmodel.GenModelPackage#getGenTypedElement()
 * @model abstract="true"
 * @generated
 */
public interface GenTypedElement extends GenBase
{
  EModelElement getEcoreModelElement();

  GenPackage getTypeGenPackage();
  String getTypeClassifierAccessorName();

  /**
   * @deprecated As of EMF 2.1, replaced by {@link #getTypeClassifierAccessorName}.
   */
  @Deprecated
  String getTypeClassifier();

  /**
   * @since 2.3
   */
  boolean hasGenericType();

  /**
   * @since 2.3
   */
  String getRawType();

  /**
   * This returns the feature type as for getRawType, except for the case that the type is a type parameter, in which case it returns the actual bounding type.
   * @since 2.3
   */
  String getRawBoundType();

  /**
   * This returns the feature type, either primitive (e.g. "int") or qualified class name (e.g. "java.lang.String", "org.eclipse.emf.common.util.EList", or "org.sample.company.Company")
   * @since 2.3
   */
  String getType(GenClass context);

  /**
   * Use {@link #getType(GenClass)} with either null for erasing type parameter references
   * or a {@link GenClass} context representing potential type substitutions for type parameter references.
   * By default, this will just do getType(getGenClass()).
   * @see #getType(GenClass)
   * @deprecated
   */
  @Deprecated
  String getType();

  /**
   * @since 2.3
   */
  String getRawImportedType();

  /**
   * This returns the feature type as for getRawImportedType, except for the case that the type is a type parameter, in which case it returns the actual bounding type.
   * @since 2.3
   */
  String getRawImportedBoundType();

  /**
   * This returns the feature type, either primitive (e.g. "int") or imported class name (e.g. "String", "EList", or "Company").
   * @since 2.3
   */
  String getImportedType(GenClass context);

  /**
   * Use {@link #getImportedType(GenClass)} with either null for erasing type parameter references
   * or a {@link GenClass} context representing potential type substitutions for type parameter references.
   * By default, this will just do getImportedType(getGenClass()).
   * @see #getImportedType(GenClass)
   * @deprecated
   */
  @Deprecated
  String getImportedType();

  /**
   * This returns the imported name of the feature type or, if primitive, of the wrapper class (e.g. "Integer").
   * @since 2.3
   */
  String getObjectType(GenClass context);

  /**
   * Use {@link #getObjectType(GenClass)} with either null for erasing type parameter references
   * or a {@link GenClass} context representing potential type substitutions for type parameter references.
   * By default, this will just do getObjectType(getGenClass()).
   * @see #getObjectType(GenClass)
   * @deprecated
   */
  @Deprecated
  String getObjectType();

  /**
   * This returns the real imported feature type used internally, regardless of the value of GenModel.isSuppressEMFValues().
   * @since 2.3
   */
  String getImportedInternalType(GenClass context);

  /**
   * Use {@link #getImportedInternalType(GenClass)} with either null for erasing type parameter references
   * or a {@link GenClass} context representing potential type substitutions for type parameter references.
   * By default, this will just do getImportedInternalType(getGenClass()).
   * @see #getImportedInternalType(GenClass)
   * @deprecated
   */
  @Deprecated
  String getImportedInternalType();

  boolean isFeatureMapType();
  boolean isWrappedFeatureMapType();

  /**
   * @deprecated As of EMF 2.1, replaced by {@link #isWrappedFeatureMapType}.
   */
  @Deprecated
  boolean isFeatureMapWrapped();

  boolean isEffectiveSuppressEMFTypes();

  String getImportedEffectiveFeatureMapWrapperInternalInterface();
  String getImportedEffectiveFeatureMapWrapperClass();

  boolean isListType();

  /**
   * @since 2.3
   */
  boolean isListDataType();

  /**
   * Returns either "" or the getListItemType surrounded by <>, depending on the effective compliance level.
   * @since 2.3
   */
  String getListTemplateArguments(GenClass context);

  /**
   * This returns the raw imported name of the feature type/wrapper class, or if a multi-valued feature, the type of the EList members.
   * @since 2.3
   */
  String getRawListItemType();

  /**
   * This returns the imported name of the feature type/wrapper class, or if a multi-valued feature, the type of the EList members
   * @since 2.3
   */
  String getListItemType(GenClass context);

  /**
   * Use {@link #getListItemType(GenClass)} with either null for erasing type parameter references
   * or a {@link GenClass} context representing potential type substitutions for type parameter references.
   * By default, this will just do getListItemType(getGenClass()).
   * @see #getListItemType(GenClass)
   * @deprecated
   */
  @Deprecated
  String getListItemType();

  /**
   * This returns the qualified name of the feature type/wrapper class, or if a multi-valued feature, the type of the EList members.
   * @since 2.3
   */
  String getQualifiedListItemType(GenClass context);

  /**
   * Use {@link #getQualifiedListItemType(GenClass)} with either null for erasing type parameter references
   * or a {@link GenClass} context representing potential type substitutions for type parameter references.
   * By default, this will just do getQualifiedListItemType(getGenClass()).
   * @see #getQualifiedListItemType(GenClass)
   * @deprecated
   */
  @Deprecated
  String getQualifiedListItemType();

  boolean isMapType();
  GenClass getMapEntryTypeGenClass();
  String getImportedMapEntryType();

  /**
   * @since 2.3
   */
  String getImportedMapKeyType(GenClass context);

  /**
   * @since 2.3
   */
  String getImportedMapValueType(GenClass context);

  /**
   * @since 2.3
   */
  String getImportedMapTemplateArguments(GenClass context);

  /**
   * @deprecated As of EMF 2.1, replaced by {@link #getMapEntryTypeGenClass}.
   */
  @Deprecated
  GenClass getMapGenClass();

  /**
   * @deprecated As of EMF 2.1, replaced by {@link #getImportedMapEntryType}.
   */
  @Deprecated
  String getMapItemType();

  /**
   * @since 2.3
   */
  boolean isUncheckedCast();

  /**
   * @since 2.4
   */
  boolean isUncheckedCast(GenClass context);

  /**
   * This returns either "(EObject)", "(org.eclipse.emf.ecore.EObject)", or "" as needed for the reference type.
   */
  String getEObjectCast();

  /**
   * This returns either "(EObject)", "(org.eclipse.emf.ecore.EObject)", or "" as needed for the reference type.
   */
  String getInternalTypeCast();

  /**
   * This returns either a cast to the internal type, or "" if it is EObject.
   * @since 2.3
   */
  String getNonEObjectInternalTypeCast(GenClass context);

  /**
   * Use {@link #getNonEObjectInternalTypeCast(GenClass)} with either null for erasing type parameter references
   * or a {@link GenClass} context representing potential type substitutions for type parameter references.
   * By default, this will just do getNonEObjectInternalTypeCast(getGenClass()).
   * @see #getNonEObjectInternalTypeCast(GenClass)
   * @deprecated
   */
  @Deprecated
  String getNonEObjectInternalTypeCast();

  /**
   * This returns that case to the actual type if it's different from the raw type.
   * @since 2.3
   */
  String getRawTypeCast();

  boolean isPrimitiveType();
  String getPrimitiveValueFunction();

  boolean isBooleanType();
  boolean isStringType();
  boolean isStringBasedType();

  boolean isEnumType();
  boolean isEnumBasedType();
  GenClass getTypeGenClass();
  GenClassifier getTypeGenClassifier();

  /**
   * @deprecated As of EMF 2.1, replaced by {@link #getTypeGenClass}.
   */
  @Deprecated
  GenClass getGenClassType();

  String getLowerBound();
  String getUpperBound();

  boolean isUnique();
  String getUniqueFlag();
  String getOrderedFlag();

} // GenTypedElement


text:
package com.code_embryo.android.ble.beacon.data;

import com.code_embryo.android.ble.beacon.record.BeaconRecord;

/**
 * UUIDと属性IDを保持するビーコンIDクラス.
 */
class BeaconId {
  private final Uuid uuid;
  private final AttributeId attributeId;

  /**
   * ビーコンID情報
   *
   * @param record ビーコンから取得したレコード情報
   */
  BeaconId(BeaconRecord record) {
    String id = makeUuid(record.uuid());
    this.uuid = new Uuid(id);
    this.attributeId = new AttributeId(record);
  }

  private String makeUuid(byte[] bytes) {
    StringBuilder sb = new StringBuilder();
    for (byte b : bytes) {
      sb.append(String.format("%02X", b));
    }

    return sb.toString();
  }

  /**
   * ビーコンのUUIDをString型で返す.
   *
   * @return String ビーコンのUUID
   */
  String uuid() {
    return uuid.value();
  }

  /**
   * Major番号をInteger型で返す.
   *
   * @return Integer Major番号
   */
  Integer major() {
    return attributeId.major();
  }

  /**
   * Minor番号をInteger型で返す.
   *
   * @return Integer Minor番号
   */
  Integer minor() {
    return attributeId.minor();
  }
}


text:
<?php

namespace App\Observers;

use App\Models\Merchant;
use App\Services\Hasher;

class MerchantObserver
{
    private $hasher;

    public function __construct(Hasher $hasher) {
        $this->hasher = $hasher;
    }

    /**
     * Listen to the Merchant created event.
     *
     * @param  Merchant  $merchant
     * @return void
     */
    public function created(Merchant $merchant)
    {
    }

    /**
     * Listen to the Merchant created event.
     *
     * @param  Merchant  $merchant
     * @return void
     */
    public function creating(Merchant $merchant)
    {
        $this->hasher->hashUserPassword($merchant);
    }
}


text:
<?php

namespace App\Service;

use Phalcon\Db\RawValue;
use Phalcony\Validator\Exception;
use User\Model\User;

/**
 * Class Auth
 * @package App\Service
 */
class Auth extends \Phalcon\Mvc\User\Component
{
    /**
     * Class property for cache getting of User
     *
     * @var User|bool|null
     */
    private $identity;

    /**
     * Get identity
     *
     * @return bool|User
     */
    public function getIdentity()
    {
        if (!is_null($this->identity)) {
            return $this->identity;
        }

        /**
         * @var $session \Phalcon\Session\Adapter
         */
        $session = $this->getDI()->get('session');
        if (!$session->isStarted()) {
            $session->start();
        }

        if ($session->get('id')) {
            /**
             * @todo check user after getting
             */
            return $this->identity = User::findFirst($session->get('id'));
        }

        return $this->identity = false;
    }

    /**
     * Register new user
     *
     * @param array $values
     * @return User
     * @throws Exception
     */
    public function registerUser(array $values = [])
    {
        $user = new User();
        $user->dateCreated = new RawValue('NOW()');
        $user->dateModified = new RawValue('NOW()');

        $user->publish = true;
        $user->deleted = false;

        $user->group_id = 1;

        $result = $user->save($values);
        if ($result === false) {
            throw new Exception(implode(', ', $user->getMessages()));
        }

        return $user;
    }

    /**
     * @param User $user
     */
    public function authByUser(\User\Model\User $user)
    {
        /**
         * @var $session \Phalcon\Session\Adapter
         */
        $session = $this->getDI()->get('session');
        if (!$session->isStarted()) {
            $session->start();
        }

        $session->set('id', $user->id);
    }

    /**
     * @param null|User $identity
     */
    public function setIdentity(\User\Model\User $identity = null)
    {
        $this->identity = $identity;
    }
}


text:
package com.five.bean;

public class SecUserRole {
    private Integer id;

    private Integer userId;

    private Integer roleId;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public Integer getRoleId() {
        return roleId;
    }

    public void setRoleId(Integer roleId) {
        this.roleId = roleId;
    }
}


text:
function hideBoxes(){
  $('#hide_this_stuff').addClass('hidden');
}

function showBoxes(){
  $('#hide_this_stuff').removeClass('hidden');
}

function showHidden() {
  if($("#survey_name").val().length > 0) {
    showBoxes();
  } else {
    hideBoxes();
  }
}

function setBehavior(){
  $("#survey_name").on("input", showHidden);
}

$(hideBoxes);
$(setBehavior);


text:
/**
 * @fileoverview A class to create a Nominatim autocomplete that will match
 * from an array of data provided via JSONP. The server returns a complex data
 * structure that is used with client-side javascript functions to render the
 * results.
 *
 * More info:
 * http://wiki.openstreetmap.org/wiki/Nominatim
 * http://open.mapquestapi.com/nominatim/
 *
 * @author petr.pridal@klokantech.com (Petr Pridal)
 */

goog.provide('klokantech.Nominatim');

goog.require('goog.ui.ac.AutoComplete');
goog.require('goog.ui.ac.InputHandler');
goog.require('goog.ui.ac.Renderer');

goog.require('klokantech.NominatimMatcher');

/**
 * Factory class to create a rich autocomplete widget that autocompletes an
 * inputbox or textarea from data provided via ajax.  The server returns a
 * complex data structure that is used with client-side javascript functions to
 * render the results.
 * @param {!Element} input Input element or text area.
 * @param {string=} opt_url The Uri of the Nominatim service.
 * @param {Object=} opt_payload Extra parameters for the Jsonp request.
 * @constructor
 * @extends {goog.ui.ac.AutoComplete}
 */
klokantech.Nominatim = function(input, opt_url, opt_payload) {
  // Create a custom renderer that renders rich rows returned from server.
  var customRenderer = {};
  customRenderer.renderRow = function(row, token, node) {
    node.innerHTML = row.data['formatted_address'] +
                     ' (' + row.data['type'] + ')';
    /* render:
    goog.dom.appendChild(node, goog.dom.createTextNode(
      row.data['formatted_address']));
    goog.dom.appendChild(node, goog.dom.createDom("span", "ac-type",
        goog.dom.createTextNode(row.data['type'])));
    */
  };

  /**
   * A standard renderer that uses a custom row renderer to display the
   * rich rows generated by this autocomplete widget.
   * @type {!goog.ui.ac.Renderer}
   */
  var renderer = new goog.ui.ac.Renderer(null, customRenderer);

  /**
   * A remote matcher that parses rich results returned via JSONP from a server.
   * @type {!klokantech.NominatimMatcher}
   * @protected
   * @suppress {underscore}
   */
  this.matcher_ = new klokantech.NominatimMatcher(opt_url, opt_payload);

  /**
   * An input handler that calls select on a row when it is selected.
   * @type {!goog.ui.ac.InputHandler}
   */
  var inputhandler = new goog.ui.ac.InputHandler(null, null, false);
  inputhandler.setThrottleTime(300);
  inputhandler.setUpdateDuringTyping(false);
  inputhandler.attachAutoComplete(this);
  inputhandler.attachInputs(input);

  // Create the widget and connect it to the input handler.
  goog.base(this, this.matcher_, renderer, inputhandler);

  this.addEventListener(goog.ui.ac.AutoComplete.EventType.UPDATE, function(e) {
    input.value = e.row['formatted_address'];
  });

};
goog.inherits(klokantech.Nominatim, goog.ui.ac.AutoComplete);

/**
 * Calls matchHandler on a set of matching rows retrieved from server.
 * @param {string} token The text that should be matched; passed to the server
 *     as the 'token' query param.
 * @param {number} maxMatches The maximum number of matches requested from the
 *     server; passed as the 'max_matches' query param.  The server is
 *     responsible for limiting the number of matches that are returned.
 * @param {Function} matchHandler Callback to execute on the result after
 *     matching.
 */
klokantech.Nominatim.prototype.search = function(token, maxMatches,
                                                 matchHandler) {
  this.matcher_.requestMatchingRows(token, maxMatches, matchHandler);
};


text: Phonegap + Framework 7 demo app


text:
module.exports = function(grunt){

  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),

    clean: ["build"],

    concat: {
      openlayers_js: {
        src: 'src/js/openlayers/*.js',
        dest: 'build/js/cybergis-client-openlayers.js'
      },
      openlayers_css: {
        src: 'src/css/openlayers/*.css',
        dest: 'build/css/cybergis-client-openlayers.css'
      },
      geoext_js: {
        src: 'src/js/geoext/*.js',
        dest: 'build/js/cybergis-client-geoext.js'
      },
      geoext_css: {
        src: 'src/css/geoext/*.css',
        dest: 'build/css/cybergis-client-geoext.css'
      }
    },
    copy: {
      core_js: {
        cwd: 'src/js/core/',
        src: '*.js',
        dest: 'build/js/',
        expand: true,
        flatten: true
      },
      core_css: {
        cwd: 'src/css/core/',
        src: '*.css',
        dest: 'build/css/',
        expand: true,
        flatten: true
      }
    },
    uglify: {
      options: {
        banner: '/*! <%= pkg.name %> <%= grunt.template.today("dd-mm-yyyy") %> */\n'
      },
      dist: {
        files: {
          'build/js/cybergis-client-openlayers.min.js': ['build/js/cybergis-client-openlayers.js'],
          'build/js/cybergis-client-geoext.min.js': ['build/js/cybergis-client-geoext.js']
        }
      }
    }
  });

  grunt.loadNpmTasks('grunt-contrib-clean');
  grunt.loadNpmTasks('grunt-contrib-concat');
  grunt.loadNpmTasks('grunt-contrib-copy');
  grunt.loadNpmTasks('grunt-contrib-uglify');
  //grunt.loadNpmTasks('grunt-contrib-jshint');
  //grunt.loadNpmTasks('grunt-contrib-watch');
  //grunt.registerTask('buildcss', ['cssc','cssmin','copy']);
  //grunt.registerTask('default', 'concat min cssmin');
  grunt.registerTask('default', ['clean', 'copy:core_js', 'copy:core_css', 'concat', 'uglify']);
};


text:
/**
 * @author Nikolay A. Kuznetsov
 */
package org.teavm.classlib.java.util.regex;

/**
 * Represents node accepting single character in unicode case
 * insensitive manner.
 *
 * @author Nikolay A. Kuznetsov
 */
class TUCICharSet extends TLeafSet {

    private char ch;

    public TUCICharSet(char ch) {
        this.ch = Character.toLowerCase(Character.toUpperCase(ch));
    }

    @Override
    public int accepts(int strIndex, CharSequence testString) {
        return (this.ch == Character.toLowerCase(Character.toUpperCase(testString.charAt(strIndex)))) ? 1 : -1;
    }

    @Override
    protected String getName() {
        return "UCI " + ch;
    }
}


text:
package main

import (
	"flag"
	"fmt"
	"os"
	"strconv"
	"time"

	"github.com/scionproto/scion/go/acceptance"
	"github.com/scionproto/scion/go/lib/integration"
	"github.com/scionproto/scion/go/lib/log"
)

var (
	name     = "sig_ping_acceptance"
	cmd      = "ping"
	attempts = flag.Int("attempts", 5, "Number of ping attempts.")
	fail     = flag.Bool("fail", false, "Succeed if the pings don't make it through.")
)

func main() {
	os.Exit(realMain())
}

func realMain() int {
	if err := integration.Init(); err != nil {
		fmt.Fprintf(os.Stderr, "Failed to init: %s\n", err)
		return 1
	}
	defer log.HandlePanic()
	defer log.Flush()
	if !*integration.Docker {
		log.Error(fmt.Sprintf("Can only run %s test with docker!", name))
		return 1
	}
	if err := acceptance.ReadTestingConf(); err != nil {
		log.Error("Testing conf reading failed", "err", err)
		return 1
	}
	args := []string{cmd, "-c", strconv.Itoa(*attempts), "-O", integration.DstHostReplace}
	in := integration.NewBinaryIntegration(name, integration.WrapperCmd, args, nil)
	err := integration.RunUnaryTests(in, integration.UniqueIAPairs(acceptance.SigAddr),
		time.Duration(*attempts)*2*time.Second+integration.DefaultRunTimeout, nil)
	if !*fail && err != nil {
		// The pings were supposed to get through but they didn't.
		fmt.Fprintf(os.Stderr, "Failed to run tests: %s\n", err)
		return 1

	}
	if *fail && err == nil {
		fmt.Fprintf(os.Stderr, "Failed to run tests: "+
			"Pings were supposed to not to reach the destination but they did.\n")
		return 1

	}
	return 0
}


text:
package com.linecorp.armeria.internal.common;

import static java.util.Objects.requireNonNull;

import java.util.AbstractMap.SimpleImmutableEntry;
import java.util.ArrayDeque;
import java.util.Map.Entry;
import java.util.Queue;

import com.linecorp.armeria.common.ClosedSessionException;
import com.linecorp.armeria.common.Flags;
import com.linecorp.armeria.common.HttpData;
import com.linecorp.armeria.common.HttpHeaders;
import com.linecorp.armeria.common.SessionProtocol;
import com.linecorp.armeria.common.stream.ClosedStreamException;

import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import io.netty.channel.Channel;
import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelFutureListener;
import io.netty.channel.ChannelPromise;
import io.netty.handler.codec.http.DefaultHttpContent;
import io.netty.handler.codec.http.DefaultLastHttpContent;
import io.netty.handler.codec.http.HttpContent;
import io.netty.handler.codec.http.HttpObject;
import io.netty.handler.codec.http.LastHttpContent;
import io.netty.handler.codec.http2.Http2Error;
import io.netty.util.ReferenceCountUtil;
import io.netty.util.collection.IntObjectHashMap;
import io.netty.util.collection.IntObjectMap;
import io.netty.util.concurrent.Future;
import io.netty.util.concurrent.FutureListener;

public abstract class Http1ObjectEncoder implements HttpObjectEncoder {

    /**
     * The maximum allowed length of an HTTP chunk when TLS is enabled.
     *

     *
16384 - The maximum length of a cleartext TLS record.

     *
6 - The maximum header length of an HTTP chunk. i.e. "4000\r\n".length()

     *
2 - The trailing "\r\n".

     *

     *
     *
To be precise, we have a chance of wasting 8 bytes because we may not use chunked encoding,
     * but it is not worth adding complexity to be that precise.
     *
     *
TODO(trustin): Remove this field as well as {@link #doWriteSplitData(int, HttpData, boolean)}
     *                   once https://github.com/netty/netty/issues/11792 is fixed.
     */
    private static final int MAX_TLS_DATA_LENGTH = 16384 - 8;

    /**
     * A non-last empty {@link HttpContent}.
     */
    private static final HttpContent EMPTY_CONTENT = new DefaultHttpContent(Unpooled.EMPTY_BUFFER);

    private final Channel ch;
    private final SessionProtocol protocol;

    private volatile boolean closed;

    /**
     * The ID of the request which is at its turn to send a response.
     */
    private int currentId = 1;

    /**
     * The minimum ID of the request whose stream has been closed/reset.
     */
    private int minClosedId = Integer.MAX_VALUE;

    /**
     * The maximum known ID with pending writes.
     */
    private int maxIdWithPendingWrites = Integer.MIN_VALUE;

    /**
     * The map which maps a request ID to its related pending response.
     */
    private final IntObjectMap<PendingWrites> pendingWritesMap = new IntObjectHashMap<>();

    protected Http1ObjectEncoder(Channel ch, SessionProtocol protocol) {
        this.ch = requireNonNull(ch, "ch");
        this.protocol = requireNonNull(protocol, "protocol");
    }

    @Override
    public final Channel channel() {
        return ch;
    }

    protected final ChannelFuture writeNonInformationalHeaders(
            int id, HttpObject converted, boolean endStream, ChannelPromise promise) {
        ChannelFuture f;
        if (converted instanceof LastHttpContent) {
            assert endStream;
            f = write(id, converted, true, promise);
        } else {
            f = write(id, converted, false, promise);
            if (endStream) {
                final ChannelFuture lastFuture = write(id, LastHttpContent.EMPTY_LAST_CONTENT, true);
                if (Flags.verboseExceptionSampler().isSampled(Http1VerboseWriteException.class)) {
                    f = combine(f, lastFuture);
                } else {
                    f = lastFuture;
                }
            }
        }
        ch.flush();
        return f;
    }

    private ChannelPromise combine(ChannelFuture first, ChannelFuture second) {
        final ChannelPromise promise = channel().newPromise();
        final FutureListener<Void> listener = new FutureListener<Void>() {
            private int remaining = 2;

            @Override
            public void operationComplete(Future<Void> ignore) throws Exception {
                remaining--;
                if (remaining == 0) {
                    final Throwable firstCause = first.cause();
                    final Throwable secondCause = second.cause();

                    Throwable combinedCause = null;
                    if (firstCause != null) {
                        combinedCause = firstCause;
                    }
                    if (secondCause != null) {
                        if (combinedCause == null) {
                            combinedCause = secondCause;
                        } else {
                            combinedCause.addSuppressed(secondCause);
                        }
                    }

                    if (combinedCause != null) {
                        promise.setFailure(combinedCause);
                    } else {
                        promise.setSuccess();
                    }
                }
            }
        };
        first.addListener(listener);
        second.addListener(listener);
        return promise;
    }

    @Override
    public final ChannelFuture doWriteData(int id, int streamId, HttpData data, boolean endStream) {
        if (!isWritable(id)) {
            data.close();
            return newClosedSessionFuture();
        }

        final int length = data.length();
        if (length == 0) {
            data.close();
            final HttpContent content = endStream ? LastHttpContent.EMPTY_LAST_CONTENT : EMPTY_CONTENT;
            final ChannelFuture future = write(id, content, endStream);
            ch.flush();
            return future;
        }

        try {
            if (!protocol.isTls() || length <= MAX_TLS_DATA_LENGTH) {
                // Cleartext connection or data.length() <= MAX_TLS_DATA_LENGTH
                return doWriteUnsplitData(id, data, endStream);
            } else {
                // TLS or data.length() > MAX_TLS_DATA_LENGTH
                return doWriteSplitData(id, data, endStream);
            }
        } catch (Throwable t) {
            return newFailedFuture(t);
        }
    }

    private ChannelFuture doWriteUnsplitData(int id, HttpData data, boolean endStream) {
        final ByteBuf buf = toByteBuf(data);
        boolean handled = false;
        try {
            final HttpContent content;
            if (endStream) {
                content = new DefaultLastHttpContent(buf);
            } else {
                content = new DefaultHttpContent(buf);
            }

            final ChannelFuture future = write(id, content, endStream);
            handled = true;
            ch.flush();
            return future;
        } finally {
            if (!handled) {
                buf.release();
            }
        }
    }

    private ChannelFuture doWriteSplitData(int id, HttpData data, boolean endStream) {
        try {
            int offset = 0;
            int remaining = data.length();
            ChannelFuture lastFuture;
            for (;;) {
                // Ensure an HttpContent does not exceed the maximum length of a cleartext TLS record.
                final int chunkSize = Math.min(MAX_TLS_DATA_LENGTH, remaining);
                lastFuture = write(id, new DefaultHttpContent(toByteBuf(data, offset, chunkSize)), false);
                remaining -= chunkSize;
                if (remaining == 0) {
                    break;
                }
                offset += chunkSize;
            }

            if (endStream) {
                lastFuture = write(id, LastHttpContent.EMPTY_LAST_CONTENT, true);
            }

            ch.flush();
            return lastFuture;
        } finally {
            data.close();
        }
    }

    protected final ChannelFuture write(int id, HttpObject obj, boolean endStream) {
        return write(id, obj, endStream, ch.newPromise());
    }

    final ChannelFuture write(int id, HttpObject obj, boolean endStream, ChannelPromise promise) {
        if (id < currentId) {
            // Attempted to write something on a finished request/response; discard.
            // e.g. the request already timed out.
            ReferenceCountUtil.release(obj);
            promise.setFailure(ClosedStreamException.get());
            return promise;
        }

        final PendingWrites currentPendingWrites = pendingWritesMap.get(id);
        if (id == currentId) {
            if (currentPendingWrites != null) {
                pendingWritesMap.remove(id);
                flushPendingWrites(currentPendingWrites);
            }

            final ChannelFuture future = ch.write(obj, promise);
            if (!isPing(id)) {
                keepAliveHandler().onReadOrWrite();
            }
            if (endStream) {
                currentId++;

                // The next PendingWrites might be complete already.
                for (;;) {
                    final PendingWrites nextPendingWrites = pendingWritesMap.get(currentId);
                    if (nextPendingWrites == null) {
                        break;
                    }

                    flushPendingWrites(nextPendingWrites);
                    if (!nextPendingWrites.isEndOfStream()) {
                        break;
                    }

                    pendingWritesMap.remove(currentId);
                    currentId++;
                }
            }

            return future;
        } else {
            final Entry<HttpObject, ChannelPromise> entry = new SimpleImmutableEntry<>(obj, promise);
            final PendingWrites pendingWrites;
            if (currentPendingWrites == null) {
                pendingWrites = new PendingWrites();
                maxIdWithPendingWrites = Math.max(maxIdWithPendingWrites, id);
                pendingWritesMap.put(id, pendingWrites);
            } else {
                pendingWrites = currentPendingWrites;
            }

            pendingWrites.add(entry);

            if (endStream) {
                pendingWrites.setEndOfStream();
            }

            return promise;
        }
    }

    private void flushPendingWrites(PendingWrites pendingWrites) {
        for (;;) {
            final Entry<HttpObject, ChannelPromise> e = pendingWrites.poll();
            if (e == null) {
                break;
            }

            ch.write(e.getKey(), e.getValue());
        }
    }

    @Override
    public final ChannelFuture doWriteTrailers(int id, int streamId, HttpHeaders headers) {
        if (!isWritable(id)) {
            return newClosedSessionFuture();
        }

        return write(id, convertTrailers(headers), true);
    }

    private LastHttpContent convertTrailers(HttpHeaders inputHeaders) {
        if (inputHeaders.isEmpty()) {
            return LastHttpContent.EMPTY_LAST_CONTENT;
        }

        final LastHttpContent lastContent = new DefaultLastHttpContent(Unpooled.EMPTY_BUFFER, false);
        final io.netty.handler.codec.http.HttpHeaders outputHeaders = lastContent.trailingHeaders();
        convertTrailers(inputHeaders, outputHeaders);
        return lastContent;
    }

    protected abstract void convertTrailers(HttpHeaders inputHeaders,
                                            io.netty.handler.codec.http.HttpHeaders outputHeaders);

    @Override
    public final ChannelFuture doWriteReset(int id, int streamId, Http2Error error) {
        // NB: this.minClosedId can be overwritten more than once when 3+ pipelined requests are received
        //     and they are handled by different threads simultaneously.
        //     e.g. when the 3rd request triggers a reset and then the 2nd one triggers another.
        updateClosedId(id);

        if (minClosedId <= maxIdWithPendingWrites) {
            final ClosedSessionException cause =
                    new ClosedSessionException("An HTTP/1 stream has been reset: " + error);
            for (int i = minClosedId; i <= maxIdWithPendingWrites; i++) {
                final PendingWrites pendingWrites = pendingWritesMap.remove(i);
                for (;;) {
                    final Entry<HttpObject, ChannelPromise> e = pendingWrites.poll();
                    if (e == null) {
                        break;
                    }

                    e.getValue().tryFailure(cause);
                }
            }
        }

        final ChannelFuture f = ch.write(Unpooled.EMPTY_BUFFER);
        if (!isWritable(currentId)) {
            f.addListener(ChannelFutureListener.CLOSE);
        }

        return f;
    }

    @Override
    public final boolean isWritable(int id, int streamId) {
        return isWritable(id);
    }

    protected final boolean isWritable(int id) {
        return id < minClosedId;
    }

    protected final void updateClosedId(int id) {
        minClosedId = Math.min(minClosedId, id);
    }

    protected abstract boolean isPing(int id);

    @Override
    public final void close() {
        if (closed) {
            return;
        }
        closed = true;

        keepAliveHandler().destroy();
        if (pendingWritesMap.isEmpty()) {
            return;
        }

        final ClosedSessionException cause = ClosedSessionException.get();
        for (Queue<Entry<HttpObject, ChannelPromise>> queue : pendingWritesMap.values()) {
            for (;;) {
                final Entry<HttpObject, ChannelPromise> e = queue.poll();
                if (e == null) {
                    break;
                }

                e.getValue().tryFailure(cause);
            }
        }

        pendingWritesMap.clear();
    }

    @Override
    public final boolean isClosed() {
        return closed;
    }

    private static final class PendingWrites extends ArrayDeque<Entry<HttpObject, ChannelPromise>> {

        private static final long serialVersionUID = 4241891747461017445L;

        private boolean endOfStream;

        PendingWrites() {
            super(4);
        }

        @Override
        public boolean add(Entry<HttpObject, ChannelPromise> httpObjectChannelPromiseEntry) {
            return isEndOfStream() ? false : super.add(httpObjectChannelPromiseEntry);
        }

        boolean isEndOfStream() {
            return endOfStream;
        }

        void setEndOfStream() {
            endOfStream = true;
        }
    }

    protected final SessionProtocol protocol() {
        return protocol;
    }

    /**
     * A dummy {@link Exception} to sample write exceptions.
     */
    @SuppressWarnings("serial")
    private static final class Http1VerboseWriteException extends Exception {
       private Http1VerboseWriteException() {
           // Only the class type is used for sampling.
           throw new UnsupportedOperationException();
       }
    }
}


text:
// Copyright 2009 the Sputnik authors.  All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/**
* @name: S15.10.7.5_A9;
* @section: 15.10.7.5;
* @assertion: The RegExp instance lastIndex property has the attribute DontDelete;
* @description: Checking if deleting the lastIndex property fails;
*/

__re = new RegExp;

//CHECK#0
if (__re.hasOwnProperty('lastIndex') !== true) {
  $FAIL('#0: __re = new RegExp; __re.hasOwnProperty(\'lastIndex\') === true');
}

//CHECK#1
if ((delete __re.lastIndex) !== false) {
  $ERROR('#1: __re = new RegExp; (delete __re.lastIndex) === false');
}

//CHECK#2
if (__re.hasOwnProperty('lastIndex') !== true) {
  $ERROR('#2: __re = new RegExp;delete __re.lastIndex === true; __re.hasOwnProperty(\'lastIndex\') === true');
}


text:
namespace ViewTonic
{
    using System;
    using System.Threading;

    internal static class ViewTonicGuardExtensions
    {
        public static void Negative(this Guard guard, Func<long> expression)
        {
            var value = expression();
            if (value < 0)
            {
                throw new ArgumentOutOfRangeException(Guard.Expression.Parse(expression), value, "Value has to be positive.");
            }
        }

        public static void NegativeTimeout(this Guard guard, Func<int> expression)
        {
            var value = expression();
            if (value != Timeout.Infinite && value < 0)
            {
                throw new ArgumentOutOfRangeException(Guard.Expression.Parse(expression), value, "Value has to be positive.");
            }
        }
    }
}


text:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="fm.jiecao.jcvideoplayer_lib">

    <application
        android:allowBackup="true"
        android:label="@string/app_name"
        android:supportsRtl="true">
        <activity
            android:name=".FullScreenActivity"
            android:configChanges="orientation|keyboardHidden"
            android:screenOrientation="landscape" />
    </application>

</manifest>


text:
package com.surgeon.weaving.core.interfaces;

/**
 * If MasterFinder#findAndInvoke return Continue.class,Then continue to call original function.
 */
public interface Continue {
}


text:
package exec

import "os"

type errorReporter struct {
	Step

	ReportFailure func(error)
}

func (reporter errorReporter) Run(signals <-chan os.Signal, ready chan<- struct{}) error {
	err := reporter.Step.Run(signals, ready)
	if err != nil {
		reporter.ReportFailure(err)
	}

	return err
}


text:
class Obstracle : public MoveableElement {
private:
	int mEatCount = 0;
public:
	Obstracle(GamefieldPtr mGamefield, uint32_t mId, const Vector& mPosition);

	virtual bool tryEat(ElementPtr other);

	virtual ElementType getType() const { return ET_Obstracle; }

};

#endif //AGARIO_OBSTRACLE_H


text:
package com.google.template.soy.jbcsrc;

import static com.google.common.base.Preconditions.checkState;
import static com.google.common.base.Strings.nullToEmpty;
import static com.google.common.collect.ImmutableSet.toImmutableSet;
import static com.google.template.soy.soytree.SoyTreeUtils.allNodesOfType;
import static java.util.stream.Collectors.toList;

import com.google.auto.value.AutoAnnotation;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Sets;
import com.google.template.soy.data.SanitizedContent.ContentKind;
import com.google.template.soy.data.internal.Converters;
import com.google.template.soy.exprtree.AbstractLocalVarDefn;
import com.google.template.soy.exprtree.ExprRootNode;
import com.google.template.soy.exprtree.TemplateLiteralNode;
import com.google.template.soy.exprtree.VarDefn.Kind;
import com.google.template.soy.exprtree.VarRefNode;
import com.google.template.soy.jbcsrc.ExpressionCompiler.BasicExpressionCompiler;
import com.google.template.soy.jbcsrc.SoyNodeCompiler.CompiledMethodBody;
import com.google.template.soy.jbcsrc.internal.InnerClasses;
import com.google.template.soy.jbcsrc.internal.SoyClassWriter;
import com.google.template.soy.jbcsrc.restricted.AnnotationRef;
import com.google.template.soy.jbcsrc.restricted.BytecodeUtils;
import com.google.template.soy.jbcsrc.restricted.CodeBuilder;
import com.google.template.soy.jbcsrc.restricted.Expression;
import com.google.template.soy.jbcsrc.restricted.FieldRef;
import com.google.template.soy.jbcsrc.restricted.LocalVariable;
import com.google.template.soy.jbcsrc.restricted.MethodRef;
import com.google.template.soy.jbcsrc.restricted.SoyExpression;
import com.google.template.soy.jbcsrc.restricted.SoyRuntimeType;
import com.google.template.soy.jbcsrc.restricted.Statement;
import com.google.template.soy.jbcsrc.shared.CompiledTemplate;
import com.google.template.soy.jbcsrc.shared.RecordToPositionalCallFactory;
import com.google.template.soy.jbcsrc.shared.TemplateMetadata;
import com.google.template.soy.soytree.CallDelegateNode;
import com.google.template.soy.soytree.CallParamContentNode;
import com.google.template.soy.soytree.CallParamValueNode;
import com.google.template.soy.soytree.LetContentNode;
import com.google.template.soy.soytree.LetValueNode;
import com.google.template.soy.soytree.PartialFileSetMetadata;
import com.google.template.soy.soytree.SoyNode;
import com.google.template.soy.soytree.TemplateBasicNode;
import com.google.template.soy.soytree.TemplateDelegateNode;
import com.google.template.soy.soytree.TemplateNode;
import com.google.template.soy.soytree.Visibility;
import com.google.template.soy.soytree.defn.TemplateHeaderVarDefn;
import com.google.template.soy.soytree.defn.TemplateParam;
import com.google.template.soy.types.NullType;
import com.google.template.soy.types.TemplateType;
import java.lang.invoke.LambdaMetafactory;
import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.MethodType;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import java.util.Set;
import java.util.stream.Stream;
import javax.annotation.Nullable;
import org.objectweb.asm.Handle;
import org.objectweb.asm.Label;
import org.objectweb.asm.Opcodes;
import org.objectweb.asm.Type;
import org.objectweb.asm.commons.Method;

/**
 * Compiles the top level {@link CompiledTemplate} class for a single template and all related
 * classes.
 */
final class TemplateCompiler {
  private static final AnnotationRef<TemplateMetadata> TEMPLATE_METADATA_REF =
      AnnotationRef.forType(TemplateMetadata.class);

  public static final String VARIANT_VAR_NAME = "__modifiable_variant__";

  private final FieldManager fields;
  private final CompiledTemplateMetadata template;
  private final TemplateNode templateNode;
  private final InnerClasses innerClasses;
  private final SoyClassWriter writer;
  private final TemplateAnalysis analysis;
  private final JavaSourceFunctionCompiler javaSourceFunctionCompiler;
  private final PartialFileSetMetadata fileSetMetadata;

  TemplateCompiler(
      TemplateNode templateNode,
      SoyClassWriter writer,
      FieldManager fields,
      InnerClasses innerClasses,
      JavaSourceFunctionCompiler javaSourceFunctionCompiler,
      PartialFileSetMetadata fileSetMetadata) {
    this.template = CompiledTemplateMetadata.create(templateNode);
    this.templateNode = templateNode;
    this.writer = writer;
    this.fields = fields;
    this.innerClasses = innerClasses;
    this.analysis = TemplateAnalysisImpl.analyze(templateNode);
    this.javaSourceFunctionCompiler = javaSourceFunctionCompiler;
    this.fileSetMetadata = fileSetMetadata;
  }

  /**
   * Returns the list of classes needed to implement this template.
   *
   *
For each template, we generate:
   *
   *

   *
A {@link CompiledTemplate}
   *
A DetachableSoyValueProvider subclass for each {@link LetValueNode} and {@link
   *       CallParamValueNode}
   *
A DetachableContentProvider subclass for each {@link LetContentNode} and {@link
   *       CallParamContentNode}
   *
Note: This will not generate classes for other templates, only the template
   *       configured in the constructor. But it will generate classes that reference the
   *       classes that are generated for other templates. It is the callers responsibility to
   *       ensure that all referenced templates are generated and available in the classloader that
   *       ultimately loads the returned classes.
   */
  void compile() {

    // TODO(lukes): change the flow of this method so these methods return method bodies and we only
    // write the methods to the writer after generating everything.
    // this should make the order of operations clearer and limit access to the writer.

    if (template.defaultModTemplateMethod().isPresent()) {
      generateTemplateMethod(template.templateMethod(), template.modifiableSelectMethod().get());
      generateTemplateMethod(template.defaultModTemplateMethod().get(), template.renderMethod());
    } else {
      generateTemplateMethod(template.templateMethod(), template.renderMethod());
    }
    generateDelegateRenderMethod();
    generateRenderMethod();
    generateModifiableSelectMethod();
  }

  private static final Handle METAFACTORY_HANDLE =
      MethodRef.create(
              LambdaMetafactory.class,
              "metafactory",
              MethodHandles.Lookup.class,
              String.class,
              MethodType.class,
              MethodType.class,
              MethodHandle.class,
              MethodType.class)
          .asHandle();

  private static final Handle DELEGATE_FACTORY_HANDLE =
      MethodRef.create(
              RecordToPositionalCallFactory.class,
              "bootstrapDelegate",
              MethodHandles.Lookup.class,
              String.class,
              MethodType.class,
              MethodHandle.class,
              String[].class)
          .asHandle();

  private static final String COMPILED_TEMPLATE_INIT_DESCRIPTOR =
      Type.getMethodDescriptor(BytecodeUtils.COMPILED_TEMPLATE_TYPE);

  private static final Type COMPILED_TEMPLATE_RENDER_DESCRIPTOR =
      Type.getMethodType(
          BytecodeUtils.RENDER_RESULT_TYPE,
          BytecodeUtils.SOY_RECORD_TYPE,
          BytecodeUtils.SOY_RECORD_TYPE,
          BytecodeUtils.LOGGING_ADVISING_APPENDABLE_TYPE,
          BytecodeUtils.RENDER_CONTEXT_TYPE);

  /** Write the function "templateMethod", which returns a reference to "renderMethod". */
  private void generateTemplateMethod(MethodRef templateMethod, MethodRef renderMethod) {
    // use invoke dynamic to lazily allocate the template instance.
    // templates are needed for direct java->soy calls, references to template literals and
    // deltemplates, which
    // should mean that the vast majority are not needed.  We can generate a simple factory() method
    // that uses invoke dynamic to generate a factory instance as needed.  This should be just as
    // fast as our previous approach of generating an explicit factory subclass while requiring much
    // less bytecode, since most factory instances are not needed.
    // The code here is identical to:
    // public static CompiledTemplate template() {
    //  return foo::render;
    // }
    // assuming foo is the name of the template class.
    Statement methodBody =
        Statement.returnExpression(
            new Expression(BytecodeUtils.COMPILED_TEMPLATE_TYPE) {
              @Override
              protected void doGen(CodeBuilder cb) {
                cb.visitInvokeDynamicInsn(
                    "render",
                    COMPILED_TEMPLATE_INIT_DESCRIPTOR,
                    METAFACTORY_HANDLE,
                    COMPILED_TEMPLATE_RENDER_DESCRIPTOR,
                    renderMethod.asHandle(),
                    COMPILED_TEMPLATE_RENDER_DESCRIPTOR);
              }
            });
    CodeBuilder methodWriter =
        new CodeBuilder(methodAccess(), templateMethod.method(), /* exceptions=*/ null, writer);
    generateTemplateMetadata(methodWriter);
    methodBody.writeMethodTo(methodWriter);
  }

  private boolean isModifyingTemplate() {
    return templateNode instanceof TemplateBasicNode
        && ((TemplateBasicNode) templateNode).getModifiesExpr() != null;
  }

  private int methodAccess() {
    // TODO(lukes): private templates need to have default access so they can be called by our
    // generated inner classes (e.g. a let).  Once jdk11 has landed we could workaround by declaring
    // our inner classes as 'nestmates' see https://openjdk.java.net/jeps/181
    return (templateNode.getVisibility() == Visibility.PUBLIC || isModifyingTemplate()
            ? Opcodes.ACC_PUBLIC
            : 0)
        | Opcodes.ACC_STATIC;
  }

  /** Writes a {@link TemplateMetadata} to the generated {@code template()} method. */
  private void generateTemplateMetadata(CodeBuilder builder) {
    ContentKind kind =
        Converters.contentKindfromSanitizedContentKind(templateNode.getContentKind());

    // using linked hash sets below for determinism
    Set<String> uniqueIjs =
        allNodesOfType(templateNode, VarRefNode.class)
            .filter(VarRefNode::isInjected)
            .map(VarRefNode::getNameWithoutLeadingDollar)
            .collect(toImmutableSet());

    Set<String> callees =
        allNodesOfType(templateNode, TemplateLiteralNode.class)
            .map(TemplateLiteralNode::getResolvedName)
            .collect(toImmutableSet());

    ImmutableSet<String> delCallees =
        ImmutableSet.<String>builder()
            .addAll(
                allNodesOfType(templateNode, CallDelegateNode.class)
                    .map(CallDelegateNode::getDelCalleeName)
                    .collect(toImmutableSet()))
            .addAll(
                allNodesOfType(templateNode, TemplateLiteralNode.class)
                    .filter(literal -> ((TemplateType) literal.getType()).isModifiable())
                    .map(TemplateCompiler::legacyOrModifiableName)
                    .collect(toImmutableSet()))
            .build();

    TemplateMetadata.DelTemplateMetadata deltemplateMetadata;
    if (templateNode.getKind() == SoyNode.Kind.TEMPLATE_DELEGATE_NODE) {
      TemplateDelegateNode delegateNode = (TemplateDelegateNode) templateNode;
      deltemplateMetadata =
          createDelTemplateMetadata(
              nullToEmpty(delegateNode.getModName()),
              delegateNode.getDelTemplateName(),
              delegateNode.getDelTemplateVariant());
    } else if (templateNode instanceof TemplateBasicNode) {
      deltemplateMetadata = metadataForBasicNode((TemplateBasicNode) templateNode);
    } else {
      deltemplateMetadata = createDefaultDelTemplateMetadata();
    }
    Set<String> namespaces = Sets.newLinkedHashSet();
    // This ordering is critical to preserve css hierarchy.
    namespaces.addAll(templateNode.getParent().getRequiredCssNamespaces());
    templateNode.getParent().getRequiredCssPaths().stream()
        .map(p -> p.getNamespace())
        .filter(p -> p != null)
        .forEach(namespaces::add);
    namespaces.addAll(templateNode.getRequiredCssNamespaces());

    // Require paths.
    Set<String> cssPaths = Sets.newLinkedHashSet();
    templateNode.getParent().getRequiredCssPaths().stream()
        // Temporary, to avoid double requesting w/ the above.
        .filter(p -> p.getNamespace() == null)
        .filter(p -> p.resolvedPath().isPresent())
        .forEach(p -> cssPaths.add(p.resolvedPath().get()));

    TemplateMetadata metadata =
        createTemplateMetadata(
            kind, namespaces, cssPaths, uniqueIjs, callees, delCallees, deltemplateMetadata);
    TEMPLATE_METADATA_REF.write(metadata, builder);
  }

  static String legacyOrModifiableName(TemplateLiteralNode node) {
    TemplateType templateType = (TemplateType) node.getType();
    return !templateType.getLegacyDeltemplateNamespace().isEmpty()
        ? templateType.getLegacyDeltemplateNamespace()
        : node.getResolvedName();
  }

  TemplateMetadata.DelTemplateMetadata metadataForBasicNode(TemplateBasicNode templateBasicNode) {
    if (templateBasicNode.isModifiable()) {
      return createDelTemplateMetadata(
          nullToEmpty(templateBasicNode.getModName()),
          modifiableImplsMapKey(templateBasicNode),
          templateBasicNode.getDelTemplateVariant());
    } else if (templateBasicNode.getModifiesExpr() != null) {
      return createDelTemplateMetadata(
          nullToEmpty(templateBasicNode.getModName()),
          legacyOrModifiableName(
              (TemplateLiteralNode) templateBasicNode.getModifiesExpr().getRoot()),
          templateBasicNode.getDelTemplateVariant());
    }
    return createDefaultDelTemplateMetadata();
  }

  private static final String modifiableImplsMapKey(TemplateBasicNode templateBasicNode) {
    return !templateBasicNode.getLegacyDeltemplateNamespace().isEmpty()
        ? templateBasicNode.getLegacyDeltemplateNamespace()
        : templateBasicNode.getTemplateName();
  }

  @AutoAnnotation
  static TemplateMetadata createTemplateMetadata(
      ContentKind contentKind,
      Set<String> requiredCssNames,
      Set<String> requiredCssPaths,
      Set<String> injectedParams,
      Set<String> callees,
      Set<String> delCallees,
      TemplateMetadata.DelTemplateMetadata deltemplateMetadata) {
    return new AutoAnnotation_TemplateCompiler_createTemplateMetadata(
        contentKind,
        requiredCssNames,
        requiredCssPaths,
        injectedParams,
        callees,
        delCallees,
        deltemplateMetadata);
  }

  @AutoAnnotation
  static TemplateMetadata.DelTemplateMetadata createDefaultDelTemplateMetadata() {
    return new AutoAnnotation_TemplateCompiler_createDefaultDelTemplateMetadata();
  }

  @AutoAnnotation
  static TemplateMetadata.DelTemplateMetadata createDelTemplateMetadata(
      String modName, String name, String variant) {
    return new AutoAnnotation_TemplateCompiler_createDelTemplateMetadata(modName, name, variant);
  }

  /**
   * Generate a static method that has the same signature as CompiledTemplate.render if we are
   * generating a render method with a positional signature.
   *
   *
Generally this method will be rarely called, it will only be used if
   *
   *

   *
This template is used as a template literal
   *
This template is called directly by {@code SoySauceImpl}
   *
This template is called with a {@code data=...} expression
   *

   *
   * The first two are generally rare and will not likely become common and the latter is
   * increasingly discouraged. So ideally, we would not generate these methods. Some possible ideas
   *
   *

   *
use {@code invokedynamic} to fully construct {@code CompiledTemplate} classes. Then we
   *       could avoid the {@code template()} and {@code render()} methods completely. This is a bit
   *       complex but would likely be a code size win.
   *
Switch some of these usecases to use the {@code MethodHandle} API directly. This may or
   *       may not actually work (I am not sure if it is safe to pass method handles around).
   *

   */
  private void generateDelegateRenderMethod() {
    if (!template.hasPositionalSignature()) {
      return;
    }
    Handle renderHandle = template.positionalRenderMethod().get().asHandle();
    Statement.returnExpression(
            new Expression(BytecodeUtils.COMPILED_TEMPLATE_TYPE) {
              @Override
              protected void doGen(CodeBuilder cb) {
                cb.loadArgs();
                cb.visitInvokeDynamicInsn(
                    "delegate",
                    COMPILED_TEMPLATE_RENDER_DESCRIPTOR.getDescriptor(),
                    DELEGATE_FACTORY_HANDLE,
                    Stream.concat(
                            Stream.of(renderHandle),
                            template.templateType().getActualParameters().stream()
                                .map(TemplateType.Parameter::getName))
                        .toArray(Object[]::new));
              }
            })
        .writeMethod(methodAccess(), template.renderMethod().method(), writer);
  }

  private void generateRenderMethod() {
    BasicExpressionCompiler constantCompiler =
        ExpressionCompiler.createConstantCompiler(
            templateNode,
            analysis,
            new SimpleLocalVariableManager(
                template.typeInfo().type(), BytecodeUtils.CLASS_INIT, /* isStatic=*/ true),
            javaSourceFunctionCompiler,
            fileSetMetadata);
    final Label start = new Label();
    final Label end = new Label();
    ImmutableList.Builder<String> paramNames = ImmutableList.builder();
    if (template.hasPositionalSignature()) {
      paramNames.addAll(
          template.templateType().getActualParameters().stream()
              .map(p -> p.getName())
              .collect(toList()));
    } else {
      paramNames.add(StandardNames.PARAMS);
    }
    paramNames.add(StandardNames.IJ);
    paramNames.add(StandardNames.APPENDABLE);
    paramNames.add(StandardNames.RENDER_CONTEXT);
    Method method = template.positionalRenderMethod().orElse(template.renderMethod()).method();
    final TemplateVariableManager variableSet =
        new TemplateVariableManager(
            template.typeInfo().type(), method, paramNames.build(), start, end, /*isStatic=*/ true);
    Optional<Expression> paramsVar =
        template.hasPositionalSignature()
            ? Optional.empty()
            : Optional.of(variableSet.getVariable(StandardNames.PARAMS));
    Expression ijVar = variableSet.getVariable(StandardNames.IJ);
    TemplateVariables variables =
        new TemplateVariables(
            variableSet,
            paramsVar,
            ijVar,
            new RenderContextExpression(variableSet.getVariable(StandardNames.RENDER_CONTEXT)));
    AppendableExpression appendable =
        AppendableExpression.forExpression(
            variableSet.getVariable(StandardNames.APPENDABLE).asNonNullable());
    SoyNodeCompiler nodeCompiler =
        SoyNodeCompiler.create(
            templateNode,
            analysis,
            innerClasses,
            appendable,
            variableSet,
            variables,
            fields,
            constantCompiler,
            javaSourceFunctionCompiler,
            fileSetMetadata);
    // Allocate local variables for all declared parameters.
    // NOTE: we initialize the parameters prior to where the jump table is initialized, this means
    // that all variables will be re-initialized ever time we re-enter the template.
    // TODO(lukes): move into SoyNodeCompiler.compile?  The fact that we construct SoyNodeCompiler
    // and then pull stuff out of it to initialize params is awkward
    TemplateVariableManager.Scope templateScope = variableSet.enterScope();
    List<Statement> paramInitStatements = new ArrayList<>();
    for (TemplateParam param : templateNode.getAllParams()) {
      SoyExpression defaultValue =
          param.hasDefault()
              ? getDefaultValue(param, nodeCompiler.exprCompiler, constantCompiler)
              : null;
      Expression initialValue;
      LocalVariable localVariable;
      if (param.isInjected()) {
        initialValue = getFieldProviderOrDefault(param.name(), ijVar, defaultValue);
        localVariable = templateScope.createNamedLocal(param.name(), initialValue.resultType());
        paramInitStatements.add(
            localVariable.store(initialValue).labelStart(localVariable.start()));
      } else if (paramsVar.isPresent()) {
        initialValue = getFieldProviderOrDefault(param.name(), paramsVar.get(), defaultValue);
        localVariable = templateScope.createNamedLocal(param.name(), initialValue.resultType());
        paramInitStatements.add(
            localVariable.store(initialValue).labelStart(localVariable.start()));
      } else {
        localVariable = (LocalVariable) variableSet.getVariable(param.name());
        paramInitStatements.add(
            localVariable.store(
                defaultValue == null
                    ? MethodRef.RUNTIME_PARAM.invoke(localVariable)
                    : MethodRef.RUNTIME_PARAM_OR_DEFAULT.invoke(
                        localVariable, defaultValue.box())));
      }
    }
    final CompiledMethodBody methodBody =
        SoyNodeCompiler.create(
                templateNode,
                analysis,
                innerClasses,
                appendable,
                variableSet,
                variables,
                fields,
                constantCompiler,
                javaSourceFunctionCompiler,
                fileSetMetadata)
            .compile(
                templateNode,
                /* prefix= */ ExtraCodeCompiler.NO_OP,
                /* suffix= */ ExtraCodeCompiler.NO_OP);
    final Statement exitTemplateScope = templateScope.exitScope();
    final Statement returnDone = Statement.returnExpression(MethodRef.RENDER_RESULT_DONE.invoke());
    new Statement() {
      @Override
      protected void doGen(CodeBuilder adapter) {
        adapter.mark(start);
        for (Statement paramInitStatement : paramInitStatements) {
          paramInitStatement.gen(adapter);
        }
        methodBody.body().gen(adapter);
        exitTemplateScope.gen(adapter);
        adapter.mark(end);
        returnDone.gen(adapter);

        variableSet.generateTableEntries(adapter);
      }
    }.writeIOExceptionMethod(methodAccess(), method, writer);
    writer.setNumDetachStates(methodBody.numberOfDetachStates());
  }

  // TODO(lukes): it seems like this should actually compile params to SoyValueProvider instances
  private SoyExpression getDefaultValue(
      TemplateHeaderVarDefn headerVar,
      ExpressionCompiler expressionCompiler,
      BasicExpressionCompiler constantCompiler) {
    ExprRootNode defaultValueNode = headerVar.defaultValue();
    if (defaultValueNode.getType() == NullType.getInstance()) {
      // a special case for null to avoid poor handling elsewhere in the compiler.
      // TODO(lukes): should this just 'return null'?
      return SoyExpression.forSoyValue(
          headerVar.type(),
          BytecodeUtils.constantNull(SoyRuntimeType.getBoxedType(headerVar.type()).runtimeType()));
    } else {
      if (ExpressionCompiler.canCompileToConstant(defaultValueNode)) {
        SoyExpression defaultValue = constantCompiler.compile(defaultValueNode);
        if (!defaultValue.isCheap()) {
          FieldRef ref;
          if (headerVar.kind() == Kind.STATE) {
            // State fields are package private so that lazy closures can access them directly.
            ref = fields.addPackagePrivateStaticField(headerVar.name(), defaultValue);
          } else {
            ref = fields.addStaticField("default$" + headerVar.name(), defaultValue);
          }
          defaultValue = defaultValue.withSource(ref.accessor());
        }
        return defaultValue;
      } else {
        Optional<SoyExpression> defaultExpression =
            expressionCompiler.compileWithNoDetaches(defaultValueNode);
        checkState(
            defaultExpression.isPresent(), "Default expression unexpectedly required detachment");
        return defaultExpression.get().box();
      }
    }
  }

  private static Expression getFieldProviderOrDefault(
      String name, Expression record, @Nullable SoyExpression defaultValue) {
    // NOTE: for compatibility with Tofu and jssrc we do not check for missing required parameters
    // here instead they will just turn into null.  Existing templates depend on this.
    if (defaultValue == null) {
      return MethodRef.RUNTIME_GET_FIELD_PROVIDER.invoke(record, BytecodeUtils.constant(name));
    } else {
      return MethodRef.RUNTIME_GET_FIELD_PROVIDER_DEFAULT.invoke(
          record, BytecodeUtils.constant(name), defaultValue.box());
    }
  }

  /**
   * Generates the main method that selects the implementation out of the map. Generates code like:
   *
   *
{@code
   * public static RenderResult fooTemplate(
   *     SoyRecord params,
   *     SoyRecord ijData,
   *     LoggingAdvisingAppendable appendable,
   *     RenderContext renderContext) {
   *   return renderContext
   *       .getDelTemplate(
   *           "fooTemplate",
   *           params.getFieldProvider("__modifiable_variant__", "").resolve().coerceToString())
   *       .render(params, ijData, appendable, renderContext);
   * }
   * }

   */
  private void generateModifiableSelectMethod() {
    if (!template.modifiableSelectMethod().isPresent()) {
      return;
    }
    Method method = template.renderMethod().method();
    final Label start = new Label();
    final Label end = new Label();

    ImmutableList.Builder<String> paramNames = ImmutableList.builder();
    paramNames.add(StandardNames.PARAMS);
    paramNames.add(StandardNames.IJ);
    paramNames.add(StandardNames.APPENDABLE);
    paramNames.add(StandardNames.RENDER_CONTEXT);

    final TemplateVariableManager variableSet =
        new TemplateVariableManager(
            template.typeInfo().type(), method, paramNames.build(), start, end, /*isStatic=*/ true);
    Expression paramsVar = variableSet.getVariable(StandardNames.PARAMS);
    Expression ijVar = variableSet.getVariable(StandardNames.IJ);
    Expression appendableVar = variableSet.getVariable(StandardNames.APPENDABLE);
    RenderContextExpression context =
        new RenderContextExpression(variableSet.getVariable(StandardNames.RENDER_CONTEXT));

    TemplateBasicNode templateBasicNode = (TemplateBasicNode) templateNode;
    Expression renderExpression =
        context.renderModifiable(
            modifiableImplsMapKey(templateBasicNode), paramsVar, ijVar, appendableVar);

    Statement returnExpression = Statement.returnExpression(renderExpression);

    new Statement() {
      @Override
      protected void doGen(CodeBuilder adapter) {
        adapter.mark(start);
        returnExpression.gen(adapter);
        adapter.mark(end);
        variableSet.generateTableEntries(adapter);
      }
    }.writeIOExceptionMethod(
        methodAccess(), template.modifiableSelectMethod().get().method(), writer);
  }

  private static final class TemplateVariables implements TemplateParameterLookup {
    private final TemplateVariableManager variableSet;
    private final Optional<? extends Expression> paramsRecord;
    private final Expression ijRecord;
    private final RenderContextExpression renderContext;

    TemplateVariables(
        TemplateVariableManager variableSet,
        Optional<? extends Expression> paramsRecord,
        Expression ijRecord,
        RenderContextExpression renderContext) {
      this.variableSet = variableSet;
      this.paramsRecord = paramsRecord;
      this.ijRecord = ijRecord;
      this.renderContext = renderContext;
    }

    @Override
    public Expression getParam(TemplateParam param) {
      return variableSet.getVariable(param.name());
    }

    @Override
    public Expression getParamsRecord() {
      return paramsRecord.get();
    }

    @Override
    public Expression getIjRecord() {
      return ijRecord;
    }

    @Override
    public Expression getLocal(AbstractLocalVarDefn<?> local) {
      return variableSet.getVariable(local.name());
    }

    @Override
    public Expression getLocal(SyntheticVarName varName) {
      return variableSet.getVariable(varName);
    }

    @Override
    public RenderContextExpression getRenderContext() {
      return renderContext;
    }
  }
}


text:
class PageUsageData;

namespace sql {
class Connection;
}

namespace history {

// Tracks pages used for the most visited view.
class VisitSegmentDatabase {
 public:
  // Must call InitSegmentTables before using any other part of this class.
  VisitSegmentDatabase();
  virtual ~VisitSegmentDatabase();

  // Compute a segment name given a URL. The segment name is currently the
  // source url spec less some information such as query strings.
  static std::string ComputeSegmentName(const GURL& url);

  // Returns the ID of the segment with the corresponding name, or 0 if there
  // is no segment with that name.
  SegmentID GetSegmentNamed(const std::string& segment_name);

  // Update the segment identified by |out_segment_id| with the provided URL ID.
  // The URL identifies the page that will now represent the segment. If url_id
  // is non zero, it is assumed to be the row id of |url|.
  bool UpdateSegmentRepresentationURL(SegmentID segment_id,
                                      URLID url_id);

  // Return the ID of the URL currently used to represent this segment or 0 if
  // an error occured.
  URLID GetSegmentRepresentationURL(SegmentID segment_id);

  // Create a segment for the provided URL ID with the given name. Returns the
  // ID of the newly created segment, or 0 on failure.
  SegmentID CreateSegment(URLID url_id, const std::string& segment_name);

  // Increase the segment visit count by the provided amount. Return true on
  // success.
  bool IncreaseSegmentVisitCount(SegmentID segment_id, base::Time ts,
                                 int amount);

  // Compute the segment usage since |from_time| using the provided aggregator.
  // A PageUsageData is added in |result| for the highest-scored segments up to
  // |max_result_count|.
  void QuerySegmentUsage(base::Time from_time,
                         int max_result_count,
                         std::vector<PageUsageData*>* result);

  // Delete all the segment usage data which is older than the provided time
  // stamp.
  bool DeleteSegmentData(base::Time older_than);

  // Change the presentation id for the segment identified by |segment_id|
  bool SetSegmentPresentationIndex(SegmentID segment_id, int index);

  // Delete the segment currently using the provided url for representation.
  // This will also delete any associated segment usage data.
  bool DeleteSegmentForURL(URLID url_id);

 protected:
  // Returns the database for the functions in this interface.
  virtual sql::Connection& GetDB() = 0;

  // Creates the tables used by this class if necessary. Returns true on
  // success.
  bool InitSegmentTables();

  // Deletes all the segment tables, returning true on success.
  bool DropSegmentTables();

 private:
  DISALLOW_COPY_AND_ASSIGN(VisitSegmentDatabase);
};

}  // namespace history

#endif  // CHROME_BROWSER_HISTORY_VISITSEGMENT_DATABASE_H_


text:
package cn.limw.summer.dao.spring.jdbc;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

import org.hibernate.SessionFactory;

import cn.limw.summer.hibernate.HibernateUtil;
import cn.limw.summer.spring.jdbc.core.namedparam.NamedParameterJdbcTemplate;

/**
 * @author li
 * @version 1 (2014年11月14日 上午10:18:00)
 * @since Java7
 */
public class SpringJdbcDaoSupport {
    private NamedParameterJdbcTemplate jdbcTemplate;

    private static final Map<Class<?>, String> TABLE_NAMES = new ConcurrentHashMap<Class<?>, String>();

    public String getTableName(Class<?> type) {
        String tableName = TABLE_NAMES.get(type);
        if (null == tableName) {
            TABLE_NAMES.put(type, tableName = HibernateUtil.getTableName(getHibernateSessionFactory(), type));
        }
        return tableName;
    }

    private SessionFactory getHibernateSessionFactory() {
        return getJdbcTemplate().getHibernateSessionFactory();
    }

    public NamedParameterJdbcTemplate getJdbcTemplate() {
        return jdbcTemplate;
    }

    public void setJdbcTemplate(NamedParameterJdbcTemplate jdbcTemplate) {
        this.jdbcTemplate = jdbcTemplate;
    }
}


text:
module Artery
  class Error < StandardError
    attr_accessor :artery_context

    def initialize(message = nil, **context)
      super message

      @original_exception = context.delete(:original_exception)
      @artery_context = context

      set_backtrace @original_exception ? @original_exception.backtrace : caller if backtrace.blank?
    end
  end

  class RequestError < Error
    attr_accessor :uri, :response

    def initialize(uri, response, **context)
      @uri = uri
      @response = response || {}

      super nil, **context
    end

    def message
      response[:error]
    end
  end

  class TimeoutError < Error; end

  class FormatError < Error
    attr_accessor :route, :msg

    def initialize(route, msg, **context)
      @route = route
      @msg = msg

      super nil, **context
    end

    def message
      "Received message from #{route} in wrong format: #{msg}"
    end
  end

  # ErrorHandler
  class ErrorHandler
    def self.handle(exception)
      Artery.logger.error exception.message + "\n" + exception.backtrace.join("\n")
    end
  end

  if defined?(Raven)
    class RavenErrorHandler < ErrorHandler
      def self.handle(exception)
        super

        options = {
          extra: {}
        }
        options[:extra][:artery] = exception.artery_context if exception.respond_to?(:artery_context)

        Raven.capture_exception(exception, options)
      end
    end
  end

  module_function def handle_error(exception)
    Artery.error_handler.handle exception
  end
end


text:
import Ember from 'ember';
import AuthenticatedRouteMixin from 'ember-simple-auth/mixins/authenticated-route-mixin';

export default Ember.Route.extend(AuthenticatedRouteMixin, {

  model() {
    return this.store.findAll('person').catch(
      (error) => {
        return [Ember.Object.create({ error })];
      }
    );
  }

});


text:
data:extend({

  	---- Building Materials
	{
		type = "item",
		name = "Building_Materials",
		icon = "__Natural-Evolution__/graphics/icons/Building_Materials.png",
		flags = {"goes-to-main-inventory"},
		subgroup = "Materials",
		order = "b[Building_Materials]",
		stack_size = 10
	},

	--- Attractor
	{
		type = "item",
		name = "attractor-on",
		icon = "__Natural-Evolution__/graphics/entity/attractor_on.png",
		flags = {"goes-to-quickbar"},
		subgroup = "Tools",
		order = "a[attractor-on]",
		stack_size = 1
	},
  	{
		type = "item",
		name = "attractor-off",
		icon = "__Natural-Evolution__/graphics/entity/attractor_off.png",
		flags = {"goes-to-quickbar"},
		subgroup = "Tools",
		order = "b[attractor-off]",
		stack_size = 1
	},

	--- Biological Bullet
	{
		type = "ammo",
		name = "Biological-bullet-magazine",
		icon = "__Natural-Evolution__/graphics/icons/Biological-bullet-magazine.png",
		flags = {"goes-to-main-inventory"},
		ammo_type =
		{
		  category = "bullet",
		  action =
		  {
			type = "direct",
			action_delivery =
			{
			  type = "instant",
			  source_effects =
			  {
				  type = "create-explosion",
				  entity_name = "explosion-gunshot"
			  },
			  target_effects =
			  {
				{
				  type = "create-entity",
				  entity_name = "explosion-hit"
				},
				{
				  type = "damage",
				  damage = { amount = 25 , type = "Biological"}
				},
				{
				  type = "damage",
				  damage = { amount = 5 , type = "physical"}
				}
			  }
			}
		  }
		},
		magazine_size = 10,
		subgroup = "ammo",
		order = "a[basic-clips]-b[piercing-bullet-magazine]-c[Biological-bullet-magazine]",
		stack_size = 100
  },
})


text:
function cache_all_flow(dataset, cache_dir)
%CACHE_ALL_FLOW Ensure that cache contains flow for all given pairs.
% This is useful because it means that we don't have to calculate flow when
% we are doing augmentations. It also means that we can interrupt the flow
% calculation process before we get to the augmentation stage and still be
% alright.
pairs = dataset.pairs;
all_data = dataset.data;
parfor i=1:dataset.num_pairs
    idxs = pairs(i);
    fst = all_data(idxs.fst); %#ok<PFBNS>
    snd = all_data(idxs.snd);
    cached_imflow(fst, snd, cache_dir);
end
end


text:
<?xml version="1.0" encoding="utf-8"?>
<!--
  Copyright 2012 Goodow.com.

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<queue-entries>
  <total-storage-limit>100M</total-storage-limit>
  <queue>
    <name>memcache-deletion</name>
    <rate>1/s</rate>
    <max-concurrent-requests>1</max-concurrent-requests>
  </queue>
  <queue>
    <name>post-commit-conv</name>
    <rate>1/s</rate>
    <max-concurrent-requests>1</max-concurrent-requests>
  </queue>
  <queue>
    <name>post-commit-udw</name>
    <rate>1/s</rate>
    <max-concurrent-requests>1</max-concurrent-requests>
  </queue>
  <queue>
    <name>robot-notifications</name>
    <rate>1/s</rate>
    <max-concurrent-requests>1</max-concurrent-requests>
  </queue>
  <queue>
    <name>reindex</name>
    <rate>1/s</rate>
    <max-concurrent-requests>1</max-concurrent-requests>
  </queue>
</queue-entries>


text:
package net.opengis.gml.impl;
/**
 * An XML PolyhedralSurfaceType(@http://www.opengis.net/gml).
 *
 * This is a complex type.
 */
public class PolyhedralSurfaceTypeImpl extends net.opengis.gml.impl.SurfaceTypeImpl implements net.opengis.gml.PolyhedralSurfaceType
{
    private static final long serialVersionUID = 1L;

    public PolyhedralSurfaceTypeImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }

    private static final javax.xml.namespace.QName POLYGONPATCHES$0 =
        new javax.xml.namespace.QName("http://www.opengis.net/gml", "polygonPatches");

    /**
     * Gets the "polygonPatches" element
     */
    public net.opengis.gml.PolygonPatchArrayPropertyType getPolygonPatches()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.opengis.gml.PolygonPatchArrayPropertyType target = null;
            target = (net.opengis.gml.PolygonPatchArrayPropertyType)get_store().find_element_user(POLYGONPATCHES$0, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }

    /**
     * Sets the "polygonPatches" element
     */
     public void setPolygonPatches(net.opengis.gml.PolygonPatchArrayPropertyType polygonPatches)
    {
        generatedSetterHelperImpl(polygonPatches, POLYGONPATCHES$0, 0, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_SINGLETON);
    }

    /**
     * Appends and returns a new empty "polygonPatches" element
     */
    public net.opengis.gml.PolygonPatchArrayPropertyType addNewPolygonPatches()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.opengis.gml.PolygonPatchArrayPropertyType target = null;
            target = (net.opengis.gml.PolygonPatchArrayPropertyType)get_store().add_element_user(POLYGONPATCHES$0);
            return target;
        }
    }
}