signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class TrainingsImpl { /** * Get the list of exports for a specific iteration .
* @ param projectId The project id
* @ param iterationId The iteration id
* @ 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 < Export > > getExportsAsync ( UUID projectId , UUID iterationId , final ServiceCallback < List < Export > > serviceCallback ) { } } | return ServiceFuture . fromResponse ( getExportsWithServiceResponseAsync ( projectId , iterationId ) , serviceCallback ) ; |
public class PureFunctionIdentifier { /** * Return { @ code true } only if { @ code rvalue } is defintely a reference reading a value .
* < p > For the most part it ' s sufficient to cover cases where a nominal function reference might
* reasonably be expected , since those are the values that matter to analysis .
* < p > It ' s very important that this never returns { @ code true } for an L - value , including when new
* syntax is added to the language . That would cause some impure functions to be considered pure .
* Therefore , this method is a very explict whitelist . Anything that ' s unrecognized is considered
* not an R - value . This is insurance against new syntax .
* < p > New cases can be added as needed to increase the accuracy of the analysis . They just have to
* be verified as always R - values . */
private static boolean isDefinitelyRValue ( Node rvalue ) { } } | Node parent = rvalue . getParent ( ) ; switch ( parent . getToken ( ) ) { case AND : case COMMA : case HOOK : case OR : // Function values pass through conditionals .
case EQ : case NOT : case SHEQ : // Functions can be usefully compared for equality / existence .
case ARRAYLIT : case CALL : case NEW : case TAGGED_TEMPLATELIT : // Functions are the callees and parameters of an invocation .
case INSTANCEOF : case TYPEOF : // Often used to determine if a ctor / method exists / matches .
case GETELEM : case GETPROP : // Many functions , especially ctors , have properties .
case RETURN : case YIELD : // Higher order functions return functions .
return true ; case SWITCH : case CASE : // Delegating on the identity of a function .
case IF : case WHILE : // Checking the existence of an optional function .
return rvalue . isFirstChildOf ( parent ) ; case EXPR_RESULT : // Extern declarations are sometimes stubs . These must be considered L - values with no
// associated R - values .
return ! rvalue . isFromExterns ( ) ; case CLASS : // ` extends ` clause .
case ASSIGN : return rvalue . isSecondChildOf ( parent ) ; case STRING_KEY : // Assignment to an object literal property . Excludes object destructuring .
return parent . getParent ( ) . isObjectLit ( ) ; default : // Anything not explicitly listed may not be an R - value . We only worry about the likely
// cases for nominal function values since those are what interest us and its safe to miss
// some R - values . It ' s more important that we correctly identify L - values .
return false ; } |
public class LastSplits { /** * Compute mean duration of splits in the buffer
* @ return Mean or average */
public Double getMean ( ) { } } | return processFunction ( new AbstractSplitFunction < Double > ( 0.0D ) { @ Override public void evaluate ( long runningFor ) { result += ( double ) runningFor ; } @ Override public Double result ( ) { return result / ( double ) splits . size ( ) ; } } ) ; |
public class CmsListManager { /** * Closes the edit dialog window . < p > */
void closeEditDialog ( ) { } } | if ( m_dialogWindow != null ) { m_dialogWindow . close ( ) ; m_dialogWindow = null ; } if ( m_isOverView ) { unlockCurrent ( ) ; m_currentResource = null ; } |
public class ContainerTx { /** * Get snapshot of all beans enlisted in current transaction .
* Note , it is important to release the lock on the beanOs
* hashtable , in case storing the bean ' s persistent state
* causes a recursive call to this method ( this is probably
* bad , but at least we won ' t hang in the recursive call ) . */
protected BeanO [ ] getAllEnlistedBeanOs ( ) { } } | if ( beanOs == null ) return null ; // d111555
BeanO result [ ] ; // d122418-5
// synchronized ( beanOs ) { / / d173022.2
// d140003.22 - - changed for less code , better performance
result = beanOList . toArray ( new BeanO [ beanOList . size ( ) ] ) ; return result ; |
public class TriangularSolver_DSCC { /** * Solves for a lower triangular matrix against a dense matrix . L * x = b
* @ param L Lower triangular matrix . Diagonal elements are assumed to be non - zero
* @ param x ( Input ) Solution matrix ' b ' . ( Output ) matrix ' x ' */
public static void solveL ( DMatrixSparseCSC L , double [ ] x ) { } } | final int N = L . numCols ; int idx0 = L . col_idx [ 0 ] ; for ( int col = 0 ; col < N ; col ++ ) { int idx1 = L . col_idx [ col + 1 ] ; double x_j = x [ col ] /= L . nz_values [ idx0 ] ; for ( int i = idx0 + 1 ; i < idx1 ; i ++ ) { int row = L . nz_rows [ i ] ; x [ row ] -= L . nz_values [ i ] * x_j ; } idx0 = idx1 ; } |
public class SystemTimersPrecision { /** * Entry point of the demo application .
* @ param args command line arguments */
public static void main ( String [ ] args ) { } } | for ( int round = 1 ; round <= 5 ; round ++ ) { Map < Long , Integer > deltaMsCount = new TreeMap < > ( ) ; Map < Long , Integer > deltaNsCount = new TreeMap < > ( ) ; System . out . println ( "\nRound: " + round ) ; long msChanges = 0 ; long nsChanges = 0 ; long initMs = System . currentTimeMillis ( ) ; long initNs = System . nanoTime ( ) ; long ms = initMs ; long ns = initNs ; for ( int i = 0 ; i < LOOP ; i ++ ) { long newMs = System . currentTimeMillis ( ) ; long newNs = System . nanoTime ( ) ; if ( newMs != ms ) { long delta = newMs - ms ; Integer count = deltaMsCount . get ( delta ) ; if ( count == null ) { count = 0 ; } deltaMsCount . put ( delta , ++ count ) ; msChanges ++ ; } if ( newNs != ns ) { long delta = newNs - ns ; Integer count = deltaNsCount . get ( delta ) ; if ( count == null ) { count = 0 ; } deltaNsCount . put ( delta , ++ count ) ; nsChanges ++ ; } ms = newMs ; ns = newNs ; } System . out . println ( "msChanges: " + msChanges + " during " + ( System . currentTimeMillis ( ) - initMs ) + " ms" ) ; System . out . println ( "deltaMsCount = " + deltaMsCount ) ; System . out . println ( "nsChanges: " + nsChanges + " during " + ( System . nanoTime ( ) - initNs ) + " ns" ) ; System . out . println ( "deltaNsCount = " + deltaNsCount ) ; // now something else . . .
long msCount = 0 ; initMs = System . currentTimeMillis ( ) ; while ( true ) { long newMs = System . currentTimeMillis ( ) ; msCount ++ ; if ( newMs - initMs >= MS_RUN ) { break ; } } System . out . println ( "currentTimeMillis msCount = " + msCount ) ; long nsCount = 0 ; initMs = System . nanoTime ( ) / 1000000 ; while ( true ) { long newMs = System . nanoTime ( ) / 1000000 ; nsCount ++ ; if ( newMs - initMs >= MS_RUN ) { break ; } } System . out . println ( "nanoTime msCount = " + nsCount ) ; System . out . println ( "Ratio ms/ns: " + msCount / ( double ) nsCount ) ; } for ( int round = 1 ; round <= LOOP ; round ++ ) { long ns1 = System . nanoTime ( ) ; long ns2 = System . nanoTime ( ) ; long ns3 = System . nanoTime ( ) ; long ns4 = System . nanoTime ( ) ; long ns5 = System . nanoTime ( ) ; if ( round % ( LOOP / 5 ) == 0 ) { System . out . println ( "\nns1 = " + ns1 ) ; System . out . println ( "ns2 = " + ns2 + " (diff: " + ( ns2 - ns1 ) + ")" ) ; System . out . println ( "ns3 = " + ns3 + " (diff: " + ( ns3 - ns2 ) + ")" ) ; System . out . println ( "ns4 = " + ns4 + " (diff: " + ( ns4 - ns3 ) + ")" ) ; System . out . println ( "ns5 = " + ns5 + " (diff: " + ( ns5 - ns4 ) + ")" ) ; } } System . out . println ( ) ; // last thing - we will count how many nanoTimes in a row will have the same value
for ( int round = 1 ; round <= LOOP ; round ++ ) { long val = System . nanoTime ( ) ; int count = 1 ; while ( val == System . nanoTime ( ) ) { count ++ ; } if ( round % ( LOOP / 5 ) == 0 ) { System . out . println ( "Change after " + count + " calls" ) ; } } |
public class PrimitiveUtils { /** * Write long .
* @ param value the value
* @ return the string */
public static String writeLong ( Long value ) { } } | if ( value == null ) return null ; return Long . toString ( value ) ; |
public class Nfs3 { /** * ( non - Javadoc )
* @ see
* com . emc . ecs . nfsclient . nfs . Nfs # sendLink ( com . emc . ecs . nfsclient . nfs . NfsLinkRequest ) */
public Nfs3LinkResponse sendLink ( NfsLinkRequest request ) throws IOException { } } | Nfs3LinkResponse response = new Nfs3LinkResponse ( ) ; _rpcWrapper . callRpcNaked ( request , response ) ; return response ; |
public class AbstractConnectorServlet { /** * Append data to JSON response .
* @ param param
* @ param value */
protected void putResponse ( JSONObject json , String param , Object value ) { } } | try { json . put ( param , value ) ; } catch ( JSONException e ) { logger . error ( "json write error" , e ) ; } |
public class LexiconUtility { /** * 设置某个单词的属性
* @ param word
* @ param natureWithFrequency
* @ return */
public static boolean setAttribute ( String word , String natureWithFrequency ) { } } | CoreDictionary . Attribute attribute = CoreDictionary . Attribute . create ( natureWithFrequency ) ; return setAttribute ( word , attribute ) ; |
public class UpdateVirtualServiceRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( UpdateVirtualServiceRequest updateVirtualServiceRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( updateVirtualServiceRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( updateVirtualServiceRequest . getClientToken ( ) , CLIENTTOKEN_BINDING ) ; protocolMarshaller . marshall ( updateVirtualServiceRequest . getMeshName ( ) , MESHNAME_BINDING ) ; protocolMarshaller . marshall ( updateVirtualServiceRequest . getSpec ( ) , SPEC_BINDING ) ; protocolMarshaller . marshall ( updateVirtualServiceRequest . getVirtualServiceName ( ) , VIRTUALSERVICENAME_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public EClass getIfcMonetaryMeasure ( ) { } } | if ( ifcMonetaryMeasureEClass == null ) { ifcMonetaryMeasureEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 845 ) ; } return ifcMonetaryMeasureEClass ; |
public class FaceListsImpl { /** * Update information of a face list .
* @ param faceListId Id referencing a particular face list .
* @ param updateOptionalParameter the object representing the optional parameters to be set before calling this API
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the { @ link ServiceResponse } object if successful . */
public Observable < Void > updateAsync ( String faceListId , UpdateFaceListsOptionalParameter updateOptionalParameter ) { } } | return updateWithServiceResponseAsync ( faceListId , updateOptionalParameter ) . map ( new Func1 < ServiceResponse < Void > , Void > ( ) { @ Override public Void call ( ServiceResponse < Void > response ) { return response . body ( ) ; } } ) ; |
public class BinaryStringUtils { /** * Same as { @ link # zeroPadString ( String , int ) } , but determines { @ code minLength } automatically . */
public static final String zeroPadString ( final String binaryString ) { } } | int minLength = ( int ) Math . ceil ( binaryString . length ( ) / 4. ) * 4 ; return zeroPadString ( binaryString , minLength ) ; |
public class BlockLocation { /** * < code > optional string tierAlias = 3 ; < / code > */
public com . google . protobuf . ByteString getTierAliasBytes ( ) { } } | java . lang . Object ref = tierAlias_ ; if ( ref instanceof java . lang . String ) { com . google . protobuf . ByteString b = com . google . protobuf . ByteString . copyFromUtf8 ( ( java . lang . String ) ref ) ; tierAlias_ = b ; return b ; } else { return ( com . google . protobuf . ByteString ) ref ; } |
public class HBCIKernel { /** * / * Processes the current message ( mid - level API ) .
* This method creates the message specified earlier by the methods rawNewJob ( ) and
* rawSet ( ) , signs and encrypts it using the values of @ p inst , @ p user , @ p signit
* and @ p crypit and sends it to server .
* After that it waits for the response , decrypts it , checks the signature of the
* received message and returns a Properties object , that contains as keys the
* pathnames of all elements of the received message , and as values the corresponding
* value of the element with that path
* bricht diese methode mit einer exception ab , so muss die aufrufende methode
* die nachricht komplett neu erzeugen .
* @ param signit A boolean value specifying , if the message to be sent should be signed .
* @ param cryptit A boolean value specifying , if the message to be sent should be encrypted .
* @ return A Properties object that contains a path - value - pair for each dataelement of
* the received message . */
public HBCIMsgStatus rawDoIt ( Message message , boolean signit , boolean cryptit ) { } } | HBCIMsgStatus msgStatus = new HBCIMsgStatus ( ) ; try { message . complete ( ) ; log . debug ( "generating raw message " + message . getName ( ) ) ; passport . getCallback ( ) . status ( HBCICallback . STATUS_MSG_CREATE , message . getName ( ) ) ; // liste der rewriter erzeugen
ArrayList < Rewrite > rewriters = getRewriters ( passport . getProperties ( ) . get ( "kernel.rewriter" ) ) ; // alle rewriter durchlaufen und plaintextnachricht patchen
for ( Rewrite rewriter1 : rewriters ) { message = rewriter1 . outgoingClearText ( message ) ; } // wenn nachricht signiert werden soll
if ( signit ) { message = signMessage ( message , rewriters ) ; } processMessage ( message , msgStatus ) ; String messageName = message . getName ( ) ; // soll nachricht verschlüsselt werden ?
if ( cryptit ) { message = cryptMessage ( message , rewriters ) ; } sendMessage ( message , messageName , msgStatus , rewriters ) ; } catch ( Exception e ) { // TODO : hack to be able to " disable " HKEND response message analysis
// because some credit institutes are buggy regarding HKEND responses
String paramName = "client.errors.ignoreDialogEndErrors" ; if ( message . getName ( ) . startsWith ( "DialogEnd" ) ) { log . error ( e . getMessage ( ) , e ) ; log . warn ( "error while receiving DialogEnd response - " + "but ignoring it because of special setting" ) ; } else { msgStatus . addException ( e ) ; } } return msgStatus ; |
public class JCollapsiblePaneBeanInfo { /** * Gets the Property Descriptors .
* @ return The propertyDescriptors value */
@ Override public PropertyDescriptor [ ] getPropertyDescriptors ( ) { } } | try { ArrayList < PropertyDescriptor > descriptors = new ArrayList < PropertyDescriptor > ( ) ; PropertyDescriptor descriptor ; try { descriptor = new PropertyDescriptor ( "animated" , com . l2fprod . common . swing . JCollapsiblePane . class ) ; } catch ( IntrospectionException e ) { descriptor = new PropertyDescriptor ( "animated" , com . l2fprod . common . swing . JCollapsiblePane . class , "getAnimated" , null ) ; } descriptor . setPreferred ( true ) ; descriptor . setBound ( true ) ; descriptors . add ( descriptor ) ; try { descriptor = new PropertyDescriptor ( "collapsed" , com . l2fprod . common . swing . JCollapsiblePane . class ) ; } catch ( IntrospectionException e ) { descriptor = new PropertyDescriptor ( "collapsed" , com . l2fprod . common . swing . JCollapsiblePane . class , "getCollapsed" , null ) ; } descriptor . setPreferred ( true ) ; descriptor . setBound ( true ) ; descriptors . add ( descriptor ) ; return ( PropertyDescriptor [ ] ) descriptors . toArray ( new PropertyDescriptor [ descriptors . size ( ) ] ) ; } catch ( Exception e ) { // do not ignore , bomb politely so use has chance to discover what went
// wrong . . .
// I know that this is suboptimal solution , but swallowing silently is
// even worse . . . Propose better solution !
Logger . getLogger ( JCollapsiblePane . class . getName ( ) ) . log ( Level . SEVERE , null , e ) ; } return null ; |
public class WebSocketNativeEncoderImpl { /** * Performs an in - situ unmasking of the readable buf bytes .
* Preserves the position of the buffer whilst unmasking all the readable bytes ,
* such that the unmasked bytes will be readable after this invocation .
* @ param buf the buffer containing readable bytes to be unmasked .
* @ param mask the mask to apply against the readable bytes of buffer . */
public static void unmask ( WrappedByteBuffer buf , int mask ) { } } | byte b ; int remainder = buf . remaining ( ) % 4 ; int remaining = buf . remaining ( ) - remainder ; int end = remaining + buf . position ( ) ; // xor a 32bit word at a time as long as possible
while ( buf . position ( ) < end ) { int plaintext = buf . getIntAt ( buf . position ( ) ) ^ mask ; buf . putInt ( plaintext ) ; } // xor the remaining 3 , 2 , or 1 bytes
switch ( remainder ) { case 3 : b = ( byte ) ( buf . getAt ( buf . position ( ) ) ^ ( ( mask >> 24 ) & 0xff ) ) ; buf . put ( b ) ; b = ( byte ) ( buf . getAt ( buf . position ( ) ) ^ ( ( mask >> 16 ) & 0xff ) ) ; buf . put ( b ) ; b = ( byte ) ( buf . getAt ( buf . position ( ) ) ^ ( ( mask >> 8 ) & 0xff ) ) ; buf . put ( b ) ; break ; case 2 : b = ( byte ) ( buf . getAt ( buf . position ( ) ) ^ ( ( mask >> 24 ) & 0xff ) ) ; buf . put ( b ) ; b = ( byte ) ( buf . getAt ( buf . position ( ) ) ^ ( ( mask >> 16 ) & 0xff ) ) ; buf . put ( b ) ; break ; case 1 : b = ( byte ) ( buf . getAt ( buf . position ( ) ) ^ ( mask >> 24 ) ) ; buf . put ( b ) ; break ; case 0 : default : break ; } // buf . position ( start ) ; |
public class br_configurebandwidth5x { /** * < pre >
* Performs generic data validation for the operation to be performed
* < / pre > */
protected void validate ( String operationType ) throws Exception { } } | super . validate ( operationType ) ; MPSString bandwidth_validator = new MPSString ( ) ; bandwidth_validator . setConstraintIsReq ( MPSConstants . GENERIC_CONSTRAINT , true ) ; bandwidth_validator . validate ( operationType , bandwidth , "\"bandwidth\"" ) ; MPSString boostmode_validator = new MPSString ( ) ; boostmode_validator . setConstraintIsReq ( MPSConstants . GENERIC_CONSTRAINT , true ) ; boostmode_validator . setConstraintMaxStrLen ( MPSConstants . GENERIC_CONSTRAINT , 128 ) ; boostmode_validator . setConstraintMinStrLen ( MPSConstants . GENERIC_CONSTRAINT , 1 ) ; boostmode_validator . validate ( operationType , boostmode , "\"boostmode\"" ) ; MPSInt min_rate_validator = new MPSInt ( ) ; min_rate_validator . setConstraintIsReq ( MPSConstants . GENERIC_CONSTRAINT , true ) ; min_rate_validator . validate ( operationType , min_rate , "\"min_rate\"" ) ; MPSInt send_limit_validator = new MPSInt ( ) ; send_limit_validator . setConstraintIsReq ( MPSConstants . GENERIC_CONSTRAINT , true ) ; send_limit_validator . validate ( operationType , send_limit , "\"send_limit\"" ) ; MPSInt receive_limit_validator = new MPSInt ( ) ; receive_limit_validator . setConstraintIsReq ( MPSConstants . GENERIC_CONSTRAINT , true ) ; receive_limit_validator . validate ( operationType , receive_limit , "\"receive_limit\"" ) ; MPSIPAddress br_ip_address_arr_validator = new MPSIPAddress ( ) ; br_ip_address_arr_validator . setConstraintIsReq ( MPSConstants . GENERIC_CONSTRAINT , true ) ; if ( br_ip_address_arr != null ) { for ( int i = 0 ; i < br_ip_address_arr . length ; i ++ ) { br_ip_address_arr_validator . validate ( operationType , br_ip_address_arr [ i ] , "br_ip_address_arr[" + i + "]" ) ; } } |
public class AreaSizeConversions { /** * Convert an area size .
* @ param a The area size
* @ param < S > A phantom type parameter indicating the coordinate space of the
* area size
* @ return An area size */
public static < S > AreaSizeF toAreaSizeF ( final PAreaSizeF < S > a ) { } } | Objects . requireNonNull ( a , "area size" ) ; return AreaSizeF . of ( a . sizeX ( ) , a . sizeY ( ) ) ; |
public class FTPClient { /** * Reserve sufficient storage to accommodate the new file to be
* transferred .
* @ param size the amount of space to reserve
* @ exception ServerException if an error occured . */
public void allocate ( long size ) throws IOException , ServerException { } } | Command cmd = new Command ( "ALLO" , String . valueOf ( size ) ) ; Reply reply = null ; try { reply = controlChannel . execute ( cmd ) ; } catch ( UnexpectedReplyCodeException urce ) { throw ServerException . embedUnexpectedReplyCodeException ( urce ) ; } catch ( FTPReplyParseException rpe ) { throw ServerException . embedFTPReplyParseException ( rpe ) ; } |
public class AWSRoboMakerClient { /** * Creates a robot .
* @ param createRobotRequest
* @ return Result of the CreateRobot 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 ResourceAlreadyExistsException
* The specified resource already exists .
* @ sample AWSRoboMaker . CreateRobot
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / robomaker - 2018-06-29 / CreateRobot " target = " _ top " > AWS API
* Documentation < / a > */
@ Override public CreateRobotResult createRobot ( CreateRobotRequest request ) { } } | request = beforeClientExecution ( request ) ; return executeCreateRobot ( request ) ; |
public class ModuleAssets { /** * Create a new Asset .
* In case the given { @ code asset } has an ID associated with it , that ID will be used ,
* otherwise the server will auto - generate an ID that will be contained in the response upon
* success .
* This method will override the configuration specified through
* { @ link CMAClient . Builder # setSpaceId ( String ) } and
* { @ link CMAClient . Builder # setEnvironmentId ( String ) } .
* @ param spaceId Space ID
* @ param environmentId Environment ID
* @ param asset Asset
* @ return { @ link CMAAsset } result instance
* @ throws IllegalArgumentException if asset is null .
* @ throws IllegalArgumentException if asset space id is null .
* @ throws IllegalArgumentException if asset environment id is null . */
public CMAAsset create ( String spaceId , String environmentId , CMAAsset asset ) { } } | assertNotNull ( spaceId , "spaceId" ) ; assertNotNull ( environmentId , "environmentId" ) ; assertNotNull ( asset , "asset" ) ; final String assetId = asset . getId ( ) ; final CMASystem sys = asset . getSystem ( ) ; asset . setSystem ( null ) ; try { if ( assetId == null ) { return service . create ( spaceId , environmentId , asset ) . blockingFirst ( ) ; } else { return service . create ( spaceId , environmentId , assetId , asset ) . blockingFirst ( ) ; } } finally { asset . setSystem ( sys ) ; } |
public class BasicRegistry { /** * { @ inheritDoc } */
@ Override public String getGroupSecurityName ( String uniqueGroupId ) throws EntryNotFoundException , RegistryException { } } | if ( uniqueGroupId == null ) { throw new IllegalArgumentException ( "uniqueGroupId is null" ) ; } if ( uniqueGroupId . isEmpty ( ) ) { throw new IllegalArgumentException ( "uniqueGroupId is an empty String" ) ; } if ( ! isValidGroup ( uniqueGroupId ) ) { throw new EntryNotFoundException ( uniqueGroupId + " does not exist" ) ; } return uniqueGroupId ; |
public class Primitive { /** * Get the appropriate default value per JLS 4.5.4 */
public static Primitive getDefaultValue ( Class < ? > type ) { } } | if ( type == null ) return Primitive . NULL ; if ( Boolean . TYPE == type || Boolean . class == type ) return Primitive . FALSE ; if ( Character . TYPE == type || Character . class == type ) return Primitive . ZERO_CHAR ; if ( Byte . TYPE == type || Byte . class == type ) return Primitive . ZERO_BYTE ; if ( Short . TYPE == type || Short . class == type ) return Primitive . ZERO_SHORT ; if ( Integer . TYPE == type || Integer . class == type ) return Primitive . ZERO_INT ; if ( Long . TYPE == type || Long . class == type ) return Primitive . ZERO_LONG ; if ( Float . TYPE == type || Float . class == type ) return Primitive . ZERO_FLOAT ; if ( Double . TYPE == type || Double . class == type ) return Primitive . ZERO_DOUBLE ; if ( BigInteger . class == type ) return Primitive . ZERO_BIG_INTEGER ; if ( BigDecimal . class == type ) return Primitive . ZERO_BIG_DECIMAL ; return Primitive . NULL ; |
public class MetaDataServiceImpl { /** * Add and update entity attributes
* @ param entityType entity meta data
* @ param existingEntityType existing entity meta data */
private void upsertAttributes ( EntityType entityType , EntityType existingEntityType ) { } } | // analyze both compound and atomic attributes owned by the entity
Map < String , Attribute > attrsMap = stream ( entityType . getOwnAllAttributes ( ) ) . collect ( toMap ( Attribute :: getName , Function . identity ( ) ) ) ; Map < String , Attribute > existingAttrsMap = stream ( existingEntityType . getOwnAllAttributes ( ) ) . collect ( toMap ( Attribute :: getName , Function . identity ( ) ) ) ; // determine attributes to add , update and delete
Set < String > addedAttrNames = Sets . difference ( attrsMap . keySet ( ) , existingAttrsMap . keySet ( ) ) ; Set < String > sharedAttrNames = Sets . intersection ( attrsMap . keySet ( ) , existingAttrsMap . keySet ( ) ) ; Set < String > deletedAttrNames = Sets . difference ( existingAttrsMap . keySet ( ) , attrsMap . keySet ( ) ) ; // add new attributes
if ( ! addedAttrNames . isEmpty ( ) ) { dataService . add ( ATTRIBUTE_META_DATA , addedAttrNames . stream ( ) . map ( attrsMap :: get ) ) ; } // update changed attributes
List < String > updatedAttrNames = sharedAttrNames . stream ( ) . filter ( attrName -> ! EntityUtils . equals ( attrsMap . get ( attrName ) , existingAttrsMap . get ( attrName ) ) ) . collect ( toList ( ) ) ; if ( ! updatedAttrNames . isEmpty ( ) ) { dataService . update ( ATTRIBUTE_META_DATA , updatedAttrNames . stream ( ) . map ( attrsMap :: get ) ) ; } // delete removed attributes
if ( ! deletedAttrNames . isEmpty ( ) ) { dataService . delete ( ATTRIBUTE_META_DATA , deletedAttrNames . stream ( ) . map ( existingAttrsMap :: get ) ) ; } |
public class XStringForFSB { /** * Compares this < code > String < / code > to another < code > String < / code > ,
* ignoring case considerations . Two strings are considered equal
* ignoring case if they are of the same length , and corresponding
* characters in the two strings are equal ignoring case .
* @ param anotherString the < code > String < / code > to compare this
* < code > String < / code > against .
* @ return < code > true < / code > if the argument is not < code > null < / code >
* and the < code > String < / code > s are equal ,
* ignoring case ; < code > false < / code > otherwise .
* @ see # equals ( Object )
* @ see java . lang . Character # toLowerCase ( char )
* @ see java . lang . Character # toUpperCase ( char ) */
public boolean equalsIgnoreCase ( String anotherString ) { } } | return ( m_length == anotherString . length ( ) ) ? str ( ) . equalsIgnoreCase ( anotherString ) : false ; |
public class SkipProcessor { /** * ~ Methoden - - - - - */
@ Override public int print ( ChronoDisplay formattable , Appendable buffer , AttributeQuery attributes , Set < ElementPosition > positions , boolean quickPath ) throws IOException { } } | return 0 ; |
public class CmsLinkRewriter { /** * Rewrites relations which are not derived from links in the content itself . < p >
* @ param res the resource for which to rewrite the relations
* @ param relations the original relations
* @ throws CmsException if something goes wrong */
protected void rewriteOtherRelations ( CmsResource res , Collection < CmsRelation > relations ) throws CmsException { } } | LOG . info ( "Rewriting non-content links for " + res . getRootPath ( ) ) ; for ( CmsRelation rel : relations ) { CmsUUID targetId = rel . getTargetId ( ) ; CmsResource newTargetResource = m_translationsById . get ( targetId ) ; CmsRelationType relType = rel . getType ( ) ; if ( ! relType . isDefinedInContent ( ) ) { if ( newTargetResource != null ) { m_cms . deleteRelationsFromResource ( rel . getSourcePath ( ) , CmsRelationFilter . TARGETS . filterStructureId ( rel . getTargetId ( ) ) . filterType ( relType ) ) ; m_cms . addRelationToResource ( rel . getSourcePath ( ) , newTargetResource . getRootPath ( ) , relType . getName ( ) ) ; } } } |
public class ChainResolver { /** * Resolves all keys within the given chain to their equivalent put operations .
* @ param chain target chain
* @ return a map of equivalent put operations */
protected Map < K , PutOperation < K , V > > resolveAll ( Chain chain ) { } } | // absent hash - collisions this should always be a 1 entry map
Map < K , PutOperation < K , V > > compacted = new HashMap < > ( 2 ) ; for ( Element element : chain ) { ByteBuffer payload = element . getPayload ( ) ; Operation < K , V > operation = codec . decode ( payload ) ; compacted . compute ( operation . getKey ( ) , ( k , v ) -> applyOperation ( k , v , operation ) ) ; } return compacted ; |
public class UserAlias { /** * Returns the name of this alias if path has been added
* to the aliased portions of attributePath
* @ param path the path to test for inclusion in the alias */
public String getAlias ( String path ) { } } | if ( m_allPathsAliased && m_attributePath . lastIndexOf ( path ) != - 1 ) { return m_name ; } Object retObj = m_mapping . get ( path ) ; if ( retObj != null ) { return ( String ) retObj ; } return null ; |
public class JobStepsInner { /** * Gets all job steps in the specified job version .
* @ 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 .
* @ param jobName The name of the job to get .
* @ param jobVersion The version of the job to get .
* @ param serviceCallback the async ServiceCallback to handle successful and failed responses .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the { @ link ServiceFuture } object */
public ServiceFuture < List < JobStepInner > > listByVersionAsync ( final String resourceGroupName , final String serverName , final String jobAgentName , final String jobName , final int jobVersion , final ListOperationCallback < JobStepInner > serviceCallback ) { } } | return AzureServiceFuture . fromPageResponse ( listByVersionSinglePageAsync ( resourceGroupName , serverName , jobAgentName , jobName , jobVersion ) , new Func1 < String , Observable < ServiceResponse < Page < JobStepInner > > > > ( ) { @ Override public Observable < ServiceResponse < Page < JobStepInner > > > call ( String nextPageLink ) { return listByVersionNextSinglePageAsync ( nextPageLink ) ; } } , serviceCallback ) ; |
public class OMVRBTree { /** * From CLR */
private void fixAfterDeletion ( OMVRBTreeEntry < K , V > x ) { } } | while ( x != root && colorOf ( x ) == BLACK ) { if ( x == leftOf ( parentOf ( x ) ) ) { OMVRBTreeEntry < K , V > sib = rightOf ( parentOf ( x ) ) ; if ( colorOf ( sib ) == RED ) { setColor ( sib , BLACK ) ; setColor ( parentOf ( x ) , RED ) ; rotateLeft ( parentOf ( x ) ) ; sib = rightOf ( parentOf ( x ) ) ; } if ( colorOf ( leftOf ( sib ) ) == BLACK && colorOf ( rightOf ( sib ) ) == BLACK ) { setColor ( sib , RED ) ; x = parentOf ( x ) ; } else { if ( colorOf ( rightOf ( sib ) ) == BLACK ) { setColor ( leftOf ( sib ) , BLACK ) ; setColor ( sib , RED ) ; rotateRight ( sib ) ; sib = rightOf ( parentOf ( x ) ) ; } setColor ( sib , colorOf ( parentOf ( x ) ) ) ; setColor ( parentOf ( x ) , BLACK ) ; setColor ( rightOf ( sib ) , BLACK ) ; rotateLeft ( parentOf ( x ) ) ; x = root ; } } else { // symmetric
OMVRBTreeEntry < K , V > sib = leftOf ( parentOf ( x ) ) ; if ( colorOf ( sib ) == RED ) { setColor ( sib , BLACK ) ; setColor ( parentOf ( x ) , RED ) ; rotateRight ( parentOf ( x ) ) ; sib = leftOf ( parentOf ( x ) ) ; } if ( x != null && colorOf ( rightOf ( sib ) ) == BLACK && colorOf ( leftOf ( sib ) ) == BLACK ) { setColor ( sib , RED ) ; x = parentOf ( x ) ; } else { if ( colorOf ( leftOf ( sib ) ) == BLACK ) { setColor ( rightOf ( sib ) , BLACK ) ; setColor ( sib , RED ) ; rotateLeft ( sib ) ; sib = leftOf ( parentOf ( x ) ) ; } setColor ( sib , colorOf ( parentOf ( x ) ) ) ; setColor ( parentOf ( x ) , BLACK ) ; setColor ( leftOf ( sib ) , BLACK ) ; rotateRight ( parentOf ( x ) ) ; x = root ; } } } setColor ( x , BLACK ) ; |
public class StunAttributeFactory { /** * Create a ReservationTokenAttribute .
* @ param token
* the token
* @ return newly created RequestedTransportAttribute */
public static ReservationTokenAttribute createReservationTokenAttribute ( byte token [ ] ) { } } | ReservationTokenAttribute attribute = new ReservationTokenAttribute ( ) ; attribute . setReservationToken ( token ) ; return attribute ; |
public class TransactionManager { /** * Immediately shuts down the service , without going through the normal close process .
* @ param message A message describing the source of the failure .
* @ param error Any exception that caused the failure . */
private void abortService ( String message , Throwable error ) { } } | if ( isRunning ( ) ) { LOG . error ( "Aborting transaction manager due to: " + message , error ) ; notifyFailed ( error ) ; } |
public class FileInfo { /** * < code > optional . alluxio . grpc . file . PAcl defaultAcl = 28 ; < / code > */
public alluxio . grpc . PAclOrBuilder getDefaultAclOrBuilder ( ) { } } | return defaultAcl_ == null ? alluxio . grpc . PAcl . getDefaultInstance ( ) : defaultAcl_ ; |
public class NumberPickerPreference { /** * Sets the step size , the number should be increased or decreased by when moving the selector
* wheel .
* @ param stepSize
* The step size , which should be set , as an { @ link Integer } value . The value must be
* between at least 1 and at maximum the value of the method
* < code > getRange ( ) : int < / code > */
public final void setStepSize ( final int stepSize ) { } } | Condition . INSTANCE . ensureAtLeast ( stepSize , 1 , "The step size must be at least 1" ) ; Condition . INSTANCE . ensureAtMaximum ( stepSize , getRange ( ) , "The step size must be at maximum the range" ) ; this . stepSize = stepSize ; setNumber ( adaptToStepSize ( getNumber ( ) ) ) ; |
public class TreeScanner { /** * Visitor method : scan a list of nodes . */
public void scan ( List < ? extends JCTree > trees ) { } } | if ( trees != null ) for ( List < ? extends JCTree > l = trees ; l . nonEmpty ( ) ; l = l . tail ) scan ( l . head ) ; } /* * Visitor methods */
public void visitTopLevel ( JCCompilationUnit tree ) { scan ( tree . packageAnnotations ) ; scan ( tree . pid ) ; scan ( tree . defs ) ; } public void visitImport ( JCImport tree ) { scan ( tree . qualid ) ; } public void visitClassDef ( JCClassDecl tree ) { scan ( tree . mods ) ; scan ( tree . typarams ) ; scan ( tree . extending ) ; scan ( tree . implementing ) ; scan ( tree . defs ) ; } public void visitMethodDef ( JCMethodDecl tree ) { scan ( tree . mods ) ; scan ( tree . restype ) ; scan ( tree . typarams ) ; scan ( tree . recvparam ) ; scan ( tree . params ) ; scan ( tree . thrown ) ; scan ( tree . defaultValue ) ; scan ( tree . body ) ; } public void visitVarDef ( JCVariableDecl tree ) { scan ( tree . mods ) ; scan ( tree . vartype ) ; scan ( tree . nameexpr ) ; scan ( tree . init ) ; } public void visitSkip ( JCSkip tree ) { |
public class DeleteMeshRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( DeleteMeshRequest deleteMeshRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( deleteMeshRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( deleteMeshRequest . getMeshName ( ) , MESHNAME_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class DatabaseStoreService { /** * Declarative Services method for setting the SerializationService service reference
* @ param ref reference to service object ; type of service object is verified */
protected void setSerializationService ( ServiceReference < SerializationService > ref ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && LoggingUtil . SESSION_LOGGER_WAS . isLoggable ( Level . FINE ) ) { LoggingUtil . SESSION_LOGGER_WAS . logp ( Level . FINE , methodClassName , "setSerializationService" , "setting " + ref ) ; } serializationServiceRef . setReference ( ref ) ; |
public class AbstractNotification { /** * Extract a parameter from name / value pairs in extra info .
* @ param param Parameter name .
* @ return Parameter value , or null if not found . */
public String getParam ( String param ) { } } | int i = findParam ( param ) ; return i < 0 ? null : StrUtil . piece ( extraInfo [ i ] , "=" , 2 ) ; |
public class Ensure { /** * As { @ link # checked ( boolean , String , Function ) } except the throwable is thrown as an unchecked exception type .
* @ param predicate the condition
* @ param explanation failure reason
* @ param exceptionFactory source of error
* @ param < T > the type to throw
* @ see Exceptions # throwChecked ( Throwable ) */
public static < T extends Throwable > void unchecked ( boolean predicate , String explanation , Function < String , T > exceptionFactory ) { } } | assert explanation != null : "explanation != null" ; assert exceptionFactory != null : "exceptionFactory != null" ; if ( ! predicate ) { T t = exceptionFactory . apply ( explain ( explanation ) ) ; throw Exceptions . throwChecked ( t ) ; } |
public class TaggerImpl { /** * 计算梯度
* @ param expected 梯度向量
* @ return 损失函数的值 */
public double gradient ( double [ ] expected ) { } } | if ( x_ . isEmpty ( ) ) { return 0.0 ; } buildLattice ( ) ; forwardbackward ( ) ; double s = 0.0 ; for ( int i = 0 ; i < x_ . size ( ) ; i ++ ) { for ( int j = 0 ; j < ysize_ ; j ++ ) { node_ . get ( i ) . get ( j ) . calcExpectation ( expected , Z_ , ysize_ ) ; } } for ( int i = 0 ; i < x_ . size ( ) ; i ++ ) { List < Integer > fvector = node_ . get ( i ) . get ( answer_ . get ( i ) ) . fVector ; for ( int j = 0 ; fvector . get ( j ) != - 1 ; j ++ ) { int idx = fvector . get ( j ) + answer_ . get ( i ) ; expected [ idx ] -- ; } s += node_ . get ( i ) . get ( answer_ . get ( i ) ) . cost ; // UNIGRAM COST
List < Path > lpath = node_ . get ( i ) . get ( answer_ . get ( i ) ) . lpath ; for ( Path p : lpath ) { if ( p . lnode . y == answer_ . get ( p . lnode . x ) ) { for ( int k = 0 ; p . fvector . get ( k ) != - 1 ; k ++ ) { int idx = p . fvector . get ( k ) + p . lnode . y * ysize_ + p . rnode . y ; expected [ idx ] -- ; } s += p . cost ; // BIGRAM COST
break ; } } } viterbi ( ) ; return Z_ - s ; |
public class Compatibility { /** * If the className argument needs to be mapped to a new implementor class ,
* returns the new class name ; otherwise returns the unmodified argument . */
public static String getActivityImplementor ( String className ) throws IOException { } } | if ( getActivityImplementors ( ) != null ) { String newImpl = getActivityImplementors ( ) . get ( className ) ; if ( newImpl != null ) return newImpl ; } return className ; |
public class physical_disk { /** * < pre >
* Use this operation to get physical disks .
* < / pre > */
public static physical_disk [ ] get ( nitro_service client ) throws Exception { } } | physical_disk resource = new physical_disk ( ) ; resource . validate ( "get" ) ; return ( physical_disk [ ] ) resource . get_resources ( client ) ; |
public class CmsDateBox { /** * Returns the time text field value as string . < p >
* @ return the time text field value as string */
private String getTimeText ( ) { } } | String timeAsString = m_time . getText ( ) . trim ( ) ; if ( CmsDateConverter . is12HourPresentation ( ) ) { if ( ! ( timeAsString . contains ( CmsDateConverter . AM ) || timeAsString . contains ( CmsDateConverter . PM ) ) ) { if ( m_am . isChecked ( ) ) { timeAsString = timeAsString + " " + CmsDateConverter . AM ; } else { timeAsString = timeAsString + " " + CmsDateConverter . PM ; } } } return timeAsString ; |
public class FtpMessage { /** * Gets the command if any or tries to unmarshal String payload representation to an command model .
* @ return */
private < T extends CommandType > T getCommand ( ) { } } | if ( command == null ) { if ( getPayload ( ) instanceof String ) { this . command = ( T ) marshaller . unmarshal ( new StringSource ( getPayload ( String . class ) ) ) ; } } return ( T ) command ; |
public class BusGroup { /** * Gets all the local subscriptions that have been sent to this Bus .
* Returns a cloned list of subscriptions to the requester .
* @ return Hashtable The cloned subscription hashtable . */
Hashtable getLocalSubscriptions ( ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "getLocalSubscriptions" ) ; SibTr . exit ( tc , "getLocalSubscriptions" , iLocalSubscriptions ) ; } return ( Hashtable ) iLocalSubscriptions . clone ( ) ; |
public class OrphanedEvent { /** * Gets profile id of the user that changed the message status .
* @ return Profile id of the user that changed the message status . */
public String getProfileId ( ) { } } | return ( data != null && data . payload != null ) ? data . payload . profileId : null ; |
public class ApptentiveNotificationCenter { /** * Adds an entry to the receiver ’ s dispatch table with an observer using strong reference . */
public synchronized ApptentiveNotificationCenter addObserver ( String notification , ApptentiveNotificationObserver observer ) { } } | addObserver ( notification , observer , false ) ; return this ; |
public class SceneStructureMetric { /** * Declares the data structure for a rigid object . Location of points are set by accessing the object directly .
* Rigid objects are useful in known scenes with calibration targets .
* @ param which Index of rigid object
* @ param fixed If the pose is known or not
* @ param worldToObject Initial estimated location of rigid object
* @ param totalPoints Total number of points attached to this rigid object */
public void setRigid ( int which , boolean fixed , Se3_F64 worldToObject , int totalPoints ) { } } | Rigid r = rigids [ which ] = new Rigid ( ) ; r . known = fixed ; r . objectToWorld . set ( worldToObject ) ; r . points = new Point [ totalPoints ] ; for ( int i = 0 ; i < totalPoints ; i ++ ) { r . points [ i ] = new Point ( pointSize ) ; } |
public class JmxEndpointMBean { /** * Handle managed bean invocation by delegating to endpoint adapter . Response is converted to proper method return result .
* @ param mbeanInvocation
* @ return */
private Object handleInvocation ( ManagedBeanInvocation mbeanInvocation ) { } } | Message response = endpointAdapter . handleMessage ( endpointConfiguration . getMessageConverter ( ) . convertInbound ( mbeanInvocation , endpointConfiguration , null ) ) ; ManagedBeanResult serviceResult = null ; if ( response != null && response . getPayload ( ) != null ) { if ( response . getPayload ( ) instanceof ManagedBeanResult ) { serviceResult = ( ManagedBeanResult ) response . getPayload ( ) ; } else if ( response . getPayload ( ) instanceof String ) { serviceResult = ( ManagedBeanResult ) endpointConfiguration . getMarshaller ( ) . unmarshal ( response . getPayload ( Source . class ) ) ; } } if ( serviceResult != null ) { return serviceResult . getResultObject ( endpointConfiguration . getApplicationContext ( ) ) ; } else { return null ; } |
public class AbstractXTree { /** * Returns the node with the specified id . Note that supernodes are kept in
* main memory ( in { @ link # supernodes } , thus , their listing has to be tested
* first .
* @ param nodeID the page id of the node to be returned
* @ return the node with the specified id */
@ Override public N getNode ( int nodeID ) { } } | N nID = supernodes . get ( Long . valueOf ( nodeID ) ) ; if ( nID != null ) { return nID ; } N n = super . getNode ( nodeID ) ; assert ! n . isSuperNode ( ) ; // we should have them ALL in # supernodes
return n ; |
public class PropertyMap { /** * Returns the default value if the given key isn ' t in this PropertyMap or
* if the the value isn ' t equal to " true " , ignoring case .
* @ param key Key of property to read
* @ param def Default value */
public boolean getBoolean ( String key , boolean def ) { } } | String value = getString ( key ) ; if ( value == null ) { return def ; } else { return "true" . equalsIgnoreCase ( value ) ; } |
public class XMLResultsParser { /** * Cleans up the stream reader . This method is expected to be called just before the final < / sparql >
* end element , which should be the last event in the document . Also closes the stream since
* there ' s nothing more to read rather than wait for the client to do so .
* @ param reader The reader
* @ throws XMLStreamException if there was an error accessing the stream . */
static final void cleanup ( XMLStreamReader reader ) throws XMLStreamException { } } | if ( reader . nextTag ( ) != END_ELEMENT || ! reader . getLocalName ( ) . equalsIgnoreCase ( SPARQL . name ( ) ) ) { logger . warn ( "Extra data at end of results" ) ; } else if ( reader . next ( ) != END_DOCUMENT ) { logger . warn ( "Unexpected data after XML" ) ; } logger . debug ( "End of input detected, closing reader..." ) ; reader . close ( ) ; |
public class MDLRXNWriter { /** * Writes a Reaction to an OutputStream in MDL sdf format .
* @ param reaction A Reaction that is written to an OutputStream */
private void writeReaction ( IReaction reaction ) throws CDKException { } } | int reactantCount = reaction . getReactantCount ( ) ; int productCount = reaction . getProductCount ( ) ; if ( reactantCount <= 0 || productCount <= 0 ) { throw new CDKException ( "Either no reactants or no products present." ) ; } try { // taking care of the $ $ $ $ signs :
// we do not write such a sign at the end of the first reaction , thus we have to write on BEFORE the second reaction
if ( reactionNumber == 2 ) { writer . write ( "$$$$" ) ; writer . write ( '\n' ) ; } writer . write ( "$RXN" ) ; writer . write ( '\n' ) ; // reaction name
String line = ( String ) reaction . getProperty ( CDKConstants . TITLE ) ; if ( line == null ) line = "" ; if ( line . length ( ) > 80 ) line = line . substring ( 0 , 80 ) ; writer . write ( line ) ; writer . write ( '\n' ) ; // user / program / date & time / reaction registry no . line
writer . write ( '\n' ) ; // comment line
line = ( String ) reaction . getProperty ( CDKConstants . REMARK ) ; if ( line == null ) line = "" ; if ( line . length ( ) > 80 ) line = line . substring ( 0 , 80 ) ; writer . write ( line ) ; writer . write ( '\n' ) ; line = "" ; line += formatMDLInt ( reactantCount , 3 ) ; line += formatMDLInt ( productCount , 3 ) ; writer . write ( line ) ; writer . write ( '\n' ) ; int i = 0 ; for ( IMapping mapping : reaction . mappings ( ) ) { Iterator < IChemObject > it = mapping . relatedChemObjects ( ) . iterator ( ) ; it . next ( ) . setProperty ( CDKConstants . ATOM_ATOM_MAPPING , i + 1 ) ; it . next ( ) . setProperty ( CDKConstants . ATOM_ATOM_MAPPING , i + 1 ) ; i ++ ; } writeAtomContainerSet ( reaction . getReactants ( ) ) ; writeAtomContainerSet ( reaction . getProducts ( ) ) ; // write sdfields , if any
if ( rdFields != null ) { Set < String > set = rdFields . keySet ( ) ; Iterator < String > iterator = set . iterator ( ) ; while ( iterator . hasNext ( ) ) { Object element = iterator . next ( ) ; writer . write ( "> <" + ( String ) element + ">" ) ; writer . write ( '\n' ) ; writer . write ( rdFields . get ( element ) . toString ( ) ) ; writer . write ( '\n' ) ; writer . write ( '\n' ) ; } } // taking care of the $ $ $ $ signs :
// we write such a sign at the end of all except the first molecule
if ( reactionNumber != 1 ) { writer . write ( "$$$$" ) ; writer . write ( '\n' ) ; } reactionNumber ++ ; } catch ( IOException ex ) { logger . error ( ex . getMessage ( ) ) ; logger . debug ( ex ) ; throw new CDKException ( "Exception while writing MDL file: " + ex . getMessage ( ) , ex ) ; } |
public class JDBCDriverService { /** * Load the Driver instance for the specified URL .
* @ param url JDBC driver URL .
* @ return the driver
* @ throws Exception if an error occurs */
public Object getDriver ( String url , Properties props , String dataSourceID ) throws Exception { } } | lock . readLock ( ) . lock ( ) ; try { if ( ! isInitialized ) try { // Switch to write lock for lazy initialization
lock . readLock ( ) . unlock ( ) ; lock . writeLock ( ) . lock ( ) ; if ( ! isInitialized ) { if ( ! loadFromApp ( ) ) classloader = AdapterUtil . getClassLoaderWithPriv ( sharedLib ) ; isInitialized = true ; } } finally { // Downgrade to read lock for rest of method
lock . readLock ( ) . lock ( ) ; lock . writeLock ( ) . unlock ( ) ; } final String className = ( String ) properties . get ( Driver . class . getName ( ) ) ; if ( className == null ) { String vendorPropertiesPID = props instanceof PropertyService ? ( ( PropertyService ) props ) . getFactoryPID ( ) : PropertyService . FACTORY_PID ; // if properties . oracle . ucp is configured do not search for driver impls because the customer has indicated
// they want to use UCP , but this will likely pick up the Oracle driver instead of the UCP driver ( since UCP has no Driver interface )
if ( "com.ibm.ws.jdbc.dataSource.properties.oracle.ucp" . equals ( vendorPropertiesPID ) ) { throw new SQLNonTransientException ( AdapterUtil . getNLSMessage ( "DSRA4015.no.ucp.connection.pool.datasource" , dataSourceID , Driver . class . getName ( ) ) ) ; } } Driver driver = loadDriver ( className , url , classloader , props , dataSourceID ) ; if ( driver == null ) throw classNotFound ( Driver . class . getName ( ) , Collections . singleton ( "META-INF/services/java.sql.Driver" ) , dataSourceID , null ) ; return driver ; } finally { lock . readLock ( ) . unlock ( ) ; } |
public class ConfigValidator { /** * Look for conflicts between single - valued attributes of a list of configuration elements .
* Match attributes by name .
* Conflicts are keyed by attribute name .
* @ param registryEntry The registry entry for the configuration elements .
* @ param list The configuration elements to test .
* @ return A mapping of conflicts detected across the configuration elements . */
protected Map < String , ConfigElementList > generateConflictMap ( RegistryEntry registryEntry , List < ? extends ConfigElement > list ) { } } | if ( list . size ( ) <= 1 ) { return Collections . emptyMap ( ) ; } boolean foundConflict = false ; Map < String , ConfigElementList > conflictMap = new HashMap < String , ConfigElementList > ( ) ; for ( ConfigElement element : list ) { for ( Map . Entry < String , Object > entry : element . getAttributes ( ) . entrySet ( ) ) { String attributeName = entry . getKey ( ) ; Object attributeValue = entry . getValue ( ) ; // consider single - values attributes only
if ( ! ( attributeValue instanceof String ) ) { continue ; } ConfigElementList configList = conflictMap . get ( attributeName ) ; if ( configList == null ) { configList = new ConfigElementList ( attributeName ) ; conflictMap . put ( attributeName , configList ) ; } if ( configList . add ( element ) ) { // Validation occurs within ' add ' .
foundConflict = true ; } } } if ( ! foundConflict ) { return Collections . emptyMap ( ) ; } else { return conflictMap ; } |
public class GosuStringUtil { /** * Split up a string into tokens delimited by the specified separator
* character . If the string is null or zero length , returns null .
* @ param s The String to tokenize
* @ param separator The character delimiting tokens
* @ return An ArrayList of String tokens , or null is s is null or 0 length . */
public static String [ ] tokenize ( String s , char separator ) { } } | if ( s == null || s . length ( ) == 0 ) { return null ; } int start = 0 ; int stop = 0 ; ArrayList tokens = new ArrayList ( ) ; while ( start <= s . length ( ) ) { stop = s . indexOf ( separator , start ) ; if ( stop == - 1 ) { stop = s . length ( ) ; } String token = s . substring ( start , stop ) ; tokens . add ( token ) ; start = stop + 1 ; } return ( String [ ] ) tokens . toArray ( new String [ tokens . size ( ) ] ) ; |
public class CircularImageView { /** * Default implementation of the placeholder text formatting .
* @ param text
* @ return */
protected String formatPlaceholderText ( String text ) { } } | String formattedText = ( null != text ) ? text . trim ( ) : null ; int length = ( null != formattedText ) ? formattedText . length ( ) : 0 ; if ( length > 0 ) { return formattedText . substring ( 0 , Math . min ( 2 , length ) ) . toUpperCase ( Locale . getDefault ( ) ) ; } return null ; |
public class AbstractCsvWriter { /** * Writes one or more String columns as a line to the CsvWriter .
* @ param columns
* the columns to write
* @ throws IllegalArgumentException
* if columns . length = = 0
* @ throws IOException
* If an I / O error occurs
* @ throws NullPointerException
* if columns is null */
protected void writeRow ( final String ... columns ) throws IOException { } } | if ( columns == null ) { throw new NullPointerException ( String . format ( "columns to write should not be null on line %d" , lineNumber ) ) ; } else if ( columns . length == 0 ) { throw new IllegalArgumentException ( String . format ( "columns to write should not be empty on line %d" , lineNumber ) ) ; } StringBuilder builder = new StringBuilder ( ) ; for ( int i = 0 ; i < columns . length ; i ++ ) { columnNumber = i + 1 ; // column no used by CsvEncoder
if ( i > 0 ) { builder . append ( ( char ) preference . getDelimiterChar ( ) ) ; // delimiter
} final String csvElement = columns [ i ] ; if ( csvElement != null ) { final CsvContext context = new CsvContext ( lineNumber , rowNumber , columnNumber ) ; final String escapedCsv = encoder . encode ( csvElement , context , preference ) ; builder . append ( escapedCsv ) ; lineNumber = context . getLineNumber ( ) ; // line number can increment when encoding multi - line columns
} } builder . append ( preference . getEndOfLineSymbols ( ) ) ; // EOL
writer . write ( builder . toString ( ) ) ; |
public class WebSecurityHelperImpl { /** * Gets the LTPA cookie from the given subject
* @ param subject
* @ return
* @ throws Exception */
static Cookie getLTPACookie ( final Subject subject ) throws Exception { } } | Cookie ltpaCookie = null ; SingleSignonToken ssoToken = null ; Set < SingleSignonToken > ssoTokens = subject . getPrivateCredentials ( SingleSignonToken . class ) ; Iterator < SingleSignonToken > ssoTokensIterator = ssoTokens . iterator ( ) ; if ( ssoTokensIterator . hasNext ( ) ) { ssoToken = ssoTokensIterator . next ( ) ; if ( ssoTokensIterator . hasNext ( ) ) { throw new WSSecurityException ( "More than one ssotoken found in subject" ) ; } } if ( ssoToken != null ) { ltpaCookie = constructLTPACookieObj ( ssoToken ) ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "No ssotoken found for this subject" ) ; } } return ltpaCookie ; |
public class DockerAgentUtils { /** * Execute pull docker image on agent
* @ param launcher
* @ param imageTag
* @ param username
* @ param password
* @ param host
* @ return
* @ throws IOException
* @ throws InterruptedException */
public static boolean pullImage ( Launcher launcher , final String imageTag , final String username , final String password , final String host ) throws IOException , InterruptedException { } } | return launcher . getChannel ( ) . call ( new MasterToSlaveCallable < Boolean , IOException > ( ) { public Boolean call ( ) throws IOException { DockerUtils . pullImage ( imageTag , username , password , host ) ; return true ; } } ) ; |
public class DocumentService { /** * RPC : TIU DOCUMENTS BY CONTEXT
* < pre >
* Returns lists of TIU Documents that satisfy the following search criteria :
* 1 - signed documents ( all )
* 2 - unsigned documents
* 3 - uncosigned documents
* 4 - signed documents / author
* 5 - signed documents / date range
* Input parameters :
* DocClass - Pointer to TIU DOCUMENT DEFINITION # 8925.1
* Context - 1 = All Signed ( by PT ) ,
* 2 = Unsigned ( by PT & ( AUTHOR ! TANSCRIBER ) )
* 3 = Uncosigned ( by PT & EXPECTED COSIGNER
* 4 = Signed notes ( by PT & selected author )
* 5 = Signed notes ( by PT & date range )
* DFN - Patient DFN
* Early - Fileman date to begin search ( optional )
* Late - Fileman date to end search ( optional )
* Person - IEN of file 200 ( optional ) Uses DUZ if not passed .
* OccLim - Occurrence Limit ( optional ) . Maximum number of documents to be retrieved .
* SortSeq - Direction to search through dates , " A " - ascending , " D " - descending
* ShowAdd - parameter determines whether addenda will be included in the return array
* IncUnd - Flag to include undictated and untranscribed . Only applies when CONTEXT = 2
* Return format :
* An array in the following format :
* 1 2 3 4 5 6
* IEN ^ TITLE ^ REFERENCE DATE / TIME ( INT ) ^ PATIENT NAME ( LAST I / LAST 4 ) ^ AUTHOR ( INT ; EXT ) ^ HOSPITAL LOCATION ^
* 7 8 9 10
* SIGNATURE STATUS ^ Visit Date / Time ^ Discharge Date / time ^ Variable Pointer to Request ( e . g . , Consult ) ^
* 11 12 13 14
* # of Associated Images ^ Subject ^ Has Children ^ IEN of Parent Document
* < / pre >
* @ param patient The patient .
* @ param startDate The start date for retrieval .
* @ param endDate The end date for retrieval .
* @ param category The document category .
* @ return List of matching documents . */
public List < Document > retrieveHeaders ( Patient patient , Date startDate , Date endDate , DocumentCategory category ) { } } | List < DocumentCategory > categories = category == null ? getCategories ( ) : Collections . singletonList ( category ) ; List < Document > results = new ArrayList < > ( ) ; for ( DocumentCategory cat : categories ) { for ( String result : broker . callRPCList ( "TIU DOCUMENTS BY CONTEXT" , null , cat . getId ( ) . getIdPart ( ) , 1 , patient . getIdElement ( ) . getIdPart ( ) , startDate , endDate ) ) { String [ ] pcs = StrUtil . split ( result , StrUtil . U , 14 ) ; Document doc = new Document ( ) ; doc . setId ( pcs [ 0 ] ) ; doc . setTitle ( pcs [ 1 ] ) ; doc . setDateTime ( new FMDate ( pcs [ 2 ] ) ) ; doc . setAuthorName ( StrUtil . piece ( pcs [ 4 ] , ";" , 3 ) ) ; doc . setLocationName ( pcs [ 5 ] ) ; doc . setSubject ( pcs [ 11 ] ) ; doc . setCategory ( cat ) ; results . add ( doc ) ; } } return results ; |
public class DFSAdmin { /** * Refresh the authorization policy on the { @ link NameNode } .
* @ return exitcode 0 on success , non - zero on failure
* @ throws IOException */
public int refreshServiceAcl ( ) throws IOException { } } | // Get the current configuration
Configuration conf = getConf ( ) ; // Create the client
RefreshAuthorizationPolicyProtocol refreshProtocol = ( RefreshAuthorizationPolicyProtocol ) RPC . getProxy ( RefreshAuthorizationPolicyProtocol . class , RefreshAuthorizationPolicyProtocol . versionID , NameNode . getClientProtocolAddress ( conf ) , getUGI ( conf ) , conf , NetUtils . getSocketFactory ( conf , RefreshAuthorizationPolicyProtocol . class ) ) ; // Refresh the authorization policy in - effect
refreshProtocol . refreshServiceAcl ( ) ; return 0 ; |
public class AmazonCloudFormationClient { /** * Deletes a stack set . Before you can delete a stack set , all of its member stack instances must be deleted . For
* more information about how to do this , see < a > DeleteStackInstances < / a > .
* @ param deleteStackSetRequest
* @ return Result of the DeleteStackSet operation returned by the service .
* @ throws StackSetNotEmptyException
* You can ' t yet delete this stack set , because it still contains one or more stack instances . Delete all
* stack instances from the stack set before deleting the stack set .
* @ throws OperationInProgressException
* Another operation is currently in progress for this stack set . Only one operation can be performed for a
* stack set at a given time .
* @ sample AmazonCloudFormation . DeleteStackSet
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / cloudformation - 2010-05-15 / DeleteStackSet " target = " _ top " > AWS
* API Documentation < / a > */
@ Override public DeleteStackSetResult deleteStackSet ( DeleteStackSetRequest request ) { } } | request = beforeClientExecution ( request ) ; return executeDeleteStackSet ( request ) ; |
public class AfplibPackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public EEnum getTextOrientationIAxis ( ) { } } | if ( textOrientationIAxisEEnum == null ) { textOrientationIAxisEEnum = ( EEnum ) EPackage . Registry . INSTANCE . getEPackage ( AfplibPackage . eNS_URI ) . getEClassifiers ( ) . get ( 110 ) ; } return textOrientationIAxisEEnum ; |
public class SampledHistogramBuilder { /** * Keep a record as a sample , with certain probability . This method is
* designed to uniformly sample all records of a table under the situation
* where the total number of records is unknown in advance . A client should
* call this method when iterating through each record of a table .
* @ param rec
* the record */
public void sample ( Record rec ) { } } | totalRecs ++ ; if ( samples . size ( ) < MAX_SAMPLES ) { samples . add ( new Sample ( rec , schema ) ) ; updateNewValueInterval ( rec ) ; } else { double flip = random . nextDouble ( ) ; if ( flip < ( double ) MAX_SAMPLES / totalRecs ) { samples . set ( random . nextInt ( MAX_SAMPLES ) , new Sample ( rec , schema ) ) ; updateNewValueInterval ( rec ) ; } } |
public class InterfaxMailFaxClientSpi { /** * This function will create the message used to invoke the fax
* job action . < br >
* If this method returns null , the SPI will throw an UnsupportedOperationException .
* @ param faxJob
* The fax job object containing the needed information
* @ param mailResourcesHolder
* The mail resources holder
* @ return The message to send ( if null , the SPI will throw an UnsupportedOperationException ) */
@ Override protected Message createSubmitFaxJobMessage ( FaxJob faxJob , MailResourcesHolder mailResourcesHolder ) { } } | // set from
String from = faxJob . getSenderEmail ( ) ; if ( ( from == null ) || ( from . length ( ) == 0 ) ) { throw new FaxException ( "From address not provided." ) ; } // create message
Message message = super . createSubmitFaxJobMessage ( faxJob , mailResourcesHolder ) ; return message ; |
public class RobotStatusProxy { /** * / * ( non - Javadoc )
* @ see com . github . thehilikus . jrobocom . RobotInfo # getInstructionSet ( boolean ) */
@ Override public InstructionSet getRemoteInstructionSet ( ) { } } | int penalty = Timing . getInstance ( ) . REMOTE_ACCESS_PENALTY ; log . trace ( "[getRemoteInstructionSet] Waiting {} cycles" , penalty ) ; turnsControl . waitTurns ( penalty , "Get Neighbour's Instruction set" ) ; Robot neighbour = world . getNeighbour ( this . robot ) ; if ( neighbour != null ) { return neighbour . getData ( ) . getInstructionSet ( ) ; } else { return InstructionSet . BASIC ; } |
public class BodyPart { /** * Adds new attachment part .
* @ param part */
public void addPart ( AttachmentPart part ) { } } | if ( attachments == null ) { attachments = new BodyPart . Attachments ( ) ; } this . attachments . add ( part ) ; |
public class ClassScanner { /** * 扫描指定的包中的所有class
* @ param excludeFilters 过滤器 , 不能为null , filter返回true时扫描出的class将被过滤
* @ param args 参数 ( String类型 , 要扫描的包的集合 )
* @ return 扫描结果
* @ throws ScannerException 扫描异常 */
@ Override public List < Class < ? > > scanByFilter ( List < ClassFilter > excludeFilters , Object ... args ) throws ScannerException { } } | LOGGER . debug ( "搜索扫描所有的类,过滤器为:{},参数为:{}" , excludeFilters , args ) ; if ( args == null || args . length == 0 ) { return Collections . emptyList ( ) ; } for ( Object arg : args ) { if ( ! ( arg instanceof String ) ) { LOGGER . debug ( "参数类型为:{}" , args . getClass ( ) ) ; throw new ScannerException ( "参数类型为:" + args . getClass ( ) ) ; } } List < Class < ? > > result = null ; for ( Object obj : args ) { List < Class < ? > > list = scanByFilter ( ( String ) obj , excludeFilters ) ; if ( result == null ) { result = list ; } else { result . addAll ( list ) ; } } return result ; |
public class DiagramBuilder { /** * create a HashMap form the json properties and add it to the shape
* @ param modelJSON
* @ param current
* @ throws org . json . JSONException */
@ SuppressWarnings ( "unchecked" ) private static void parseProperties ( JSONObject modelJSON , Shape current , Boolean keepGlossaryLink ) throws JSONException { } } | if ( modelJSON . has ( "properties" ) ) { JSONObject propsObject = modelJSON . getJSONObject ( "properties" ) ; Iterator < String > keys = propsObject . keys ( ) ; Pattern pattern = Pattern . compile ( jsonPattern ) ; while ( keys . hasNext ( ) ) { StringBuilder result = new StringBuilder ( ) ; int lastIndex = 0 ; String key = keys . next ( ) ; String value = propsObject . getString ( key ) ; if ( ! keepGlossaryLink ) { Matcher matcher = pattern . matcher ( value ) ; while ( matcher . find ( ) ) { String id = matcher . group ( 1 ) ; current . addGlossaryIds ( id ) ; String text = matcher . group ( 2 ) ; result . append ( text ) ; lastIndex = matcher . end ( ) ; } result . append ( value . substring ( lastIndex ) ) ; value = result . toString ( ) ; } current . putProperty ( key , value ) ; } } |
public class AppGameContainer { /** * Try creating a display with the given format
* @ param format The format to attempt
* @ throws LWJGLException Indicates a failure to support the given format */
private void tryCreateDisplay ( PixelFormat format ) throws LWJGLException { } } | if ( SHARED_DRAWABLE == null ) { Display . create ( format ) ; } else { Display . create ( format , SHARED_DRAWABLE ) ; } |
public class JMatrix { /** * Cholesky decomposition for symmetric and positive definite matrix .
* Only the lower triangular part will be used in the decomposition .
* @ throws IllegalArgumentException if the matrix is not positive definite . */
@ Override public Cholesky cholesky ( ) { } } | if ( nrows ( ) != ncols ( ) ) { throw new UnsupportedOperationException ( "Cholesky decomposition on non-square matrix" ) ; } int n = nrows ( ) ; // Main loop .
for ( int j = 0 ; j < n ; j ++ ) { double d = 0.0 ; for ( int k = 0 ; k < j ; k ++ ) { double s = 0.0 ; for ( int i = 0 ; i < k ; i ++ ) { s += get ( k , i ) * get ( j , i ) ; } s = ( get ( j , k ) - s ) / get ( k , k ) ; set ( j , k , s ) ; d = d + s * s ; } d = get ( j , j ) - d ; if ( d < 0.0 ) { throw new IllegalArgumentException ( "The matrix is not positive definite." ) ; } set ( j , j , Math . sqrt ( d ) ) ; } return new Cholesky ( this ) ; |
public class SchemaService { /** * change , ensure it hasn ' t changed . Return the application ' s StorageService object . */
private StorageService verifyStorageServiceOption ( ApplicationDefinition currAppDef , ApplicationDefinition appDef ) { } } | // Verify or assign StorageService
String ssName = getStorageServiceOption ( appDef ) ; StorageService storageService = getStorageService ( appDef ) ; Utils . require ( storageService != null , "StorageService is unknown or hasn't been initialized: %s" , ssName ) ; // Currently , StorageService can ' t be changed .
if ( currAppDef != null ) { String currSSName = getStorageServiceOption ( currAppDef ) ; Utils . require ( currSSName . equals ( ssName ) , "'StorageService' cannot be changed for application: %s" , appDef . getAppName ( ) ) ; } return storageService ; |
public class SecretKeyFactory { /** * Update the active spi of this class and return the next
* implementation for failover . If no more implemenations are
* available , this method returns null . However , the active spi of
* this class is never set to null . */
private SecretKeyFactorySpi nextSpi ( SecretKeyFactorySpi oldSpi ) { } } | synchronized ( lock ) { // somebody else did a failover concurrently
// try that spi now
if ( ( oldSpi != null ) && ( oldSpi != spi ) ) { return spi ; } if ( serviceIterator == null ) { return null ; } while ( serviceIterator . hasNext ( ) ) { Service s = serviceIterator . next ( ) ; if ( JceSecurity . canUseProvider ( s . getProvider ( ) ) == false ) { continue ; } try { Object obj = s . newInstance ( null ) ; if ( obj instanceof SecretKeyFactorySpi == false ) { continue ; } SecretKeyFactorySpi spi = ( SecretKeyFactorySpi ) obj ; provider = s . getProvider ( ) ; this . spi = spi ; return spi ; } catch ( NoSuchAlgorithmException e ) { // ignore
} } serviceIterator = null ; return null ; } |
public class PropertySourcePropertyResolver { /** * Add a property source for the given map .
* @ param name The name of the property source
* @ param values The values
* @ return This environment */
public PropertySourcePropertyResolver addPropertySource ( String name , @ Nullable Map < String , ? super Object > values ) { } } | if ( CollectionUtils . isNotEmpty ( values ) ) { return addPropertySource ( PropertySource . of ( name , values ) ) ; } return this ; |
public class _Private_Utils { /** * Determines whether the passed - in { @ code superset } symtab is an extension
* of { @ code subset } .
* If both are LSTs , their imported tables and locally declared symbols are
* exhaustively checked , which can be expensive . Callers of this method
* should cache the results of these comparisons .
* @ param superset
* either a system or local symbol table
* @ param subset
* either a system or local symbol table
* @ return true if { @ code superset } extends { @ code subset } , false if not */
public static boolean symtabExtends ( SymbolTable superset , SymbolTable subset ) { } } | assert superset . isSystemTable ( ) || superset . isLocalTable ( ) ; assert subset . isSystemTable ( ) || subset . isLocalTable ( ) ; // NB : system symtab 1.0 is a singleton , hence if both symtabs
// are one this will be true .
if ( superset == subset ) return true ; // If the subset ' s symtab is a system symtab , the superset ' s is always
// an extension of the subset ' s as system symtab - ness is irrelevant to
// the conditions for copy opt . to be safe .
// TODO amzn / ion - java / issues / 24 System symtab - ness ARE relevant if there ' s multiple
// versions .
if ( subset . isSystemTable ( ) ) return true ; // From here on , subset is a LST because isSystemTable ( ) is false .
if ( superset . isLocalTable ( ) ) { if ( superset instanceof LocalSymbolTable && subset instanceof LocalSymbolTable ) { // use the internal comparison
return ( ( LocalSymbolTable ) superset ) . symtabExtends ( subset ) ; } // TODO reason about symbol tables that don ' t extend LocalSymbolTable but are still local
return localSymtabExtends ( superset , subset ) ; } // From here on , superset is a system symtab .
// If LST subset has no local symbols or imports , and it ' s system
// symbols are same as those of system symtab superset ' s , then
// superset extends subset
return subset . getMaxId ( ) == superset . getMaxId ( ) ; |
public class AdminToolMenuUtils { /** * checks if actualEntry contains the activeMenuName in entry itself and its
* sub entries
* @ param activeMenuName
* @ param actualEntry current iterated object
* @ return */
public boolean isActiveInMenuTree ( MenuEntry activeMenu , MenuEntry actualEntry ) { } } | return actualEntry . flattened ( ) . anyMatch ( entry -> checkForNull ( entry , activeMenu ) ? entry . getName ( ) . equals ( activeMenu . getName ( ) ) : false ) ; |
public class BaseDestinationHandler { /** * < p > This method will compare the passed in set of localising ME uuids with the
* set already known about . Adding and removing transmission queues to those
* localisatoinsones as necessary .
* If there are any new localising ME ' s the infrastructure
* to be able to send messages to them is created .
* If the ME knows about some that are not in WCCM , they are marked
* for deletion .
* If they are still being advertised in WLM , nothing more is done
* until they are removed from WLM as WLM can still return them as places
* to send messages too .
* If the entries are not in WLM , an attempt is made to rejig the messages .
* This will move them to another localisation if possible , or will put
* them to the exception destination or discard them .
* If after the rejig , there are no messages left awaiting
* transmission to the deleted localisation , the infrastructure for the
* localistion is removed , otherwise it is left until the last message
* has been processed .
* @ param newQueuePointLocalisingMEUuids The set of MEs on which the
* queue point is localised , possibly including the local ME .
* @ throws SIResourceException */
public void updateLocalizationSet ( Set newQueuePointLocalisingMEUuids ) throws SIResourceException { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "updateLocalizationSet" , new Object [ ] { newQueuePointLocalisingMEUuids } ) ; // TODO the transactionality of this method has been compromised by using autocommit
// this needs some thought
SIBUuid8 messagingEngineUuid = messageProcessor . getMessagingEngineUuid ( ) ; synchronized ( this ) // Ensure any cleanup initiated by this method does not start
{ // until this method has finished - synchronises with cleanupDestination
// If the local queue point has been removed , act on this here
if ( ( ! newQueuePointLocalisingMEUuids . contains ( messagingEngineUuid . toString ( ) ) ) && _ptoPRealization != null ) { _ptoPRealization . localQueuePointRemoved ( isDeleted ( ) , _isSystem , isTemporary ( ) , messagingEngineUuid ) ; } // If this isn ' t PubSub we ' ll have remote Queue points
if ( ! isPubSub ( ) ) { _ptoPRealization . updateRemoteQueuePointSet ( newQueuePointLocalisingMEUuids ) ; } } // If the Queue points are not null , then synchronize ( Queue destination )
_protoRealization . updateLocalisationSet ( messagingEngineUuid , newQueuePointLocalisingMEUuids ) ; // Close any remote consumers that are attached to deleted queue points
_protoRealization . getRemoteSupport ( ) . closeRemoteConsumers ( newQueuePointLocalisingMEUuids , getLocalisationManager ( ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "updateLocalizationSet" ) ; |
public class OptionValueImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public void eSet ( int featureID , Object newValue ) { } } | switch ( featureID ) { case SimpleAntlrPackage . OPTION_VALUE__KEY : setKey ( ( String ) newValue ) ; return ; case SimpleAntlrPackage . OPTION_VALUE__VALUE : setValue ( ( String ) newValue ) ; return ; } super . eSet ( featureID , newValue ) ; |
public class AbstractPrimitiveService { /** * Configures the state machine .
* By default , this method will configure state machine operations by extracting public methods with
* a single { @ link Commit } parameter via reflection . Override this method to explicitly register
* state machine operations via the provided { @ link ServiceExecutor } .
* @ param executor The state machine executor . */
protected void configure ( ServiceExecutor executor ) { } } | Operations . getOperationMap ( getClass ( ) ) . forEach ( ( ( operationId , method ) -> configure ( operationId , method , executor ) ) ) ; |
public class DetectDescribeAssociate { /** * Remove from active list and mark so that it is dropped in the next cycle
* @ param track The track which is to be dropped */
@ Override public boolean dropTrack ( PointTrack track ) { } } | if ( ! tracksAll . remove ( track ) ) return false ; if ( ! sets [ track . setId ] . tracks . remove ( track ) ) { return false ; } // the track may or may not be in the active list
tracksActive . remove ( track ) ; tracksInactive . remove ( track ) ; // it must be in the all list
// recycle the data
unused . add ( track ) ; return true ; |
public class XCatchClauseImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public Object eGet ( int featureID , boolean resolve , boolean coreType ) { } } | switch ( featureID ) { case XbasePackage . XCATCH_CLAUSE__EXPRESSION : return getExpression ( ) ; case XbasePackage . XCATCH_CLAUSE__DECLARED_PARAM : return getDeclaredParam ( ) ; } return super . eGet ( featureID , resolve , coreType ) ; |
public class UpdateExpandedTextAd { /** * Runs the example .
* @ param adWordsServices the services factory .
* @ param session the session .
* @ param adId the ID of the ad to update .
* @ throws ApiException if the API request failed with one or more service errors .
* @ throws RemoteException if the API request failed due to other errors . */
public static void runExample ( AdWordsServicesInterface adWordsServices , AdWordsSession session , Long adId ) throws RemoteException { } } | // Get the AdService .
AdServiceInterface adService = adWordsServices . get ( session , AdServiceInterface . class ) ; // Creates an expanded text ad using the provided ad ID .
ExpandedTextAd expandedTextAd = new ExpandedTextAd ( ) ; expandedTextAd . setId ( adId ) ; // Updates some properties of the expanded text ad .
expandedTextAd . setHeadlinePart1 ( "Cruise to Pluto #" + System . currentTimeMillis ( ) ) ; expandedTextAd . setHeadlinePart2 ( "Tickets on sale now" ) ; expandedTextAd . setDescription ( "Best space cruise ever." ) ; expandedTextAd . setFinalUrls ( new String [ ] { "http://www.example.com/" } ) ; expandedTextAd . setFinalMobileUrls ( new String [ ] { "http://www.example.com/mobile" } ) ; // Creates ad group ad operation and adds it to the list .
AdOperation operation = new AdOperation ( ) ; operation . setOperator ( Operator . SET ) ; operation . setOperand ( expandedTextAd ) ; // Updates the ad on the server .
ExpandedTextAd updatedAd = ( ExpandedTextAd ) adService . mutate ( new AdOperation [ ] { operation } ) . getValue ( 0 ) ; // Prints out some information .
System . out . printf ( "Expanded text ad with ID %d was updated.%n" , updatedAd . getId ( ) ) ; System . out . printf ( "Headline part 1 is '%s'.%nHeadline part 2 is '%s'.%nDescription is '%s'.%n" , updatedAd . getHeadlinePart1 ( ) , updatedAd . getHeadlinePart2 ( ) , updatedAd . getDescription ( ) ) ; System . out . printf ( "Final URL is '%s'.%nFinal mobile URL is '%s'.%n" , updatedAd . getFinalUrls ( ) [ 0 ] , updatedAd . getFinalMobileUrls ( ) [ 0 ] ) ; |
public class JmxRequest { /** * Get a processing configuration as a boolean value
* @ param pConfigKey configuration to lookup
* @ return boolean value of the configuration , the default value or false if the default value is null */
public Boolean getParameterAsBool ( ConfigKey pConfigKey ) { } } | String booleanS = getParameter ( pConfigKey ) ; return Boolean . parseBoolean ( booleanS != null ? booleanS : pConfigKey . getDefaultValue ( ) ) ; |
public class AdminConfig { /** * infer page suffix from index and login page configured in admin - config . properties
* If none is configured then use default suffix : ' xhtml ' . */
public String getPageSufix ( ) { } } | if ( has ( pageSuffix ) ) { return pageSuffix ; } if ( ! has ( indexPage ) && ! has ( loginPage ) ) { pageSuffix = Constants . DEFAULT_PAGE_FORMAT ; } if ( has ( indexPage ) ) { pageSuffix = indexPage . substring ( indexPage . lastIndexOf ( '.' ) + 1 ) ; } else { pageSuffix = indexPage . substring ( loginPage . lastIndexOf ( '.' ) + 1 ) ; } return pageSuffix ; |
public class ComplexImg { /** * Returns a { @ link ColorImg } consisting of this ComplexImg ' s power channel
* log - scaled for display .
* Values are displayed in grayscale .
* @ return image of power spectrum for display
* @ see # getPhaseSpectrumImg ( )
* @ see # getPowerPhaseSpectrumImg ( ) */
public ColorImg getPowerSpectrumImg ( ) { } } | this . recomputePowerChannel ( ) ; // get copy of power channel
ColorImg powerSpectrum = this . getDelegate ( ) . getChannelImage ( ComplexImg . CHANNEL_POWER ) . copy ( ) ; // logarithmize values
powerSpectrum . forEach ( px -> px . setValue ( 0 , Math . log ( 1 + px . getValue ( 0 ) ) ) ) ; // normalize values
powerSpectrum . scaleChannelToUnitRange ( 0 ) ; // copy 1st channel to others to retain grayscale
System . arraycopy ( powerSpectrum . getData ( ) [ 0 ] , 0 , powerSpectrum . getData ( ) [ 1 ] , 0 , powerSpectrum . numValues ( ) ) ; System . arraycopy ( powerSpectrum . getData ( ) [ 0 ] , 0 , powerSpectrum . getData ( ) [ 2 ] , 0 , powerSpectrum . numValues ( ) ) ; return powerSpectrum ; |
public class AbstractLinkedList { /** * Adds an entry at the beginning of the list .
* @ param e
* the entry to add . */
protected void pushFrontEntry ( T e ) { } } | e . setPrev ( null ) ; e . setNext ( head ) ; if ( head != null ) { head . setPrev ( e ) ; } else { last = e ; } head = e ; size ++ ; |
public class ManagedExecutorServiceImpl { /** * { @ inheritDoc } */
@ Override public < T > T invokeAny ( Collection < ? extends Callable < T > > tasks ) throws InterruptedException , ExecutionException { } } | Entry < Collection < ? extends Callable < T > > , TaskLifeCycleCallback [ ] > entry = createCallbacks ( tasks ) ; tasks = entry . getKey ( ) ; TaskLifeCycleCallback [ ] callbacks = entry . getValue ( ) ; PolicyExecutor executor = callbacks . length > 0 ? callbacks [ 0 ] . policyExecutor : policyExecutor ; return executor . invokeAny ( tasks , callbacks ) ; |
public class Results { /** * Creates a new result with the status { @ literal 403 - FORBIDDEN } with the given content . The result has the
* { @ literal Content - Type } header set to { @ literal text / plain } .
* @ param content the content
* @ return a new configured result */
public static Result forbidden ( String content ) { } } | return status ( Result . FORBIDDEN ) . render ( content ) . as ( MimeTypes . TEXT ) ; |
public class ContentionMark { /** * Run the " Increment " procedure on the server asynchronously . */
void increment ( ) { } } | long id = rand . nextInt ( config . tuples ) ; long toIncrement = rand . nextInt ( 5 ) ; // 0 - 4
try { client . callProcedure ( new CMCallback ( ) , "Increment" , toIncrement , id ) ; } catch ( IOException e ) { // This is not ideal error handling for production , but should be
// harmless in a benchmark like this
try { Thread . sleep ( 50 ) ; } catch ( Exception e2 ) { } } |
public class Primitive { /** * Return the primitive value stored in its java . lang wrapper class */
public Object getValue ( ) { } } | if ( value == Special . NULL_VALUE ) return null ; if ( value == Special . VOID_TYPE ) throw new InterpreterError ( "attempt to unwrap void type" ) ; return value ; |
public class WordLemmaTag { /** * / * for debugging only */
public static void main ( String [ ] args ) { } } | WordLemmaTag wLT = new WordLemmaTag ( ) ; wLT . setFromString ( "hunter/NN" ) ; System . out . println ( wLT . word ( ) ) ; System . out . println ( wLT . lemma ( ) ) ; System . out . println ( wLT . tag ( ) ) ; WordLemmaTag wLT2 = new WordLemmaTag ( ) ; wLT2 . setFromString ( "bought/buy/V" ) ; System . out . println ( wLT2 . word ( ) ) ; System . out . println ( wLT2 . lemma ( ) ) ; System . out . println ( wLT2 . tag ( ) ) ; WordLemmaTag wLT3 = new WordLemmaTag ( ) ; wLT2 . setFromString ( "life" ) ; System . out . println ( wLT3 . word ( ) ) ; System . out . println ( wLT3 . lemma ( ) ) ; System . out . println ( wLT3 . tag ( ) ) ; |
public class ServerException { /** * Gets any detail messages , preferring the provided locale .
* @ return The detail messages , with { num } - indexed placeholders populated ,
* if needed . */
public String [ ] getDetails ( Locale locale ) { } } | if ( m_details == null || m_details . length == 0 ) { return s_emptyStringArray ; } String [ ] ret = new String [ m_details . length ] ; for ( int i = 0 ; i < m_details . length ; i ++ ) { ret [ i ] = getLocalizedOrCode ( m_bundleName , locale , m_code , null ) ; } return ret ; |
public class OrderByPlanNode { /** * Add multiple sort expressions to the order - by
* @ param sortExprs List of the input expression on which to order the rows
* @ param sortDirs List of the corresponding sort order for each input expression */
public void addSortExpressions ( List < AbstractExpression > sortExprs , List < SortDirectionType > sortDirs ) { } } | assert ( sortExprs . size ( ) == sortDirs . size ( ) ) ; for ( int i = 0 ; i < sortExprs . size ( ) ; ++ i ) { addSortExpression ( sortExprs . get ( i ) , sortDirs . get ( i ) ) ; } |
public class CassandraTableScanJavaRDD { /** * Builds a K / V Pair RDD using the partitioner from an existing
* CassandraTableScanPairRDD . Since we cannot determine ahead of time
* the type of the PairRDD or the type of it ' s partitioner this method will
* throw exceptions if the Partitioner is not a CassandraPartitioner at
* runtime . */
public < K > CassandraJavaPairRDD < K , R > keyAndApplyPartitionerFrom ( RowReaderFactory < K > rrf , RowWriterFactory < K > rwf , Class < K > keyClass , CassandraJavaPairRDD < K , ? > otherRDD ) { } } | ClassTag < K > keyClassTag = JavaApiHelper . getClassTag ( keyClass ) ; CassandraRDD < Tuple2 < K , R > > newRDD = this . rdd ( ) . keyBy ( keyClassTag , rrf , rwf ) . withPartitioner ( otherRDD . rdd ( ) . partitioner ( ) ) ; return new CassandraJavaPairRDD < > ( newRDD , keyClassTag , classTag ( ) ) ; |
public class UtilImpl_FileUtils { /** * TODO : Change the result to ' boolean ' . */
public static Boolean isFile ( final File target ) { } } | return AccessController . doPrivileged ( new PrivilegedAction < Boolean > ( ) { @ Override public Boolean run ( ) { return Boolean . valueOf ( target . isFile ( ) ) ; } } ) ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.