signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class IQRCode { /** * 从二维码图片读取二维码信息 * @ param image 图片信息 * @ return 二维码文本信息 * @ throws NotFoundException 当图像文件中没有二维码信息 ( 图像 ) 时抛出该异常 */ private static String read ( BufferedImage image ) throws NotFoundException { } }
LuminanceSource source = new BufferedImageLuminanceSource ( image ) ; Binarizer binarizer = new HybridBinarizer ( source ) ; BinaryBitmap binaryBitmap = new BinaryBitmap ( binarizer ) ; Result result = new MultiFormatReader ( ) . decode ( binaryBitmap ) ; return result . getText ( ) ;
public class ExtensionAlert { /** * This method is intended for internal use only , and should only * be called by other classes for unit testing . */ protected void applyOverrides ( Alert alert ) { } }
if ( this . alertOverrides . isEmpty ( ) ) { // Nothing to do return ; } String changedName = this . alertOverrides . getProperty ( alert . getPluginId ( ) + ".name" ) ; if ( changedName != null ) { alert . setName ( applyOverride ( alert . getName ( ) , changedName ) ) ; } String changedDesc = this . alertOverrides . getProperty ( alert . getPluginId ( ) + ".description" ) ; if ( changedDesc != null ) { alert . setDescription ( applyOverride ( alert . getDescription ( ) , changedDesc ) ) ; } String changedSolution = this . alertOverrides . getProperty ( alert . getPluginId ( ) + ".solution" ) ; if ( changedSolution != null ) { alert . setSolution ( applyOverride ( alert . getSolution ( ) , changedSolution ) ) ; } String changedOther = this . alertOverrides . getProperty ( alert . getPluginId ( ) + ".otherInfo" ) ; if ( changedOther != null ) { alert . setOtherInfo ( applyOverride ( alert . getOtherInfo ( ) , changedOther ) ) ; } String changedReference = this . alertOverrides . getProperty ( alert . getPluginId ( ) + ".reference" ) ; if ( changedReference != null ) { alert . setReference ( applyOverride ( alert . getReference ( ) , changedReference ) ) ; }
public class ResourceGroovyMethods { /** * Write a Byte Order Mark at the beginning of the file * @ param stream the FileOutputStream to write the BOM to * @ param bigEndian true if UTF 16 Big Endian or false if Low Endian * @ throws IOException if an IOException occurs . * @ since 1.0 */ private static void writeUtf16Bom ( OutputStream stream , boolean bigEndian ) throws IOException { } }
if ( bigEndian ) { stream . write ( - 2 ) ; stream . write ( - 1 ) ; } else { stream . write ( - 1 ) ; stream . write ( - 2 ) ; }
public class OldConvolution { /** * Implement column formatted images * @ param img the image to process * @ param kh the kernel height * @ param kw the kernel width * @ param sy the stride along y * @ param sx the stride along x * @ param ph the padding width * @ param pw the padding height * @ param pval the padding value * @ param coverAll whether to cover the whole image or not * @ return the column formatted image */ public static INDArray im2col ( INDArray img , int kh , int kw , int sy , int sx , int ph , int pw , int pval , boolean coverAll ) { } }
// number of images long n = img . size ( 0 ) ; // number of channels ( depth ) long c = img . size ( 1 ) ; // image height long h = img . size ( 2 ) ; // image width long w = img . size ( 3 ) ; long outHeight = outSize ( h , kh , sy , ph , coverAll ) ; long outWidth = outSize ( w , kw , sx , pw , coverAll ) ; INDArray padded = Nd4j . pad ( img , new int [ ] [ ] { { 0 , 0 } , { 0 , 0 } , { ph , ph + sy - 1 } , { pw , pw + sx - 1 } } , Nd4j . PadMode . CONSTANT ) ; INDArray ret = Nd4j . create ( n , c , kh , kw , outHeight , outWidth ) ; for ( int i = 0 ; i < kh ; i ++ ) { // offset for the row based on the stride and output height long iLim = i + sy * outHeight ; for ( int j = 0 ; j < kw ; j ++ ) { // offset for the column based on stride and output width long jLim = j + sx * outWidth ; INDArray get = padded . get ( NDArrayIndex . all ( ) , NDArrayIndex . all ( ) , NDArrayIndex . interval ( i , sy , iLim ) , NDArrayIndex . interval ( j , sx , jLim ) ) ; ret . put ( new INDArrayIndex [ ] { NDArrayIndex . all ( ) , NDArrayIndex . all ( ) , NDArrayIndex . point ( i ) , NDArrayIndex . point ( j ) , NDArrayIndex . all ( ) , NDArrayIndex . all ( ) } , get ) ; } } return ret ;
public class Broker { /** * Hand in the object to share . */ public void handIn ( String key , V obj ) { } }
if ( ! retrieveSharedQueue ( key ) . offer ( obj ) ) { throw new RuntimeException ( "Could not register the given element, broker slot is already occupied." ) ; }
public class Flowable { /** * Instructs a Publisher that is emitting items faster than its Subscriber can consume them to buffer up to * a given amount of items until they can be emitted . The resulting Publisher will signal * a { @ code BufferOverflowException } via { @ code onError } as soon as the buffer ' s capacity is exceeded , dropping all undelivered * items , canceling the source , and notifying the producer with { @ code onOverflow } . * < img width = " 640 " height = " 300 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / bp . obp . buffer . png " alt = " " > * < dl > * < dt > < b > Backpressure : < / b > < / dt > * < dd > The operator honors backpressure from downstream and consumes the source { @ code Publisher } in an unbounded * manner ( i . e . , not applying backpressure to it ) . < / dd > * < dt > < b > Scheduler : < / b > < / dt > * < dd > { @ code onBackpressureBuffer } does not operate by default on a particular { @ link Scheduler } . < / dd > * < / dl > * @ param capacity number of slots available in the buffer . * @ param delayError * if true , an exception from the current Flowable is delayed until all buffered elements have been * consumed by the downstream ; if false , an exception is immediately signaled to the downstream , skipping * any buffered element * @ param unbounded * if true , the capacity value is interpreted as the internal " island " size of the unbounded buffer * @ param onOverflow action to execute if an item needs to be buffered , but there are no available slots . Null is allowed . * @ return the source { @ code Publisher } modified to buffer items up to the given capacity * @ see < a href = " http : / / reactivex . io / documentation / operators / backpressure . html " > ReactiveX operators documentation : backpressure operators < / a > * @ since 1.1.0 */ @ CheckReturnValue @ BackpressureSupport ( BackpressureKind . SPECIAL ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final Flowable < T > onBackpressureBuffer ( int capacity , boolean delayError , boolean unbounded , Action onOverflow ) { } }
ObjectHelper . requireNonNull ( onOverflow , "onOverflow is null" ) ; ObjectHelper . verifyPositive ( capacity , "capacity" ) ; return RxJavaPlugins . onAssembly ( new FlowableOnBackpressureBuffer < T > ( this , capacity , unbounded , delayError , onOverflow ) ) ;
public class CmsGalleryController { /** * Converts categories tree to a list of info beans . < p > * @ param categoryList the category list * @ param entries the tree entries */ private void categoryTreeToList ( List < CmsCategoryBean > categoryList , List < CmsCategoryTreeEntry > entries ) { } }
if ( entries == null ) { return ; } // skipping the root tree entry where the path property is empty for ( CmsCategoryTreeEntry entry : entries ) { CmsCategoryBean bean = new CmsCategoryBean ( entry ) ; categoryList . add ( bean ) ; categoryTreeToList ( categoryList , entry . getChildren ( ) ) ; }
public class CmsJspImageBean { /** * Returns a variation of the current image scaled with the given scaler . < p > * It is always the original image which is used as a base , never a scaled version . * So for example if the image has been cropped by the user , the cropping are is ignored . < p > * @ param targetScaler contains the information about how to scale the image * @ return a variation of the current image scaled with the given scaler */ protected CmsJspImageBean createVariation ( CmsImageScaler targetScaler ) { } }
CmsJspImageBean result = new CmsJspImageBean ( ) ; result . setCmsObject ( getCmsObject ( ) ) ; result . setResource ( getCmsObject ( ) , getResource ( ) ) ; result . setOriginalScaler ( getOriginalScaler ( ) ) ; result . setBaseScaler ( getBaseScaler ( ) ) ; result . setVfsUri ( getVfsUri ( ) ) ; result . setScaler ( targetScaler ) ; result . setQuality ( getQuality ( ) ) ; return result ;
public class GraphGenerator { /** * On assigning node link properties * @ param node * node * @ param relation * relation * @ param childNode * child node */ private void assignNodeLinkProperty ( Node node , Relation relation , Node childNode ) { } }
// Construct Node Link for this relationship NodeLink nodeLink = new NodeLink ( node . getNodeId ( ) , childNode . getNodeId ( ) ) ; setLink ( node , relation , childNode , nodeLink ) ;
public class ListArtifactsResult { /** * Information about the artifacts . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setArtifacts ( java . util . Collection ) } or { @ link # withArtifacts ( java . util . Collection ) } if you want to * override the existing values . * @ param artifacts * Information about the artifacts . * @ return Returns a reference to this object so that method calls can be chained together . */ public ListArtifactsResult withArtifacts ( Artifact ... artifacts ) { } }
if ( this . artifacts == null ) { setArtifacts ( new java . util . ArrayList < Artifact > ( artifacts . length ) ) ; } for ( Artifact ele : artifacts ) { this . artifacts . add ( ele ) ; } return this ;
public class AWSElasticsearchClient { /** * Modifies the cluster configuration of the specified Elasticsearch domain , setting as setting the instance type * and the number of instances . * @ param updateElasticsearchDomainConfigRequest * Container for the parameters to the < code > < a > UpdateElasticsearchDomain < / a > < / code > operation . Specifies the * type and number of instances in the domain cluster . * @ return Result of the UpdateElasticsearchDomainConfig operation returned by the service . * @ throws BaseException * An error occurred while processing the request . * @ throws InternalException * The request processing has failed because of an unknown error , exception or failure ( the failure is * internal to the service ) . Gives http status code of 500. * @ throws InvalidTypeException * An exception for trying to create or access sub - resource that is either invalid or not supported . Gives * http status code of 409. * @ throws LimitExceededException * An exception for trying to create more than allowed resources or sub - resources . Gives http status code of * 409. * @ throws ResourceNotFoundException * An exception for accessing or deleting a resource that does not exist . Gives http status code of 400. * @ throws ValidationException * An exception for missing / invalid input fields . Gives http status code of 400. * @ sample AWSElasticsearch . UpdateElasticsearchDomainConfig */ @ Override public UpdateElasticsearchDomainConfigResult updateElasticsearchDomainConfig ( UpdateElasticsearchDomainConfigRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeUpdateElasticsearchDomainConfig ( request ) ;
public class SparseBitmap { /** * Computes the bit - wise logical exclusive or with another bitmap . * @ param o * another bitmap * @ return the result of the bti - wise logical exclusive or */ public SparseBitmap xor ( SparseBitmap o ) { } }
SparseBitmap a = new SparseBitmap ( ) ; xor2by2 ( a , this , o ) ; return a ;
public class Util { /** * WAS classic encodes the GSSToken containing the encoded LTPA token inside another GSSToken . * This code detects if there is another GSSToken inside the GSSToken , * obtains the internal LTPA token bytes , and decodes them . * @ param codec The codec to do the encoding of the Any . * @ param token _ arr the bytes of the GSS token to decode . * @ return the LTPA token bytes . */ @ Sensitive public static byte [ ] decodeLTPAToken ( Codec codec , @ Sensitive byte [ ] token_arr ) throws SASException { } }
byte [ ] ltpaTokenBytes = null ; try { byte [ ] data = readGSSTokenData ( LTPAMech . LTPA_OID . substring ( 4 ) , token_arr ) ; if ( data != null ) { // Check if it is double - encoded WAS classic token and get the encoded ltpa token bytes if ( isGSSToken ( LTPAMech . LTPA_OID . substring ( 4 ) , data ) ) { data = readGSSTokenData ( LTPAMech . LTPA_OID . substring ( 4 ) , data ) ; } Any any = codec . decode_value ( data , org . omg . Security . OpaqueHelper . type ( ) ) ; ltpaTokenBytes = org . omg . Security . OpaqueHelper . extract ( any ) ; } } catch ( Exception ex ) { // TODO : Modify SASException to take a message ? throw new SASException ( 2 , ex ) ; } if ( ltpaTokenBytes == null || ltpaTokenBytes . length == 0 ) { throw new SASException ( 2 ) ; } return ltpaTokenBytes ;
public class TypeLexer { /** * $ ANTLR start " WS " */ public final void mWS ( ) throws RecognitionException { } }
try { int _type = WS ; int _channel = DEFAULT_TOKEN_CHANNEL ; // org / javaruntype / type / parser / Type . g : 124:5 : ( ( ' ' ) + ) // org / javaruntype / type / parser / Type . g : 124:7 : ( ' ' ) + { // org / javaruntype / type / parser / Type . g : 124:7 : ( ' ' ) + int cnt2 = 0 ; loop2 : do { int alt2 = 2 ; int LA2_0 = input . LA ( 1 ) ; if ( ( LA2_0 == ' ' ) ) { alt2 = 1 ; } switch ( alt2 ) { case 1 : // org / javaruntype / type / parser / Type . g : 124:8 : ' ' { match ( ' ' ) ; } break ; default : if ( cnt2 >= 1 ) break loop2 ; EarlyExitException eee = new EarlyExitException ( 2 , input ) ; throw eee ; } cnt2 ++ ; } while ( true ) ; skip ( ) ; } state . type = _type ; state . channel = _channel ; } finally { }
public class ManagedExecutorServiceImpl { /** * { @ inheritDoc } */ @ Override public Object createResource ( final ResourceInfo ref ) throws Exception { } }
ComponentMetaData cData = ComponentMetaDataAccessorImpl . getComponentMetaDataAccessor ( ) . getComponentMetaData ( ) ; if ( cData != null ) applications . add ( cData . getJ2EEName ( ) . getApplication ( ) ) ; return this ;
public class NameSpace { /** * Get the specified variable in this namespace . * @ param name the name * @ param recurse If recurse is true then we recursively search through * parent namespaces for the variable . * Note : this method is primarily intended for use internally . If you * use this method outside of the bsh package you will have to use * Primitive . unwrap ( ) to get primitive values . * @ return The variable value or Primitive . VOID if it is not defined . * @ throws UtilEvalError the util eval error * @ see Primitive # unwrap ( Object ) */ public Object getVariable ( final String name , final boolean recurse ) throws UtilEvalError { } }
final Variable var = this . getVariableImpl ( name , recurse ) ; return this . unwrapVariable ( var ) ;
public class ClusterServiceImpl { /** * should be called under lock */ void setMasterAddress ( Address master ) { } }
assert lock . isHeldByCurrentThread ( ) : "Called without holding cluster service lock!" ; if ( logger . isFineEnabled ( ) ) { logger . fine ( "Setting master address to " + master ) ; } masterAddress = master ;
public class SchemaValidator { /** * Validate the given value against the given model schema . * @ param value The value to validate * @ param schema The model schema to validate the value against * @ param config The config model for some validator * @ return A status containing error code and description */ public Status validate ( final Object value , final Model schema , SchemaValidatorsConfig config ) { } }
return doValidate ( value , schema , config ) ;
public class ImageBuilderMarshaller { /** * Marshall the given parameter object . */ public void marshall ( ImageBuilder imageBuilder , ProtocolMarshaller protocolMarshaller ) { } }
if ( imageBuilder == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( imageBuilder . getName ( ) , NAME_BINDING ) ; protocolMarshaller . marshall ( imageBuilder . getArn ( ) , ARN_BINDING ) ; protocolMarshaller . marshall ( imageBuilder . getImageArn ( ) , IMAGEARN_BINDING ) ; protocolMarshaller . marshall ( imageBuilder . getDescription ( ) , DESCRIPTION_BINDING ) ; protocolMarshaller . marshall ( imageBuilder . getDisplayName ( ) , DISPLAYNAME_BINDING ) ; protocolMarshaller . marshall ( imageBuilder . getVpcConfig ( ) , VPCCONFIG_BINDING ) ; protocolMarshaller . marshall ( imageBuilder . getInstanceType ( ) , INSTANCETYPE_BINDING ) ; protocolMarshaller . marshall ( imageBuilder . getPlatform ( ) , PLATFORM_BINDING ) ; protocolMarshaller . marshall ( imageBuilder . getState ( ) , STATE_BINDING ) ; protocolMarshaller . marshall ( imageBuilder . getStateChangeReason ( ) , STATECHANGEREASON_BINDING ) ; protocolMarshaller . marshall ( imageBuilder . getCreatedTime ( ) , CREATEDTIME_BINDING ) ; protocolMarshaller . marshall ( imageBuilder . getEnableDefaultInternetAccess ( ) , ENABLEDEFAULTINTERNETACCESS_BINDING ) ; protocolMarshaller . marshall ( imageBuilder . getDomainJoinInfo ( ) , DOMAINJOININFO_BINDING ) ; protocolMarshaller . marshall ( imageBuilder . getImageBuilderErrors ( ) , IMAGEBUILDERERRORS_BINDING ) ; protocolMarshaller . marshall ( imageBuilder . getAppstreamAgentVersion ( ) , APPSTREAMAGENTVERSION_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class JavaAnnotation { /** * Returns the value of the property with the given name , i . e . the result of the method with the property name * of the represented { @ link java . lang . annotation . Annotation } . E . g . for * < pre > < code > { @ literal @ } SomeAnnotation ( value = " someString " , types = { SomeType . class , AnotherType . class } ) * class SomeAnnotatedClass { } * < / code > < / pre > * the results will be * < pre > < code > someAnnotation . get ( " value " ) - - & gt ; " someString " * someAnnotation . get ( " types " ) - - & gt ; [ JavaClass { SomeType } , JavaClass { AnotherType } ] * < / code > < / pre > * @ param property The name of the annotation property , i . e . the declared method name * @ return the value of the given property , where the result type is more precisely * < ul > * < li > Class & lt ; ? & gt ; - - & gt ; TypeDetails { clazz } < / li > * < li > Class & lt ; ? & gt ; [ ] - - & gt ; [ TypeDetails { clazz } , . . . ] < / li > * < li > Enum - - & gt ; JavaEnumConstant < / li > * < li > Enum [ ] - - & gt ; [ JavaEnumConstant , . . . ] < / li > * < li > anyOtherType - - & gt ; anyOtherType < / li > * < / ul > */ @ PublicAPI ( usage = ACCESS ) public Optional < Object > get ( String property ) { } }
return Optional . fromNullable ( values . get ( property ) ) ;
public class AnnotationMetadataWriter { /** * Accept an { @ link ClassWriterOutputVisitor } to write all generated classes . * @ param outputVisitor The { @ link ClassWriterOutputVisitor } * @ throws IOException If an error occurs */ public void accept ( ClassWriterOutputVisitor outputVisitor ) throws IOException { } }
try ( OutputStream outputStream = outputVisitor . visitClass ( className ) ) { ClassWriter classWriter = generateClassBytes ( ) ; outputStream . write ( classWriter . toByteArray ( ) ) ; }
public class MutableArray { /** * Sets a Blob object at the given index . * @ param index the index . This value must not exceed the bounds of the array . * @ param value the Blob object * @ return The self object */ @ NonNull @ Override public MutableArray setBlob ( int index , Blob value ) { } }
return setValue ( index , value ) ;
public class IndexingMetadata { /** * Retrieves the value of the ' indexed _ by _ default ' protobuf option from the schema file defining the given * message descriptor . */ public static boolean isLegacyIndexingEnabled ( Descriptor messageDescriptor ) { } }
boolean isLegacyIndexingEnabled = true ; for ( Option o : messageDescriptor . getFileDescriptor ( ) . getOptions ( ) ) { if ( o . getName ( ) . equals ( INDEXED_BY_DEFAULT_OPTION ) ) { isLegacyIndexingEnabled = Boolean . valueOf ( ( String ) o . getValue ( ) ) ; break ; } } return isLegacyIndexingEnabled ;
public class Conversions { /** * Tries conversion of any value to an integer */ public static int toInteger ( Object value , EvaluationContext ctx ) { } }
if ( value instanceof Boolean ) { return ( ( Boolean ) value ) ? 1 : 0 ; } else if ( value instanceof Integer ) { return ( Integer ) value ; } else if ( value instanceof BigDecimal ) { try { return ( ( BigDecimal ) value ) . setScale ( 0 , RoundingMode . HALF_UP ) . intValueExact ( ) ; } catch ( ArithmeticException ex ) { } } else if ( value instanceof String ) { try { return Integer . parseInt ( ( String ) value ) ; } catch ( NumberFormatException e ) { } } throw new EvaluationError ( "Can't convert '" + value + "' to an integer" ) ;
public class JmsFactoryFactoryImpl { /** * For use by the JCA resource adaptor . */ @ Override public TopicConnectionFactory createTopicConnectionFactory ( JmsJcaConnectionFactory jcaConnectionFactory , JmsJcaManagedTopicConnectionFactory jcaManagedTopicConnectionFactory ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "createTopicConnectionFactory" , new Object [ ] { jcaConnectionFactory , jcaManagedTopicConnectionFactory } ) ; TopicConnectionFactory tcf = new JmsTopicConnectionFactoryImpl ( jcaConnectionFactory , jcaManagedTopicConnectionFactory ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "createTopicConnectionFactory" , tcf ) ; return tcf ;
public class CmsContextMenuHandler { /** * Loads the context menu . < p > * @ param structureId the resource structure id * @ param context the context * @ param menuButton the menu button */ public void loadContextMenu ( final CmsUUID structureId , final AdeContext context , final CmsContextMenuButton menuButton ) { } }
CmsRpcAction < List < CmsContextMenuEntryBean > > action = new CmsRpcAction < List < CmsContextMenuEntryBean > > ( ) { @ Override public void execute ( ) { CmsCoreProvider . getService ( ) . getContextMenuEntries ( structureId , context , this ) ; } @ Override protected void onResponse ( List < CmsContextMenuEntryBean > result ) { menuButton . showMenu ( transformEntries ( result , structureId ) ) ; } } ; action . execute ( ) ;
public class MappingRuleMarshaller { /** * Marshall the given parameter object . */ public void marshall ( MappingRule mappingRule , ProtocolMarshaller protocolMarshaller ) { } }
if ( mappingRule == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( mappingRule . getClaim ( ) , CLAIM_BINDING ) ; protocolMarshaller . marshall ( mappingRule . getMatchType ( ) , MATCHTYPE_BINDING ) ; protocolMarshaller . marshall ( mappingRule . getValue ( ) , VALUE_BINDING ) ; protocolMarshaller . marshall ( mappingRule . getRoleARN ( ) , ROLEARN_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class ModelsImpl { /** * Adds a customizable prebuilt domain along with all of its models to this application . * @ param appId The application ID . * @ param versionId The version ID . * @ param addCustomPrebuiltDomainOptionalParameter the object representing the optional parameters to be set before calling this API * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the List & lt ; UUID & gt ; object */ public Observable < List < UUID > > addCustomPrebuiltDomainAsync ( UUID appId , String versionId , AddCustomPrebuiltDomainModelsOptionalParameter addCustomPrebuiltDomainOptionalParameter ) { } }
return addCustomPrebuiltDomainWithServiceResponseAsync ( appId , versionId , addCustomPrebuiltDomainOptionalParameter ) . map ( new Func1 < ServiceResponse < List < UUID > > , List < UUID > > ( ) { @ Override public List < UUID > call ( ServiceResponse < List < UUID > > response ) { return response . body ( ) ; } } ) ;
public class Graphics { /** * Draw a line with a gradient between the two points . * @ param x1 * The starting x position to draw the line * @ param y1 * The starting y position to draw the line * @ param Color1 * The starting position ' s color * @ param x2 * The ending x position to draw the line * @ param y2 * The ending y position to draw the line * @ param Color2 * The ending position ' s color */ public void drawGradientLine ( float x1 , float y1 , Color Color1 , float x2 , float y2 , Color Color2 ) { } }
predraw ( ) ; TextureImpl . bindNone ( ) ; GL . glBegin ( SGL . GL_LINES ) ; Color1 . bind ( ) ; GL . glVertex2f ( x1 , y1 ) ; Color2 . bind ( ) ; GL . glVertex2f ( x2 , y2 ) ; GL . glEnd ( ) ; postdraw ( ) ;
public class AmazonComprehendClient { /** * Starts an asynchronous document classification job . Use the operation to track the progress of the job . * @ param startDocumentClassificationJobRequest * @ return Result of the StartDocumentClassificationJob operation returned by the service . * @ throws InvalidRequestException * The request is invalid . * @ throws TooManyRequestsException * The number of requests exceeds the limit . Resubmit your request later . * @ throws ResourceNotFoundException * The specified resource ARN was not found . Check the ARN and try your request again . * @ throws ResourceUnavailableException * The specified resource is not available . Check to see if the resource is in the < code > TRAINED < / code > * state and try your request again . * @ throws KmsKeyValidationException * The KMS customer managed key ( CMK ) entered cannot be validated . Verify the key and re - enter it . * @ throws InternalServerException * An internal server error occurred . Retry your request . * @ sample AmazonComprehend . StartDocumentClassificationJob * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / comprehend - 2017-11-27 / StartDocumentClassificationJob " * target = " _ top " > AWS API Documentation < / a > */ @ Override public StartDocumentClassificationJobResult startDocumentClassificationJob ( StartDocumentClassificationJobRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeStartDocumentClassificationJob ( request ) ;
public class ByteArrayUtil { /** * Retrieves the long value of a subarray of bytes . * The values are considered little endian . The subarray is determined by * offset and length . If bytes length is not large enough for given offset * and length the values are considered 0. * This should be used for file format fields , where part of the value has * been cut . Example : TinyPE * Presumes the byte array to be not null and its length should be between 0 * and 8 inclusive . * @ param bytes * the little endian byte array that shall be converted to long * @ param offset * the index to start reading the long value from * @ param length * the number of bytes used to convert to long * @ return long value */ public static long getBytesLongValueSafely ( byte [ ] bytes , int offset , int length ) { } }
assert length <= 8 && length >= 0 && bytes != null ; byte [ ] value = new byte [ length ] ; if ( offset + length > bytes . length ) { logger . warn ( "byte array not large enough for given offset + length" ) ; } for ( int i = 0 ; offset + i < bytes . length && i < length ; i ++ ) { value [ i ] = bytes [ offset + i ] ; } return bytesToLong ( value ) ;
public class JdbcUtils { /** * Check if the named table exists , if it does drop it , calling the preDropCallback first * @ param jdbcOperations { @ link JdbcOperations } used to check if the table exists and execute * the drop * @ param table The name of the table to drop , case insensitive * @ param preDropCallback The callback to execute immediately before the table is dropped * @ return The result returned from the callback */ public static final < T > T dropTableIfExists ( JdbcOperations jdbcOperations , final String table , final Function < JdbcOperations , T > preDropCallback ) { } }
LOGGER . info ( "Dropping table: " + table ) ; final boolean tableExists = doesTableExist ( jdbcOperations , table ) ; if ( tableExists ) { final T ret = preDropCallback . apply ( jdbcOperations ) ; jdbcOperations . execute ( "DROP TABLE " + table ) ; return ret ; } return null ;
public class LibraryLoader { /** * Replies the data model of the current operating system : 32 or 64 bits . * @ return the integer which is corresponding to the data model , or < code > 0 < / code > if * it could not be determined . */ @ Pure static int getOperatingSystemArchitectureDataModel ( ) { } }
final String arch = System . getProperty ( "sun.arch.data.model" ) ; // $ NON - NLS - 1 $ if ( arch != null ) { try { return Integer . parseInt ( arch ) ; } catch ( AssertionError e ) { throw e ; } catch ( Throwable exception ) { } } return 0 ;
public class ContractMethodSignatures { /** * Extracts the method signature field named { @ code field } , with the * type { @ code clazz } , from the annotations of * { @ code contractMethod } . * @ param contractMethod the annotated method node * @ param field the name of the field to retrieve * @ param clazz the type of the value to return * @ return the value of the field , or { @ code null } */ @ Requires ( { } }
"contractMethod != null" , "field != null" , "clazz != null" } ) @ SuppressWarnings ( "unchecked" ) static < T > T getMetaData ( MethodNode contractMethod , String field , Class < T > clazz ) { List < AnnotationNode > annotations = contractMethod . invisibleAnnotations ; if ( annotations == null ) { return null ; } for ( AnnotationNode annotation : annotations ) { if ( ! annotation . desc . equals ( CONTRACT_METHOD_SIGNATURE_DESC ) ) { continue ; } if ( annotation . values == null ) { return null ; } Iterator < ? > it = annotation . values . iterator ( ) ; while ( it . hasNext ( ) ) { String name = ( String ) it . next ( ) ; Object value = it . next ( ) ; if ( name . equals ( field ) ) { return ( T ) value ; } } } return null ;
public class WorkflowClient { /** * Retrieve a workflow by workflow id * @ param workflowId the id of the workflow * @ param includeTasks specify if the tasks in the workflow need to be returned * @ return the requested workflow */ public Workflow getWorkflow ( String workflowId , boolean includeTasks ) { } }
Preconditions . checkArgument ( StringUtils . isNotBlank ( workflowId ) , "workflow id cannot be blank" ) ; Workflow workflow = getForEntity ( "workflow/{workflowId}" , new Object [ ] { "includeTasks" , includeTasks } , Workflow . class , workflowId ) ; populateWorkflowOutput ( workflow ) ; return workflow ;
public class XAResourceWrapperStatImpl { /** * { @ inheritDoc } */ public void rollback ( Xid xid ) throws XAException { } }
long l1 = System . currentTimeMillis ( ) ; try { super . rollback ( xid ) ; } finally { xastat . deltaRollback ( System . currentTimeMillis ( ) - l1 ) ; }
public class GetDataSourceRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( GetDataSourceRequest getDataSourceRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( getDataSourceRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( getDataSourceRequest . getDataSourceId ( ) , DATASOURCEID_BINDING ) ; protocolMarshaller . marshall ( getDataSourceRequest . getVerbose ( ) , VERBOSE_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class Project { /** * Make the given filename absolute relative to the current working * directory candidates . * If the given filename exists in more than one of the working directories , * a list of these existing absolute paths is returned . * The returned list is guaranteed to be non - empty . The returned paths might * exist or not exist and might be relative or absolute . * @ return A list of at least one candidate path for the given filename . */ private List < String > makeAbsoluteCwdCandidates ( String fileName ) { } }
List < String > candidates = new ArrayList < > ( ) ; boolean hasProtocol = ( URLClassPath . getURLProtocol ( fileName ) != null ) ; if ( hasProtocol ) { candidates . add ( fileName ) ; return candidates ; } if ( new File ( fileName ) . isAbsolute ( ) ) { candidates . add ( fileName ) ; return candidates ; } for ( File currentWorkingDirectory : currentWorkingDirectoryList ) { File relativeToCurrent = new File ( currentWorkingDirectory , fileName ) ; if ( relativeToCurrent . exists ( ) ) { candidates . add ( relativeToCurrent . toString ( ) ) ; } } if ( candidates . isEmpty ( ) ) { candidates . add ( fileName ) ; } return candidates ;
public class Envelope2D { /** * Returns True if the envelope contains the other envelope ( boundary * exclusive ) . * @ param other The other envelope * @ return True if this contains the other , boundary exclusive . */ boolean containsExclusive ( Envelope2D other ) { } }
// Note : This will return False , if either envelope is empty , thus no // need to call is _ empty ( ) . return other . xmin > xmin && other . xmax < xmax && other . ymin > ymin && other . ymax < ymax ;
public class DalvikPurgeableDecoder { /** * Creates a bitmap from encoded bytes . * @ param encodedImage the encoded image with reference to the encoded bytes * @ param bitmapConfig the { @ link android . graphics . Bitmap . Config } used to create the decoded * Bitmap * @ param regionToDecode optional image region to decode . currently not supported . * @ param colorSpace the target color space of the decoded bitmap , must be one of the named color * space in { @ link android . graphics . ColorSpace . Named } . If null , then SRGB color space is * assumed if the SDK version > = 26. * @ return the bitmap * @ throws TooManyBitmapsException if the pool is full * @ throws java . lang . OutOfMemoryError if the Bitmap cannot be allocated */ @ Override public CloseableReference < Bitmap > decodeFromEncodedImageWithColorSpace ( final EncodedImage encodedImage , Bitmap . Config bitmapConfig , @ Nullable Rect regionToDecode , @ Nullable final ColorSpace colorSpace ) { } }
BitmapFactory . Options options = getBitmapFactoryOptions ( encodedImage . getSampleSize ( ) , bitmapConfig ) ; if ( Build . VERSION . SDK_INT >= Build . VERSION_CODES . O ) { OreoUtils . setColorSpace ( options , colorSpace ) ; } CloseableReference < PooledByteBuffer > bytesRef = encodedImage . getByteBufferRef ( ) ; Preconditions . checkNotNull ( bytesRef ) ; try { Bitmap bitmap = decodeByteArrayAsPurgeable ( bytesRef , options ) ; return pinBitmap ( bitmap ) ; } finally { CloseableReference . closeSafely ( bytesRef ) ; }
public class ApiOvhConnectivity { /** * Search for active and inactive lines at an address . It will search for active lines only if the owner name is specified * REST : POST / connectivity / eligibility / search / lines * @ param ownerName [ required ] Owner name , at least the first three chars * @ param streetNumber [ required ] Street number , that can be found using / connectivity / eligibility / search / streetNumbers method * @ param streetCode [ required ] Street code , that can be found using / connectivity / eligibility / search / streets method */ public OvhAsyncTaskArray < OvhLine > eligibility_search_lines_POST ( String ownerName , String streetCode , String streetNumber ) throws IOException { } }
String qPath = "/connectivity/eligibility/search/lines" ; StringBuilder sb = path ( qPath ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "ownerName" , ownerName ) ; addBody ( o , "streetCode" , streetCode ) ; addBody ( o , "streetNumber" , streetNumber ) ; String resp = execN ( qPath , "POST" , sb . toString ( ) , o ) ; return convertTo ( resp , t2 ) ;
public class WebUtil { /** * failure a cookie */ public static void failureCookie ( HttpServletRequest request , HttpServletResponse response , String name , String domain , String contextPath ) { } }
if ( request != null && response != null ) { addCookie ( request , response , name , null , domain , contextPath , 0 , true ) ; }
public class TableIterator { /** * Gets the next { @ link TableBucket } in the iteration . This will either be served directly from the cached batch * of { @ link TableBucket } s or a new invocation to the underlying indexHashIterator will be performed to fetch the next * { @ link TableBucket } . */ private CompletableFuture < TableBucket > getNextBucket ( ) { } }
val fromBatch = getNextBucketFromExistingBatch ( ) ; if ( fromBatch != null ) { return CompletableFuture . completedFuture ( fromBatch ) ; } val canContinue = new AtomicBoolean ( true ) ; return Futures . loop ( canContinue :: get , this :: fetchNextTableBuckets , canContinue :: set , this . executor ) . thenApply ( v -> getNextBucketFromExistingBatch ( ) ) ;
public class ParameterProperty { /** * Set whether or not a parameter might be non - null . * @ param param * the parameter index * @ param hasProperty * true if the parameter might be non - null , false otherwise */ public void setParamWithProperty ( int param , boolean hasProperty ) { } }
if ( param < 0 || param > 31 ) { return ; } if ( hasProperty ) { bits |= ( 1 << param ) ; } else { bits &= ~ ( 1 << param ) ; }
public class Scaler { /** * Returns minimum level where number of markers is not less that minMarkers * and less than maxMarkers . If both cannot be met , maxMarkers is stronger . * @ param minMarkers * @ param maxMarkers * @ return */ public ScaleLevel level ( int minMarkers , int maxMarkers ) { } }
Iterator < ScaleLevel > iterator = scale . iterator ( min , max ) ; ScaleLevel level = iterator . next ( ) ; ScaleLevel prev = null ; while ( iterator . hasNext ( ) && minMarkers > level . count ( min , max ) ) { prev = level ; level = iterator . next ( ) ; } if ( maxMarkers < level . count ( min , max ) ) { return prev ; } else { return level ; }
public class Feature { /** * Create a new instance of this class by passing in a formatted valid JSON String . If you are * creating a Feature object from scratch it is better to use one of the other provided static * factory methods such as { @ link # fromGeometry ( Geometry ) } . * @ param json a formatted valid JSON string defining a GeoJson Feature * @ return a new instance of this class defined by the values passed inside this static factory * method * @ since 1.0.0 */ public static Feature fromJson ( @ NonNull String json ) { } }
GsonBuilder gson = new GsonBuilder ( ) ; gson . registerTypeAdapterFactory ( GeoJsonAdapterFactory . create ( ) ) ; gson . registerTypeAdapterFactory ( GeometryAdapterFactory . create ( ) ) ; Feature feature = gson . create ( ) . fromJson ( json , Feature . class ) ; // Even thought properties are Nullable , // Feature object will be created with properties set to an empty object , // so that addProperties ( ) would work if ( feature . properties ( ) != null ) { return feature ; } return new Feature ( TYPE , feature . bbox ( ) , feature . id ( ) , feature . geometry ( ) , new JsonObject ( ) ) ;
public class BaseGridScreen { /** * Display this screen in html input format . * @ return true if default params were found for this form . * @ param out The http output stream . * @ exception DBException File exception . */ public boolean printData ( PrintWriter out , int iPrintOptions ) { } }
boolean bFieldsFound = false ; iPrintOptions = this . printStartGridScreenData ( out , iPrintOptions ) ; Record record = this . getMainRecord ( ) ; if ( record == null ) return bFieldsFound ; int iNumCols = this . getSFieldCount ( ) ; int iLimit = DEFAULT_LIMIT ; String strParamLimit = this . getProperty ( LIMIT_PARAM ) ; // Display screen if ( ( strParamLimit != null ) && ( strParamLimit . length ( ) > 0 ) ) { try { iLimit = Integer . parseInt ( strParamLimit ) ; } catch ( NumberFormatException e ) { iLimit = DEFAULT_LIMIT ; } } int iFieldCount = 0 ; for ( int i = 0 ; i < iNumCols ; i ++ ) { if ( ! ( this . getSField ( i ) instanceof BasePanel ) ) iFieldCount ++ ; } if ( iFieldCount > 0 ) { bFieldsFound = true ; BasePanel scrHeading = this . getReportHeading ( ) ; if ( scrHeading != null ) scrHeading . printData ( out , iPrintOptions | HtmlConstants . MAIN_HEADING_SCREEN ) ; BasePanel scrDetail = this . getReportDetail ( ) ; this . printStartRecordGridData ( out , iPrintOptions ) ; this . printNavButtonControls ( out , iPrintOptions ) ; // for entire data try { boolean bHeadingFootingExists = this . isAnyHeadingFooting ( ) ; record = this . getNextRecord ( out , iPrintOptions , true , bHeadingFootingExists ) ; while ( record != null ) { this . printStartRecordData ( record , out , iPrintOptions ) ; if ( bHeadingFootingExists ) this . printHeadingFootingData ( out , iPrintOptions | HtmlConstants . HEADING_SCREEN | HtmlConstants . DETAIL_SCREEN ) ; bFieldsFound = super . printData ( out , ( iPrintOptions & ( ~ HtmlConstants . HTML_ADD_DESC_COLUMN ) ) | HtmlConstants . MAIN_SCREEN ) ; // Don ' t add description if ( scrDetail != null ) scrDetail . printData ( out , iPrintOptions | HtmlConstants . DETAIL_SCREEN ) ; Record recordNext = this . getNextRecord ( out , iPrintOptions , false , bHeadingFootingExists ) ; this . printEndRecordData ( record , out , iPrintOptions ) ; record = recordNext ; if ( -- iLimit == 0 ) break ; // Max rows displayed } } catch ( DBException ex ) { ex . printStackTrace ( ) ; } this . printEndRecordGridData ( out , iPrintOptions ) ; BasePanel scrFooting = this . getReportFooting ( ) ; if ( scrFooting != null ) scrFooting . printData ( out , iPrintOptions | HtmlConstants . MAIN_FOOTING_SCREEN ) ; } this . printEndGridScreenData ( out , iPrintOptions ) ; return bFieldsFound ;
public class GSECOLImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public boolean eIsSet ( int featureID ) { } }
switch ( featureID ) { case AfplibPackage . GSECOL__COLOR : return COLOR_EDEFAULT == null ? color != null : ! COLOR_EDEFAULT . equals ( color ) ; } return super . eIsSet ( featureID ) ;
public class ComponentSupport { /** * Marks all direct children and Facets with an attribute for deletion . * @ deprecated use FaceletCompositionContext . markForDeletion * @ see # finalizeForDeletion ( UIComponent ) * @ param component * UIComponent to mark */ @ Deprecated public static void markForDeletion ( UIComponent component ) { } }
// flag this component as deleted component . getAttributes ( ) . put ( MARK_DELETED , Boolean . TRUE ) ; Iterator < UIComponent > iter = component . getFacetsAndChildren ( ) ; while ( iter . hasNext ( ) ) { UIComponent child = iter . next ( ) ; if ( child . getAttributes ( ) . containsKey ( MARK_CREATED ) ) { child . getAttributes ( ) . put ( MARK_DELETED , Boolean . TRUE ) ; } }
public class ProcessUtils { /** * Kills the Operating System ( OS ) process identified by the process ID ( PID ) . * @ param processId ID of the process to kill . * @ return a boolean value indicating whether the process identified by the process ID ( ID ) * was successfully terminated . * @ see Runtime # exec ( String ) */ public static boolean kill ( int processId ) { } }
String killCommand = String . format ( "%s %d" , ( SystemUtils . isWindows ( ) ? WINDOWS_KILL_COMMAND : UNIX_KILL_COMMAND ) , processId ) ; try { Process killProcess = Runtime . getRuntime ( ) . exec ( killCommand ) ; return killProcess . waitFor ( KILL_WAIT_TIMEOUT , KILL_WAIT_TIME_UNIT ) ; } catch ( Throwable ignore ) { return false ; }
public class RevisionDataOutputStream { /** * { @ inheritDoc } * Encodes the given UUID as a sequence of 2 Longs , withe the Most Significant Bits first , followed by Least * Significant bits . * @ param uuid The value to encode . */ @ Override public void writeUUID ( UUID uuid ) throws IOException { } }
writeLong ( uuid . getMostSignificantBits ( ) ) ; writeLong ( uuid . getLeastSignificantBits ( ) ) ;
public class FactoryInterpolation { /** * Returns { @ link InterpolatePixelS } of the specified type . * @ param min Minimum possible pixel value . Inclusive . * @ param max Maximum possible pixel value . Inclusive . * @ param type Type of interpolation . * @ param dataType Type of gray - scale image * @ return Interpolation for single band image */ public static < T extends ImageGray < T > > InterpolatePixelS < T > createPixelS ( double min , double max , InterpolationType type , BorderType borderType , ImageDataType dataType ) { } }
Class t = ImageDataType . typeToSingleClass ( dataType ) ; return createPixelS ( min , max , type , borderType , t ) ;
public class SSLComponent { /** * Protected so it can be called via unit test . * @ return */ Map < String , WSKeyStore > getKeyStores ( ) { } }
Map < String , WSKeyStore > ret = new HashMap < String , WSKeyStore > ( keystoreIdMap ) ; ret . putAll ( keystorePidMap ) ; return ret ;
public class RecurlyClient { /** * Delete an existing shipping address * @ param accountCode recurly account id * @ param shippingAddressId the shipping address id to delete */ public void deleteShippingAddress ( final String accountCode , final long shippingAddressId ) { } }
doDELETE ( Accounts . ACCOUNTS_RESOURCE + "/" + accountCode + ShippingAddresses . SHIPPING_ADDRESSES_RESOURCE + "/" + shippingAddressId ) ;
public class DefaultConnectionManager { /** * { @ inheritDoc } * @ see jp . co . future . uroborosql . connection . ConnectionManager # getConnection ( java . lang . String ) */ @ Override public Connection getConnection ( final String alias ) { } }
if ( conn == null ) { conn = connectionSupplier . getConnection ( alias ) ; } return conn ;
public class Intersectiond { /** * Determine the closest point on the triangle with the vertices < code > v0 < / code > , < code > v1 < / code > , < code > v2 < / code > * between that triangle and the given point < code > p < / code > and store that point into the given < code > result < / code > . * Additionally , this method returns whether the closest point is a vertex ( { @ link # POINT _ ON _ TRIANGLE _ VERTEX _ 0 } , { @ link # POINT _ ON _ TRIANGLE _ VERTEX _ 1 } , { @ link # POINT _ ON _ TRIANGLE _ VERTEX _ 2 } ) * of the triangle , lies on an edge ( { @ link # POINT _ ON _ TRIANGLE _ EDGE _ 01 } , { @ link # POINT _ ON _ TRIANGLE _ EDGE _ 12 } , { @ link # POINT _ ON _ TRIANGLE _ EDGE _ 20 } ) * or on the { @ link # POINT _ ON _ TRIANGLE _ FACE face } of the triangle . * Reference : Book " Real - Time Collision Detection " chapter 5.1.5 " Closest Point on Triangle to Point " * @ param v0 * the first vertex of the triangle * @ param v1 * the second vertex of the triangle * @ param v2 * the third vertex of the triangle * @ param p * the point * @ param result * will hold the closest point * @ return one of { @ link # POINT _ ON _ TRIANGLE _ VERTEX _ 0 } , { @ link # POINT _ ON _ TRIANGLE _ VERTEX _ 1 } , { @ link # POINT _ ON _ TRIANGLE _ VERTEX _ 2 } , * { @ link # POINT _ ON _ TRIANGLE _ EDGE _ 01 } , { @ link # POINT _ ON _ TRIANGLE _ EDGE _ 12 } , { @ link # POINT _ ON _ TRIANGLE _ EDGE _ 20 } or * { @ link # POINT _ ON _ TRIANGLE _ FACE } */ public static int findClosestPointOnTriangle ( Vector2dc v0 , Vector2dc v1 , Vector2dc v2 , Vector2dc p , Vector2d result ) { } }
return findClosestPointOnTriangle ( v0 . x ( ) , v0 . y ( ) , v1 . x ( ) , v1 . y ( ) , v2 . x ( ) , v2 . y ( ) , p . x ( ) , p . y ( ) , result ) ;
public class ExtensionIndexService { /** * { @ inheritDoc } */ public synchronized void addDeployedExtension ( ModuleIdentifier identifier , ExtensionInfo extensionInfo ) { } }
final ExtensionJar extensionJar = new ExtensionJar ( identifier , extensionInfo ) ; Set < ExtensionJar > jars = this . extensions . get ( extensionInfo . getName ( ) ) ; if ( jars == null ) { this . extensions . put ( extensionInfo . getName ( ) , jars = new HashSet < ExtensionJar > ( ) ) ; } jars . add ( extensionJar ) ;
public class ProcessorUtilities { /** * Replaces the escaped chars with their normal counterpart . Only replaces ( ' [ ' , ' ] ' , ' ( ' , ' ) ' , ' ; ' , ' , ' , ' + ' , ' - ' and ' = ' ) * @ param input The string to have all its escaped characters replaced . * @ return The input string with the escaped characters replaced back to normal . */ public static String replaceEscapeChars ( final String input ) { } }
if ( input == null ) return null ; String retValue = LEFT_SQUARE_BRACKET_PATTERN . matcher ( input ) . replaceAll ( "[" ) ; retValue = RIGHT_SQUARE_BRACKET_PATTERN . matcher ( retValue ) . replaceAll ( "]" ) ; retValue = LEFT_BRACKET_PATTERN . matcher ( retValue ) . replaceAll ( "(" ) ; retValue = RIGHT_BRACKET_PATTERN . matcher ( retValue ) . replaceAll ( ")" ) ; retValue = COLON_PATTERN . matcher ( retValue ) . replaceAll ( ":" ) ; retValue = COMMA_PATTERN . matcher ( retValue ) . replaceAll ( "," ) ; retValue = EQUALS_PATTERN . matcher ( retValue ) . replaceAll ( "=" ) ; retValue = PLUS_PATTERN . matcher ( retValue ) . replaceAll ( "+" ) ; return MINUS_PATTERN . matcher ( retValue ) . replaceAll ( "-" ) ;
public class PHPFixture { /** * { @ inheritDoc } */ public Message check ( String arg0 ) throws NoSuchMessageException { } }
String methodName = Helper . purge ( arg0 ) ; LOGGER . debug ( "Check for class " + desc + ", method " + methodName ) ; PHPMethodDescriptor meth = findMethod ( desc , methodName ) ; if ( meth == null ) { LOGGER . error ( "Method not found on class " + desc + ", method " + methodName ) ; throw new NoSuchMessageException ( methodName + " for class " + desc ) ; } return new PHPMessage ( meth , id , true ) ;
public class CalendarAstronomer { /** * Convert from ecliptic to equatorial coordinates . * @ param eclipLong The ecliptic longitude * @ param eclipLat The ecliptic latitude * @ return The corresponding point in equatorial coordinates . * @ hide draft / provisional / internal are hidden on Android */ public final Equatorial eclipticToEquatorial ( double eclipLong , double eclipLat ) { } }
// See page 42 of " Practial Astronomy with your Calculator " , // by Peter Duffet - Smith , for details on the algorithm . double obliq = eclipticObliquity ( ) ; double sinE = Math . sin ( obliq ) ; double cosE = Math . cos ( obliq ) ; double sinL = Math . sin ( eclipLong ) ; double cosL = Math . cos ( eclipLong ) ; double sinB = Math . sin ( eclipLat ) ; double cosB = Math . cos ( eclipLat ) ; double tanB = Math . tan ( eclipLat ) ; return new Equatorial ( Math . atan2 ( sinL * cosE - tanB * sinE , cosL ) , Math . asin ( sinB * cosE + cosB * sinE * sinL ) ) ;
public class Neighbour { /** * Add a PubSubOutputHandler to the list of PubSubOutputHandlers that this neighbour * knows about . */ protected void addPubSubOutputHandler ( PubSubOutputHandler handler ) { } }
if ( iPubSubOutputHandlers == null ) iPubSubOutputHandlers = new HashSet ( ) ; // Add the PubSubOutputHandler to the list that this neighbour // knows about . This is so a recovered neighbour can add the list of // output handlers back into the matchspace . iPubSubOutputHandlers . add ( handler ) ;
public class ClassInfoScreen { /** * Set up all the screen fields . */ public void setupSFields ( ) { } }
this . getRecord ( ClassInfo . CLASS_INFO_FILE ) . getField ( ClassInfo . CLASS_NAME ) . setupDefaultView ( this . getNextLocation ( ScreenConstants . NEXT_LOGICAL , ScreenConstants . ANCHOR_DEFAULT ) , this , ScreenConstants . DEFAULT_DISPLAY ) ; this . getRecord ( ClassInfo . CLASS_INFO_FILE ) . getField ( ClassInfo . BASE_CLASS_NAME ) . setupDefaultView ( this . getNextLocation ( ScreenConstants . NEXT_LOGICAL , ScreenConstants . ANCHOR_DEFAULT ) , this , ScreenConstants . DEFAULT_DISPLAY ) ;
public class SpaceGroup { /** * Gets all transformations except for the identity in crystal axes basis . * @ return */ public List < Matrix4d > getTransformations ( ) { } }
List < Matrix4d > transfs = new ArrayList < Matrix4d > ( ) ; for ( int i = 1 ; i < this . transformations . size ( ) ; i ++ ) { transfs . add ( transformations . get ( i ) ) ; } return transfs ;
public class AbstractDataBinder { /** * Sets , whether data should be cached , or not . * @ param useCache * True , if data should be cached , false otherwise . */ public final void useCache ( final boolean useCache ) { } }
synchronized ( cache ) { this . useCache = useCache ; logger . logDebug ( getClass ( ) , useCache ? "Enabled" : "Disabled" + " caching" ) ; if ( ! useCache ) { clearCache ( ) ; } }
public class TimeOfDay { /** * Returns a copy of this time with the specified period added , * wrapping to what would be a new day if required . * If the addition is zero , then < code > this < / code > is returned . * Fields in the period that aren ' t present in the partial are ignored . * This method is typically used to add multiple copies of complex * period instances . Adding one field is best achieved using methods * like { @ link # withFieldAdded ( DurationFieldType , int ) } * or { @ link # plusHours ( int ) } . * @ param period the period to add to this one , null means zero * @ param scalar the amount of times to add , such as - 1 to subtract once * @ return a copy of this instance with the period added * @ throws ArithmeticException if the new datetime exceeds the capacity */ public TimeOfDay withPeriodAdded ( ReadablePeriod period , int scalar ) { } }
if ( period == null || scalar == 0 ) { return this ; } int [ ] newValues = getValues ( ) ; for ( int i = 0 ; i < period . size ( ) ; i ++ ) { DurationFieldType fieldType = period . getFieldType ( i ) ; int index = indexOf ( fieldType ) ; if ( index >= 0 ) { newValues = getField ( index ) . addWrapPartial ( this , index , newValues , FieldUtils . safeMultiply ( period . getValue ( i ) , scalar ) ) ; } } return new TimeOfDay ( this , newValues ) ;
public class ResourceUtil { /** * Returns ' true ' is this resource represents a ' file ' witch can be displayed ( a HTML file ) . */ public static boolean isRenderableFile ( Resource resource ) { } }
boolean result = false ; try { Node node = resource . adaptTo ( Node . class ) ; if ( node != null ) { NodeType type = node . getPrimaryNodeType ( ) ; if ( ResourceUtil . TYPE_FILE . equals ( type . getName ( ) ) ) { String resoureName = resource . getName ( ) ; result = resoureName . toLowerCase ( ) . endsWith ( LinkUtil . EXT_HTML ) ; } } } catch ( RepositoryException e ) { // ok , not renderable } return result ;
public class PropertiesEscape { /** * Perform a Java Properties Key level 2 ( basic set and all non - ASCII chars ) < strong > escape < / strong > operation * on a < tt > char [ ] < / tt > input . * < em > Level 2 < / em > means this method will escape : * < ul > * < li > The Java Properties Key basic escape set : * < ul > * < li > The < em > Single Escape Characters < / em > : * < tt > & # 92 ; t < / tt > ( < tt > U + 0009 < / tt > ) , * < tt > & # 92 ; n < / tt > ( < tt > U + 000A < / tt > ) , * < tt > & # 92 ; f < / tt > ( < tt > U + 000C < / tt > ) , * < tt > & # 92 ; r < / tt > ( < tt > U + 000D < / tt > ) , * < tt > & # 92 ; & nbsp ; < / tt > ( < tt > U + 0020 < / tt > ) , * < tt > & # 92 ; : < / tt > ( < tt > U + 003A < / tt > ) , * < tt > & # 92 ; = < / tt > ( < tt > U + 003D < / tt > ) and * < tt > & # 92 ; & # 92 ; < / tt > ( < tt > U + 005C < / tt > ) . * < / li > * < li > * Two ranges of non - displayable , control characters ( some of which are already part of the * < em > single escape characters < / em > list ) : < tt > U + 0000 < / tt > to < tt > U + 001F < / tt > * and < tt > U + 007F < / tt > to < tt > U + 009F < / tt > . * < / li > * < / ul > * < / li > * < li > All non ASCII characters . < / li > * < / ul > * This escape will be performed by using the Single Escape Chars whenever possible . For escaped * characters that do not have an associated SEC , default to < tt > & # 92 ; uFFFF < / tt > * Hexadecimal Escapes . * This method calls { @ link # escapePropertiesKey ( char [ ] , int , int , java . io . Writer , PropertiesKeyEscapeLevel ) } * with the following preconfigured values : * < ul > * < li > < tt > level < / tt > : * { @ link PropertiesKeyEscapeLevel # LEVEL _ 2 _ ALL _ NON _ ASCII _ PLUS _ BASIC _ ESCAPE _ SET } < / li > * < / ul > * This method is < strong > thread - safe < / strong > . * @ param text the < tt > char [ ] < / tt > to be escaped . * @ param offset the position in < tt > text < / tt > at which the escape operation should start . * @ param len the number of characters in < tt > text < / tt > that should be escaped . * @ param writer the < tt > java . io . Writer < / tt > to which the escaped result will be written . Nothing will * be written at all to this writer if input is < tt > null < / tt > . * @ throws IOException if an input / output exception occurs */ public static void escapePropertiesKey ( final char [ ] text , final int offset , final int len , final Writer writer ) throws IOException { } }
escapePropertiesKey ( text , offset , len , writer , PropertiesKeyEscapeLevel . LEVEL_2_ALL_NON_ASCII_PLUS_BASIC_ESCAPE_SET ) ;
public class PicocliBaseScript { /** * Return the CommandLine for this script . * If there isn ' t one already , then create it using { @ link # createCommandLine ( ) } . * @ return the CommandLine for this script . */ protected CommandLine getOrCreateCommandLine ( ) { } }
try { CommandLine commandLine = ( CommandLine ) getProperty ( COMMAND_LINE ) ; if ( commandLine == null ) { commandLine = createCommandLine ( ) ; // The script has a real property ( a field or getter ) but if we let Script . setProperty handle // this then it just gets stuffed into a binding that shadows the property . // This is somewhat related to other bugged behavior in Script wrt properties and bindings . // See http : / / jira . codehaus . org / browse / GROOVY - 6582 for example . // The correct behavior for Script . setProperty would be to check whether // the property has a setter before creating a new script binding . this . getMetaClass ( ) . setProperty ( this , COMMAND_LINE , commandLine ) ; } return commandLine ; } catch ( MissingPropertyException mpe ) { CommandLine commandLine = createCommandLine ( ) ; // Since no property or binding already exists , we can use plain old setProperty here . setProperty ( COMMAND_LINE , commandLine ) ; return commandLine ; }
public class ServerCommsDiagnosticModule { /** * Dump out all outbound ME to ME conversations . * @ param is the incident stream to log information to . */ private void dumpMEtoMEConversations ( final IncidentStream is ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "dumpMEtoMEConversations" , is ) ; final ServerConnectionManager scm = ServerConnectionManager . getRef ( ) ; final List obc = scm . getActiveOutboundMEtoMEConversations ( ) ; is . writeLine ( "" , "" ) ; is . writeLine ( "\n------ ME to ME Conversation Dump ------ " , ">" ) ; if ( obc != null ) { // Build a map of connection - > conversation so that we can output the // connection information once per set of conversations . final Map < Object , LinkedList < Conversation > > connectionToConversationMap = convertToMap ( is , obc ) ; // Go through the map and dump out a connection - followed by its conversations for ( final Iterator < Entry < Object , LinkedList < Conversation > > > i = connectionToConversationMap . entrySet ( ) . iterator ( ) ; i . hasNext ( ) ; ) { final Entry < Object , LinkedList < Conversation > > entry = i . next ( ) ; is . writeLine ( "\nOutbound connection:" , entry . getKey ( ) ) ; final LinkedList conversationList = entry . getValue ( ) ; while ( ! conversationList . isEmpty ( ) ) { final Conversation c = ( Conversation ) conversationList . removeFirst ( ) ; is . writeLine ( "\nOutbound Conversation[" + c . getId ( ) + "]: " , c . getFullSummary ( ) ) ; try { dumpMEtoMEConversation ( is , c ) ; } catch ( Throwable t ) { // No FFDC Code Needed is . writeLine ( "\nUnable to dump conversation" , t ) ; } } } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "dumpMEtoMEConversations" ) ;
public class RepeatableFileInputStream { /** * Resets the input stream to the last mark point , or the beginning of the * stream if there is no mark point , by creating a new FileInputStream based * on the underlying file . * @ throws IOException * when the FileInputStream cannot be re - created . */ @ Override public void reset ( ) throws IOException { } }
this . fis . close ( ) ; abortIfNeeded ( ) ; this . fis = new FileInputStream ( file ) ; long skipped = 0 ; long toSkip = markPoint ; while ( toSkip > 0 ) { skipped = this . fis . skip ( toSkip ) ; toSkip -= skipped ; } if ( log . isDebugEnabled ( ) ) { log . debug ( "Reset to mark point " + markPoint + " after returning " + bytesReadPastMarkPoint + " bytes" ) ; } this . bytesReadPastMarkPoint = 0 ;
public class SarlBatchCompiler { /** * Compile the java files after the compilation of the project ' s files . * @ param progress monitor of the progress of the compilation . * @ return the success status . Replies < code > false < / code > if the activity is canceled . */ protected boolean postCompileJava ( IProgressMonitor progress ) { } }
assert progress != null ; progress . subTask ( Messages . SarlBatchCompiler_52 ) ; final File classOutputPath = getClassOutputPath ( ) ; if ( classOutputPath == null ) { getLogger ( ) . info ( Messages . SarlBatchCompiler_24 ) ; return true ; } getLogger ( ) . info ( Messages . SarlBatchCompiler_25 ) ; final Iterable < File > sources = Iterables . concat ( getSourcePaths ( ) , Collections . singleton ( getOutputPath ( ) ) ) ; if ( getLogger ( ) . isDebugEnabled ( ) ) { getLogger ( ) . debug ( Messages . SarlBatchCompiler_29 , toPathString ( sources ) ) ; } final List < File > classpath = getClassPath ( ) ; if ( getLogger ( ) . isDebugEnabled ( ) ) { getLogger ( ) . debug ( Messages . SarlBatchCompiler_30 , toPathString ( classpath ) ) ; } return runJavaCompiler ( classOutputPath , sources , classpath , true , true , progress ) ;
public class MPBase { /** * Process the method to call the api * @ param clazz a MPBase extended class * @ param resource an instance of the MPBase extended class , if its called from a non static method * @ param methodName a String with the decorated method to be processed * @ param mapParams a hashmap with the args passed in the call of the method * @ param useCache a Boolean flag that indicates if the cache must be used * @ return a resourse obj fill with the api response * @ throws MPException */ protected static < T extends MPBase > T processMethod ( Class clazz , T resource , String methodName , HashMap < String , String > mapParams , Boolean useCache ) throws MPException { } }
if ( resource == null ) { try { resource = ( T ) clazz . newInstance ( ) ; } catch ( Exception ex ) { throw new MPException ( ex ) ; } } // Validates the method executed if ( ! ALLOWED_METHODS . contains ( methodName ) ) { throw new MPException ( "Method \"" + methodName + "\" not allowed" ) ; } AnnotatedElement annotatedMethod = getAnnotatedMethod ( clazz , methodName ) ; HashMap < String , Object > hashAnnotation = getRestInformation ( annotatedMethod ) ; HttpMethod httpMethod = ( HttpMethod ) hashAnnotation . get ( "method" ) ; String path = parsePath ( hashAnnotation . get ( "path" ) . toString ( ) , mapParams , resource ) ; int retries = Integer . valueOf ( hashAnnotation . get ( "retries" ) . toString ( ) ) ; int connectionTimeout = Integer . valueOf ( hashAnnotation . get ( "connectionTimeout" ) . toString ( ) ) ; int socketTimeout = Integer . valueOf ( hashAnnotation . get ( "socketTimeout" ) . toString ( ) ) ; if ( METHODS_TO_VALIDATE . contains ( methodName ) ) { // Validator will throw an MPValidatorException , there is no need to do a conditional MPValidator . validate ( resource ) ; } PayloadType payloadType = ( PayloadType ) hashAnnotation . get ( "payloadType" ) ; JsonObject payload = generatePayload ( httpMethod , resource ) ; Collection < Header > colHeaders = getStandardHeaders ( ) ; if ( StringUtils . isNotEmpty ( resource . getIdempotenceKey ( ) ) ) { colHeaders . add ( new BasicHeader ( "x-idempotency-key" , resource . getIdempotenceKey ( ) ) ) ; } MPApiResponse response = callApi ( httpMethod , path , payloadType , payload , colHeaders , retries , connectionTimeout , socketTimeout , useCache ) ; if ( response . getStatusCode ( ) >= 200 && response . getStatusCode ( ) < 300 ) { if ( httpMethod != HttpMethod . DELETE ) { resource = fillResourceWithResponseData ( resource , response ) ; } else { resource = cleanResource ( resource ) ; } } resource . lastApiResponse = response ; return resource ;
public class LdapAdapter { /** * Delete the descendants of the specified ldap entry . * @ param ldapEntry * @ param delDescendant * @ return * @ throws WIMException */ private List < LdapEntry > deleteAll ( LdapEntry ldapEntry , boolean delDescendant ) throws WIMException { } }
String dn = ldapEntry . getDN ( ) ; List < LdapEntry > delEntries = new ArrayList < LdapEntry > ( ) ; List < LdapEntry > descs = getDescendants ( dn , SearchControls . ONELEVEL_SCOPE ) ; if ( descs . size ( ) > 0 ) { if ( delDescendant ) { for ( int i = 0 ; i < descs . size ( ) ; i ++ ) { LdapEntry descEntry = descs . get ( i ) ; delEntries . addAll ( deleteAll ( descEntry , true ) ) ; } } else { throw new EntityHasDescendantsException ( WIMMessageKey . ENTITY_HAS_DESCENDENTS , Tr . formatMessage ( tc , WIMMessageKey . ENTITY_HAS_DESCENDENTS , WIMMessageHelper . generateMsgParms ( dn ) ) ) ; } } /* Call the preexit function */ deletePreExit ( dn ) ; List < String > grpList = getGroups ( dn ) ; iLdapConn . getContextManager ( ) . destroySubcontext ( dn ) ; delEntries . add ( ldapEntry ) ; for ( int i = 0 ; i < grpList . size ( ) ; i ++ ) { String grpDN = grpList . get ( i ) ; iLdapConn . invalidateAttributes ( grpDN , null , null ) ; } return delEntries ;
public class AbstractTransactionalConnectionManager { /** * { @ inheritDoc } */ public void transactionStarted ( ConnectionListener cl ) throws ResourceException { } }
try { if ( ! cl . isEnlisted ( ) && TxUtils . isUncommitted ( ti . getTransactionManager ( ) . getTransaction ( ) ) && shouldEnlist ( cl ) ) cl . enlist ( ) ; } catch ( ResourceException re ) { throw re ; } catch ( Exception e ) { throw new ResourceException ( e ) ; }
public class AllClassificationCombinations { /** * Returns list of bottom level classes */ public List < Classification . RuntimeClassification > getClassifications ( ) { } }
List < Classification . RuntimeClassification > result = new ArrayList < > ( ) ; getClassifications ( result , tree . getRoot ( ) ) ; return result ;
public class VdmCompletionContext { /** * Constructs the completion context for a constructor call * @ param index */ private void consConstructorCallContext ( ) { } }
// This gives us everything after new , e . g . ' MyClass ' if you type ' new MyClass ' proposalPrefix = rawScan . subSequence ( rawScan . indexOf ( "new" ) , rawScan . length ( ) ) . toString ( ) ; processedScan = rawScan ; // new StringBuffer ( subSeq ) ; type = SearchType . New ;
public class Path3d { /** * Change the coordinates of the last inserted point . * If the point in parameter is modified , the path will be changed also . * @ param point */ public void setLastPoint ( Point3d point ) { } }
if ( this . numCoordsProperty . get ( ) >= 3 ) { this . coordsProperty [ this . numCoordsProperty . get ( ) - 3 ] = point . xProperty ; this . coordsProperty [ this . numCoordsProperty . get ( ) - 2 ] = point . yProperty ; this . coordsProperty [ this . numCoordsProperty . get ( ) - 1 ] = point . zProperty ; this . graphicalBounds = null ; this . logicalBounds = null ; }
public class Bits { /** * A { @ link BitReader } that sources bits from a < code > FileChannel < / code > . * This stream operates with a byte buffer . This will generally improve * performance in applications that skip forwards or backwards across the * file . * Note that using a direct ByteBuffer should generally yield better * performance . * @ param channel * the file channel from which bits are to be read * @ param buffer * the buffer used to store file data * @ return a bit reader over the channel */ public static BitReader readerFrom ( FileChannel channel , ByteBuffer buffer ) { } }
if ( channel == null ) throw new IllegalArgumentException ( "null channel" ) ; if ( buffer == null ) throw new IllegalArgumentException ( "null buffer" ) ; return new FileChannelBitReader ( channel , buffer ) ;
public class Expression { /** * Creates a code chunk representing a JavaScript regular expression literal . * @ param contents The regex literal ( including the opening and closing slashes ) . */ public static Expression regexLiteral ( String contents ) { } }
int firstSlash = contents . indexOf ( '/' ) ; int lastSlash = contents . lastIndexOf ( '/' ) ; checkArgument ( firstSlash < lastSlash && firstSlash != - 1 , "expected regex to start with a '/' and have a second '/' near the end, got %s" , contents ) ; return Leaf . create ( contents , /* isCheap = */ false ) ;
public class HttpSessionEventPublisher { /** * Handles the HttpSessionEvent by publishing a { @ link HttpSessionCreationEvent } to the * application appContext . * @ param event HttpSessionEvent passed in by the container */ public void sessionCreated ( HttpSessionEvent event ) { } }
if ( null == eventMulticaster ) { eventMulticaster = Containers . getRoot ( ) . getBean ( EventMulticaster . class ) . get ( ) ; Assert . notNull ( eventMulticaster ) ; } eventMulticaster . multicast ( new HttpSessionCreationEvent ( event . getSession ( ) ) ) ;
public class PdfContentByte { /** * Create a new uncolored tiling pattern . * @ param width the width of the pattern * @ param height the height of the pattern * @ param xstep the desired horizontal spacing between pattern cells . * May be either positive or negative , but not zero . * @ param ystep the desired vertical spacing between pattern cells . * May be either positive or negative , but not zero . * @ param color the default color . Can be < CODE > null < / CODE > * @ return the < CODE > PdfPatternPainter < / CODE > where the pattern will be created */ public PdfPatternPainter createPattern ( float width , float height , float xstep , float ystep , Color color ) { } }
checkWriter ( ) ; if ( xstep == 0.0f || ystep == 0.0f ) throw new RuntimeException ( "XStep or YStep can not be ZERO." ) ; PdfPatternPainter painter = new PdfPatternPainter ( writer , color ) ; painter . setWidth ( width ) ; painter . setHeight ( height ) ; painter . setXStep ( xstep ) ; painter . setYStep ( ystep ) ; writer . addSimplePattern ( painter ) ; return painter ;
public class VirtualNetworkGatewaysInner { /** * Generates VPN client package for P2S client of the virtual network gateway in the specified resource group . * @ param resourceGroupName The name of the resource group . * @ param virtualNetworkGatewayName The name of the virtual network gateway . * @ param parameters Parameters supplied to the generate virtual network gateway VPN client package operation . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ throws CloudException thrown if the request is rejected by server * @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @ return the String object if successful . */ public String generatevpnclientpackage ( String resourceGroupName , String virtualNetworkGatewayName , VpnClientParameters parameters ) { } }
return generatevpnclientpackageWithServiceResponseAsync ( resourceGroupName , virtualNetworkGatewayName , parameters ) . toBlocking ( ) . last ( ) . body ( ) ;
public class YScreenField { /** * Display the applet html screen . * @ exception DBException File exception . */ public void printAppletHtmlScreen ( PrintWriter out , ResourceBundle reg ) throws DBException { } }
reg = ( ( BaseApplication ) this . getTask ( ) . getApplication ( ) ) . getResources ( "HtmlApplet" , false ) ; Map < String , Object > propApplet = new Hashtable < String , Object > ( ) ; Task task = this . getTask ( ) ; Map < String , Object > properties = null ; if ( task instanceof ServletTask ) properties = ( ( ServletTask ) task ) . getRequestProperties ( ( ( ServletTask ) task ) . getServletRequest ( ) , true ) ; else properties = task . getProperties ( ) ; properties = ( ( AppletHtmlScreen ) this . getScreenField ( ) ) . getAppletProperties ( propApplet , properties ) ; out . println ( "<center>" ) ; char DEFAULT = ' ' ; char ch = ScreenFieldViewAdapter . getFirstToUpper ( this . getProperty ( DBParams . JAVA ) , DEFAULT ) ; if ( ch == DEFAULT ) if ( this . getTask ( ) instanceof ServletTask ) { // Default - ' P ' lug - in / ' A ' pplet depends on browser ch = 'P' ; // by Default - use plug - in HttpServletRequest req = ( ( ServletTask ) this . getTask ( ) ) . getServletRequest ( ) ; Enumeration < ? > e = req . getHeaderNames ( ) ; while ( e . hasMoreElements ( ) ) { String name = ( String ) e . nextElement ( ) ; String value = req . getHeader ( name ) ; if ( ( name != null ) && ( name . equalsIgnoreCase ( "User-Agent" ) ) && ( value != null ) ) { // This is what I ' m looking for . . . the browser type value = value . toUpperCase ( ) ; if ( value . indexOf ( "MOZILLA/5" ) != - 1 ) ch = UserInfoModel . WEBSTART . charAt ( 0 ) ; // Browser 5 . x . . . Use plug - in ( yeah ! ) if ( value . indexOf ( "MOZILLA/4" ) != - 1 ) ch = UserInfoModel . WEBSTART . charAt ( 0 ) ; // Browser 4 . x . . . must use plug - in if ( value . indexOf ( "MSIE" ) != - 1 ) ch = UserInfoModel . WEBSTART . charAt ( 0 ) ; // Microsoft . . . must use plug - in if ( value . indexOf ( "WEBKIT" ) != - 1 ) ch = UserInfoModel . WEBSTART . charAt ( 0 ) ; // Chrome / Safari . . . must use plug - in if ( value . indexOf ( "CHROME" ) != - 1 ) ch = UserInfoModel . WEBSTART . charAt ( 0 ) ; // Chrome . . . must use plug - in if ( value . indexOf ( "SAFARI" ) != - 1 ) ch = UserInfoModel . WEBSTART . charAt ( 0 ) ; // Safari . . . must use plug - in break ; } } } if ( ch != UserInfoModel . PLUG_IN . charAt ( 0 ) ) { // Not the plug - in , use jnlp applet tags String strWebStartResourceName = this . getProperty ( "webStart" ) ; if ( strWebStartResourceName == null ) strWebStartResourceName = "webStart" ; String strApplet = reg . getString ( strWebStartResourceName ) ; String strJnlpURL = reg . getString ( strWebStartResourceName + "Jnlp" ) ; if ( ( strApplet == null ) || ( strApplet . length ( ) == 0 ) ) strApplet = WEB_START_DEFAULT ; StringBuilder sb = new StringBuilder ( strApplet ) ; StringBuffer sbParams = new StringBuffer ( ) ; for ( Map . Entry < String , Object > entry : properties . entrySet ( ) ) { String strKey = ( String ) entry . getKey ( ) ; Object objValue = entry . getValue ( ) ; String strValue = null ; if ( objValue != null ) strValue = objValue . toString ( ) ; if ( strValue != null ) // x if ( strValue . length ( ) > 0) sbParams . append ( strKey + ":\"" + strValue + "\",\n" ) ; } if ( propApplet . get ( HtmlConstants . ARCHIVE ) != null ) sbParams . append ( "archive:\"" + propApplet . get ( HtmlConstants . ARCHIVE ) + "\", \n" ) ; if ( propApplet . get ( HtmlConstants . NAME ) != null ) if ( sbParams . indexOf ( "name:" ) == - 1 ) sbParams . append ( "name:\"" + propApplet . get ( HtmlConstants . NAME ) + "\", \n" ) ; if ( propApplet . get ( HtmlConstants . ID ) != null ) sbParams . append ( "id:\"" + propApplet . get ( HtmlConstants . ID ) + "\", \n" ) ; if ( sbParams . indexOf ( "hash:" ) == - 1 ) sbParams . append ( "hash:location.hash,\n" ) ; if ( sbParams . indexOf ( "draggable:" ) == - 1 ) sbParams . append ( "draggable:true," ) ; Utility . replace ( sb , "{other}" , sbParams . toString ( ) ) ; strJnlpURL = Utility . encodeXML ( this . getJnlpURL ( strJnlpURL , propApplet , properties ) ) ; Utility . replace ( sb , "{jnlpURL}" , strJnlpURL ) ; Utility . replaceResources ( sb , reg , propApplet , null ) ; out . println ( sb . toString ( ) ) ; } else { out . println ( "<OBJECT classid=\"clsid:8AD9C840-044E-11D1-B3E9-00805F499D93\"" ) ; out . println ( " width=\"" + propApplet . get ( HtmlConstants . WIDTH ) + "\"" ) ; out . println ( " height=\"" + propApplet . get ( HtmlConstants . HEIGHT ) + "\"" ) ; if ( propApplet . get ( HtmlConstants . NAME ) != null ) out . println ( " name=\"" + propApplet . get ( HtmlConstants . NAME ) + "\"" ) ; out . println ( " codebase=\"http://java.sun.com/update/1.5.0/jinstall-1_6_0-windows-i586.cab#Version=1,6,0,0\">" ) ; if ( propApplet . get ( HtmlConstants . ARCHIVE ) != null ) out . println ( "<param name=\"ARCHIVE\" value=\"" + propApplet . get ( HtmlConstants . ARCHIVE ) + "\">" ) ; out . println ( "<param name=\"CODE\" value=\"" + propApplet . get ( DBParams . APPLET ) + "\">" ) ; out . println ( "<param name=\"CODEBASE\" value=\"" + propApplet . get ( HtmlConstants . CODEBASE ) + "\">" ) ; for ( Map . Entry < String , Object > entry : properties . entrySet ( ) ) { String strKey = ( String ) entry . getKey ( ) ; Object objValue = entry . getValue ( ) ; String strValue = null ; if ( objValue != null ) strValue = objValue . toString ( ) ; if ( strValue != null ) if ( strValue . length ( ) > 0 ) out . println ( "<param name=\"" + strKey + "\" value=\"" + strValue + "\">" ) ; } out . println ( "<param name=\"type\" value=\"application/x-java-applet;version=1.6.0\">" ) ; out . println ( "<COMMENT>" ) ; out . println ( "<EMBED type=\"application/x-java-applet;version=1.6\"" ) ; if ( propApplet . get ( HtmlConstants . ARCHIVE ) != null ) out . println ( " java_ARCHIVE=\"" + propApplet . get ( HtmlConstants . ARCHIVE ) + "\"" ) ; out . println ( " java_CODE=\"" + propApplet . get ( DBParams . APPLET ) + "\"" ) ; out . println ( " width=\"" + propApplet . get ( HtmlConstants . WIDTH ) + "\"" ) ; out . println ( " height=\"" + propApplet . get ( HtmlConstants . HEIGHT ) + "\"" ) ; if ( propApplet . get ( HtmlConstants . NAME ) != null ) out . println ( " name=\"" + propApplet . get ( HtmlConstants . NAME ) + "\"" ) ; out . println ( " java_CODEBASE=\"" + propApplet . get ( HtmlConstants . CODEBASE ) + "\"" ) ; for ( Map . Entry < String , Object > entry : properties . entrySet ( ) ) { String strKey = ( String ) entry . getKey ( ) ; Object objValue = entry . getValue ( ) ; String strValue = null ; if ( objValue != null ) strValue = objValue . toString ( ) ; if ( strValue != null ) if ( strValue . length ( ) > 0 ) out . println ( " " + strKey + " =\"" + strValue + "\"" ) ; } out . println ( " pluginspage=\"http://java.sun.com/javase/downloads/ea.jsp\"><NOEMBED></COMMENT>" ) ; out . println ( " alt=\"Your browser understands the &lt;APPLET&gt; tag but is not running the applet, for some reason.\"" ) ; out . println ( " Your browser is completely ignoring the &lt;APPLET&gt; tag!" ) ; out . println ( "</NOEMBED></EMBED>" ) ; out . println ( "</OBJECT>" ) ; } out . println ( "</center>" ) ;
public class HeapList { /** * returns true if the value has been added */ public boolean Add ( T value ) { } }
if ( m_Count < m_Capacity ) { m_Array [ ++ m_Count ] = value ; UpHeap ( ) ; } else if ( greaterThan ( m_Array [ 1 ] , value ) ) { m_Array [ 1 ] = value ; DownHeap ( ) ; } else return false ; return true ;
public class SaltAnnotateExtractor { /** * Use the left / right token index of the spans to create spanning relations * when this did not happen yet . * @ param graph * @ param nodeByRankID * @ param numberOfRelations */ private void createMissingSpanningRelations ( SDocumentGraph graph , FastInverseMap < Long , SNode > nodeByRankID , TreeMap < Long , SToken > tokenByIndex , Map < String , ComponentEntry > componentForSpan , AtomicInteger numberOfRelations ) { } }
// add the missing spanning relations for each continuous span of the graph for ( SSpan span : graph . getSpans ( ) ) { long pre = 1 ; RelannisNodeFeature featSpan = RelannisNodeFeature . extract ( span ) ; ComponentEntry spanComponent = componentForSpan . get ( span . getId ( ) ) ; if ( spanComponent != null && featSpan != null && featSpan . getLeftToken ( ) >= 0 && featSpan . getRightToken ( ) >= 0 ) { for ( long i = featSpan . getLeftToken ( ) ; i <= featSpan . getRightToken ( ) ; i ++ ) { SToken tok = tokenByIndex . get ( i ) ; if ( tok != null ) { boolean missing = true ; List < SRelation < SNode , SNode > > existingRelations = graph . getRelations ( span . getId ( ) , tok . getId ( ) ) ; if ( existingRelations != null ) { for ( Relation e : existingRelations ) { if ( e instanceof SSpanningRelation ) { missing = false ; break ; } } } // end if relations exist if ( missing ) { String type = "c" ; SLayer layer = findOrAddSLayer ( spanComponent . getNamespace ( ) , graph ) ; createNewRelation ( graph , span , tok , null , type , spanComponent . getId ( ) , layer , pre ++ , nodeByRankID , numberOfRelations ) ; } } // end if token exists } // end for each covered token index } } // end for each span
public class DTMDefaultBase { /** * Given a node handle , get the index of the node ' s first child . * If not yet resolved , waits for more nodes to be added to the document and * tries again * @ param nodeHandle handle to node , which should probably be an element * node , but need not be . * @ param inScope true if all namespaces in scope should be returned , * false if only the namespace declarations should be * returned . * @ return handle of first namespace , or DTM . NULL to indicate none exists . */ public int getFirstNamespaceNode ( int nodeHandle , boolean inScope ) { } }
if ( inScope ) { int identity = makeNodeIdentity ( nodeHandle ) ; if ( _type ( identity ) == DTM . ELEMENT_NODE ) { SuballocatedIntVector nsContext = findNamespaceContext ( identity ) ; if ( nsContext == null || nsContext . size ( ) < 1 ) return NULL ; return nsContext . elementAt ( 0 ) ; } else return NULL ; } else { // Assume that attributes and namespaces immediately // follow the element . // % OPT % Would things be faster if all NS nodes were built // before all Attr nodes ? Some costs at build time for 2nd // pass . . . int identity = makeNodeIdentity ( nodeHandle ) ; if ( _type ( identity ) == DTM . ELEMENT_NODE ) { while ( DTM . NULL != ( identity = getNextNodeIdentity ( identity ) ) ) { int type = _type ( identity ) ; if ( type == DTM . NAMESPACE_NODE ) return makeNodeHandle ( identity ) ; else if ( DTM . ATTRIBUTE_NODE != type ) break ; } return NULL ; } else return NULL ; }
public class ManagedBackupShortTermRetentionPoliciesInner { /** * Updates a managed database ' s short term retention policy . * @ param resourceGroupName The name of the resource group that contains the resource . You can obtain this value from the Azure Resource Manager API or the portal . * @ param managedInstanceName The name of the managed instance . * @ param databaseName The name of the database . * @ param retentionDays The backup retention period in days . This is how many days Point - in - Time Restore will be supported . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ throws CloudException thrown if the request is rejected by server * @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @ return the ManagedBackupShortTermRetentionPolicyInner object if successful . */ public ManagedBackupShortTermRetentionPolicyInner beginUpdate ( String resourceGroupName , String managedInstanceName , String databaseName , Integer retentionDays ) { } }
return beginUpdateWithServiceResponseAsync ( resourceGroupName , managedInstanceName , databaseName , retentionDays ) . toBlocking ( ) . single ( ) . body ( ) ;
public class PropsUtils { /** * Load job schedules from the given directories * @ param parent The parent properties for these properties * @ param dir The directory to look in * @ param suffixes File suffixes to load * @ return The loaded set of schedules */ public static Props loadPropsInDir ( final Props parent , final File dir , final String ... suffixes ) { } }
try { final Props props = new Props ( parent ) ; final File [ ] files = dir . listFiles ( ) ; Arrays . sort ( files ) ; if ( files != null ) { for ( final File f : files ) { if ( f . isFile ( ) && endsWith ( f , suffixes ) ) { props . putAll ( new Props ( null , f . getAbsolutePath ( ) ) ) ; } } } return props ; } catch ( final IOException e ) { throw new RuntimeException ( "Error loading properties." , e ) ; }
public class AbstractItemLink { /** * Remove while locked for expiry * @ param lockId * @ param transaction * @ throws ProtocolException * @ throws TransactionException * @ throws SevereMessageStoreException */ final void cmdRemoveExpiring ( final long lockId , final PersistentTransaction transaction ) throws ProtocolException , TransactionException , SevereMessageStoreException { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "cmdRemoveExpiring" , new Object [ ] { "Item Link: " + this , "Stream Link: " + _owningStreamLink , formatLockId ( lockId ) , "Transaction: " + transaction } ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "expiring item " + _tuple . getUniqueId ( ) ) ; synchronized ( this ) { if ( ItemLinkState . STATE_LOCKED_FOR_EXPIRY == _itemLinkState ) { if ( _lockID != lockId ) { throw new LockIdMismatch ( _lockID , lockId ) ; } ListStatistics stats = getParentStatistics ( ) ; synchronized ( stats ) { stats . decrementExpiring ( ) ; stats . incrementRemoving ( ) ; } _transactionId = transaction . getPersistentTranId ( ) ; _itemLinkState = ItemLinkState . STATE_REMOVING_EXPIRING ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) SibTr . event ( this , tc , "Invalid Item state: " + _itemLinkState ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "cmdRemoveExpiring" ) ; throw new StateException ( _itemLinkState . toString ( ) ) ; } } final Task task = new RemoveLockedTask ( this ) ; transaction . addWork ( task ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "cmdRemoveExpiring" ) ;
public class HttpServerKeepAliveHandler { /** * Keep - alive only works if the client can detect when the message has ended without relying on the connection being * closed . * < ul > * < li > See < a href = " https : / / tools . ietf . org / html / rfc7230 # section - 6.3 " / > < / li > * < li > See < a href = " https : / / tools . ietf . org / html / rfc7230 # section - 3.3.2 " / > < / li > * < li > See < a href = " https : / / tools . ietf . org / html / rfc7230 # section - 3.3.3 " / > < / li > * < / ul > * @ param response The HttpResponse to check * @ return true if the response has a self defined message length . */ private static boolean isSelfDefinedMessageLength ( HttpResponse response ) { } }
return isContentLengthSet ( response ) || isTransferEncodingChunked ( response ) || isMultipart ( response ) || isInformational ( response ) || response . status ( ) . code ( ) == HttpResponseStatus . NO_CONTENT . code ( ) ;
public class GraphDOT { /** * Renders an { @ link Automaton } in the GraphVIZ DOT format . * @ param automaton * the automaton to render . * @ param inputAlphabet * the input alphabet to consider * @ param a * the appendable to write to * @ throws IOException * if writing to { @ code a } fails */ public static < S , I , T > void write ( Automaton < S , I , T > automaton , Collection < ? extends I > inputAlphabet , Appendable a ) throws IOException { } }
write ( automaton . transitionGraphView ( inputAlphabet ) , a ) ;
public class GLImplementation { /** * Returns a { @ link com . flowpowered . caustic . api . gl . Context } for the { @ link GLImplementation } , loading it if necessary . * @ param glImplementation The GL implementation to look up a factory for * @ return The implementation , as a { @ link com . flowpowered . caustic . api . gl . Context } or null if it couldn ' t be loaded */ public static Context get ( GLImplementation glImplementation ) { } }
if ( ! implementations . containsKey ( glImplementation ) ) { if ( ! load ( glImplementation ) ) { return null ; } } try { return implementations . get ( glImplementation ) . newInstance ( ) ; } catch ( IllegalAccessException | IllegalArgumentException | InstantiationException | InvocationTargetException ex ) { CausticUtil . getCausticLogger ( ) . log ( Level . WARNING , "Couldn't create Context from loaded implementation class" , ex ) ; return null ; }
public class StorageSnippets { /** * Example of retrieving Requester pays status on a bucket . */ public Bucket getRequesterPaysStatus ( String bucketName ) throws StorageException { } }
// [ START get _ requester _ pays _ status ] // Instantiate a Google Cloud Storage client Storage storage = StorageOptions . getDefaultInstance ( ) . getService ( ) ; // The name of the bucket to retrieve requester - pays status , eg . " my - bucket " // String bucketName = " my - bucket " // Retrieve the bucket , throws StorageException on failure Bucket bucket = storage . get ( bucketName , Storage . BucketGetOption . fields ( BucketField . BILLING ) ) ; System . out . println ( "Requester pays status : " + bucket . requesterPays ( ) ) ; // [ END get _ requester _ pays _ status ] return bucket ;
public class AbstractMessage { /** * Convenience static method that converts a JSON string to a particular message object . * @ param json the JSON string * @ param clazz the class whose instance is represented by the JSON string * @ return the message object that was represented by the JSON string */ public static < T extends BasicMessage > T fromJSON ( String json , Class < T > clazz ) { } }
try { Method buildObjectMapperForDeserializationMethod = findBuildObjectMapperForDeserializationMethod ( clazz ) ; final ObjectMapper mapper = ( ObjectMapper ) buildObjectMapperForDeserializationMethod . invoke ( null ) ; if ( FailOnUnknownProperties . class . isAssignableFrom ( clazz ) ) { mapper . configure ( DeserializationFeature . FAIL_ON_UNKNOWN_PROPERTIES , true ) ; } return mapper . readValue ( json , clazz ) ; } catch ( Exception e ) { throw new IllegalStateException ( "JSON message cannot be converted to object of type [" + clazz + "]" , e ) ; }
public class OfflineConversionAdjustmentFeed { /** * Gets the adjustmentType value for this OfflineConversionAdjustmentFeed . * @ return adjustmentType * The adjustment type . * ( RETRACT , RESTATE ) * < span class = " constraint Required " > This field is required * and should not be { @ code null } . < / span > */ public com . google . api . ads . adwords . axis . v201809 . cm . OfflineConversionAdjustmentType getAdjustmentType ( ) { } }
return adjustmentType ;
public class TorqueDBHandling { /** * Adds the input files ( in our case torque schema files ) to use . * @ param srcDir The directory containing the files * @ param listOfFilenames The filenames in a comma - separated list */ public void addDBDefinitionFiles ( String srcDir , String listOfFilenames ) throws IOException { } }
StringTokenizer tokenizer = new StringTokenizer ( listOfFilenames , "," ) ; File dir = new File ( srcDir ) ; String filename ; while ( tokenizer . hasMoreTokens ( ) ) { filename = tokenizer . nextToken ( ) . trim ( ) ; if ( filename . length ( ) > 0 ) { _torqueSchemata . put ( "schema" + _torqueSchemata . size ( ) + ".xml" , readTextCompressed ( new File ( dir , filename ) ) ) ; } }
public class UnscheduledEventMonitor { /** * Invoked periodically by the timer thread */ @ Override public void run ( ) { } }
try { int maxEvents = PropertyManager . getIntegerProperty ( PropertyNames . UNSCHEDULED_EVENTS_BATCH_SIZE , 100 ) ; if ( maxEvents == 0 && hasRun ) // indicates only run at startup ( old behavior ) return ; int minAge = PropertyManager . getIntegerProperty ( PropertyNames . UNSCHEDULED_EVENTS_MIN_AGE , 3600 ) ; if ( minAge < 300 ) { logger . severe ( PropertyNames . UNSCHEDULED_EVENTS_MIN_AGE + " cannot be less than 300 (5 minutes)" ) ; minAge = 300 ; } long curTime = DatabaseAccess . getCurrentTime ( ) ; Date olderThan = new Date ( curTime - minAge * 1000 ) ; Date now = new Date ( curTime ) ; logger . log ( LogLevel . TRACE , "Processing unscheduled events older than " + olderThan + " at: " + now ) ; int count = processUnscheduledEvents ( olderThan , maxEvents ) ; if ( count > 0 ) logger . log ( LogLevel . INFO , "Processing " + count + " unscheduled events at " + new Date ( DatabaseAccess . getCurrentTime ( ) ) ) ; } catch ( Throwable t ) { logger . severeException ( t . getMessage ( ) , t ) ; }
public class Network { /** * Check if a network is available */ public static boolean isAvailable ( Context context ) { } }
boolean connected = false ; ConnectivityManager cm = ( ConnectivityManager ) context . getSystemService ( Context . CONNECTIVITY_SERVICE ) ; if ( cm != null ) { NetworkInfo ni = cm . getActiveNetworkInfo ( ) ; if ( ni != null ) { connected = ni . isConnected ( ) ; } } return connected ;
public class ToolExecutionEnvironment { /** * { @ inheritDoc } */ @ Override public final void setup ( ) { } }
// Setup mandatory environment facets try { if ( log . isDebugEnabled ( ) ) { log . debug ( "ToolExecutionEnvironment setup -- Starting." ) ; } // Build the ClassLoader as required for the JAXB tools holder = builder . buildAndSet ( ) ; // Redirect the JUL logging handler used by the tools to the Maven log . loggingHandlerEnvironmentFacet . setup ( ) ; // If requested , switch the locale if ( localeFacet != null ) { localeFacet . setup ( ) ; } // Setup optional / extra environment facets for ( EnvironmentFacet current : extraFacets ) { try { current . setup ( ) ; } catch ( Exception e ) { throw new IllegalStateException ( "Could not setup() EnvironmentFacet of type [" + current . getClass ( ) . getName ( ) + "]" , e ) ; } } if ( log . isDebugEnabled ( ) ) { log . debug ( "ToolExecutionEnvironment setup -- Done." ) ; } } catch ( IllegalStateException e ) { throw e ; } catch ( Exception e ) { throw new IllegalStateException ( "Could not setup mandatory ToolExecutionEnvironment." , e ) ; }
public class WebsphereDetector { /** * { @ inheritDoc } * @ param servers */ @ Override public void addMBeanServers ( Set < MBeanServerConnection > servers ) { } }
try { /* * this . mbeanServer = AdminServiceFactory . getMBeanFactory ( ) . getMBeanServer ( ) ; */ Class adminServiceClass = ClassUtil . classForName ( "com.ibm.websphere.management.AdminServiceFactory" , getClass ( ) . getClassLoader ( ) ) ; if ( adminServiceClass != null ) { Method getMBeanFactoryMethod = adminServiceClass . getMethod ( "getMBeanFactory" , new Class [ 0 ] ) ; Object mbeanFactory = getMBeanFactoryMethod . invoke ( null ) ; if ( mbeanFactory != null ) { Method getMBeanServerMethod = mbeanFactory . getClass ( ) . getMethod ( "getMBeanServer" , new Class [ 0 ] ) ; servers . add ( ( MBeanServer ) getMBeanServerMethod . invoke ( mbeanFactory ) ) ; } } } catch ( InvocationTargetException ex ) { // CNFE should be earlier throw new IllegalArgumentException ( INTERNAL_ERROR_MSG , ex ) ; } catch ( IllegalAccessException ex ) { throw new IllegalArgumentException ( INTERNAL_ERROR_MSG , ex ) ; } catch ( NoSuchMethodException ex ) { throw new IllegalArgumentException ( INTERNAL_ERROR_MSG , ex ) ; }