signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class CompressionConfigParser { /** * Return compression type * @ param properties Compression config settings * @ return String representing compression type , null if none exists */ public static String getCompressionType ( Map < String , Object > properties ) { } }
return ( String ) properties . get ( COMPRESSION_TYPE_KEY ) ;
public class AlignedBox3f { /** * Set the min Z . * @ param z the min z . */ @ Override public void setMinZ ( double z ) { } }
double o = this . maxz ; if ( o < z ) { this . minz = o ; this . maxz = z ; } else { this . minz = z ; }
public class ApiBase { /** * Gets the URL of REST Mango Pay API . * @ param key The method key to get URL of . * @ return The URL string of given method . */ protected String getRequestUrl ( String key ) throws Exception { } }
String result = "" ; try { result = this . methods . get ( key ) [ 0 ] ; } catch ( Exception ex ) { throw new Exception ( "Unknown method key: " + key ) ; } return result ;
public class PdfBoxGraphics2DFontTextDrawer { /** * Close / delete all resources associated with this drawer . This mainly means * deleting all temporary files . You can not use this object after a call to * close . * Calling close multiple times does nothing . */ @ SuppressWarnings ( "ResultOfMethodCallIgnored" ) @ Override public void close ( ) { } }
for ( File tempFile : tempFiles ) tempFile . delete ( ) ; tempFiles . clear ( ) ; fontFiles . clear ( ) ; fontMap . clear ( ) ;
public class InternalSARLParser { /** * InternalSARL . g : 16064:1 : ruleJvmParameterizedTypeReference returns [ EObject current = null ] : ( ( ( ruleQualifiedName ) ) ( ( ( ' < ' ) = > otherlv _ 1 = ' < ' ) ( ( lv _ arguments _ 2_0 = ruleJvmArgumentTypeReference ) ) ( otherlv _ 3 = ' , ' ( ( lv _ arguments _ 4_0 = ruleJvmArgumentTypeReference ) ) ) * otherlv _ 5 = ' > ' ( ( ( ( ( ) ' . ' ) ) = > ( ( ) otherlv _ 7 = ' . ' ) ) ( ( ruleValidID ) ) ( ( ( ' < ' ) = > otherlv _ 9 = ' < ' ) ( ( lv _ arguments _ 10_0 = ruleJvmArgumentTypeReference ) ) ( otherlv _ 11 = ' , ' ( ( lv _ arguments _ 12_0 = ruleJvmArgumentTypeReference ) ) ) * otherlv _ 13 = ' > ' ) ? ) * ) ? ) ; */ public final EObject ruleJvmParameterizedTypeReference ( ) throws RecognitionException { } }
EObject current = null ; Token otherlv_1 = null ; Token otherlv_3 = null ; Token otherlv_5 = null ; Token otherlv_7 = null ; Token otherlv_9 = null ; Token otherlv_11 = null ; Token otherlv_13 = null ; EObject lv_arguments_2_0 = null ; EObject lv_arguments_4_0 = null ; EObject lv_arguments_10_0 = null ; EObject lv_arguments_12_0 = null ; enterRule ( ) ; try { // InternalSARL . g : 16070:2 : ( ( ( ( ruleQualifiedName ) ) ( ( ( ' < ' ) = > otherlv _ 1 = ' < ' ) ( ( lv _ arguments _ 2_0 = ruleJvmArgumentTypeReference ) ) ( otherlv _ 3 = ' , ' ( ( lv _ arguments _ 4_0 = ruleJvmArgumentTypeReference ) ) ) * otherlv _ 5 = ' > ' ( ( ( ( ( ) ' . ' ) ) = > ( ( ) otherlv _ 7 = ' . ' ) ) ( ( ruleValidID ) ) ( ( ( ' < ' ) = > otherlv _ 9 = ' < ' ) ( ( lv _ arguments _ 10_0 = ruleJvmArgumentTypeReference ) ) ( otherlv _ 11 = ' , ' ( ( lv _ arguments _ 12_0 = ruleJvmArgumentTypeReference ) ) ) * otherlv _ 13 = ' > ' ) ? ) * ) ? ) ) // InternalSARL . g : 16071:2 : ( ( ( ruleQualifiedName ) ) ( ( ( ' < ' ) = > otherlv _ 1 = ' < ' ) ( ( lv _ arguments _ 2_0 = ruleJvmArgumentTypeReference ) ) ( otherlv _ 3 = ' , ' ( ( lv _ arguments _ 4_0 = ruleJvmArgumentTypeReference ) ) ) * otherlv _ 5 = ' > ' ( ( ( ( ( ) ' . ' ) ) = > ( ( ) otherlv _ 7 = ' . ' ) ) ( ( ruleValidID ) ) ( ( ( ' < ' ) = > otherlv _ 9 = ' < ' ) ( ( lv _ arguments _ 10_0 = ruleJvmArgumentTypeReference ) ) ( otherlv _ 11 = ' , ' ( ( lv _ arguments _ 12_0 = ruleJvmArgumentTypeReference ) ) ) * otherlv _ 13 = ' > ' ) ? ) * ) ? ) { // InternalSARL . g : 16071:2 : ( ( ( ruleQualifiedName ) ) ( ( ( ' < ' ) = > otherlv _ 1 = ' < ' ) ( ( lv _ arguments _ 2_0 = ruleJvmArgumentTypeReference ) ) ( otherlv _ 3 = ' , ' ( ( lv _ arguments _ 4_0 = ruleJvmArgumentTypeReference ) ) ) * otherlv _ 5 = ' > ' ( ( ( ( ( ) ' . ' ) ) = > ( ( ) otherlv _ 7 = ' . ' ) ) ( ( ruleValidID ) ) ( ( ( ' < ' ) = > otherlv _ 9 = ' < ' ) ( ( lv _ arguments _ 10_0 = ruleJvmArgumentTypeReference ) ) ( otherlv _ 11 = ' , ' ( ( lv _ arguments _ 12_0 = ruleJvmArgumentTypeReference ) ) ) * otherlv _ 13 = ' > ' ) ? ) * ) ? ) // InternalSARL . g : 16072:3 : ( ( ruleQualifiedName ) ) ( ( ( ' < ' ) = > otherlv _ 1 = ' < ' ) ( ( lv _ arguments _ 2_0 = ruleJvmArgumentTypeReference ) ) ( otherlv _ 3 = ' , ' ( ( lv _ arguments _ 4_0 = ruleJvmArgumentTypeReference ) ) ) * otherlv _ 5 = ' > ' ( ( ( ( ( ) ' . ' ) ) = > ( ( ) otherlv _ 7 = ' . ' ) ) ( ( ruleValidID ) ) ( ( ( ' < ' ) = > otherlv _ 9 = ' < ' ) ( ( lv _ arguments _ 10_0 = ruleJvmArgumentTypeReference ) ) ( otherlv _ 11 = ' , ' ( ( lv _ arguments _ 12_0 = ruleJvmArgumentTypeReference ) ) ) * otherlv _ 13 = ' > ' ) ? ) * ) ? { // InternalSARL . g : 16072:3 : ( ( ruleQualifiedName ) ) // InternalSARL . g : 16073:4 : ( ruleQualifiedName ) { // InternalSARL . g : 16073:4 : ( ruleQualifiedName ) // InternalSARL . g : 16074:5 : ruleQualifiedName { if ( state . backtracking == 0 ) { if ( current == null ) { current = createModelElement ( grammarAccess . getJvmParameterizedTypeReferenceRule ( ) ) ; } } if ( state . backtracking == 0 ) { newCompositeNode ( grammarAccess . getJvmParameterizedTypeReferenceAccess ( ) . getTypeJvmTypeCrossReference_0_0 ( ) ) ; } pushFollow ( FOLLOW_152 ) ; ruleQualifiedName ( ) ; state . _fsp -- ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { afterParserOrEnumRuleCall ( ) ; } } } // InternalSARL . g : 16088:3 : ( ( ( ' < ' ) = > otherlv _ 1 = ' < ' ) ( ( lv _ arguments _ 2_0 = ruleJvmArgumentTypeReference ) ) ( otherlv _ 3 = ' , ' ( ( lv _ arguments _ 4_0 = ruleJvmArgumentTypeReference ) ) ) * otherlv _ 5 = ' > ' ( ( ( ( ( ) ' . ' ) ) = > ( ( ) otherlv _ 7 = ' . ' ) ) ( ( ruleValidID ) ) ( ( ( ' < ' ) = > otherlv _ 9 = ' < ' ) ( ( lv _ arguments _ 10_0 = ruleJvmArgumentTypeReference ) ) ( otherlv _ 11 = ' , ' ( ( lv _ arguments _ 12_0 = ruleJvmArgumentTypeReference ) ) ) * otherlv _ 13 = ' > ' ) ? ) * ) ? int alt374 = 2 ; alt374 = dfa374 . predict ( input ) ; switch ( alt374 ) { case 1 : // InternalSARL . g : 16089:4 : ( ( ' < ' ) = > otherlv _ 1 = ' < ' ) ( ( lv _ arguments _ 2_0 = ruleJvmArgumentTypeReference ) ) ( otherlv _ 3 = ' , ' ( ( lv _ arguments _ 4_0 = ruleJvmArgumentTypeReference ) ) ) * otherlv _ 5 = ' > ' ( ( ( ( ( ) ' . ' ) ) = > ( ( ) otherlv _ 7 = ' . ' ) ) ( ( ruleValidID ) ) ( ( ( ' < ' ) = > otherlv _ 9 = ' < ' ) ( ( lv _ arguments _ 10_0 = ruleJvmArgumentTypeReference ) ) ( otherlv _ 11 = ' , ' ( ( lv _ arguments _ 12_0 = ruleJvmArgumentTypeReference ) ) ) * otherlv _ 13 = ' > ' ) ? ) * { // InternalSARL . g : 16089:4 : ( ( ' < ' ) = > otherlv _ 1 = ' < ' ) // InternalSARL . g : 16090:5 : ( ' < ' ) = > otherlv _ 1 = ' < ' { otherlv_1 = ( Token ) match ( input , 40 , FOLLOW_92 ) ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { newLeafNode ( otherlv_1 , grammarAccess . getJvmParameterizedTypeReferenceAccess ( ) . getLessThanSignKeyword_1_0 ( ) ) ; } } // InternalSARL . g : 16096:4 : ( ( lv _ arguments _ 2_0 = ruleJvmArgumentTypeReference ) ) // InternalSARL . g : 16097:5 : ( lv _ arguments _ 2_0 = ruleJvmArgumentTypeReference ) { // InternalSARL . g : 16097:5 : ( lv _ arguments _ 2_0 = ruleJvmArgumentTypeReference ) // InternalSARL . g : 16098:6 : lv _ arguments _ 2_0 = ruleJvmArgumentTypeReference { if ( state . backtracking == 0 ) { newCompositeNode ( grammarAccess . getJvmParameterizedTypeReferenceAccess ( ) . getArgumentsJvmArgumentTypeReferenceParserRuleCall_1_1_0 ( ) ) ; } pushFollow ( FOLLOW_28 ) ; lv_arguments_2_0 = ruleJvmArgumentTypeReference ( ) ; state . _fsp -- ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { if ( current == null ) { current = createModelElementForParent ( grammarAccess . getJvmParameterizedTypeReferenceRule ( ) ) ; } add ( current , "arguments" , lv_arguments_2_0 , "org.eclipse.xtext.xbase.Xtype.JvmArgumentTypeReference" ) ; afterParserOrEnumRuleCall ( ) ; } } } // InternalSARL . g : 16115:4 : ( otherlv _ 3 = ' , ' ( ( lv _ arguments _ 4_0 = ruleJvmArgumentTypeReference ) ) ) * loop370 : do { int alt370 = 2 ; int LA370_0 = input . LA ( 1 ) ; if ( ( LA370_0 == 32 ) ) { alt370 = 1 ; } switch ( alt370 ) { case 1 : // InternalSARL . g : 16116:5 : otherlv _ 3 = ' , ' ( ( lv _ arguments _ 4_0 = ruleJvmArgumentTypeReference ) ) { otherlv_3 = ( Token ) match ( input , 32 , FOLLOW_92 ) ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { newLeafNode ( otherlv_3 , grammarAccess . getJvmParameterizedTypeReferenceAccess ( ) . getCommaKeyword_1_2_0 ( ) ) ; } // InternalSARL . g : 16120:5 : ( ( lv _ arguments _ 4_0 = ruleJvmArgumentTypeReference ) ) // InternalSARL . g : 16121:6 : ( lv _ arguments _ 4_0 = ruleJvmArgumentTypeReference ) { // InternalSARL . g : 16121:6 : ( lv _ arguments _ 4_0 = ruleJvmArgumentTypeReference ) // InternalSARL . g : 16122:7 : lv _ arguments _ 4_0 = ruleJvmArgumentTypeReference { if ( state . backtracking == 0 ) { newCompositeNode ( grammarAccess . getJvmParameterizedTypeReferenceAccess ( ) . getArgumentsJvmArgumentTypeReferenceParserRuleCall_1_2_1_0 ( ) ) ; } pushFollow ( FOLLOW_28 ) ; lv_arguments_4_0 = ruleJvmArgumentTypeReference ( ) ; state . _fsp -- ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { if ( current == null ) { current = createModelElementForParent ( grammarAccess . getJvmParameterizedTypeReferenceRule ( ) ) ; } add ( current , "arguments" , lv_arguments_4_0 , "org.eclipse.xtext.xbase.Xtype.JvmArgumentTypeReference" ) ; afterParserOrEnumRuleCall ( ) ; } } } } break ; default : break loop370 ; } } while ( true ) ; otherlv_5 = ( Token ) match ( input , 41 , FOLLOW_93 ) ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { newLeafNode ( otherlv_5 , grammarAccess . getJvmParameterizedTypeReferenceAccess ( ) . getGreaterThanSignKeyword_1_3 ( ) ) ; } // InternalSARL . g : 16144:4 : ( ( ( ( ( ) ' . ' ) ) = > ( ( ) otherlv _ 7 = ' . ' ) ) ( ( ruleValidID ) ) ( ( ( ' < ' ) = > otherlv _ 9 = ' < ' ) ( ( lv _ arguments _ 10_0 = ruleJvmArgumentTypeReference ) ) ( otherlv _ 11 = ' , ' ( ( lv _ arguments _ 12_0 = ruleJvmArgumentTypeReference ) ) ) * otherlv _ 13 = ' > ' ) ? ) * loop373 : do { int alt373 = 2 ; alt373 = dfa373 . predict ( input ) ; switch ( alt373 ) { case 1 : // InternalSARL . g : 16145:5 : ( ( ( ( ) ' . ' ) ) = > ( ( ) otherlv _ 7 = ' . ' ) ) ( ( ruleValidID ) ) ( ( ( ' < ' ) = > otherlv _ 9 = ' < ' ) ( ( lv _ arguments _ 10_0 = ruleJvmArgumentTypeReference ) ) ( otherlv _ 11 = ' , ' ( ( lv _ arguments _ 12_0 = ruleJvmArgumentTypeReference ) ) ) * otherlv _ 13 = ' > ' ) ? { // InternalSARL . g : 16145:5 : ( ( ( ( ) ' . ' ) ) = > ( ( ) otherlv _ 7 = ' . ' ) ) // InternalSARL . g : 16146:6 : ( ( ( ) ' . ' ) ) = > ( ( ) otherlv _ 7 = ' . ' ) { // InternalSARL . g : 16152:6 : ( ( ) otherlv _ 7 = ' . ' ) // InternalSARL . g : 16153:7 : ( ) otherlv _ 7 = ' . ' { // InternalSARL . g : 16153:7 : ( ) // InternalSARL . g : 16154:8: { if ( state . backtracking == 0 ) { current = forceCreateModelElementAndSet ( grammarAccess . getJvmParameterizedTypeReferenceAccess ( ) . getJvmInnerTypeReferenceOuterAction_1_4_0_0_0 ( ) , current ) ; } } otherlv_7 = ( Token ) match ( input , 77 , FOLLOW_3 ) ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { newLeafNode ( otherlv_7 , grammarAccess . getJvmParameterizedTypeReferenceAccess ( ) . getFullStopKeyword_1_4_0_0_1 ( ) ) ; } } } // InternalSARL . g : 16166:5 : ( ( ruleValidID ) ) // InternalSARL . g : 16167:6 : ( ruleValidID ) { // InternalSARL . g : 16167:6 : ( ruleValidID ) // InternalSARL . g : 16168:7 : ruleValidID { if ( state . backtracking == 0 ) { if ( current == null ) { current = createModelElement ( grammarAccess . getJvmParameterizedTypeReferenceRule ( ) ) ; } } if ( state . backtracking == 0 ) { newCompositeNode ( grammarAccess . getJvmParameterizedTypeReferenceAccess ( ) . getTypeJvmTypeCrossReference_1_4_1_0 ( ) ) ; } pushFollow ( FOLLOW_94 ) ; ruleValidID ( ) ; state . _fsp -- ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { afterParserOrEnumRuleCall ( ) ; } } } // InternalSARL . g : 16182:5 : ( ( ( ' < ' ) = > otherlv _ 9 = ' < ' ) ( ( lv _ arguments _ 10_0 = ruleJvmArgumentTypeReference ) ) ( otherlv _ 11 = ' , ' ( ( lv _ arguments _ 12_0 = ruleJvmArgumentTypeReference ) ) ) * otherlv _ 13 = ' > ' ) ? int alt372 = 2 ; alt372 = dfa372 . predict ( input ) ; switch ( alt372 ) { case 1 : // InternalSARL . g : 16183:6 : ( ( ' < ' ) = > otherlv _ 9 = ' < ' ) ( ( lv _ arguments _ 10_0 = ruleJvmArgumentTypeReference ) ) ( otherlv _ 11 = ' , ' ( ( lv _ arguments _ 12_0 = ruleJvmArgumentTypeReference ) ) ) * otherlv _ 13 = ' > ' { // InternalSARL . g : 16183:6 : ( ( ' < ' ) = > otherlv _ 9 = ' < ' ) // InternalSARL . g : 16184:7 : ( ' < ' ) = > otherlv _ 9 = ' < ' { otherlv_9 = ( Token ) match ( input , 40 , FOLLOW_92 ) ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { newLeafNode ( otherlv_9 , grammarAccess . getJvmParameterizedTypeReferenceAccess ( ) . getLessThanSignKeyword_1_4_2_0 ( ) ) ; } } // InternalSARL . g : 16190:6 : ( ( lv _ arguments _ 10_0 = ruleJvmArgumentTypeReference ) ) // InternalSARL . g : 16191:7 : ( lv _ arguments _ 10_0 = ruleJvmArgumentTypeReference ) { // InternalSARL . g : 16191:7 : ( lv _ arguments _ 10_0 = ruleJvmArgumentTypeReference ) // InternalSARL . g : 16192:8 : lv _ arguments _ 10_0 = ruleJvmArgumentTypeReference { if ( state . backtracking == 0 ) { newCompositeNode ( grammarAccess . getJvmParameterizedTypeReferenceAccess ( ) . getArgumentsJvmArgumentTypeReferenceParserRuleCall_1_4_2_1_0 ( ) ) ; } pushFollow ( FOLLOW_28 ) ; lv_arguments_10_0 = ruleJvmArgumentTypeReference ( ) ; state . _fsp -- ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { if ( current == null ) { current = createModelElementForParent ( grammarAccess . getJvmParameterizedTypeReferenceRule ( ) ) ; } add ( current , "arguments" , lv_arguments_10_0 , "org.eclipse.xtext.xbase.Xtype.JvmArgumentTypeReference" ) ; afterParserOrEnumRuleCall ( ) ; } } } // InternalSARL . g : 16209:6 : ( otherlv _ 11 = ' , ' ( ( lv _ arguments _ 12_0 = ruleJvmArgumentTypeReference ) ) ) * loop371 : do { int alt371 = 2 ; int LA371_0 = input . LA ( 1 ) ; if ( ( LA371_0 == 32 ) ) { alt371 = 1 ; } switch ( alt371 ) { case 1 : // InternalSARL . g : 16210:7 : otherlv _ 11 = ' , ' ( ( lv _ arguments _ 12_0 = ruleJvmArgumentTypeReference ) ) { otherlv_11 = ( Token ) match ( input , 32 , FOLLOW_92 ) ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { newLeafNode ( otherlv_11 , grammarAccess . getJvmParameterizedTypeReferenceAccess ( ) . getCommaKeyword_1_4_2_2_0 ( ) ) ; } // InternalSARL . g : 16214:7 : ( ( lv _ arguments _ 12_0 = ruleJvmArgumentTypeReference ) ) // InternalSARL . g : 16215:8 : ( lv _ arguments _ 12_0 = ruleJvmArgumentTypeReference ) { // InternalSARL . g : 16215:8 : ( lv _ arguments _ 12_0 = ruleJvmArgumentTypeReference ) // InternalSARL . g : 16216:9 : lv _ arguments _ 12_0 = ruleJvmArgumentTypeReference { if ( state . backtracking == 0 ) { newCompositeNode ( grammarAccess . getJvmParameterizedTypeReferenceAccess ( ) . getArgumentsJvmArgumentTypeReferenceParserRuleCall_1_4_2_2_1_0 ( ) ) ; } pushFollow ( FOLLOW_28 ) ; lv_arguments_12_0 = ruleJvmArgumentTypeReference ( ) ; state . _fsp -- ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { if ( current == null ) { current = createModelElementForParent ( grammarAccess . getJvmParameterizedTypeReferenceRule ( ) ) ; } add ( current , "arguments" , lv_arguments_12_0 , "org.eclipse.xtext.xbase.Xtype.JvmArgumentTypeReference" ) ; afterParserOrEnumRuleCall ( ) ; } } } } break ; default : break loop371 ; } } while ( true ) ; otherlv_13 = ( Token ) match ( input , 41 , FOLLOW_93 ) ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { newLeafNode ( otherlv_13 , grammarAccess . getJvmParameterizedTypeReferenceAccess ( ) . getGreaterThanSignKeyword_1_4_2_3 ( ) ) ; } } break ; } } break ; default : break loop373 ; } } while ( true ) ; } break ; } } } if ( state . backtracking == 0 ) { leaveRule ( ) ; } } catch ( RecognitionException re ) { recover ( input , re ) ; appendSkippedTokens ( ) ; } finally { } return current ;
public class DBPropertiesUpdate { /** * { @ inheritDoc } */ @ Override public MultiValuedMap < String , String > updateInDB ( final JexlContext _jexlContext , final UpdateLifecycle _step , final Set < Profile > _profile ) throws InstallationException { } }
if ( _step == UpdateLifecycle . DBPROPERTIES_UPDATE ) { if ( DBPropertiesUpdate . LOG . isInfoEnabled ( ) ) { DBPropertiesUpdate . LOG . info ( "Importing Properties '" + this . bundlename + "'" ) ; } final Instance bundleInst = getExistingBundle ( this . bundeluuid ) ; if ( bundleInst == null ) { this . bundleInstance = insertNewBundle ( ) ; } else { this . bundleInstance = bundleInst ; } registerRevision ( getFileApplication ( ) , getInstallFile ( ) , this . bundleInstance ) ; try { for ( final Resource resource : this . resources ) { if ( "Properties" . equals ( resource . type ) ) { if ( resource . language == null || resource . language . length ( ) < 1 ) { importFromProperties ( new URL ( getInstallFile ( ) . getUrl ( ) , resource . filename ) ) ; } else { importFromProperties ( new URL ( getInstallFile ( ) . getUrl ( ) , resource . filename ) , resource . language ) ; } } } } catch ( final MalformedURLException e ) { DBPropertiesUpdate . LOG . error ( "The URL given for one File of the DBProperties is invalid" , e ) ; } } return MultiMapUtils . emptyMultiValuedMap ( ) ;
public class DataLoggerRespository { /** * closes all reopen loggers */ public synchronized void close ( ) { } }
Map < String , IDataLogger > copiedLoggers = new HashMap < String , IDataLogger > ( this . openLoggers ) ; for ( IDataLogger dataLogger : copiedLoggers . values ( ) ) { try { dataLogger . close ( ) ; } catch ( Exception e ) { } } this . openLoggers . clear ( ) ;
public class DocumentDescription { /** * A description of the parameters for a document . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setParameters ( java . util . Collection ) } or { @ link # withParameters ( java . util . Collection ) } if you want to * override the existing values . * @ param parameters * A description of the parameters for a document . * @ return Returns a reference to this object so that method calls can be chained together . */ public DocumentDescription withParameters ( DocumentParameter ... parameters ) { } }
if ( this . parameters == null ) { setParameters ( new com . amazonaws . internal . SdkInternalList < DocumentParameter > ( parameters . length ) ) ; } for ( DocumentParameter ele : parameters ) { this . parameters . add ( ele ) ; } return this ;
public class CreateWorkspacesResult { /** * Information about the WorkSpaces that were created . * Because this operation is asynchronous , the identifier returned is not immediately available for use with other * operations . For example , if you call < a > DescribeWorkspaces < / a > before the WorkSpace is created , the information * returned can be incomplete . * @ param pendingRequests * Information about the WorkSpaces that were created . < / p > * Because this operation is asynchronous , the identifier returned is not immediately available for use with * other operations . For example , if you call < a > DescribeWorkspaces < / a > before the WorkSpace is created , the * information returned can be incomplete . */ public void setPendingRequests ( java . util . Collection < Workspace > pendingRequests ) { } }
if ( pendingRequests == null ) { this . pendingRequests = null ; return ; } this . pendingRequests = new com . amazonaws . internal . SdkInternalList < Workspace > ( pendingRequests ) ;
public class PipelineDescriptionMarshaller { /** * Marshall the given parameter object . */ public void marshall ( PipelineDescription pipelineDescription , ProtocolMarshaller protocolMarshaller ) { } }
if ( pipelineDescription == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( pipelineDescription . getPipelineId ( ) , PIPELINEID_BINDING ) ; protocolMarshaller . marshall ( pipelineDescription . getName ( ) , NAME_BINDING ) ; protocolMarshaller . marshall ( pipelineDescription . getFields ( ) , FIELDS_BINDING ) ; protocolMarshaller . marshall ( pipelineDescription . getDescription ( ) , DESCRIPTION_BINDING ) ; protocolMarshaller . marshall ( pipelineDescription . getTags ( ) , TAGS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EClass getIfcSweptSurface ( ) { } }
if ( ifcSweptSurfaceEClass == null ) { ifcSweptSurfaceEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 688 ) ; } return ifcSweptSurfaceEClass ;
public class Accounts { /** * trying to get account info without setting the client */ private static void getAccountInfo ( ) { } }
try { Account response = Account . getter ( ) . get ( ) ; System . out . println ( response ) ; } catch ( PlivoRestException | IOException e ) { e . printStackTrace ( ) ; }
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link ArithType } { @ code > } } */ @ XmlElementDecl ( namespace = "http://www.w3.org/1998/Math/MathML" , name = "product" ) public JAXBElement < ArithType > createProduct ( ArithType value ) { } }
return new JAXBElement < ArithType > ( _Product_QNAME , ArithType . class , null , value ) ;
public class LValue { /** * Returns ` value ` as a Number . Strings will be coerced into * either a Long or Double . * @ param value * the value to cast to a Number . * @ return ` value ` as a Number . * @ throws NumberFormatException when ` value ` is a String which could * not be parsed as a Long or Double . */ public Number asNumber ( Object value ) throws NumberFormatException { } }
if ( value instanceof Number ) { return ( Number ) value ; } String str = String . valueOf ( value ) ; return str . matches ( "\\d+" ) ? Long . valueOf ( str ) : Double . valueOf ( str ) ;
public class Transformation2D { /** * Returns TRUE , if this transformation does not have rotation and shear * within the given tolerance . * @ param tol * The tolerance value . */ public boolean isScaleAndShift ( double tol ) { } }
return xy * xy + yx * yx < ( xx * xx + yy * yy ) * tol ;
public class EliminateVowels { /** * This function eliminates all vowels from a given string and returns the string without vowels . * > > > eliminateVowels ( " " ) * > > > eliminateVowels ( " abcdef \ nghijklm " ) * " bcdf \ nghjklm " * > > > eliminateVowels ( " abcdef " ) * " bcdf " * > > > eliminateVowels ( " aaaaa " ) * > > > eliminateVowels ( " aaBAA " ) * > > > eliminateVowels ( " zbcd " ) * " zbcd " * Parameters : * string ( String ) : The string from which vowels need to be eliminated . * Returns : * String : A string without vowels . */ public static String eliminateVowels ( String string ) { } }
return string . replaceAll ( "[AaEeIiOoUu]" , "" ) ;
public class XMemcachedClient { /** * ( non - Javadoc ) * @ see net . rubyeye . xmemcached . MemcachedClient # replace ( java . lang . String , int , T , * net . rubyeye . xmemcached . transcoders . Transcoder ) */ public final < T > boolean replace ( final String key , final int exp , final T value , final Transcoder < T > transcoder ) throws TimeoutException , InterruptedException , MemcachedException { } }
return this . replace ( key , exp , value , transcoder , this . opTimeout ) ;
public class CommandCreator { /** * Add the requested post parameters to the Request . * @ param request Request to add post params to */ private void addPostParams ( final Request request ) { } }
if ( command != null ) { request . addPostParam ( "Command" , command ) ; } if ( device != null ) { request . addPostParam ( "Device" , device ) ; } if ( sim != null ) { request . addPostParam ( "Sim" , sim ) ; } if ( callbackMethod != null ) { request . addPostParam ( "CallbackMethod" , callbackMethod ) ; } if ( callbackUrl != null ) { request . addPostParam ( "CallbackUrl" , callbackUrl . toString ( ) ) ; } if ( commandMode != null ) { request . addPostParam ( "CommandMode" , commandMode ) ; } if ( includeSid != null ) { request . addPostParam ( "IncludeSid" , includeSid ) ; }
public class EnglishLemmatizer { /** * Gets instance . * @ return the instance */ public static EnglishLemmatizer getInstance ( ) { } }
if ( INSTANCE == null ) { synchronized ( EnglishLemmatizer . class ) { if ( INSTANCE != null ) { return INSTANCE ; } INSTANCE = new EnglishLemmatizer ( ) ; } } return INSTANCE ;
public class AbstractSearchQueryDto { /** * Finds the methods that are annotated with a { @ link CamundaQueryParam } with a value that matches the key parameter . * Before invoking these methods , the annotated { @ link StringToTypeConverter } is used to convert the String value to the desired Java type . * @ param key * @ param value */ protected void setValueBasedOnAnnotation ( String key , String value ) { } }
List < Method > matchingMethods = findMatchingAnnotatedMethods ( key ) ; for ( Method method : matchingMethods ) { Class < ? extends JacksonAwareStringToTypeConverter < ? > > converterClass = findAnnotatedTypeConverter ( method ) ; if ( converterClass == null ) { continue ; } JacksonAwareStringToTypeConverter < ? > converter = null ; try { converter = converterClass . newInstance ( ) ; converter . setObjectMapper ( objectMapper ) ; Object convertedValue = converter . convertQueryParameterToType ( value ) ; method . invoke ( this , convertedValue ) ; } catch ( InstantiationException e ) { throw new RestException ( Status . INTERNAL_SERVER_ERROR , e , "Server error." ) ; } catch ( IllegalAccessException e ) { throw new RestException ( Status . INTERNAL_SERVER_ERROR , e , "Server error." ) ; } catch ( InvocationTargetException e ) { throw new InvalidRequestException ( Status . BAD_REQUEST , e , "Cannot set query parameter '" + key + "' to value '" + value + "'" ) ; } catch ( RestException e ) { throw new InvalidRequestException ( e . getStatus ( ) , e , "Cannot set query parameter '" + key + "' to value '" + value + "': " + e . getMessage ( ) ) ; } }
public class JAXPXPathEngine { /** * { @ inheritDoc } */ public String evaluate ( String xPath , Node n ) { } }
try { return xpath . evaluate ( xPath , n ) ; } catch ( XPathExpressionException ex ) { throw new XMLUnitException ( ex ) ; }
public class DBTablePropertySheet { /** * This method is called from within the constructor to * initialize the form . * WARNING : Do NOT modify this code . The content of this method is * always regenerated by the Form Editor . */ private void initComponents ( ) // GEN - BEGIN : initComponents { } }
java . awt . GridBagConstraints gridBagConstraints ; jPanel1 = new javax . swing . JPanel ( ) ; lblEnabled = new javax . swing . JLabel ( ) ; cbEnabled = new javax . swing . JCheckBox ( ) ; lblDisabledByParent = new javax . swing . JLabel ( ) ; cbDisabledByParent = new javax . swing . JCheckBox ( ) ; jLabel3 = new javax . swing . JLabel ( ) ; jLabel4 = new javax . swing . JLabel ( ) ; lblTableName = new javax . swing . JLabel ( ) ; tfTableName = new javax . swing . JTextField ( ) ; lblClassName = new javax . swing . JLabel ( ) ; tfClassName = new javax . swing . JTextField ( ) ; lblPackageName = new javax . swing . JLabel ( ) ; tfPackageName = new javax . swing . JTextField ( ) ; lblDynamicProxy = new javax . swing . JLabel ( ) ; cbDynamicProxy = new javax . swing . JCheckBox ( ) ; lblConversionStrategyClass = new javax . swing . JLabel ( ) ; tfConversionStrategyClass = new javax . swing . JTextField ( ) ; setLayout ( new java . awt . GridBagLayout ( ) ) ; addComponentListener ( new java . awt . event . ComponentAdapter ( ) { public void componentShown ( java . awt . event . ComponentEvent evt ) { formComponentShown ( evt ) ; } public void componentHidden ( java . awt . event . ComponentEvent evt ) { formComponentHidden ( evt ) ; } } ) ; addHierarchyListener ( new java . awt . event . HierarchyListener ( ) { public void hierarchyChanged ( java . awt . event . HierarchyEvent evt ) { formHierarchyChanged ( evt ) ; } } ) ; jPanel1 . setLayout ( new java . awt . GridLayout ( 8 , 2 ) ) ; lblEnabled . setDisplayedMnemonic ( 'e' ) ; lblEnabled . setText ( "enabled" ) ; jPanel1 . add ( lblEnabled ) ; cbEnabled . setMnemonic ( 'e' ) ; cbEnabled . addActionListener ( new java . awt . event . ActionListener ( ) { public void actionPerformed ( java . awt . event . ActionEvent evt ) { cbEnabledActionPerformed ( evt ) ; } } ) ; jPanel1 . add ( cbEnabled ) ; lblDisabledByParent . setText ( "disabled by Parent:" ) ; jPanel1 . add ( lblDisabledByParent ) ; cbDisabledByParent . setEnabled ( false ) ; jPanel1 . add ( cbDisabledByParent ) ; jPanel1 . add ( jLabel3 ) ; jPanel1 . add ( jLabel4 ) ; lblTableName . setLabelFor ( tfTableName ) ; lblTableName . setText ( "Table Name:" ) ; jPanel1 . add ( lblTableName ) ; tfTableName . setEditable ( false ) ; tfTableName . setText ( "jTextField1" ) ; tfTableName . setBorder ( null ) ; tfTableName . setDisabledTextColor ( new java . awt . Color ( 0 , 51 , 51 ) ) ; tfTableName . setEnabled ( false ) ; jPanel1 . add ( tfTableName ) ; lblClassName . setDisplayedMnemonic ( 'c' ) ; lblClassName . setLabelFor ( tfClassName ) ; lblClassName . setText ( "Class Name:" ) ; jPanel1 . add ( lblClassName ) ; tfClassName . setText ( "jTextField1" ) ; tfClassName . addActionListener ( new java . awt . event . ActionListener ( ) { public void actionPerformed ( java . awt . event . ActionEvent evt ) { tfClassNameActionPerformed ( evt ) ; } } ) ; tfClassName . addFocusListener ( new java . awt . event . FocusAdapter ( ) { public void focusLost ( java . awt . event . FocusEvent evt ) { tfClassNameFocusLost ( evt ) ; } } ) ; tfClassName . addKeyListener ( new java . awt . event . KeyAdapter ( ) { public void keyTyped ( java . awt . event . KeyEvent evt ) { tfClassNameKeyTyped ( evt ) ; } } ) ; jPanel1 . add ( tfClassName ) ; lblPackageName . setDisplayedMnemonic ( 'p' ) ; lblPackageName . setLabelFor ( tfPackageName ) ; lblPackageName . setText ( "Package:" ) ; jPanel1 . add ( lblPackageName ) ; tfPackageName . setText ( "jTextField2" ) ; tfPackageName . addActionListener ( new java . awt . event . ActionListener ( ) { public void actionPerformed ( java . awt . event . ActionEvent evt ) { tfPackageNameActionPerformed ( evt ) ; } } ) ; tfPackageName . addFocusListener ( new java . awt . event . FocusAdapter ( ) { public void focusLost ( java . awt . event . FocusEvent evt ) { tfPackageNameFocusLost ( evt ) ; } } ) ; tfPackageName . addKeyListener ( new java . awt . event . KeyAdapter ( ) { public void keyTyped ( java . awt . event . KeyEvent evt ) { tfPackageNameKeyTyped ( evt ) ; } } ) ; jPanel1 . add ( tfPackageName ) ; lblDynamicProxy . setDisplayedMnemonic ( 'u' ) ; lblDynamicProxy . setText ( "Use Dynamic Proxy:" ) ; jPanel1 . add ( lblDynamicProxy ) ; cbDynamicProxy . setMnemonic ( 'u' ) ; cbDynamicProxy . addActionListener ( new java . awt . event . ActionListener ( ) { public void actionPerformed ( java . awt . event . ActionEvent evt ) { cbDynamicProxyActionPerformed ( evt ) ; } } ) ; jPanel1 . add ( cbDynamicProxy ) ; lblConversionStrategyClass . setDisplayedMnemonic ( 's' ) ; lblConversionStrategyClass . setLabelFor ( tfConversionStrategyClass ) ; lblConversionStrategyClass . setText ( "Conversion Strategy Class:" ) ; jPanel1 . add ( lblConversionStrategyClass ) ; tfConversionStrategyClass . setText ( "jTextField1" ) ; tfConversionStrategyClass . addActionListener ( new java . awt . event . ActionListener ( ) { public void actionPerformed ( java . awt . event . ActionEvent evt ) { tfConversionStrategyClassActionPerformed ( evt ) ; } } ) ; tfConversionStrategyClass . addFocusListener ( new java . awt . event . FocusAdapter ( ) { public void focusLost ( java . awt . event . FocusEvent evt ) { tfConversionStrategyClassFocusLost ( evt ) ; } } ) ; tfConversionStrategyClass . addKeyListener ( new java . awt . event . KeyAdapter ( ) { public void keyTyped ( java . awt . event . KeyEvent evt ) { tfConversionStrategyClassKeyTyped ( evt ) ; } } ) ; jPanel1 . add ( tfConversionStrategyClass ) ; gridBagConstraints = new java . awt . GridBagConstraints ( ) ; gridBagConstraints . fill = java . awt . GridBagConstraints . HORIZONTAL ; gridBagConstraints . anchor = java . awt . GridBagConstraints . NORTH ; gridBagConstraints . weightx = 1.0 ; gridBagConstraints . weighty = 1.0 ; add ( jPanel1 , gridBagConstraints ) ;
public class FileUtil { /** * Checks if the file item is one among the supplied file types . * This first checks against file extensions , then against file mime types * @ param newFile the file to be checked , if null then return false * otherwise validate * @ param fileTypes allowed file types , if null or empty return true , * otherwise validate * @ return { @ code true } if either extension or mime - type match is successful */ public static boolean validateFileType ( final FileItemWrap newFile , final List < String > fileTypes ) { } }
// The newFile is null , then return false if ( newFile == null ) { return false ; } // If fileTypes to validate is null or empty , then assume newFile is valid if ( fileTypes == null || fileTypes . isEmpty ( ) ) { return true ; } final List < String > fileExts = fileTypes . stream ( ) . filter ( fileType -> fileType . startsWith ( "." ) ) . collect ( Collectors . toList ( ) ) ; // filter mime types from fileTypes . final List < String > fileMimes = fileTypes . stream ( ) . filter ( fileType -> ! fileExts . contains ( fileType ) ) . collect ( Collectors . toList ( ) ) ; // First validate newFile against fileExts list // If extensions are supplied , then check if newFile has a name if ( fileExts . size ( ) > 0 && newFile . getName ( ) != null ) { // Then see if newFile has an extension String [ ] split = newFile . getName ( ) . split ( ( "\\.(?=[^\\.]+$)" ) ) ; // If it exists , then check if it matches supplied extension ( s ) if ( split . length == 2 && fileExts . stream ( ) . anyMatch ( fileExt -> fileExt . equals ( "." + split [ 1 ] ) ) ) { return true ; } } // If extension match is unsucessful , then move to fileMimes list if ( fileMimes . size ( ) > 0 ) { final String mimeType = getFileMimeType ( newFile ) ; LOG . debug ( "File mime-type is: " + mimeType ) ; for ( String fileMime : fileMimes ) { if ( StringUtils . equals ( mimeType , fileMime ) ) { return true ; } if ( fileMime . indexOf ( "*" ) == fileMime . length ( ) - 1 ) { fileMime = fileMime . substring ( 0 , fileMime . length ( ) - 1 ) ; if ( mimeType . indexOf ( fileMime ) == 0 ) { return true ; } } } } return false ;
public class EmbeddableStateFinder { /** * The embeddable is not null . * Only cache the values if we are in the most specific embeddable containing { @ code column } * otherwise a more specific embeddable might be null and we would miss it * Only set the values for the columns sharing this specific embeddable * columns from deeper embeddables might be null */ private void maybeCacheOnNonNullEmbeddable ( String [ ] path , int index , Set < String > columnsOfEmbeddable ) { } }
if ( index == path . length - 2 ) { // right level ( i . e . the most specific embeddable for the column at bay for ( String columnInvolved : columnsOfEmbeddable ) { if ( columnInvolved . split ( "\\." ) . length == path . length ) { // Only cache for columns from the same embeddable columnToOuterMostNullEmbeddableCache . put ( columnInvolved , null ) ; } } }
public class CommerceRegionPersistenceImpl { /** * Removes all the commerce regions where commerceCountryId = & # 63 ; from the database . * @ param commerceCountryId the commerce country ID */ @ Override public void removeByCommerceCountryId ( long commerceCountryId ) { } }
for ( CommerceRegion commerceRegion : findByCommerceCountryId ( commerceCountryId , QueryUtil . ALL_POS , QueryUtil . ALL_POS , null ) ) { remove ( commerceRegion ) ; }
public class AbstractJMSPublisher { /** * Connect to JCR Repostory and JMS queue * @ throws JMSException if JMS Exception occurred */ @ PostConstruct public void acquireConnections ( ) throws JMSException { } }
LOGGER . debug ( "Initializing: {}" , this . getClass ( ) . getCanonicalName ( ) ) ; connection = connectionFactory . createConnection ( ) ; connection . start ( ) ; jmsSession = connection . createSession ( false , Session . AUTO_ACKNOWLEDGE ) ; producer = jmsSession . createProducer ( createDestination ( ) ) ; eventBus . register ( this ) ;
public class CustomBinder { /** * Configures a { @ link com . google . inject . Binder } via the exposed methods . */ @ Override protected void configure ( ) { } }
install ( new GuiceJerseyBinder ( ) ) ; // POJOs bind ( MyDependency . class ) . to ( DefaultMyDependency . class ) ; // vertx - mod - jersey interfaces Multibinder . newSetBinder ( binder ( ) , VertxRequestProcessor . class ) . addBinding ( ) . to ( GuiceRequestProcessor . class ) ; Multibinder . newSetBinder ( binder ( ) , VertxResponseProcessor . class ) . addBinding ( ) . to ( GuiceResponseProcessor . class ) ; Multibinder . newSetBinder ( binder ( ) , VertxPostResponseProcessor . class ) . addBinding ( ) . to ( GuicePostResponseProcessor . class ) ; // Jersey interfaces Multibinder . newSetBinder ( binder ( ) , ContainerRequestFilter . class ) . addBinding ( ) . to ( GuiceRequestFilter . class ) ; Multibinder . newSetBinder ( binder ( ) , ContainerResponseFilter . class ) . addBinding ( ) . to ( GuiceResponseFilter . class ) ; Multibinder . newSetBinder ( binder ( ) , ExceptionMapper . class ) . addBinding ( ) . to ( GuiceExceptionMapper . class ) ;
public class CronExpression { /** * Indicates whether the given date satisfies the cron expression . Note that * milliseconds are ignored , so two Dates falling on different milliseconds * of the same second will always have the same result here . * @ param date the date to evaluate * @ return a boolean indicating whether the given date satisfies the cron * expression */ public boolean isSatisfiedBy ( final Date date ) { } }
final Calendar testDateCal = Calendar . getInstance ( getTimeZone ( ) ) ; testDateCal . setTime ( date ) ; testDateCal . set ( Calendar . MILLISECOND , 0 ) ; final Date originalDate = testDateCal . getTime ( ) ; testDateCal . add ( Calendar . SECOND , - 1 ) ; final Date timeAfter = getTimeAfter ( testDateCal . getTime ( ) ) ; return timeAfter != null && timeAfter . equals ( originalDate ) ;
public class UpdateSketchBuilder { /** * Returns a local concurrent UpdateSketch to be used as a per - thread local buffer along with the * given concurrent shared UpdateSketch and the current configuration of this Builder * < p > The parameters unique to the local concurrent sketch are : * < ul > * < li > Local Nominal Entries or Local Log Nominal Entries < / li > * < li > Propagate Ordered Compact flag < / li > * < / ul > * @ param shared the concurrent shared sketch to be accessed via the concurrent local sketch . * @ return an UpdateSketch to be used as a per - thread local buffer . */ public UpdateSketch buildLocal ( final UpdateSketch shared ) { } }
if ( ( shared == null ) || ! ( shared instanceof ConcurrentSharedThetaSketch ) ) { throw new SketchesStateException ( "The concurrent shared sketch must be built first." ) ; } return new ConcurrentHeapThetaBuffer ( bLocalLgNomLongs , bSeed , ( ConcurrentSharedThetaSketch ) shared , bPropagateOrderedCompact , bMaxNumLocalThreads ) ;
public class DescribeClientVpnTargetNetworksRequest { /** * This method is intended for internal use only . Returns the marshaled request configured with additional * parameters to enable operation dry - run . */ @ Override public Request < DescribeClientVpnTargetNetworksRequest > getDryRunRequest ( ) { } }
Request < DescribeClientVpnTargetNetworksRequest > request = new DescribeClientVpnTargetNetworksRequestMarshaller ( ) . marshall ( this ) ; request . addParameter ( "DryRun" , Boolean . toString ( true ) ) ; return request ;
public class WProgressBar { /** * Sets the maximum value of the progress bar . * @ param max the maximum allowable value . */ public final void setMax ( final int max ) { } }
if ( max < 0 ) { throw new IllegalArgumentException ( ILLEGAL_MAX ) ; } if ( max != getMax ( ) ) { getOrCreateComponentModel ( ) . max = max ; }
public class DescribeDimensionKeysResult { /** * The dimension keys that were requested . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setKeys ( java . util . Collection ) } or { @ link # withKeys ( java . util . Collection ) } if you want to override the * existing values . * @ param keys * The dimension keys that were requested . * @ return Returns a reference to this object so that method calls can be chained together . */ public DescribeDimensionKeysResult withKeys ( DimensionKeyDescription ... keys ) { } }
if ( this . keys == null ) { setKeys ( new java . util . ArrayList < DimensionKeyDescription > ( keys . length ) ) ; } for ( DimensionKeyDescription ele : keys ) { this . keys . add ( ele ) ; } return this ;
public class MappingUtils { /** * Invokes Property Descriptor Getter and returns value returned by that function . * @ param target Object Getter of which would be executed * @ param prop Property Descriptor which would be used to invoke Getter * @ return Value returned from Getter */ public static Object callGetter ( Object target , PropertyDescriptor prop ) { } }
Object result = null ; Method getter = prop . getReadMethod ( ) ; if ( getter == null ) { throw new RuntimeException ( "No read method for bean property " + target . getClass ( ) + " " + prop . getName ( ) ) ; } try { result = getter . invoke ( target , new Object [ 0 ] ) ; } catch ( InvocationTargetException e ) { throw new RuntimeException ( "Couldn't invoke method: " + getter , e ) ; } catch ( IllegalArgumentException e ) { throw new RuntimeException ( "Couldn't invoke method with 0 arguments: " + getter , e ) ; } catch ( IllegalAccessException e ) { throw new RuntimeException ( "Couldn't invoke method: " + getter , e ) ; } return result ;
public class HTMLReport { /** * Write ccm . html for the CCM * @ param events The events * @ param status The status * @ param path The root path * @ param fw The file writer * @ exception Exception If an error occurs */ private static void generateCCMHTML ( List < TraceEvent > events , TraceEventStatus status , String path , FileWriter fw ) throws Exception { } }
writeString ( fw , "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"" ) ; writeEOL ( fw ) ; writeString ( fw , " \"http://www.w3.org/TR/html4/loose.dtd\">" ) ; writeEOL ( fw ) ; writeString ( fw , "<html>" ) ; writeEOL ( fw ) ; writeString ( fw , "<head>" ) ; writeEOL ( fw ) ; writeString ( fw , "<meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\">" ) ; writeEOL ( fw ) ; writeString ( fw , "<title>CachedConnectionManager</title>" ) ; writeEOL ( fw ) ; writeString ( fw , "</head>" ) ; writeEOL ( fw ) ; writeString ( fw , "<body style=\"background: #D7D7D7;\">" ) ; writeEOL ( fw ) ; writeString ( fw , "<h1>CachedConnectionManager</h1>" ) ; writeEOL ( fw ) ; writeString ( fw , "<table>" ) ; writeEOL ( fw ) ; writeString ( fw , "<tr>" ) ; writeEOL ( fw ) ; writeString ( fw , "<td><b>Status:</b></td><td><div style=\"color: " ) ; writeString ( fw , status . getColor ( ) ) ; writeString ( fw , ";\">" ) ; writeString ( fw , status . getDescription ( ) ) ; writeString ( fw , "</div></td>" ) ; writeEOL ( fw ) ; writeString ( fw , "</tr>" ) ; writeEOL ( fw ) ; writeString ( fw , "</table>" ) ; writeEOL ( fw ) ; writeString ( fw , "<p>" ) ; writeEOL ( fw ) ; writeString ( fw , "<table>" ) ; writeEOL ( fw ) ; writeString ( fw , "<tr>" ) ; writeEOL ( fw ) ; writeString ( fw , "<td><b>Timestamp</b></td>" ) ; writeEOL ( fw ) ; writeString ( fw , "<td><b>Thread</b></td>" ) ; writeEOL ( fw ) ; writeString ( fw , "<td><b>Event</b></td>" ) ; writeEOL ( fw ) ; writeString ( fw , "<td><b>Key</b></td>" ) ; writeEOL ( fw ) ; writeString ( fw , "<td><b>Call stack</b></td>" ) ; writeEOL ( fw ) ; writeString ( fw , "</tr>" ) ; writeEOL ( fw ) ; for ( TraceEvent te : events ) { writeString ( fw , "<tr>" ) ; writeEOL ( fw ) ; writeString ( fw , "<td>" + te . getTimestamp ( ) + "</td>" ) ; writeEOL ( fw ) ; writeString ( fw , "<td>" + te . getThreadId ( ) + "</td>" ) ; writeEOL ( fw ) ; writeString ( fw , "<td>" + TraceEvent . asText ( te ) + "</td>" ) ; writeEOL ( fw ) ; writeString ( fw , "<td>" + te . getPayload1 ( ) + "</td>" ) ; writeEOL ( fw ) ; String callstack = te . getPayload1 ( ) ; if ( te . getType ( ) == TraceEvent . PUSH_CCM_CONTEXT ) { callstack += "-push" ; } else { callstack += "-pop" ; } callstack += ".txt" ; writeString ( fw , "<td><a href=\"" + callstack + "\">Link</a></td>" ) ; writeEOL ( fw ) ; FileWriter report = null ; try { report = new FileWriter ( path + "/" + callstack ) ; writeString ( report , TraceEventHelper . exceptionDescription ( te . getPayload2 ( ) ) ) ; writeEOL ( report ) ; } finally { if ( report != null ) { try { report . flush ( ) ; report . close ( ) ; } catch ( Exception e ) { // Ignore } } } writeString ( fw , "</tr>" ) ; writeEOL ( fw ) ; } writeString ( fw , "</table>" ) ; writeEOL ( fw ) ; writeString ( fw , "<p>" ) ; writeEOL ( fw ) ; writeString ( fw , "<a href=\"../index.html\">Back</a>" ) ; writeEOL ( fw ) ; writeString ( fw , "</body>" ) ; writeEOL ( fw ) ; writeString ( fw , "</html>" ) ; writeEOL ( fw ) ;
public class ConcurrentEvictingQueue { /** * Returns an array containing all of the elements in this queue , in * proper sequence ; the runtime type of the returned array is that of * the specified array . If the queue fits in the specified array , it * is returned therein . Otherwise , a new array is allocated with the * runtime type of the specified array and the size of this queue . * < p > Like the { @ link # toArray ( ) } method , this method acts as bridge between * array - based and collection - based APIs . Further , this method allows * precise control over the runtime type of the output array , and may , * under certain circumstances , be used to save allocation costs . * Note that { @ code toArray ( new Object [ 0 ] ) } is identical in function to * { @ code toArray ( ) } . * @ param destination the array into which the elements of the queue are to * be stored , if it is big enough ; otherwise , a new array of the * same runtime type is allocated for this purpose * @ return an array containing all of the elements in this queue * @ throws ArrayStoreException if the runtime type of the specified array * is not a supertype of the runtime type of every element in * this queue * @ throws NullPointerException if the specified array is null */ @ Override @ SuppressWarnings ( { } }
"unchecked" } ) public < T > T [ ] toArray ( final T [ ] destination ) { requireNonNull ( destination , ILLEGAL_DESTINATION_ARRAY ) ; Supplier < T [ ] > copyRingBuffer = ( ) -> { if ( size == 0 ) { return destination ; } T [ ] result = destination ; if ( destination . length < size ) { result = ( T [ ] ) newInstance ( result . getClass ( ) . getComponentType ( ) , size ) ; } if ( headIndex <= tailIndex ) { System . arraycopy ( ringBuffer , headIndex , result , 0 , size ) ; } else { int toTheEnd = ringBuffer . length - headIndex ; System . arraycopy ( ringBuffer , headIndex , result , 0 , toTheEnd ) ; System . arraycopy ( ringBuffer , 0 , result , toTheEnd , tailIndex + 1 ) ; } return result ; } ; return readConcurrentlyWithoutSpin ( copyRingBuffer ) ;
public class XmMultiTenantSpringLiquibase { /** * { @ inheritDoc } */ @ Override public void afterPropertiesSet ( ) throws Exception { } }
if ( getDataSource ( ) == null && getSchemas ( ) == null ) { super . afterPropertiesSet ( ) ; } else { if ( getDataSource ( ) == null && getSchemas ( ) != null ) { throw new LiquibaseException ( "When schemas are defined you should also define a base dataSource" ) ; } if ( getDataSource ( ) != null ) { log . info ( "Schema based multitenancy enabled" ) ; if ( CollectionUtils . isEmpty ( getSchemas ( ) ) ) { log . warn ( "Schemas not defined, using defaultSchema only" ) ; setSchemas ( new ArrayList < > ( ) ) ; getSchemas ( ) . add ( getDefaultSchema ( ) ) ; } runOnAllSchemasXm ( ) ; } }
public class DescribeGameSessionPlacementRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DescribeGameSessionPlacementRequest describeGameSessionPlacementRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( describeGameSessionPlacementRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( describeGameSessionPlacementRequest . getPlacementId ( ) , PLACEMENTID_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class MediaClient { /** * Create a preset which help to convert media files on be played in a wide range of devices . * @ param request The request object containing all options for deleting presets . */ public CreatePresetResponse createPreset ( CreatePresetRequest request ) { } }
checkNotNull ( request , "The parameter request should NOT be null." ) ; InternalRequest internalRequest = createRequest ( HttpMethodName . POST , request , PRESET ) ; return invokeHttpClient ( internalRequest , CreatePresetResponse . class ) ;
public class CmsHtmlImportConverter { /** * Initialises Vector m _ enterTags with tag names . < p > */ private void initialiseTags ( ) { } }
StringTokenizer T = new StringTokenizer ( "p,table,tr,td,body,head,script,pre,title,style,h1,h2,h3,h4,h5,h6,ul,ol,li" , "," ) ; while ( T . hasMoreTokens ( ) ) { m_enterTags . add ( T . nextToken ( ) ) ; }
public class DefaultGroovyMethods { /** * Iterates over the elements of a collection , and checks whether at least * one element is true according to the Groovy Truth . * Equivalent to self . any ( { element { @ code - > } element } ) * < pre class = " groovyTestCase " > * assert [ false , true ] . any ( ) * assert [ 0 , 1 ] . any ( ) * assert ! [ 0 , 0 ] . any ( ) * < / pre > * @ param self the object over which we iterate * @ return true if any item in the collection matches the closure predicate * @ since 1.5.0 */ public static boolean any ( Object self ) { } }
BooleanReturningMethodInvoker bmi = new BooleanReturningMethodInvoker ( ) ; for ( Iterator iter = InvokerHelper . asIterator ( self ) ; iter . hasNext ( ) ; ) { if ( bmi . convertToBoolean ( iter . next ( ) ) ) { return true ; } } return false ;
public class Console { /** * This is the entry point method . */ @ Override public void onModuleLoad ( ) { } }
// start from the requested URL jcrService . getRequestedURI ( new BaseCallback < String > ( ) { @ SuppressWarnings ( "synthetic-access" ) @ Override public void onSuccess ( String result ) { // parse requested url to determine navigation jcrURL . parse ( result ) ; // before navigate to the requested URL we need to // check is this user already logged in or not yet . getCredentials ( ) ; } } ) ;
public class RomanAlphabetFactory { /** * Translates a positive integer ( not equal to zero ) * into a String using the letters ' a ' to ' z ' ; * 1 = a , 2 = b , . . . , 26 = z , 27 = aa , 28 = ab , . . . */ public static final String getString ( int index ) { } }
if ( index < 1 ) throw new NumberFormatException ( "You can't translate a negative number into an alphabetical value." ) ; index -- ; int bytes = 1 ; int start = 0 ; int symbols = 26 ; while ( index >= symbols + start ) { bytes ++ ; start += symbols ; symbols *= 26 ; } int c = index - start ; char [ ] value = new char [ bytes ] ; while ( bytes > 0 ) { value [ -- bytes ] = ( char ) ( 'a' + ( c % 26 ) ) ; c /= 26 ; } return new String ( value ) ;
public class XML { /** * long discussion . See bug # 354145. */ private XmlNode [ ] getNodesForInsert ( Object value ) { } }
if ( value instanceof XML ) { return new XmlNode [ ] { ( ( XML ) value ) . node } ; } else if ( value instanceof XMLList ) { XMLList list = ( XMLList ) value ; XmlNode [ ] rv = new XmlNode [ list . length ( ) ] ; for ( int i = 0 ; i < list . length ( ) ; i ++ ) { rv [ i ] = list . item ( i ) . node ; } return rv ; } else { return new XmlNode [ ] { XmlNode . createText ( getProcessor ( ) , ScriptRuntime . toString ( value ) ) } ; }
public class XSerializables { /** * Create an XSerializable object through the { @ code creator } function * and load it from the { @ code item } . * @ param < T > the XSerializable object * @ param item the item to load from * @ param creator the function to create Ts * @ return the created and loaded object */ public static < T extends XSerializable > T parseItem ( XElement item , Supplier < T > creator ) { } }
T result = creator . get ( ) ; result . load ( item ) ; return result ;
public class FastAdapter { /** * Set to true if you want the items to be selectable . * By default , no items are selectable * @ param selectable true if items are selectable * @ return this */ public FastAdapter < Item > withSelectable ( boolean selectable ) { } }
if ( selectable ) { addExtension ( mSelectExtension ) ; } else { mExtensions . remove ( mSelectExtension . getClass ( ) ) ; } // TODO revisit this - - > false means anyways that it is not in the extension list ! mSelectExtension . withSelectable ( selectable ) ; return this ;
public class ZipUtil { /** * Changes an existing ZIP file : transforms a given entry in it . * @ param zip * an existing ZIP file ( only read ) . * @ param path * new ZIP entry path . * @ param transformer * transformer for the given ZIP entry . * @ return < code > true < / code > if the entry was replaced . */ public static boolean transformEntry ( final File zip , final String path , final ZipEntryTransformer transformer ) { } }
return operateInPlace ( zip , new InPlaceAction ( ) { public boolean act ( File tmpFile ) { return transformEntry ( zip , path , transformer , tmpFile ) ; } } ) ;
public class DatabaseHashMap { /** * Get connection * @ param fromInit - true if we were called from initDBSettings ( this prevents an infinite loop ) */ Connection getConnection ( boolean fromInit ) { } }
if ( com . ibm . websphere . ras . TraceComponent . isAnyTracingEnabled ( ) && LoggingUtil . SESSION_LOGGER_WAS . isLoggable ( Level . FINE ) ) { LoggingUtil . SESSION_LOGGER_WAS . entering ( methodClassName , methodNames [ GET_CONNECTION ] ) ; } Connection conn = null ; boolean exceptionOccured = false ; if ( dataSource == null ) getDataSource ( ) ; if ( dataSource != null ) { // Try getting connection thrice when stale connection happens // if it fails , give it up int tries = 0 ; suspendTransaction ( ) ; beginDBContext ( ) ; // PK06395 / d321615 while ( tries < _smc . getConnectionRetryCount ( ) + 1 ) { try { tries ++ ; exceptionOccured = false ; // if ( ! SessionManagerConfig . is _ zOS ( ) ) { / / LIDB2775.25 zOS // conn = dataSource . getConnection ( dbid , dbpwd ) ; // } else { // in liberty profile , depend on data source for user / password conn = dataSource . getConnection ( ) ; // LIDB2775.25 zOS if ( dbHandler != null && ! dbHandler . isConnectionValid ( conn ) ) { LoggingUtil . SESSION_LOGGER_WAS . logp ( Level . FINE , methodClassName , methodNames [ GET_CONNECTION ] , "Stale connection detected." ) ; continue ; } conn . setAutoCommit ( true ) ; if ( com . ibm . websphere . ras . TraceComponent . isAnyTracingEnabled ( ) && LoggingUtil . SESSION_LOGGER_WAS . isLoggable ( Level . FINER ) ) { LoggingUtil . SESSION_LOGGER_WAS . exiting ( methodClassName , methodNames [ GET_CONNECTION ] , "Connection-isolation-level" + conn . getTransactionIsolation ( ) ) ; } // if we did not successully initialize the database settings due to the database being down on startup , do it now // fromInit tells us if we came from initDBSettings : We don ' t want to call this the first time when initDBSettings calls getConnection if ( ! initialized && ! fromInit && ! tryingToInitialize ) { synchronized ( this ) { tryingToInitialize = true ; if ( ! initialized ) { initDBSettings ( ) ; } tryingToInitialize = false ; } } return conn ; } catch ( Throwable th ) { exceptionOccured = true ; // if ( isStaleConnectionException ( th ) ) { // com . ibm . ws . ffdc . FFDCFilter . processException ( th , " com . ibm . ws . session . store . db . DatabaseHashMap . getConnection " , " 1081 " , this ) ; // if ( com . ibm . websphere . ras . TraceComponent . isAnyTracingEnabled ( ) & & LoggingUtil . SESSION _ LOGGER _ WAS . isLoggable ( Level . FINE ) ) { // LoggingUtil . SESSION _ LOGGER _ WAS . logp ( Level . FINE , methodClassName , methodNames [ UPDATE _ LAST _ ACCESS _ TIME ] , " StaleConnectionException " ) ; // continue ; / / try up to 3 times // } else { // exceptionOccured = true ; LoggingUtil . SESSION_LOGGER_WAS . logp ( Level . SEVERE , methodClassName , methodNames [ GET_CONNECTION ] , "CommonMessage.exception" , th ) ; // break ; / / bail out now continue ; // try up to 3 times } } } else { LoggingUtil . SESSION_LOGGER_WAS . logp ( Level . WARNING , methodClassName , methodNames [ GET_CONNECTION ] , "DatabaseHashMap.getConnectionError" ) ; } if ( exceptionOccured ) { endDBContext ( ) ; // PK06395 / d321615 resumeTransaction ( ) ; } return null ;
public class PatternCacheControl { /** * Adds a directive with the associated value to the directives map , after parsing the value from the configuration file * @ param directiveName * @ param directiveValue */ private void parseDirectiveWithValue ( String directiveName , String directiveValue ) { } }
Directive directive ; if ( directiveName . equals ( Directive . MAX_AGE . getName ( ) ) ) { if ( directiveValue . startsWith ( M_PLUS_STRING ) ) { directiveValue = directiveValue . replace ( M_PLUS_STRING , EMPTY_STRING_VALUE ) ; directive = Directive . MAX_AGE_MPLUS ; } else { directive = Directive . MAX_AGE ; } } else { directive = Directive . get ( directiveName ) ; } long value = Utils . parseTimeInterval ( directiveValue , TimeUnit . SECONDS , 0 ) ; directives . put ( directive , Long . toString ( value ) ) ;
public class TokenBucketImpl { /** * Refills the bucket with the specified number of tokens . If the bucket is currently full or near capacity then * fewer than { @ code numTokens } may be added . * @ param numTokens The number of tokens to add to the bucket . */ public synchronized void refill ( long numTokens ) { } }
long newTokens = Math . min ( capacity , Math . max ( 0 , numTokens ) ) ; size = Math . max ( 0 , Math . min ( size + newTokens , capacity ) ) ;
public class CommFaxClientSpi { /** * Releases the COMM port connection if open . */ protected void releaseCommPortConnection ( ) { } }
// get reference Connection < CommPortAdapter > connection = this . commConnection ; this . commConnection = null ; if ( connection != null ) { // get logger Logger logger = this . getLogger ( ) ; try { // release connection logger . logInfo ( new Object [ ] { "Closing COMM port connection." } , null ) ; connection . close ( ) ; } catch ( Exception exception ) { logger . logError ( new Object [ ] { "Error while closing COMM port connection." } , exception ) ; } }
public class AppointmentCalendarApplet { /** * Add any applet sub - panel ( s ) now . */ public boolean addSubPanels ( Container parent , int options ) { } }
parent . setLayout ( new BoxLayout ( parent , BoxLayout . X_AXIS ) ) ; JScrollPane scroller = new JScrollPane ( ScrollPaneConstants . VERTICAL_SCROLLBAR_AS_NEEDED , ScrollPaneConstants . HORIZONTAL_SCROLLBAR_AS_NEEDED ) ; scroller . setOpaque ( false ) ; scroller . getViewport ( ) . setOpaque ( false ) ; scroller . setPreferredSize ( new Dimension ( 800 , 400 ) ) ; scroller . setAlignmentX ( LEFT_ALIGNMENT ) ; scroller . setAlignmentY ( TOP_ALIGNMENT ) ; CalendarModel model = this . setupTestModel ( ) ; ImageIcon backgroundImage = this . getBackgroundImage ( ) ; // Calendar panel is transparent , but this helps with rendering see - thru components CalendarPanel panel = new CalendarPanel ( model , true , backgroundImage ) ; panel . setStatusListener ( new TaskCalendarStatusHandler ( this ) ) ; scroller . setViewportView ( panel ) ; parent . add ( scroller ) ; return true ;
public class JKValidationUtil { public static boolean isUpperCase ( final String txt ) { } }
boolean upper = true ; for ( final char c : txt . toCharArray ( ) ) { if ( Character . isLowerCase ( c ) ) { upper = false ; break ; } } return upper ;
public class StructureDiagramGenerator { /** * < p > Convenience method to generate 2D coordinates for a reaction . If atom - atom * maps are present on a reaction , the substructures are automatically aligned . < / p > * < p > This feature can be disabled by changing the { @ link # setAlignMappedReaction ( boolean ) } < / p > * @ param reaction reaction to layout * @ throws CDKException problem with layout */ public final void generateCoordinates ( final IReaction reaction ) throws CDKException { } }
// layout products and agents for ( IAtomContainer mol : reaction . getProducts ( ) . atomContainers ( ) ) generateCoordinates ( mol ) ; for ( IAtomContainer mol : reaction . getAgents ( ) . atomContainers ( ) ) generateCoordinates ( mol ) ; // do not align = simple layout of reactants if ( alignMappedReaction ) { final Set < IBond > mapped = ReactionManipulator . findMappedBonds ( reaction ) ; Multimap < Integer , Map < Integer , IAtom > > refmap = HashMultimap . create ( ) ; for ( IAtomContainer mol : reaction . getProducts ( ) . atomContainers ( ) ) { Cycles . markRingAtomsAndBonds ( mol ) ; final ConnectedComponents cc = new ConnectedComponents ( GraphUtil . toAdjListSubgraph ( mol , mapped ) ) ; final IAtomContainerSet parts = ConnectivityChecker . partitionIntoMolecules ( mol , cc . components ( ) ) ; for ( IAtomContainer part : parts . atomContainers ( ) ) { // skip single atoms ( unmapped ) if ( part . getAtomCount ( ) == 1 ) continue ; final Map < Integer , IAtom > map = new HashMap < > ( ) ; for ( IAtom atom : part . atoms ( ) ) { // safe as substructure should only be mapped bonds and therefore atoms ! int idx = atom . getProperty ( CDKConstants . ATOM_ATOM_MAPPING ) ; if ( map . put ( idx , atom ) == null ) refmap . put ( idx , map ) ; } } } Map < IAtom , IAtom > afix = new HashMap < > ( ) ; Set < IBond > bfix = new HashSet < > ( ) ; for ( IAtomContainer mol : reaction . getReactants ( ) . atomContainers ( ) ) { Cycles . markRingAtomsAndBonds ( mol ) ; final ConnectedComponents cc = new ConnectedComponents ( GraphUtil . toAdjListSubgraph ( mol , mapped ) ) ; final IAtomContainerSet parts = ConnectivityChecker . partitionIntoMolecules ( mol , cc . components ( ) ) ; // we only aligned the largest part IAtomContainer largest = null ; for ( IAtomContainer part : parts . atomContainers ( ) ) { if ( largest == null || part . getBondCount ( ) > largest . getBondCount ( ) ) largest = part ; } afix . clear ( ) ; bfix . clear ( ) ; boolean aggresive = false ; if ( largest != null && largest . getAtomCount ( ) > 1 ) { int idx = largest . getAtom ( 0 ) . getProperty ( CDKConstants . ATOM_ATOM_MAPPING ) ; // select the largest and use those coordinates Map < Integer , IAtom > reference = select ( refmap . get ( idx ) ) ; for ( IAtom atom : largest . atoms ( ) ) { idx = atom . getProperty ( CDKConstants . ATOM_ATOM_MAPPING ) ; final IAtom src = reference . get ( idx ) ; if ( src == null ) continue ; if ( ! aggresive ) { // no way to get the container of ' src ' without // lots of refactoring , instead we just use the // new API points - first checking these will not // fail if ( src . getContainer ( ) != null && atom . getContainer ( ) != null && AtomPlacer . isColinear ( src , src . bonds ( ) ) != AtomPlacer . isColinear ( atom , atom . bonds ( ) ) ) continue ; } atom . setPoint2d ( new Point2d ( src . getPoint2d ( ) ) ) ; afix . put ( atom , src ) ; } } if ( ! afix . isEmpty ( ) ) { if ( aggresive ) { for ( IBond bond : mol . bonds ( ) ) { if ( afix . containsKey ( bond . getBegin ( ) ) && afix . containsKey ( bond . getEnd ( ) ) ) { // only fix acyclic bonds if the source atoms were also acyclic if ( ! bond . isInRing ( ) ) { IAtom srcBeg = afix . get ( bond . getBegin ( ) ) ; IAtom srcEnd = afix . get ( bond . getEnd ( ) ) ; for ( IAtomContainer product : reaction . getProducts ( ) . atomContainers ( ) ) { IBond srcBond = product . getBond ( srcBeg , srcEnd ) ; if ( srcBond != null ) { if ( ! srcBond . isInRing ( ) ) bfix . add ( bond ) ; // safe to add break ; } } } else { bfix . add ( bond ) ; } } } } else { for ( IBond bond : mol . bonds ( ) ) { if ( afix . containsKey ( bond . getBegin ( ) ) && afix . containsKey ( bond . getEnd ( ) ) ) { // only fix bonds that match their ring membership status IAtom srcBeg = afix . get ( bond . getBegin ( ) ) ; IAtom srcEnd = afix . get ( bond . getEnd ( ) ) ; for ( IAtomContainer product : reaction . getProducts ( ) . atomContainers ( ) ) { IBond srcBond = product . getBond ( srcBeg , srcEnd ) ; if ( srcBond != null ) { if ( srcBond . isInRing ( ) == bond . isInRing ( ) ) bfix . add ( bond ) ; break ; } } } } afix . clear ( ) ; for ( IBond bond : bfix ) { afix . put ( bond . getBegin ( ) , null ) ; afix . put ( bond . getEnd ( ) , null ) ; } int [ ] parts2 = new int [ mol . getAtomCount ( ) ] ; int numParts = 0 ; Deque < IAtom > queue = new ArrayDeque < > ( ) ; for ( IAtom atom : afix . keySet ( ) ) { if ( parts2 [ mol . indexOf ( atom ) ] != 0 ) continue ; parts2 [ mol . indexOf ( atom ) ] = ++ numParts ; for ( IBond bond : mol . getConnectedBondsList ( atom ) ) { if ( bfix . contains ( bond ) ) queue . add ( bond . getOther ( atom ) ) ; } while ( ! queue . isEmpty ( ) ) { atom = queue . poll ( ) ; if ( parts2 [ mol . indexOf ( atom ) ] != 0 ) continue ; parts2 [ mol . indexOf ( atom ) ] = numParts ; for ( IBond bond : mol . getConnectedBondsList ( atom ) ) { if ( bfix . contains ( bond ) ) queue . add ( bond . getOther ( atom ) ) ; } } } if ( numParts > 1 ) { int best = 0 ; int bestSize = 0 ; for ( int part = 1 ; part <= numParts ; part ++ ) { int size = 0 ; for ( int i = 0 ; i < parts2 . length ; i ++ ) { if ( parts2 [ i ] == part ) ++ size ; } if ( size > bestSize ) { bestSize = size ; best = part ; } } for ( IAtom atom : new ArrayList < > ( afix . keySet ( ) ) ) { if ( parts2 [ mol . indexOf ( atom ) ] != best ) { afix . remove ( atom ) ; bfix . removeAll ( mol . getConnectedBondsList ( atom ) ) ; } } } } } setMolecule ( mol , false , afix . keySet ( ) , bfix ) ; generateCoordinates ( ) ; } // reorder reactants such that they are in the same order they appear on the right reaction . getReactants ( ) . sortAtomContainers ( new Comparator < IAtomContainer > ( ) { @ Override public int compare ( IAtomContainer a , IAtomContainer b ) { Point2d aCenter = GeometryUtil . get2DCenter ( a ) ; Point2d bCenter = GeometryUtil . get2DCenter ( b ) ; if ( aCenter == null || bCenter == null ) return 0 ; else return Double . compare ( aCenter . x , bCenter . x ) ; } } ) ; } else { for ( IAtomContainer mol : reaction . getReactants ( ) . atomContainers ( ) ) generateCoordinates ( mol ) ; }
public class ConvertUtils { /** * Creates output object using provided creator . Returns null if obj null . */ public static < IN , OUT > OUT create ( IN obj , Creator < IN , OUT > creator ) { } }
return obj == null ? null : creator . create ( obj ) ;
public class PowerOfTwoFileAllocator { /** * Find a region of the given size . */ private Region find ( long size ) { } }
validate ( ! VALIDATING || Long . bitCount ( size ) == 1 ) ; Region current = this . root ; if ( ( current . available ( ) & size ) == 0 ) { // no region big enough for us . . . return null ; } else { while ( true ) { if ( current . left != null && ( current . left . available ( ) & size ) != 0 ) { current = current . left ; } else if ( ( current . availableHere ( ) & size ) != 0 ) { long mask = size - 1 ; long a = ( current . start ( ) + mask ) & ~ mask ; return new Region ( a , a + size - 1 ) ; } else if ( current . right != null && ( current . right . available ( ) & size ) != 0 ) { current = current . right ; } else { throw new AssertionError ( ) ; } } }
public class ArrowButtonPainter { /** * { @ inheritDoc } */ protected void doPaint ( Graphics2D g , JComponent c , int width , int height , Object [ ] extendedCacheKeys ) { } }
switch ( state ) { case FOREGROUND_DISABLED : paintForegroundDisabled ( g , width , height ) ; break ; case FOREGROUND_ENABLED : paintForegroundEnabled ( g , width , height ) ; break ; case FOREGROUND_PRESSED : paintForegroundPressed ( g , width , height ) ; break ; }
public class AbstractAccessControlProvider { /** * Registers the given { @ link AccessControl } and may be used for configuration of access controls during * bootstrapping . This method should not be used after the application startup ( bootstrapping ) has completed . * @ param accessControl the { @ link AccessControl } to register . */ protected void addAccessControl ( AccessControl accessControl ) { } }
String id = accessControl . getId ( ) ; AccessControl existing = this . id2nodeMap . get ( id ) ; if ( existing == null ) { this . id2nodeMap . put ( id , accessControl ) ; LOG . debug ( "Registered access control {}" , accessControl ) ; } else if ( existing == accessControl ) { LOG . debug ( "Access control {} was already registered." , accessControl ) ; } else { throw new IllegalStateException ( "Duplicate access control with ID '" + id + "'." ) ; }
public class GetBatchPredictionRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( GetBatchPredictionRequest getBatchPredictionRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( getBatchPredictionRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( getBatchPredictionRequest . getBatchPredictionId ( ) , BATCHPREDICTIONID_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class DropwizardMetricRegistry { /** * Creates a named { @ link Meter } that wraps a Dropwizard Metrics { @ link * com . codahale . metrics . Meter } . * @ param name * @ return a { @ link Meter } that wraps a Dropwizard Metrics { @ link com . codahale . metrics . Meter } */ @ Override public Meter meter ( String name ) { } }
final com . codahale . metrics . Meter meter = registry . meter ( name ) ; return new Meter ( ) { @ Override public void mark ( ) { meter . mark ( ) ; } @ Override public void mark ( long size ) { meter . mark ( size ) ; } } ;
public class CmsFileExplorer { /** * Reads the given tree level . < p > * @ param parentId the parent id * @ param openPathFragment the open path fragment */ void readTreeLevel ( CmsUUID parentId , String openPathFragment ) { } }
CmsObject cms = A_CmsUI . getCmsObject ( ) ; boolean openedFragment = false ; try { CmsResource parent = cms . readResource ( parentId , CmsResourceFilter . IGNORE_EXPIRATION ) ; String folderPath = cms . getSitePath ( parent ) ; List < CmsResource > folderResources = cms . readResources ( folderPath , FOLDERS , false ) ; // sets the parent to leaf mode , in case no child folders are present m_treeContainer . setChildrenAllowed ( parentId , ! folderResources . isEmpty ( ) ) ; for ( CmsResource resource : folderResources ) { addTreeItem ( cms , resource , parentId , false , m_treeContainer ) ; openedFragment = openedFragment || resource . getName ( ) . equals ( openPathFragment ) ; } if ( ! openedFragment && ( openPathFragment != null ) ) { CmsResource resource = cms . readResource ( CmsStringUtil . joinPaths ( folderPath , openPathFragment ) , CmsResourceFilter . IGNORE_EXPIRATION ) ; addTreeItem ( cms , resource , parentId , true , m_treeContainer ) ; } m_fileTree . markAsDirtyRecursive ( ) ; } catch ( CmsException e ) { CmsErrorDialog . showErrorDialog ( e ) ; LOG . error ( e . getLocalizedMessage ( ) , e ) ; }
public class AddSiteLinksUsingFeeds { /** * Runs the example . * @ param adWordsServices the services factory . * @ param session the session . * @ param campaignId the ID of the campaign where sitelinks will be added . * @ param feedName the name of the new sitelinks feed . * @ param adGroupId the ID of the ad group to which additional targeting will be applied . * @ throws ApiException if the API request failed with one or more service errors . * @ throws RemoteException if the API request failed due to other errors . */ public static void runExample ( AdWordsServicesInterface adWordsServices , AdWordsSession session , Long campaignId , String feedName , @ Nullable Long adGroupId ) throws RemoteException { } }
SiteLinksDataHolder siteLinksData = new SiteLinksDataHolder ( ) ; createSiteLinksFeed ( adWordsServices , session , siteLinksData , feedName ) ; createSiteLinksFeedItems ( adWordsServices , session , siteLinksData ) ; createSiteLinksFeedMapping ( adWordsServices , session , siteLinksData ) ; createSiteLinksCampaignFeed ( adWordsServices , session , siteLinksData , campaignId ) ; // Optional : Restrict the first feed item to only serve with ads for the specified ad group ID . if ( adGroupId != null ) { restrictFeedItemToAdGroup ( adWordsServices , session , siteLinksData , adGroupId ) ; }
public class CrawlActionsBuilder { /** * Click no children of the specified parent element . * @ param tagName The tag name of which no children should be clicked . * @ return The builder to append more options . */ public ExcludeByParentBuilder dontClickChildrenOf ( String tagName ) { } }
checkNotRead ( ) ; Preconditions . checkNotNull ( tagName ) ; ExcludeByParentBuilder exclude = new ExcludeByParentBuilder ( tagName . toUpperCase ( ) ) ; crawlParentsExcluded . add ( exclude ) ; return exclude ;
public class ReflectionUtils { /** * Asserts only one method is annotated with annotation . * @ param method collection of methods to validate * @ param annotation annotation to propagate in exception message */ public static void assertOnlyOneMethod ( final Collection < Method > methods , Class < ? extends Annotation > annotation ) { } }
if ( methods . size ( ) > 1 ) { throw annotation == null ? MESSAGES . onlyOneMethodCanExist ( ) : MESSAGES . onlyOneMethodCanExist2 ( annotation ) ; }
public class Query { /** * Bind the given { @ link java . util . Date } to the PreparedStatement as a { @ link java . sql . Date } . * @ param date The { @ literal java . util . Date } to bind . * @ return { @ literal this } */ public Query addDateParameter ( java . util . Date date ) { } }
return addParameter ( new Date ( date . getTime ( ) ) ) ;
public class AbstractInterceptor { /** * Create accumulator and register it . * @ param producerId id of the producer * @ param annotation Accumulate annotation * @ param accName Accumulator name * @ param statsName Statistics name */ private void createAccumulator ( String producerId , Accumulate annotation , String accName , String statsName ) { } }
if ( annotation != null && producerId != null && ! producerId . isEmpty ( ) && accName != null && ! accName . isEmpty ( ) && statsName != null && ! statsName . isEmpty ( ) ) { AccumulatorDefinition definition = new AccumulatorDefinition ( ) ; if ( annotation . name ( ) . length ( ) > 0 ) { definition . setName ( annotation . name ( ) ) ; } else { definition . setName ( accName ) ; } definition . setIntervalName ( annotation . intervalName ( ) ) ; definition . setProducerName ( producerId ) ; definition . setStatName ( statsName ) ; definition . setValueName ( annotation . valueName ( ) ) ; definition . setTimeUnit ( annotation . timeUnit ( ) ) ; AccumulatorRepository . getInstance ( ) . createAccumulator ( definition ) ; }
public class CssEscape { /** * Perform a CSS String level 2 ( basic set and all non - ASCII chars ) < strong > escape < / strong > operation * on a < tt > String < / tt > input . * < em > Level 2 < / em > means this method will escape : * < ul > * < li > The CSS String basic escape set : * < ul > * < li > The < em > Backslash Escapes < / em > : * < tt > & # 92 ; & quot ; < / tt > ( < tt > U + 0022 < / tt > ) and * < tt > & # 92 ; & # 39 ; < / tt > ( < tt > U + 0027 < / tt > ) . * < / li > * < li > * Two ranges of non - displayable , control characters : < 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 Backslash escapes whenever possible . For escaped * characters that do not have an associated Backslash , default to < tt > & # 92 ; FF < / tt > * Hexadecimal Escapes . * This method calls * { @ link # escapeCssString ( String , CssStringEscapeType , CssStringEscapeLevel ) } * with the following preconfigured values : * < ul > * < li > < tt > type < / tt > : * { @ link CssStringEscapeType # BACKSLASH _ ESCAPES _ DEFAULT _ TO _ COMPACT _ HEXA } < / li > * < li > < tt > level < / tt > : * { @ link CssStringEscapeLevel # LEVEL _ 2 _ ALL _ NON _ ASCII _ PLUS _ BASIC _ ESCAPE _ SET } < / li > * < / ul > * This method is < strong > thread - safe < / strong > . * @ param text the < tt > String < / tt > to be escaped . * @ return The escaped result < tt > String < / tt > . As a memory - performance improvement , will return the exact * same object as the < tt > text < / tt > input argument if no escaping modifications were required ( and * no additional < tt > String < / tt > objects will be created during processing ) . Will * return < tt > null < / tt > if input is < tt > null < / tt > . */ public static String escapeCssString ( final String text ) { } }
return escapeCssString ( text , CssStringEscapeType . BACKSLASH_ESCAPES_DEFAULT_TO_COMPACT_HEXA , CssStringEscapeLevel . LEVEL_2_ALL_NON_ASCII_PLUS_BASIC_ESCAPE_SET ) ;
public class ScriptRuntime { /** * Equality * See ECMA 11.9 */ public static boolean eq ( Object x , Object y ) { } }
if ( x == null || x == Undefined . instance ) { if ( y == null || y == Undefined . instance ) { return true ; } if ( y instanceof ScriptableObject ) { Object test = ( ( ScriptableObject ) y ) . equivalentValues ( x ) ; if ( test != Scriptable . NOT_FOUND ) { return ( ( Boolean ) test ) . booleanValue ( ) ; } } return false ; } else if ( x instanceof Number ) { return eqNumber ( ( ( Number ) x ) . doubleValue ( ) , y ) ; } else if ( x == y ) { return true ; } else if ( x instanceof CharSequence ) { return eqString ( ( CharSequence ) x , y ) ; } else if ( x instanceof Boolean ) { boolean b = ( ( Boolean ) x ) . booleanValue ( ) ; if ( y instanceof Boolean ) { return b == ( ( Boolean ) y ) . booleanValue ( ) ; } if ( y instanceof ScriptableObject ) { Object test = ( ( ScriptableObject ) y ) . equivalentValues ( x ) ; if ( test != Scriptable . NOT_FOUND ) { return ( ( Boolean ) test ) . booleanValue ( ) ; } } return eqNumber ( b ? 1.0 : 0.0 , y ) ; } else if ( x instanceof Scriptable ) { if ( y instanceof Scriptable ) { if ( x instanceof ScriptableObject ) { Object test = ( ( ScriptableObject ) x ) . equivalentValues ( y ) ; if ( test != Scriptable . NOT_FOUND ) { return ( ( Boolean ) test ) . booleanValue ( ) ; } } if ( y instanceof ScriptableObject ) { Object test = ( ( ScriptableObject ) y ) . equivalentValues ( x ) ; if ( test != Scriptable . NOT_FOUND ) { return ( ( Boolean ) test ) . booleanValue ( ) ; } } if ( x instanceof Wrapper && y instanceof Wrapper ) { // See bug 413838 . Effectively an extension to ECMA for // the LiveConnect case . Object unwrappedX = ( ( Wrapper ) x ) . unwrap ( ) ; Object unwrappedY = ( ( Wrapper ) y ) . unwrap ( ) ; return unwrappedX == unwrappedY || ( isPrimitive ( unwrappedX ) && isPrimitive ( unwrappedY ) && eq ( unwrappedX , unwrappedY ) ) ; } return false ; } else if ( y instanceof Boolean ) { if ( x instanceof ScriptableObject ) { Object test = ( ( ScriptableObject ) x ) . equivalentValues ( y ) ; if ( test != Scriptable . NOT_FOUND ) { return ( ( Boolean ) test ) . booleanValue ( ) ; } } double d = ( ( Boolean ) y ) . booleanValue ( ) ? 1.0 : 0.0 ; return eqNumber ( d , x ) ; } else if ( y instanceof Number ) { return eqNumber ( ( ( Number ) y ) . doubleValue ( ) , x ) ; } else if ( y instanceof CharSequence ) { return eqString ( ( CharSequence ) y , x ) ; } // covers the case when y = = Undefined . instance as well return false ; } else { warnAboutNonJSObject ( x ) ; return x == y ; }
public class MeasureUnitUtil { /** * Convert the given value expressed in radians per second to the given unit . * @ param value is the value to convert * @ param outputUnit is the unit of result . * @ return the result of the convertion . */ @ Pure public static double fromRadiansPerSecond ( double value , AngularUnit outputUnit ) { } }
switch ( outputUnit ) { case TURNS_PER_SECOND : return value / ( 2. * MathConstants . PI ) ; case DEGREES_PER_SECOND : return Math . toDegrees ( value ) ; case RADIANS_PER_SECOND : default : } return value ;
public class RequireJS { /** * Returns the JSON that is used to setup the RequireJS config . * This value is cached in memory so that all of the processing to get the JSON only has to happen once . * @ param urlPrefix The URL prefix where the WebJars can be downloaded from with a trailing slash , e . g . / webJars / * @ return The JSON structured config */ public synchronized static Map < String , ObjectNode > getSetupJson ( String urlPrefix ) { } }
if ( requireConfigJson == null ) { List < Map . Entry < String , Boolean > > prefixes = new ArrayList < > ( ) ; prefixes . add ( new AbstractMap . SimpleEntry < > ( urlPrefix , true ) ) ; requireConfigJson = generateSetupJson ( prefixes ) ; } return requireConfigJson ;
public class CursorManager { /** * This returns a list of { @ link IoDevice } s that are connected and currently controlling a * { @ link Cursor } . This list will not include any { @ link IoDevice } that is not connected or * connected but not controlling a { @ link Cursor } . * @ return The list of used { @ link IoDevice } s */ public List < IoDevice > getUsedIoDevices ( ) { } }
final ArrayList < IoDevice > used = new ArrayList < > ( ) ; synchronized ( mIODevices ) { for ( IoDevice d : mIODevices ) { if ( isDeviceActive ( d ) ) { used . add ( d ) ; } } } return used ;
public class World { /** * Scans up to a number of fields in front of the robot , stopping on the first field that * contains a robot * @ param robot scanning robot * @ param dist maximum distance * @ return a container of information about the scan * @ see ScanResult */ public ScanResult scan ( Robot robot , int dist ) { } }
Point space = getReferenceField ( robot , dist ) ; Robot inPosition = getRobotAt ( space ) ; ScanResult ret = null ; if ( inPosition == null ) { ret = new ScanResult ( Found . EMPTY , dist ) ; } else { if ( robot . getData ( ) . getTeamId ( ) == inPosition . getData ( ) . getTeamId ( ) ) { ret = new ScanResult ( Found . FRIEND , dist ) ; } else { ret = new ScanResult ( Found . ENEMY , dist ) ; } } return ret ;
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EClass getIfcFacetedBrepWithVoids ( ) { } }
if ( ifcFacetedBrepWithVoidsEClass == null ) { ifcFacetedBrepWithVoidsEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 259 ) ; } return ifcFacetedBrepWithVoidsEClass ;
public class FcmServiceClientImpl { /** * Sends an FCM message to the given set of registration tokens with the given request payload . * @ param registrationTokens the devices to send a message to . * @ param request the details of the message . * @ return A { @ link Task } that contains the result of sending the message . */ @ Override public Task < FcmSendMessageResult > sendMessageToRegistrationTokens ( final Collection < String > registrationTokens , final FcmSendMessageRequest request ) { } }
return dispatcher . dispatchTask ( new Callable < FcmSendMessageResult > ( ) { @ Override public FcmSendMessageResult call ( ) { return proxy . sendMessageToRegistrationTokens ( registrationTokens , request ) ; } } ) ;
public class CmsXmlContentTypeManager { /** * Returns a fresh XML content handler instance for the specified class name . < p > * @ param className the name of the XML content handler to return * @ return the XML content handler class * @ throws CmsXmlException if something goes wrong */ public I_CmsXmlContentHandler getFreshContentHandler ( String className ) throws CmsXmlException { } }
I_CmsXmlContentHandler contentHandler ; // generate an instance for the content handler try { contentHandler = ( I_CmsXmlContentHandler ) Class . forName ( className ) . newInstance ( ) ; } catch ( InstantiationException e ) { throw new CmsXmlException ( Messages . get ( ) . container ( Messages . ERR_INVALID_CONTENT_HANDLER_1 , className ) ) ; } catch ( IllegalAccessException e ) { throw new CmsXmlException ( Messages . get ( ) . container ( Messages . ERR_INVALID_CONTENT_HANDLER_1 , className ) ) ; } catch ( ClassCastException e ) { throw new CmsXmlException ( Messages . get ( ) . container ( Messages . ERR_INVALID_CONTENT_HANDLER_1 , className ) ) ; } catch ( ClassNotFoundException e ) { throw new CmsXmlException ( Messages . get ( ) . container ( Messages . ERR_INVALID_CONTENT_HANDLER_1 , className ) ) ; } return contentHandler ;
public class CqlNativeStorage { /** * writer write the data by executing CQL query */ private void sendCqlQuery ( Map < String , ByteBuffer > key , List < ByteBuffer > bindedVariables ) throws IOException { } }
try { writer . write ( key , bindedVariables ) ; } catch ( InterruptedException e ) { throw new IOException ( e ) ; }
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EClass getIfcMolecularWeightMeasure ( ) { } }
if ( ifcMolecularWeightMeasureEClass == null ) { ifcMolecularWeightMeasureEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 715 ) ; } return ifcMolecularWeightMeasureEClass ;
public class JwwfServer { /** * Attahes new plugin to this server * @ param plugin Plugin to attach * @ return This JwwfServer */ public JwwfServer attachPlugin ( JwwfPlugin plugin ) { } }
plugins . add ( plugin ) ; if ( plugin instanceof IPluginGlobal ) ( ( IPluginGlobal ) plugin ) . onAttach ( this ) ; return this ;
public class LocalTime { /** * Returns a copy of this { @ code LocalTime } with the nano - of - second altered . * This instance is immutable and unaffected by this method call . * @ param nanoOfSecond the nano - of - second to set in the result , from 0 to 999,999,999 * @ return a { @ code LocalTime } based on this time with the requested nanosecond , not null * @ throws DateTimeException if the nanos value is invalid */ public LocalTime withNano ( int nanoOfSecond ) { } }
if ( this . nano == nanoOfSecond ) { return this ; } NANO_OF_SECOND . checkValidValue ( nanoOfSecond ) ; return create ( hour , minute , second , nanoOfSecond ) ;
public class JSONArray { /** * Put or replace a double value . If the index is greater than the length of * the JSONArray , then null elements will be added as necessary to pad * it out . * @ param index The subscript . * @ param value A double value . * @ return this * @ throws JSONException If the index is negative or if the value is * not finite . */ public JSONArray put ( int index , double value ) throws JSONException { } }
put ( index , Double . valueOf ( value ) ) ; return this ;
public class PactDslJsonArray { /** * Element that can be any string * @ param example example value to use for generated bodies */ public PactDslJsonArray stringType ( String example ) { } }
body . put ( example ) ; matchers . addRule ( rootPath + appendArrayIndex ( 0 ) , TypeMatcher . INSTANCE ) ; return this ;
public class MPDDatabaseReader { /** * Read project data from a database . * @ return ProjectFile instance * @ throws MPXJException */ public ProjectFile read ( ) throws MPXJException { } }
MPD9DatabaseReader reader = new MPD9DatabaseReader ( ) ; reader . setProjectID ( m_projectID ) ; reader . setPreserveNoteFormatting ( m_preserveNoteFormatting ) ; reader . setDataSource ( m_dataSource ) ; reader . setConnection ( m_connection ) ; ProjectFile project = reader . read ( ) ; return ( project ) ;
public class EJBJavaColonNamingHelper { /** * Remove names from the global mapping . * @ param names List of names to remove . */ public void removeGlobalBindings ( List < String > names ) { } }
Lock writeLock = javaColonLock . writeLock ( ) ; writeLock . lock ( ) ; try { for ( String name : names ) { javaColonGlobalBindings . unbind ( name ) ; } } finally { writeLock . unlock ( ) ; }
public class GetPlaybackConfigurationResult { /** * The tags assigned to the playback configuration . * @ param tags * The tags assigned to the playback configuration . * @ return Returns a reference to this object so that method calls can be chained together . */ public GetPlaybackConfigurationResult withTags ( java . util . Map < String , String > tags ) { } }
setTags ( tags ) ; return this ;
public class JobScheduler { /** * Check if the given job is scheduled . * @ param job the job to check * @ return true if the job is scheduled , false else * @ throws JobSchedulerException thrown if an exception occurs while checking if the job is scheduled */ public boolean isScheduled ( final org . easybatch . core . job . Job job ) throws JobSchedulerException { } }
String jobName = job . getName ( ) ; try { return scheduler . checkExists ( TriggerKey . triggerKey ( TRIGGER_NAME_PREFIX + jobName ) ) ; } catch ( SchedulerException e ) { throw new JobSchedulerException ( format ( "Unable to check if the job '%s' is scheduled" , jobName ) , e ) ; }
public class ConcurrentHeapThetaBuffer { /** * Propagates the content of the buffer as a sketch to the shared sketch */ private void propagateToSharedSketch ( ) { } }
// noinspection StatementWithEmptyBody while ( localPropagationInProgress . get ( ) ) { } // busy wait until previous propagation completed final CompactSketch compactSketch = compact ( propagateOrderedCompact , null ) ; localPropagationInProgress . set ( true ) ; shared . propagate ( localPropagationInProgress , compactSketch , ConcurrentSharedThetaSketch . NOT_SINGLE_HASH ) ; super . reset ( ) ; thetaLong_ = shared . getVolatileTheta ( ) ;
public class ArchiveResourceListSource { /** * Returns a list of file resources contained in the specified directory * within a given Zip ' d archive file . * @ param file the zip file containing the resources to return * @ param root the directory within the zip file containing the resources * @ return a list of file resources contained in the specified directory * within a given Zip ' d archive file */ private List getResources ( ZipFile file , String root ) { } }
List resourceNames = new ArrayList ( ) ; Enumeration e = file . entries ( ) ; while ( e . hasMoreElements ( ) ) { ZipEntry entry = ( ZipEntry ) e . nextElement ( ) ; String name = entry . getName ( ) ; if ( name . startsWith ( root ) && ! ( name . indexOf ( '/' ) > root . length ( ) ) && ! entry . isDirectory ( ) ) { // Calling File . getPath ( ) cleans up the path so that it ' s using // the proper path separators for the host OS name = new File ( name ) . getPath ( ) ; resourceNames . add ( name ) ; } } return resourceNames ;
public class RMIImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public Object eGet ( int featureID , boolean resolve , boolean coreType ) { } }
switch ( featureID ) { case AfplibPackage . RMI__INCRMENT : return getINCRMENT ( ) ; } return super . eGet ( featureID , resolve , coreType ) ;
public class WordTree { /** * 增加一组单词 * @ param words 单词集合 */ public void addWords ( Collection < String > words ) { } }
if ( false == ( words instanceof Set ) ) { words = new HashSet < > ( words ) ; } for ( String word : words ) { addWord ( word ) ; }
public class CmsGalleryController { /** * Removes all selected galleries from the search object . < p > */ public void clearGalleries ( ) { } }
List < String > selectedGalleries = m_searchObject . getGalleries ( ) ; m_handler . onClearGalleries ( selectedGalleries ) ; m_searchObject . clearGalleries ( ) ; updateResultsTab ( false ) ; ValueChangeEvent . fire ( this , m_searchObject ) ;
public class TableStatServiceImpl { /** * 列出pairId下 , start - end时间段下的tableStat , 首先从数据库中取出这一段时间所有数据 , 该数据都是根据end _ time倒排序的 , 每隔1分钟将这些数据分组 */ public Map < Long , BehaviorHistoryInfo > listTimelineBehaviorHistory ( TimelineBehaviorHistoryCondition condition ) { } }
Assert . assertNotNull ( condition ) ; Map < Long , BehaviorHistoryInfo > behaviorHistoryInfos = new LinkedHashMap < Long , BehaviorHistoryInfo > ( ) ; List < TableHistoryStatDO > tableHistoryStatDOs = tableHistoryStatDao . listTimelineTableStat ( condition ) ; int size = tableHistoryStatDOs . size ( ) ; int k = size - 1 ; for ( Long i = condition . getStart ( ) . getTime ( ) ; i <= condition . getEnd ( ) . getTime ( ) ; i += 60 * 1000 ) { BehaviorHistoryInfo behaviorHistoryInfo = new BehaviorHistoryInfo ( ) ; List < TableStat > tableStat = new ArrayList < TableStat > ( ) ; // 取出每个时间点i以内的数据 , k是一个游标 , 每次遍历时前面已经取过了的数据就不用再遍历了 for ( int j = k ; j >= 0 ; -- j ) { if ( ( i - tableHistoryStatDOs . get ( j ) . getEndTime ( ) . getTime ( ) <= 60 * 1000 ) && ( i - tableHistoryStatDOs . get ( j ) . getEndTime ( ) . getTime ( ) >= 0 ) ) { tableStat . add ( tableHistoryStatDOToModel ( tableHistoryStatDOs . get ( j ) ) ) ; k = j - 1 ; } // 如果不满足if条件 , 则后面的数据也不用再遍历 else { break ; } } if ( tableStat . size ( ) > 0 ) { behaviorHistoryInfo . setItems ( tableStat ) ; behaviorHistoryInfos . put ( i , behaviorHistoryInfo ) ; } } return behaviorHistoryInfos ;
public class ParsePackage { /** * Parse the process . * @ return ProcessDefinition */ private ProcessDefinition processProcess ( ProcessTextProvider textProvider ) { } }
int start = textProvider . getPos ( ) ; if ( ! JavaClass ( textProvider ) ) { throw new ParserException ( "Missing class name" , textProvider ) ; } textProvider . accumulate ( " " ) ; String className = textProvider . getLastToken ( ) ; // if ( className . indexOf ( ' . ' ) = = - 1 ) { // className = textProvider . getPackageName ( ) + className ; textProvider . setCurrentScope ( className ) ; String processName = getProcessName ( textProvider ) ; textProvider . addTOCElement ( null , processName , start , textProvider . getPos ( ) , TYPE_PROCESS ) ; String launchForm = null ; String queueName = null ; String description = "" ; if ( quotedString ( '"' , textProvider ) ) { description = textProvider . getLastToken ( ) ; } if ( exact ( "launchForm" , textProvider ) ) { exactOrError ( "=" , textProvider ) ; if ( ! CVariable ( textProvider ) ) { throw new ParserException ( "Missing launch form name" , textProvider ) ; } launchForm = textProvider . getLastToken ( ) ; if ( exact ( "queue" , textProvider ) ) { exactOrError ( "=" , textProvider ) ; if ( ! quotedString ( '"' , textProvider ) ) { throw new ParserException ( "Missing queue name" , textProvider ) ; } queueName = textProvider . getLastToken ( ) ; if ( textProvider . getWorkflowManager ( ) . getQueue ( queueName ) == null ) { throw new ParserException ( "Missing queue definition for " + queueName , textProvider ) ; } } } ProcessDefinition ret = new ProcessDefinition ( processName , className , textProvider . getWorkflowManager ( ) , launchForm , queueName , textProvider . getPackageName ( ) , description ) ; ret . addTask ( new TaskStart ( ret ) ) ; log . debug ( ret . getName ( ) ) ; textProvider . accumulate ( "\n" ) ; processTaskList ( ret , textProvider ) ; commit ( textProvider ) ; return ret ;
public class AcroFields { /** * Renames a field . Only the last part of the name can be renamed . For example , * if the original field is " ab . cd . ef " only the " ef " part can be renamed . * @ param oldName the old field name * @ param newName the new field name * @ return < CODE > true < / CODE > if the renaming was successful , < CODE > false < / CODE > * otherwise */ public boolean renameField ( String oldName , String newName ) { } }
int idx1 = oldName . lastIndexOf ( '.' ) + 1 ; int idx2 = newName . lastIndexOf ( '.' ) + 1 ; if ( idx1 != idx2 ) return false ; if ( ! oldName . substring ( 0 , idx1 ) . equals ( newName . substring ( 0 , idx2 ) ) ) return false ; if ( fields . containsKey ( newName ) ) return false ; Item item = ( Item ) fields . get ( oldName ) ; if ( item == null ) return false ; newName = newName . substring ( idx2 ) ; PdfString ss = new PdfString ( newName , PdfObject . TEXT_UNICODE ) ; item . writeToAll ( PdfName . T , ss , Item . WRITE_VALUE | Item . WRITE_MERGED ) ; item . markUsed ( this , Item . WRITE_VALUE ) ; fields . remove ( oldName ) ; fields . put ( newName , item ) ; return true ;
public class SelectScan { /** * UpdateScan methods */ @ Override public void setVal ( String fldname , Constant val ) { } }
UpdateScan us = ( UpdateScan ) s ; us . setVal ( fldname , val ) ;
public class PHPMethods { /** * Matches a string with a pattern and replaces the matched components with * a provided string . * @ param pattern * @ param replacement * @ param subject * @ return */ public static String preg_replace ( Pattern pattern , String replacement , String subject ) { } }
Matcher m = pattern . matcher ( subject ) ; StringBuffer sb = new StringBuffer ( subject . length ( ) ) ; while ( m . find ( ) ) { m . appendReplacement ( sb , replacement ) ; } m . appendTail ( sb ) ; return sb . toString ( ) ;
public class RemoteRefPolling { /** * counts active remote refs , if none backoff remoteref polling massively eats cpu */ public void run ( ) { } }
pollThread = Thread . currentThread ( ) ; if ( underway ) return ; underway = true ; try { int count = 1 ; while ( count > 0 ) { // as long there are messages , keep sending them count = onePoll ( ) ; if ( sendJobs . size ( ) > 0 ) { if ( count > 0 ) { int debug = 1 ; } else { if ( remoteRefCounter == 0 ) // no remote actors registered { Actor . current ( ) . delayed ( 100 , this ) ; // backoff massively } else { Actor . current ( ) . delayed ( 1 , this ) ; // backoff a bit ( remoteactors present , no messages ) } } } else { // no schedule entries ( = = no clients ) Actor . current ( ) . delayed ( 100 , this ) ; } } } finally { underway = false ; }
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EClass getIfcIsothermalMoistureCapacityMeasure ( ) { } }
if ( ifcIsothermalMoistureCapacityMeasureEClass == null ) { ifcIsothermalMoistureCapacityMeasureEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 820 ) ; } return ifcIsothermalMoistureCapacityMeasureEClass ;
public class StringGrabber { /** * remove N chars from head * @ see StringGrabber # carryHead ( ) * @ param cnt * count of chars * @ return */ public StringGrabber removeHead ( int cnt ) { } }
try { sb . delete ( 0 , cnt ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } return StringGrabber . this ;
public class Expressions { /** * Create a new Path expression * @ param type type of expression * @ param variable variable name * @ return path expression */ public static < T extends Comparable < ? > > ComparablePath < T > comparablePath ( Class < ? extends T > type , String variable ) { } }
return new ComparablePath < T > ( type , PathMetadataFactory . forVariable ( variable ) ) ;
public class hqlParser { /** * hql . g : 606:1 : expressionOrVector : e = expression ( v = vectorExpr ) ? - > { v ! = null } ? ^ ( VECTOR _ EXPR [ \ " { vector } \ " ] $ e $ v ) - > ^ ( $ e ) ; */ public final hqlParser . expressionOrVector_return expressionOrVector ( ) throws RecognitionException { } }
hqlParser . expressionOrVector_return retval = new hqlParser . expressionOrVector_return ( ) ; retval . start = input . LT ( 1 ) ; CommonTree root_0 = null ; ParserRuleReturnScope e = null ; ParserRuleReturnScope v = null ; RewriteRuleSubtreeStream stream_expression = new RewriteRuleSubtreeStream ( adaptor , "rule expression" ) ; RewriteRuleSubtreeStream stream_vectorExpr = new RewriteRuleSubtreeStream ( adaptor , "rule vectorExpr" ) ; try { // hql . g : 607:2 : ( e = expression ( v = vectorExpr ) ? - > { v ! = null } ? ^ ( VECTOR _ EXPR [ \ " { vector } \ " ] $ e $ v ) - > ^ ( $ e ) ) // hql . g : 607:4 : e = expression ( v = vectorExpr ) ? { pushFollow ( FOLLOW_expression_in_expressionOrVector2948 ) ; e = expression ( ) ; state . _fsp -- ; stream_expression . add ( e . getTree ( ) ) ; // hql . g : 607:17 : ( v = vectorExpr ) ? int alt88 = 2 ; int LA88_0 = input . LA ( 1 ) ; if ( ( LA88_0 == COMMA ) ) { alt88 = 1 ; } switch ( alt88 ) { case 1 : // hql . g : 607:19 : v = vectorExpr { pushFollow ( FOLLOW_vectorExpr_in_expressionOrVector2954 ) ; v = vectorExpr ( ) ; state . _fsp -- ; stream_vectorExpr . add ( v . getTree ( ) ) ; } break ; } // AST REWRITE // elements : v , e , e // token labels : // rule labels : v , retval , e // token list labels : // rule list labels : // wildcard labels : retval . tree = root_0 ; RewriteRuleSubtreeStream stream_v = new RewriteRuleSubtreeStream ( adaptor , "rule v" , v != null ? v . getTree ( ) : null ) ; RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream ( adaptor , "rule retval" , retval != null ? retval . getTree ( ) : null ) ; RewriteRuleSubtreeStream stream_e = new RewriteRuleSubtreeStream ( adaptor , "rule e" , e != null ? e . getTree ( ) : null ) ; root_0 = ( CommonTree ) adaptor . nil ( ) ; // 608:2 : - > { v ! = null } ? ^ ( VECTOR _ EXPR [ \ " { vector } \ " ] $ e $ v ) if ( v != null ) { // hql . g : 608:18 : ^ ( VECTOR _ EXPR [ \ " { vector } \ " ] $ e $ v ) { CommonTree root_1 = ( CommonTree ) adaptor . nil ( ) ; root_1 = ( CommonTree ) adaptor . becomeRoot ( adaptor . create ( VECTOR_EXPR , "{vector}" ) , root_1 ) ; adaptor . addChild ( root_1 , stream_e . nextTree ( ) ) ; adaptor . addChild ( root_1 , stream_v . nextTree ( ) ) ; adaptor . addChild ( root_0 , root_1 ) ; } } else // 609:2 : - > ^ ( $ e ) { // hql . g : 609:5 : ^ ( $ e ) { CommonTree root_1 = ( CommonTree ) adaptor . nil ( ) ; root_1 = ( CommonTree ) adaptor . becomeRoot ( stream_e . nextNode ( ) , root_1 ) ; adaptor . addChild ( root_0 , root_1 ) ; } } retval . tree = root_0 ; } retval . stop = input . LT ( - 1 ) ; retval . tree = ( CommonTree ) adaptor . rulePostProcessing ( root_0 ) ; adaptor . setTokenBoundaries ( retval . tree , retval . start , retval . stop ) ; } catch ( RecognitionException re ) { reportError ( re ) ; recover ( input , re ) ; retval . tree = ( CommonTree ) adaptor . errorNode ( input , retval . start , input . LT ( - 1 ) , re ) ; } finally { // do for sure before leaving } return retval ;
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EClass getIfcThermalResistanceMeasure ( ) { } }
if ( ifcThermalResistanceMeasureEClass == null ) { ifcThermalResistanceMeasureEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 752 ) ; } return ifcThermalResistanceMeasureEClass ;