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" ... | 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 = rul... | 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_argu... |
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... |
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
... | 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 create... | 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 ) ; protocolMarshal... |
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 Doubl... | 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 "
* > > > eliminateVowel... | 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 Transco... | 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 ( callb... |
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... | List < Method > matchingMethods = findMatchingAnnotatedMethods ( key ) ; for ( Method method : matchingMethods ) { Class < ? extends JacksonAwareStringToTypeConverter < ? > > converterClass = findAnnotatedTypeConverter ( method ) ; if ( converterClass == null ) { continue ; } JacksonAwareStringToTypeConverter < ? > con... |
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 java... |
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 em... | // 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 .... |
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
... | 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
columnToOuterMostNullEmbeddableCach... |
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 ( ) ) ; eventB... |
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... |
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 indicat... | 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 ... |
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 > Loca... | 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 , bMaxNumLoc... |
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 ... | 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 callGet... | 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 ) { thr... |
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 statu... | 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 ) ; write... |
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 w... | "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 ( ... |
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 ( "Sc... |
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 t... |
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 ( )
* ... | 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
//... |
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 ... |
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 ; } el... |
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... | 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 replace... | 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 ( dataSour... |
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 ; } } els... |
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 . c... |
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 . set... |
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... | // 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 ) { fina... |
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 . ... |
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 AccessCont... | 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 alr... |
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 marsha... |
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 (... | 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 ... |
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 ... | SiteLinksDataHolder siteLinksData = new SiteLinksDataHolder ( ) ; createSiteLinksFeed ( adWordsServices , session , siteLinksData , feedName ) ; createSiteLinksFeedItems ( adWordsServices , session , siteLinksData ) ; createSiteLinksFeedMapping ( adWordsServices , session , siteLinksData ) ; createSiteLinksCampaignFeed... |
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 Annotat... | 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 , ... | 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 ( annota... |
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 > T... | 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 f... |
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 , Angul... | 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 ... | 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 { @ lin... | 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 ,... | 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 ... |
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 th... | 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_CmsXmlContentHan... | 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_H... |
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 t... | 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 i... | 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 ( ... | 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 . ... | 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 , compa... |
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 ... | 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 ( ) ) { /... |
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 -... |
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 . get... |
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 r... | 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... |
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 ... |
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 expr... |
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 ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.