signature
stringlengths 43
39.1k
| implementation
stringlengths 0
450k
|
|---|---|
public class MultiBackgroundInitializer { /** * Returns the number of tasks needed for executing all child { @ code
* BackgroundInitializer } objects in parallel . This implementation sums up
* the required tasks for all child initializers ( which is necessary if one
* of the child initializers is itself a { @ code MultiBackgroundInitializer }
* ) . Then it adds 1 for the control task that waits for the completion of
* the children .
* @ return the number of tasks required for background processing */
@ Override protected int getTaskCount ( ) { } }
|
int result = 1 ; for ( final BackgroundInitializer < ? > bi : childInitializers . values ( ) ) { result += bi . getTaskCount ( ) ; } return result ;
|
public class JaxbUtils { /** * Creates an XMLStreamReader based on an input stream .
* @ param is the input stream from which the data to be parsed will be taken
* @ param namespaceAware if { @ code false } the XMLStreamReader will remove all namespaces from all
* XML elements
* @ return platform - specific XMLStreamReader implementation
* @ throws JAXBException if the XMLStreamReader could not be created */
public static XMLStreamReader createXmlStreamReader ( InputStream is , boolean namespaceAware ) throws JAXBException { } }
|
XMLInputFactory xif = getXmlInputFactory ( namespaceAware ) ; XMLStreamReader xsr = null ; try { xsr = xif . createXMLStreamReader ( is ) ; } catch ( XMLStreamException e ) { throw new JAXBException ( e ) ; } return xsr ;
|
public class AppsImpl { /** * Gets the endpoint URLs for the prebuilt Cortana applications .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the PersonalAssistantsResponse object */
public Observable < ServiceResponse < PersonalAssistantsResponse > > listCortanaEndpointsWithServiceResponseAsync ( ) { } }
|
if ( this . client . endpoint ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.endpoint() is required and cannot be null." ) ; } String parameterizedHost = Joiner . on ( ", " ) . join ( "{Endpoint}" , this . client . endpoint ( ) ) ; return service . listCortanaEndpoints ( this . client . acceptLanguage ( ) , parameterizedHost , this . client . userAgent ( ) ) . flatMap ( new Func1 < Response < ResponseBody > , Observable < ServiceResponse < PersonalAssistantsResponse > > > ( ) { @ Override public Observable < ServiceResponse < PersonalAssistantsResponse > > call ( Response < ResponseBody > response ) { try { ServiceResponse < PersonalAssistantsResponse > clientResponse = listCortanaEndpointsDelegate ( response ) ; return Observable . just ( clientResponse ) ; } catch ( Throwable t ) { return Observable . error ( t ) ; } } } ) ;
|
public class Cache { /** * Add objects .
* @ param obj the obj */
@ Override public void add ( ApiType obj ) { } }
|
String key = keyFunc . apply ( obj ) ; lock . lock ( ) ; try { ApiType oldObj = this . items . get ( key ) ; this . items . put ( key , obj ) ; this . updateIndices ( oldObj , obj , key ) ; } finally { lock . unlock ( ) ; }
|
public class EmailUtils { /** * Send a job cancellation notification email .
* @ param jobId job name
* @ param message email message
* @ param jobState a { @ link State } object carrying job configuration properties
* @ throws EmailException if there is anything wrong sending the email */
public static void sendJobCancellationEmail ( String jobId , String message , State jobState ) throws EmailException { } }
|
sendEmail ( jobState , String . format ( "Gobblin notification: job %s has been cancelled" , jobId ) , message ) ;
|
public class SpringInstanceProvider { /** * 返回指定类型的实例 。
* @ param beanClass 实例的类型
* @ return 指定类型的实例 。 */
@ SuppressWarnings ( "unchecked" ) public < T > T getInstance ( Class < T > beanClass ) { } }
|
String [ ] beanNames = applicationContext . getBeanNamesForType ( beanClass ) ; if ( beanNames . length == 0 ) { return null ; } return ( T ) applicationContext . getBean ( beanNames [ 0 ] ) ;
|
public class Shape { /** * Convert a linear index to
* the equivalent nd index based on the shape of the specified ndarray .
* Infers the number of indices from the specified shape .
* @ param arr the array to compute the indexes
* based on
* @ param index the index to map
* @ return the mapped indexes along each dimension */
public static long [ ] ind2subC ( INDArray arr , long index ) { } }
|
if ( arr . rank ( ) == 1 ) return new long [ ] { index } ; return ind2subC ( arr . shape ( ) , index , ArrayUtil . prodLong ( arr . shape ( ) ) ) ;
|
public class ServerCache { /** * Since the cache instances are stored with key as cacheName , it has to change default cache JNDI name to internal
* cache name . */
@ Trivial public static String normalizeCacheName ( String cacheName , CacheConfig cacheConfig ) { } }
|
String tempCacheName = cacheName ; if ( cacheName . equalsIgnoreCase ( DCacheBase . DEFAULT_BASE_JNDI_NAME ) ) { tempCacheName = DCacheBase . DEFAULT_CACHE_NAME ; } else if ( cacheName . equalsIgnoreCase ( DCacheBase . DEFAULT_DMAP_JNDI_NAME ) ) { tempCacheName = DCacheBase . DEFAULT_DISTRIBUTED_MAP_NAME ; } // Make sure the input cacheName matched with cacheConfig ' s cacheName .
// If not match , set to the input cacheName for cacheConfig
if ( null != cacheConfig && ! tempCacheName . equals ( cacheConfig . cacheName ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "normalized cacheName=" + cacheName + " does not match with cacheConfig cacheName=" + cacheConfig . cacheName ) ; } cacheConfig . cacheName = tempCacheName ; } return tempCacheName ;
|
public class JobSchedulesImpl { /** * Gets information about the specified job schedule .
* @ param jobScheduleId The ID of the job schedule to get .
* @ param serviceCallback the async ServiceCallback to handle successful and failed responses .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the { @ link ServiceFuture } object */
public ServiceFuture < CloudJobSchedule > getAsync ( String jobScheduleId , final ServiceCallback < CloudJobSchedule > serviceCallback ) { } }
|
return ServiceFuture . fromHeaderResponse ( getWithServiceResponseAsync ( jobScheduleId ) , serviceCallback ) ;
|
public class ForeignDestination { /** * / * ( non - Javadoc )
* @ see com . ibm . ws . sib . processor . runtime . SIMPMessageHandlerControllable # isLocal ( ) */
public boolean isLocal ( ) { } }
|
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "isLocal" ) ; boolean isLocal = false ; if ( foreignDest . getResolvedDestinationHandler ( ) . getLocalLocalizationPoint ( ) != null ) isLocal = true ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "isLocal" , new Boolean ( isLocal ) ) ; return isLocal ;
|
public class ElemNumber { /** * Given a ' from ' pattern ( ala xsl : number ) , a match pattern
* and a context , find the first ancestor that matches the
* pattern ( including the context handed in ) .
* @ param xctxt The XPath runtime state for this .
* @ param fromMatchPattern The ancestor must match this pattern .
* @ param countMatchPattern The ancestor must also match this pattern .
* @ param context The node that " . " expresses .
* @ param namespaceContext The context in which namespaces in the
* queries are supposed to be expanded .
* @ return the first ancestor that matches the given pattern
* @ throws javax . xml . transform . TransformerException */
int findAncestor ( XPathContext xctxt , XPath fromMatchPattern , XPath countMatchPattern , int context , ElemNumber namespaceContext ) throws javax . xml . transform . TransformerException { } }
|
DTM dtm = xctxt . getDTM ( context ) ; while ( DTM . NULL != context ) { if ( null != fromMatchPattern ) { if ( fromMatchPattern . getMatchScore ( xctxt , context ) != XPath . MATCH_SCORE_NONE ) { // context = null ;
break ; } } if ( null != countMatchPattern ) { if ( countMatchPattern . getMatchScore ( xctxt , context ) != XPath . MATCH_SCORE_NONE ) { break ; } } context = dtm . getParent ( context ) ; } return context ;
|
public class ExtensionList { /** * Used to bind extension to URLs by their class names .
* @ since 1.349 */
public T getDynamic ( String className ) { } }
|
for ( T t : this ) if ( t . getClass ( ) . getName ( ) . equals ( className ) ) return t ; return null ;
|
public class ListEntitiesDetectionJobsResult { /** * A list containing the properties of each job that is returned .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setEntitiesDetectionJobPropertiesList ( java . util . Collection ) } or
* { @ link # withEntitiesDetectionJobPropertiesList ( java . util . Collection ) } if you want to override the existing
* values .
* @ param entitiesDetectionJobPropertiesList
* A list containing the properties of each job that is returned .
* @ return Returns a reference to this object so that method calls can be chained together . */
public ListEntitiesDetectionJobsResult withEntitiesDetectionJobPropertiesList ( EntitiesDetectionJobProperties ... entitiesDetectionJobPropertiesList ) { } }
|
if ( this . entitiesDetectionJobPropertiesList == null ) { setEntitiesDetectionJobPropertiesList ( new java . util . ArrayList < EntitiesDetectionJobProperties > ( entitiesDetectionJobPropertiesList . length ) ) ; } for ( EntitiesDetectionJobProperties ele : entitiesDetectionJobPropertiesList ) { this . entitiesDetectionJobPropertiesList . add ( ele ) ; } return this ;
|
public class Vectors { /** * Creates a mul function that multiplies given { @ code value } by it ' s argument .
* @ param arg a value to be multiplied by function ' s argument
* @ return a closure that does { @ code _ * _ } */
public static VectorFunction asMulFunction ( final double arg ) { } }
|
return new VectorFunction ( ) { @ Override public double evaluate ( int i , double value ) { return value * arg ; } } ;
|
public class MapQuestTileSource { /** * Reads the mapbox map id from the manifest . < br >
* It will use the default value of mapquest if not defined */
public final void retrieveMapBoxMapId ( final Context aContext ) { } }
|
// Retrieve the MapId from the Manifest
String temp = ManifestUtil . retrieveKey ( aContext , MAPBOX_MAPID ) ; if ( temp != null && temp . length ( ) > 0 ) mapBoxMapId = temp ;
|
public class TypeParameterBuilderImpl { /** * Add upper type bounds .
* @ param type the type . */
public void addUpperConstraint ( String type ) { } }
|
final JvmUpperBound constraint = this . jvmTypesFactory . createJvmUpperBound ( ) ; constraint . setTypeReference ( newTypeRef ( this . context , type ) ) ; getJvmTypeParameter ( ) . getConstraints ( ) . add ( constraint ) ;
|
public class DefaultDatabus { /** * Produces a list - of - lists for all unique tag sets for a given databus event . < code > existingTags < / code > must either
* be null or the result of a previous call to { @ link # sortedTagUnion ( java . util . List , java . util . List ) } or
* { @ link # sortedTagUnion ( java . util . List , java . util . Set ) } . */
private static List < List < String > > sortedTagUnion ( @ Nullable List < List < String > > existingTags , Set < String > newTagSet ) { } }
|
return sortedTagUnion ( existingTags , asSortedList ( newTagSet ) ) ;
|
public class KenBurnsView { /** * Creates a new transition and starts over . */
public void restart ( ) { } }
|
int width = getWidth ( ) ; int height = getHeight ( ) ; if ( width == 0 || height == 0 ) { return ; // Can ' t call restart ( ) when view area is zero .
} updateViewport ( width , height ) ; updateDrawableBounds ( ) ; startNewTransition ( ) ;
|
public class SeekableOutputStream { /** * / Outputstream overrides */
@ Override public final void write ( byte pBytes [ ] ) throws IOException { } }
|
write ( pBytes , 0 , pBytes != null ? pBytes . length : 1 ) ;
|
public class SendTemplatedEmailRequest { /** * A list of tags , in the form of name / value pairs , to apply to an email that you send using
* < code > SendTemplatedEmail < / code > . Tags correspond to characteristics of the email that you define , so that you can
* publish email sending events .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setTags ( java . util . Collection ) } or { @ link # withTags ( java . util . Collection ) } if you want to override the
* existing values .
* @ param tags
* A list of tags , in the form of name / value pairs , to apply to an email that you send using
* < code > SendTemplatedEmail < / code > . Tags correspond to characteristics of the email that you define , so that
* you can publish email sending events .
* @ return Returns a reference to this object so that method calls can be chained together . */
public SendTemplatedEmailRequest withTags ( MessageTag ... tags ) { } }
|
if ( this . tags == null ) { setTags ( new com . amazonaws . internal . SdkInternalList < MessageTag > ( tags . length ) ) ; } for ( MessageTag ele : tags ) { this . tags . add ( ele ) ; } return this ;
|
public class AbstractLoggingExceptionHandler { /** * Log an exception */
public void logException ( Thread thread , Throwable throwable ) { } }
|
String logMessage ; String errorCode = extractErrorCode ( throwable ) ; if ( errorCode != null ) { logMessage = "Uncaught throwable handled with errorCode (" + errorCode + ")." ; } else { logMessage = "Uncaught throwable handled." ; } doLogException ( logMessage , throwable ) ;
|
public class ConsistentHashPartitionFilter { /** * Returns a list of pseudo - random 32 - bit values derived from the specified end point ID . */
private List < Integer > computeHashCodes ( String endPointId ) { } }
|
// Use the libketama approach of using MD5 hashes to generate 32 - bit random values . This assigns a set of
// randomly generated ranges to each end point . The individual ranges may vary widely in size , but , with
// sufficient # of entries per end point , the overall amount of data assigned to each server tends to even out
// with minimal variation ( 256 entries per server yields roughly 5 % variation in server load ) .
List < Integer > list = Lists . newArrayListWithCapacity ( _entriesPerEndPoint ) ; for ( int i = 0 ; list . size ( ) < _entriesPerEndPoint ; i ++ ) { Hasher hasher = Hashing . md5 ( ) . newHasher ( ) ; hasher . putInt ( i ) ; putUnencodedChars ( hasher , endPointId ) ; ByteBuffer buf = ByteBuffer . wrap ( hasher . hash ( ) . asBytes ( ) ) ; while ( buf . hasRemaining ( ) && list . size ( ) < _entriesPerEndPoint ) { list . add ( buf . getInt ( ) ) ; } } return list ;
|
public class HttpRequestHelper { /** * Returns the target host as defined in the Host header or extracted from the request URI .
* Usefull to generate Host header in a HttpRequest
* @ param request
* @ return the host formatted as host : port */
public static HttpHost getHost ( HttpRequest request ) { } }
|
HttpHost httpHost = UriUtils . extractHost ( request . getRequestLine ( ) . getUri ( ) ) ; String scheme = httpHost . getSchemeName ( ) ; String host = httpHost . getHostName ( ) ; int port = httpHost . getPort ( ) ; Header [ ] headers = request . getHeaders ( HttpHeaders . HOST ) ; if ( headers != null && headers . length != 0 ) { String headerValue = headers [ 0 ] . getValue ( ) ; String [ ] splitted = headerValue . split ( ":" ) ; host = splitted [ 0 ] ; if ( splitted . length > 1 ) { port = Integer . parseInt ( splitted [ 1 ] ) ; } else { port = - 1 ; } } return new HttpHost ( host , port , scheme ) ;
|
public class FileUtilities { /** * Read a file into a byte array .
* @ param filePath the path to the file .
* @ return the array of bytes .
* @ throws IOException */
public static byte [ ] readFileToBytes ( String filePath ) throws IOException { } }
|
Path path = Paths . get ( filePath ) ; byte [ ] bytes = Files . readAllBytes ( path ) ; return bytes ;
|
public class UserTypeMarshaller { /** * Marshall the given parameter object . */
public void marshall ( UserType userType , ProtocolMarshaller protocolMarshaller ) { } }
|
if ( userType == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( userType . getUsername ( ) , USERNAME_BINDING ) ; protocolMarshaller . marshall ( userType . getAttributes ( ) , ATTRIBUTES_BINDING ) ; protocolMarshaller . marshall ( userType . getUserCreateDate ( ) , USERCREATEDATE_BINDING ) ; protocolMarshaller . marshall ( userType . getUserLastModifiedDate ( ) , USERLASTMODIFIEDDATE_BINDING ) ; protocolMarshaller . marshall ( userType . getEnabled ( ) , ENABLED_BINDING ) ; protocolMarshaller . marshall ( userType . getUserStatus ( ) , USERSTATUS_BINDING ) ; protocolMarshaller . marshall ( userType . getMFAOptions ( ) , MFAOPTIONS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
|
public class WsAddressingHeaders { /** * Sets the to uri by string .
* @ param to the to to set */
public void setTo ( String to ) { } }
|
try { this . to = new URI ( to ) ; } catch ( URISyntaxException e ) { throw new CitrusRuntimeException ( "Invalid to uri" , e ) ; }
|
public class ElementUtils { /** * Determine if the element contains any undefined ( transient ) elements . The call will return null if no undefined
* elements are found ; it will return a string indicating the relative path if an undefined element is found .
* @ param e Element to search for undefined Elements
* @ return String representation of the path of the undefined element , null otherwise */
public static String locateUndefinedElement ( Element e ) { } }
|
if ( e instanceof Resource ) { // recursively check all of the resources children
Resource r = ( Resource ) e ; for ( Resource . Entry entry : r ) { String rpath = locateUndefinedElement ( entry . getValue ( ) ) ; String term = entry . getKey ( ) . toString ( ) ; if ( rpath != null ) { return ( ! "" . equals ( rpath ) ) ? term + "/" + rpath : term ; } } return null ; } else if ( e instanceof TransientElement ) { // return empty string as relative path and indicating transient element was found
return "" ; } else { // property that isn ' t a transient element
return null ; }
|
public class Logging { /** * Log a message at the ' STATISTICS ' level .
* You should check isTime ( ) before building the message .
* @ param message Informational log message .
* @ param e Exception */
public void statistics ( CharSequence message , Throwable e ) { } }
|
log ( Level . STATISTICS , message , e ) ;
|
public class XDBHandler { /** * Receive notification of the end of an element . */
@ Override public void endElement ( String uri , String l , String q ) { } }
|
/* * 1 . If current element is a String , update its value from the string buffer .
* 2 . Add the element to parent . */
XDB . Element element = Enum . valueOf ( XDB . Element . class , l . toUpperCase ( ) ) ; switch ( element ) { case M : break ; case P : _binder . put ( _name , _text . toString ( ) ) ; break ; case T : break ; case H : _heading = _data . toArray ( new String [ _data . size ( ) ] ) ; break ; case R : ++ _rindex ; break ; case C : if ( _heading == null ) { _data . add ( _text . toString ( ) ) ; } else { _binder . put ( _name + '[' + _rindex + "]." + _heading [ _cindex ] , _text . toString ( ) ) ; ++ _cindex ; } break ; } _text . setLength ( 0 ) ;
|
public class Matrix { /** * Set a row of this matrix from a row vector .
* @ param rv the row vector
* @ param r the row index
* @ throws numbercruncher . MatrixException for an invalid index or
* an invalid vector size */
public void setRow ( RowVector rv , int r ) throws MatrixException { } }
|
if ( ( r < 0 ) || ( r >= nRows ) ) { throw new MatrixException ( MatrixException . INVALID_INDEX ) ; } if ( nCols != rv . nCols ) { throw new MatrixException ( MatrixException . INVALID_DIMENSIONS ) ; } for ( int c = 0 ; c < nCols ; ++ c ) { this . values [ r ] [ c ] = rv . values [ 0 ] [ c ] ; }
|
public class WebService { /** * method to convert the input HELM into a standard HELM
* @ param notation
* HELM input
* @ return standard HELM
* @ throws HELM1FormatException
* if the HELM input contains HELM2 features
* @ throws ValidationException
* if the HELM input is not valid
* @ throws MonomerLoadingException
* if the MonomerFactory can not be loaded
* @ throws CTKException
* general ChemToolKit exception passed to HELMToolKit
* @ throws ChemistryException
* if the Chemistry Engine can not be initialized */
public String convertIntoStandardHELM ( String notation ) throws HELM1FormatException , ValidationException , MonomerLoadingException , CTKException , ChemistryException { } }
|
String result = HELM1Utils . getStandard ( validate ( notation ) ) ; setMonomerFactoryToDefault ( notation ) ; return result ;
|
public class HealthCheck { /** * Register a health check task .
* @ param task The task function . */
public void register ( Task task ) { } }
|
Optional . ofNullable ( task ) . filter ( t -> t . getTask ( ) != null ) . filter ( t -> StringUtils . hasText ( t . getName ( ) ) ) . ifPresent ( t -> checkTaskMap . put ( t . getName ( ) , t ) ) ;
|
public class Library { /** * Setup native library . This is the first method that must be called !
* @ param libraryName the name of the library to load
* @ param engine Support for external a Crypto Device ( " engine " ) , usually
* @ return { @ code true } if initialization was successful
* @ throws Exception if an error happens during initialization */
public static boolean initialize ( String libraryName , String engine ) throws Exception { } }
|
if ( _instance == null ) { _instance = libraryName == null ? new Library ( ) : new Library ( libraryName ) ; if ( aprMajorVersion ( ) < 1 ) { throw new UnsatisfiedLinkError ( "Unsupported APR Version (" + aprVersionString ( ) + ")" ) ; } if ( ! aprHasThreads ( ) ) { throw new UnsatisfiedLinkError ( "Missing APR_HAS_THREADS" ) ; } } return initialize0 ( ) && SSL . initialize ( engine ) == 0 ;
|
public class JPAEntityManager { /** * New JPA 2.0 API methods / / F743-954 , F743-954.1 d597764 */
@ Override public void detach ( Object entity ) { } }
|
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "em.detach(" + entity + ");\n" + toString ( ) ) ; getEMInvocationInfo ( false ) . detach ( entity ) ;
|
public class BigtableTableAdminClient { /** * Constructs an instance of BigtableTableAdminClient with the given settings . */
public static BigtableTableAdminClient create ( @ Nonnull BigtableTableAdminSettings settings ) throws IOException { } }
|
EnhancedBigtableTableAdminStub stub = EnhancedBigtableTableAdminStub . createEnhanced ( settings . getStubSettings ( ) ) ; return create ( settings . getProjectId ( ) , settings . getInstanceId ( ) , stub ) ;
|
public class EpsilonInsensitiveLoss { /** * Computes the first derivative of the & epsilon ; - insensitive loss
* @ param pred the predicted value
* @ param y the true value
* @ param eps the epsilon tolerance
* @ return the first derivative of the & epsilon ; - insensitive loss */
public static double deriv ( double pred , double y , double eps ) { } }
|
final double x = pred - y ; if ( eps < Math . abs ( x ) ) return Math . signum ( x ) ; else return 0 ;
|
public class SpringBootUtil { /** * Get the Spring Boot Uber JAR in its expected location , validating the JAR
* contents and handling spring - boot - maven - plugin classifier configuration as
* well . If the JAR was not found in its expected location , then return null .
* @ param outputDirectory
* @ param project
* @ param log
* @ return the JAR File if it was found , false otherwise */
public static File getSpringBootUberJAR ( MavenProject project , Log log ) { } }
|
File fatArchive = getSpringBootUberJARLocation ( project , log ) ; if ( net . wasdev . wlp . common . plugins . util . SpringBootUtil . isSpringBootUberJar ( fatArchive ) ) { log . info ( "Found Spring Boot Uber JAR: " + fatArchive . getAbsolutePath ( ) ) ; return fatArchive ; } log . warn ( "Spring Boot Uber JAR was not found in expected location: " + fatArchive . getAbsolutePath ( ) ) ; return null ;
|
public class BaseSetupSiteProcess { /** * PopulateSourceDir Method . */
public boolean populateSourceDir ( String templateDir , String srcDir ) { } }
|
URL fromDirUrl = this . getTask ( ) . getApplication ( ) . getResourceURL ( templateDir , null ) ; if ( "http" . equalsIgnoreCase ( fromDirUrl . getProtocol ( ) ) ) { String packageName = templateDir + "/main_tourgeek_user/org/jbundle/main/user/db" ; packageName = packageName . replace ( '/' , '.' ) ; Bundle bundle = ( Bundle ) ClassServiceUtility . getClassService ( ) . getClassFinder ( null ) . findBundle ( null , null , packageName , null ) ; if ( bundle == null ) { Object resource = ClassServiceUtility . getClassService ( ) . getClassFinder ( null ) . deployThisResource ( packageName , null , true ) ; if ( resource != null ) bundle = ( Bundle ) ClassServiceUtility . getClassService ( ) . getClassFinder ( null ) . findBundle ( resource , null , packageName , null ) ; } if ( bundle == null ) return false ; // Couldn ' t file files
OsgiWebStartServlet . transferBundleFiles ( bundle , templateDir , srcDir ) ; } else if ( ! "file" . equalsIgnoreCase ( fromDirUrl . getProtocol ( ) ) ) return false ; String fromDir = fromDirUrl . getFile ( ) ; File fromDirFile = new File ( fromDir ) ; File srcDirFile = new File ( srcDir ) ; Map < String , Object > properties = new HashMap < String , Object > ( ) ; properties . put ( "extension" , "xml" ) ; properties . put ( "filter" , ".*" ) ; // Hack ( filter is a bad name since it it used in many places )
if ( srcDirFile . exists ( ) ) { long srcModified = srcDirFile . lastModified ( ) ; long fromModified = fromDirFile . lastModified ( ) ; if ( srcModified > fromModified ) return true ; // It ' s already set up and current !
// Delete the directory so I can replace it with new data
properties . put ( "sourceDir" , srcDir ) ; properties . put ( "destDir" , srcDir ) ; properties . put ( "listenerClass" , DeleteScanListener . class . getName ( ) ) ; properties . put ( "deleteDir" , DBConstants . TRUE ) ; BaseProcess process = new ConvertCode ( this . getTask ( ) , null , properties ) ; process . run ( ) ; process . free ( ) ; } properties . put ( "sourceDir" , fromDir ) ; properties . put ( "destDir" , srcDir ) ; properties . put ( "listenerClass" , BaseScanListener . class . getName ( ) ) ; BaseProcess process = new ConvertCode ( this . getTask ( ) , null , properties ) ; process . run ( ) ; process . free ( ) ; return true ;
|
public class BlueCasUtil { /** * If this cas has no Sentence annotation , creates one with the whole cas
* text */
public static void fixNoSentences ( JCas jCas ) { } }
|
Collection < Sentence > sentences = select ( jCas , Sentence . class ) ; if ( sentences . size ( ) == 0 ) { String text = jCas . getDocumentText ( ) ; Sentence sentence = new Sentence ( jCas , 0 , text . length ( ) ) ; sentence . addToIndexes ( ) ; }
|
public class ConvolutionalTrieSerializer { /** * Gets upper bound .
* @ param currentParent the current parent
* @ param currentChildren the current children
* @ param godchildNode the godchild node
* @ param godchildAdjustment the godchild adjustment
* @ return the upper bound */
protected long getUpperBound ( TrieNode currentParent , AtomicLong currentChildren , TrieNode godchildNode , int godchildAdjustment ) { } }
|
return Math . min ( currentParent . getCursorCount ( ) - currentChildren . get ( ) , godchildNode . getCursorCount ( ) - godchildAdjustment ) ;
|
public class CharsetConversion { /** * Return converted charset name for java . */
public static String getJavaCharset ( final int id ) { } }
|
Entry entry = getEntry ( id ) ; if ( entry != null ) { if ( entry . javaCharset != null ) { return entry . javaCharset ; } else { logger . warn ( "Unknown java charset for: id = " + id + ", name = " + entry . mysqlCharset + ", coll = " + entry . mysqlCollation ) ; return null ; } } else { logger . warn ( "Unexpect mysql charset: " + id ) ; return null ; }
|
public class CmsDriverManager { /** * Creates a new user . < p >
* @ param dbc the current database context
* @ param name the name for the new user
* @ param password the password for the new user
* @ param description the description for the new user
* @ param additionalInfos the additional infos for the user
* @ return the created user
* @ see CmsObject # createUser ( String , String , String , Map )
* @ throws CmsException if something goes wrong
* @ throws CmsIllegalArgumentException if the name for the user is not valid */
public CmsUser createUser ( CmsDbContext dbc , String name , String password , String description , Map < String , Object > additionalInfos ) throws CmsException , CmsIllegalArgumentException { } }
|
// no space before or after the name
name = name . trim ( ) ; // check the user name
String userName = CmsOrganizationalUnit . getSimpleName ( name ) ; OpenCms . getValidationHandler ( ) . checkUserName ( userName ) ; if ( CmsStringUtil . isEmptyOrWhitespaceOnly ( userName ) ) { throw new CmsIllegalArgumentException ( Messages . get ( ) . container ( Messages . ERR_BAD_USER_1 , userName ) ) ; } // check the ou
CmsOrganizationalUnit ou = readOrganizationalUnit ( dbc , CmsOrganizationalUnit . getParentFqn ( name ) ) ; // check the password
validatePassword ( password ) ; Map < String , Object > info = new HashMap < String , Object > ( ) ; if ( additionalInfos != null ) { info . putAll ( additionalInfos ) ; } if ( description != null ) { info . put ( CmsUserSettings . ADDITIONAL_INFO_DESCRIPTION , description ) ; } int flags = 0 ; if ( ou . hasFlagWebuser ( ) ) { flags += I_CmsPrincipal . FLAG_USER_WEBUSER ; } CmsUser user = getUserDriver ( dbc ) . createUser ( dbc , new CmsUUID ( ) , name , OpenCms . getPasswordHandler ( ) . digest ( password ) , " " , " " , " " , 0 , I_CmsPrincipal . FLAG_ENABLED + flags , 0 , info ) ; if ( ! dbc . getProjectId ( ) . isNullUUID ( ) ) { // user modified event is not needed
return user ; } // fire user modified event
Map < String , Object > eventData = new HashMap < String , Object > ( ) ; eventData . put ( I_CmsEventListener . KEY_USER_ID , user . getId ( ) . toString ( ) ) ; eventData . put ( I_CmsEventListener . KEY_USER_ACTION , I_CmsEventListener . VALUE_USER_MODIFIED_ACTION_CREATE_USER ) ; OpenCms . fireCmsEvent ( new CmsEvent ( I_CmsEventListener . EVENT_USER_MODIFIED , eventData ) ) ; return user ;
|
public class JSONTokener { /** * Get the next value . The value can be a Boolean , Double , Integer ,
* JSONArray , JSONObject , Long , or String , or the JSONObject . NULL object .
* @ throws JSONException If syntax error .
* @ return An object . */
public Object nextValue ( ) throws JSONException { } }
|
char c = this . nextClean ( ) ; String string ; switch ( c ) { case '"' : case '\'' : return this . nextString ( c ) ; case '{' : this . back ( ) ; return new JSONObject ( this ) ; case '[' : this . back ( ) ; return new JSONArray ( this ) ; } /* * Handle unquoted text . This could be the values true , false , or
* null , or it can be a number . An implementation ( such as this one )
* is allowed to also accept non - standard forms .
* Accumulate characters until we reach the end of the text or a
* formatting character . */
StringBuilder sb = new StringBuilder ( ) ; while ( c > ' ' && ",:]}/\\\"[{;=#" . indexOf ( c ) < 0 ) { sb . append ( c ) ; c = this . next ( ) ; } if ( false == this . eof ) { this . back ( ) ; } string = sb . toString ( ) . trim ( ) ; if ( "" . equals ( string ) ) { throw this . syntaxError ( "Missing value" ) ; } return JSONObject . stringToValue ( string ) ;
|
public class MutableDictionary { /** * Set a Blob object for the given key .
* @ param key The key
* @ param value The Blob object .
* @ return The self object . */
@ NonNull @ Override public MutableDictionary setBlob ( @ NonNull String key , Blob value ) { } }
|
return setValue ( key , value ) ;
|
public class AWSMigrationHubClient { /** * Registers a new migration task which represents a server , database , etc . , being migrated to AWS by a migration
* tool .
* This API is a prerequisite to calling the < code > NotifyMigrationTaskState < / code > API as the migration tool must
* first register the migration task with Migration Hub .
* @ param importMigrationTaskRequest
* @ return Result of the ImportMigrationTask operation returned by the service .
* @ throws AccessDeniedException
* You do not have sufficient access to perform this action .
* @ throws InternalServerErrorException
* Exception raised when there is an internal , configuration , or dependency error encountered .
* @ throws ServiceUnavailableException
* Exception raised when there is an internal , configuration , or dependency error encountered .
* @ throws DryRunOperationException
* Exception raised to indicate a successfully authorized action when the < code > DryRun < / code > flag is set to
* " true " .
* @ throws UnauthorizedOperationException
* Exception raised to indicate a request was not authorized when the < code > DryRun < / code > flag is set to
* " true " .
* @ throws InvalidInputException
* Exception raised when the provided input violates a policy constraint or is entered in the wrong format
* or data type .
* @ throws ResourceNotFoundException
* Exception raised when the request references a resource ( ADS configuration , update stream , migration
* task , etc . ) that does not exist in ADS ( Application Discovery Service ) or in Migration Hub ' s repository .
* @ sample AWSMigrationHub . ImportMigrationTask
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / AWSMigrationHub - 2017-05-31 / ImportMigrationTask "
* target = " _ top " > AWS API Documentation < / a > */
@ Override public ImportMigrationTaskResult importMigrationTask ( ImportMigrationTaskRequest request ) { } }
|
request = beforeClientExecution ( request ) ; return executeImportMigrationTask ( request ) ;
|
public class BaseController { /** * 构造系统业务错误
* @ param message
* 错误消息
* @ return JsonObject */
@ SuppressWarnings ( "unchecked" ) protected JsonObject bizError ( String message ) { } }
|
JsonObject json = JsonObject . create ( ) ; json . setMsg ( Arrays . asList ( message ) ) ; json . addData ( WebResponseConstant . MESSAGE_MSG , message ) ; json . setStatus ( GlobalResponseStatusMsg . BIZ_ERROR . getMessage ( ) . getCode ( ) ) ; return json ;
|
public class CPDisplayLayoutLocalServiceWrapper { /** * Returns the cp display layout with the primary key .
* @ param CPDisplayLayoutId the primary key of the cp display layout
* @ return the cp display layout
* @ throws PortalException if a cp display layout with the primary key could not be found */
@ Override public com . liferay . commerce . product . model . CPDisplayLayout getCPDisplayLayout ( long CPDisplayLayoutId ) throws com . liferay . portal . kernel . exception . PortalException { } }
|
return _cpDisplayLayoutLocalService . getCPDisplayLayout ( CPDisplayLayoutId ) ;
|
public class MaterialConfigs { /** * To two methods below are to avoid creating methods on already long Material interface with a No Op implementations . */
private List < ScmMaterialConfig > filterScmMaterials ( ) { } }
|
List < ScmMaterialConfig > scmMaterials = new ArrayList < > ( ) ; for ( MaterialConfig material : this ) { if ( material instanceof ScmMaterialConfig ) { scmMaterials . add ( ( ScmMaterialConfig ) material ) ; } } return scmMaterials ;
|
public class PageLeafEntry { /** * Copies the row and its inline blobs to the target buffer .
* @ return - 1 if the row or the blobs can ' t fit in the new buffer . */
public int copyTo ( byte [ ] buffer , int rowOffset , int blobTail ) { } }
|
byte [ ] blockBuffer = _block . getBuffer ( ) ; System . arraycopy ( blockBuffer , _rowOffset , buffer , rowOffset , _length ) ; return _row . copyBlobs ( blockBuffer , _rowOffset , buffer , rowOffset , blobTail ) ;
|
public class StandardIdGenerator { /** * Create a new random number generator instance we should use for generating session identifiers . */
private SecureRandom createSecureRandom ( ) { } }
|
SecureRandom result ; try { result = SecureRandom . getInstance ( "SHA1PRNG" ) ; } catch ( NoSuchAlgorithmException e ) { result = new SecureRandom ( ) ; } // Force seeding to take place .
result . nextInt ( ) ; return result ;
|
public class LineageResource { /** * Returns the schema for the given dataset id .
* @ param guid dataset entity id */
@ GET @ Path ( "{guid}/schema" ) @ Consumes ( Servlets . JSON_MEDIA_TYPE ) @ Produces ( Servlets . JSON_MEDIA_TYPE ) public Response schema ( @ PathParam ( "guid" ) String guid ) { } }
|
if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( "==> LineageResource.schema({})" , guid ) ; } AtlasPerfTracer perf = null ; try { if ( AtlasPerfTracer . isPerfTraceEnabled ( PERF_LOG ) ) { perf = AtlasPerfTracer . getPerfTracer ( PERF_LOG , "LineageResource.schema(" + guid + ")" ) ; } final String jsonResult = lineageService . getSchemaForEntity ( guid ) ; JSONObject response = new JSONObject ( ) ; response . put ( AtlasClient . REQUEST_ID , Servlets . getRequestId ( ) ) ; response . put ( AtlasClient . RESULTS , new JSONObject ( jsonResult ) ) ; return Response . ok ( response ) . build ( ) ; } catch ( SchemaNotFoundException e ) { LOG . error ( "schema not found for {}" , guid ) ; throw new WebApplicationException ( Servlets . getErrorResponse ( e , Response . Status . NOT_FOUND ) ) ; } catch ( EntityNotFoundException e ) { LOG . error ( "table entity not found for {}" , guid ) ; throw new WebApplicationException ( Servlets . getErrorResponse ( e , Response . Status . NOT_FOUND ) ) ; } catch ( DiscoveryException | IllegalArgumentException e ) { LOG . error ( "Unable to get schema for entity guid={}" , guid , e ) ; throw new WebApplicationException ( Servlets . getErrorResponse ( e , Response . Status . BAD_REQUEST ) ) ; } catch ( WebApplicationException e ) { LOG . error ( "Unable to get schema for entity guid={}" , guid , e ) ; throw e ; } catch ( Throwable e ) { LOG . error ( "Unable to get schema for entity={}" , guid , e ) ; throw new WebApplicationException ( Servlets . getErrorResponse ( e , Response . Status . INTERNAL_SERVER_ERROR ) ) ; } finally { AtlasPerfTracer . log ( perf ) ; if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( "<== LineageResource.schema({})" , guid ) ; } }
|
public class DualInputSemanticProperties { /** * Adds , to the existing information , a field that is forwarded directly
* from the source record ( s ) in the first input to the destination
* record ( s ) .
* @ param sourceField the position in the source record ( s ) from the first input
* @ param destinationField the position in the destination record ( s ) */
public void addForwardedField1 ( int sourceField , int destinationField ) { } }
|
FieldSet fs ; if ( ( fs = this . forwardedFields1 . get ( sourceField ) ) != null ) { fs . add ( destinationField ) ; } else { fs = new FieldSet ( destinationField ) ; this . forwardedFields1 . put ( sourceField , fs ) ; }
|
public class CaffeineSpec { /** * Configures the value as weak or soft references . */
void recordStats ( @ Nullable String value ) { } }
|
requireArgument ( value == null , "record stats does not take a value" ) ; requireArgument ( ! recordStats , "record stats was already set" ) ; recordStats = true ;
|
public class ReadInputRegistersResponse { /** * Returns a reference to the array of input registers read .
* @ return a < tt > InputRegister [ ] < / tt > instance . */
public synchronized InputRegister [ ] getRegisters ( ) { } }
|
InputRegister [ ] dest = new InputRegister [ registers . length ] ; System . arraycopy ( registers , 0 , dest , 0 , dest . length ) ; return dest ;
|
public class EventProcessorHost { /** * Synchronized string UUID generation convenience method .
* We saw null and empty strings returned from UUID . randomUUID ( ) . toString ( ) when used from multiple
* threads and there is no clear answer on the net about whether it is really thread - safe or not .
* One of the major users of UUIDs is the built - in lease and checkpoint manager , which can be replaced by
* user implementations . This UUID generation method is public so user implementations can use it as well and
* avoid the problems .
* @ return A string UUID with dashes but no curly brackets . */
public static String safeCreateUUID ( ) { } }
|
synchronized ( EventProcessorHost . UUID_SYNCHRONIZER ) { final UUID newUuid = UUID . randomUUID ( ) ; return newUuid . toString ( ) ; }
|
public class DefaultHistoryManager { /** * ( non - Javadoc )
* @ see org . activiti . engine . impl . history . HistoryManagerInterface # isHistoryLevelAtLeast ( org . activiti . engine . impl . history . HistoryLevel ) */
@ Override public boolean isHistoryLevelAtLeast ( HistoryLevel level ) { } }
|
if ( log . isDebugEnabled ( ) ) { log . debug ( "Current history level: {}, level required: {}" , historyLevel , level ) ; } // Comparing enums actually compares the location of values declared in
// the enum
return historyLevel . isAtLeast ( level ) ;
|
public class Balance { /** * Returns the total amount of the < code > currency < / code > in this balance .
* @ return the total amount . */
public BigDecimal getTotal ( ) { } }
|
if ( total == null ) { return available . add ( frozen ) . subtract ( borrowed ) . add ( loaned ) . add ( withdrawing ) . add ( depositing ) ; } else { return total ; }
|
public class FactionWarfareApi { /** * An overview of statistics about factions involved in faction warfare
* Statistical overviews of factions involved in faction warfare - - - This
* route expires daily at 11:05
* @ param datasource
* The server name you would like data from ( optional , default to
* tranquility )
* @ param ifNoneMatch
* ETag from a previous request . A 304 will be returned if this
* matches the current ETag ( optional )
* @ return ApiResponse & lt ; List & lt ; FactionWarfareStatsResponse & gt ; & gt ;
* @ throws ApiException
* If fail to call the API , e . g . server error or cannot
* deserialize the response body */
public ApiResponse < List < FactionWarfareStatsResponse > > getFwStatsWithHttpInfo ( String datasource , String ifNoneMatch ) throws ApiException { } }
|
com . squareup . okhttp . Call call = getFwStatsValidateBeforeCall ( datasource , ifNoneMatch , null ) ; Type localVarReturnType = new TypeToken < List < FactionWarfareStatsResponse > > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnType ) ;
|
public class RemediationExecutionStatusMarshaller { /** * Marshall the given parameter object . */
public void marshall ( RemediationExecutionStatus remediationExecutionStatus , ProtocolMarshaller protocolMarshaller ) { } }
|
if ( remediationExecutionStatus == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( remediationExecutionStatus . getResourceKey ( ) , RESOURCEKEY_BINDING ) ; protocolMarshaller . marshall ( remediationExecutionStatus . getState ( ) , STATE_BINDING ) ; protocolMarshaller . marshall ( remediationExecutionStatus . getStepDetails ( ) , STEPDETAILS_BINDING ) ; protocolMarshaller . marshall ( remediationExecutionStatus . getInvocationTime ( ) , INVOCATIONTIME_BINDING ) ; protocolMarshaller . marshall ( remediationExecutionStatus . getLastUpdatedTime ( ) , LASTUPDATEDTIME_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
|
public class AsciiString { /** * Copies the characters in this string to a character array .
* @ return a character array containing the characters of this string . */
public char [ ] toCharArray ( int start , int end ) { } }
|
int length = end - start ; if ( length == 0 ) { return EmptyArrays . EMPTY_CHARS ; } if ( isOutOfBounds ( start , length , length ( ) ) ) { throw new IndexOutOfBoundsException ( "expected: " + "0 <= start(" + start + ") <= srcIdx + length(" + length + ") <= srcLen(" + length ( ) + ')' ) ; } final char [ ] buffer = new char [ length ] ; for ( int i = 0 , j = start + arrayOffset ( ) ; i < length ; i ++ , j ++ ) { buffer [ i ] = b2c ( value [ j ] ) ; } return buffer ;
|
public class JsonObject { /** * Returns the { @ link JsonArray } at the given key , or the default if it does not exist or is the
* wrong type . */
public Json . Array getArray ( String key , Json . Array default_ ) { } }
|
Object o = get ( key ) ; return ( o instanceof Json . Array ) ? ( Json . Array ) o : default_ ;
|
public class CommerceOrderPaymentPersistenceImpl { /** * Returns a range of all the commerce order payments where commerceOrderId = & # 63 ; .
* Useful when paginating results . Returns a maximum of < code > end - start < / code > instances . < code > start < / code > and < code > end < / code > are not primary keys , they are indexes in the result set . Thus , < code > 0 < / code > refers to the first result in the set . Setting both < code > start < / code > and < code > end < / code > to { @ link QueryUtil # ALL _ POS } will return the full result set . If < code > orderByComparator < / code > is specified , then the query will include the given ORDER BY logic . If < code > orderByComparator < / code > is absent and pagination is required ( < code > start < / code > and < code > end < / code > are not { @ link QueryUtil # ALL _ POS } ) , then the query will include the default ORDER BY logic from { @ link CommerceOrderPaymentModelImpl } . If both < code > orderByComparator < / code > and pagination are absent , for performance reasons , the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order .
* @ param commerceOrderId the commerce order ID
* @ param start the lower bound of the range of commerce order payments
* @ param end the upper bound of the range of commerce order payments ( not inclusive )
* @ return the range of matching commerce order payments */
@ Override public List < CommerceOrderPayment > findByCommerceOrderId ( long commerceOrderId , int start , int end ) { } }
|
return findByCommerceOrderId ( commerceOrderId , start , end , null ) ;
|
public class AWSGlueClient { /** * Updates a specified DevEndpoint .
* @ param updateDevEndpointRequest
* @ return Result of the UpdateDevEndpoint operation returned by the service .
* @ throws EntityNotFoundException
* A specified entity does not exist
* @ throws InternalServiceException
* An internal service error occurred .
* @ throws OperationTimeoutException
* The operation timed out .
* @ throws InvalidInputException
* The input provided was not valid .
* @ throws ValidationException
* A value could not be validated .
* @ sample AWSGlue . UpdateDevEndpoint
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / glue - 2017-03-31 / UpdateDevEndpoint " target = " _ top " > AWS API
* Documentation < / a > */
@ Override public UpdateDevEndpointResult updateDevEndpoint ( UpdateDevEndpointRequest request ) { } }
|
request = beforeClientExecution ( request ) ; return executeUpdateDevEndpoint ( request ) ;
|
public class DiameterStackMultiplexer { /** * ( non - Javadoc )
* @ see org . mobicents . diameter . stack . DiameterStackMultiplexerMBean # _ LocalPeer _ setVendorId ( java . lang . String ) */
@ Override public void _LocalPeer_setVendorId ( long vendorId ) throws MBeanException { } }
|
// validate vendor - id
try { getMutableConfiguration ( ) . setLongValue ( OwnVendorID . ordinal ( ) , vendorId ) ; if ( logger . isInfoEnabled ( ) ) { logger . info ( "Local Peer Vendor-Id successfully changed to '" + vendorId + "'. Restart to Diameter stack is needed to apply changes." ) ; } } catch ( NumberFormatException nfe ) { throw new MBeanException ( nfe ) ; }
|
public class CommerceCurrencyUtil { /** * Returns the commerce currency where uuid = & # 63 ; and groupId = & # 63 ; or throws a { @ link NoSuchCurrencyException } if it could not be found .
* @ param uuid the uuid
* @ param groupId the group ID
* @ return the matching commerce currency
* @ throws NoSuchCurrencyException if a matching commerce currency could not be found */
public static CommerceCurrency findByUUID_G ( String uuid , long groupId ) throws com . liferay . commerce . currency . exception . NoSuchCurrencyException { } }
|
return getPersistence ( ) . findByUUID_G ( uuid , groupId ) ;
|
public class ManageAddOnsDialog { /** * Notifies that the given { @ code addOn } was installed . The add - on is added to the table of installed add - ons , or if an
* update , set it as updated , and , if available in marketplace , removed from the table of available add - ons .
* @ param addOn the add - on that was installed
* @ since 2.4.0 */
public void notifyAddOnInstalled ( final AddOn addOn ) { } }
|
if ( EventQueue . isDispatchThread ( ) ) { if ( latestInfo != null && latestInfo . getAddOn ( addOn . getId ( ) ) != null ) { uninstalledAddOnsModel . removeAddOn ( addOn ) ; } installedAddOnsModel . addOrRefreshAddOn ( addOn ) ; } else { EventQueue . invokeLater ( new Runnable ( ) { @ Override public void run ( ) { notifyAddOnInstalled ( addOn ) ; } } ) ; }
|
public class SerializedFormBuilder { /** * Build the serialization overview for the given class .
* @ param typeElement the class to print the overview for .
* @ param classContentTree content tree to which the documentation will be added */
public void buildFieldSerializationOverview ( TypeElement typeElement , Content classContentTree ) { } }
|
if ( utils . definesSerializableFields ( typeElement ) ) { VariableElement ve = utils . serializableFields ( typeElement ) . first ( ) ; // Check to see if there are inline comments , tags or deprecation
// information to be printed .
if ( fieldWriter . shouldPrintOverview ( ve ) ) { Content serializableFieldsTree = fieldWriter . getSerializableFieldsHeader ( ) ; Content fieldsOverviewContentTree = fieldWriter . getFieldsContentHeader ( true ) ; fieldWriter . addMemberDeprecatedInfo ( ve , fieldsOverviewContentTree ) ; if ( ! configuration . nocomment ) { fieldWriter . addMemberDescription ( ve , fieldsOverviewContentTree ) ; fieldWriter . addMemberTags ( ve , fieldsOverviewContentTree ) ; } serializableFieldsTree . addContent ( fieldsOverviewContentTree ) ; classContentTree . addContent ( fieldWriter . getSerializableFields ( configuration . getText ( "doclet.Serialized_Form_class" ) , serializableFieldsTree ) ) ; } }
|
public class Interpreter { /** * Execute a While statement at a given point in the function or method
* body . This will loop over the body zero or more times .
* @ param stmt
* - - - Loop statement to executed
* @ param frame
* - - - The current stack frame
* @ return */
private Status executeWhile ( Stmt . While stmt , CallStack frame , EnclosingScope scope ) { } }
|
Status r ; do { RValue . Bool operand = executeExpression ( BOOL_T , stmt . getCondition ( ) , frame ) ; if ( operand == RValue . False ) { return Status . NEXT ; } // Keep executing the loop body until we exit it somehow .
r = executeBlock ( stmt . getBody ( ) , frame , scope ) ; } while ( r == Status . NEXT || r == Status . CONTINUE ) ; // If we get here , then we have exited the loop body without falling
// through to the next bytecode .
if ( r == Status . BREAK ) { return Status . NEXT ; } else { return r ; }
|
public class FeatureCoreStyleExtension { /** * Determine if an icon relationship exists for the feature table
* @ param featureTable
* feature table
* @ return true if relationship exists */
public boolean hasIconRelationship ( String featureTable ) { } }
|
return hasStyleRelationship ( getMappingTableName ( TABLE_MAPPING_ICON , featureTable ) , featureTable , IconTable . TABLE_NAME ) ;
|
public class AbstractRegistry { /** * 恢复
* @ throws Exception */
protected void recover ( ) throws Exception { } }
|
// register
Set < Node > recoverRegistered = new HashSet < Node > ( getRegistered ( ) ) ; if ( ! recoverRegistered . isEmpty ( ) ) { if ( LOGGER . isInfoEnabled ( ) ) { LOGGER . info ( "Recover register node " + recoverRegistered ) ; } for ( Node node : recoverRegistered ) { register ( node ) ; } } // subscribe
Map < Node , Set < NotifyListener > > recoverSubscribed = new HashMap < Node , Set < NotifyListener > > ( getSubscribed ( ) ) ; if ( ! recoverSubscribed . isEmpty ( ) ) { if ( LOGGER . isInfoEnabled ( ) ) { LOGGER . info ( "Recover subscribe node " + recoverSubscribed . keySet ( ) ) ; } for ( Map . Entry < Node , Set < NotifyListener > > entry : recoverSubscribed . entrySet ( ) ) { Node node = entry . getKey ( ) ; for ( NotifyListener listener : entry . getValue ( ) ) { subscribe ( node , listener ) ; } } }
|
public class AttributeValue { /** * An attribute of type Number Set . For example :
* < code > " NS " : [ " 42.2 " , " - 19 " , " 7.5 " , " 3.14 " ] < / code >
* Numbers are sent across the network to DynamoDB as strings , to maximize compatibility across languages and
* libraries . However , DynamoDB treats them as number type attributes for mathematical operations .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setNS ( java . util . Collection ) } or { @ link # withNS ( java . util . Collection ) } if you want to override the
* existing values .
* @ param nS
* An attribute of type Number Set . For example : < / p >
* < code > " NS " : [ " 42.2 " , " - 19 " , " 7.5 " , " 3.14 " ] < / code >
* Numbers are sent across the network to DynamoDB as strings , to maximize compatibility across languages and
* libraries . However , DynamoDB treats them as number type attributes for mathematical operations .
* @ return Returns a reference to this object so that method calls can be chained together . */
public AttributeValue withNS ( String ... nS ) { } }
|
if ( this . nS == null ) { setNS ( new java . util . ArrayList < String > ( nS . length ) ) ; } for ( String ele : nS ) { this . nS . add ( ele ) ; } return this ;
|
public class AccessControlEntryImpl { /** * Adds specified privileges to the given list .
* @ param list the result list of combined privileges .
* @ param privileges privileges to add .
* @ return true if at least one of privileges was added . */
protected boolean combineRecursively ( List < Privilege > list , Privilege [ ] privileges ) { } }
|
boolean res = false ; for ( Privilege p : privileges ) { if ( p . isAggregate ( ) ) { res = combineRecursively ( list , p . getAggregatePrivileges ( ) ) ; } else if ( ! contains ( list , p ) ) { list . add ( p ) ; res = true ; } } return res ;
|
public class Utils { /** * Returns all of the constructors in a { @ link TypeElement } that PaperParcel can use . */
static ImmutableList < ExecutableElement > orderedConstructorsIn ( TypeElement element , List < String > reflectAnnotations ) { } }
|
List < ExecutableElement > allConstructors = ElementFilter . constructorsIn ( element . getEnclosedElements ( ) ) ; List < ExecutableElement > visibleConstructors = new ArrayList < > ( allConstructors . size ( ) ) ; for ( ExecutableElement constructor : allConstructors ) { if ( Visibility . ofElement ( constructor ) != Visibility . PRIVATE ) { visibleConstructors . add ( constructor ) ; } } Collections . sort ( visibleConstructors , PARAMETER_COUNT_ORDER . reverse ( ) ) ; List < ExecutableElement > reflectConstructors = new ArrayList < > ( ) ; if ( reflectAnnotations . size ( ) > 0 ) { for ( ExecutableElement constructor : allConstructors ) { if ( Visibility . ofElement ( constructor ) == Visibility . PRIVATE && usesAnyAnnotationsFrom ( constructor , reflectAnnotations ) ) { reflectConstructors . add ( constructor ) ; } } Collections . sort ( reflectConstructors , PARAMETER_COUNT_ORDER . reverse ( ) ) ; } return ImmutableList . < ExecutableElement > builder ( ) . addAll ( visibleConstructors ) . addAll ( reflectConstructors ) . build ( ) ;
|
public class WizardDialogDecorator { /** * Adapts the enable state of the tab layout , which indicates the currently shown fragment . */
private void adaptTabLayoutEnableState ( ) { } }
|
if ( tabLayout != null ) { LinearLayout tabStrip = ( ( LinearLayout ) tabLayout . getChildAt ( 0 ) ) ; tabStrip . setEnabled ( tabLayoutEnabled ) ; for ( int i = 0 ; i < tabStrip . getChildCount ( ) ; i ++ ) { tabStrip . getChildAt ( i ) . setEnabled ( tabLayoutEnabled ) ; } }
|
public class DynamicObject { /** * - - - - internal API - - - - - */
public static Map < String , Object > getPropertyMap ( Object obj ) { } }
|
Assert . notNull ( obj , "Argument cannot be null" ) ; try { BeanInfo beanInfo = Introspector . getBeanInfo ( obj . getClass ( ) ) ; PropertyDescriptor [ ] propertyDescriptors = beanInfo . getPropertyDescriptors ( ) ; Map < String , Object > propertyMap = new HashMap < String , Object > ( propertyDescriptors . length ) ; for ( PropertyDescriptor pd : propertyDescriptors ) { Method getter = pd . getReadMethod ( ) ; if ( getter != null ) { propertyMap . put ( pd . getName ( ) , getter . invoke ( obj ) ) ; } } return propertyMap ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; }
|
public class WrapFactory { /** * Wrap an object newly created by a constructor call .
* @ param cx the current Context for this thread
* @ param scope the scope of the executing script
* @ param obj the object to be wrapped
* @ return the wrapped value . */
public Scriptable wrapNewObject ( Context cx , Scriptable scope , Object obj ) { } }
|
if ( obj instanceof Scriptable ) { return ( Scriptable ) obj ; } Class < ? > cls = obj . getClass ( ) ; if ( cls . isArray ( ) ) { return NativeJavaArray . wrap ( scope , obj ) ; } return wrapAsJavaObject ( cx , scope , obj , null ) ;
|
public class CassandraDataHandlerBase { /** * Constructs Thrift Tow ( each record ) for Index Table .
* @ param columnFamily
* Column family Name for Index Table
* @ param embeddedFieldName
* the embedded field name
* @ param obj
* Embedded Object instance
* @ param column
* Instance of { @ link Column }
* @ param rowKey
* Name of Index Column
* @ param ecValue
* Name of embeddable object in Element Collection cache ( usually
* in the form of < element collection field name > # < integer
* counter >
* @ return Instance of { @ link ThriftRow } */
private ThriftRow constructIndexTableThriftRow ( String columnFamily , String embeddedFieldName , Object obj , Attribute column , byte [ ] rowKey , String ecValue ) { } }
|
// Column Name
Field columnField = ( Field ) column . getJavaMember ( ) ; byte [ ] indexColumnName = PropertyAccessorHelper . get ( obj , columnField ) ; ThriftRow tr = null ; if ( indexColumnName != null && indexColumnName . length != 0 && rowKey != null ) { // Construct Index Table Thrift Row
tr = new ThriftRow ( ) ; tr . setColumnFamilyName ( columnFamily ) ; // Index column - family name
tr . setId ( embeddedFieldName + Constants . INDEX_TABLE_ROW_KEY_DELIMITER + column . getName ( ) ) ; // Id
SuperColumn thriftSuperColumn = new SuperColumn ( ) ; thriftSuperColumn . setName ( indexColumnName ) ; Column thriftColumn = new Column ( ) ; thriftColumn . setName ( rowKey ) ; thriftColumn . setValue ( ecValue . getBytes ( ) ) ; thriftColumn . setTimestamp ( generator . getTimestamp ( ) ) ; thriftSuperColumn . addToColumns ( thriftColumn ) ; tr . addSuperColumn ( thriftSuperColumn ) ; } return tr ;
|
public class BaseApplet { /** * The browser back button was pressed ( Javascript called me ) .
* @ param command The command that was popped from the browser history . */
public void doForward ( String command ) { } }
|
if ( command != null ) if ( command . startsWith ( "#" ) ) command = command . substring ( 1 ) ; Util . getLogger ( ) . info ( "Browser forward: java browser command=" + command + " = target: " + this . cleanCommand ( command ) ) ; BaseApplet . handleAction ( this . cleanCommand ( command ) , this , this , Constants . DONT_PUSH_TO_BROWSER ) ;
|
public class AngularPass { /** * Add node to the list of injectables .
* @ param n node to add . */
private void addNode ( Node n ) { } }
|
Node target = null ; Node fn = null ; String name = null ; switch ( n . getToken ( ) ) { // handles assignment cases like :
// a = function ( ) { }
// a = b = c = function ( ) { }
case ASSIGN : if ( ! n . getFirstChild ( ) . isQualifiedName ( ) ) { compiler . report ( JSError . make ( n , INJECTED_FUNCTION_ON_NON_QNAME ) ) ; return ; } name = n . getFirstChild ( ) . getQualifiedName ( ) ; // last node of chained assignment .
fn = n ; while ( fn . isAssign ( ) ) { fn = fn . getLastChild ( ) ; } target = n . getParent ( ) ; break ; // handles function case :
// function fnName ( ) { }
case FUNCTION : name = NodeUtil . getName ( n ) ; fn = n ; target = n ; if ( n . getParent ( ) . isAssign ( ) && n . getParent ( ) . getJSDocInfo ( ) . isNgInject ( ) ) { // This is a function assigned into a symbol , e . g . a regular function
// declaration in a goog . module or goog . scope .
// Skip in this traversal , it is handled when visiting the assign .
return ; } break ; // handles var declaration cases like :
// var a = function ( ) { }
// var a = b = function ( ) { }
case VAR : case LET : case CONST : name = n . getFirstChild ( ) . getString ( ) ; // looks for a function node .
fn = getDeclarationRValue ( n ) ; target = n ; break ; // handles class method case :
// class clName ( ) {
// constructor ( ) { }
// someMethod ( ) { } < = = =
case MEMBER_FUNCTION_DEF : Node parent = n . getParent ( ) ; if ( parent . isClassMembers ( ) ) { Node classNode = parent . getParent ( ) ; String midPart = n . isStaticMember ( ) ? "." : ".prototype." ; name = NodeUtil . getName ( classNode ) + midPart + n . getString ( ) ; if ( NodeUtil . isEs6ConstructorMemberFunctionDef ( n ) ) { name = NodeUtil . getName ( classNode ) ; } fn = n . getFirstChild ( ) ; if ( classNode . getParent ( ) . isAssign ( ) || classNode . getParent ( ) . isName ( ) ) { target = classNode . getGrandparent ( ) ; } else { target = classNode ; } } break ; default : break ; } if ( fn == null || ! fn . isFunction ( ) ) { compiler . report ( JSError . make ( n , INJECT_NON_FUNCTION_ERROR ) ) ; return ; } // report an error if the function declaration did not take place in a block or global scope
if ( ! target . getParent ( ) . isScript ( ) && ! target . getParent ( ) . isBlock ( ) && ! target . getParent ( ) . isModuleBody ( ) ) { compiler . report ( JSError . make ( n , INJECT_IN_NON_GLOBAL_OR_BLOCK_ERROR ) ) ; return ; } // checks that name is present , which must always be the case unless the
// compiler allowed a syntax error or a dangling anonymous function
// expression .
checkNotNull ( name ) ; // registers the node .
injectables . add ( new NodeContext ( name , n , fn , target ) ) ;
|
public class ByFullTextUtil { /** * Add a predicate for each simple property whose value is not null . */
public < T > List < Predicate > byExample ( ManagedType < T > mt , Path < T > mtPath , T mtValue , SearchParameters sp , CriteriaBuilder builder ) { } }
|
List < Predicate > predicates = newArrayList ( ) ; for ( SingularAttribute < ? super T , ? > attr : mt . getSingularAttributes ( ) ) { if ( ! isPrimaryKey ( mt , attr ) ) { continue ; } Object attrValue = jpaUtil . getValue ( mtValue , attr ) ; if ( attrValue != null ) { predicates . add ( builder . equal ( mtPath . get ( jpaUtil . attribute ( mt , attr ) ) , attrValue ) ) ; } } return predicates ;
|
public class HierarchicalUriComponents { /** * Normalize the path removing sequences like " path / . . " .
* @ see StringUtils # cleanPath ( String ) */
@ Override public UriComponents normalize ( ) { } }
|
String normalizedPath = StringUtils . cleanPath ( getPath ( ) ) ; return new HierarchicalUriComponents ( getScheme ( ) , this . userInfo , this . host , this . port , new FullPathComponent ( normalizedPath ) , this . queryParams , getFragment ( ) , this . encoded , false ) ;
|
public class ConvertNullTo { /** * { @ inheritDoc } */
public Object execute ( final Object value , final CsvContext context ) { } }
|
if ( value == null ) { return returnValue ; } return next . execute ( value , context ) ;
|
public class ParserPropertyHelper { /** * Check if the path to the property correspond to an association .
* @ param targetTypeName the name of the entity containing the property
* @ param pathWithoutAlias the path to the property WITHOUT aliases
* @ return { @ code true } if the property is an association or { @ code false } otherwise */
public boolean isAssociation ( String targetTypeName , List < String > pathWithoutAlias ) { } }
|
OgmEntityPersister persister = getPersister ( targetTypeName ) ; Type propertyType = persister . getPropertyType ( pathWithoutAlias . get ( 0 ) ) ; return propertyType . isAssociationType ( ) ;
|
public class BehaviorTreeReader { /** * Parses the given input stream .
* @ param input the input stream
* @ throws SerializationException if the input stream cannot be successfully parsed . */
public void parse ( InputStream input ) { } }
|
try { parse ( new InputStreamReader ( input , "UTF-8" ) ) ; } catch ( IOException ex ) { throw new SerializationException ( ex ) ; } finally { StreamUtils . closeQuietly ( input ) ; }
|
public class InternalChannelz { /** * Returns a server list . */
public ServerList getServers ( long fromId , int maxPageSize ) { } }
|
List < InternalInstrumented < ServerStats > > serverList = new ArrayList < > ( maxPageSize ) ; Iterator < InternalInstrumented < ServerStats > > iterator = servers . tailMap ( fromId ) . values ( ) . iterator ( ) ; while ( iterator . hasNext ( ) && serverList . size ( ) < maxPageSize ) { serverList . add ( iterator . next ( ) ) ; } return new ServerList ( serverList , ! iterator . hasNext ( ) ) ;
|
public class SurveyFragment { /** * Run this when the user hits the send button , and only send if it returns true . This method will update the visual validation state of all questions , and update the answers instance variable with the latest answer state .
* @ return true if all questions that have constraints have met those constraints . */
public boolean validateAndUpdateState ( ) { } }
|
boolean validationPassed = true ; List < Fragment > fragments = getRetainedChildFragmentManager ( ) . getFragments ( ) ; for ( Fragment fragment : fragments ) { SurveyQuestionView surveyQuestionView = ( SurveyQuestionView ) fragment ; answers . put ( surveyQuestionView . getQuestionId ( ) , surveyQuestionView . getAnswer ( ) ) ; boolean isValid = surveyQuestionView . isValid ( ) ; surveyQuestionView . updateValidationState ( isValid ) ; if ( ! isValid ) { validationPassed = false ; } } return validationPassed ;
|
public class Jsr309ConferenceController { /** * EVENTS */
@ Override public void onReceive ( Object message ) throws Exception { } }
|
final Class < ? > klass = message . getClass ( ) ; final ActorRef self = self ( ) ; final ActorRef sender = sender ( ) ; final State state = fsm . state ( ) ; if ( logger . isInfoEnabled ( ) ) { logger . info ( "********** Conference Controller Current State: \"" + state . toString ( ) ) ; logger . info ( "********** Conference Controller Processing Message: \"" + klass . getName ( ) + " sender : " + sender . getClass ( ) ) ; } if ( Observe . class . equals ( klass ) ) { onObserve ( ( Observe ) message , self , sender ) ; } else if ( StopObserving . class . equals ( klass ) ) { onStopObserving ( ( StopObserving ) message , self , sender ) ; } else if ( CreateMediaSession . class . equals ( klass ) ) { onCreateMediaSession ( ( CreateMediaSession ) message , self , sender ) ; } else if ( Stop . class . equals ( klass ) ) { onStop ( ( Stop ) message , self , sender ) ; } else if ( StopMediaGroup . class . equals ( klass ) ) { onStopMediaGroup ( ( StopMediaGroup ) message , self , sender ) ; } else if ( JoinCall . class . equals ( klass ) ) { onJoinCall ( ( JoinCall ) message , self , sender ) ; } else if ( Play . class . equals ( klass ) ) { onPlay ( ( Play ) message , self , sender ) ; }
|
public class WorkspacePersistentDataManager { /** * { @ inheritDoc } */
public ItemData getItemData ( final NodeData parentData , final QPathEntry name , ItemType itemType ) throws RepositoryException { } }
|
final WorkspaceStorageConnection con = dataContainer . openConnection ( ) ; try { return con . getItemData ( parentData , name , itemType ) ; } finally { con . close ( ) ; }
|
public class HttpClientService { public void get ( String url ) throws Exception { } }
|
String response = excuteGet ( url , false ) ; if ( response == null ) { LOGGER . error ( "call uri error, response is null, uri = " + url ) ; } // parseResultMap ( response , url ) ;
|
public class ServiceHttpClientFactory { /** * Creates { @ link HttpClient } instances for each defined { @ link ServiceHttpClientConfiguration } .
* @ param configuration The configuration
* @ param instanceList The instance list
* @ return The client bean */
@ EachBean ( ServiceHttpClientConfiguration . class ) @ Requires ( condition = ServiceHttpClientCondition . class ) DefaultHttpClient serviceHttpClient ( @ Parameter ServiceHttpClientConfiguration configuration , @ Parameter StaticServiceInstanceList instanceList ) { } }
|
List < URI > originalURLs = configuration . getUrls ( ) ; Collection < URI > loadBalancedURIs = instanceList . getLoadBalancedURIs ( ) ; boolean isHealthCheck = configuration . isHealthCheck ( ) ; LoadBalancer loadBalancer = loadBalancerFactory . create ( instanceList ) ; Optional < String > path = configuration . getPath ( ) ; DefaultHttpClient httpClient ; if ( path . isPresent ( ) ) { httpClient = beanContext . createBean ( DefaultHttpClient . class , loadBalancer , configuration , path . get ( ) ) ; } else { httpClient = beanContext . createBean ( DefaultHttpClient . class , loadBalancer , configuration ) ; } httpClient . setClientIdentifiers ( configuration . getServiceId ( ) ) ; if ( isHealthCheck ) { taskScheduler . scheduleWithFixedDelay ( configuration . getHealthCheckInterval ( ) , configuration . getHealthCheckInterval ( ) , ( ) -> Flowable . fromIterable ( originalURLs ) . flatMap ( originalURI -> { URI healthCheckURI = originalURI . resolve ( configuration . getHealthCheckUri ( ) ) ; return httpClient . exchange ( HttpRequest . GET ( healthCheckURI ) ) . onErrorResumeNext ( throwable -> { if ( throwable instanceof HttpClientResponseException ) { HttpClientResponseException responseException = ( HttpClientResponseException ) throwable ; HttpResponse response = responseException . getResponse ( ) ; // noinspection unchecked
return Flowable . just ( response ) ; } return Flowable . just ( HttpResponse . serverError ( ) ) ; } ) . map ( response -> Collections . singletonMap ( originalURI , response . getStatus ( ) ) ) ; } ) . subscribe ( uriToStatusMap -> { Map . Entry < URI , HttpStatus > entry = uriToStatusMap . entrySet ( ) . iterator ( ) . next ( ) ; URI uri = entry . getKey ( ) ; HttpStatus status = entry . getValue ( ) ; if ( status . getCode ( ) >= 300 ) { loadBalancedURIs . remove ( uri ) ; } else if ( ! loadBalancedURIs . contains ( uri ) ) { loadBalancedURIs . add ( uri ) ; } } ) ) ; } return httpClient ;
|
public class StandaloneMetaProperty { @ Override public P get ( Bean bean ) { } }
|
return clazz . cast ( metaBean ( ) . metaProperty ( name ( ) ) . get ( bean ) ) ;
|
public class FixDependencyChecker { /** * Returns if the apars list apars1 is superseded by apars2 . Apars1 is superseded by apars2 if all the apars in apars1 is also included in apars2
* @ param apars1 Fix to check
* @ param apars2
* @ return Returns true if apars list apars1 is superseded by apars2 . Else return false . */
private static boolean isSupersededBy ( List < Problem > apars1 , List < Problem > apars2 ) { } }
|
boolean result = true ; // Now iterate over the current list of problems , and see if the incoming IFixInfo contains all of the problems from this IfixInfo .
// If it does then return true , to indicate that this IFixInfo object has been superseded .
for ( Iterator < Problem > iter1 = apars1 . iterator ( ) ; iter1 . hasNext ( ) ; ) { boolean currAparMatch = false ; Problem currApar1 = iter1 . next ( ) ; for ( Iterator < Problem > iter2 = apars2 . iterator ( ) ; iter2 . hasNext ( ) ; ) { Problem currApar2 = iter2 . next ( ) ; if ( currApar1 . getDisplayId ( ) . equals ( currApar2 . getDisplayId ( ) ) ) { currAparMatch = true ; } } if ( ! currAparMatch ) result = false ; } return result ;
|
public class StreamExecutionEnvironment { /** * Creates a new data stream that contains elements in the iterator . The iterator is splittable ,
* allowing the framework to create a parallel data stream source that returns the elements in
* the iterator .
* < p > Because the iterator will remain unmodified until the actual execution happens , the type
* of data returned by the iterator must be given explicitly in the form of the type
* information . This method is useful for cases where the type is generic . In that case , the
* type class ( as given in
* { @ link # fromParallelCollection ( org . apache . flink . util . SplittableIterator , Class ) } does not
* supply all type information .
* @ param iterator
* The iterator that produces the elements of the data stream
* @ param typeInfo
* The TypeInformation for the produced data stream .
* @ param < OUT >
* The type of the returned data stream
* @ return A data stream representing the elements in the iterator */
public < OUT > DataStreamSource < OUT > fromParallelCollection ( SplittableIterator < OUT > iterator , TypeInformation < OUT > typeInfo ) { } }
|
return fromParallelCollection ( iterator , typeInfo , "Parallel Collection Source" ) ;
|
public class Config { /** * Parses configuration file and extracts values for test environment
* @ param context
* list of parameters includes values within & lt ; suite & gt ; & lt ; / suite & gt ; and & lt ; test & gt ; & lt ; / test & gt ;
* tags */
public synchronized static void initConfig ( ITestContext context ) { } }
|
SeLionLogger . getLogger ( ) . entering ( context ) ; Map < ConfigProperty , String > initialValues = new HashMap < > ( ) ; Map < String , String > testParams = context . getCurrentXmlTest ( ) . getLocalParameters ( ) ; if ( ! testParams . isEmpty ( ) ) { for ( ConfigProperty prop : ConfigProperty . values ( ) ) { // Check if a selionConfig param resides in the < test >
String newValue = testParams . get ( prop . getName ( ) ) ; // accept param values that are empty in initialValues .
if ( newValue != null ) { initialValues . put ( prop , newValue ) ; } } } ConfigManager . addConfig ( context . getCurrentXmlTest ( ) . getName ( ) , new LocalConfig ( initialValues ) ) ; SeLionLogger . getLogger ( ) . exiting ( ) ;
|
public class MethodProxy { /** * Add a proxy for this method . Each call to the method will be routed to
* the invocationHandler instead . */
public static void proxy ( Method method , InvocationHandler invocationHandler ) { } }
|
assertInvocationHandlerNotNull ( invocationHandler ) ; MockRepository . putMethodProxy ( method , invocationHandler ) ;
|
public class DownloadRequestQueue { /** * Generates a download id for the request and adds the download request to the download request queue for the dispatchers pool to act on immediately .
* @ param request
* @ return downloadId */
int add ( DownloadRequest request ) { } }
|
int downloadId = getDownloadId ( ) ; // Tag the request as belonging to this queue and add it to the set of current requests .
request . setDownloadRequestQueue ( this ) ; synchronized ( mCurrentRequests ) { mCurrentRequests . add ( request ) ; } // Process requests in the order they are added .
request . setDownloadId ( downloadId ) ; mDownloadQueue . add ( request ) ; return downloadId ;
|
public class CmsJspScopedVarBodyTagSuport { /** * Returns the int value of the specified scope string . < p >
* The default value is { @ link PageContext # PAGE _ SCOPE } . < p >
* @ param scope the string name of the desired scope , e . g . " application " , " request "
* @ return the int value of the specified scope string */
protected static int getScopeAsInt ( String scope ) { } }
|
int scopeValue ; switch ( SCOPES_LIST . indexOf ( scope ) ) { case 3 : // application
scopeValue = PageContext . APPLICATION_SCOPE ; break ; case 2 : // session
scopeValue = PageContext . SESSION_SCOPE ; break ; case 1 : // request
scopeValue = PageContext . REQUEST_SCOPE ; break ; default : // page
scopeValue = PageContext . PAGE_SCOPE ; break ; } return scopeValue ;
|
public class CmsVfsSitemapService { /** * Creates a navigation level type info . < p >
* @ return the navigation level type info bean
* @ throws CmsException if reading the sub level redirect copy page fails */
private CmsNewResourceInfo createNavigationLevelTypeInfo ( ) throws CmsException { } }
|
String name = CmsResourceTypeFolder . getStaticTypeName ( ) ; Locale locale = getWorkplaceLocale ( ) ; String subtitle = Messages . get ( ) . getBundle ( getWorkplaceLocale ( ) ) . key ( Messages . GUI_NAVIGATION_LEVEL_SUBTITLE_0 ) ; if ( CmsStringUtil . isEmptyOrWhitespaceOnly ( subtitle ) ) { subtitle = CmsWorkplaceMessages . getResourceTypeName ( locale , name ) ; } CmsNewResourceInfo result = new CmsNewResourceInfo ( CmsResourceTypeFolder . getStaticTypeId ( ) , name , Messages . get ( ) . getBundle ( getWorkplaceLocale ( ) ) . key ( Messages . GUI_NAVIGATION_LEVEL_TITLE_0 ) , subtitle , getCmsObject ( ) . readResource ( SUB_LEVEL_REDIRECT_COPY_PAGE ) . getStructureId ( ) , false , subtitle ) ; result . setBigIconClasses ( CmsIconUtil . ICON_NAV_LEVEL_BIG ) ; result . setCreateParameter ( CmsJspNavBuilder . NAVIGATION_LEVEL_FOLDER ) ; return result ;
|
public class StateMachineDefinition { /** * Get the transition definitions
* @ param transitionthe transition
* @ returnthe definitions */
public Transition < S > getTransition ( S fromState , T transition ) { } }
|
Transition < S > transitionDef = transitions . get ( new DoubleValueBean < S , T > ( fromState , transition ) ) ; if ( transitionDef == null ) { throw new IllegalArgumentException ( "Transition '" + transition + "' from state '" + fromState + "' has not been defined." ) ; } return transitionDef ;
|
public class br { /** * < pre >
* Performs generic data validation for the operation to be performed
* < / pre > */
protected void validate ( String operationType ) throws Exception { } }
|
super . validate ( operationType ) ; MPSDouble br_cpu_usage_validator = new MPSDouble ( ) ; br_cpu_usage_validator . validate ( operationType , br_cpu_usage , "\"br_cpu_usage\"" ) ; MPSDouble br_memory_usage_validator = new MPSDouble ( ) ; br_memory_usage_validator . validate ( operationType , br_memory_usage , "\"br_memory_usage\"" ) ; MPSDouble wan_out_validator = new MPSDouble ( ) ; wan_out_validator . validate ( operationType , wan_out , "\"wan_out\"" ) ; MPSDouble lan_out_validator = new MPSDouble ( ) ; lan_out_validator . validate ( operationType , lan_out , "\"lan_out\"" ) ; MPSString upsince_validator = new MPSString ( ) ; upsince_validator . setConstraintMaxStrLen ( MPSConstants . GENERIC_CONSTRAINT , 128 ) ; upsince_validator . setConstraintMinStrLen ( MPSConstants . GENERIC_CONSTRAINT , 1 ) ; upsince_validator . validate ( operationType , upsince , "\"upsince\"" ) ; MPSString ha_peer_state_validator = new MPSString ( ) ; ha_peer_state_validator . setConstraintMaxStrLen ( MPSConstants . GENERIC_CONSTRAINT , 32 ) ; ha_peer_state_validator . setConstraintMinStrLen ( MPSConstants . GENERIC_CONSTRAINT , 1 ) ; ha_peer_state_validator . validate ( operationType , ha_peer_state , "\"ha_peer_state\"" ) ; MPSString ha_state_validator = new MPSString ( ) ; ha_state_validator . setConstraintMaxStrLen ( MPSConstants . GENERIC_CONSTRAINT , 32 ) ; ha_state_validator . setConstraintMinStrLen ( MPSConstants . GENERIC_CONSTRAINT , 1 ) ; ha_state_validator . validate ( operationType , ha_state , "\"ha_state\"" ) ; MPSIPAddress ha_peer_ip_address_validator = new MPSIPAddress ( ) ; ha_peer_ip_address_validator . validate ( operationType , ha_peer_ip_address , "\"ha_peer_ip_address\"" ) ; MPSDouble ha_peer_id_validator = new MPSDouble ( ) ; ha_peer_id_validator . validate ( operationType , ha_peer_id , "\"ha_peer_id\"" ) ; MPSString operation_status_validator = new MPSString ( ) ; operation_status_validator . setConstraintMaxStrLen ( MPSConstants . GENERIC_CONSTRAINT , 128 ) ; operation_status_validator . validate ( operationType , operation_status , "\"operation_status\"" ) ; MPSString bypass_validator = new MPSString ( ) ; bypass_validator . setConstraintMaxStrLen ( MPSConstants . GENERIC_CONSTRAINT , 128 ) ; bypass_validator . validate ( operationType , bypass , "\"bypass\"" ) ; MPSString bandwidth_mode_validator = new MPSString ( ) ; bandwidth_mode_validator . setConstraintMaxStrLen ( MPSConstants . GENERIC_CONSTRAINT , 128 ) ; bandwidth_mode_validator . validate ( operationType , bandwidth_mode , "\"bandwidth_mode\"" ) ; MPSDoubleLong bandwidth_limit_validator = new MPSDoubleLong ( ) ; bandwidth_limit_validator . validate ( operationType , bandwidth_limit , "\"bandwidth_limit\"" ) ; MPSIPAddress havmip_validator = new MPSIPAddress ( ) ; havmip_validator . validate ( operationType , havmip , "\"havmip\"" ) ; MPSString acl_connections_validator = new MPSString ( ) ; acl_connections_validator . setConstraintMaxStrLen ( MPSConstants . GENERIC_CONSTRAINT , 32 ) ; acl_connections_validator . validate ( operationType , acl_connections , "\"acl_connections\"" ) ; MPSString unacl_connections_validator = new MPSString ( ) ; unacl_connections_validator . setConstraintMaxStrLen ( MPSConstants . GENERIC_CONSTRAINT , 32 ) ; unacl_connections_validator . validate ( operationType , unacl_connections , "\"unacl_connections\"" ) ; MPSString connected_plugins_validator = new MPSString ( ) ; connected_plugins_validator . setConstraintMaxStrLen ( MPSConstants . GENERIC_CONSTRAINT , 32 ) ; connected_plugins_validator . validate ( operationType , connected_plugins , "\"connected_plugins\"" ) ; MPSString max_plugins_validator = new MPSString ( ) ; max_plugins_validator . setConstraintMaxStrLen ( MPSConstants . GENERIC_CONSTRAINT , 32 ) ; max_plugins_validator . validate ( operationType , max_plugins , "\"max_plugins\"" ) ; MPSDouble wan_in_validator = new MPSDouble ( ) ; wan_in_validator . validate ( operationType , wan_in , "\"wan_in\"" ) ; MPSDouble lan_in_validator = new MPSDouble ( ) ; lan_in_validator . validate ( operationType , lan_in , "\"lan_in\"" ) ; MPSDouble wan_out_prev_validator = new MPSDouble ( ) ; wan_out_prev_validator . validate ( operationType , wan_out_prev , "\"wan_out_prev\"" ) ; MPSDouble lan_out_prev_validator = new MPSDouble ( ) ; lan_out_prev_validator . validate ( operationType , lan_out_prev , "\"lan_out_prev\"" ) ; MPSDouble wan_in_prev_validator = new MPSDouble ( ) ; wan_in_prev_validator . validate ( operationType , wan_in_prev , "\"wan_in_prev\"" ) ; MPSDouble lan_in_prev_validator = new MPSDouble ( ) ; lan_in_prev_validator . validate ( operationType , lan_in_prev , "\"lan_in_prev\"" ) ; MPSDouble prev_poll_time_validator = new MPSDouble ( ) ; prev_poll_time_validator . validate ( operationType , prev_poll_time , "\"prev_poll_time\"" ) ; MPSIPAddress apa_ip_address_validator = new MPSIPAddress ( ) ; apa_ip_address_validator . setConstraintIsReq ( MPSConstants . ADD_CONSTRAINT , true ) ; apa_ip_address_validator . validate ( operationType , apa_ip_address , "\"apa_ip_address\"" ) ; MPSIPAddress apa_netmask_validator = new MPSIPAddress ( ) ; apa_netmask_validator . setConstraintIsReq ( MPSConstants . ADD_CONSTRAINT , true ) ; apa_netmask_validator . validate ( operationType , apa_netmask , "\"apa_netmask\"" ) ; MPSIPAddress apa_gateway_validator = new MPSIPAddress ( ) ; apa_gateway_validator . setConstraintIsReq ( MPSConstants . ADD_CONSTRAINT , true ) ; apa_gateway_validator . validate ( operationType , apa_gateway , "\"apa_gateway\"" ) ; MPSIPAddress plugin_ip_address_validator = new MPSIPAddress ( ) ; plugin_ip_address_validator . setConstraintIsReq ( MPSConstants . ADD_CONSTRAINT , true ) ; plugin_ip_address_validator . validate ( operationType , plugin_ip_address , "\"plugin_ip_address\"" ) ; MPSDouble system_load_validator = new MPSDouble ( ) ; system_load_validator . validate ( operationType , system_load , "\"system_load\"" ) ; MPSDouble active_connections_validator = new MPSDouble ( ) ; active_connections_validator . validate ( operationType , active_connections , "\"active_connections\"" ) ; MPSIPAddress mgmt_ip_address_validator = new MPSIPAddress ( ) ; mgmt_ip_address_validator . validate ( operationType , mgmt_ip_address , "\"mgmt_ip_address\"" ) ; MPSString license_validator = new MPSString ( ) ; license_validator . setConstraintMaxStrLen ( MPSConstants . GENERIC_CONSTRAINT , 64 ) ; license_validator . setConstraintMinStrLen ( MPSConstants . GENERIC_CONSTRAINT , 1 ) ; license_validator . validate ( operationType , license , "\"license\"" ) ;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.