signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class MockServerClient { /** * Bind new ports to listen on */ public List < Integer > bind ( Integer ... ports ) { } }
String boundPorts = sendRequest ( request ( ) . withMethod ( "PUT" ) . withPath ( calculatePath ( "bind" ) ) . withBody ( portBindingSerializer . serialize ( portBinding ( ports ) ) , StandardCharsets . UTF_8 ) ) . getBodyAsString ( ) ; return portBindingSerializer . deserialize ( boundPorts ) . getPorts ( ) ;
public class Matrix4d { /** * Apply rotation of < code > angles . z < / code > radians about the Z axis , followed by a rotation of < code > angles . y < / code > radians about the Y axis and * followed by a rotation of < code > angles . x < / code > radians about the X axis . * When used with a right - handed coor...
return rotateZYX ( angles . z , angles . y , angles . x ) ;
public class RemoteFieldTable { /** * I ' m done with the model , free the resources . */ public void free ( ) { } }
try { if ( m_tableRemote != null ) m_tableRemote . freeRemoteSession ( ) ; } catch ( RemoteException ex ) { ex . printStackTrace ( ) ; } m_tableRemote = null ; super . free ( ) ;
public class DomXmlEnsure { /** * Ensure that the nodeList is either null or empty . * @ param nodeList the nodeList to ensure to be either null or empty * @ param expression the expression was used to fine the nodeList * @ throws SpinXPathException if the nodeList is either null or empty */ public static void en...
if ( nodeList == null || nodeList . getLength ( ) == 0 ) { throw LOG . unableToFindXPathExpression ( expression ) ; }
public class Quaternionf { /** * / * ( non - Javadoc ) * @ see org . joml . Quaternionfc # positiveZ ( org . joml . Vector3f ) */ public Vector3f positiveZ ( Vector3f dir ) { } }
float invNorm = 1.0f / ( x * x + y * y + z * z + w * w ) ; float nx = - x * invNorm ; float ny = - y * invNorm ; float nz = - z * invNorm ; float nw = w * invNorm ; float dx = nx + nx ; float dy = ny + ny ; float dz = nz + nz ; dir . x = nx * dz + nw * dy ; dir . y = ny * dz - nw * dx ; dir . z = - nx * dx - ny * dy + ...
public class NativeLoader { /** * Determine the right linux library depending on the architecture . * @ param library The library name . * @ param osName The operating system name . * @ param osArch The system architecture . * @ return The library resource . * @ throws UnsupportedOperationException Throw an e...
String resourceName ; String platform = null ; String fileExtension = "so" ; switch ( osArch ) { case ARCH_AMD64 : case ARCH_X86_64 : platform = "linux-x64" ; break ; case ARCH_ARM : platform = "linux-armhf32" ; break ; case ARCH_AARCH64 : platform = "linux-aarch64" ; break ; default : unsupportedPlatform ( osName , os...
public class ReadableWrappersImpl { /** * Converts the List to PagedList . * @ param list list to be converted in to paged list * @ param < InnerT > the wrapper inner type * @ return the Paged list for the inner type . */ public static < InnerT > PagedList < InnerT > convertToPagedList ( List < InnerT > list ) { ...
PageImpl < InnerT > page = new PageImpl < > ( ) ; page . setItems ( list ) ; page . setNextPageLink ( null ) ; return new PagedList < InnerT > ( page ) { @ Override public Page < InnerT > nextPage ( String nextPageLink ) { return null ; } } ;
public class HSMDependenceMeasure { /** * Count the number of cells above the threshold . * @ param mat Matrix * @ param threshold Threshold * @ return Number of elements above the threshold . */ private int countAboveThreshold ( int [ ] [ ] mat , double threshold ) { } }
int ret = 0 ; for ( int i = 0 ; i < mat . length ; i ++ ) { int [ ] row = mat [ i ] ; for ( int j = 0 ; j < row . length ; j ++ ) { if ( row [ j ] >= threshold ) { ret ++ ; } } } return ret ;
public class BeanCodeGen { /** * Main method . * This calls { @ code System . exit } . * @ param args the arguments , not null */ public static void main ( String [ ] args ) { } }
BeanCodeGen gen ; try { gen = createFromArgs ( args ) ; } catch ( RuntimeException ex ) { System . out . println ( ex . getMessage ( ) ) ; System . out . println ( "" ) ; System . out . println ( "Code generator" ) ; System . out . println ( " Usage java org.joda.beans.gen.BeanCodeGen [file]" ) ; System . out . printl...
public class VarOptItemsSketch { /** * Returns a copy of the items ( no weights ) in the sketch as members of Class < em > clazz < / em > , * or null if empty . The returned array length may be smaller than the total capacity . * < p > This method allocates an array of class < em > clazz < / em > , which must eithe...
assert ( h_ + r_ ) > 0 ; // are 2 Array . asList ( data _ . subList ( ) ) copies better ? final T [ ] prunedList = ( T [ ] ) Array . newInstance ( clazz , getNumSamples ( ) ) ; int i = 0 ; for ( T item : data_ ) { if ( item != null ) { prunedList [ i ++ ] = item ; } } return prunedList ;
public class DomainConfigurationMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DomainConfiguration domainConfiguration , ProtocolMarshaller protocolMarshaller ) { } }
if ( domainConfiguration == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( domainConfiguration . getWorkflowExecutionRetentionPeriodInDays ( ) , WORKFLOWEXECUTIONRETENTIONPERIODINDAYS_BINDING ) ; } catch ( Exception e ) { throw new SdkClien...
public class HttpMessage { /** * Returns the names of the parameters of the given { @ code type } . * @ param type the type of the parameters that will be extracted from the message * @ return a { @ code TreeSet } with the names of the parameters of the given { @ code type } , never { @ code null } * @ since 2.4....
TreeSet < String > set = new TreeSet < > ( ) ; Map < String , String > paramMap = Model . getSingleton ( ) . getSession ( ) . getParams ( this , type ) ; for ( Entry < String , String > param : paramMap . entrySet ( ) ) { set . add ( param . getKey ( ) ) ; } return set ;
public class ListDataKey { /** * creates a list data key with the given name and type . Null types are allowed . * @ param < T > the type of the value * @ param name the name of the key that is stored in the xdata file * @ param dataClass the class of the type * @ return */ public static < T > ListDataKey < T >...
return create ( name , dataClass , true ) ;
public class AvatarNode { /** * Returns the address of the remote namenode */ static InetSocketAddress getRemoteNamenodeAddress ( Configuration conf , InstanceId instance ) throws IOException { } }
String fs = null ; if ( instance == InstanceId . NODEZERO ) { fs = conf . get ( DFS_NAMENODE_RPC_ADDRESS1_KEY ) ; if ( fs == null ) fs = conf . get ( "fs.default.name1" ) ; } else if ( instance == InstanceId . NODEONE ) { fs = conf . get ( DFS_NAMENODE_RPC_ADDRESS0_KEY ) ; if ( fs == null ) fs = conf . get ( "fs.defaul...
public class FloatMapper { /** * { @ inheritDoc } */ @ Override protected Float doBase ( String name , Object value ) { } }
if ( value instanceof Number ) { return ( ( Number ) value ) . floatValue ( ) ; } else if ( value instanceof String ) { try { return Double . valueOf ( ( String ) value ) . floatValue ( ) ; } catch ( NumberFormatException e ) { throw new IndexException ( "Field '{}' with value '{}' can not be parsed as float" , name , ...
public class ApiOvhSms { /** * The senders that are attached to your personal informations or OVH services and that can be automatically validated * REST : GET / sms / { serviceName } / sendersAvailableForValidation * @ param referer [ required ] Information type * @ param serviceName [ required ] The internal na...
String qPath = "/sms/{serviceName}/sendersAvailableForValidation" ; StringBuilder sb = path ( qPath , serviceName ) ; query ( sb , "referer" , referer ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , t3 ) ;
public class CmsHtmlList { /** * Returns all items of the current page . < p > * @ return all items of the current page , a list of { @ link CmsListItem } objects */ public List < CmsListItem > getCurrentPageItems ( ) { } }
if ( getSize ( ) == 0 ) { return Collections . emptyList ( ) ; } if ( m_metadata . isSelfManaged ( ) ) { return getContent ( ) ; } return Collections . unmodifiableList ( getContent ( ) . subList ( displayedFrom ( ) - 1 , displayedTo ( ) ) ) ;
public class TagValuesMarshaller { /** * Marshall the given parameter object . */ public void marshall ( TagValues tagValues , ProtocolMarshaller protocolMarshaller ) { } }
if ( tagValues == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( tagValues . getKey ( ) , KEY_BINDING ) ; protocolMarshaller . marshall ( tagValues . getValues ( ) , VALUES_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ...
public class SignatureRequest { /** * Removes the signer from the list . If that user does not exist , this will * throw a HelloSignException . * @ param email String * @ throws HelloSignException thrown if there is a problem removing the * signer . */ public void removeSigner ( String email ) throws HelloSignE...
if ( email == null ) { throw new HelloSignException ( "Cannot remove null signer" ) ; } for ( int i = 0 ; i < signers . size ( ) ; i ++ ) { if ( email . equalsIgnoreCase ( signers . get ( i ) . getEmail ( ) ) ) { signers . remove ( i ) ; } }
public class FTPConnection { /** * Internally registers a command * @ param label The command name * @ param help The help message * @ param cmd The command function * @ param needsAuth Whether authentication is required to run this command */ protected void addCommand ( String label , String help , Command cmd...
commands . put ( label . toUpperCase ( ) , new CommandInfo ( cmd , help , needsAuth ) ) ;
public class ExperimentsInner { /** * Gets a list of Experiments within the specified Workspace . * @ param resourceGroupName Name of the resource group to which the resource belongs . * @ param workspaceName The name of the workspace . Workspace names can only contain a combination of alphanumeric characters along...
return listByWorkspaceWithServiceResponseAsync ( resourceGroupName , workspaceName , experimentsListByWorkspaceOptions ) . map ( new Func1 < ServiceResponse < Page < ExperimentInner > > , Page < ExperimentInner > > ( ) { @ Override public Page < ExperimentInner > call ( ServiceResponse < Page < ExperimentInner > > resp...
public class HBaseTapCollector { /** * Method collect writes the given values to the { @ link Tap } this instance * encapsulates . * @ param writableComparable * of type WritableComparable * @ param writable * of type Writable * @ throws IOException * when */ public void collect ( Object writableComparabl...
if ( hadoopFlowProcess instanceof HadoopFlowProcess ) ( ( HadoopFlowProcess ) hadoopFlowProcess ) . getReporter ( ) . progress ( ) ; writer . write ( writableComparable , writable ) ;
public class SmartBinder { /** * Terminate this binder by looking up the named static method on the * given target type . Perform the actual method lookup using the given * Lookup object . If the lookup fails , a RuntimeException will be raised , * containing the actual reason . This method is for convenience in ...
return new SmartHandle ( start , binder . invokeStaticQuiet ( lookup , target , name ) ) ;
public class CheckedInputStream { /** * Skips specified number of bytes of input . * @ param n the number of bytes to skip * @ return the actual number of bytes skipped * @ exception IOException if an I / O error has occurred */ public long skip ( long n ) throws IOException { } }
byte [ ] buf = new byte [ 512 ] ; long total = 0 ; while ( total < n ) { long len = n - total ; len = read ( buf , 0 , len < buf . length ? ( int ) len : buf . length ) ; if ( len == - 1 ) { return total ; } total += len ; } return total ;
public class ParserContext { /** * Processes the XML document at the provided { @ link URL } and returns a result from the namespace element handlers . */ public < T > T processDocument ( URI uri ) throws ConfigurationException { } }
DocumentBuilderFactory dbFactory = DocumentBuilderFactory . newInstance ( ) ; dbFactory . setNamespaceAware ( true ) ; DocumentBuilder dBuilder = null ; try { dBuilder = dbFactory . newDocumentBuilder ( ) ; } catch ( Exception e ) { throw new WindupException ( "Failed to build xml parser due to: " + e . getMessage ( ) ...
public class XmlBeanMapper { /** * This method loads the JAXB - bean as XML from the given { @ code inputStream } . * @ param inputStream is the { @ link InputStream } with the XML to parse . * @ return the parsed XML converted to the according JAXB - bean . * @ param source describes the source of the invalid XM...
try { Object unmarshalledObject = getOrCreateUnmarshaller ( ) . unmarshal ( inputStream ) ; T jaxbBean = this . xmlBeanClass . cast ( unmarshalledObject ) ; validate ( jaxbBean ) ; return jaxbBean ; } catch ( JAXBException e ) { throw new XmlInvalidException ( e , source ) ; }
public class LocalFileSystem { /** * Moves files to a bad file directory on the same device , so that their * storage will not be reused . */ public boolean reportChecksumFailure ( Path p , FSDataInputStream in , long inPos , FSDataInputStream sums , long sumsPos ) { } }
try { // canonicalize f File f = ( ( RawLocalFileSystem ) fs ) . pathToFile ( p ) . getCanonicalFile ( ) ; // find highest writable parent dir of f on the same device String device = new DF ( f , getConf ( ) ) . getMount ( ) ; File parent = f . getParentFile ( ) ; File dir = null ; while ( parent != null && parent . ca...
public class ChannelClientImpl { /** * Called when the link is closing . */ @ Override public void shutdown ( ShutdownModeAmp mode ) { } }
// jamp / 3210 // getReadMailbox ( ) . close ( ) ; try { getServiceRefOut ( ) . shutdown ( mode ) ; } catch ( Throwable e ) { log . log ( Level . FINER , e . toString ( ) , e ) ; } for ( ServiceRefAmp service : _linkServiceMap . values ( ) ) { service . shutdown ( mode ) ; } for ( StubAmp actor : _closeList ) { actor ....
public class LssClient { /** * List all your live sessions with given status . * @ param status Live session status . * @ return The list of all your live sessions . */ public ListSessionsResponse listSessions ( String status ) { } }
ListSessionsRequest request = new ListSessionsRequest ( ) . withStatus ( status ) ; return listSessions ( request ) ;
public class Assertions { /** * Check an object by a validator . * @ param < T > object type * @ param obj object to be checked * @ param validator validator for the operation * @ return the object if it is valid * @ throws InvalidObjectError will be thrown if the object is invalid * @ since 1.0.2 */ @ Null...
if ( assertNotNull ( validator ) . isValid ( obj ) ) { return obj ; } else { final InvalidObjectError error = new InvalidObjectError ( "Detected invalid object" , obj ) ; MetaErrorListeners . fireError ( "Invalid object" , error ) ; throw error ; }
public class GVRLight { /** * Bind an { @ code int } to the shader uniform { @ code key } . * Throws an exception of the key does not exist . * @ param key Name of the shader uniform * @ param value New data */ public void setInt ( String key , int value ) { } }
checkKeyIsUniform ( key ) ; NativeLight . setInt ( getNative ( ) , key , value ) ;
public class Humanize { /** * For dates that are the current day or within one day , return ' today ' , * ' tomorrow ' or ' yesterday ' , as appropriate . Otherwise , returns a string * formatted according to a locale sensitive DateFormat . * @ param style * The style of the Date * @ param then * The date (...
Date today = new Date ( ) ; long delta = then . getTime ( ) - today . getTime ( ) ; long days = delta / ND_FACTOR ; if ( days == 0 ) return context . get ( ) . getMessage ( "today" ) ; else if ( days == 1 ) return context . get ( ) . getMessage ( "tomorrow" ) ; else if ( days == - 1 ) return context . get ( ) . getMess...
public class JmesPathContainsFunction { /** * Retrieves the subject ( lhs expression ) which could be an array * or string , the search ( rhs expression ) which could be any JmesPath * expression . If subject is an array , this function returns true if * one of the elements in the array is equal to the provided s...
JsonNode subject = evaluatedArgs . get ( 0 ) ; JsonNode search = evaluatedArgs . get ( 1 ) ; if ( subject . isArray ( ) ) { return doesArrayContain ( subject , search ) ; } else if ( subject . isTextual ( ) ) { return doesStringContain ( subject , search ) ; } throw new InvalidTypeException ( "Type mismatch. Expecting ...
public class AmqpClient { /** * Opens a channel on server . * @ return AmqpChannel */ public AmqpChannel openChannel ( ) { } }
int id = ++ this . channelCount ; AmqpChannel chan = new AmqpChannel ( id , this ) ; channels . put ( id , chan ) ; return chan ;
public class DefaultDedupEventStore { /** * Copies events matching the specified predicate from one dedup queue to another . * Note : this method expects both " from " and " to " are dedup queues . If " from " queue is not , use * { @ link # copyFromRawChannel } instead to avoid starting a DedupQueueService for " f...
checkNotNull ( from , "from" ) ; checkNotNull ( to , "to" ) ; ScanSink sink = newCopySink ( to ) ; _delegate . scan ( _channels . writeChannel ( from ) , filter , sink , COPY_BATCH_SIZE , since ) ; SortedQueue source = getQueueReadOnly ( from , SERVICE_SLOW_WAIT_DURATION ) ; Iterator < List < ByteBuffer > > it = Iterat...
public class VisualizationUtils { /** * Plots the MSD curve with the trajectory t and adds the fitted model for confined diffusion above . * @ param t Trajectory to calculate the msd curve * @ param lagMin Minimum timelag ( e . g . 1,2,3 . . ) lagMin * timelag = elapsed time in seconds * @ param lagMax Maximum ti...
double [ ] xData = new double [ lagMax - lagMin + 1 ] ; double [ ] yData = new double [ lagMax - lagMin + 1 ] ; double [ ] modelData = new double [ lagMax - lagMin + 1 ] ; MeanSquaredDisplacmentFeature msdeval = new MeanSquaredDisplacmentFeature ( t , lagMin ) ; msdeval . setTrajectory ( t ) ; msdeval . setTimelag ( la...
public class EntityProcessor { /** * < p > Accepts the { @ link InvocationContext } of an { @ link HttpEntityEnclosingRequest } and inserts * < b > the < / b > request parameter which is annotated with @ { @ link Entity } into its body . < / p > * < p > < b > Note < / b > that it makes no sense to scope multiple en...
try { if ( request instanceof HttpEntityEnclosingRequestBase ) { List < Entry < Entity , Object > > entities = Metadata . onParams ( Entity . class , context ) ; if ( entities . isEmpty ( ) ) { throw new MissingEntityException ( context ) ; } if ( entities . size ( ) > 1 ) { throw new MultipleEntityException ( context ...
public class OrExpressionImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public boolean eIsSet ( int featureID ) { } }
switch ( featureID ) { case SimpleExpressionsPackage . OR_EXPRESSION__LEFT : return left != null ; case SimpleExpressionsPackage . OR_EXPRESSION__RIGHT : return right != null ; } return super . eIsSet ( featureID ) ;
public class EncryptedCachedDiskStringsTable { /** * Get an item from the shared string table * @ param idx index of the entry * @ return entry */ @ Override public RichTextString getItemAt ( int idx ) { } }
try { return new XSSFRichTextString ( this . getString ( idx ) ) ; } catch ( IOException e ) { LOG . error ( "Cannot read from temporary shared String table. Exception: " + e ) ; } return new XSSFRichTextString ( "" ) ;
public class CmsLoginController { /** * Logs out the current user redirecting to the login form afterwards . < p > * @ param cms the cms context * @ param request the servlet request * @ param response the servlet response * @ throws IOException if writing to the response fails */ public static void logout ( Cm...
String loggedInUser = cms . getRequestContext ( ) . getCurrentUser ( ) . getName ( ) ; HttpSession session = request . getSession ( false ) ; if ( session != null ) { session . invalidate ( ) ; /* we need this because a new session might be created after this method , but before the session info is updated in OpenCms...
public class NodeUtil { /** * Creates a node representing a qualified name . * @ param name A qualified name ( e . g . " foo " or " foo . bar . baz " ) * @ return A VAR node , or an EXPR _ RESULT node containing an ASSIGN or NAME node . */ public static Node newQNameDeclaration ( AbstractCompiler compiler , String ...
return newQNameDeclaration ( compiler , name , value , info , Token . VAR ) ;
public class AbstractWriteHandler { /** * Handles request complete event . */ public void onCompleted ( ) { } }
mSerializingExecutor . execute ( ( ) -> { Preconditions . checkState ( mContext != null ) ; try { completeRequest ( mContext ) ; replySuccess ( ) ; } catch ( Exception e ) { LogUtils . warnWithException ( LOG , "Exception occurred while completing write request {}." , mContext . getRequest ( ) , e ) ; Throwables . thro...
public class PageUtil { /** * 根据总数计算总页数 * @ param totalCount 总数 * @ param pageSize 每页数 * @ return 总页数 */ public static int totalPage ( int totalCount , int pageSize ) { } }
if ( pageSize == 0 ) { return 0 ; } return totalCount % pageSize == 0 ? ( totalCount / pageSize ) : ( totalCount / pageSize + 1 ) ;
public class Util { /** * Is this a CData string ? * @ param string The string to analyze . * @ return true if this string must be a CDATA area ( if it has carriage - returns ) . */ public static boolean isCData ( String string ) { } }
if ( string != null ) { for ( int i = 0 ; i < string . length ( ) ; i ++ ) { char chChar = string . charAt ( i ) ; if ( ( chChar == 0x9 ) || ( chChar == 0xD ) || ( chChar == 0xA ) ) return true ; // Carriage return / Line feed / newline } } return false ;
public class StaplerResponseWrapper { /** * { @ inheritDoc } */ @ Override public void sendError ( int sc , String msg ) throws IOException { } }
getWrapped ( ) . sendError ( sc , msg ) ;
public class TaxRate { /** * Creates a new tax rate . */ public static TaxRate create ( TaxRateCreateParams params , RequestOptions options ) throws StripeException { } }
String url = String . format ( "%s%s" , Stripe . getApiBase ( ) , "/v1/tax_rates" ) ; return request ( ApiResource . RequestMethod . POST , url , params , TaxRate . class , options ) ;
public class Validate { /** * < p > Validate that the specified argument string is * neither < code > null < / code > nor a length of zero ( no characters ) ; * otherwise throwing an exception with the specified message . * < pre > Validate . notEmpty ( myString , " The string must not be empty " ) ; < / pre > ...
if ( string == null || string . length ( ) == 0 ) { throw new IllegalArgumentException ( message ) ; }
public class FindbugsPropertyPage { /** * Triggers FB analysis on given project * @ param myProject opened project with FindBugs nature */ private static void runBuild ( @ Nonnull IProject myProject ) { } }
StructuredSelection selection = new StructuredSelection ( myProject ) ; FindBugsAction action = new FindBugsAction ( ) ; action . selectionChanged ( null , selection ) ; action . run ( null ) ;
public class WITH { /** * < div color = ' red ' style = " font - size : 24px ; color : red " > < b > < i > < u > JCYPHER < / u > < / i > < / b > < / div > * < div color = ' red ' style = " font - size : 18px ; color : red " > < i > return the result of a collection expression < / i > < / div > * < div color = ' red...
RElement < RElement < ? > > ret = RFactory . resultOf ( C ) ; ASTNode an = APIObjectAccess . getAstNode ( ret ) ; an . setClauseType ( ClauseType . WITH ) ; return ret ;
public class TransformerComponentBuilder { /** * Notification method invoked when transformer is removed . */ @ Override protected void onRemovedInternal ( ) { } }
final List < TransformerChangeListener > listeners = getAllListeners ( ) ; for ( final TransformerChangeListener listener : listeners ) { listener . onOutputChanged ( this , new LinkedList < > ( ) ) ; listener . onRemove ( this ) ; }
public class Mac { /** * Finishes the MAC operation . * < p > A call to this method resets this < code > Mac < / code > object to the * state it was in when previously initialized via a call to * < code > init ( Key ) < / code > or * < code > init ( Key , AlgorithmParameterSpec ) < / code > . * That is , the ...
chooseFirstProvider ( ) ; if ( initialized == false ) { throw new IllegalStateException ( "MAC not initialized" ) ; } byte [ ] mac = spi . engineDoFinal ( ) ; spi . engineReset ( ) ; return mac ;
public class SlotManager { /** * Suspends the component . This clears the internal state of the slot manager . */ public void suspend ( ) { } }
LOG . info ( "Suspending the SlotManager." ) ; // stop the timeout checks for the TaskManagers and the SlotRequests if ( taskManagerTimeoutCheck != null ) { taskManagerTimeoutCheck . cancel ( false ) ; taskManagerTimeoutCheck = null ; } if ( slotRequestTimeoutCheck != null ) { slotRequestTimeoutCheck . cancel ( false )...
public class IterableSubject { /** * Checks that a actual iterable contains none of the excluded objects or fails . ( Duplicates are * irrelevant to this test , which fails if any of the actual elements equal any of the excluded . ) */ public final void containsNoneOf ( @ NullableDecl Object firstExcluded , @ Nullabl...
containsNoneIn ( accumulate ( firstExcluded , secondExcluded , restOfExcluded ) ) ;
public class TregexPatternCompiler { /** * Create a TregexPattern from this tregex string using the headFinder and * basicCat function this TregexPatternCompiler was created with . * < i > Implementation note : < / i > If there is an invalid token in the Tregex * parser , JavaCC will throw a TokenMgrError . This ...
for ( Pair < String , String > macro : macros ) { tregex = tregex . replaceAll ( macro . first ( ) , macro . second ( ) ) ; } TregexPattern pattern ; try { TregexParser parser = new TregexParser ( new StringReader ( tregex + '\n' ) , basicCatFunction , headFinder ) ; pattern = parser . Root ( ) ; } catch ( TokenMgrErro...
public class Validator { /** * Validates a field to be a valid IPv4 address * @ param name The field to check * @ param message A custom error message instead of the default one */ public void expectIpv4 ( String name , String message ) { } }
String value = Optional . ofNullable ( get ( name ) ) . orElse ( "" ) ; if ( ! InetAddressValidator . getInstance ( ) . isValidInet4Address ( value ) ) { addError ( name , Optional . ofNullable ( message ) . orElse ( messages . get ( Validation . IPV4_KEY . name ( ) , name ) ) ) ; }
public class V2ExtraJaxbClassModel { /** * { @ inheritDoc } */ @ Override public ExtraJaxbClassModel setClazz ( Class < ? > clazz ) { } }
String c = clazz != null ? clazz . getName ( ) : null ; setModelValue ( c ) ; return this ;
public class OutSegment { /** * < pre > * u8 type = 0 * u8 isCont * < / pre > */ private int fillFooter ( byte [ ] buffer , int offset , int entryTail , boolean isCont ) { } }
BitsUtil . writeInt16 ( buffer , offset , entryTail ) ; offset += 2 ; buffer [ offset ] = ( byte ) ( isCont ? 1 : 0 ) ; offset ++ ; return offset ;
public class OSMTablesFactory { /** * Create the relation table . * @ param connection * @ param relationTable * @ return * @ throws SQLException */ public static PreparedStatement createRelationTable ( Connection connection , String relationTable ) throws SQLException { } }
try ( Statement stmt = connection . createStatement ( ) ) { StringBuilder sb = new StringBuilder ( "CREATE TABLE " ) ; sb . append ( relationTable ) ; sb . append ( "(ID_RELATION BIGINT PRIMARY KEY," + "USER_NAME VARCHAR," + "UID BIGINT," + "VISIBLE BOOLEAN," + "VERSION INTEGER," + "CHANGESET INTEGER," + "LAST_UPDATE T...
public class SubunitCluster { /** * Tells whether the other SubunitCluster contains exactly the same Subunit . * This is checked by String equality of their residue one - letter sequences . * @ param other * SubunitCluster * @ return true if the SubunitClusters are identical , false otherwise */ public boolean ...
String thisSequence = this . subunits . get ( this . representative ) . getProteinSequenceString ( ) ; String otherSequence = other . subunits . get ( other . representative ) . getProteinSequenceString ( ) ; return thisSequence . equals ( otherSequence ) ;
public class Preconditions { /** * A { @ code double } specialized version of { @ link # checkPrecondition ( Object , * boolean , Function ) } * @ param value The value * @ param condition The predicate * @ param describer The describer of the predicate * @ return value * @ throws PreconditionViolationExcep...
return innerCheckD ( value , condition , describer ) ;
public class AmazonGlacierClient { /** * This operation lists all the tags attached to a vault . The operation returns an empty map if there are no tags . * For more information about tags , see < a * href = " http : / / docs . aws . amazon . com / amazonglacier / latest / dev / tagging . html " > Tagging Amazon Gl...
request = beforeClientExecution ( request ) ; return executeListTagsForVault ( request ) ;
public class Caster { /** * cast a value to a value defined by type argument * @ param pc * @ param type type of the returning Value * @ param o Object to cast * @ return casted Value * @ throws PageException */ public static Object castTo ( PageContext pc , String type , Object o , boolean alsoPattern ) thro...
type = StringUtil . toLowerCase ( type ) . trim ( ) ; if ( type . length ( ) > 2 ) { char first = type . charAt ( 0 ) ; switch ( first ) { case 'a' : if ( type . equals ( "any" ) ) { return o ; } else if ( type . equals ( "array" ) ) { return toArray ( o ) ; } break ; case 'b' : if ( type . equals ( "boolean" ) || type...
public class HessianInput { /** * Reads a byte array from the stream . */ public int readString ( char [ ] buffer , int offset , int length ) throws IOException { } }
int readLength = 0 ; if ( _chunkLength == END_OF_DATA ) { _chunkLength = 0 ; return - 1 ; } else if ( _chunkLength == 0 ) { int tag = read ( ) ; switch ( tag ) { case 'N' : return - 1 ; case 'S' : case 's' : case 'X' : case 'x' : _isLastChunk = tag == 'S' || tag == 'X' ; _chunkLength = ( read ( ) << 8 ) + read ( ) ; br...
public class InterfaceAnalyzer { /** * Analyzes the source code of an interface . The specified interface must not contain methods , that changes the * state of the corresponding object itself . * @ param code * source code of an interface which describes how to generate the < i > immutable < / i > * @ return a...
Check . notNull ( code , "code" ) ; final CompilationUnit unit = Check . notNull ( SourceCodeReader . parse ( code ) , "compilationUnit" ) ; final List < TypeDeclaration > types = Check . notEmpty ( unit . getTypes ( ) , "typeDeclarations" ) ; Check . stateIsTrue ( types . size ( ) == 1 , "only one interface declaratio...
public class TagLibFactory { /** * Laedt eine einzelne TagLib . * @ param file TLD die geladen werden soll . * @ param saxParser Definition des Sax Parser mit dem die TagLib eingelsesen werden soll . * @ return TagLib * @ throws TagLibException */ public static TagLib loadFromFile ( Resource res , Identificatio...
// Read in XML TagLib lib = TagLibFactory . getHashLib ( FunctionLibFactory . id ( res ) ) ; if ( lib == null ) { lib = new TagLibFactory ( null , res , id ) . getLib ( ) ; TagLibFactory . hashLib . put ( FunctionLibFactory . id ( res ) , lib ) ; } lib . setSource ( res . toString ( ) ) ; return lib ;
public class CacheUtil { /** * in difference to the getInstance method of the CacheConnection this method produces a wrapper * Cache ( if necessary ) that creates Entry objects to make sure the Cache has meta data . * @ param cc * @ param config * @ return * @ throws IOException */ public static Cache getInst...
return cc . getInstance ( config ) ;
public class AbstractProject { /** * { @ inheritDoc } * A project must be blocked if its own previous build is in progress , * or if the blockBuildWhenUpstreamBuilding option is true and an upstream * project is building , but derived classes can also check other conditions . */ @ Override public CauseOfBlockage ...
// Block builds until they are done with post - production if ( ! isConcurrentBuild ( ) && isLogUpdated ( ) ) { final R lastBuild = getLastBuild ( ) ; if ( lastBuild != null ) { return new BlockedBecauseOfBuildInProgress ( lastBuild ) ; } else { // The build has been likely deleted after the isLogUpdated ( ) call . // ...
public class Quaternion { /** * Sets this quaternion to one that first rotates about x by the specified number of radians , * then rotates about y , then about z . */ public Quaternion fromAngles ( Vector3 angles ) { } }
return fromAngles ( angles . x , angles . y , angles . z ) ;
public class ScanSpec { /** * Write to log . * @ param log * The { @ link LogNode } to log to . */ public void log ( final LogNode log ) { } }
if ( log != null ) { final LogNode scanSpecLog = log . log ( "ScanSpec:" ) ; for ( final Field field : ScanSpec . class . getDeclaredFields ( ) ) { try { scanSpecLog . log ( field . getName ( ) + ": " + field . get ( this ) ) ; } catch ( final ReflectiveOperationException e ) { // Ignore } } }
public class RottenTomatoesApi { /** * Retrieves movies currently in theaters * @ param country Provides localized data for the selected country * @ return * @ throws RottenTomatoesException */ public List < RTMovie > getInTheaters ( String country ) throws RottenTomatoesException { } }
return getInTheaters ( country , DEFAULT_PAGE , DEFAULT_PAGE_LIMIT ) ;
public class CandidateCluster { /** * Adds the data point with the specified index to the facility */ public void add ( int index , DoubleVector v ) { } }
boolean added = indices . add ( index ) ; assert added : "Adding duplicate indices to candidate facility" ; if ( sumVector == null ) { sumVector = ( v instanceof SparseVector ) ? new SparseHashDoubleVector ( v ) : new DenseVector ( v ) ; } else { VectorMath . add ( sumVector , v ) ; centroid = null ; }
public class Function3Args { /** * This function is used to fixup variables from QNames to stack frame * indexes at stylesheet build time . * @ param vars List of QNames that correspond to variables . This list * should be searched backwards for the first qualified name that * corresponds to the variable refere...
super . fixupVariables ( vars , globalsSize ) ; if ( null != m_arg2 ) m_arg2 . fixupVariables ( vars , globalsSize ) ;
public class ConcurrentTaskScheduler { /** * { @ inheritDoc } * @ see org . audit4j . core . schedule . TaskScheduler # schedule ( java . lang . Runnable , * java . util . Date ) */ @ Override public ScheduledFuture < ? > schedule ( Runnable task , Date startTime ) { } }
long initialDelay = startTime . getTime ( ) - System . currentTimeMillis ( ) ; try { return this . scheduledExecutor . schedule ( decorateTask ( task , false ) , initialDelay , TimeUnit . MILLISECONDS ) ; } catch ( RejectedExecutionException ex ) { throw new TaskRejectedException ( "Executor [" + this . scheduledExecut...
public class StatementInsert { /** * Executes an INSERT _ SELECT statement . It is assumed that the argument * is of the correct type . * @ return the result of executing the statement */ Result getResult ( Session session ) { } }
Table table = baseTable ; Result resultOut = null ; RowSetNavigator generatedNavigator = null ; PersistentStore store = session . sessionData . getRowStore ( baseTable ) ; if ( generatedIndexes != null ) { resultOut = Result . newUpdateCountResult ( generatedResultMetaData , 0 ) ; generatedNavigator = resultOut . getCh...
public class GeometricCumulativeDoubleBondFactory { /** * Create an encoder for axial 2D stereochemistry for the given start and * end atoms . * @ param container the molecule * @ param start start of the cumulated system * @ param end end of the cumulated system * @ return an encoder or null if there are no ...
List < IBond > startBonds = container . getConnectedBondsList ( start ) ; List < IBond > endBonds = container . getConnectedBondsList ( end ) ; if ( startBonds . size ( ) < 2 || endBonds . size ( ) < 2 ) return null ; if ( has2DCoordinates ( startBonds ) && has2DCoordinates ( endBonds ) ) { return axial2DEncoder ( cont...
public class AmazonLightsailClient { /** * Returns the names of all active ( not deleted ) resources . * @ param getActiveNamesRequest * @ return Result of the GetActiveNames operation returned by the service . * @ throws ServiceException * A general service exception . * @ throws InvalidInputException * Li...
request = beforeClientExecution ( request ) ; return executeGetActiveNames ( request ) ;
public class ReadFileRecordRequest { /** * readData - - read all the data for this request . * @ throws java . io . IOException If the data cannot be read */ public void readData ( DataInput din ) throws IOException { } }
int byteCount = din . readUnsignedByte ( ) ; int recordCount = byteCount / 7 ; records = new RecordRequest [ recordCount ] ; for ( int i = 0 ; i < recordCount ; i ++ ) { if ( din . readByte ( ) != 6 ) { throw new IOException ( ) ; } int file = din . readUnsignedShort ( ) ; int record = din . readUnsignedShort ( ) ; if ...
public class Config { public static Integer getPropertyInteger ( Class < ? > cls , String key ) { } }
return getSettings ( ) . getPropertyInteger ( cls , key ) ;
public class DocLint { /** * Simple API entry point . * @ param args Options and operands for doclint * @ throws BadArgs if an error is detected in any args * @ throws IOException if there are problems with any of the file arguments */ public void run ( String ... args ) throws BadArgs , IOException { } }
PrintWriter out = new PrintWriter ( System . out ) ; try { run ( out , args ) ; } finally { out . flush ( ) ; }
public class SimulatorImpl { /** * Schedules the specified task for execution after the specified delay . * @ param task Python object callable without arguments , to schedule * @ param delay delay in seconds before task is to be executed */ public void scheduleTask ( PyObject task , double delay ) { } }
mTimer . schedule ( new PythonCallTimerTask ( task ) , Math . round ( delay * 1000 ) ) ;
public class IfcPortImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ SuppressWarnings ( "unchecked" ) public EList < IfcRelConnectsPorts > getConnectedTo ( ) { } }
return ( EList < IfcRelConnectsPorts > ) eGet ( Ifc2x3tc1Package . Literals . IFC_PORT__CONNECTED_TO , true ) ;
public class BlobInputStream { /** * Repositions this stream to the position at the time the < code > mark < / code > method was last * called on this input stream . NB : If mark is not called we move to the beginning . * @ see java . io . InputStream # mark ( int ) * @ see java . io . IOException */ public synch...
checkClosed ( ) ; try { if ( mpos <= Integer . MAX_VALUE ) { lo . seek ( ( int ) mpos ) ; } else { lo . seek64 ( mpos , LargeObject . SEEK_SET ) ; } buffer = null ; apos = mpos ; } catch ( SQLException se ) { throw new IOException ( se . toString ( ) ) ; }
public class Utilities { /** * Encrypt a string with AES - 128 using the specified key . * @ param message Input string . * @ param key Encryption key . * @ return Encrypted output . */ @ SuppressWarnings ( "InsecureCryptoUsage" ) // Only used in known - weak crypto " legacy " mode . static byte [ ] aes128Encrypt...
try { key = normalizeString ( key , 16 ) ; rightPadString ( message , '{' , 16 ) ; Cipher cipher = Cipher . getInstance ( "AES/ECB/NoPadding" ) ; cipher . init ( Cipher . ENCRYPT_MODE , new SecretKeySpec ( key . getBytes ( ) , "AES" ) ) ; return cipher . doFinal ( message . toString ( ) . getBytes ( ) ) ; } catch ( Exc...
public class MaterialCalendarView { /** * Clear the currently selected date ( s ) */ public void clearSelection ( ) { } }
List < CalendarDay > dates = getSelectedDates ( ) ; adapter . clearSelections ( ) ; for ( CalendarDay day : dates ) { dispatchOnDateSelected ( day , false ) ; }
public class Parameters { /** * Gets a parameter whose value is a ( possibly empty ) comma - separated list of Strings . */ public List < String > getStringList ( final String param ) { } }
return get ( param , new StringToStringList ( "," ) , new AlwaysValid < List < String > > ( ) , "comma-separated list of strings" ) ;
public class DescribeLoadBalancerPolicyTypesRequest { /** * The names of the policy types . If no names are specified , describes all policy types defined by Elastic Load * Balancing . * @ return The names of the policy types . If no names are specified , describes all policy types defined by Elastic * Load Balan...
if ( policyTypeNames == null ) { policyTypeNames = new com . amazonaws . internal . SdkInternalList < String > ( ) ; } return policyTypeNames ;
public class AWSServiceCatalogClient { /** * Get the Access Status for AWS Organization portfolio share feature . This API can only be called by the master * account in the organization . * @ param getAWSOrganizationsAccessStatusRequest * @ return Result of the GetAWSOrganizationsAccessStatus operation returned b...
request = beforeClientExecution ( request ) ; return executeGetAWSOrganizationsAccessStatus ( request ) ;
public class GenerateParseInfoVisitor { /** * Private helper to build the human - readable string for referring to a template in the generated * code ' s javadoc . * @ param currSoyFile The current Soy file for which we ' re generating parse - info code . * @ param template The template that we want to refer to i...
StringBuilder resultSb = new StringBuilder ( ) ; if ( template . getSourceLocation ( ) . getFilePath ( ) . equals ( currSoyFile . getFilePath ( ) ) && template . getTemplateKind ( ) != TemplateMetadata . Kind . DELTEMPLATE ) { resultSb . append ( template . getTemplateName ( ) . substring ( template . getTemplateName (...
public class MpxjConvert { /** * Use the universal project reader to open the file . * Throw an exception if we can ' t determine the file type . * @ param inputFile file name * @ return ProjectFile instance */ private ProjectFile readFile ( String inputFile ) throws MPXJException { } }
ProjectReader reader = new UniversalProjectReader ( ) ; ProjectFile projectFile = reader . read ( inputFile ) ; if ( projectFile == null ) { throw new IllegalArgumentException ( "Unsupported file type" ) ; } return projectFile ;
public class PortalApplicationContextLocator { /** * If running in a web application the existing { @ link WebApplicationContext } will be returned . * if not a singleton { @ link ApplicationContext } is created if needed and returned . Unless a * { @ link WebApplicationContext } is specifically needed this method ...
final ServletContext context = servletContext ; if ( context != null ) { getLogger ( ) . debug ( "Using WebApplicationContext" ) ; if ( applicationContextCreator . isCreated ( ) ) { final IllegalStateException createException = new IllegalStateException ( "A portal managed ApplicationContext has already been created bu...
public class SpringApplicationBuilder { /** * Default properties for the environment . Multiple calls to this method are * cumulative . * @ param defaults the default properties * @ return the current builder * @ see SpringApplicationBuilder # properties ( String . . . ) */ public SpringApplicationBuilder prope...
this . defaultProperties . putAll ( defaults ) ; this . application . setDefaultProperties ( this . defaultProperties ) ; if ( this . parent != null ) { this . parent . properties ( this . defaultProperties ) ; this . parent . environment ( this . environment ) ; } return this ;
public class CmsAliasList { /** * Adds the controls for a single alias to the widget . < p > * @ param alias the alias for which the controls should be added */ public void addAlias ( final CmsAliasBean alias ) { } }
final HorizontalPanel hp = new HorizontalPanel ( ) ; hp . getElement ( ) . getStyle ( ) . setMargin ( 2 , Unit . PX ) ; final CmsTextBox textbox = createTextBox ( ) ; textbox . setFormValueAsString ( alias . getSitePath ( ) ) ; hp . add ( textbox ) ; CmsSelectBox selectbox = createSelectBox ( ) ; selectbox . setFormVal...
public class AmazonRedshiftClient { /** * Returns a list of Amazon Redshift parameter groups , including parameter groups you created and the default * parameter group . For each parameter group , the response includes the parameter group name , description , and * parameter group family name . You can optionally s...
request = beforeClientExecution ( request ) ; return executeDescribeClusterParameterGroups ( request ) ;
public class AbstractFileSystem { /** * { @ inheritDoc } * Sets up a lazy connection to Alluxio through mFileSystem . This must be called before client * operations . * If it is called twice on the same object concurrently , one of the thread will do the * initialization work , the other will wait until initial...
initialize ( uri , conf , null ) ;
public class RaftNodeImpl { /** * Restores the snapshot sent by the leader if it ' s not applied before . * @ return true if snapshot is restores , false otherwise . */ public boolean installSnapshot ( SnapshotEntry snapshot ) { } }
long commitIndex = state . commitIndex ( ) ; if ( commitIndex > snapshot . index ( ) ) { logger . info ( "Ignored stale " + snapshot + ", commit index at: " + commitIndex ) ; return false ; } else if ( commitIndex == snapshot . index ( ) ) { logger . info ( "Ignored " + snapshot + " since commit index is same." ) ; ret...
public class XMLConverUtil { /** * XML to Object * @ param < T > * @ param clazz * clazz * @ param inputStream * inputStream * @ param charset * charset * @ return T */ public static < T > T convertToObject ( Class < T > clazz , InputStream inputStream , Charset charset ) { } }
return convertToObject ( clazz , new InputStreamReader ( inputStream , charset ) ) ;
public class DefaultSocketManager { /** * Open the read and write selectors . This needs to be done before data can * be send through this socket manager using its own API ( not the * { @ link # redirectChannel ( ) redirected channel } ) . These selectors should be * { @ link # closeSelectors ( ) closed } before ...
readSelector = Selector . open ( ) ; socket . register ( readSelector , SelectionKey . OP_READ ) ; writeSelector = Selector . open ( ) ; socket . register ( writeSelector , SelectionKey . OP_WRITE ) ;
public class Ifc2x3tc1FactoryImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public String convertIfcLoadGroupTypeEnumToString ( EDataType eDataType , Object instanceValue ) { } }
return instanceValue == null ? null : instanceValue . toString ( ) ;
public class CompositedActionFrames { /** * documentation inherited from interface */ public int getYOrigin ( int orient , int frameIdx ) { } }
CompositedMultiFrameImage cmfi = ( CompositedMultiFrameImage ) getFrames ( orient ) ; return cmfi . getYOrigin ( frameIdx ) ;
public class GridSyncRecordMessageFilterHandler { /** * On select , synchronize the records . */ public int doRecordChange ( FieldInfo field , int iChangeType , boolean bDisplayOption ) { } }
// Read a valid record int iErrorCode = super . doRecordChange ( field , iChangeType , bDisplayOption ) ; // Initialize the record if ( iErrorCode == DBConstants . NORMAL_RETURN ) { if ( iChangeType == DBConstants . AFTER_ADD_TYPE ) { Object bookmark = this . getOwner ( ) . getLastModified ( m_iHandleType ) ; if ( book...