signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class Iterables { /** * Combines four iterables into a single iterable . The returned iterable has
* an iterator that traverses the elements in { @ code a } , followed by the
* elements in { @ code b } , followed by the elements in { @ code c } , followed by
* the elements in { @ code d } . The source iter... | return concat ( ImmutableList . of ( a , b , c , d ) ) ; |
public class ListFuncSup { /** * define a function to deal with each element in the list with given
* start index
* @ param func
* a function takes in each element from list and
* iterator info
* @ param index
* the index where to start iteration
* @ return return ' last loop value ' . < br >
* check
... | return ( R ) forEach ( $ ( func ) , index ) ; |
public class DNSOutput { /** * Writes an unsigned 16 bit value to the stream .
* @ param val The value to be written */
public void writeU16 ( int val ) { } } | check ( val , 16 ) ; need ( 2 ) ; array [ pos ++ ] = ( byte ) ( ( val >>> 8 ) & 0xFF ) ; array [ pos ++ ] = ( byte ) ( val & 0xFF ) ; |
public class GrafeasV1Beta1Client { /** * Deletes the specified note .
* < p > Sample code :
* < pre > < code >
* try ( GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client . create ( ) ) {
* NoteName name = NoteName . of ( " [ PROJECT ] " , " [ NOTE ] " ) ;
* grafeasV1Beta1Client . deleteNote ( n... | DeleteNoteRequest request = DeleteNoteRequest . newBuilder ( ) . setName ( name == null ? null : name . toString ( ) ) . build ( ) ; deleteNote ( request ) ; |
public class ApiOvhTelephony { /** * Alter this object properties
* REST : PUT / telephony / { billingAccount } / rsva / { serviceName }
* @ param body [ required ] New object properties
* @ param billingAccount [ required ] The name of your billingAccount
* @ param serviceName [ required ] */
public void billi... | String qPath = "/telephony/{billingAccount}/rsva/{serviceName}" ; StringBuilder sb = path ( qPath , billingAccount , serviceName ) ; exec ( qPath , "PUT" , sb . toString ( ) , body ) ; |
public class CmsImportVersion7 { /** * Associates the stored resources to the created organizational units . < p >
* This is a global process that occurs only once at the end of the import ,
* after all resources have been imported , to make sure that the resources
* of the organizational units are available . < ... | if ( ( m_orgUnitResources == null ) || m_orgUnitResources . isEmpty ( ) ) { // no organizational resources to associate
return ; } String site = getCms ( ) . getRequestContext ( ) . getSiteRoot ( ) ; try { getCms ( ) . getRequestContext ( ) . setSiteRoot ( "" ) ; List < String > orgUnits = new ArrayList < String > ( m_... |
public class Registration { /** * Checks the syntax of the given URL .
* @ param url The URL .
* @ return true , if valid . */
private boolean checkUrl ( String url ) { } } | try { URI uri = new URI ( url ) ; return uri . isAbsolute ( ) ; } catch ( URISyntaxException e ) { return false ; } |
public class AptUtil { /** * Returns unqualified class name ( e . g . String , if java . lang . String )
* NB : This method requires the given element has the kind of { @ link ElementKind # CLASS } .
* @ param element
* @ return unqualified class name
* @ author vvakame */
public static String getNameForNew ( E... | if ( element . getKind ( ) != ElementKind . CLASS ) { throw new IllegalStateException ( ) ; } return getNameForNew ( "" , element ) ; |
public class Attributes { /** * Remove an attribute by key . < b > Case sensitive . < / b >
* @ param key attribute key to remove */
public void remove ( String key ) { } } | int i = indexOfKey ( key ) ; if ( i != NotFound ) remove ( i ) ; |
public class ResolveFileAction { /** * { @ inheritDoc } */
@ Override public void execute ( ExecutorService executor ) { } } | File f = new File ( _locAdmin . resolveString ( _location ) ) ; if ( f . isAbsolute ( ) ) { resolve ( _location , _filesToMonitor ) ; } else { resolve ( AppManagerConstants . SERVER_APPS_DIR + _location , _filesToMonitor ) ; resolve ( AppManagerConstants . SHARED_APPS_DIR + _location , _filesToMonitor ) ; } _mon . setP... |
public class ControllerLinkRelationProvider { /** * ( non - Javadoc )
* @ see org . springframework . hateoas . server . LinkRelationProvider # getCollectionResourceRelFor ( java . lang . Class ) */
@ Override public LinkRelation getCollectionResourceRelFor ( Class < ? > resource ) { } } | LookupContext context = LookupContext . forCollectionResourceRelLookup ( entityType ) ; return providers . getRequiredPluginFor ( context ) . getCollectionResourceRelFor ( resource ) ; |
public class BoxApiFile { /** * Gets a request to fetch the upload session using the upload session id . It contains the number of parts that are processed so far ,
* the total number of parts required for the commit and expiration date and time of the upload session .
* @ return the status . */
public BoxRequestsF... | return new BoxRequestsFile . GetUploadSession ( uploadSessionId , getUploadSessionInfoUrl ( uploadSessionId ) , mSession ) ; |
public class R2jsUtils { /** * Parse an expression containing multiple lines , functions or sub - expressions
* in a list of inline sub - expressions . This function also cleanup comments .
* @ param expr expression to parse
* @ return a list of inline sub - expressions */
public static List < String > parse ( St... | List < String > expressions = new ArrayList < > ( ) ; int parenthesis = 0 ; // ' ( ' and ' ) '
int brackets = 0 ; // ' { ' and ' } '
int brackets2 = 0 ; // ' [ ' and ' ] '
String [ ] lines = expr . split ( "\n" ) ; StringBuilder sb = new StringBuilder ( ) ; for ( String line : lines ) { line = line . trim ( ) ; if ( li... |
public class BoneCP { /** * Return total number of connections created in all partitions .
* @ return number of created connections */
public int getTotalCreatedConnections ( ) { } } | int total = 0 ; for ( int i = 0 ; i < this . partitionCount && this . partitions [ i ] != null ; i ++ ) { total += this . partitions [ i ] . getCreatedConnections ( ) ; } return total ; |
public class BrowserPattern { /** * Compares all attributes of this instance with the given instance of a { @ code BrowserPattern } .
* This method is < em > consistent with equals < / em > .
* @ param other
* another instance of { @ code OperatingSystemPattern }
* @ return negative value if one of the attribut... | int result = other == null ? - 1 : 0 ; if ( result == 0 ) { result = compareInt ( getPosition ( ) , other . getPosition ( ) ) ; if ( result == 0 ) { result = compareInt ( getId ( ) , other . getId ( ) ) ; } if ( result == 0 ) { result = getPattern ( ) . pattern ( ) . compareTo ( other . getPattern ( ) . pattern ( ) ) ;... |
public class CORSFilter { /** * Parses each param - value and populates configuration variables . If a param is provided , it overrides the default .
* @ param allowedOrigins A { @ link String } of comma separated origins .
* @ param allowedHttpMethods A { @ link String } of comma separated HTTP methods .
* @ par... | if ( allowedOrigins != null ) { if ( allowedOrigins . trim ( ) . equals ( "*" ) ) { this . anyOriginAllowed = true ; } else { this . anyOriginAllowed = false ; Set < String > setAllowedOrigins = parseStringToSet ( allowedOrigins ) ; this . allowedOrigins . clear ( ) ; this . allowedOrigins . addAll ( setAllowedOrigins ... |
public class MimeTypeUtil { /** * Detects the mime type of a binary resource ( nt : file , nt : resource or another asset type ) .
* @ param resource the binary resource
* @ param defaultValue the default value if the detection has no useful result
* @ return he detected mime type or the default value given */
pu... | MimeType mimeType = getMimeType ( resource ) ; return mimeType != null ? mimeType . toString ( ) : defaultValue ; |
public class CSVDirConfiguration { /** * from http : / / hsqldb . org / doc / 2.0 / guide / texttables - chapt . html # ttc _ configuration
* @ return field delimiter expression to be used with HSQLDB */
public String getEscapedFieldDelimiter ( ) { } } | final String escaped ; switch ( fieldDelimiter ) { case ';' : escaped = "\\semi" ; break ; case '\'' : escaped = "\\quote" ; break ; case ' ' : escaped = "\\space" ; break ; case '`' : escaped = "\\apos" ; break ; default : escaped = String . valueOf ( fieldDelimiter ) ; } return escaped ; |
public class CProductLocalServiceWrapper { /** * Returns a range of all the c products .
* 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 >... | return _cProductLocalService . getCProducts ( start , end ) ; |
public class Webhook { /** * Create a WebhookCreator to execute create .
* @ param pathSessionSid The unique id of the Session for this webhook .
* @ param target The target of this webhook .
* @ return WebhookCreator capable of executing the create */
public static WebhookCreator creator ( final String pathSessi... | return new WebhookCreator ( pathSessionSid , target ) ; |
public class GoogleHadoopFileSystemBase { /** * { @ inheritDoc }
* < p > Returns the service if delegation tokens are configured , otherwise , null . */
@ Override public String getCanonicalServiceName ( ) { } } | String service = null ; if ( delegationTokens != null ) { service = delegationTokens . getService ( ) . toString ( ) ; } logger . atFine ( ) . log ( "GHFS.getCanonicalServiceName:=> %s" , service ) ; return service ; |
public class StatisticsJDBCStorageConnection { /** * { @ inheritDoc } */
public boolean isOpened ( ) { } } | Statistics s = ALL_STATISTICS . get ( IS_OPENED_DESCR ) ; try { s . begin ( ) ; return wcs . isOpened ( ) ; } finally { s . end ( ) ; } |
public class RequestLaunchTemplateData { /** * The elastic inference accelerator for the instance .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setElasticInferenceAccelerators ( java . util . Collection ) } or
* { @ link # withElasticInferenceAccelerato... | if ( this . elasticInferenceAccelerators == null ) { setElasticInferenceAccelerators ( new com . amazonaws . internal . SdkInternalList < LaunchTemplateElasticInferenceAccelerator > ( elasticInferenceAccelerators . length ) ) ; } for ( LaunchTemplateElasticInferenceAccelerator ele : elasticInferenceAccelerators ) { thi... |
public class MapperScannerConfigurer { /** * BeanDefinitionRegistries are called early in application startup , before
* BeanFactoryPostProcessors . This means that PropertyResourceConfigurers will not have been
* loaded and any property substitution of this class ' properties will fail . To avoid this , find
* a... | Map < String , PropertyResourceConfigurer > prcs = applicationContext . getBeansOfType ( PropertyResourceConfigurer . class ) ; if ( ! prcs . isEmpty ( ) && applicationContext instanceof ConfigurableApplicationContext ) { BeanDefinition mapperScannerBean = ( ( ConfigurableApplicationContext ) applicationContext ) . get... |
public class SREConfigurationBlock { /** * Invoked when the user want to search for a SARL runtime environment . */
protected void handleInstalledSREsButtonSelected ( ) { } } | PreferencesUtil . createPreferenceDialogOn ( getControl ( ) . getShell ( ) , SREsPreferencePage . ID , new String [ ] { SREsPreferencePage . ID } , null ) . open ( ) ; |
public class ProgressiveRendering { /** * { @ link BoundObjectTable # releaseMe } just cannot work the way we need it to . */
private void release ( ) { } } | try { Method release = BoundObjectTable . Table . class . getDeclaredMethod ( "release" , String . class ) ; release . setAccessible ( true ) ; release . invoke ( boundObjectTable , boundId ) ; } catch ( Exception x ) { LOG . log ( Level . WARNING , "failed to unbind " + boundId , x ) ; } |
public class PooledByteArrayBufferedInputStream { /** * Checks if there is some data left in the buffer . If not but buffered stream still has some
* data to be read , then more data is buffered .
* @ return false if and only if there is no more data and underlying input stream has no more data
* to be read
* @... | if ( mBufferOffset < mBufferedSize ) { return true ; } final int readData = mInputStream . read ( mByteArray ) ; if ( readData <= 0 ) { return false ; } mBufferedSize = readData ; mBufferOffset = 0 ; return true ; |
public class ClassPathUtils { /** * Scan the classpath string provided , and collect a set of package paths found in jars and classes on the path .
* On the resulting path set , first exclude those that match any exclude prefixes , and then include
* those that match a set of include prefixes .
* @ param classPat... | final Set < String > pathSet = new HashSet < String > ( ) ; // Defer to JDKPaths to do the actual classpath scanning .
__JDKPaths . processClassPathItem ( classPath , excludeJarSet , pathSet ) ; return filterPathSet ( pathSet , excludePrefixes , includePrefixes ) ; |
public class StreamScanner { /** * Method that does full resolution of an entity reference , be it
* character entity , internal entity or external entity , including
* updating of input buffers , and depending on whether result is
* a character entity ( or one of 5 pre - defined entities ) , returns
* char in ... | char c = getNextCharFromCurrent ( SUFFIX_IN_ENTITY_REF ) ; // Do we have a ( numeric ) character entity reference ?
if ( c == '#' ) { // numeric
final StringBuffer originalSurface = new StringBuffer ( "#" ) ; int ch = resolveCharEnt ( originalSurface ) ; if ( mCfgTreatCharRefsAsEntities ) { final char [ ] originalChars... |
public class CreateIbanLengthMapConstantsClass { /** * Instantiates a class via deferred binding .
* @ return the new instance , which must be cast to the requested class */
public static IbanLengthMapSharedConstants create ( ) { } } | if ( ibanLengthMapConstants == null ) { // NOPMD it ' s thread save !
synchronized ( IbanLengthMapConstantsClient . class ) { if ( ibanLengthMapConstants == null ) { final IbanLengthMapConstants ibanLengthMap = GWT . create ( IbanLengthMapConstants . class ) ; ibanLengthMapConstants = new IbanLengthMapConstantsClient (... |
public class DataStorage { /** * Analyze which and whether a transition of the fs state is required and
* perform it if necessary .
* Rollback if ( previousLV > = LAYOUT _ VERSION & & previousLV >
* FEDERATION _ VERSION )
* Upgrade if this . LV > LAYOUT _ VERSION & & this . LV > FEDERATION _ VERSION
* Regular... | if ( startOpt == StartupOption . ROLLBACK ) doRollback ( nsInfo ) ; // rollback if applicable
int numOfDirs = sds . size ( ) ; List < StorageDirectory > dirsToUpgrade = new ArrayList < StorageDirectory > ( numOfDirs ) ; List < StorageInfo > dirsInfo = new ArrayList < StorageInfo > ( numOfDirs ) ; for ( StorageDirectory... |
public class JsonGetterContextCache { /** * Cleanup on best effort basis . Concurrent calls to this method may
* leave the cache empty . In that case , lost entries are re - cached
* at a later call to { @ link # getContext ( String ) } .
* @ param excluded */
private void cleanupIfNeccessary ( JsonGetterContext ... | int cacheCount ; while ( ( cacheCount = internalCache . size ( ) ) > maxContexts ) { int sampleCount = Math . max ( cacheCount - maxContexts , cleanupRemoveAtLeastItems ) + 1 ; for ( SamplingEntry sample : internalCache . getRandomSamples ( sampleCount ) ) { if ( excluded != sample . getEntryValue ( ) ) { internalCache... |
public class DeviceTemplateMarshaller { /** * Marshall the given parameter object . */
public void marshall ( DeviceTemplate deviceTemplate , ProtocolMarshaller protocolMarshaller ) { } } | if ( deviceTemplate == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( deviceTemplate . getDeviceType ( ) , DEVICETYPE_BINDING ) ; protocolMarshaller . marshall ( deviceTemplate . getCallbackOverrides ( ) , CALLBACKOVERRIDES_BINDING ) ; } ca... |
public class StatsTraceContext { /** * See { @ link StreamTracer # inboundMessageRead } .
* < p > Called from { @ link io . grpc . internal . MessageDeframer } . */
public void inboundMessageRead ( int seqNo , long optionalWireSize , long optionalUncompressedSize ) { } } | for ( StreamTracer tracer : tracers ) { tracer . inboundMessageRead ( seqNo , optionalWireSize , optionalUncompressedSize ) ; } |
public class ComputeNodesImpl { /** * Gets information about the specified compute node .
* @ param poolId The ID of the pool that contains the compute node .
* @ param nodeId The ID of the compute node that you want to get information about .
* @ param computeNodeGetOptions Additional parameters for the operatio... | return ServiceFuture . fromHeaderResponse ( getWithServiceResponseAsync ( poolId , nodeId , computeNodeGetOptions ) , serviceCallback ) ; |
public class CreateResolverEndpointRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( CreateResolverEndpointRequest createResolverEndpointRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( createResolverEndpointRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( createResolverEndpointRequest . getCreatorRequestId ( ) , CREATORREQUESTID_BINDING ) ; protocolMarshaller . marshall ( createResolverEndpointRequest . getN... |
public class HasInputStream { /** * Create a new object with a supplier that can read multiple times .
* @ param aISP
* { @ link InputStream } provider . May not be < code > null < / code > .
* @ return Never < code > null < / code > . */
@ Nonnull @ ReturnsMutableCopy public static HasInputStream multiple ( @ No... | return new HasInputStream ( aISP , true ) ; |
public class IpUtil { /** * 获取ip位置信息
* @ param ip ip地址
* @ return json数据
* @ throws IOException io异常 */
public static JSONObject getIpInfo ( String ip ) throws IOException { } } | String param = "?ip=" + ip ; String ipInfoStr = getIpInfoByIp ( URL . IP_INFO_URI + param ) ; JSONObject jsonObject = JSON . parseObject ( ipInfoStr ) ; Integer code = ( Integer ) jsonObject . get ( "code" ) ; if ( code == 0 ) { return jsonObject . getJSONObject ( "data" ) ; } return null ; |
public class CmsUserInfo { /** * Creates an user image upload button . < p >
* @ param label the label to use
* @ param icon the icon to use
* @ param user the user
* @ param uploadListener the upload listener
* @ return the button */
private CmsUploadButton createImageUploadButton ( String label , Resource i... | CmsUploadButton uploadButton = new CmsUploadButton ( CmsUserIconHelper . USER_IMAGE_FOLDER + CmsUserIconHelper . TEMP_FOLDER ) ; if ( label != null ) { uploadButton . setCaption ( label ) ; } if ( icon != null ) { uploadButton . setIcon ( icon ) ; } uploadButton . getState ( ) . setUploadType ( UploadType . singlefile ... |
public class AmazonRoute53Client { /** * Creates a new public or private hosted zone . You create records in a public hosted zone to define how you want to
* route traffic on the internet for a domain , such as example . com , and its subdomains ( apex . example . com ,
* acme . example . com ) . You create records... | request = beforeClientExecution ( request ) ; return executeCreateHostedZone ( request ) ; |
public class AbstractCachedGenerator { /** * Adds the linked resource to the linked resource map
* @ param path
* the resource path
* @ param context
* the generator context
* @ param fMapping
* the file path mapping linked to the resource */
protected void addLinkedResources ( String path , GeneratorContex... | addLinkedResources ( path , context , Arrays . asList ( fMapping ) ) ; |
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public EClass getIfcCartesianTransformationOperator ( ) { } } | if ( ifcCartesianTransformationOperatorEClass == null ) { ifcCartesianTransformationOperatorEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 81 ) ; } return ifcCartesianTransformationOperatorEClass ; |
public class Feed { /** * Gets the systemFeedGenerationData value for this Feed .
* @ return systemFeedGenerationData * The system data for the Feed . This data specifies information
* for generating the feed items
* of the system generated feed .
* < span class = " constraint Selectable " > This field can
* ... | return systemFeedGenerationData ; |
public class WavImpl { /** * Flush and close audio data and stream .
* @ param input The audio input .
* @ param dataLine Audio source data .
* @ throws IOException If error on closing . */
private static void close ( AudioInputStream input , DataLine dataLine ) throws IOException { } } | dataLine . drain ( ) ; dataLine . flush ( ) ; dataLine . stop ( ) ; dataLine . close ( ) ; input . close ( ) ; |
public class ComputeNodesImpl { /** * Disables task scheduling on the specified compute node .
* You can disable task scheduling on a node only if its current scheduling state is enabled .
* @ param poolId The ID of the pool that contains the compute node .
* @ param nodeId The ID of the compute node on which you... | disableSchedulingWithServiceResponseAsync ( poolId , nodeId , nodeDisableSchedulingOption , computeNodeDisableSchedulingOptions ) . toBlocking ( ) . single ( ) . body ( ) ; |
public class AbstractFCKConnector { /** * Return FCKeditor current folder path .
* @ param context
* @ return String path */
protected String getCurrentFolderPath ( GenericWebAppContext context ) { } } | // To limit browsing set Servlet init param " digitalAssetsPath " with desired JCR path
String rootFolderStr = ( String ) context . get ( "org.exoplatform.frameworks.jcr.command.web.fckeditor.digitalAssetsPath" ) ; if ( rootFolderStr == null ) rootFolderStr = "/" ; // set current folder
String currentFolderStr = ( Stri... |
public class HeadersSerializer { /** * Gets a module wrapping this serializer as an adapter for the Jackson
* ObjectMapper .
* @ return a simple module to be plugged onto Jackson ObjectMapper . */
public static SimpleModule getModule ( ) { } } | SimpleModule module = new SimpleModule ( ) ; module . addSerializer ( Headers . class , new HeadersSerializer ( ) ) ; return module ; |
public class Selectable { /** * Selector that matches any descendant element with a given name that satisfies the
* specified constraints . If no constraints are provided , accepts all descendant elements
* with the given name .
* @ param qname element QName
* @ param constraints element constraints
* @ retur... | ElementEqualsConstraint nameConstraint = new ElementEqualsConstraint ( qname ) ; return new DescendantSelector < T > ( getContext ( ) , getCurrentSelector ( ) , ElementSelector . gatherConstraints ( nameConstraint , constraints ) ) ; |
public class CPRuleUserSegmentRelPersistenceImpl { /** * Returns the cp rule user segment rel with the primary key or returns < code > null < / code > if it could not be found .
* @ param primaryKey the primary key of the cp rule user segment rel
* @ return the cp rule user segment rel , or < code > null < / code >... | Serializable serializable = entityCache . getResult ( CPRuleUserSegmentRelModelImpl . ENTITY_CACHE_ENABLED , CPRuleUserSegmentRelImpl . class , primaryKey ) ; if ( serializable == nullModel ) { return null ; } CPRuleUserSegmentRel cpRuleUserSegmentRel = ( CPRuleUserSegmentRel ) serializable ; if ( cpRuleUserSegmentRel ... |
public class InstantiateOperation { /** * Returns a list containing the classes of the elements in the given object list as array . */
private Class < ? > [ ] getClassList ( List < Object > objects ) { } } | Class < ? > [ ] classes = new Class < ? > [ objects . size ( ) ] ; for ( int i = 0 ; i < objects . size ( ) ; i ++ ) { classes [ i ] = objects . get ( i ) . getClass ( ) ; } return classes ; |
public class State { /** * Get the value of a property .
* @ param key property key
* @ return value associated with the key as a string or < code > null < / code > if the property is not set */
public String getProp ( String key ) { } } | if ( this . specProperties . containsKey ( key ) ) { return this . specProperties . getProperty ( key ) ; } return this . commonProperties . getProperty ( key ) ; |
public class GVRAsynchronousResourceLoader { /** * Load a compressed texture asynchronously .
* This is the implementation of
* { @ link GVRContext # loadCompressedTexture ( GVRAndroidResource . CompressedTextureCallback , GVRAndroidResource ) }
* : it will usually be more convenient ( and more efficient ) to cal... | loadCompressedTexture ( gvrContext , textureCache , callback , resource , GVRCompressedImage . DEFAULT_QUALITY ) ; |
public class AbstractCommonShapeFileReader { /** * Invoked to initialize the buffer for the content of the file .
* @ throws IOException in case of error . */
private void initializeContentBuffer ( ) throws IOException { } } | if ( this . seekEnabled ) { this . buffer = ByteBuffer . allocate ( this . fileSize - HEADER_BYTES ) ; final int read = this . stream . read ( this . buffer ) ; if ( read < 0 ) { throw new EOFException ( ) ; } this . buffer . rewind ( ) ; this . buffer . limit ( read ) ; this . bufferPosition = HEADER_BYTES ; } else { ... |
public class DoorType { /** * Gets the value of the genericApplicationPropertyOfDoor property .
* This accessor method returns a reference to the live list ,
* not a snapshot . Therefore any modification you make to the
* returned list will be present inside the JAXB object .
* This is why there is not a < CODE... | if ( _GenericApplicationPropertyOfDoor == null ) { _GenericApplicationPropertyOfDoor = new ArrayList < JAXBElement < Object > > ( ) ; } return this . _GenericApplicationPropertyOfDoor ; |
public class BatchDeletePhoneNumberRequest { /** * List of phone number IDs .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setPhoneNumberIds ( java . util . Collection ) } or { @ link # withPhoneNumberIds ( java . util . Collection ) } if you want
* to o... | if ( this . phoneNumberIds == null ) { setPhoneNumberIds ( new java . util . ArrayList < String > ( phoneNumberIds . length ) ) ; } for ( String ele : phoneNumberIds ) { this . phoneNumberIds . add ( ele ) ; } return this ; |
public class AbstractRasMethodAdapter { /** * Begin processing a method . This is called when the instruction stream
* for a method is first encountered . Since this is the first callback , we
* use this to add the byte codes required for entry tracing . */
@ Override public void visitCode ( ) { } } | if ( injectedTraceAnnotationVisitor == null && classAdapter . isInjectedTraceAnnotationRequired ( ) ) { AnnotationVisitor av = visitAnnotation ( INJECTED_TRACE_TYPE . getDescriptor ( ) , true ) ; av . visitEnd ( ) ; } super . visitCode ( ) ; // Label the entry to the method so we can update the local var
// debug data ... |
public class WidgetUtil { /** * Creates the HTML to display a transparent Flash movie for the browser on which we ' re running .
* @ param flashVars a pre - URLEncoded string containing flash variables , or null .
* http : / / www . adobe . com / cfusion / knowledgebase / index . cfm ? id = tn _ 16417 */
public sta... | FlashObject obj = new FlashObject ( ident , movie , width , height , flashVars ) ; obj . transparent = true ; return createContainer ( obj ) ; |
public class ApiOvhTelephony { /** * Create a new token
* REST : POST / telephony / { billingAccount } / easyHunting / { serviceName } / hunting / eventToken
* @ param expiration [ required ] Time to live in seconds for the token
* @ param billingAccount [ required ] The name of your billingAccount
* @ param se... | String qPath = "/telephony/{billingAccount}/easyHunting/{serviceName}/hunting/eventToken" ; StringBuilder sb = path ( qPath , billingAccount , serviceName ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "expiration" , expiration ) ; String resp = exec ( qPath , "POST" , sb . toSt... |
public class UserApiKeyAuthProviderClientImpl { /** * Deletes a user API key associated with the current user .
* @ param id The id of the API key to delete .
* @ return A { @ link Task } that completes when the API key is deleted . */
@ Override public Task < Void > deleteApiKey ( @ NonNull final ObjectId id ) { }... | return dispatcher . dispatchTask ( new Callable < Void > ( ) { @ Override public Void call ( ) { deleteApiKeyInternal ( id ) ; return null ; } } ) ; |
public class ActionRequestProcessor { /** * Fire the action , creating , populating , performing and to next .
* @ param runtime The runtime meta of action execute , which has action execute , path parameter and states . ( NotNull )
* @ throws IOException When the action fails about the IO .
* @ throws ServletExc... | final ActionResponseReflector reflector = createResponseReflector ( runtime ) ; ready ( runtime , reflector ) ; final OptionalThing < VirtualForm > form = prepareActionForm ( runtime ) ; populateParameter ( runtime , form ) ; final VirtualAction action = createAction ( runtime , reflector ) ; final NextJourney journey ... |
public class PortletRequestContextImpl { /** * / * ( non - Javadoc )
* @ see org . apache . pluto . container . PortletRequestContext # getPublicParameterMap ( ) */
@ Override public Map < String , String [ ] > getPublicParameterMap ( ) { } } | // Only re - use render parameters on a render request
if ( this . portalRequestInfo . getUrlType ( ) == UrlType . RENDER ) { return this . portletWindow . getPublicRenderParameters ( ) ; } return Collections . emptyMap ( ) ; |
public class ErrorDetails { /** * Details for an exception name .
* @ param t a throwable
* @ return an object with error details */
public static ErrorDetails exceptionName ( Throwable t ) { } } | return new ErrorDetails ( t . getClass ( ) . getName ( ) , ErrorDetailsKind . EXCEPTION_NAME ) ; |
public class AfplibPackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public EClass getCDD ( ) { } } | if ( cddEClass == null ) { cddEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( AfplibPackage . eNS_URI ) . getEClassifiers ( ) . get ( 225 ) ; } return cddEClass ; |
public class MigrateProcessInstanceCmd { /** * delete unmapped instances in a bottom - up fashion ( similar to deleteCascade and regular BPMN execution ) */
protected void deleteUnmappedActivityInstances ( MigratingProcessInstance migratingProcessInstance ) { } } | Set < MigratingScopeInstance > leafInstances = collectLeafInstances ( migratingProcessInstance ) ; final DeleteUnmappedInstanceVisitor visitor = new DeleteUnmappedInstanceVisitor ( executionBuilder . isSkipCustomListeners ( ) , executionBuilder . isSkipIoMappings ( ) ) ; for ( MigratingScopeInstance leafInstance : leaf... |
public class BinaryBAMShardIndexWriter { /** * Write this content as binary output */
@ Override public void writeReference ( final BAMIndexContent content ) { } } | if ( content == null ) { writeNullContent ( ) ; return ; } // write bins
final BAMIndexContent . BinList bins = content . getBins ( ) ; final int size = bins == null ? 0 : content . getNumberOfNonNullBins ( ) ; if ( size == 0 ) { writeNullContent ( ) ; return ; } // final List < Chunk > chunks = content . getMetaData (... |
public class Database { public String [ ] get_device_property_list ( String devname , String wildcard ) throws DevFailed { } } | return databaseDAO . get_device_property_list ( this , devname , wildcard ) ; |
public class ReframingResponseObserver { /** * Accept a new response from inner / upstream callable . This message will be processed by the
* { @ link Reframer } in the delivery loop and the output will be delivered to the downstream { @ link
* ResponseObserver } .
* < p > If the delivery loop is stopped , this w... | IllegalStateException error = null ; // Guard against unsolicited notifications
if ( ! awaitingInner || ! newItem . compareAndSet ( null , response ) ) { // Notify downstream if it ' s still open
error = new IllegalStateException ( "Received unsolicited response from upstream." ) ; cancellation . compareAndSet ( null ,... |
public class MsgpackIOUtil { /** * Serializes the { @ code message } into an { @ link MessageBufferOutput } using the given { @ code schema } . */
public static < T > void writeTo ( MessageBufferOutput out , T message , Schema < T > schema , boolean numeric ) throws IOException { } } | MessagePacker packer = MessagePack . newDefaultPacker ( out ) ; try { writeTo ( packer , message , schema , numeric ) ; } finally { packer . flush ( ) ; } |
public class RouteFilterPrefixMarshaller { /** * Marshall the given parameter object . */
public void marshall ( RouteFilterPrefix routeFilterPrefix , ProtocolMarshaller protocolMarshaller ) { } } | if ( routeFilterPrefix == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( routeFilterPrefix . getCidr ( ) , CIDR_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( )... |
public class QuerySelect { /** * Returns an Observable of the results of pushing one set of parameters
* through a select query .
* @ param params
* one set of parameters to be run with the query
* @ return */
private < T > Observable < T > executeOnce ( final List < Parameter > params , ResultSetMapper < ? ext... | return QuerySelectOnSubscribe . execute ( this , params , function ) . subscribeOn ( context . scheduler ( ) ) ; |
public class NamePhraseRenderer { /** * { @ inheritDoc } */
@ Override public final String renderAsPhrase ( ) { } } | final Name name = nameRenderer . getGedObject ( ) ; final String prefix = escapeString ( name . getPrefix ( ) ) ; final String surname = escapeString ( name . getSurname ( ) ) ; final String suffix = escapeString ( name . getSuffix ( ) ) ; return separate ( prefix , surname , suffix ) ; |
public class ListItem { /** * Mock data */
static List < ListItem > createItemsV1 ( Context context ) { } } | final List < ListItem > items = new ArrayList < > ( ) ; final Painting [ ] paintings = Painting . list ( context . getResources ( ) ) ; items . add ( new ListItem ( "Donec sem arcu, feugiat sit amet purus ut, cursus tristique" + " justo. Quisque eu ligula sed massa tristique elementum eu vel augue." ) ) ; items . add (... |
public class ClusterJspHelper { /** * Helper function that generates the decommissioning report . */
DecommissionStatus generateDecommissioningReport ( ) { } } | List < InetSocketAddress > isas = null ; ArrayList < String > suffixes = null ; if ( isAvatar ) { suffixes = new ArrayList < String > ( ) ; suffixes . add ( "0" ) ; suffixes . add ( "1" ) ; } try { isas = DFSUtil . getClientRpcAddresses ( conf , suffixes ) ; sort ( isas ) ; } catch ( Exception e ) { // catch any except... |
public class BaseMessage { /** * Setup this message given this internal data structure .
* @ param data The data in an intermediate format . */
public static BaseMessage createMessage ( String strMessageClassName , BaseMessageHeader messageHeader , Object data ) { } } | BaseMessage message = null ; if ( ( strMessageClassName == null ) && ( messageHeader != null ) ) { strMessageClassName = ( String ) messageHeader . get ( BaseMessageHeader . INTERNAL_MESSAGE_CLASS ) ; if ( ( strMessageClassName == null ) || ( strMessageClassName . length ( ) == 0 ) ) { // ? String strRequestType = ( St... |
public class MetaSnapshotDAO { /** * 删除interval秒之前的数据 */
public Integer deleteByTimestamp ( String destination , int interval ) { } } | HashMap params = Maps . newHashMapWithExpectedSize ( 2 ) ; long timestamp = System . currentTimeMillis ( ) - interval * 1000 ; params . put ( "timestamp" , timestamp ) ; params . put ( "destination" , destination ) ; return getSqlMapClientTemplate ( ) . delete ( "meta_snapshot.deleteByTimestamp" , params ) ; |
public class CompensationBehavior { /** * With compensation , we have a dedicated scope execution for every handler , even if the handler is not
* a scope activity ; this must be respected when invoking end listeners , etc . */
public static boolean executesNonScopeCompensationHandler ( PvmExecutionImpl execution ) {... | ActivityImpl activity = execution . getActivity ( ) ; return execution . isScope ( ) && activity != null && activity . isCompensationHandler ( ) && ! activity . isScope ( ) ; |
public class MgcpEndpointManager { /** * Unregisters an active endpoint .
* @ param endpointId The ID of the endpoint to be unregistered
* @ throws MgcpEndpointNotFoundException If there is no registered endpoint with such ID */
public void unregisterEndpoint ( String endpointId ) throws MgcpEndpointNotFoundExcepti... | MgcpEndpoint endpoint = this . endpoints . remove ( endpointId ) ; if ( endpoint == null ) { throw new MgcpEndpointNotFoundException ( "Endpoint " + endpointId + " not found" ) ; } endpoint . forget ( ( MgcpMessageObserver ) this ) ; endpoint . forget ( ( MgcpEndpointObserver ) this ) ; if ( log . isDebugEnabled ( ) ) ... |
public class A_CmsSelectBox { /** * Sets the form value of this select box . < p >
* @ param value the new value
* @ param fireEvents true if change events should be fired */
public void setFormValue ( Object value , boolean fireEvents ) { } } | if ( value == null ) { value = "" ; } if ( ! "" . equals ( value ) && ! m_selectCells . containsKey ( value ) ) { OPTION option = createUnknownOption ( ( String ) value ) ; if ( option != null ) { addOption ( option ) ; } } if ( value instanceof String ) { String strValue = ( String ) value ; onValueSelect ( strValue ,... |
public class SourceFile { /** * Returns a copy of code as a list of lines . */
public List < String > getLines ( ) { } } | try { return CharSource . wrap ( sourceBuilder ) . readLines ( ) ; } catch ( IOException e ) { throw new AssertionError ( "IOException not possible, as the string is in-memory" ) ; } |
public class PdfTransparencyGroup { /** * Determining whether the objects within the stack are composited with one another or only with the group ' s backdrop .
* @ param knockout */
public void setKnockout ( boolean knockout ) { } } | if ( knockout ) put ( PdfName . K , PdfBoolean . PDFTRUE ) ; else remove ( PdfName . K ) ; |
public class QueryBuilder { /** * Query for selecting changes ( or snapshots ) made on a concrete ValueObject
* ( so a ValueObject owned by a concrete Entity instance ) .
* < br / > < br / >
* < b > Path parameter < / b > is a relative path from owning Entity instance to ValueObject that you are looking for .
*... | Validate . argumentsAreNotNull ( ownerEntityClass , ownerLocalId , path ) ; return new QueryBuilder ( new IdFilterDefinition ( ValueObjectIdDTO . valueObjectId ( ownerLocalId , ownerEntityClass , path ) ) ) ; |
public class AccessLogInterceptor { /** * 记录访问日志
* @ param ip 访问IP
* @ param visitor 访问者
* @ param userId 用户id
* @ param browser 浏览器
* @ param url 访问URL
* @ param elapsedTime 请求耗时
* @ return 记录日志行 */
private String getAccessLog ( String ip , User visitor , Integer userId , String browser , String url , lo... | StringBuilder sb = new StringBuilder ( ) ; sb . append ( null != ip ? ip : "unknown" ) . append ( "\t" ) ; if ( visitor == null ) { sb . append ( "-\t-\t" ) ; } else { if ( userId == null ) { sb . append ( "-\t" ) ; } else { sb . append ( visitor . getUserId ( ) == userId ? AccessLogType . PORTAL_USER : AccessLogType .... |
public class GVRRigidBody { /** * Set a { @ linkplain GVRRigidBody rigid body } to be ignored ( true ) or not ( false )
* @ param collisionObject rigidbody object on the collision check
* @ param ignore boolean to indicate if the specified object will be ignored or not */
public void setIgnoreCollisionCheck ( GVRRi... | Native3DRigidBody . setIgnoreCollisionCheck ( getNative ( ) , collisionObject . getNative ( ) , ignore ) ; |
public class AbstractEditor { /** * This method is called when an editor is removed from the
* workspace . */
public void dispose ( ) { } } | if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Disposing of editor " + getId ( ) ) ; } context . register ( GlobalCommandIds . SAVE , null ) ; context . register ( GlobalCommandIds . SAVE_AS , null ) ; // descriptor . removePropertyChangeListener ( ( PropertyChangeListener ) context . getPane ( ) ) ;
concreteDi... |
public class MultiPartReader { /** * Reads uploaded files and form variables from POSTed data .
* Files are stored on disk in case uploadDir is not null .
* Otherwise files are stored as attributes on the http - request in the form of FileObjects , using the name of the html - form - variable as key .
* Plain pro... | input = request . getInputStream ( ) ; // the next variable stores all post data and is useful for debug purposes
bytesReadAsLine = input . readLine ( line , 0 , BUFFER_SIZE ) ; if ( bytesReadAsLine <= 2 ) { return 0 ; } bytesRead = bytesReadAsLine ; // save the multipart boundary string
String boundary = new String ( ... |
public class HBaseTableUtil { /** * Creates a hbase table if it does not exists . Same as calling
* { @ link # createTableIfNotExists ( org . apache . hadoop . hbase . client . HBaseAdmin , byte [ ] ,
* org . apache . hadoop . hbase . HTableDescriptor , byte [ ] [ ] , long , java . util . concurrent . TimeUnit ) } ... | createTableIfNotExists ( admin , tableName , tableDescriptor , splitKeys , MAX_CREATE_TABLE_WAIT , TimeUnit . MILLISECONDS ) ; |
public class MvpDelegate { /** * < p > Attach delegated object as view to presenter fields of this object .
* If delegate did not enter at { @ link # onCreate ( Bundle ) } ( or
* { @ link # onCreate ( ) } ) before this method , then view will not be attached to
* presenters < / p > */
public void onAttach ( ) { }... | for ( MvpPresenter < ? super Delegated > presenter : mPresenters ) { if ( mIsAttached && presenter . getAttachedViews ( ) . contains ( mDelegated ) ) { continue ; } presenter . attachView ( mDelegated ) ; } for ( MvpDelegate < ? > childDelegate : mChildDelegates ) { childDelegate . onAttach ( ) ; } mIsAttached = true ; |
public class TokenList { /** * Detects variable values using another token list .
* Usually , one is working with two token lists . One list contains literals and variables and the other token list
* contains only literals . Both lists match are then compared to find values ( literals of the second list ) for
* v... | Map < String , String > variables = new HashMap < String , String > ( ) ; boolean thisContainsVariables = containsVariables ( ) ; boolean thatContainsVariables = tokenList . containsVariables ( ) ; // If both lists contain variables , we get into trouble .
if ( thisContainsVariables && thatContainsVariables ) { throw n... |
public class ObjectUtil { /** * - - - - - LIST / ARRAY UTILITIES */
public static Object findFirstIn ( Object obj , Object [ ] arr ) { } } | for ( Object o : arr ) { if ( obj . equals ( o ) ) { return o ; } } return null ; |
public class ProjectOperations { /** * Returns all the { @ link JavaEnumSource } objects from the given { @ link Project } */
public List < JavaResource > getProjectEnums ( Project project ) { } } | final List < JavaResource > enums = new ArrayList < > ( ) ; if ( project != null ) { project . getFacet ( JavaSourceFacet . class ) . visitJavaSources ( new JavaResourceVisitor ( ) { @ Override public void visit ( VisitContext context , JavaResource resource ) { try { JavaSource < ? > javaSource = resource . getJavaTyp... |
public class KeyTypeData { /** * Reads :
* typeInfo {
* deprecated {
* co {
* direct { " true " }
* tz {
* camtr { " true " } */
private static void getTypeInfo ( UResourceBundle typeInfoRes ) { } } | Map < String , Set < String > > _deprecatedKeyTypes = new LinkedHashMap < String , Set < String > > ( ) ; for ( UResourceBundleIterator keyInfoIt = typeInfoRes . getIterator ( ) ; keyInfoIt . hasNext ( ) ; ) { UResourceBundle keyInfoEntry = keyInfoIt . next ( ) ; String key = keyInfoEntry . getKey ( ) ; TypeInfoType ty... |
public class OgmEntityEntryState { /** * state chain management ops below */
@ Override public void addExtraState ( EntityEntryExtraState extraState ) { } } | if ( next == null ) { next = extraState ; } else { next . addExtraState ( extraState ) ; } |
public class EasyReader { /** * 读取
* @ param handler 处理逻辑
* @ param size 读取多少个文件
* @ throws Exception */
public void read ( LineHandler handler , int size ) throws Exception { } } | File rootFile = new File ( root ) ; File [ ] files ; if ( rootFile . isDirectory ( ) ) { files = rootFile . listFiles ( new FileFilter ( ) { @ Override public boolean accept ( File pathname ) { return pathname . isFile ( ) && ! pathname . getName ( ) . endsWith ( ".bin" ) ; } } ) ; if ( files == null ) { if ( rootFile ... |
public class EntityGraphLoader { /** * Get the entity by id and load its graph using loadGraph . */
public T getById ( PK pk ) { } } | try { tx . begin ( ) ; T entity = repository . getById ( pk ) ; loadGraph ( entity ) ; tx . commit ( ) ; return entity ; } catch ( Exception x ) { throw new RuntimeException ( x ) ; } |
public class Utils { /** * Logs target object */
static void log ( Object targetObj , String msg ) { } } | if ( EventsParams . isDebug ( ) ) { Log . d ( TAG , toLogStr ( targetObj , msg ) ) ; } |
public class Uninterruptibles { /** * Invokes { @ code latch . } { @ link CountDownLatch # await ( ) await ( ) }
* uninterruptibly . */
public static void awaitUninterruptibly ( CountDownLatch latch ) { } } | boolean interrupted = false ; try { while ( true ) { try { latch . await ( ) ; return ; } catch ( InterruptedException e ) { interrupted = true ; } } } finally { if ( interrupted ) { Thread . currentThread ( ) . interrupt ( ) ; } } |
public class WayDecorator { /** * Finds the segments of a line along which a name can be drawn and then adds WayTextContainers
* to the list of drawable items .
* @ param upperLeft the tile in the upper left corner of the drawing pane
* @ param lowerRight the tile in the lower right corner of the drawing pane
*... | if ( coordinates . length == 0 ) { return ; } Point [ ] c ; if ( dy == 0f ) { c = coordinates [ 0 ] ; } else { c = RendererUtils . parallelPath ( coordinates [ 0 ] , dy ) ; } if ( c . length < 2 ) { return ; } LineString path = new LineString ( ) ; for ( int i = 1 ; i < c . length ; i ++ ) { LineSegment segment = new L... |
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public EClass getIfcBuildingElementProxy ( ) { } } | if ( ifcBuildingElementProxyEClass == null ) { ifcBuildingElementProxyEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 61 ) ; } return ifcBuildingElementProxyEClass ; |
public class Asm { /** * Create mmword ( 8 bytes ) pointer operand
* ! @ note This constructor is provided only for convenience for mmx programming . */
public static final Mem mmword_ptr_abs ( long target , long disp , SEGMENT segmentPrefix ) { } } | return _ptr_build_abs ( target , disp , segmentPrefix , SIZE_QWORD ) ; |
public class TypeParser { /** * org / javaruntype / type / parser / Type . g : 111:1 : typeParameterization : ( typeExpression | UNKNOWN | UNKNOWN EXTENDS typExp = typeExpression - > ^ ( EXT $ typExp ) | UNKNOWN SUPER typExp = typeExpression - > ^ ( SUP $ typExp ) ) ; */
public final TypeParser . typeParameterization_r... | TypeParser . typeParameterization_return retval = new TypeParser . typeParameterization_return ( ) ; retval . start = input . LT ( 1 ) ; CommonTree root_0 = null ; Token UNKNOWN8 = null ; Token UNKNOWN9 = null ; Token EXTENDS10 = null ; Token UNKNOWN11 = null ; Token SUPER12 = null ; TypeParser . typeExpression_return ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.