signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class AbstractWisdomWatcherMojo { /** * Searches if the given file has already being copied to its output directory and so may have been ' filtered ' .
* @ param input the input file
* @ return the ' filtered ' file if exists , { @ code null } otherwise */
public File getFilteredVersion ( File input ) { } } | File out = getOutputFile ( input ) ; if ( ! out . isFile ( ) ) { return null ; } return out ; |
public class Clients { /** * Setup the indirect client .
* @ param client the indirect client */
protected void updateIndirectClient ( final IndirectClient client ) { } } | if ( this . callbackUrl != null && client . getCallbackUrl ( ) == null ) { client . setCallbackUrl ( this . callbackUrl ) ; } if ( this . urlResolver != null && client . getUrlResolver ( ) == null ) { client . setUrlResolver ( this . urlResolver ) ; } if ( this . callbackUrlResolver != null && client . getCallbackUrlResolver ( ) == null ) { client . setCallbackUrlResolver ( this . callbackUrlResolver ) ; } if ( this . ajaxRequestResolver != null && client . getAjaxRequestResolver ( ) == null ) { client . setAjaxRequestResolver ( this . ajaxRequestResolver ) ; } |
public class JsFacade { /** * Drafts */
@ UsedByApp public void saveDraft ( JsPeer peer , String text ) { } } | messenger . saveDraft ( peer . convert ( ) , text ) ; |
public class DialogImpl { public void operationEnded ( InvokeImpl tcInvokeRequestImpl ) { } } | try { this . dialogLock . lock ( ) ; // this op died cause of timeout , TC - L - CANCEL !
int index = getIndexFromInvokeId ( tcInvokeRequestImpl . getInvokeId ( ) ) ; freeInvokeId ( tcInvokeRequestImpl . getInvokeId ( ) ) ; this . operationsSent [ index ] = null ; // lets call listener
// This is done actually with COmponentIndication . . . .
} finally { this . dialogLock . unlock ( ) ; } |
public class CreateTrainingSet { /** * save parameters */
private void saveParameters ( String outputDir ) throws IOException { } } | logger . info ( "save parameters" ) ; // save param
File paramFile = new File ( outputDir + "param" ) ; // File paramFile = File . createTempFile ( " param " , null ) ;
// paramFile . deleteOnExit ( ) ;
// parameter . store ( new FileOutputStream ( paramFile ) , " model parameters " ) ;
parameter . store ( new FileOutputStream ( paramFile ) , null ) ; // add the param to the model
// model . add ( paramFile , " param " ) ; |
public class PlacesSampleActivity { /** * Save the DraggablePanel state to restore it once the activity lifecycle be rebooted .
* @ param outState bundle to put the DraggableState information . */
@ Override protected void onSaveInstanceState ( Bundle outState ) { } } | super . onSaveInstanceState ( outState ) ; saveDraggableState ( outState ) ; saveLastPlaceLoadedPosition ( outState ) ; |
public class WikipediaInfo { /** * Building a mapping from categories to article sets .
* @ param pWiki The wikipedia object .
* @ param pNodes The category nodes that should be used to build the map .
* @ return A mapping from categories to article sets .
* @ throws WikiPageNotFoundException */
private Map < Integer , Set < Integer > > getCategoryArticleMap ( Wikipedia pWiki , Set < Integer > pNodes ) throws WikiPageNotFoundException { } } | Map < Integer , Set < Integer > > categoryArticleMap = new HashMap < Integer , Set < Integer > > ( ) ; int progress = 0 ; for ( int node : pNodes ) { progress ++ ; ApiUtilities . printProgressInfo ( progress , pNodes . size ( ) , 10 , ApiUtilities . ProgressInfoMode . TEXT , "Getting category-article map." ) ; Category cat = pWiki . getCategory ( node ) ; if ( cat != null ) { Set < Integer > pages = new HashSet < Integer > ( cat . __getPages ( ) ) ; categoryArticleMap . put ( node , pages ) ; } else { logger . info ( "{} is not a category." , node ) ; } } return categoryArticleMap ; |
public class ByteArrayReader { /** * Reads an MPINT using the first 32 bits as the length prefix
* @ return
* @ throws IOException */
public BigInteger readMPINT32 ( ) throws IOException { } } | int bits = ( int ) readInt ( ) ; byte [ ] raw = new byte [ ( bits + 7 ) / 8 + 1 ] ; raw [ 0 ] = 0 ; readFully ( raw , 1 , raw . length - 1 ) ; return new BigInteger ( raw ) ; |
public class CopyFileExtensions { /** * Copies the given source directory to the given destination directory with the option to set
* the lastModified time from the given destination file or directory .
* @ param source
* The source directory .
* @ param destination
* The destination directory .
* @ param lastModified
* Flag the tells if the attribute lastModified has to be set with the attribute from
* the destination file .
* @ return ' s true if the directory is copied , otherwise false .
* @ throws FileIsSecurityRestrictedException
* Is thrown if the source file is security restricted .
* @ throws IOException
* Is thrown if an error occurs by reading or writing .
* @ throws FileIsADirectoryException
* Is thrown if the destination file is a directory .
* @ throws FileIsNotADirectoryException
* Is thrown if the source file is not a directory .
* @ throws DirectoryAlreadyExistsException
* Is thrown if the directory all ready exists . */
public static boolean copyDirectory ( final File source , final File destination , final boolean lastModified ) throws FileIsSecurityRestrictedException , IOException , FileIsADirectoryException , FileIsNotADirectoryException , DirectoryAlreadyExistsException { } } | return copyDirectoryWithFileFilter ( source , destination , null , lastModified ) ; |
public class Bitstream { /** * Reads the exact number of bytes from the source
* input stream into a byte array .
* @ param bThe byte array to read the specified number
* of bytes into .
* @ param offsThe index in the array where the first byte
* read should be stored .
* @ param lenthe number of bytes to read .
* @ exception BitstreamException is thrown if the specified
* number of bytes could not be read from the stream . */
private int readFully ( byte [ ] b , int offs , int len ) throws BitstreamException { } } | int nRead = 0 ; try { while ( len > 0 ) { int bytesread = source . read ( b , offs , len ) ; if ( bytesread == - 1 ) { while ( len -- > 0 ) { b [ offs ++ ] = 0 ; } break ; // throw newBitstreamException ( UNEXPECTED _ EOF , new EOFException ( ) ) ;
} nRead = nRead + bytesread ; offs += bytesread ; len -= bytesread ; } } catch ( IOException ex ) { throw newBitstreamException ( STREAM_ERROR , ex ) ; } return nRead ; |
public class Viterbi { /** * Sum .
* @ param cols the cols
* @ return the double */
public double sum ( PairDblInt [ ] cols ) { } } | double res = 0.0 ; for ( int i = 0 ; i < numLabels ; i ++ ) { res += cols [ i ] . first ; } if ( res < 1 && res > - 1 ) { res = 1 ; } return res ; |
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public EClass getIfcDraughtingPreDefinedColour ( ) { } } | if ( ifcDraughtingPreDefinedColourEClass == null ) { ifcDraughtingPreDefinedColourEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 176 ) ; } return ifcDraughtingPreDefinedColourEClass ; |
public class OrderAwarePluginRegistry { /** * Creates a new { @ link OrderAwarePluginRegistry } using the given { @ link Comparator } for ordering contained
* { @ link Plugin } s .
* @ param comparator must not be { @ literal null } .
* @ return
* @ deprecated since 2.0 , for removal in 2.1 . Prefer { @ link PluginRegistry # of ( Comparator ) } . */
@ Deprecated public static < S , T extends Plugin < S > > OrderAwarePluginRegistry < T , S > create ( Comparator < ? super T > comparator ) { } } | Assert . notNull ( comparator , "Comparator must not be null!" ) ; return of ( Collections . emptyList ( ) , comparator ) ; |
public class ItemListBox { /** * Adds the supplied item to this list box at the end of the list , using the supplied label
* if not null . If no label is given , { @ link # toLabel ( Object ) } is used to calculate it . */
public void addItem ( T item , String label ) { } } | addItem ( label == null ? toLabel ( item ) : label ) ; _items . add ( item ) ; |
public class HpelHelper { /** * Using privileged security , retrieve the specified System property
* @ param propName a non - null , non - empty String that specifies the property . The caller must
* guarantee that this String is not null and not the empty String .
* @ return the < code > String < / code > value of the specified system property , or null . If there
* is no property associated with the specified key , null is returned . If a SecurityException
* is encounted while trying to retrieve the value , the exception is logged and absorbed and
* null is returned . */
public static String getSystemProperty ( String propName ) { } } | final String temp = propName ; try { String prop = AccessController . doPrivileged ( new PrivilegedAction < String > ( ) { @ Override public String run ( ) { return System . getProperty ( temp ) ; } } ) ; return prop ; } catch ( SecurityException se ) { // LOG THE EXCEPTION
return null ; } |
public class HttpChannelProvider { /** * { @ inheritDoc } */
@ Override public void stop ( BundleContext context ) throws Exception { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( this , tc , "Unregistering HTTPChannelProvider" ) ; } registration . unregister ( ) ; |
public class IniFile { /** * Gets the Section attribute of the IniFile object
* @ param strSection section name to get
* @ return The Section value
* @ throws IOException */
public Map getSection ( String strSection ) throws IOException { } } | Object o = sections . get ( strSection . toLowerCase ( ) ) ; if ( o == null ) throw new IOException ( "section with name " + strSection + " does not exist" ) ; return ( Map ) o ; |
public class XMLParser { /** * Read an element declaration . This contains a name and a content spec .
* < ! ELEMENT foo EMPTY > < ! ELEMENT foo ( bar ? , ( baz | quux ) ) > < ! ELEMENT foo
* ( # PCDATA | bar ) * >
* @ throws IOException Signals that an I / O exception has occurred .
* @ throws KriptonRuntimeException the kripton runtime exception */
private void readElementDeclaration ( ) throws IOException , KriptonRuntimeException { } } | read ( START_ELEMENT ) ; skip ( ) ; readName ( ) ; readContentSpec ( ) ; skip ( ) ; read ( '>' ) ; |
public class RemoteQPConsumerKey { /** * ( non - Javadoc )
* @ see com . ibm . ws . sib . processor . impl . ConsumerKey # waiting ( long , boolean ) */
public long waiting ( long timeout , boolean modifyTimeout ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "waiting" , new Object [ ] { new Long ( timeout ) , Boolean . valueOf ( modifyTimeout ) } ) ; boolean processGets = true ; synchronized ( this ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "refilling: " + Boolean . valueOf ( isRefilling ) + "doRefill: " + Boolean . valueOf ( doRefill ) ) ; if ( isRefilling ) { processGets = false ; // A request came in while we were busy doing refills . Therfore we
// record the timeout ( if we dont have a longer one ) in case we have to redrive
// a new refill request when the current one is satisfied .
if ( timeout == LocalConsumerPoint . INFINITE_WAIT ) refillTime = timeout ; else if ( timeout != LocalConsumerPoint . NO_WAIT ) { // Work out when this request would have expired
long expiryTime = System . currentTimeMillis ( ) + timeout ; // If we dont have a current refillTime that extends to the period of this request
// then set the new refillTime
if ( refillTime != LocalConsumerPoint . INFINITE_WAIT && refillTime < expiryTime ) refillTime = expiryTime ; } } else { if ( doRefill ) // Has a refill been inititated
{ isRefilling = true ; doRefill = false ; } } } if ( processGets ) { try { long protocolTimeout ; // Either modify the timeout with a roundTrip time or not .
// But always convert the protocol time into a SIMP format
// ( from the LCP format )
if ( modifyTimeout ) { if ( timeout == LocalConsumerPoint . INFINITE_WAIT ) { // no need to modify timeout
// we are using a different constant for the protocol
protocolTimeout = SIMPConstants . INFINITE_TIMEOUT ; } else if ( timeout == LocalConsumerPoint . NO_WAIT ) { timeout = getRoundTripTime ( ) ; // the consumer needs to wait atleast
// for this time
protocolTimeout = 0L ; // this ensures that the DME knows not to wait
} else { long rtt = getRoundTripTime ( ) ; protocolTimeout = timeout + rtt ; timeout = protocolTimeout ; } } else { if ( timeout == LocalConsumerPoint . INFINITE_WAIT ) protocolTimeout = SIMPConstants . INFINITE_TIMEOUT ; else if ( timeout == LocalConsumerPoint . NO_WAIT ) protocolTimeout = 0L ; // this ensures that the DME knows not to wait
else protocolTimeout = timeout ; } boolean callIssueGet = true ; if ( readAhead || protocolTimeout == SIMPConstants . INFINITE_TIMEOUT ) { synchronized ( this ) { if ( countOfOutstandingInfiniteTimeoutGets > 0 ) { callIssueGet = false ; // already scheduled requests
} else { if ( keyGroup == null ) { // will issue get , so update counts within the synchronized block
if ( protocolTimeout == SIMPConstants . INFINITE_TIMEOUT ) { countOfOutstandingInfiniteTimeoutGets ++ ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "readAhead change: countOfOutstandingInfiniteTimeoutGets++ " + countOfOutstandingInfiniteTimeoutGets ) ; } } // else do nothing , since gets issued on the key group don ' t count
// towards
// countOfOutstandingInfiniteTimeoutGets
} } if ( readAhead ) tryPrefetching ( ) ; // call try prefetching since window may have
// increased
} if ( callIssueGet ) { AIStreamKey key ; if ( keyGroup == null ) key = rcd . issueGet ( criteria , protocolTimeout , this , this ) ; else key = ( ( RemoteQPConsumerKeyGroup ) keyGroup ) . issueGet ( protocolTimeout , this ) ; if ( key == null ) { // decrement the counts . this will be very rare !
synchronized ( this ) { if ( ( keyGroup == null ) && ( protocolTimeout == SIMPConstants . INFINITE_TIMEOUT ) ) { countOfOutstandingInfiniteTimeoutGets -- ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "readAhead change: countOfOutstandingInfiniteTimeoutGets-- " + countOfOutstandingInfiniteTimeoutGets ) ; } } // log and throw exception to consumer
SIResourceException e = new SIResourceException ( nls . getFormattedMessage ( "ANYCAST_STREAM_UNAVAILABLE_CWSIP0481" , new Object [ ] { rcd . getDestName ( ) , rcd . getLocalisationUuid ( ) . toString ( ) } , null ) ) ; FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.impl.RemoteQPConsumerKey.waiting" , "1:357:1.47.1.26" , this ) ; SibTr . exception ( tc , e ) ; consumerPoint . notifyException ( e ) ; } } } catch ( SIResourceException e ) { // FFDC
FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.impl.RemoteQPConsumerKey.waiting" , "1:369:1.47.1.26" , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) SibTr . exception ( tc , e ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "waiting" , "SIErrorException" ) ; throw new SIErrorException ( e ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "waiting" , Long . valueOf ( timeout ) ) ; return timeout ; |
public class NtlmPasswordAuthentication { /** * Return the domain and username in the format :
* < tt > domain \ \ username < / tt > . This is equivalent to < tt > toString ( ) < / tt > . */
public String getName ( ) { } } | boolean d = domain . length ( ) > 0 && domain . equals ( "?" ) == false ; return d ? domain + "\\" + username : username ; |
public class CPMeasurementUnitLocalServiceWrapper { /** * Creates a new cp measurement unit with the primary key . Does not add the cp measurement unit to the database .
* @ param CPMeasurementUnitId the primary key for the new cp measurement unit
* @ return the new cp measurement unit */
@ Override public com . liferay . commerce . product . model . CPMeasurementUnit createCPMeasurementUnit ( long CPMeasurementUnitId ) { } } | return _cpMeasurementUnitLocalService . createCPMeasurementUnit ( CPMeasurementUnitId ) ; |
public class GuavaTransformers { /** * Returns a Transformer & lt ; T , ImmutableSet & lt ; T & gt ; & gt that maps an Observable & lt ; T & gt ; to an Observable & lt ; ImmutableSet & lt ; T & gt ; & gt ; */
public static < T > Observable . Transformer < T , ImmutableSet < T > > toImmutableSet ( ) { } } | return new Observable . Transformer < T , ImmutableSet < T > > ( ) { @ Override public Observable < ImmutableSet < T > > call ( Observable < T > source ) { return source . collect ( new Func0 < ImmutableSet . Builder < T > > ( ) { @ Override public ImmutableSet . Builder < T > call ( ) { return ImmutableSet . builder ( ) ; } } , new Action2 < ImmutableSet . Builder < T > , T > ( ) { @ Override public void call ( ImmutableSet . Builder < T > builder , T t ) { builder . add ( t ) ; } } ) . map ( new Func1 < ImmutableSet . Builder < T > , ImmutableSet < T > > ( ) { @ Override public ImmutableSet < T > call ( ImmutableSet . Builder < T > builder ) { return builder . build ( ) ; } } ) ; } } ; |
public class MultiXSDSchemaCollector { /** * Produces an XML Schema or a Stdlib SchemaFiles document containing the XML Schemas
* @ return */
public MultiXSDSchemaFiles encode ( ) { } } | MultiXSDSchemaFiles files = new MultiXSDSchemaFiles ( ) ; for ( Map . Entry < String , DOMResult > entry : schemas . entrySet ( ) ) { MultiXSDSchemaFile file = new MultiXSDSchemaFile ( ) ; file . name = entry . getKey ( ) ; file . schema = getElement ( entry . getValue ( ) . getNode ( ) ) ; files . files . add ( file ) ; } // Now loosen xml : any namespace = # # other to xml : any namespace = # # any
if ( loosenXmlAnyConstraints ) MultiXSDSchemaLoosener . loosenXmlAnyOtherNamespaceToXmlAnyAnyNamespace ( files ) ; return files ; |
public class TableXmlHandler { /** * / * ( non - Javadoc )
* @ see org . xml . sax . helpers . DefaultHandler # endElement ( java . lang . String , java . lang . String , java . lang . String ) */
@ Override public void endElement ( String uri , String localName , String name ) throws SAXException { } } | if ( "table" . equals ( name ) ) { for ( final Column column : this . currentColumns . values ( ) ) { this . currentTable . addColumn ( column ) ; } if ( this . primaryKey != null ) { this . currentTable . setPrimaryKey ( this . primaryKey ) ; } this . tables . put ( this . currentTable . getName ( ) , this . currentTable ) ; this . tableColumnTypes . put ( this . currentTable . getName ( ) , this . currentColumnTypes ) ; this . primaryKey = null ; this . currentColumns = null ; this . currentColumnTypes = null ; this . currentTable = null ; } else if ( "column" . equals ( name ) ) { this . currentColumns . put ( this . currentColumn . getName ( ) , this . currentColumn ) ; this . currentColumn = null ; } else if ( "name" . equals ( name ) ) { final String itemName = this . chars . toString ( ) . trim ( ) ; if ( this . currentIndex != null ) { this . currentIndex . setName ( itemName ) ; } else if ( this . currentUnique != null ) { this . currentUnique . setName ( itemName ) ; } else if ( this . currentTable == null ) { this . currentTable = new Table ( itemName ) ; } else if ( this . currentColumn == null ) { this . currentColumn = new Column ( itemName ) ; } } else if ( "type" . equals ( name ) ) { final String sqlTypeName = this . chars . toString ( ) . trim ( ) ; final int sqlType = this . getSqlType ( sqlTypeName ) ; this . currentColumnTypes . put ( this . currentColumn . getName ( ) , sqlType ) ; final String hibType = this . getHibernateType ( sqlType ) ; final SimpleValue value = new SimpleValue ( this . mappings , this . currentTable ) ; value . setTypeName ( hibType ) ; this . currentColumn . setValue ( value ) ; } else if ( "param" . equals ( name ) ) { final String param = this . chars . toString ( ) . trim ( ) ; final Integer length = Integer . valueOf ( param ) ; this . currentColumn . setLength ( length ) ; } else if ( "primary-key" . equals ( name ) ) { final String columnName = this . chars . toString ( ) . trim ( ) ; if ( this . primaryKey == null ) { this . primaryKey = new PrimaryKey ( ) ; } final Column column = this . currentColumns . get ( columnName ) ; this . primaryKey . addColumn ( column ) ; } else if ( "not-null" . equals ( name ) ) { final String columnName = this . chars . toString ( ) . trim ( ) ; final Column column = this . currentColumns . get ( columnName ) ; column . setNullable ( false ) ; } else if ( "column-ref" . equals ( name ) ) { final String columnName = this . chars . toString ( ) . trim ( ) ; final Column column = this . currentColumns . get ( columnName ) ; if ( this . currentIndex != null ) { this . currentIndex . addColumn ( column ) ; } else if ( this . currentUnique != null ) { this . currentUnique . addColumn ( column ) ; } } else if ( "index" . equals ( name ) ) { this . currentTable . addIndex ( this . currentIndex ) ; this . currentIndex = null ; } else if ( "unique" . equals ( name ) ) { this . currentTable . addUniqueKey ( this . currentUnique ) ; this . currentUnique = null ; } else if ( "key" . equals ( name ) ) { this . logger . warn ( "the 'key' element is ignored, use the table level 'primary-key' element instead" ) ; } this . chars = null ; |
public class Table { /** * Performs Table structure modification and changes to the index nodes
* to remove a given index from a MEMORY or TEXT table . Not for PK index . */
public void dropIndex ( Session session , String indexname ) { } } | // find the array index for indexname and remove
int todrop = getIndexIndex ( indexname ) ; indexList = ( Index [ ] ) ArrayUtil . toAdjustedArray ( indexList , null , todrop , - 1 ) ; for ( int i = 0 ; i < indexList . length ; i ++ ) { indexList [ i ] . setPosition ( i ) ; } setBestRowIdentifiers ( ) ; if ( store != null ) { store . resetAccessorKeys ( indexList ) ; } |
public class IOUtils { /** * < p > copyFile . < / p >
* @ param srcFile a { @ link java . io . File } object .
* @ param destFile a { @ link java . io . File } object .
* @ throws java . io . IOException if any . */
public static void copyFile ( File srcFile , File destFile ) throws IOException { } } | InputStream reader = new FileInputStream ( srcFile ) ; OutputStream out = new FileOutputStream ( destFile ) ; try { byte [ ] buffer = new byte [ 2048 ] ; int n = 0 ; while ( - 1 != ( n = reader . read ( buffer ) ) ) { out . write ( buffer , 0 , n ) ; } } finally { org . apache . commons . io . IOUtils . closeQuietly ( out ) ; org . apache . commons . io . IOUtils . closeQuietly ( reader ) ; } |
public class ClientService { /** * Returns a client object for a clientId
* @ param clientId ID of client to return
* @ return Client or null
* @ throws Exception exception */
public Client getClient ( int clientId ) throws Exception { } } | Client client = null ; PreparedStatement statement = null ; ResultSet results = null ; try ( Connection sqlConnection = sqlService . getConnection ( ) ) { String queryString = "SELECT * FROM " + Constants . DB_TABLE_CLIENT + " WHERE " + Constants . GENERIC_ID + " = ?" ; statement = sqlConnection . prepareStatement ( queryString ) ; statement . setInt ( 1 , clientId ) ; results = statement . executeQuery ( ) ; if ( results . next ( ) ) { client = this . getClientFromResultSet ( results ) ; } } catch ( Exception e ) { throw e ; } finally { try { if ( results != null ) { results . close ( ) ; } } catch ( Exception e ) { } try { if ( statement != null ) { statement . close ( ) ; } } catch ( Exception e ) { } } return client ; |
public class GVRDirectLight { /** * Sets the near and far range of the shadow map camera .
* This function enables shadow mapping and sets the shadow map
* camera near and far range , controlling which objects affect
* the shadow map . To modify other properties of the shadow map
* camera ' s projection , you can call { @ link GVRShadowMap # getCamera }
* and update them .
* @ param near near shadow camera clipping plane
* @ param far far shadow camera clipping plane
* @ see GVRShadowMap # getCamera ( ) */
public void setShadowRange ( float near , float far ) { } } | GVRSceneObject owner = getOwnerObject ( ) ; GVROrthogonalCamera shadowCam = null ; if ( owner == null ) { throw new UnsupportedOperationException ( "Light must have an owner to set the shadow range" ) ; } GVRShadowMap shadowMap = ( GVRShadowMap ) getComponent ( GVRRenderTarget . getComponentType ( ) ) ; if ( shadowMap != null ) { shadowCam = ( GVROrthogonalCamera ) shadowMap . getCamera ( ) ; shadowCam . setNearClippingDistance ( near ) ; shadowCam . setFarClippingDistance ( far ) ; shadowMap . setEnable ( true ) ; } else { shadowCam = GVRShadowMap . makeOrthoShadowCamera ( getGVRContext ( ) . getMainScene ( ) . getMainCameraRig ( ) . getCenterCamera ( ) ) ; shadowCam . setNearClippingDistance ( near ) ; shadowCam . setFarClippingDistance ( far ) ; shadowMap = new GVRShadowMap ( getGVRContext ( ) , shadowCam ) ; owner . attachComponent ( shadowMap ) ; } mCastShadow = true ; |
public class CallImpl { /** * Call this method to get a notification when this call hangs up .
* @ param listener
* @ return true if the hangup listener was added . False if the call has
* already been hungup . */
public boolean addHangupListener ( CallHangupListener listener ) { } } | boolean callStillUp = true ; if ( ( this . _originatingParty != null && this . _originatingParty . isLive ( ) ) || ( this . _acceptingParty != null && this . _acceptingParty . isLive ( ) ) || ( this . _transferTargetParty != null && this . _transferTargetParty . isLive ( ) ) ) this . _hangupListeners . add ( listener ) ; else callStillUp = false ; return callStillUp ; |
public class FileOperations { /** * Deletes the specified file from the specified compute node .
* @ param poolId The ID of the pool that contains the compute node .
* @ param nodeId The ID of the compute node .
* @ param fileName The name of the file to delete .
* @ throws BatchErrorException Exception thrown when an error response is received from the Batch service .
* @ throws IOException Exception thrown when there is an error in serialization / deserialization of data sent to / received from the Batch service . */
public void deleteFileFromComputeNode ( String poolId , String nodeId , String fileName ) throws BatchErrorException , IOException { } } | deleteFileFromComputeNode ( poolId , nodeId , fileName , null , null ) ; |
public class ParsingRuleRegistry { /** * Find SQL statement rule .
* @ param databaseType database type
* @ param contextClassName context class name
* @ return SQL statement rule */
public Optional < SQLStatementRule > findSQLStatementRule ( final DatabaseType databaseType , final String contextClassName ) { } } | return Optional . fromNullable ( parserRuleDefinitions . get ( DatabaseType . H2 == databaseType ? DatabaseType . MySQL : databaseType ) . getSqlStatementRuleDefinition ( ) . getRules ( ) . get ( contextClassName ) ) ; |
public class Sequencers { /** * Signal that a new workspace was removed .
* @ param workspaceName the workspace name ; may not be null */
protected void workspaceRemoved ( String workspaceName ) { } } | // Otherwise , update the configs by workspace key . . .
try { configChangeLock . lock ( ) ; // Make a copy of the existing map . . .
Map < String , Collection < SequencingConfiguration > > configByWorkspaceName = new HashMap < String , Collection < SequencingConfiguration > > ( this . configByWorkspaceName ) ; // Insert the new information . . .
if ( configByWorkspaceName . remove ( workspaceName ) != null ) { // Replace the exisiting map ( which is used without a lock ) . . .
this . configByWorkspaceName = configByWorkspaceName ; } } finally { configChangeLock . unlock ( ) ; } |
public class Ifc2x3tc1FactoryImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public String convertIfcGlobalOrLocalEnumToString ( EDataType eDataType , Object instanceValue ) { } } | return instanceValue == null ? null : instanceValue . toString ( ) ; |
public class AzureProxy { /** * Create a proxy implementation of the provided Swagger interface .
* @ param swaggerInterface The Swagger interface to provide a proxy implementation for .
* @ param azureServiceClient The AzureServiceClient that contains the details to use to create
* the AzureProxy implementation of the swagger interface .
* @ param < A > The type of the Swagger interface .
* @ return A proxy implementation of the provided Swagger interface . */
@ SuppressWarnings ( "unchecked" ) public static < A > A create ( Class < A > swaggerInterface , AzureServiceClient azureServiceClient ) { } } | return AzureProxy . create ( swaggerInterface , azureServiceClient . azureEnvironment ( ) , azureServiceClient . httpPipeline ( ) , azureServiceClient . serializerAdapter ( ) ) ; |
public class GridFilesystem { /** * Opens an OutputStream for writing to the file denoted by pathname . The OutputStream can either overwrite the
* existing file or append to it .
* @ param pathname the path to write to
* @ param append if true , the bytes written to the OutputStream will be appended to the end of the file . If false ,
* the bytes will overwrite the original contents .
* @ return an OutputStream for writing to the file at pathname
* @ throws IOException if an error occurs */
public OutputStream getOutput ( String pathname , boolean append ) throws IOException { } } | return getOutput ( pathname , append , defaultChunkSize ) ; |
public class PolicyStatesInner { /** * Summarizes policy states for the subscription level policy definition .
* @ param subscriptionId Microsoft Azure subscription ID .
* @ param policyDefinitionName Policy definition name .
* @ param queryOptions Additional parameters for the operation
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the SummarizeResultsInner object */
public Observable < SummarizeResultsInner > summarizeForPolicyDefinitionAsync ( String subscriptionId , String policyDefinitionName , QueryOptions queryOptions ) { } } | return summarizeForPolicyDefinitionWithServiceResponseAsync ( subscriptionId , policyDefinitionName , queryOptions ) . map ( new Func1 < ServiceResponse < SummarizeResultsInner > , SummarizeResultsInner > ( ) { @ Override public SummarizeResultsInner call ( ServiceResponse < SummarizeResultsInner > response ) { return response . body ( ) ; } } ) ; |
public class TimeZone { /** * { @ inheritDoc } */
public final int getOffset ( final int era , final int year , final int month , final int dayOfMonth , final int dayOfWeek , final int milliseconds ) { } } | // calculate time of day
int ms = milliseconds ; final int hour = ms / 3600000 ; ms -= hour * 3600000 ; final int minute = ms / 60000 ; ms -= minute * 60000 ; final int second = ms / 1000 ; ms -= second * 1000 ; final Calendar cal = Calendar . getInstance ( ) ; cal . clear ( ) ; // don ' t retain current date / time , it may disturb the calculation
// set date and time
cal . set ( Calendar . ERA , era ) ; cal . set ( Calendar . DAY_OF_WEEK , dayOfWeek ) ; cal . set ( year , month , dayOfMonth , hour , minute , second ) ; cal . set ( Calendar . MILLISECOND , ms ) ; final Observance observance = vTimeZone . getApplicableObservance ( new DateTime ( cal . getTime ( ) ) ) ; if ( observance != null ) { final TzOffsetTo offset = observance . getProperty ( Property . TZOFFSETTO ) ; return ( int ) ( offset . getOffset ( ) . getTotalSeconds ( ) * 1000L ) ; } return 0 ; |
public class Snappy { /** * Get the uncompressed byte size of the given compressed input . This
* operation takes O ( 1 ) time .
* @ param input
* @ param offset
* @ param length
* @ return uncompressed byte size of the the given input data
* @ throws IOException when failed to uncompress the given input . The error code is
* { @ link SnappyErrorCode # PARSING _ ERROR } */
public static int uncompressedLength ( byte [ ] input , int offset , int length ) throws IOException { } } | if ( input == null ) { throw new NullPointerException ( "input is null" ) ; } return impl . uncompressedLength ( input , offset , length ) ; |
public class VirtualHostKeySelector { /** * Build up the list of server names represented by a certificate */
private Collection < String > getCertServerNames ( X509Certificate x509 ) throws CertificateParsingException { } } | Collection < String > serverNames = new LinkedHashSet < > ( ) ; /* Add CN for the certificate */
String certCN = getCertCN ( x509 ) ; serverNames . add ( certCN ) ; /* Add alternative names for each certificate */
try { Collection < List < ? > > altNames = x509 . getSubjectAlternativeNames ( ) ; if ( altNames != null ) { for ( List < ? > entry : altNames ) { if ( entry . size ( ) >= 2 ) { Object entryType = entry . get ( 0 ) ; if ( entryType instanceof Integer && ( Integer ) entryType == 2 ) { Object field = entry . get ( 1 ) ; if ( field instanceof String ) { serverNames . add ( ( ( String ) field ) . toLowerCase ( ) ) ; } } } } } } catch ( CertificateParsingException cpe ) { LOGGER . warn ( "Certificate alternative names ignored for certificate " + ( certCN != null ? " " + certCN : "" ) , cpe ) ; } return serverNames ; |
public class AppMsg { /** * Make a { @ link AppMsg } with a custom layout . The layout must have a { @ link TextView } com id { @ link android . R . id . message }
* @ param context The context to use . Usually your
* { @ link android . app . Activity } object .
* @ param text The text to show . Can be formatted text .
* @ param style The style with a background and a duration . */
public static AppMsg makeText ( Activity context , CharSequence text , Style style , int layoutId ) { } } | LayoutInflater inflate = ( LayoutInflater ) context . getSystemService ( Context . LAYOUT_INFLATER_SERVICE ) ; View v = inflate . inflate ( layoutId , null ) ; return makeText ( context , text , style , v , true ) ; |
public class CommerceCurrencyLocalServiceBaseImpl { /** * Returns all the commerce currencies matching the UUID and company .
* @ param uuid the UUID of the commerce currencies
* @ param companyId the primary key of the company
* @ return the matching commerce currencies , or an empty list if no matches were found */
@ Override public List < CommerceCurrency > getCommerceCurrenciesByUuidAndCompanyId ( String uuid , long companyId ) { } } | return commerceCurrencyPersistence . findByUuid_C ( uuid , companyId ) ; |
public class TimerNpHandleImpl { /** * Read this object from the ObjectInputStream .
* Note , this is overriding the default Serialize interface
* implementation .
* @ see java . io . Serializable */
private void readObject ( java . io . ObjectInputStream in ) throws IOException , ClassNotFoundException { } } | final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "readObject" ) ; in . defaultReadObject ( ) ; // Read in eye catcher .
byte [ ] eyeCatcher = new byte [ EYECATCHER . length ] ; // Insure that all of the bytes have been read .
int bytesRead = 0 ; for ( int offset = 0 ; offset < EYECATCHER . length ; offset += bytesRead ) { bytesRead = in . read ( eyeCatcher , offset , EYECATCHER . length - offset ) ; if ( bytesRead == - 1 ) { throw new IOException ( "end of input stream while reading eye catcher" ) ; } } // Validate that the eyecatcher matches
for ( int i = 0 ; i < EYECATCHER . length ; i ++ ) { if ( EYECATCHER [ i ] != eyeCatcher [ i ] ) { String eyeCatcherString = new String ( eyeCatcher ) ; throw new IOException ( "Invalid eye catcher '" + eyeCatcherString + "' in TimerHandle input stream" ) ; } } // Read in the rest of the header .
@ SuppressWarnings ( "unused" ) short incoming_platform = in . readShort ( ) ; short incoming_vid = in . readShort ( ) ; // Verify the version is supported by this version of code .
if ( incoming_vid != VERSION_ID ) { throw new InvalidObjectException ( "EJB TimerHandle data stream is not of the correct version, " + "this client should be updated." ) ; } // Read in the instance data .
ivTaskId = in . readUTF ( ) ; byte [ ] bytes = ( byte [ ] ) in . readObject ( ) ; ByteArray byteArray = new ByteArray ( bytes ) ; EJSContainer container = EJSContainer . getDefaultContainer ( ) ; ivBeanId = BeanId . getBeanId ( byteArray , container ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "readObject: " + this ) ; |
public class HsqldbDatabase { /** * / * ( non - Javadoc )
* @ see org . parosproxy . paros . db . DatabaseIF # close ( boolean , boolean ) */
@ Override public void close ( boolean compact , boolean cleanup ) { } } | logger . debug ( "close" ) ; super . close ( compact , cleanup ) ; if ( this . getDatabaseServer ( ) == null ) { return ; } try { // shutdown
( ( HsqldbDatabaseServer ) this . getDatabaseServer ( ) ) . shutdown ( compact ) ; } catch ( Exception e ) { logger . error ( e . getMessage ( ) , e ) ; } |
public class MathUtils { /** * Returns the smallest angle between two angles .
* @ param alpha First angle in degrees
* @ param beta Second angle in degrees
* @ return Smallest angle between two angles . */
public static double differenceBetweenAngles ( double alpha , double beta ) { } } | double phi = Math . abs ( beta - alpha ) % 360 ; return phi > 180 ? 360 - phi : phi ; |
public class AerialMavenGeneratorPlugin { public void execute ( ) throws MojoExecutionException , MojoFailureException { } } | ArrayList < String > params = new ArrayList < String > ( ) ; params . add ( AerialParamKeys . INPUT_TYPE . toString ( ) ) ; params . add ( inputType . toString ( ) ) ; params . add ( AerialParamKeys . SOURCE . toString ( ) ) ; params . add ( source ) ; params . add ( AerialParamKeys . OUTPUT_TYPE . toString ( ) ) ; params . add ( outputType . toString ( ) ) ; params . add ( AerialParamKeys . DESTINATION . toString ( ) ) ; params . add ( destination ) ; if ( configurationFile != null ) { params . add ( AerialParamKeys . CONFIGURATION . toString ( ) ) ; params . add ( configurationFile ) ; } if ( namedParams != null ) { for ( Entry < String , String > entry : namedParams . entrySet ( ) ) { params . add ( entry . getKey ( ) + "=" + entry . getValue ( ) ) ; } } if ( valueParams != null ) { for ( String param : valueParams ) { param = param . replaceAll ( "=" , "\\=" ) ; params . add ( param ) ; } } String [ ] paramsArray = new String [ params . size ( ) ] ; paramsArray = params . toArray ( paramsArray ) ; try { AerialMain . main ( paramsArray ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; throw new MojoFailureException ( "Failed to execute generation" ) ; } |
public class WSRdbManagedConnectionImpl { /** * Claim the unused managed connection as a victim connection ,
* which can then be reauthenticated and reused . */
public void setClaimedVictim ( ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "marking this mc as _claimedVictim" ) ; _claimedVictim = true ; |
public class WebJsptaglibraryDescriptorImpl { /** * Returns all < code > tag - file < / code > elements
* @ return list of < code > tag - file < / code > */
public List < TagFileType < WebJsptaglibraryDescriptor > > getAllTagFile ( ) { } } | List < TagFileType < WebJsptaglibraryDescriptor > > list = new ArrayList < TagFileType < WebJsptaglibraryDescriptor > > ( ) ; List < Node > nodeList = model . get ( "tag-file" ) ; for ( Node node : nodeList ) { TagFileType < WebJsptaglibraryDescriptor > type = new TagFileTypeImpl < WebJsptaglibraryDescriptor > ( this , "tag-file" , model , node ) ; list . add ( type ) ; } return list ; |
public class AWSIotClient { /** * Describes a search index .
* @ param describeIndexRequest
* @ return Result of the DescribeIndex operation returned by the service .
* @ throws InvalidRequestException
* The request is not valid .
* @ throws ThrottlingException
* The rate exceeds the limit .
* @ throws UnauthorizedException
* You are not authorized to perform this operation .
* @ throws ServiceUnavailableException
* The service is temporarily unavailable .
* @ throws InternalFailureException
* An unexpected error has occurred .
* @ throws ResourceNotFoundException
* The specified resource does not exist .
* @ sample AWSIot . DescribeIndex */
@ Override public DescribeIndexResult describeIndex ( DescribeIndexRequest request ) { } } | request = beforeClientExecution ( request ) ; return executeDescribeIndex ( request ) ; |
public class AbstractIndexWriter { /** * Add the member information for the unicode character along with the
* list of the members .
* @ param uc Unicode for which member list information to be generated
* @ param memberlist List of members for the unicode character
* @ param contentTree the content tree to which the information will be added */
protected void addContents ( Character uc , List < ? extends Doc > memberlist , Content contentTree ) { } } | addHeading ( uc , contentTree ) ; int memberListSize = memberlist . size ( ) ; // Display the list only if there are elements to be displayed .
if ( memberListSize > 0 ) { Content dl = new HtmlTree ( HtmlTag . DL ) ; for ( Doc element : memberlist ) { addDescription ( dl , element ) ; } contentTree . addContent ( dl ) ; } |
public class ContentValues { /** * Adds a value to the set .
* @ param key the name of the value to forceInsert
* @ param value the data for the value to forceInsert */
public ContentValues put ( String key , String value ) { } } | mValues . put ( key , value ) ; return this ; |
public class DescribeAssociationRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( DescribeAssociationRequest describeAssociationRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( describeAssociationRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( describeAssociationRequest . getName ( ) , NAME_BINDING ) ; protocolMarshaller . marshall ( describeAssociationRequest . getInstanceId ( ) , INSTANCEID_BINDING ) ; protocolMarshaller . marshall ( describeAssociationRequest . getAssociationId ( ) , ASSOCIATIONID_BINDING ) ; protocolMarshaller . marshall ( describeAssociationRequest . getAssociationVersion ( ) , ASSOCIATIONVERSION_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class AttackerModel { /** * Attacker */
@ Override public void prepare ( FeatureProvider provider ) { } } | super . prepare ( provider ) ; animator = provider . getFeature ( Animatable . class ) ; transformable = provider . getFeature ( Transformable . class ) ; if ( provider instanceof AttackerListener ) { addListener ( ( AttackerListener ) provider ) ; } checker = ( AttackerChecker ) provider ; |
public class TrafficForecastAdjustmentSegment { /** * Sets the basisType value for this TrafficForecastAdjustmentSegment .
* @ param basisType * The basis type of the adjustment . */
public void setBasisType ( com . google . api . ads . admanager . axis . v201902 . BasisType basisType ) { } } | this . basisType = basisType ; |
public class HexUtil { /** * Appends 8 characters to a StringBuilder with the int in a " Big Endian "
* hexidecimal format . For example , a int 0xFFAA1234 will be appended as a
* String in format " FFAA1234 " . A int of value 0 will be appended as " 00000 " .
* @ param buffer The StringBuilder the int value in hexidecimal format
* will be appended to . If the buffer is null , this method will throw
* a NullPointerException .
* @ param value The int value that will be converted to a hexidecimal String . */
static public void appendHexString ( StringBuilder buffer , int value ) { } } | assertNotNull ( buffer ) ; int nibble = ( value & 0xF0000000 ) >>> 28 ; buffer . append ( HEX_TABLE [ nibble ] ) ; nibble = ( value & 0x0F000000 ) >>> 24 ; buffer . append ( HEX_TABLE [ nibble ] ) ; nibble = ( value & 0x00F00000 ) >>> 20 ; buffer . append ( HEX_TABLE [ nibble ] ) ; nibble = ( value & 0x000F0000 ) >>> 16 ; buffer . append ( HEX_TABLE [ nibble ] ) ; nibble = ( value & 0x0000F000 ) >>> 12 ; buffer . append ( HEX_TABLE [ nibble ] ) ; nibble = ( value & 0x00000F00 ) >>> 8 ; buffer . append ( HEX_TABLE [ nibble ] ) ; nibble = ( value & 0x000000F0 ) >>> 4 ; buffer . append ( HEX_TABLE [ nibble ] ) ; nibble = ( value & 0x0000000F ) ; buffer . append ( HEX_TABLE [ nibble ] ) ; |
public class DomainValidationOptionMarshaller { /** * Marshall the given parameter object . */
public void marshall ( DomainValidationOption domainValidationOption , ProtocolMarshaller protocolMarshaller ) { } } | if ( domainValidationOption == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( domainValidationOption . getDomainName ( ) , DOMAINNAME_BINDING ) ; protocolMarshaller . marshall ( domainValidationOption . getValidationDomain ( ) , VALIDATIONDOMAIN_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class JNvgraph { /** * Set size , topology data in the graph descriptor */
public static int nvgraphSetGraphStructure ( nvgraphHandle handle , nvgraphGraphDescr descrG , Object topologyData , int TType ) { } } | return checkResult ( nvgraphSetGraphStructureNative ( handle , descrG , topologyData , TType ) ) ; |
public class IteratorExecutor { /** * Utility method that checks whether all tasks succeeded from the output of { @ link # executeAndGetResults ( ) } .
* @ return true if all tasks succeeded . */
public static < T > boolean verifyAllSuccessful ( List < Either < T , ExecutionException > > results ) { } } | return Iterables . all ( results , new Predicate < Either < T , ExecutionException > > ( ) { @ Override public boolean apply ( @ Nullable Either < T , ExecutionException > input ) { return input instanceof Either . Left ; } } ) ; |
public class Waiter { /** * Waits for a text to be shown .
* @ param text the text that needs to be shown , specified as a regular expression
* @ param expectedMinimumNumberOfMatches the minimum number of matches of text that must be shown . { @ code 0 } means any number of matches
* @ param timeout the amount of time in milliseconds to wait
* @ param scroll { @ code true } if scrolling should be performed
* @ return { @ code true } if text is found and { @ code false } if it is not found before the timeout */
public TextView waitForText ( String text , int expectedMinimumNumberOfMatches , long timeout , boolean scroll ) { } } | return waitForText ( TextView . class , text , expectedMinimumNumberOfMatches , timeout , scroll , false , true ) ; |
public class DFSOutputStream { /** * Waits till all existing data is flushed and confirmations
* received from datanodes . */
private void flushInternal ( ) throws IOException { } } | isClosed ( ) ; dfsClient . checkOpen ( ) ; long toWaitFor ; synchronized ( this ) { enqueueCurrentPacket ( ) ; toWaitFor = lastQueuedSeqno ; } waitForAckedSeqno ( toWaitFor ) ; |
public class Descriptor { /** * getter for categories - gets List of Wikipedia categories associated with a Wikipedia page .
* @ generated
* @ return value of the feature */
public FSArray getCategories ( ) { } } | if ( Descriptor_Type . featOkTst && ( ( Descriptor_Type ) jcasType ) . casFeat_categories == null ) jcasType . jcas . throwFeatMissing ( "categories" , "de.julielab.jules.types.wikipedia.Descriptor" ) ; return ( FSArray ) ( jcasType . ll_cas . ll_getFSForRef ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( Descriptor_Type ) jcasType ) . casFeatCode_categories ) ) ) ; |
public class HKerberosSecuredThriftClientFactoryImpl { /** * { @ inheritDoc } */
public HClient createClient ( CassandraHost ch ) { } } | if ( log . isDebugEnabled ( ) ) { log . debug ( "Creation of new client" ) ; } return params == null ? new HKerberosThriftClient ( kerberosTicket , ch , krbServicePrincipalName ) : new HKerberosThriftClient ( kerberosTicket , ch , krbServicePrincipalName , params ) ; |
public class HTTPRequest { /** * This function sets the content .
* @ param content
* The new value for the content */
public final void setContent ( ContentPart < ? > [ ] content ) { } } | // clear non relevant flags
this . contentString = null ; this . contentBinary = null ; this . contentType = ContentType . MULTI_PART ; if ( content == null ) { this . contentParts = null ; } else { this . contentParts = content . clone ( ) ; } |
public class AppServicePlansInner { /** * Restart all apps in an App Service plan .
* Restart all apps in an App Service plan .
* @ param resourceGroupName Name of the resource group to which the resource belongs .
* @ param name Name of the App Service plan .
* @ param softRestart Specify & lt ; code & gt ; true & lt ; / code & gt ; to performa a soft restart , applies the configuration settings and restarts the apps if necessary . The default is & lt ; code & gt ; false & lt ; / code & gt ; , which always restarts and reprovisions the apps
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the { @ link ServiceResponse } object if successful . */
public Observable < ServiceResponse < Void > > restartWebAppsWithServiceResponseAsync ( String resourceGroupName , String name , Boolean softRestart ) { } } | if ( resourceGroupName == null ) { throw new IllegalArgumentException ( "Parameter resourceGroupName is required and cannot be null." ) ; } if ( name == null ) { throw new IllegalArgumentException ( "Parameter name is required and cannot be null." ) ; } if ( this . client . subscriptionId ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.subscriptionId() is required and cannot be null." ) ; } if ( this . client . apiVersion ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.apiVersion() is required and cannot be null." ) ; } return service . restartWebApps ( resourceGroupName , name , this . client . subscriptionId ( ) , softRestart , this . client . apiVersion ( ) , this . client . acceptLanguage ( ) , this . client . userAgent ( ) ) . flatMap ( new Func1 < Response < ResponseBody > , Observable < ServiceResponse < Void > > > ( ) { @ Override public Observable < ServiceResponse < Void > > call ( Response < ResponseBody > response ) { try { ServiceResponse < Void > clientResponse = restartWebAppsDelegate ( response ) ; return Observable . just ( clientResponse ) ; } catch ( Throwable t ) { return Observable . error ( t ) ; } } } ) ; |
public class AbstractJTACrud { /** * Create a FluentTransaction , with the given transaction block .
* @ param < R > the return type of the transaction block
* @ param callable , The transaction block to be executed by the returned FluentTransaction
* @ return a new FluentTransaction with a transaction block already defined .
* @ throws java . lang . UnsupportedOperationException if transactions are not supported . */
@ Override public < R > FluentTransaction < R > . Intermediate transaction ( Callable < R > callable ) { } } | return FluentTransaction . transaction ( getTransactionManager ( ) ) . with ( callable ) ; |
public class ThriftClient { /** * ( non - Javadoc )
* @ see com . impetus . client . cassandra . CassandraClientBase # findByRange ( byte [ ] ,
* byte [ ] , com . impetus . kundera . metadata . model . EntityMetadata , boolean ,
* java . util . List , java . util . List , java . util . List , int ) */
@ Override public List findByRange ( byte [ ] minVal , byte [ ] maxVal , EntityMetadata m , boolean isWrapReq , List < String > relations , List < String > columns , List < IndexExpression > conditions , int maxResults ) throws Exception { } } | SlicePredicate slicePredicate = new SlicePredicate ( ) ; if ( columns != null && ! columns . isEmpty ( ) ) { List asList = new ArrayList ( 32 ) ; for ( String colName : columns ) { if ( colName != null ) { asList . add ( UTF8Type . instance . decompose ( colName ) ) ; } } slicePredicate . setColumn_names ( asList ) ; } else { SliceRange sliceRange = new SliceRange ( ) ; sliceRange . setStart ( ByteBufferUtil . EMPTY_BYTE_BUFFER ) ; sliceRange . setFinish ( ByteBufferUtil . EMPTY_BYTE_BUFFER ) ; slicePredicate . setSlice_range ( sliceRange ) ; } KeyRange keyRange = new KeyRange ( maxResults ) ; keyRange . setStart_key ( minVal == null ? "" . getBytes ( ) : minVal ) ; keyRange . setEnd_key ( maxVal == null ? "" . getBytes ( ) : maxVal ) ; ColumnParent cp = new ColumnParent ( m . getTableName ( ) ) ; if ( conditions != null && ! conditions . isEmpty ( ) ) { keyRange . setRow_filter ( conditions ) ; keyRange . setRow_filterIsSet ( true ) ; } Connection conn = getConnection ( ) ; List < KeySlice > keys = conn . getClient ( ) . get_range_slices ( cp , slicePredicate , keyRange , getConsistencyLevel ( ) ) ; releaseConnection ( conn ) ; List results = null ; if ( keys != null ) { results = populateEntitiesFromKeySlices ( m , isWrapReq , relations , keys , dataHandler ) ; } return results ; |
public class AfplibFactoryImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public String convertCFCRetired1ToString ( EDataType eDataType , Object instanceValue ) { } } | return instanceValue == null ? null : instanceValue . toString ( ) ; |
public class AbstractTraverser { /** * Calls the protected abstract method visit that is to be
* implemented in subclasses of this abstract class .
* @ param domain BioPAX Element
* @ param range property value ( can be BioPAX element , primitive , enum , string )
* @ param model the BioPAX model of interest
* @ param editor parent ' s property PropertyEditor */
public void visit ( BioPAXElement domain , Object range , Model model , PropertyEditor < ? , ? > editor ) { } } | // actions
visit ( range , domain , model , editor ) ; |
public class NodeKey { /** * Get the multi - character key uniquely identifying the repository ' s storage source in which this node appears .
* @ return the source key ; never null and always contains at least one character */
public String getSourceKey ( ) { } } | if ( sourceKey == null ) { // Value is idempotent , so it ' s okay to do this without synchronizing . . .
sourceKey = key . substring ( SOURCE_START_INDEX , SOURCE_END_INDEX ) ; } return sourceKey ; |
public class ReceiveMessageBuilder { /** * Creates new JSONPath validation context if not done before and gets the validation context . */
private JsonPathMessageValidationContext getJsonPathValidationContext ( ) { } } | if ( jsonPathValidationContext == null ) { jsonPathValidationContext = new JsonPathMessageValidationContext ( ) ; getAction ( ) . getValidationContexts ( ) . add ( jsonPathValidationContext ) ; } return jsonPathValidationContext ; |
public class CmsConfigurationReader { /** * Parses the set of formatters to remove . < p >
* @ param node the parent node
* @ return the set of formatters to remove */
public Set < String > parseRemoveFormatters ( I_CmsXmlContentLocation node ) { } } | Set < String > removeFormatters = new HashSet < String > ( ) ; for ( I_CmsXmlContentValueLocation removeLoc : node . getSubValues ( N_REMOVE_FORMATTERS + "/" + N_REMOVE_FORMATTER ) ) { CmsXmlVfsFileValue value = ( CmsXmlVfsFileValue ) removeLoc . getValue ( ) ; CmsLink link = value . getLink ( m_cms ) ; if ( link != null ) { removeFormatters . add ( link . getStructureId ( ) . toString ( ) ) ; } } return removeFormatters ; |
public class AlpineResource { /** * Wrapper around { @ link # contOnValidationError ( ValidationTask [ ] ) } but instead of returning
* a list of errors , this method will halt processing of the request by throwing
* a BadRequestException , setting the HTTP status to 400 ( BAD REQUEST ) and providing
* a full list of validation errors in the body of the response .
* Usage :
* < pre >
* List & lt ; ValidationException & gt ; errors = failOnValidationError (
* new ValidationTask ( pattern , input , errorMessage ) ,
* new ValidationTask ( pattern , input , errorMessage )
* / / If validation fails , this line will not be reached .
* < / pre >
* @ param validationTasks an array of one or more ValidationTasks
* @ since 1.0.0 */
protected final void failOnValidationError ( final ValidationTask ... validationTasks ) { } } | final List < ValidationException > errors = contOnValidationError ( validationTasks ) ; if ( ! Collections . isEmpty ( errors ) ) { throw new BadRequestException ( Response . status ( Response . Status . BAD_REQUEST ) . entity ( errors ) . build ( ) ) ; } |
public class BeansDescriptorImpl { /** * If not already created , a new < code > interceptors < / code > element with the given value will be created .
* Otherwise , the existing < code > interceptors < / code > element will be returned .
* @ return a new or existing instance of < code > Interceptors < BeansDescriptor > < / code > */
public Interceptors < BeansDescriptor > getOrCreateInterceptors ( ) { } } | Node node = model . getOrCreate ( "interceptors" ) ; Interceptors < BeansDescriptor > interceptors = new InterceptorsImpl < BeansDescriptor > ( this , "interceptors" , model , node ) ; return interceptors ; |
public class DeploymentReadyOptionMarshaller { /** * Marshall the given parameter object . */
public void marshall ( DeploymentReadyOption deploymentReadyOption , ProtocolMarshaller protocolMarshaller ) { } } | if ( deploymentReadyOption == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( deploymentReadyOption . getActionOnTimeout ( ) , ACTIONONTIMEOUT_BINDING ) ; protocolMarshaller . marshall ( deploymentReadyOption . getWaitTimeInMinutes ( ) , WAITTIMEINMINUTES_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class YasjlAnalyticsDeferredResponseParser { /** * Helper method to initialize the internal response structure once ready . */
private void createResponse ( ) { } } | response = new GenericAnalyticsResponse ( null , queryRowObservable . onBackpressureBuffer ( ) , null , null , null , null , currentRequest , null , null , null ) ; |
public class PercentEscaper { /** * Overridden for performance . For unescaped strings this improved the performance of the uri
* escaper from ~ 400ns to ~ 170ns as measured by { @ link CharEscapersBenchmark } . */
@ Override public String escape ( String s ) { } } | int slen = s . length ( ) ; for ( int index = 0 ; index < slen ; index ++ ) { char c = s . charAt ( index ) ; if ( c >= safeOctets . length || ! safeOctets [ c ] ) { return escapeSlow ( s , index ) ; } } return s ; |
public class Months { /** * Obtains a { @ code Months } from a text string such as { @ code PnM } .
* This will parse the string produced by { @ code toString ( ) } which is
* based on the ISO - 8601 period format { @ code PnYnM } .
* The string starts with an optional sign , denoted by the ASCII negative
* or positive symbol . If negative , the whole amount is negated .
* The ASCII letter " P " is next in upper or lower case .
* There are then two sections , each consisting of a number and a suffix .
* At least one of the two sections must be present .
* The sections have suffixes in ASCII of " Y " and " M " for years and months ,
* accepted in upper or lower case . The suffixes must occur in order .
* The number part of each section must consist of ASCII digits .
* The number may be prefixed by the ASCII negative or positive symbol .
* The number must parse to an { @ code int } .
* The leading plus / minus sign , and negative values for years and months are
* not part of the ISO - 8601 standard .
* For example , the following are valid inputs :
* < pre >
* " P2M " - - Months . of ( 2)
* " P - 2M " - - Months . of ( - 2)
* " - P2M " - - Months . of ( - 2)
* " - P - 2M " - - Months . of ( 2)
* " P3Y " - - Months . of ( 3 * 12)
* " P3Y - 2M " - - Months . of ( 3 * 12 - 2)
* < / pre >
* @ param text the text to parse , not null
* @ return the parsed period , not null
* @ throws DateTimeParseException if the text cannot be parsed to a period */
@ FromString public static Months parse ( CharSequence text ) { } } | Objects . requireNonNull ( text , "text" ) ; Matcher matcher = PATTERN . matcher ( text ) ; if ( matcher . matches ( ) ) { int negate = "-" . equals ( matcher . group ( 1 ) ) ? - 1 : 1 ; String weeksStr = matcher . group ( 2 ) ; String daysStr = matcher . group ( 3 ) ; if ( weeksStr != null || daysStr != null ) { int months = 0 ; if ( daysStr != null ) { try { months = Integer . parseInt ( daysStr ) ; } catch ( NumberFormatException ex ) { throw new DateTimeParseException ( "Text cannot be parsed to a Months, non-numeric months" , text , 0 , ex ) ; } } if ( weeksStr != null ) { try { int years = Math . multiplyExact ( Integer . parseInt ( weeksStr ) , MONTHS_PER_YEAR ) ; months = Math . addExact ( months , years ) ; } catch ( NumberFormatException ex ) { throw new DateTimeParseException ( "Text cannot be parsed to a Months, non-numeric years" , text , 0 , ex ) ; } } return of ( Math . multiplyExact ( months , negate ) ) ; } } throw new DateTimeParseException ( "Text cannot be parsed to a Months" , text , 0 ) ; |
public class VictimsRecord { /** * Create a { @ link VictimsRecord } object when a json string is provided .
* @ param jsonStr
* @ return */
public static VictimsRecord fromJSON ( String jsonStr ) { } } | Gson gson = new GsonBuilder ( ) . setDateFormat ( DATE_FORMAT ) . create ( ) ; return gson . fromJson ( jsonStr , VictimsRecord . class ) ; |
public class UrlRewriterImpl { /** * Copy path fragment
* @ param input
* input string
* @ param beginIndex
* character index from which we look for ' / ' in input
* @ param output
* where path fragments are appended
* @ return last character in fragment + 1 */
private static int copyPathFragment ( char [ ] input , int beginIndex , StringBuilder output ) { } } | int inputCharIndex = beginIndex ; while ( inputCharIndex < input . length ) { final char inputChar = input [ inputCharIndex ] ; if ( inputChar == '/' ) { break ; } output . append ( inputChar ) ; inputCharIndex += 1 ; } return inputCharIndex ; |
public class Deferrers { /** * Check that presented defer actions for the current thread .
* @ return true if presented , false otherwise
* @ since 1.0 */
@ Weight ( Weight . Unit . NORMAL ) public static boolean isEmpty ( ) { } } | final boolean result = REGISTRY . get ( ) . isEmpty ( ) ; if ( result ) { REGISTRY . remove ( ) ; } return result ; |
public class CoreOAuthConsumerSupport { /** * Inherited . */
public InputStream readProtectedResource ( URL url , OAuthConsumerToken accessToken , String httpMethod ) throws OAuthRequestFailedException { } } | if ( accessToken == null ) { throw new OAuthRequestFailedException ( "A valid access token must be supplied." ) ; } ProtectedResourceDetails resourceDetails = getProtectedResourceDetailsService ( ) . loadProtectedResourceDetailsById ( accessToken . getResourceId ( ) ) ; if ( ( ! resourceDetails . isAcceptsAuthorizationHeader ( ) ) && ! "POST" . equalsIgnoreCase ( httpMethod ) && ! "PUT" . equalsIgnoreCase ( httpMethod ) ) { throw new IllegalArgumentException ( "Protected resource " + resourceDetails . getId ( ) + " cannot be accessed with HTTP method " + httpMethod + " because the OAuth provider doesn't accept the OAuth Authorization header." ) ; } return readResource ( resourceDetails , url , httpMethod , accessToken , resourceDetails . getAdditionalParameters ( ) , null ) ; |
public class SObject { /** * Deprecated
* @ see # of ( String , String ) */
@ Deprecated public static SObject valueOf ( String key , String content ) { } } | return of ( key , content ) ; |
public class WaveformPreviewComponent { /** * Look up the playback state that has reached furthest in the track . This is used to render the “ played until ”
* graphic below the preview .
* @ return the playback state , if any , with the highest { @ link PlaybackState # position } value */
public PlaybackState getFurthestPlaybackState ( ) { } } | PlaybackState result = null ; for ( PlaybackState state : playbackStateMap . values ( ) ) { if ( result == null || result . position < state . position ) { result = state ; } } return result ; |
public class SqlFilterManagerImpl { /** * { @ inheritDoc }
* @ see jp . co . future . uroborosql . filter . SqlFilter # doCallableStatement ( jp . co . future . uroborosql . context . SqlContext , java . sql . CallableStatement ) */
@ Override public CallableStatement doCallableStatement ( final SqlContext sqlContext , final CallableStatement callableStatement ) throws SQLException { } } | if ( getFilters ( ) . isEmpty ( ) ) { return callableStatement ; } CallableStatement cs = callableStatement ; for ( final SqlFilter filter : getFilters ( ) ) { cs = filter . doCallableStatement ( sqlContext , cs ) ; } return cs ; |
public class GroupBy { /** * Create a new aggregating map expression using a backing LinkedHashMap
* @ param key key for the map entries
* @ param value value for the map entries
* @ return wrapper expression */
public static < K , V , T , U > AbstractGroupExpression < Pair < K , V > , Map < T , U > > map ( GroupExpression < K , T > key , GroupExpression < V , U > value ) { } } | return new GMap . Mixin < K , V , T , U , Map < T , U > > ( key , value , GMap . createLinked ( QPair . create ( key , value ) ) ) ; |
public class ImgUtil { /** * 写出图像为指定格式
* @ param image { @ link Image }
* @ param imageType 图片类型 ( 图片扩展名 )
* @ param destImageStream 写出到的目标流
* @ param quality 质量 , 数字为0 ~ 1 ( 不包括0和1 ) 表示质量压缩比 , 除此数字外设置表示不压缩
* @ return 是否成功写出 , 如果返回false表示未找到合适的Writer
* @ throws IORuntimeException IO异常
* @ since 4.3.2 */
public static boolean write ( Image image , String imageType , ImageOutputStream destImageStream , float quality ) throws IORuntimeException { } } | if ( StrUtil . isBlank ( imageType ) ) { imageType = IMAGE_TYPE_JPG ; } final ImageWriter writer = getWriter ( image , imageType ) ; return write ( toBufferedImage ( image , imageType ) , writer , destImageStream , quality ) ; |
public class PixelMath { /** * Bounds image pixels to be between these two values
* @ param img Image
* @ param min minimum value .
* @ param max maximum value . */
public static void boundImage ( GrayU16 img , int min , int max ) { } } | ImplPixelMath . boundImage ( img , min , max ) ; |
public class FCMTopicManager { /** * Sends DELETE HTTP request to provided URL . Request is authorized using Google API key .
* @ param urlS target URL string */
private int delete ( String urlS ) throws IOException { } } | URL url = new URL ( urlS ) ; HttpURLConnection conn = prepareAuthorizedConnection ( url ) ; conn . setRequestMethod ( "DELETE" ) ; conn . connect ( ) ; return conn . getResponseCode ( ) ; |
public class SagaModuleBuilder { /** * Creates the module containing all saga lib bindings . */
public Module build ( ) { } } | SagaLibModule module = new SagaLibModule ( ) ; module . setStateStorage ( stateStorage ) ; module . setTimeoutManager ( timeoutMgr ) ; module . setScanner ( scanner ) ; module . setProviderFactory ( providerFactory ) ; module . setExecutionOrder ( preferredOrder ) ; module . setExecutionContext ( executionContext ) ; module . setModuleTypes ( moduleTypes ) ; module . setExecutor ( executor ) ; module . setInterceptorTypes ( interceptorTypes ) ; module . setStrategyFinder ( strategyFinder ) ; module . setInvoker ( invoker ) ; module . setCoordinatorFactory ( coordinatorFactory ) ; return module ; |
public class Tree { /** * According to the spec , to make a dependent node exclusive :
* 1 . make the node the only child of the parent .
* 2 . all previous children of the parent become children of the added node .
* If a set of siblings nodes has any addition or deletion , then restart the priority counting , since priority numbers are derived from each other
* @ param depNode
* @ param exclusiveParentNode
* @ return the Node that was changed , null if the node or the parent node could not be found */
public synchronized boolean makeExclusiveDependency ( Node depNode , Node exclusiveParentNode ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "makeExclusiveDependency entry: depNode: " + depNode + " exclusiveParentNode: " + exclusiveParentNode ) ; } if ( ( depNode == null ) || ( exclusiveParentNode == null ) ) { return false ; } // the dependent node that will have an exclusive parent , that dependent node will need to be the parent of the current parent ' s children
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "make dependent Node parent of all current Parent dependents" ) ; } ArrayList < Node > dependents = exclusiveParentNode . getDependents ( ) ; for ( int i = 0 ; i < dependents . size ( ) ; i ++ ) { Node n = dependents . get ( i ) ; if ( n . getStreamID ( ) != depNode . getStreamID ( ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "node stream-id: " + n . getStreamID ( ) + " will now have a parent stream of: " + depNode . getStreamID ( ) ) ; } n . setParent ( depNode , false ) ; } } exclusiveParentNode . clearDependents ( ) ; // make desired node be the only dependent of this parent
depNode . setParent ( exclusiveParentNode , true ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "set up exclusive parent, clear counts and resort nodes" ) ; } // clear and re - sort where needed
depNode . setWriteCount ( 0 ) ; depNode . clearDependentsWriteCount ( ) ; depNode . sortDependents ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "makeExclusiveDependency exit: depNode changed to: " + depNode . toStringDetails ( ) ) ; } return true ; |
public class WebSocketAddon { /** * < p > getAnnotation . < / p >
* @ param annotationClass a { @ link java . lang . Class } object .
* @ param endpointClass a { @ link java . lang . Class } object .
* @ param < A > a A object .
* @ return a A object . */
protected static < A > A getAnnotation ( Class < A > annotationClass , Class endpointClass ) { } } | if ( endpointClass == Object . class || endpointClass == null ) return null ; A annotation = _getAnnotation ( annotationClass , endpointClass ) ; if ( annotation == null ) { Class sCls = endpointClass . getSuperclass ( ) ; if ( sCls != null ) { annotation = _getAnnotation ( annotationClass , sCls ) ; } if ( annotation == null ) { Class [ ] inces = endpointClass . getInterfaces ( ) ; for ( Class infc : inces ) { annotation = _getAnnotation ( annotationClass , infc ) ; if ( annotation != null ) { return annotation ; } } annotation = getAnnotation ( annotationClass , sCls ) ; if ( annotation == null ) { for ( Class infc : inces ) { annotation = getAnnotation ( annotationClass , infc ) ; if ( annotation != null ) { return annotation ; } } } } } return annotation ; |
public class InJvmContainerExecutor { /** * YARN provides ability to pass resources ( e . g . , classpath ) through
* { @ link LocalResource } s which allows user to provision all the resources
* required to run the app . This method will extract those resources as a
* { @ link Set } of { @ link URL } s so they are used when { @ link ClassLoader } for a
* container is created .
* This is done primarily as a convenience for applications that rely on
* automatic classpath propagation ( e . g . , pull everything from my dev
* classpath ) instead of manual .
* @ param container
* @ return */
private Set < URL > filterAndBuildUserClasspath ( Container container ) { } } | if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Building additional classpath for the container: " + container ) ; } Set < URL > additionalClassPathUrls = new HashSet < URL > ( ) ; Set < Path > userClassPath = this . extractUserProvidedClassPathEntries ( container ) ; for ( Path resourcePath : userClassPath ) { String resourceName = "file:///" + new File ( resourcePath . getName ( ) ) . getAbsolutePath ( ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( "\t adding " + resourceName + " to the classpath" ) ; } try { additionalClassPathUrls . add ( new URI ( resourceName ) . toURL ( ) ) ; } catch ( Exception e ) { throw new IllegalArgumentException ( e ) ; } } return additionalClassPathUrls ; |
public class CoreLoader { /** * Load . */
public void load ( final KunderaMetadata kunderaMetadata ) { } } | log . info ( "Loading Kundera Core Metdata ... " ) ; CoreMetadata coreMetadata = new CoreMetadata ( ) ; coreMetadata . setLazyInitializerFactory ( new CglibLazyInitializerFactory ( ) ) ; kunderaMetadata . setCoreMetadata ( coreMetadata ) ; |
public class VRPResourceManager { /** * Creates a new Virtual Resource Pool .
* @ param spec The VRP is created to have this config . The spec can either have member hubs specified , or the child resource pools . If hubs are specified , a child resource pool will be created within every hub . If child resource pools are specified , the parents of these resource pools will be considered as hubs .
* @ return No description given .
* @ throws InsufficientResourcesFault
* @ throws InvalidState
* @ throws RuntimeFault
* @ throws RemoteException */
public String createVRP ( VirtualResourcePoolSpec spec ) throws InsufficientResourcesFault , InvalidState , RuntimeFault , RemoteException { } } | return getVimService ( ) . createVRP ( getMOR ( ) , spec ) ; |
public class AnnotatedHttpServiceTypeUtil { /** * Validates whether the specified element { @ link Class } is supported .
* Throws { @ link IllegalArgumentException } if it is not supported . */
static Class < ? > validateElementType ( Class < ? > clazz ) { } } | if ( clazz . isEnum ( ) ) { return clazz ; } if ( supportedElementTypes . containsKey ( clazz ) ) { return clazz ; } throw new IllegalArgumentException ( "Parameter type '" + clazz . getName ( ) + "' is not supported." ) ; |
public class OneToOneRingBuffer { /** * { @ inheritDoc } */
public boolean write ( final int msgTypeId , final DirectBuffer srcBuffer , final int srcIndex , final int length ) { } } | checkTypeId ( msgTypeId ) ; checkMsgLength ( length ) ; final AtomicBuffer buffer = this . buffer ; final int recordLength = length + HEADER_LENGTH ; final int alignedRecordLength = align ( recordLength , ALIGNMENT ) ; final int requiredCapacity = alignedRecordLength + HEADER_LENGTH ; final int capacity = this . capacity ; final int tailPositionIndex = this . tailPositionIndex ; final int headCachePositionIndex = this . headCachePositionIndex ; final int mask = capacity - 1 ; long head = buffer . getLong ( headCachePositionIndex ) ; final long tail = buffer . getLong ( tailPositionIndex ) ; final int availableCapacity = capacity - ( int ) ( tail - head ) ; if ( requiredCapacity > availableCapacity ) { head = buffer . getLongVolatile ( headPositionIndex ) ; if ( requiredCapacity > ( capacity - ( int ) ( tail - head ) ) ) { return false ; } buffer . putLong ( headCachePositionIndex , head ) ; } int padding = 0 ; int recordIndex = ( int ) tail & mask ; final int toBufferEndLength = capacity - recordIndex ; if ( requiredCapacity > toBufferEndLength ) { int headIndex = ( int ) head & mask ; if ( requiredCapacity > headIndex ) { head = buffer . getLongVolatile ( headPositionIndex ) ; headIndex = ( int ) head & mask ; if ( requiredCapacity > headIndex ) { return false ; } buffer . putLong ( headCachePositionIndex , head ) ; } padding = toBufferEndLength ; } if ( 0 != padding ) { buffer . putLong ( 0 , 0L ) ; buffer . putInt ( typeOffset ( recordIndex ) , PADDING_MSG_TYPE_ID ) ; buffer . putIntOrdered ( lengthOffset ( recordIndex ) , padding ) ; recordIndex = 0 ; } buffer . putBytes ( encodedMsgOffset ( recordIndex ) , srcBuffer , srcIndex , length ) ; buffer . putLong ( recordIndex + alignedRecordLength , 0L ) ; buffer . putInt ( typeOffset ( recordIndex ) , msgTypeId ) ; buffer . putIntOrdered ( lengthOffset ( recordIndex ) , recordLength ) ; buffer . putLongOrdered ( tailPositionIndex , tail + alignedRecordLength + padding ) ; return true ; |
public class TenantContextDataHolder { /** * This method will execute { @ code runnable . run ( ) } method on behalf of the specified tenant .
* @ param tenant the tenant
* @ param runnable an instance on which { @ code run ( ) } method will be executed */
static void execute ( Tenant tenant , Runnable runnable ) { } } | startTenantFlow ( ) ; try { getThreadLocalInstance ( ) . setTenant ( tenant ) ; runnable . run ( ) ; } finally { endTenantFlow ( ) ; } |
public class StopRemoteAccessSessionRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( StopRemoteAccessSessionRequest stopRemoteAccessSessionRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( stopRemoteAccessSessionRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( stopRemoteAccessSessionRequest . getArn ( ) , ARN_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class Tmpfs { /** * The list of tmpfs volume mount options .
* Valid values :
* < code > " defaults " | " ro " | " rw " | " suid " | " nosuid " | " dev " | " nodev " | " exec " | " noexec " | " sync " | " async " | " dirsync " | " remount " | " mand " | " nomand " | " atime " | " noatime " | " diratime " | " nodiratime " | " bind " | " rbind " | " unbindable " | " runbindable " | " private " | " rprivate " | " shared " | " rshared " | " slave " | " rslave " | " relatime " | " norelatime " | " strictatime " | " nostrictatime " | " mode " | " uid " | " gid " | " nr _ inodes " | " nr _ blocks " | " mpol " < / code >
* @ param mountOptions
* The list of tmpfs volume mount options . < / p >
* Valid values :
* < code > " defaults " | " ro " | " rw " | " suid " | " nosuid " | " dev " | " nodev " | " exec " | " noexec " | " sync " | " async " | " dirsync " | " remount " | " mand " | " nomand " | " atime " | " noatime " | " diratime " | " nodiratime " | " bind " | " rbind " | " unbindable " | " runbindable " | " private " | " rprivate " | " shared " | " rshared " | " slave " | " rslave " | " relatime " | " norelatime " | " strictatime " | " nostrictatime " | " mode " | " uid " | " gid " | " nr _ inodes " | " nr _ blocks " | " mpol " < / code > */
public void setMountOptions ( java . util . Collection < String > mountOptions ) { } } | if ( mountOptions == null ) { this . mountOptions = null ; return ; } this . mountOptions = new com . amazonaws . internal . SdkInternalList < String > ( mountOptions ) ; |
public class MOA { /** * Returns an enumeration describing the available options .
* @ return an enumeration of all the available options . */
public Enumeration listOptions ( ) { } } | Vector result = new Vector ( ) ; result . addElement ( new Option ( "\tThe MOA classifier to use.\n" + "\t(default: " + MOAUtils . toCommandLine ( new DecisionStump ( ) ) + ")" , "B" , 1 , "-B <classname + options>" ) ) ; Enumeration en = super . listOptions ( ) ; while ( en . hasMoreElements ( ) ) result . addElement ( en . nextElement ( ) ) ; return result . elements ( ) ; |
public class TzServer { /** * See if we have a url for the service . If not discover the real one .
* < p > If the uri is parseable we won ' t even attempt the / . well - known approach .
* It implies we have a scheme etc .
* < p > Otherwise we will assume it ' s a host attempt to discover it through
* / . well - known
* @ param url the service url
* @ return discovered url
* @ throws TimezonesException on error */
private String discover ( final String url ) throws TimezonesException { } } | /* For the moment we ' ll try to find it via . well - known . We may have to
* use DNS SRV lookups */
// String domain = hi . getHostname ( ) ;
// int lpos = domain . lastIndexOf ( " . " ) ;
// int lpos2 = domain . lastIndexOf ( " . " , lpos - 1 ) ;
// if ( lpos2 > 0 ) {
// domain = domain . substring ( lpos2 + 1 ) ;
String realUrl ; try { /* See if it ' s a real url */
new URL ( url ) ; realUrl = url ; } catch ( final Throwable t ) { realUrl = "https://" + url + "/.well-known/timezone" ; } for ( int redirects = 0 ; redirects < 10 ; redirects ++ ) { try ( CloseableHttpResponse hresp = doCall ( realUrl , "capabilities" , null , null ) ) { if ( ( status == HttpServletResponse . SC_MOVED_PERMANENTLY ) || ( status == HttpServletResponse . SC_MOVED_TEMPORARILY ) || ( status == HttpServletResponse . SC_TEMPORARY_REDIRECT ) ) { // boolean permanent = rcode = = HttpServletResponse . SC _ MOVED _ PERMANENTLY ;
final String newLoc = HttpUtil . getFirstHeaderValue ( hresp , "location" ) ; if ( newLoc != null ) { if ( debug ( ) ) { debug ( "Got redirected to " + newLoc + " from " + url ) ; } final int qpos = newLoc . indexOf ( "?" ) ; if ( qpos < 0 ) { realUrl = newLoc ; } else { realUrl = newLoc . substring ( 0 , qpos ) ; } // Try again
continue ; } } if ( status != HttpServletResponse . SC_OK ) { // The response is invalid and did not provide the new location for
// the resource . Report an error or possibly handle the response
// like a 404 Not Found error .
error ( "================================================" ) ; error ( "================================================" ) ; error ( "================================================" ) ; error ( "Got response " + status + ", from " + realUrl ) ; error ( "================================================" ) ; error ( "================================================" ) ; error ( "================================================" ) ; throw new TimezonesException ( TimezonesException . noPrimary , "Got response " + status + ", from " + realUrl ) ; } /* Should have a capabilities record . */
try { capabilities = om . readValue ( hresp . getEntity ( ) . getContent ( ) , CapabilitiesType . class ) ; } catch ( final Throwable t ) { // Bad data - we ' ll just go with the url for the moment ?
error ( t ) ; } return realUrl ; } catch ( final TimezonesException tze ) { throw tze ; } catch ( final Throwable t ) { if ( debug ( ) ) { error ( t ) ; } throw new TimezonesException ( t ) ; } } if ( debug ( ) ) { error ( "Too many redirects: Got response " + status + ", from " + realUrl ) ; } throw new TimezonesException ( "Too many redirects on " + realUrl ) ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.