signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class Json { /** * Parses the given input string as JSON . The input must contain a valid JSON value , optionally
* padded with whitespace .
* @ param string
* the input string , must be valid JSON
* @ return a value that represents the parsed JSON
* @ throws ParseException
* if the input is not valid JSON */
public static JsonValue parse ( String string ) { } } | if ( string == null ) { throw new NullPointerException ( "string is null" ) ; } DefaultHandler handler = new DefaultHandler ( ) ; new JsonParser ( handler ) . parse ( string ) ; return handler . getValue ( ) ; |
public class LocationAttributes { /** * Remove the location attributes from a DOM element .
* @ param elem
* the element to remove the location attributes from .
* @ param recurse
* if < code > true < / code > , also remove location attributes on
* descendant elements . */
public static void remove ( Element elem , boolean recurse ) { } } | elem . removeAttributeNS ( URI , SRC_ATTR ) ; elem . removeAttributeNS ( URI , LINE_ATTR ) ; elem . removeAttributeNS ( URI , COL_ATTR ) ; if ( recurse ) { NodeList children = elem . getChildNodes ( ) ; for ( int i = 0 ; i < children . getLength ( ) ; i ++ ) { Node child = children . item ( i ) ; if ( child . getNodeType ( ) == Node . ELEMENT_NODE ) { remove ( ( Element ) child , recurse ) ; } } } |
public class SyncAgentsInner { /** * Creates or updates a sync agent .
* @ param resourceGroupName The name of the resource group that contains the resource . You can obtain this value from the Azure Resource Manager API or the portal .
* @ param serverName The name of the server on which the sync agent is hosted .
* @ param syncAgentName The name of the sync agent .
* @ param syncDatabaseId ARM resource id of the sync database in the sync agent .
* @ 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 < SyncAgentInner > beginCreateOrUpdateAsync ( String resourceGroupName , String serverName , String syncAgentName , String syncDatabaseId , final ServiceCallback < SyncAgentInner > serviceCallback ) { } } | return ServiceFuture . fromResponse ( beginCreateOrUpdateWithServiceResponseAsync ( resourceGroupName , serverName , syncAgentName , syncDatabaseId ) , serviceCallback ) ; |
public class Utils { /** * Split list by comma .
* @ param hosts the hosts
* @ return string */
public static String splitListByComma ( List < String > hosts ) { } } | boolean firstHost = true ; StringBuilder hostConnection = new StringBuilder ( ) ; for ( String host : hosts ) { if ( ! firstHost ) { hostConnection . append ( "," ) ; } hostConnection . append ( host . trim ( ) ) ; firstHost = false ; } return hostConnection . toString ( ) ; |
public class Utils { /** * Substitute variables surrounded by < code > $ { < / code > and < code > } < / code > .
* The variables ' values come from the dicionary that is also passed along .
* Variables that have no values in the dictionary are removed from the
* final string result .
* @ param string the original string w / variables
* @ param dictionary the dictionary with variables ' values
* @ return the orginal string with variables substituted */
public static String subst ( String string , Map dictionary ) { } } | LOGGER . entering ( CLASS_NAME , "subst" , new Object [ ] { string , dictionary } ) ; Pattern pattern = Pattern . compile ( VARIABLE_PATTERN ) ; Matcher matcher = pattern . matcher ( string ) ; while ( matcher . find ( ) ) { String value = ( String ) dictionary . get ( matcher . group ( 1 ) ) ; if ( value == null ) value = "" ; string = string . replace ( matcher . group ( 0 ) , value ) ; matcher . reset ( string ) ; } matcher . reset ( ) ; LOGGER . exiting ( CLASS_NAME , "subst" , string ) ; return string ; |
public class WebServiceRefProcessor { /** * This method will create the injection binding from WebServiceRef annotation , if there is no DD so that processXML did not execute and create the injection binding . */
@ Override public InjectionBinding < WebServiceRef > createInjectionBinding ( WebServiceRef webServiceRef , Class < ? > instanceClass , Member member , String jndiName ) throws InjectionException { } } | InjectionBinding < WebServiceRef > binding ; WebServiceRefInfo wsrInfo = WebServiceRefInfoBuilder . buildWebServiceRefInfo ( webServiceRef , instanceClass . getClassLoader ( ) ) ; wsrInfo . setClientMetaData ( JaxWsMetaDataManager . getJaxWsClientMetaData ( ivNameSpaceConfig . getModuleMetaData ( ) ) ) ; if ( member == null ) { // Annotated on class
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Creating new injection binding for @WebServiceRef annotation found on the " + instanceClass . getName ( ) + " class." ) ; } this . validateAndSetClassLevelWebServiceRef ( webServiceRef , instanceClass , wsrInfo ) ; // Now add the @ HandlerChain instance
javax . jws . HandlerChain hcAnnot = instanceClass . getAnnotation ( javax . jws . HandlerChain . class ) ; if ( hcAnnot != null ) { wsrInfo . setHandlerChainAnnotation ( hcAnnot ) ; wsrInfo . setHandlerChainDeclaringClassName ( instanceClass . getName ( ) ) ; } binding = new WebServiceRefBinding ( wsrInfo , ivNameSpaceConfig ) ; } else if ( member instanceof Method ) { // Annotated on method
Method method = ( Method ) member ; wsrInfo . setJndiName ( jndiName ) ; // Send the wsrInfo to this call so that both the ' type ' and ' value ' properties can be set correctly
this . validateAndSetMemberLevelWebServiceRef ( webServiceRef , method , wsrInfo ) ; // Now add the @ HandlerChain instance
javax . jws . HandlerChain hcAnnot = method . getAnnotation ( javax . jws . HandlerChain . class ) ; if ( hcAnnot != null ) { wsrInfo . setHandlerChainAnnotation ( hcAnnot ) ; wsrInfo . setHandlerChainDeclaringClassName ( instanceClass . getName ( ) ) ; } // MTOM , RespectBinding , Addressing
// Merge any features that might be set on the field ( @ MTOM , @ RespectBinding , @ Addressing )
// Note that we only support features for port - component - ref type injections .
// For a port - component - ref type injection , the " Service SEI class " will be set on
// ' wsrMetadata ' .
if ( wsrInfo . getServiceRefTypeClassName ( ) != null ) { handleMTOM ( webServiceRef , wsrInfo , method . getAnnotation ( MTOM . class ) ) ; handleRespectBinding ( webServiceRef , wsrInfo , method . getAnnotation ( RespectBinding . class ) ) ; handleAddressing ( webServiceRef , wsrInfo , method . getAnnotation ( Addressing . class ) ) ; } // Create binding for @ WebServiceRef annotation
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Creating new injection binding for the @WebServiceRef annotation on the " + method . getName ( ) + " method in the " + method . getDeclaringClass ( ) . getName ( ) + " class." ) ; } binding = new WebServiceRefBinding ( wsrInfo , ivNameSpaceConfig ) ; addInjectionBinding ( binding ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Successfully created an injection binding for the @WebServiceRef annotation on the " + method . getName ( ) + " method in the " + method . getDeclaringClass ( ) . getName ( ) + " class." ) ; } } else { // Annotated on field
Field field = ( Field ) member ; wsrInfo . setJndiName ( jndiName ) ; // Send the wsrInfo to this call so that both the ' type ' and ' value ' properties can be set correctly
this . validateAndSetMemberLevelWebServiceRef ( webServiceRef , field , wsrInfo ) ; // Now add the @ HandlerChain instance
javax . jws . HandlerChain hcAnnot = field . getAnnotation ( javax . jws . HandlerChain . class ) ; if ( hcAnnot != null ) { wsrInfo . setHandlerChainAnnotation ( hcAnnot ) ; wsrInfo . setHandlerChainDeclaringClassName ( instanceClass . getName ( ) ) ; } // MTOM , RespectBinding , Addressing
// Merge any features that might be set on the field ( @ MTOM , @ RespectBinding , @ Addressing )
// Note that we only support features for port - component - ref type injections .
// For a port - component - ref type injection , the " Service SEI class " will be set on
// ' wsrMetadata ' .
if ( wsrInfo . getServiceRefTypeClassName ( ) != null ) { handleMTOM ( webServiceRef , wsrInfo , field . getAnnotation ( MTOM . class ) ) ; handleRespectBinding ( webServiceRef , wsrInfo , field . getAnnotation ( RespectBinding . class ) ) ; handleAddressing ( webServiceRef , wsrInfo , field . getAnnotation ( Addressing . class ) ) ; } // Create binding for @ WebServiceRef annotation
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Creating new injection binding for the @WebServiceRef annotation on the " + field . getName ( ) + " field in the " + field . getDeclaringClass ( ) . getName ( ) + " class." ) ; } binding = new WebServiceRefBinding ( wsrInfo , ivNameSpaceConfig ) ; addInjectionBinding ( binding ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Successfully created an injection binding for the @WebServiceRef annotation on the " + field . getName ( ) + " field in the " + field . getDeclaringClass ( ) . getName ( ) + " class. HashCode=" + Integer . toHexString ( System . identityHashCode ( this ) ) ) ; } } return binding ; |
public class AppServicePlansInner { /** * Gets server farm usage information .
* Gets server farm usage information .
* @ param resourceGroupName Name of the resource group to which the resource belongs .
* @ param name Name of App Service Plan
* @ param filter Return only usages / metrics specified in the filter . Filter conforms to odata syntax . Example : $ filter = ( name . value eq ' Metric1 ' or name . value eq ' Metric2 ' ) .
* @ 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 < List < CsmUsageQuotaInner > > listUsagesAsync ( final String resourceGroupName , final String name , final String filter , final ListOperationCallback < CsmUsageQuotaInner > serviceCallback ) { } } | return AzureServiceFuture . fromPageResponse ( listUsagesSinglePageAsync ( resourceGroupName , name , filter ) , new Func1 < String , Observable < ServiceResponse < Page < CsmUsageQuotaInner > > > > ( ) { @ Override public Observable < ServiceResponse < Page < CsmUsageQuotaInner > > > call ( String nextPageLink ) { return listUsagesNextSinglePageAsync ( nextPageLink ) ; } } , serviceCallback ) ; |
public class GeneratorRegistry { /** * Returns the path to use in the generation URL for debug mode .
* @ param path
* the resource path
* @ return the path to use in the generation URL for debug mode . */
public String getDebugModeGenerationPath ( String path ) { } } | ResourceGenerator resourceGenerator = resolveResourceGenerator ( path ) ; return resourceGenerator . getDebugModeRequestPath ( ) ; |
public class TorqueDBHandling { /** * Adds an input stream of a db definition ( in our case of a torque schema file ) .
* @ param schemaStream The input stream */
public void addDBDefinitionFile ( InputStream schemaStream ) throws IOException { } } | _torqueSchemata . put ( "schema" + _torqueSchemata . size ( ) + ".xml" , readStreamCompressed ( schemaStream ) ) ; |
public class BinTrie { /** * 获取键值对集合
* @ return */
public Set < Map . Entry < String , V > > entrySet ( ) { } } | Set < Map . Entry < String , V > > entrySet = new TreeSet < Map . Entry < String , V > > ( ) ; StringBuilder sb = new StringBuilder ( ) ; for ( BaseNode node : child ) { if ( node == null ) continue ; node . walk ( new StringBuilder ( sb . toString ( ) ) , entrySet ) ; } return entrySet ; |
public class IOUtils { /** * Scans given directory for files satisfying given inclusion / exclusion
* patterns .
* @ param buildContext
* Build context provided by the environment , used to scan for files .
* @ param directory
* Directory to scan .
* @ param includes
* inclusion pattern .
* @ param excludes
* exclusion pattern .
* @ param defaultExcludes
* default exclusion flag .
* @ return Files from the given directory which satisfy given patterns . The
* files are { @ link File # getCanonicalFile ( ) canonical } .
* @ throws IOException
* If an I / O error occurs , which is possible because the
* construction of the canonical pathname may require filesystem
* queries . */
public static List < File > scanDirectoryForFiles ( BuildContext buildContext , final File directory , final String [ ] includes , final String [ ] excludes , boolean defaultExcludes ) throws IOException { } } | if ( ! directory . exists ( ) ) { return Collections . emptyList ( ) ; } final Scanner scanner ; if ( buildContext != null ) { scanner = buildContext . newScanner ( directory , true ) ; } else { final DirectoryScanner directoryScanner = new DirectoryScanner ( ) ; directoryScanner . setBasedir ( directory . getAbsoluteFile ( ) ) ; scanner = directoryScanner ; } scanner . setIncludes ( includes ) ; scanner . setExcludes ( excludes ) ; if ( defaultExcludes ) { scanner . addDefaultExcludes ( ) ; } scanner . scan ( ) ; final List < File > files = new ArrayList < File > ( ) ; for ( final String name : scanner . getIncludedFiles ( ) ) { files . add ( new File ( directory , name ) . getCanonicalFile ( ) ) ; } return files ; |
public class SnorocketOWLReasoner { /** * Gets the data properties that are disjoint with the specified data
* property expression < code > pe < / code > . The data properties are returned as
* a { @ link NodeSet } .
* @ param pe
* The data property expression whose disjoint data properties
* are to be retrieved .
* @ return The return value is a < code > NodeSet < / code > such that for each
* data property < code > P < / code > in the < code > NodeSet < / code > the set
* of reasoner axioms entails
* < code > EquivalentDataProperties ( P , DataPropertyComplementOf ( pe ) ) < / code >
* or
* < code > StrictSubDataPropertyOf ( P , DataPropertyComplementOf ( pe ) ) < / code >
* @ throws InconsistentOntologyException
* if the imports closure of the root ontology is inconsistent
* @ throws ClassExpressionNotInProfileException
* if < code > data propertyExpression < / code > is not within the
* profile that is supported by this reasoner .
* @ throws FreshEntitiesException
* if the signature of < code > pe < / code > is not contained within
* the signature of the imports closure of the root ontology and
* the undeclared entity policy of this reasoner is set to
* { @ link FreshEntityPolicy # DISALLOW } .
* @ throws ReasonerInterruptedException
* if the reasoning process was interrupted for any particular
* reason ( for example if reasoning was cancelled by a client
* process )
* @ throws TimeOutException
* if the reasoner timed out during a basic reasoning operation .
* See { @ link # getTimeOut ( ) } . */
@ Override public NodeSet < OWLDataProperty > getDisjointDataProperties ( OWLDataPropertyExpression pe ) throws InconsistentOntologyException , FreshEntitiesException , ReasonerInterruptedException , TimeOutException { } } | throw new ReasonerInternalException ( "getDisjointDataProperties not implemented" ) ; |
public class CloseableTabbedPaneUI { /** * Paints the border for the tab ' s content , ie . the area below the tabs */
@ Override protected void paintContentBorder ( final Graphics g , final int tabPlacement , final int tabIndex ) { } } | final int w = tabPane . getWidth ( ) ; final int h = tabPane . getHeight ( ) ; final Insets tabAreaInsets = getTabAreaInsets ( tabPlacement ) ; final int x = 0 ; final int y = calculateTabAreaHeight ( tabPlacement , runCount , maxTabHeight ) + tabAreaInsets . bottom ; g . setColor ( _tabSelectedBackgroundColor ) ; g . fillRect ( x , y , w , h ) ; g . setColor ( _tabBorderColor ) ; // top line , except below selected tab
final Rectangle selectTabBounds = getTabBounds ( tabPane , tabIndex ) ; g . drawLine ( x , y , selectTabBounds . x , y ) ; g . drawLine ( selectTabBounds . x + selectTabBounds . width , y , x + w , y ) ; |
public class ADContractionNameSampleStream { /** * Recursive method to process a node in Arvores Deitadas format .
* @ param node
* the node to be processed
* @ param sentence
* the sentence tokens we got so far
* @ param names
* the names we got so far */
private void process ( Node node , List < String > sentence , List < Span > names ) { } } | if ( node != null ) { for ( TreeElement element : node . getElements ( ) ) { if ( element . isLeaf ( ) ) { processLeaf ( ( Leaf ) element , sentence , names ) ; } else { process ( ( Node ) element , sentence , names ) ; } } } |
public class StructureTools { /** * Short version of { @ link # getStructure ( String , PDBFileParser , AtomCache ) }
* which creates new parsers when needed
* @ param name
* @ return
* @ throws IOException
* @ throws StructureException */
public static Structure getStructure ( String name ) throws IOException , StructureException { } } | return StructureTools . getStructure ( name , null , null ) ; |
public class LoggingUtils { /** * Prepare log event log event .
* @ param logEvent the log event
* @ return the log event */
public static LogEvent prepareLogEvent ( final LogEvent logEvent ) { } } | val messageModified = TicketIdSanitizationUtils . sanitize ( logEvent . getMessage ( ) . getFormattedMessage ( ) ) ; val message = new SimpleMessage ( messageModified ) ; val newLogEventBuilder = Log4jLogEvent . newBuilder ( ) . setLevel ( logEvent . getLevel ( ) ) . setLoggerName ( logEvent . getLoggerName ( ) ) . setLoggerFqcn ( logEvent . getLoggerFqcn ( ) ) . setContextData ( new SortedArrayStringMap ( logEvent . getContextData ( ) ) ) . setContextStack ( logEvent . getContextStack ( ) ) . setEndOfBatch ( logEvent . isEndOfBatch ( ) ) . setIncludeLocation ( logEvent . isIncludeLocation ( ) ) . setMarker ( logEvent . getMarker ( ) ) . setMessage ( message ) . setNanoTime ( logEvent . getNanoTime ( ) ) . setThreadName ( logEvent . getThreadName ( ) ) . setThrownProxy ( logEvent . getThrownProxy ( ) ) . setThrown ( logEvent . getThrown ( ) ) . setTimeMillis ( logEvent . getTimeMillis ( ) ) ; try { newLogEventBuilder . setSource ( logEvent . getSource ( ) ) ; } catch ( final Exception e ) { newLogEventBuilder . setSource ( null ) ; } return newLogEventBuilder . build ( ) ; |
public class EsaResourceImpl { /** * Looks in the underlying asset to see if there is a requireFeatureWithTolerates entry for
* the supplied feature , and if there is , removes it . */
private void removeRequireFeatureWithToleratesIfExists ( String feature ) { } } | Collection < RequireFeatureWithTolerates > rfwt = _asset . getWlpInformation ( ) . getRequireFeatureWithTolerates ( ) ; if ( rfwt != null ) { for ( RequireFeatureWithTolerates toCheck : rfwt ) { if ( toCheck . getFeature ( ) . equals ( feature ) ) { rfwt . remove ( toCheck ) ; return ; } } } |
public class DisassociatePhoneNumberFromUserRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( DisassociatePhoneNumberFromUserRequest disassociatePhoneNumberFromUserRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( disassociatePhoneNumberFromUserRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( disassociatePhoneNumberFromUserRequest . getAccountId ( ) , ACCOUNTID_BINDING ) ; protocolMarshaller . marshall ( disassociatePhoneNumberFromUserRequest . getUserId ( ) , USERID_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class HtmlLabelUtil { /** * Returns < code > true < / code > for a label in the given list of labels with the value of the < code > for < / code >
* attribute equal to the given id .
* @ param labels list of all labels
* @ param id id for which a label should exist
* @ return < code > true < / code > if a label referencing the given id is found , otherwise < code > false < / code > */
public static boolean containsLabelForId ( List < HtmlLabel > labels , String id ) { } } | for ( HtmlLabel label : labels ) { if ( label . getForAttribute ( ) != null && label . getForAttribute ( ) . equals ( id ) ) { return true ; } } return false ; |
public class AwsSecurityFindingFilters { /** * The type of a threat intel indicator .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setThreatIntelIndicatorType ( java . util . Collection ) } or
* { @ link # withThreatIntelIndicatorType ( java . util . Collection ) } if you want to override the existing values .
* @ param threatIntelIndicatorType
* The type of a threat intel indicator .
* @ return Returns a reference to this object so that method calls can be chained together . */
public AwsSecurityFindingFilters withThreatIntelIndicatorType ( StringFilter ... threatIntelIndicatorType ) { } } | if ( this . threatIntelIndicatorType == null ) { setThreatIntelIndicatorType ( new java . util . ArrayList < StringFilter > ( threatIntelIndicatorType . length ) ) ; } for ( StringFilter ele : threatIntelIndicatorType ) { this . threatIntelIndicatorType . add ( ele ) ; } return this ; |
public class FeatureCache { /** * Resize the cache
* @ param maxSize
* max size */
public void resize ( int maxSize ) { } } | this . maxSize = maxSize ; if ( cache . size ( ) > maxSize ) { int count = 0 ; Iterator < Long > rowIds = cache . keySet ( ) . iterator ( ) ; while ( rowIds . hasNext ( ) ) { rowIds . next ( ) ; if ( ++ count > maxSize ) { rowIds . remove ( ) ; } } } |
public class Directory { /** * Returns the specified tag ' s value as an int , if possible . Every attempt to represent the tag ' s value as an int
* is taken . Here is a list of the action taken depending upon the tag ' s original type :
* < ul >
* < li > int - Return unchanged .
* < li > Number - Return an int value ( real numbers are truncated ) .
* < li > Rational - Truncate any fractional part and returns remaining int .
* < li > String - Attempt to parse string as an int . If this fails , convert the char [ ] to an int ( using shifts and OR ) .
* < li > Rational [ ] - Return int value of first item in array .
* < li > byte [ ] - Return int value of first item in array .
* < li > int [ ] - Return int value of first item in array .
* < / ul >
* @ throws MetadataException if no value exists for tagType or if it cannot be converted to an int . */
public int getInt ( int tagType ) throws MetadataException { } } | Integer integer = getInteger ( tagType ) ; if ( integer != null ) return integer ; Object o = getObject ( tagType ) ; if ( o == null ) throw new MetadataException ( "Tag '" + getTagName ( tagType ) + "' has not been set -- check using containsTag() first" ) ; throw new MetadataException ( "Tag '" + tagType + "' cannot be converted to int. It is of type '" + o . getClass ( ) + "'." ) ; |
public class CmsContainerpageService { /** * Helper method for converting a CmsContainer to a CmsContainerBean when saving a container page . < p >
* @ param container the container for which the CmsContainerBean should be created
* @ param containerpageRootPath the container page root path
* @ return a container bean
* @ throws CmsException in case generating the container data fails */
private CmsContainerBean getContainerBeanToSave ( CmsContainer container , String containerpageRootPath ) throws CmsException { } } | CmsObject cms = getCmsObject ( ) ; List < CmsContainerElementBean > elements = new ArrayList < CmsContainerElementBean > ( ) ; for ( CmsContainerElement elementData : container . getElements ( ) ) { if ( ! elementData . isNew ( ) ) { CmsContainerElementBean newElementBean = getContainerElementBeanToSave ( cms , containerpageRootPath , container , elementData ) ; if ( newElementBean != null ) { elements . add ( newElementBean ) ; } } } CmsContainerBean result = new CmsContainerBean ( container . getName ( ) , container . getType ( ) , container . getParentInstanceId ( ) , container . isRootContainer ( ) , elements ) ; return result ; |
public class MediaType { /** * Creates a { @ code MediaType } by parsing the specified string . The string must look like a standard MIME type
* string , for example " text / html " or " application / xml " . There can optionally be parameters present , for example
* " text / html ; encoding = UTF - 8 " or " application / xml ; q = 0.8 " .
* @ param text A string representing a media type .
* @ return A { @ code MediaType } object .
* @ throws java . lang . IllegalArgumentException If the string is not a valid media type string . */
public static MediaType fromString ( String text ) { } } | Matcher matcher = MEDIA_TYPE_PATTERN . matcher ( text ) ; if ( ! matcher . matches ( ) ) { throw new IllegalArgumentException ( "Invalid media type string: " + text ) ; } String type ; String subType ; if ( matcher . group ( GROUP_INDEX ) != null ) { type = matcher . group ( GROUP_INDEX ) ; subType = matcher . group ( GROUP_INDEX ) ; } else { type = matcher . group ( TYPE_INDEX ) ; subType = matcher . group ( SUBTYPE_INDEX ) ; } Map < String , String > parametersBuilder = new HashMap < > ( ) ; Matcher parametersMatcher = PARAMETER_PATTERN . matcher ( matcher . group ( GROUP_MATCHER_INDEX ) ) ; while ( parametersMatcher . find ( ) ) { parametersBuilder . put ( parametersMatcher . group ( 1 ) , parametersMatcher . group ( 2 ) ) ; } return new MediaType ( type , subType , Collections . unmodifiableMap ( parametersBuilder ) ) ; |
public class BaseFactoryImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public Charset createCharsetFromString ( EDataType eDataType , String initialValue ) { } } | return ( Charset ) super . createFromString ( eDataType , initialValue ) ; |
public class xen_websensevpx_image { /** * < pre >
* Use this operation to get websense XVA file .
* < / pre > */
public static xen_websensevpx_image [ ] get ( nitro_service client ) throws Exception { } } | xen_websensevpx_image resource = new xen_websensevpx_image ( ) ; resource . validate ( "get" ) ; return ( xen_websensevpx_image [ ] ) resource . get_resources ( client ) ; |
public class GeneralOperations { /** * It closes a < code > Statement < / code > if not < code > null < / code > . */
public static void closeStatement ( Statement statement ) throws InternalErrorException { } } | if ( statement != null ) { try { statement . close ( ) ; } catch ( SQLException e ) { throw new InternalErrorException ( e ) ; } } |
public class Type1Font { /** * Gets the font parameter identified by < CODE > key < / CODE > . Valid values
* for < CODE > key < / CODE > are < CODE > ASCENT < / CODE > , < CODE > CAPHEIGHT < / CODE > , < CODE > DESCENT < / CODE > ,
* < CODE > ITALICANGLE < / CODE > , < CODE > BBOXLLX < / CODE > , < CODE > BBOXLLY < / CODE > , < CODE > BBOXURX < / CODE >
* and < CODE > BBOXURY < / CODE > .
* @ param key the parameter to be extracted
* @ param fontSize the font size in points
* @ return the parameter in points */
public float getFontDescriptor ( int key , float fontSize ) { } } | switch ( key ) { case AWT_ASCENT : case ASCENT : return Ascender * fontSize / 1000 ; case CAPHEIGHT : return CapHeight * fontSize / 1000 ; case AWT_DESCENT : case DESCENT : return Descender * fontSize / 1000 ; case ITALICANGLE : return ItalicAngle ; case BBOXLLX : return llx * fontSize / 1000 ; case BBOXLLY : return lly * fontSize / 1000 ; case BBOXURX : return urx * fontSize / 1000 ; case BBOXURY : return ury * fontSize / 1000 ; case AWT_LEADING : return 0 ; case AWT_MAXADVANCE : return ( urx - llx ) * fontSize / 1000 ; case UNDERLINE_POSITION : return UnderlinePosition * fontSize / 1000 ; case UNDERLINE_THICKNESS : return UnderlineThickness * fontSize / 1000 ; } return 0 ; |
public class BoxSession { /** * Logout the currently authenticated user .
* @ return a task that can be used to block until the user associated with this session has been logged out . */
public BoxFutureTask < BoxSession > logout ( ) { } } | final BoxFutureTask < BoxSession > task = ( new BoxSessionLogoutRequest ( this ) ) . toTask ( ) ; new Thread ( ) { @ Override public void run ( ) { task . run ( ) ; } } . start ( ) ; return task ; |
public class WTimeoutWarningRenderer { /** * Paints the given WTimeoutWarning if the component ' s timeout period is greater than 0.
* @ param component the WTimeoutWarning to paint .
* @ param renderContext the RenderContext to paint to . */
@ Override public void doRender ( final WComponent component , final WebXmlRenderContext renderContext ) { } } | WTimeoutWarning warning = ( WTimeoutWarning ) component ; XmlStringBuilder xml = renderContext . getWriter ( ) ; final int timoutPeriod = warning . getTimeoutPeriod ( ) ; if ( timoutPeriod > 0 ) { xml . appendTagOpen ( "ui:session" ) ; xml . appendAttribute ( "timeout" , String . valueOf ( timoutPeriod ) ) ; int warningPeriod = warning . getWarningPeriod ( ) ; xml . appendOptionalAttribute ( "warn" , warningPeriod > 0 , warningPeriod ) ; xml . appendEnd ( ) ; } |
public class H2Headers { /** * Decode header bytes without validating against connection settings
* @ param WsByteBuffer
* @ param H2HeaderTable
* @ return H2HeaderField
* @ throws CompressionException */
public static H2HeaderField decodeHeader ( WsByteBuffer buffer , H2HeaderTable table ) throws CompressionException { } } | return decodeHeader ( buffer , table , true , false , null ) ; |
public class NumberInRange { /** * Checks if a given number is in the range of a short .
* @ param number
* a number which should be in the range of a short ( positive or negative )
* @ see java . lang . Short # MIN _ VALUE
* @ see java . lang . Short # MAX _ VALUE
* @ return number as a short ( rounding might occur ) */
@ ArgumentsChecked @ Throws ( IllegalNullArgumentException . class ) public static short checkShort ( @ Nonnull final Number number ) { } } | Check . notNull ( number , "number" ) ; if ( ! isInShortRange ( number ) ) { throw new IllegalNumberRangeException ( number . toString ( ) , SHORT_MIN , SHORT_MAX ) ; } return number . shortValue ( ) ; |
public class DescribeSpotFleetRequestsResult { /** * Information about the configuration of your Spot Fleet .
* @ param spotFleetRequestConfigs
* Information about the configuration of your Spot Fleet . */
public void setSpotFleetRequestConfigs ( java . util . Collection < SpotFleetRequestConfig > spotFleetRequestConfigs ) { } } | if ( spotFleetRequestConfigs == null ) { this . spotFleetRequestConfigs = null ; return ; } this . spotFleetRequestConfigs = new com . amazonaws . internal . SdkInternalList < SpotFleetRequestConfig > ( spotFleetRequestConfigs ) ; |
public class AWSBudgetsClient { /** * Describes a budget .
* @ param describeBudgetRequest
* Request of DescribeBudget
* @ return Result of the DescribeBudget operation returned by the service .
* @ throws InternalErrorException
* An error on the server occurred during the processing of your request . Try again later .
* @ throws InvalidParameterException
* An error on the client occurred . Typically , the cause is an invalid input value .
* @ throws NotFoundException
* We can ’ t locate the resource that you specified .
* @ sample AWSBudgets . DescribeBudget */
@ Override public DescribeBudgetResult describeBudget ( DescribeBudgetRequest request ) { } } | request = beforeClientExecution ( request ) ; return executeDescribeBudget ( request ) ; |
public class DurableSubscriptionItemStream { /** * Returns the subState .
* @ return Object */
public ConsumerDispatcherState getConsumerDispatcherState ( ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "getConsumerDispatcherState" ) ; SibTr . exit ( tc , "getConsumerDispatcherState" , _subState ) ; } return _subState ; |
public class BatchEventProcessor { /** * Notifies the EventHandler when this processor is starting up */
private void notifyStart ( ) { } } | if ( eventHandler instanceof LifecycleAware ) { try { ( ( LifecycleAware ) eventHandler ) . onStart ( ) ; } catch ( final Throwable ex ) { exceptionHandler . handleOnStartException ( ex ) ; } } |
public class ResourceHeaderScreen { /** * SetupSFields Method . */
public void setupSFields ( ) { } } | Converter converter = new FieldLengthConverter ( this . getRecord ( Resource . RESOURCE_FILE ) . getField ( Resource . CODE ) , 30 ) ; new SEditText ( this . getNextLocation ( ScreenConstants . NEXT_LOGICAL , ScreenConstants . ANCHOR_DEFAULT ) , this , converter , ScreenConstants . DEFAULT_DISPLAY ) ; this . getRecord ( ResourceScreenRecord . RESOURCE_SCREEN_RECORD_FILE ) . getField ( ResourceScreenRecord . LANGUAGE ) . setupDefaultView ( this . getNextLocation ( ScreenConstants . RIGHT_WITH_DESC , ScreenConstants . ANCHOR_DEFAULT ) , this , ScreenConstants . DEFAULT_DISPLAY ) ; this . getRecord ( ResourceScreenRecord . RESOURCE_SCREEN_RECORD_FILE ) . getField ( ResourceScreenRecord . LOCALE ) . setupDefaultView ( this . getNextLocation ( ScreenConstants . RIGHT_WITH_DESC , ScreenConstants . ANCHOR_DEFAULT ) , this , ScreenConstants . DEFAULT_DISPLAY ) ; |
public class WPartialDateField { /** * Override WInput ' s validateComponent to perform further validation on the date . A partial date is invalid if there
* was text submitted but no date components were parsed .
* @ param diags the list into which any validation diagnostics are added . */
@ Override protected void validateComponent ( final List < Diagnostic > diags ) { } } | if ( isValidDate ( ) ) { super . validateComponent ( diags ) ; } else { diags . add ( createErrorDiagnostic ( getComponentModel ( ) . errorMessage , this ) ) ; } |
public class ByteBuffer { /** * Appends the subarray of the < CODE > byte < / CODE > array . The buffer will grow by
* < CODE > len < / CODE > bytes .
* @ param b the array to be appended
* @ param off the offset to the start of the array
* @ param len the length of bytes to append
* @ return a reference to this < CODE > ByteBuffer < / CODE > object */
public ByteBuffer append ( byte b [ ] , int off , int len ) { } } | if ( ( off < 0 ) || ( off > b . length ) || ( len < 0 ) || ( ( off + len ) > b . length ) || ( ( off + len ) < 0 ) || len == 0 ) return this ; int newcount = count + len ; if ( newcount > buf . length ) { byte newbuf [ ] = new byte [ Math . max ( buf . length << 1 , newcount ) ] ; System . arraycopy ( buf , 0 , newbuf , 0 , count ) ; buf = newbuf ; } System . arraycopy ( b , off , buf , count , len ) ; count = newcount ; return this ; |
public class RethinkDBQuery { /** * Builds the entity from cursor .
* @ param entity
* the entity
* @ param obj
* the obj
* @ param entityType
* the entity type
* @ return the object */
private void buildEntityFromCursor ( Object entity , HashMap obj , EntityType entityType ) { } } | Iterator < Attribute > iter = entityType . getAttributes ( ) . iterator ( ) ; while ( iter . hasNext ( ) ) { Attribute attribute = iter . next ( ) ; Field field = ( Field ) attribute . getJavaMember ( ) ; if ( field . isAnnotationPresent ( Id . class ) ) { PropertyAccessorHelper . set ( entity , field , obj . get ( ID ) ) ; } else { PropertyAccessorHelper . set ( entity , field , obj . get ( ( ( AbstractAttribute ) attribute ) . getJPAColumnName ( ) ) ) ; } } |
public class Problem { /** * Shortcut method for reducing law of Demeters issues .
* @ param index Index of the problem input to retrieve .
* @ return Problem input instance required .
* @ throws ArrayIndexOutOfBoundsException If the given index is not valid . */
public ProblemInput getProblemInput ( final int index ) { } } | final List < ProblemInput > inputs = getProblemInputs ( ) ; if ( index < 0 || inputs . size ( ) <= index ) { throw new ArrayIndexOutOfBoundsException ( ) ; } return inputs . get ( index ) ; |
public class SetIdentityPoolRolesRequest { /** * The map of roles associated with this pool . For a given role , the key will be either " authenticated " or
* " unauthenticated " and the value will be the Role ARN .
* @ param roles
* The map of roles associated with this pool . For a given role , the key will be either " authenticated " or
* " unauthenticated " and the value will be the Role ARN .
* @ return Returns a reference to this object so that method calls can be chained together . */
public SetIdentityPoolRolesRequest withRoles ( java . util . Map < String , String > roles ) { } } | setRoles ( roles ) ; return this ; |
public class BitcoindeAdapters { /** * Adapt a org . knowm . xchange . bitcoinde . dto . marketdata . BitcoindeOrderBook object to an OrderBook
* object .
* @ param bitcoindeOrderbookWrapper the exchange specific OrderBook object
* @ param currencyPair ( e . g . BTC / USD )
* @ return The XChange OrderBook */
public static OrderBook adaptOrderBook ( BitcoindeOrderbookWrapper bitcoindeOrderbookWrapper , CurrencyPair currencyPair ) { } } | // System . out . println ( " bitcoindeOrderbookWrapper = " +
// bitcoindeOrderbookWrapper ) ;
// System . out . println ( " credits = " + bitcoindeOrderbookWrapper . getCredits ( ) ) ;
List < LimitOrder > asks = createOrders ( currencyPair , Order . OrderType . ASK , bitcoindeOrderbookWrapper . getBitcoindeOrders ( ) . getAsks ( ) ) ; List < LimitOrder > bids = createOrders ( currencyPair , Order . OrderType . BID , bitcoindeOrderbookWrapper . getBitcoindeOrders ( ) . getBids ( ) ) ; Collections . sort ( bids , BID_COMPARATOR ) ; Collections . sort ( asks , ASK_COMPARATOR ) ; return new OrderBook ( null , asks , bids ) ; |
public class Cache2kBuilder { /** * Wraps to factory but passes on nulls . */
private static < T > CustomizationReferenceSupplier < T > wrapCustomizationInstance ( T obj ) { } } | if ( obj == null ) { return null ; } return new CustomizationReferenceSupplier < T > ( obj ) ; |
public class AWSRoboMakerClient { /** * Registers a robot with a fleet .
* @ param registerRobotRequest
* @ return Result of the RegisterRobot operation returned by the service .
* @ throws InvalidParameterException
* A parameter specified in a request is not valid , is unsupported , or cannot be used . The returned message
* provides an explanation of the error value .
* @ throws InternalServerException
* AWS RoboMaker experienced a service issue . Try your call again .
* @ throws ThrottlingException
* AWS RoboMaker is temporarily unable to process the request . Try your call again .
* @ throws LimitExceededException
* The requested resource exceeds the maximum number allowed , or the number of concurrent stream requests
* exceeds the maximum number allowed .
* @ throws ResourceNotFoundException
* The specified resource does not exist .
* @ sample AWSRoboMaker . RegisterRobot
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / robomaker - 2018-06-29 / RegisterRobot " target = " _ top " > AWS API
* Documentation < / a > */
@ Override public RegisterRobotResult registerRobot ( RegisterRobotRequest request ) { } } | request = beforeClientExecution ( request ) ; return executeRegisterRobot ( request ) ; |
public class YggdrasilAuthenticator { /** * Creates a < code > YggdrasilAuthenticator < / code > and initializes it with a
* token .
* @ param clientToken the client token
* @ param accessToken the access token
* @ return a YggdrasilAuthenticator
* @ throws AuthenticationException If an exception occurs during the
* authentication */
public static YggdrasilAuthenticator token ( String clientToken , String accessToken ) throws AuthenticationException { } } | return token ( clientToken , accessToken , YggdrasilAuthenticationServiceBuilder . buildDefault ( ) ) ; |
public class CmsSearchFieldConfiguration { /** * Extends the given document by a field that contains the resource type name . < p >
* @ param document the document to extend
* @ param cms the OpenCms context used for building the search index
* @ param resource the resource that is indexed
* @ param extractionResult the plain text extraction result from the resource
* @ param properties the list of all properties directly attached to the resource ( not searched )
* @ param propertiesSearched the list of all searched properties of the resource
* @ return the document extended by a field that contains the resource type name
* @ throws CmsLoaderException in case of errors identifying the resource type name */
protected I_CmsSearchDocument appendType ( I_CmsSearchDocument document , CmsObject cms , CmsResource resource , I_CmsExtractionResult extractionResult , List < CmsProperty > properties , List < CmsProperty > propertiesSearched ) throws CmsLoaderException { } } | // add the resource type to the document
I_CmsResourceType type = OpenCms . getResourceManager ( ) . getResourceType ( resource . getTypeId ( ) ) ; String typeName = "VFS" ; if ( type != null ) { typeName = type . getTypeName ( ) ; } document . addTypeField ( typeName ) ; // add the file name suffix to the document
String resName = CmsResource . getName ( resource . getRootPath ( ) ) ; int index = resName . lastIndexOf ( '.' ) ; if ( ( index != - 1 ) && ( resName . length ( ) > index ) ) { document . addSuffixField ( resName . substring ( index + 1 ) ) ; } return document ; |
public class AmazonCognitoSyncClient { /** * Gets a list of identity pools registered with Cognito .
* ListIdentityPoolUsage can only be called with developer credentials . You cannot make this API call with the
* temporary user credentials provided by Cognito Identity .
* @ param listIdentityPoolUsageRequest
* A request for usage information on an identity pool .
* @ return Result of the ListIdentityPoolUsage operation returned by the service .
* @ throws NotAuthorizedException
* Thrown when a user is not authorized to access the requested resource .
* @ throws InvalidParameterException
* Thrown when a request parameter does not comply with the associated constraints .
* @ throws InternalErrorException
* Indicates an internal service error .
* @ throws TooManyRequestsException
* Thrown if the request is throttled .
* @ sample AmazonCognitoSync . ListIdentityPoolUsage
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / cognito - sync - 2014-06-30 / ListIdentityPoolUsage "
* target = " _ top " > AWS API Documentation < / a > */
@ Override public ListIdentityPoolUsageResult listIdentityPoolUsage ( ListIdentityPoolUsageRequest request ) { } } | request = beforeClientExecution ( request ) ; return executeListIdentityPoolUsage ( request ) ; |
public class JobOperatorImpl { /** * { @ inheritDoc } */
@ Override public List < StepExecution > getStepExecutions ( long jobExecutionId ) throws NoSuchJobExecutionException , JobSecurityException { } } | if ( authService != null ) { authService . authorizedExecutionRead ( jobExecutionId ) ; } JobExecutionEntity jobEx = getPersistenceManagerService ( ) . getJobExecution ( jobExecutionId ) ; List < StepExecution > stepExecutions = new ArrayList < StepExecution > ( ) ; stepExecutions . addAll ( getPersistenceManagerService ( ) . getStepExecutionsTopLevelFromJobExecutionId ( jobExecutionId ) ) ; return stepExecutions ; |
public class DAGraph { /** * Prepares this DAG for node enumeration using getNext method , each call to getNext returns next node
* in the DAG with no dependencies . */
public void prepareForEnumeration ( ) { } } | if ( isPreparer ( ) ) { for ( NodeT node : nodeTable . values ( ) ) { // Prepare each node for traversal
node . initialize ( ) ; if ( ! this . isRootNode ( node ) ) { // Mark other sub - DAGs as non - preparer
node . setPreparer ( false ) ; } } initializeDependentKeys ( ) ; initializeQueue ( ) ; } |
public class MMCRGImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public Object eGet ( int featureID , boolean resolve , boolean coreType ) { } } | switch ( featureID ) { case AfplibPackage . MMCRG__KEY : return getKey ( ) ; case AfplibPackage . MMCRG__VALUE : return getValue ( ) ; } return super . eGet ( featureID , resolve , coreType ) ; |
public class JOGLTypeConversions { /** * Convert pixel types from GL constants .
* @ param e The GL constant .
* @ return The value . */
public static JCGLPixelFormat pixelTypeFromGL ( final int e ) { } } | switch ( e ) { case GL . GL_UNSIGNED_INT_24_8 : return JCGLPixelFormat . PIXEL_PACKED_UNSIGNED_INT_24_8 ; case GL . GL_UNSIGNED_SHORT_5_6_5 : return JCGLPixelFormat . PIXEL_PACKED_UNSIGNED_SHORT_565 ; case GL . GL_UNSIGNED_SHORT_5_5_5_1 : return JCGLPixelFormat . PIXEL_PACKED_UNSIGNED_SHORT_5551 ; case GL . GL_UNSIGNED_SHORT_4_4_4_4 : return JCGLPixelFormat . PIXEL_PACKED_UNSIGNED_SHORT_4444 ; case GL2ES2 . GL_UNSIGNED_INT_10_10_10_2 : return JCGLPixelFormat . PIXEL_PACKED_UNSIGNED_INT_1010102 ; case GL . GL_UNSIGNED_SHORT : return JCGLPixelFormat . PIXEL_COMPONENT_UNSIGNED_SHORT ; case GL . GL_UNSIGNED_INT : return JCGLPixelFormat . PIXEL_COMPONENT_UNSIGNED_INT ; case GL . GL_UNSIGNED_BYTE : return JCGLPixelFormat . PIXEL_COMPONENT_UNSIGNED_BYTE ; case GL . GL_SHORT : return JCGLPixelFormat . PIXEL_COMPONENT_SHORT ; case GL2ES2 . GL_INT : return JCGLPixelFormat . PIXEL_COMPONENT_INT ; case GL . GL_FLOAT : return JCGLPixelFormat . PIXEL_COMPONENT_FLOAT ; case GL . GL_BYTE : return JCGLPixelFormat . PIXEL_COMPONENT_BYTE ; case GL . GL_HALF_FLOAT : return JCGLPixelFormat . PIXEL_COMPONENT_HALF_FLOAT ; default : throw new UnreachableCodeException ( ) ; } |
public class IoUtil { /** * Fill a region of a file with a given byte value .
* @ param fileChannel to fill
* @ param position at which to start writing .
* @ param length of the region to write .
* @ param value to fill the region with . */
public static void fill ( final FileChannel fileChannel , final long position , final long length , final byte value ) { } } | try { final byte [ ] filler ; if ( 0 != value ) { filler = new byte [ BLOCK_SIZE ] ; Arrays . fill ( filler , value ) ; } else { filler = FILLER ; } final ByteBuffer byteBuffer = ByteBuffer . wrap ( filler ) ; fileChannel . position ( position ) ; final int blocks = ( int ) ( length / BLOCK_SIZE ) ; final int blockRemainder = ( int ) ( length % BLOCK_SIZE ) ; for ( int i = 0 ; i < blocks ; i ++ ) { byteBuffer . position ( 0 ) ; fileChannel . write ( byteBuffer ) ; } if ( blockRemainder > 0 ) { byteBuffer . position ( 0 ) ; byteBuffer . limit ( blockRemainder ) ; fileChannel . write ( byteBuffer ) ; } } catch ( final IOException ex ) { LangUtil . rethrowUnchecked ( ex ) ; } |
public class GenericUrl { /** * Returns the URI for the given encoded URL .
* < p > Any { @ link URISyntaxException } is wrapped in an { @ link IllegalArgumentException } .
* @ param encodedUrl encoded URL
* @ return URI */
private static URI toURI ( String encodedUrl ) { } } | try { return new URI ( encodedUrl ) ; } catch ( URISyntaxException e ) { throw new IllegalArgumentException ( e ) ; } |
public class SocketConnectionController { /** * Gets Comapi access token .
* @ return Comapi access token . */
private String getToken ( ) { } } | SessionData session = dataMgr . getSessionDAO ( ) . session ( ) ; if ( session != null && session . getExpiresOn ( ) > System . currentTimeMillis ( ) ) { return session . getAccessToken ( ) ; } return null ; |
public class CreateSnapshotRequest { /** * This method is intended for internal use only . Returns the marshaled request configured with additional
* parameters to enable operation dry - run . */
@ Override public Request < CreateSnapshotRequest > getDryRunRequest ( ) { } } | Request < CreateSnapshotRequest > request = new CreateSnapshotRequestMarshaller ( ) . marshall ( this ) ; request . addParameter ( "DryRun" , Boolean . toString ( true ) ) ; return request ; |
public class CalendarRecordItem { /** * Change the data in this field .
* @ param iFieldSeq The field sequence to set .
* @ param objData The new data . */
public void updateTargetRecord ( ) { } } | try { BaseTable table = this . getMainRecord ( ) . getTable ( ) ; table . set ( table . getRecord ( ) ) ; table . seek ( null ) ; // Read this record
} catch ( Exception ex ) { ex . printStackTrace ( ) ; } |
public class GridTable { /** * Free the buffers in this grid table . */
public void removeAll ( ) { } } | if ( m_gridList != null ) m_gridList . removeAll ( ) ; if ( m_gridBuffer != null ) m_gridBuffer . removeAll ( ) ; if ( m_gridNew != null ) m_gridNew . removeAll ( ) ; m_iEndOfFileIndex = UNKNOWN_POSITION ; m_iPhysicalFilePosition = UNKNOWN_POSITION ; m_iLogicalFilePosition = UNKNOWN_POSITION ; |
public class XmlRuleSetWriter { /** * Converts { @ link Severity } to { @ link SeverityEnumType }
* @ param severity
* { @ link Severity } , can be < code > null < / code >
* @ param defaultSeverity
* default severity level , can be < code > null < / code >
* @ return { @ link SeverityEnumType } */
private SeverityEnumType getSeverity ( Severity severity , Severity defaultSeverity ) { } } | if ( severity == null ) { severity = defaultSeverity ; } return defaultSeverity != null ? SeverityEnumType . fromValue ( severity . getValue ( ) ) : null ; |
public class PullResponseItem { /** * Returns whether the status indicates a successful pull operation
* @ returns true : status indicates that pull was successful , false : status doesn ' t indicate a successful pull */
@ JsonIgnore public boolean isPullSuccessIndicated ( ) { } } | if ( isErrorIndicated ( ) || getStatus ( ) == null ) { return false ; } return ( getStatus ( ) . contains ( DOWNLOAD_COMPLETE ) || getStatus ( ) . contains ( IMAGE_UP_TO_DATE ) || getStatus ( ) . contains ( DOWNLOADED_NEWER_IMAGE ) || getStatus ( ) . contains ( LEGACY_REGISTRY ) || getStatus ( ) . contains ( DOWNLOADED_SWARM ) ) ; |
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link VectorproductType } { @ code > } } */
@ XmlElementDecl ( namespace = "http://www.w3.org/1998/Math/MathML" , name = "vectorproduct" ) public JAXBElement < VectorproductType > createVectorproduct ( VectorproductType value ) { } } | return new JAXBElement < VectorproductType > ( _Vectorproduct_QNAME , VectorproductType . class , null , value ) ; |
public class Breakpoint { /** * True , if the context passed is above nextctxt . That means that the current context must have an " outer " chain
* that reaches nextctxt .
* @ param current
* The context to test .
* @ return True if the current context is above nextctxt . */
private boolean isAboveNext ( Context current ) { } } | Context c = current . outer ; while ( c != null ) { if ( c == current . threadState . nextctxt ) { return true ; } c = c . outer ; } return false ; |
public class AbstractComponent { /** * { @ inheritDoc } */
@ Override public final void listen ( final WaveChecker waveChecker , final WaveType ... waveTypes ) { } } | // Call the other method with null method
listen ( waveChecker , null , waveTypes ) ; |
public class GrpcSslContexts { /** * Set ciphers and APN appropriate for gRPC . Precisely what is set is permitted to change , so if
* an application requires particular settings it should override the options set here . */
@ CanIgnoreReturnValue public static SslContextBuilder configure ( SslContextBuilder builder , Provider jdkProvider ) { } } | ApplicationProtocolConfig apc ; if ( SUN_PROVIDER_NAME . equals ( jdkProvider . getName ( ) ) ) { // Jetty ALPN / NPN only supports one of NPN or ALPN
if ( JettyTlsUtil . isJettyAlpnConfigured ( ) ) { apc = ALPN ; } else if ( JettyTlsUtil . isJettyNpnConfigured ( ) ) { apc = NPN ; } else if ( JettyTlsUtil . isJava9AlpnAvailable ( ) ) { apc = ALPN ; } else { throw new IllegalArgumentException ( SUN_PROVIDER_NAME + " selected, but Jetty NPN/ALPN unavailable" ) ; } } else if ( isConscrypt ( jdkProvider ) ) { apc = ALPN ; } else { throw new IllegalArgumentException ( "Unknown provider; can't configure: " + jdkProvider ) ; } return builder . sslProvider ( SslProvider . JDK ) . ciphers ( Http2SecurityUtil . CIPHERS , SupportedCipherSuiteFilter . INSTANCE ) . applicationProtocolConfig ( apc ) . sslContextProvider ( jdkProvider ) ; |
public class IntegerRadixSort { /** * Waits for all futures to complete , discarding any results .
* Note : This method is cloned from ConcurrentUtils . java to avoid package dependency . */
private static void waitForAll ( Iterable < ? extends Future < ? > > futures ) throws InterruptedException , ExecutionException { } } | for ( Future < ? > future : futures ) { future . get ( ) ; } |
public class DeweyNumber { /** * Creates a new dewey number from this such that a 0 is appended as new last digit .
* @ return A new dewey number which contains this as a prefix and has 0 as last digit */
public DeweyNumber addStage ( ) { } } | int [ ] newDeweyNumber = Arrays . copyOf ( deweyNumber , deweyNumber . length + 1 ) ; return new DeweyNumber ( newDeweyNumber ) ; |
public class RawData { /** * This methods sets the raw data values .
* @ param startTime the time the template was invoked .
* @ param stopTime the time the template completed .
* @ param contentLength the content length of the template result . */
public void set ( long startTime , long stopTime , long contentLength ) { } } | this . startTime = startTime ; this . endTime = stopTime ; this . contentLength = contentLength ; |
public class DefaultEurekaClientConfig { /** * ( non - Javadoc )
* @ see com . netflix . discovery . EurekaClientConfig # getDSServerDomain ( ) */
@ Override public String getEurekaServerDNSName ( ) { } } | return configInstance . getStringProperty ( namespace + EUREKA_SERVER_DNS_NAME_KEY , configInstance . getStringProperty ( namespace + EUREKA_SERVER_FALLBACK_DNS_NAME_KEY , null ) . get ( ) ) . get ( ) ; |
public class SqlResultSetMappingImpl { /** * If not already created , a new < code > column - result < / code > element will be created and returned .
* Otherwise , the first existing < code > column - result < / code > element will be returned .
* @ return the instance defined for the element < code > column - result < / code > */
public ColumnResult < SqlResultSetMapping < T > > getOrCreateColumnResult ( ) { } } | List < Node > nodeList = childNode . get ( "column-result" ) ; if ( nodeList != null && nodeList . size ( ) > 0 ) { return new ColumnResultImpl < SqlResultSetMapping < T > > ( this , "column-result" , childNode , nodeList . get ( 0 ) ) ; } return createColumnResult ( ) ; |
public class TokenStream { /** * Convert the value of this token to a long , return it , and move to the next token .
* @ return the current token ' s value , converted to an integer
* @ throws ParsingException if there is no such token to consume , or if the token cannot be converted to a long
* @ throws IllegalStateException if this method was called before the stream was { @ link # start ( ) started } */
public long consumeLong ( ) throws ParsingException , IllegalStateException { } } | if ( completed ) throwNoMoreContent ( ) ; // Get the value from the current token . . .
String value = currentToken ( ) . value ( ) ; try { long result = Long . parseLong ( value ) ; moveToNextToken ( ) ; return result ; } catch ( NumberFormatException e ) { Position position = currentToken ( ) . position ( ) ; String msg = CommonI18n . expectingValidLongAtLineAndColumn . text ( value , position . getLine ( ) , position . getColumn ( ) ) ; throw new ParsingException ( position , msg ) ; } |
public class DynamicURLClassLoader { /** * Merge the specified URLs to the current classpath . */
private static URL [ ] mergeClassPath ( URL ... urls ) { } } | final String path = System . getProperty ( "java.class.path" ) ; // $ NON - NLS - 1 $
final String separator = System . getProperty ( "path.separator" ) ; // $ NON - NLS - 1 $
final String [ ] parts = path . split ( Pattern . quote ( separator ) ) ; final URL [ ] u = new URL [ parts . length + urls . length ] ; for ( int i = 0 ; i < parts . length ; ++ i ) { try { u [ i ] = new File ( parts [ i ] ) . toURI ( ) . toURL ( ) ; } catch ( MalformedURLException exception ) { // ignore exception
} } System . arraycopy ( urls , 0 , u , parts . length , urls . length ) ; return u ; |
public class SipSessionImpl { /** * ( non - Javadoc )
* @ see javax . servlet . sip . SipSession # getLocalParty ( ) */
public Address getLocalParty ( ) { } } | if ( sessionCreatingDialog != null ) { return new AddressImpl ( sessionCreatingDialog . getLocalParty ( ) , null , ModifiableRule . NotModifiable ) ; } else if ( sessionCreatingTransactionRequest != null ) { if ( isSessionCreatingTransactionServer ) { ToHeader toHeader = ( ToHeader ) sessionCreatingTransactionRequest . getMessage ( ) . getHeader ( ToHeader . NAME ) ; return new AddressImpl ( toHeader . getAddress ( ) , AddressImpl . getParameters ( ( Parameters ) toHeader ) , ModifiableRule . NotModifiable ) ; } else { FromHeader fromHeader = ( FromHeader ) sessionCreatingTransactionRequest . getMessage ( ) . getHeader ( FromHeader . NAME ) ; return new AddressImpl ( fromHeader . getAddress ( ) , AddressImpl . getParameters ( ( Parameters ) fromHeader ) , ModifiableRule . NotModifiable ) ; } } else { return localParty ; } |
public class BootstrapContextImpl { /** * Returns a queue name or topic name ( if the specified type is String ) or a destination .
* @ param value destination id , if any , specified in the activation config .
* @ param type interface required for the destination setter method .
* @ param destinationType destination interface type ( according to the activation spec config properties )
* @ param destinationRef reference to the AdminObjectService for the destination that is configured on the activation spec . Otherwise null .
* @ param activationProps endpoint activation properties .
* @ param adminObjSvc admin object service from MEF , or null
* @ return queue name or topic name ( if the specified type is String ) or a destination .
* @ throws Exception if unable to get the destination . */
private Object getDestination ( Object value , Class < ? > type , String destinationType , AtomicServiceReference < AdminObjectService > destinationRef , @ Sensitive Map < String , Object > activationProps , AdminObjectService adminObjSvc ) throws Exception { } } | final String methodName = "getDestination" ; final boolean trace = TraceComponent . isAnyTracingEnabled ( ) ; if ( trace && tc . isEntryEnabled ( ) ) Tr . entry ( tc , methodName , value , type , destinationType , destinationRef , activationProps , adminObjSvc ) ; if ( trace && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Resource adapter id" , resourceAdapterID ) ; // Special case for WMQ : useJNDI = true activation config property
boolean isString = String . class . equals ( type ) ; String savedValue = isString ? ( String ) value : null ; boolean isJNDIName = resourceAdapterID . equals ( WMQJMS ) && isString && activationProps != null && Boolean . parseBoolean ( ( String ) activationProps . get ( "useJNDI" ) ) ; if ( trace && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "isString, isJNDIName, savedValue" , isString , isJNDIName , savedValue ) ; if ( adminObjSvc != null ) { if ( trace && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "use adminObjSvc found by MDB runtime" ) ; if ( isJNDIName ) { value = adminObjSvc . getJndiName ( ) ; if ( trace && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "useJNDI name was specified, using jndiName from the admin obj svc from mdb" , value ) ; } else { value = adminObjSvc . createResource ( null ) ; if ( trace && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "created admin object resource using admin object service from mdb runtime" , value ) ; } } else { ServiceReference < AdminObjectService > reference = destinationRef != null ? destinationRef . getReference ( ) : null ; if ( trace && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "reference" , reference ) ; if ( reference != null && ! "com.ibm.ws.jca.destination.unspecified" . equals ( reference . getProperty ( "component.name" ) ) && ( value == null || value . equals ( reference . getProperty ( ID ) ) // id takes precedence over jndiName
|| value . equals ( reference . getProperty ( ResourceFactory . JNDI_NAME ) ) ) ) { if ( isJNDIName ) { value = reference . getProperty ( ResourceFactory . JNDI_NAME ) ; if ( trace && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "return JNDI name" , value ) ; } else { value = destinationRef . getServiceWithException ( ) . createResource ( null ) ; if ( trace && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "return the created resource based on destinationRef" , value ) ; } } else if ( value != null && reference != null ) { if ( trace && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "use bundle context" ) ; BundleContext bundleContext = Utils . priv . getBundleContext ( componentContext ) ; String filter = FilterUtils . createPropertyFilter ( ID , ( String ) value ) ; Collection < ServiceReference < AdminObjectService > > refs = Utils . priv . getServiceReferences ( bundleContext , AdminObjectService . class , filter ) ; if ( refs . isEmpty ( ) ) { // See if it matches a jndiName if they didn ' t specify a valid id
filter = FilterUtils . createPropertyFilter ( AdminObjectService . JNDI_NAME , ( String ) value ) ; refs = Utils . priv . getServiceReferences ( bundleContext , AdminObjectService . class , filter ) ; if ( refs . isEmpty ( ) ) { if ( trace && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "An administered object for " + value + " was not found. This is ok if one was not provided." ) ; if ( trace && tc . isEntryEnabled ( ) ) Tr . exit ( tc , methodName ) ; return value ; } } reference = refs . iterator ( ) . next ( ) ; if ( isJNDIName ) { value = reference . getProperty ( AdminObjectService . JNDI_NAME ) ; } else { AdminObjectService destinationSvc = Utils . priv . getService ( bundleContext , reference ) ; value = destinationSvc . createResource ( null ) ; // Do not unget the service because we are not done using it .
// This is similar to a JNDI lookup of an admin object which does not unget the service upon returning it to the app .
} } } // Queue name or topic name
if ( trace && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "value, savedValue" , value , savedValue ) ; // Skip this processing for third party resource adapters
if ( resourceAdapterID . equals ( WASJMS ) || resourceAdapterID . equals ( WMQJMS ) ) { if ( trace && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Extra processing" ) ; if ( isString && ! isJNDIName ) { String activationPropsDestinationType = activationProps == null ? null : ( String ) activationProps . get ( "destinationType" ) ; destinationType = activationPropsDestinationType == null ? destinationType : activationPropsDestinationType ; if ( destinationType == null ) destinationType = ( String ) properties . get ( "destinationType" ) ; if ( destinationType != null ) value = getDestinationName ( destinationType , value ) ; } } else { if ( trace && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Extra processing skipped" ) ; if ( savedValue != null ) { value = savedValue ; if ( trace && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "value, savedValue" , value , savedValue ) ; } } if ( trace && tc . isEntryEnabled ( ) ) Tr . exit ( tc , methodName ) ; return value ; |
public class StreamingKMeans { /** * Generates a new instance of a { @ code StreamingClustering } based on the
* values used to construct this generator . */
public OnlineClustering < T > generate ( ) { } } | return new StreamingKMeansClustering < T > ( alpha , beta , gamma , numClusters , logNumPoints ) ; |
public class GeneralPurposeFFT_F64_1D { /** * radb2 : Real FFT ' s backward processing of factor 2 */
void radb2 ( final int ido , final int l1 , final double in [ ] , final int in_off , final double out [ ] , final int out_off , final int offset ) { } } | int i , ic ; double t1i , t1r , w1r , w1i ; int iw1 = offset ; int idx0 = l1 * ido ; for ( int k = 0 ; k < l1 ; k ++ ) { int idx1 = k * ido ; int idx2 = 2 * idx1 ; int idx3 = idx2 + ido ; int oidx1 = out_off + idx1 ; int iidx1 = in_off + idx2 ; int iidx2 = in_off + ido - 1 + idx3 ; double i1r = in [ iidx1 ] ; double i2r = in [ iidx2 ] ; out [ oidx1 ] = i1r + i2r ; out [ oidx1 + idx0 ] = i1r - i2r ; } if ( ido < 2 ) return ; if ( ido != 2 ) { for ( int k = 0 ; k < l1 ; ++ k ) { int idx1 = k * ido ; int idx2 = 2 * idx1 ; int idx3 = idx2 + ido ; int idx4 = idx1 + idx0 ; for ( i = 2 ; i < ido ; i += 2 ) { ic = ido - i ; int idx5 = i - 1 + iw1 ; int idx6 = out_off + i ; int idx7 = in_off + i ; int idx8 = in_off + ic ; w1r = wtable_r [ idx5 - 1 ] ; w1i = wtable_r [ idx5 ] ; int iidx1 = idx7 + idx2 ; int iidx2 = idx8 + idx3 ; int oidx1 = idx6 + idx1 ; int oidx2 = idx6 + idx4 ; t1r = in [ iidx1 - 1 ] - in [ iidx2 - 1 ] ; t1i = in [ iidx1 ] + in [ iidx2 ] ; double i1i = in [ iidx1 ] ; double i1r = in [ iidx1 - 1 ] ; double i2i = in [ iidx2 ] ; double i2r = in [ iidx2 - 1 ] ; out [ oidx1 - 1 ] = i1r + i2r ; out [ oidx1 ] = i1i - i2i ; out [ oidx2 - 1 ] = w1r * t1r - w1i * t1i ; out [ oidx2 ] = w1r * t1i + w1i * t1r ; } } if ( ido % 2 == 1 ) return ; } for ( int k = 0 ; k < l1 ; k ++ ) { int idx1 = k * ido ; int idx2 = 2 * idx1 ; int oidx1 = out_off + ido - 1 + idx1 ; int iidx1 = in_off + idx2 + ido ; out [ oidx1 ] = 2 * in [ iidx1 - 1 ] ; out [ oidx1 + idx0 ] = - 2 * in [ iidx1 ] ; } |
public class ContainerOverrides { /** * The type and amount of a resource to assign to a container . This value overrides the value set in the job
* definition . Currently , the only supported resource is < code > GPU < / code > .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setResourceRequirements ( java . util . Collection ) } or { @ link # withResourceRequirements ( java . util . Collection ) }
* if you want to override the existing values .
* @ param resourceRequirements
* The type and amount of a resource to assign to a container . This value overrides the value set in the job
* definition . Currently , the only supported resource is < code > GPU < / code > .
* @ return Returns a reference to this object so that method calls can be chained together . */
public ContainerOverrides withResourceRequirements ( ResourceRequirement ... resourceRequirements ) { } } | if ( this . resourceRequirements == null ) { setResourceRequirements ( new java . util . ArrayList < ResourceRequirement > ( resourceRequirements . length ) ) ; } for ( ResourceRequirement ele : resourceRequirements ) { this . resourceRequirements . add ( ele ) ; } return this ; |
public class MapTransitionExtractor { /** * Get the direct neighbor angle groups .
* @ param tile The current tile .
* @ return The 4 neighbor groups . */
private Collection < String > getNeighborGroups ( Tile tile ) { } } | final Collection < String > neighborGroups = new ArrayList < > ( TransitionType . BITS ) ; addNeighborGroup ( neighborGroups , tile , 1 , - 1 ) ; addNeighborGroup ( neighborGroups , tile , - 1 , - 1 ) ; addNeighborGroup ( neighborGroups , tile , 1 , 1 ) ; addNeighborGroup ( neighborGroups , tile , - 1 , 1 ) ; return neighborGroups ; |
public class Closeables2 { /** * Close all { @ link Closeable } objects provided in the { @ code closeables }
* iterator . When encountering an error when closing , write the message out
* to the provided { @ code log } .
* @ param closeables The closeables that we want to close .
* @ param log The log where we will write error messages when failing to
* close a closeable . */
public static void closeAll ( @ Nonnull final Iterable < ? extends Closeable > closeables , @ Nonnull final Logger log ) { } } | Throwable throwable = null ; for ( Closeable closeable : closeables ) { try { closeQuietly ( closeable , log ) ; } catch ( Throwable e ) { if ( throwable == null ) { throwable = e ; } else { log . error ( "Suppressing throwable thrown when closing " + closeable , e ) ; } } } if ( throwable != null ) { throw Throwables . propagate ( throwable ) ; } |
public class DiscoverInfo { /** * Returns true if this DiscoverInfo contains at least one Identity of the given category and type .
* @ param category the category to look for .
* @ param type the type to look for .
* @ return true if this DiscoverInfo contains a Identity of the given category and type . */
public boolean hasIdentity ( String category , String type ) { } } | String key = XmppStringUtils . generateKey ( category , type ) ; return identitiesSet . contains ( key ) ; |
public class DoubleIntPair { /** * Implementation of comparableSwapped interface , sorting by second then
* first .
* @ param other Object to compare to
* @ return comparison result */
public int compareSwappedTo ( DoubleIntPair other ) { } } | int fdiff = this . second - other . second ; if ( fdiff != 0 ) { return fdiff ; } return Double . compare ( this . second , other . second ) ; |
public class View { /** * Updates the View with the new XML definition .
* @ param source source of the Item ' s new definition .
* The source should be either a < code > StreamSource < / code > or < code > SAXSource < / code > , other sources
* may not be handled . */
public void updateByXml ( Source source ) throws IOException { } } | checkPermission ( CONFIGURE ) ; StringWriter out = new StringWriter ( ) ; try { // this allows us to use UTF - 8 for storing data ,
// plus it checks any well - formedness issue in the submitted
// data
XMLUtils . safeTransform ( source , new StreamResult ( out ) ) ; out . close ( ) ; } catch ( TransformerException | SAXException e ) { throw new IOException ( "Failed to persist configuration.xml" , e ) ; } // try to reflect the changes by reloading
try ( InputStream in = new BufferedInputStream ( new ByteArrayInputStream ( out . toString ( ) . getBytes ( StandardCharsets . UTF_8 ) ) ) ) { // Do not allow overwriting view name as it might collide with another
// view in same ViewGroup and might not satisfy Jenkins . checkGoodName .
String oldname = name ; ViewGroup oldOwner = owner ; // oddly , this field is not transient
Object o = Jenkins . XSTREAM2 . unmarshal ( XStream2 . getDefaultDriver ( ) . createReader ( in ) , this , null , true ) ; if ( ! o . getClass ( ) . equals ( getClass ( ) ) ) { // ensure that we ' ve got the same view type . extending this code to support updating
// to different view type requires destroying & creating a new view type
throw new IOException ( "Expecting view type: " + this . getClass ( ) + " but got: " + o . getClass ( ) + " instead." + "\nShould you needed to change to a new view type, you must first delete and then re-create " + "the view with the new view type." ) ; } name = oldname ; owner = oldOwner ; } catch ( StreamException | ConversionException | Error e ) { // mostly reflection errors
throw new IOException ( "Unable to read" , e ) ; } save ( ) ; |
public class FilenameUtils { /** * Remove illegal characters from String based on current OS .
* @ param input The input string
* @ param isPath
* @ return Cleaned - up string . */
public static String removeIllegalCharacters ( final String input , boolean isPath ) { } } | String ret = input ; switch ( Functions . getOs ( ) ) { case MAC : case LINUX : // On OSX the VFS take care of writing correct filenames to FAT filesystems . . .
// Just remove the default illegal characters
ret = removeStartingDots ( ret ) ; ret = ret . replaceAll ( isPath ? REGEXP_ILLEGAL_CHARACTERS_OTHERS_PATH : REGEXP_ILLEGAL_CHARACTERS_OTHERS , "_" ) ; break ; case WIN64 : case WIN32 : // we need to be more careful on Windows when using e . g . FAT32
// Therefore be more conservative by default and replace more characters .
ret = removeWindowsTrailingDots ( ret ) ; ret = ret . replaceAll ( isPath ? REGEXP_ILLEGAL_CHARACTERS_WINDOWS_PATH : REGEXP_ILLEGAL_CHARACTERS_WINDOWS , "_" ) ; break ; default : // we need to be more careful on Linux when using e . g . FAT32
// Therefore be more conservative by default and replace more characters .
ret = removeStartingDots ( ret ) ; ret = ret . replaceAll ( isPath ? REGEXP_ILLEGAL_CHARACTERS_WINDOWS_PATH : REGEXP_ILLEGAL_CHARACTERS_WINDOWS , "_" ) ; break ; } return ret ; |
public class ModelConsumerLoader { /** * add the class to consumers annotated with @ OnCommand
* @ param cclass
* @ param containerWrapper */
public void loadMehtodAnnotations ( Class cclass , ContainerWrapper containerWrapper ) { } } | try { for ( Method method : ClassUtil . getAllDecaredMethods ( cclass ) ) { if ( method . isAnnotationPresent ( OnCommand . class ) ) { addConsumerMethod ( method , cclass , containerWrapper ) ; } } } catch ( Exception e ) { e . printStackTrace ( ) ; } |
public class SequenceConverter { /** * method to get for all rna / dnas the nucleotide sequence form an
* HELM2Notation
* @ param helm2notation
* input HELM2Notation
* @ return rna / dna nucleotide sequences divided with white space
* @ throws NucleotideLoadingException if nucleotides can not be loaded
* @ throws NotationException if notation is not valid
* @ throws HELM2HandledException
* if HELM2 features are involved
* @ throws ChemistryException if chemistry engine can not be initialized */
public static String getNucleotideSequenceFromNotation ( HELM2Notation helm2notation ) throws NotationException , NucleotideLoadingException , HELM2HandledException , ChemistryException { } } | List < PolymerNotation > polymers = helm2notation . getListOfPolymers ( ) ; StringBuffer sb = new StringBuffer ( ) ; for ( PolymerNotation polymer : polymers ) { try { sb . append ( RNAUtils . getNucleotideSequence ( polymer ) + " " ) ; } catch ( RNAUtilsException e ) { e . printStackTrace ( ) ; throw new NotationException ( "Input complex notation contains non-nucleic acid polymer" ) ; } } sb . setLength ( sb . length ( ) - 1 ) ; return sb . toString ( ) ; |
public class SharedTreeNode { /** * Find the set of levels for a particular categorical column that can reach this node .
* A null return value implies the full set ( i . e . every level ) .
* @ param colIdToFind Column id to find
* @ return Set of levels */
private BitSet findInclusiveLevels ( int colIdToFind ) { } } | if ( parent == null ) { return null ; } if ( parent . getColId ( ) == colIdToFind ) { return inclusiveLevels ; } return parent . findInclusiveLevels ( colIdToFind ) ; |
public class TldHelperFunctions { /** * Computes the fractional area of intersection between the two regions .
* @ return number from 0 to 1 . higher means more intersection */
public double computeOverlap ( ImageRectangle a , ImageRectangle b ) { } } | if ( ! a . intersection ( b , work ) ) return 0 ; int areaI = work . area ( ) ; int bottom = a . area ( ) + b . area ( ) - areaI ; return areaI / ( double ) bottom ; |
public class ns_vserver_appflow_config { /** * Use this API to fetch filtered set of ns _ vserver _ appflow _ config resources .
* set the filter parameter values in filtervalue object . */
public static ns_vserver_appflow_config [ ] get_filtered ( nitro_service service , filtervalue [ ] filter ) throws Exception { } } | ns_vserver_appflow_config obj = new ns_vserver_appflow_config ( ) ; options option = new options ( ) ; option . set_filter ( filter ) ; ns_vserver_appflow_config [ ] response = ( ns_vserver_appflow_config [ ] ) obj . getfiltered ( service , option ) ; return response ; |
public class ContentLoader { /** * Sets the locator pointing to the content definition .
* @ param contentDef
* the url of the content definition . */
@ RuleSetup ( RequirementLevel . OPTIONAL ) public void setContentDefinition ( final URL contentDef ) { } } | assertStateBefore ( State . INITIALIZED ) ; this . contentDef = contentDef ; |
public class Formatter { /** * 将字符串转换成自定义格式的日期
* @ param datetime 日期格式的字符串
* @ param formatWay 自定义格式
* @ return 自定义格式的日期
* @ throws ParseException 异常 */
public static Date stringToCustomDateTime ( String datetime , String formatWay ) throws ParseException { } } | return stringToCustomDateTime ( new SimpleDateFormat ( formatWay ) , datetime ) ; |
public class ApplicationsImpl { /** * Gets information about the specified application .
* This operation returns only applications and versions that are available for use on compute nodes ; that is , that can be used in an application package reference . For administrator information about applications and versions that are not yet available to compute nodes , use the Azure portal or the Azure Resource Manager API .
* @ param applicationId The ID of the application .
* @ param applicationGetOptions Additional parameters for the operation
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ throws BatchErrorException thrown if the request is rejected by server
* @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
* @ return the ApplicationSummary object if successful . */
public ApplicationSummary get ( String applicationId , ApplicationGetOptions applicationGetOptions ) { } } | return getWithServiceResponseAsync ( applicationId , applicationGetOptions ) . toBlocking ( ) . single ( ) . body ( ) ; |
public class JobAgentsInner { /** * Gets a job agent .
* @ param resourceGroupName The name of the resource group that contains the resource . You can obtain this value from the Azure Resource Manager API or the portal .
* @ param serverName The name of the server .
* @ param jobAgentName The name of the job agent to be retrieved .
* @ 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 < JobAgentInner > getAsync ( String resourceGroupName , String serverName , String jobAgentName , final ServiceCallback < JobAgentInner > serviceCallback ) { } } | return ServiceFuture . fromResponse ( getWithServiceResponseAsync ( resourceGroupName , serverName , jobAgentName ) , serviceCallback ) ; |
public class FileLister { /** * extracts the job id from a Path
* @ param input Path
* @ return job id as string */
static String getJobIdFromPath ( Path aPath ) { } } | String fileName = aPath . getName ( ) ; JobFile jf = new JobFile ( fileName ) ; String jobId = jf . getJobid ( ) ; if ( jobId == null ) { throw new ProcessingException ( "job id is null for " + aPath . toUri ( ) ) ; } return jobId ; |
public class StorageImportDispatcher { /** * Imports the ( deferred ) contracts .
* @ throws StorageException */
private void importContracts ( ) throws StorageException { } } | for ( ContractBean contract : contracts ) { logger . info ( Messages . i18n . format ( "StorageImportDispatcher.ImportingClientContract" ) ) ; // $ NON - NLS - 1 $
String clientId = contract . getClient ( ) . getClient ( ) . getId ( ) ; String clientOrganizationId = contract . getClient ( ) . getClient ( ) . getOrganization ( ) . getId ( ) ; String clientVersion = contract . getClient ( ) . getVersion ( ) ; String apiId = contract . getApi ( ) . getApi ( ) . getId ( ) ; String apiOrganizationId = contract . getApi ( ) . getApi ( ) . getOrganization ( ) . getId ( ) ; String apiVersion = contract . getApi ( ) . getVersion ( ) ; String planId = contract . getPlan ( ) . getPlan ( ) . getId ( ) ; String planVersion = contract . getPlan ( ) . getVersion ( ) ; contract . setApi ( lookupApi ( apiOrganizationId , apiId , apiVersion ) ) ; contract . setPlan ( lookupPlan ( apiOrganizationId , planId , planVersion ) ) ; contract . setClient ( lookupClient ( clientOrganizationId , clientId , clientVersion ) ) ; contract . setId ( null ) ; storage . createContract ( contract ) ; } |
public class BaseWindowedBolt { /** * define a sliding event time window
* @ param size window size
* @ param slide slide size */
public BaseWindowedBolt < T > eventTimeWindow ( Time size , Time slide ) { } } | long s = size . toMilliseconds ( ) ; long l = slide . toMilliseconds ( ) ; ensurePositiveTime ( s , l ) ; ensureSizeGreaterThanSlide ( s , l ) ; setSizeAndSlide ( s , l ) ; this . windowAssigner = SlidingEventTimeWindows . of ( s , l ) ; return this ; |
public class XmlStringTools { /** * Reverse the escaping of special chars from a value of an attribute .
* @ param value
* the value to decode
* @ return the decoded value */
public static String decodeAttributeValue ( String value ) { } } | String _result = value . replaceAll ( PATTERN__ENTITY_QUOTE , VALUE__CHAR_QUOTE ) ; _result = _result . replaceAll ( PATTERN__ENTITY_AMPERSAND , VALUE__CHAR_AMPERSAND ) ; return _result ; |
public class IntentCompat { /** * Declare chooser activity in manifest :
* < pre >
* & lt ; activity android : name = " org . holoeverywhere . content . ChooserActivity "
* android : theme = " @ style / Holo . Theme . Dialog . Alert . Light "
* android : excludeFromRecents = " true " / & gt ;
* < / pre > */
@ SuppressLint ( "NewApi" ) public static Intent createChooser ( Intent target , CharSequence title ) { } } | if ( VERSION . SDK_INT >= VERSION_CODES . JELLY_BEAN ) { return Intent . createChooser ( target , title ) ; } Intent intent = new Intent ( ) ; intent . setClass ( Application . getLastInstance ( ) , ChooserActivity . class ) ; intent . putExtra ( Intent . EXTRA_INTENT , target ) ; if ( title != null ) { intent . putExtra ( Intent . EXTRA_TITLE , title ) ; } int permFlags = target . getFlags ( ) & ( Intent . FLAG_GRANT_READ_URI_PERMISSION | Intent . FLAG_GRANT_WRITE_URI_PERMISSION ) ; if ( permFlags != 0 && VERSION . SDK_INT >= VERSION_CODES . JELLY_BEAN ) { ClipData targetClipData = target . getClipData ( ) ; if ( targetClipData == null && target . getData ( ) != null ) { ClipData . Item item = new ClipData . Item ( target . getData ( ) ) ; String [ ] mimeTypes ; if ( target . getType ( ) != null ) { mimeTypes = new String [ ] { target . getType ( ) } ; } else { mimeTypes = new String [ ] { } ; } targetClipData = new ClipData ( null , mimeTypes , item ) ; } if ( targetClipData != null ) { intent . setClipData ( targetClipData ) ; intent . addFlags ( permFlags ) ; } } return intent ; |
public class ClientAppBase { /** * Connect to a set of servers in parallel . Each will retry until
* connection . This call will block until all have connected .
* @ param servers A comma separated list of servers using the hostname : port
* syntax ( where : port is optional ) .
* @ throws InterruptedException if anything bad happens with the threads . */
public static void connect ( Client client , String servers ) throws InterruptedException { } } | printLogStatic ( "CLIENT" , "Connecting to VoltDB..." ) ; String [ ] serverArray = servers . split ( "," ) ; final CountDownLatch connections = new CountDownLatch ( serverArray . length ) ; // use a new thread to connect to each server
for ( final String server : serverArray ) { new Thread ( new Runnable ( ) { @ Override public void run ( ) { connectToOneServerWithRetry ( client , server ) ; connections . countDown ( ) ; } } ) . start ( ) ; } // block until all have connected
connections . await ( ) ; |
public class DefaultGroovyMethods { /** * Returns the items from the array excluding the first item .
* < pre class = " groovyTestCase " >
* String [ ] strings = [ " a " , " b " , " c " ]
* def result = strings . tail ( )
* assert result . class . componentType = = String
* String [ ] expected = [ " b " , " c " ]
* assert result = = expected
* < / pre >
* @ param self an array
* @ return an array without its first element
* @ throws NoSuchElementException if the array is empty and you try to access the tail ( )
* @ since 1.7.3 */
@ SuppressWarnings ( "unchecked" ) public static < T > T [ ] tail ( T [ ] self ) { } } | if ( self . length == 0 ) { throw new NoSuchElementException ( "Cannot access tail() for an empty array" ) ; } T [ ] result = createSimilarArray ( self , self . length - 1 ) ; System . arraycopy ( self , 1 , result , 0 , self . length - 1 ) ; return result ; |
public class SREutils { /** * Change the data associated to the given container by the SRE .
* @ param < S > the type of the data .
* @ param type the type of the data .
* @ param container the container .
* @ param data the SRE - specific data .
* @ return the SRE - specific data that was associated to the container before associating data to it .
* @ since 0.6 */
public static < S > S setSreSpecificData ( SRESpecificDataContainer container , S data , Class < S > type ) { } } | assert container != null ; final S oldData = container . $getSreSpecificData ( type ) ; container . $setSreSpecificData ( data ) ; return oldData ; |
public class LocalSession { /** * Rollback pending put / get operations in this session
* @ param rollbackGets
* @ param deliveredMessageIDs
* @ throws JMSException */
public final void rollback ( boolean rollbackGets , List < String > deliveredMessageIDs ) throws JMSException { } } | if ( ! transacted ) throw new IllegalStateException ( "Session is not transacted" ) ; // [ JMS SPEC ]
externalAccessLock . readLock ( ) . lock ( ) ; try { checkNotClosed ( ) ; rollbackUpdates ( true , rollbackGets , deliveredMessageIDs ) ; } finally { externalAccessLock . readLock ( ) . unlock ( ) ; } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.