signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class AbstractJSONDocScanner { /** * Gets the API documentation for the set of classes passed as argument */ public Set < ApiDoc > getApiDocs ( Set < Class < ? > > classes , MethodDisplay displayMethodAs ) { } }
Set < ApiDoc > apiDocs = new TreeSet < ApiDoc > ( ) ; for ( Class < ? > controller : classes ) { ApiDoc apiDoc = getApiDoc ( controller , displayMethodAs ) ; apiDocs . add ( apiDoc ) ; } return apiDocs ;
public class RtfDocumentHeader { /** * Converts a HeaderFooter into a RtfHeaderFooterGroup . Depending on which class * the HeaderFooter is , the correct RtfHeaderFooterGroup is created . * @ param hf The HeaderFooter to convert . * @ param type Whether the conversion is being done on a footer or header * @ ret...
if ( hf != null ) { if ( hf instanceof RtfHeaderFooterGroup ) { return new RtfHeaderFooterGroup ( this . document , ( RtfHeaderFooterGroup ) hf , type ) ; } else if ( hf instanceof RtfHeaderFooter ) { return new RtfHeaderFooterGroup ( this . document , ( RtfHeaderFooter ) hf , type ) ; } else { return new RtfHeaderFoot...
public class SelectSubPlanAssembler { /** * Pull a join order out of the join orders deque , compute all possible plans * for that join order , then append them to the computed plans deque . */ @ Override protected AbstractPlanNode nextPlan ( ) { } }
// repeat ( usually run once ) until plans are created // or no more plans can be created while ( m_plans . size ( ) == 0 ) { // get the join order for us to make plans out of JoinNode joinTree = m_joinOrders . poll ( ) ; // no more join orders = > no more plans to generate if ( joinTree == null ) { return null ; } // ...
public class Funcs { /** * Returns the parse { @ link Function } with given class type . * Supports : { @ link Byte } , { @ link Short } , { @ link Integer } , { @ link Long } , * { @ link Float } , { @ link Double } , { @ link BigInteger } , { @ link BigDecimal } , { @ link Date } * @ param type * @ return */ ...
return new StructBehavior < Function < Object , O > > ( type ) { @ SuppressWarnings ( "unchecked" ) @ Override protected Function < Object , O > booleanIf ( ) { return ( Function < Object , O > ) TO_BOOLEAN ; } @ SuppressWarnings ( "unchecked" ) @ Override protected Function < Object , O > byteIf ( ) { return ( Functio...
public class BinaryHashBucketArea { /** * Append record and insert to bucket . */ boolean appendRecordAndInsert ( BinaryRow record , int hashCode ) throws IOException { } }
final int posHashCode = findBucket ( hashCode ) ; // get the bucket for the given hash code final int bucketArrayPos = posHashCode >> table . bucketsPerSegmentBits ; final int bucketInSegmentPos = ( posHashCode & table . bucketsPerSegmentMask ) << BUCKET_SIZE_BITS ; final MemorySegment bucket = this . buckets [ bucketA...
public class RawResponse { /** * If decompress http response body . Default is true . */ public RawResponse decompress ( boolean decompress ) { } }
return new RawResponse ( method , url , statusCode , statusLine , cookies , headers , body , charset , decompress ) ;
public class DERUniversalString { /** * UniversalStrings have characters which are 4 bytes long - for the * moment we just return them in Hex . . . */ public String getString ( ) { } }
StringBuffer buf = new StringBuffer ( ) ; for ( int i = 0 ; i != string . length ; i ++ ) { buf . append ( table [ ( string [ i ] >>> 4 ) % 0xf ] ) ; buf . append ( table [ string [ i ] & 0xf ] ) ; } return buf . toString ( ) ;
public class SeverityClassificationPulldownAction { /** * Set the menu to given severity level . * @ param severity * the severity level ( 1 . . 5) */ private void selectSeverity ( int severity ) { } }
// Severity is 1 - based , but the menu item list is 0 - based int index = severity - 1 ; for ( int i = 0 ; i < severityItemList . length ; ++ i ) { MenuItem menuItem = severityItemList [ i ] ; menuItem . setEnabled ( true ) ; menuItem . setSelection ( i == index ) ; }
public class Javalin { /** * Adds a PATCH request handler with the given roles for the specified path to the instance . * Requires an access manager to be set on the instance . * @ see AccessManager * @ see < a href = " https : / / javalin . io / documentation # handlers " > Handlers in docs < / a > */ public Jav...
return addHandler ( HandlerType . PATCH , path , handler , permittedRoles ) ;
public class GitlabAPI { /** * Get the comments of a commit * @ param projectId ( required ) - The ID of a project * @ param sha ( required ) - The name of a repository branch or tag or if not given the default branch * @ return A CommitComment * @ throws IOException on gitlab api call error * @ see < a href ...
String tailUrl = GitlabProject . URL + "/" + sanitizeProjectId ( projectId ) + "/repository/commits/" + sha + CommitComment . URL ; return Arrays . asList ( retrieve ( ) . to ( tailUrl , CommitComment [ ] . class ) ) ;
public class ValidatorFactoryMaker { /** * Unbind reference added automatically from addFactory annotation */ @ SuppressWarnings ( "javadoc" ) public void removeFactory ( ValidatorFactory factory ) { } }
// this is to avoid adding items to the cache that were removed while // iterating synchronized ( map ) { providers . remove ( factory ) ; map . clear ( ) ; }
public class ProviderConfig { /** * Load and instantiate the Provider described by this class . * NOTE use of doPrivileged ( ) . * @ return null if the Provider could not be loaded * @ throws ProviderException if executing the Provider ' s constructor * throws a ProviderException . All other Exceptions are igno...
return AccessController . doPrivileged ( new PrivilegedAction < Provider > ( ) { public Provider run ( ) { // if ( debug ! = null ) { // debug . println ( " Loading provider : " + ProviderConfig . this ) ; try { // First try with the boot classloader . return initProvider ( className , Object . class . getClassLoader (...
public class BlobContainersInner { /** * Sets the ImmutabilityPolicy to Locked state . The only action allowed on a Locked policy is ExtendImmutabilityPolicy action . ETag in If - Match is required for this operation . * @ param resourceGroupName The name of the resource group within the user ' s subscription . The n...
if ( resourceGroupName == null ) { throw new IllegalArgumentException ( "Parameter resourceGroupName is required and cannot be null." ) ; } if ( accountName == null ) { throw new IllegalArgumentException ( "Parameter accountName is required and cannot be null." ) ; } if ( containerName == null ) { throw new IllegalArgu...
public class BaseTraceFormatter { /** * The messages log always uses the same / enhanced format , and relies on already formatted * messages . This does the formatting needed to take a message suitable for console . log * and wrap it to fit into messages . log . * @ param genData * @ return Formatted string for...
// This is a very light trace format , based on enhanced : StringBuilder sb = new StringBuilder ( 256 ) ; String name = null ; KeyValuePair [ ] pairs = genData . getPairs ( ) ; KeyValuePair kvp = null ; String message = null ; Long datetime = null ; String level = "" ; String loggerName = null ; String srcClassName = n...
public class HybridViterbi { /** * 构造并初始化网格 * @ param inst * 样本实例 * @ return 双链网格 */ private Node [ ] [ ] [ ] initialLattice ( Instance inst ) { } }
int [ ] [ ] [ ] data = ( int [ ] [ ] [ ] ) inst . getData ( ) ; length = inst . length ( ) ; Node [ ] [ ] [ ] lattice = new Node [ 2 ] [ length ] [ ] ; for ( int i = 0 ; i < length ; i ++ ) { lattice [ 0 ] [ i ] = new Node [ ysize [ 0 ] ] ; for ( int j = 0 ; j < ysize [ 0 ] ; j ++ ) { lattice [ 0 ] [ i ] [ j ] = new No...
public class ApiOvhEmailexchange { /** * Create new archive mailbox * REST : POST / email / exchange / { organizationName } / service / { exchangeService } / account / { primaryEmailAddress } / archive * @ param quota [ required ] Archive mailbox quota ( if not provided mailbox quota will be taken ) * @ param org...
String qPath = "/email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/archive" ; StringBuilder sb = path ( qPath , organizationName , exchangeService , primaryEmailAddress ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "quota" , quota ) ; Str...
public class Reflector { /** * to get a visible Propety ( Field or Getter ) of a object * @ param obj Object to invoke * @ param prop property to call * @ return property value */ public static Object getProperty ( Object obj , String prop , Object defaultValue ) { } }
// first try field Field [ ] fields = getFieldsIgnoreCase ( obj . getClass ( ) , prop , null ) ; if ( ! ArrayUtil . isEmpty ( fields ) ) { try { return fields [ 0 ] . get ( obj ) ; } catch ( Throwable t ) { ExceptionUtil . rethrowIfNecessary ( t ) ; } } // then getter try { char first = prop . charAt ( 0 ) ; if ( first...
public class BsonDecoder { /** * default visibility for unit test */ String decodeCString ( ByteBuf buffer ) throws IOException { } }
int length = buffer . bytesBefore ( BsonConstants . STRING_TERMINATION ) ; if ( length < 0 ) throw new IOException ( "string termination not found" ) ; String result = buffer . toString ( buffer . readerIndex ( ) , length , StandardCharsets . UTF_8 ) ; buffer . skipBytes ( length + 1 ) ; return result ;
public class CmsVisitEntryFilter { /** * Returns an extended filter with the starting date restriction . < p > * @ param from the starting date to filter * @ return an extended filter with the starting date restriction */ public CmsVisitEntryFilter filterFrom ( long from ) { } }
CmsVisitEntryFilter filter = ( CmsVisitEntryFilter ) clone ( ) ; filter . m_dateFrom = from ; return filter ;
public class FalseFriendRuleHandler { @ Override public void startElement ( String namespaceURI , String lName , String qName , Attributes attrs ) throws SAXException { } }
if ( qName . equals ( RULE ) ) { translations . clear ( ) ; id = attrs . getValue ( "id" ) ; if ( ! ( inRuleGroup && defaultOff ) ) { defaultOff = "off" . equals ( attrs . getValue ( "default" ) ) ; } if ( inRuleGroup && id == null ) { id = ruleGroupId ; } correctExamples = new ArrayList < > ( ) ; incorrectExamples = n...
public class M2tsSettingsMarshaller { /** * Marshall the given parameter object . */ public void marshall ( M2tsSettings m2tsSettings , ProtocolMarshaller protocolMarshaller ) { } }
if ( m2tsSettings == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( m2tsSettings . getAbsentInputAudioBehavior ( ) , ABSENTINPUTAUDIOBEHAVIOR_BINDING ) ; protocolMarshaller . marshall ( m2tsSettings . getArib ( ) , ARIB_BINDING ) ; protocol...
public class FileUtils { /** * Read a text file into a String , optionally limiting the length . * @ param file to read ( will not seek , so things like / proc files are OK ) * @ param max length ( positive for head , negative of tail , 0 for no limit ) * @ param ellipsis to add of the file was truncated ( can be...
InputStream input = new FileInputStream ( file ) ; try { if ( max > 0 ) { // " head " mode : read the first N bytes byte [ ] data = new byte [ max + 1 ] ; int length = input . read ( data ) ; if ( length <= 0 ) return "" ; if ( length <= max ) return new String ( data , 0 , length ) ; if ( ellipsis == null ) return new...
public class ArrayCoreMap { /** * Reduces memory consumption to the minimum for representing the values * currently stored stored in this object . */ public void compact ( ) { } }
if ( keys . length > size ) { Class < ? > [ ] newKeys = new Class < ? > [ size ] ; Object [ ] newVals = new Object [ size ] ; System . arraycopy ( keys , 0 , newKeys , 0 , size ) ; System . arraycopy ( values , 0 , newVals , 0 , size ) ; keys = newKeys ; values = newVals ; }
public class PdfPage { /** * Rotates the mediabox , but not the text in it . * @ returna < CODE > PdfRectangle < / CODE > */ PdfRectangle rotateMediaBox ( ) { } }
this . mediaBox = mediaBox . rotate ( ) ; put ( PdfName . MEDIABOX , this . mediaBox ) ; return this . mediaBox ;
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link DMSAngleType } { @ code > } * @ param value * Java instance representing xml element ' s value . * @ return * the new instance of { @ link JAXBElement } { @ code < } { @ link DMSAngleType } { @ code > } */ @ Xm...
return new JAXBElement < DMSAngleType > ( _DmsAngleValue_QNAME , DMSAngleType . class , null , value ) ;
public class CliCommandBuilder { /** * Sets the commands to execute . * @ param commands the commands to execute * @ return the builder */ public CliCommandBuilder setCommands ( final Iterable < String > commands ) { } }
if ( commands == null ) { addCliArgument ( CliArgument . COMMANDS , null ) ; return this ; } final StringBuilder cmds = new StringBuilder ( ) ; for ( final Iterator < String > iterator = commands . iterator ( ) ; iterator . hasNext ( ) ; ) { cmds . append ( iterator . next ( ) ) ; if ( iterator . hasNext ( ) ) cmds . a...
public class CommonOps_DDRM { /** * Inserts into the specified elements of dst the source matrix . * < pre > * for i in len ( rows ) : * for j in len ( cols ) : * dst ( rows [ i ] , cols [ j ] ) = src ( i , j ) * < / pre > * @ param src Source matrix . Not modified . * @ param dst output matrix . Must be ...
if ( rowsSize != src . numRows || colsSize != src . numCols ) throw new MatrixDimensionException ( "Unexpected number of rows and/or columns in dst matrix" ) ; int indexSrc = 0 ; for ( int i = 0 ; i < rowsSize ; i ++ ) { int indexDstRow = dst . numCols * rows [ i ] ; for ( int j = 0 ; j < colsSize ; j ++ ) { dst . data...
public class FileCacheManager { /** * Reads the cache file . */ JsonNode readCacheFile ( ) { } }
if ( cacheFile == null || ! this . checkCacheLockFile ( ) ) { // no cache or the cache is not valid . return null ; } try { if ( ! cacheFile . exists ( ) ) { LOGGER . debug ( "Cache file doesn't exists. File: {}" , cacheFile ) ; return null ; } try ( Reader reader = new InputStreamReader ( new FileInputStream ( cacheFi...
public class DwgUtil { /** * Read a double value from a group of unsigned bytes and a default double * @ param data Array of unsigned bytes obtained from the DWG binary file * @ param offset The current bit offset where the value begins * @ param defVal Default double value * @ throws Exception If an unexpected...
int flags = ( ( Integer ) getBits ( data , 2 , offset ) ) . intValue ( ) ; int read = 2 ; double val ; if ( flags == 0x0 ) { val = defVal ; } else { int _offset = offset + 2 ; String dstr ; if ( flags == 0x3 ) { byte [ ] bytes = ( byte [ ] ) getBits ( data , 64 , _offset ) ; ByteBuffer bb = ByteBuffer . wrap ( bytes ) ...
public class ChaiProviderFactory { /** * Returns a thread - safe " wrapped " { @ code ChaiProvider } . All ldap operations will be forced through a single * lock and then sent to the backing provider . * Depending on the ldap server and the configured timeouts , calling methods on a synchronized * provider may re...
if ( theProvider instanceof SynchronizedProvider ) { return theProvider ; } else { return ( ChaiProvider ) Proxy . newProxyInstance ( theProvider . getClass ( ) . getClassLoader ( ) , theProvider . getClass ( ) . getInterfaces ( ) , new SynchronizedProvider ( theProvider ) ) ; }
public class S3StorageProvider { /** * Counts the number of items in a space up to the maxCount . If maxCount * is reached or exceeded , the returned string will indicate this with a * trailing ' + ' character ( e . g . 1000 + ) . * Note that anecdotal evidence shows that this method of counting * ( using size ...
List < String > spaceContentChunk = null ; long count = 0 ; do { String marker = null ; if ( spaceContentChunk != null && spaceContentChunk . size ( ) > 0 ) { marker = spaceContentChunk . get ( spaceContentChunk . size ( ) - 1 ) ; } spaceContentChunk = getSpaceContentsChunked ( spaceId , null , MAX_ITEM_COUNT , marker ...
public class Days { /** * Obtains a { @ code Days } consisting of the number of days between two dates . * The start date is included , but the end date is not . * The result of this method can be negative if the end is before the start . * @ param startDateInclusive the start date , inclusive , not null * @ pa...
return of ( Math . toIntExact ( DAYS . between ( startDateInclusive , endDateExclusive ) ) ) ;
public class DiskFileItem { /** * Returns the size of the file . * @ return The size of the file , in bytes . */ @ Nonnegative public long getSize ( ) { } }
if ( m_nSize >= 0 ) return m_nSize ; if ( m_aCachedContent != null ) return m_aCachedContent . length ; if ( m_aDFOS . isInMemory ( ) ) return m_aDFOS . getDataLength ( ) ; return m_aDFOS . getFile ( ) . length ( ) ;
public class OsgiPropertyUtils { /** * Retrieve the value of the specified property from framework / system properties . * Value is converted and returned as an int . * @ param propertyName Name of property * @ param defaultValue Default value to return if property is not set * @ return Property or default valu...
String tmpObj = get ( propertyName ) ; if ( tmpObj != null ) { try { return Integer . parseInt ( tmpObj ) ; } catch ( NumberFormatException e ) { } } return defaultValue ;
public class TransactionInput { /** * Connects this input to the relevant output of the referenced transaction if it ' s in the given map . * Connecting means updating the internal pointers and spent flags . If the mode is to ABORT _ ON _ CONFLICT then * the spent output won ' t be changed , but the outpoint . from...
Transaction tx = transactions . get ( outpoint . getHash ( ) ) ; if ( tx == null ) { return TransactionInput . ConnectionResult . NO_SUCH_TX ; } return connect ( tx , mode ) ;
public class CmsListItemWidget { /** * Adds a widget to the button panel . < p > * @ param w the widget to add */ public void addButton ( Widget w ) { } }
m_buttonPanel . add ( w ) ; if ( CmsCoreProvider . get ( ) . isIe7 ( ) ) { m_buttonPanel . getElement ( ) . getStyle ( ) . setWidth ( m_buttonPanel . getWidgetCount ( ) * 22 , Unit . PX ) ; }
public class ImplicitObjectELResolver { /** * If the base object is < code > null < / code > , and the property matches * the name of a JSP implicit object , returns < code > true < / code > * to indicate that implicit objects cannot be overwritten . * < p > The < code > propertyResolved < / code > property of th...
if ( context == null ) { throw new NullPointerException ( ) ; } if ( ( base == null ) && ( "pageContext" . equals ( property ) || "pageScope" . equals ( property ) ) || "requestScope" . equals ( property ) || "sessionScope" . equals ( property ) || "applicationScope" . equals ( property ) || "param" . equals ( property...
public class AbstractStreamMessage { /** * Helper method for the common case of cleaning up all elements in a queue when shutting down the stream . */ void cleanupQueue ( SubscriptionImpl subscription , Queue < Object > queue ) { } }
final Throwable cause = ClosedPublisherException . get ( ) ; for ( ; ; ) { final Object e = queue . poll ( ) ; if ( e == null ) { break ; } try { if ( e instanceof CloseEvent ) { notifySubscriberOfCloseEvent ( subscription , ( CloseEvent ) e ) ; continue ; } if ( e instanceof CompletableFuture ) { ( ( CompletableFuture...
public class ZooKeeperHaServices { @ Override public void close ( ) throws Exception { } }
Throwable exception = null ; try { blobStoreService . close ( ) ; } catch ( Throwable t ) { exception = t ; } internalClose ( ) ; if ( exception != null ) { ExceptionUtils . rethrowException ( exception , "Could not properly close the ZooKeeperHaServices." ) ; }
public class EvaluateRetrievalPerformance { /** * Find all matching objects . * @ param posn Output set . * @ param lrelation Label relation * @ param label Query object label */ private void findMatches ( ModifiableDBIDs posn , Relation < ? > lrelation , Object label ) { } }
posn . clear ( ) ; for ( DBIDIter ri = lrelation . iterDBIDs ( ) ; ri . valid ( ) ; ri . advance ( ) ) { if ( match ( label , lrelation . get ( ri ) ) ) { posn . add ( ri ) ; } }
public class CustomUserRegistryWrapper { /** * { @ inheritDoc } */ @ Override @ FFDCIgnore ( com . ibm . websphere . security . EntryNotFoundException . class ) public String getUniqueGroupId ( String groupSecurityName ) throws EntryNotFoundException , RegistryException { } }
try { return customUserRegistry . getUniqueGroupId ( groupSecurityName ) ; } catch ( com . ibm . websphere . security . EntryNotFoundException e ) { throw new EntryNotFoundException ( e . getMessage ( ) , e ) ; } catch ( Exception e ) { throw new RegistryException ( e . getMessage ( ) , e ) ; }
public class OperaDesktopDriver { /** * Executes an opera action . * @ param using - action _ name * @ param data - data parameter * @ param dataString - data string parameter * @ param dataStringParam - parameter to data string */ public void operaDesktopAction ( String using , int data , String dataString , S...
getScopeServices ( ) . getExec ( ) . action ( using , data , dataString , dataStringParam ) ;
public class Utils { /** * Concatenate and encode the given name / value pairs into a valid URI query string . * This method is the complement of { @ link # parseURIQuery ( String ) } . * @ param uriParams Unencoded name / value pairs . * @ return URI query in the form { name 1 } = { value 1 } { @ literal & } . ....
StringBuilder buffer = new StringBuilder ( ) ; for ( String name : uriParams . keySet ( ) ) { String value = uriParams . get ( name ) ; if ( buffer . length ( ) > 0 ) { buffer . append ( "&" ) ; } buffer . append ( Utils . urlEncode ( name ) ) ; if ( ! Utils . isEmpty ( value ) ) { buffer . append ( "=" ) ; buffer . ap...
public class MessageStoreImpl { /** * Obtain a list of XIDs which are in - doubt . * Part of MBean interface for resolving in - doubt transactions . * @ return the XIDs as an array of strings */ @ Override public String [ ] listPreparedTransactions ( ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getPreparedTransactions" ) ; String [ ] col = null ; if ( _manager != null ) { // Obtain array of in - doubt xids from the XidManager Xid [ ] xids = null ; xids = _manager . listRemoteInDoubts ( ) ; if ( xids != null...
public class TemplatesApi { /** * Gets PDF documents from a template . * Retrieves one or more PDF documents from the specified template . You can specify the ID of the document to retrieve or can specify & # x60 ; combined & # x60 ; to retrieve all documents in the template as one pdf . * @ param accountId The ext...
return getDocument ( accountId , templateId , documentId , null ) ;
public class Threads { /** * sleep 等待 。 已捕捉并处理 InterruptedException 。 * @ param duration * 等待时间 * @ param unit * 时间单位 */ public static void sleep ( final long duration , final TimeUnit unit ) { } }
try { Thread . sleep ( unit . toMillis ( duration ) ) ; } catch ( InterruptedException e ) { LOG . trace ( "" , e ) ; Thread . currentThread ( ) . interrupt ( ) ; }
public class Request { /** * Returns a boolean value . To be used when parameter is required or has a default value . * @ throws java . lang . IllegalArgumentException is value is null or blank */ public boolean mandatoryParamAsBoolean ( String key ) { } }
String s = mandatoryParam ( key ) ; return parseBoolean ( key , s ) ;
public class UploadServlet { /** * Parse the properties . * Override this to do extra stuff . */ public void parseProperties ( Properties properties , MultipartRequest multi ) { } }
Enumeration < ? > params = multi . getParameterNames ( ) ; while ( params . hasMoreElements ( ) ) { String name = ( String ) params . nextElement ( ) ; String value = multi . getParameter ( name ) ; if ( value != null ) properties . setProperty ( name , value ) ; if ( DEBUG ) System . out . println ( name + " = " + val...
public class Logger { /** * { @ inheritDoc } */ public final void warn ( String message , Throwable throwable ) { } }
if ( isWarnEnabled ( ) ) { out . print ( "[ maven embedder WARNING] " ) ; out . println ( message ) ; if ( null != throwable ) { throwable . printStackTrace ( out ) ; } }
public class RuntimeEnv { /** * Returns an instatiator for the specified { @ code clazz } . */ public static < T > Instantiator < T > newInstantiator ( Class < T > clazz ) { } }
final Constructor < T > constructor = getConstructor ( clazz ) ; if ( constructor == null ) { // non - sun jre if ( newInstanceFromObjectInputStream == null ) { if ( objectConstructorId == - 1 ) throw new RuntimeException ( "Could not resolve constructor for " + clazz ) ; return new Android3Instantiator < T > ( clazz )...
public class Frame { public Frame name ( String name , String src ) { } }
this . name = name ; this . src = src ; return this ;
public class StateAssignmentOperation { /** * Verifies conditions in regards to parallelism and maxParallelism that must be met when restoring state . * @ param operatorState state to restore * @ param executionJobVertex task for which the state should be restored */ private static void checkParallelismPrecondition...
// - - - - - max parallelism preconditions - - - - - if ( operatorState . getMaxParallelism ( ) < executionJobVertex . getParallelism ( ) ) { throw new IllegalStateException ( "The state for task " + executionJobVertex . getJobVertexId ( ) + " can not be restored. The maximum parallelism (" + operatorState . getMaxPara...
public class SubWriterHolderWriter { /** * Add the summary link comment . * @ param mw the writer for the member being documented * @ param member the member being documented * @ param firstSentenceTags the first sentence tags for the member to be documented * @ param tdSummary the content tree to which the com...
addIndexComment ( member , firstSentenceTags , tdSummary ) ;
public class IfcStructuralLoadGroupImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ SuppressWarnings ( "unchecked" ) @ Override public EList < IfcStructuralResultGroup > getSourceOfResultGroup ( ) { } }
return ( EList < IfcStructuralResultGroup > ) eGet ( Ifc4Package . Literals . IFC_STRUCTURAL_LOAD_GROUP__SOURCE_OF_RESULT_GROUP , true ) ;
public class STSAssumeRoleSessionCredentialsProvider { /** * Starts a new session by sending a request to the AWS Security Token Service ( STS ) to assume a * Role using the long lived AWS credentials . This class then vends the short lived session * credentials for the assumed Role sent back from STS . */ private ...
AssumeRoleRequest assumeRoleRequest = new AssumeRoleRequest ( ) . withRoleArn ( roleArn ) . withDurationSeconds ( roleSessionDurationSeconds ) . withRoleSessionName ( roleSessionName ) . withPolicy ( scopeDownPolicy ) ; if ( roleExternalId != null ) { assumeRoleRequest = assumeRoleRequest . withExternalId ( roleExterna...
public class XmlEscapeSymbols { /** * These two methods ( two versions : for String and for char [ ] ) compare each of the candidate * text fragments with an CER coming from the SORTED _ CERS array , during binary search operations . */ private static int compare ( final char [ ] cer , final String text , final int s...
final int textLen = end - start ; final int maxCommon = Math . min ( cer . length , textLen ) ; int i ; // char 0 is discarded , will be & in both cases for ( i = 1 ; i < maxCommon ; i ++ ) { final char tc = text . charAt ( start + i ) ; if ( cer [ i ] < tc ) { return - 1 ; } else if ( cer [ i ] > tc ) { return 1 ; } }...
public class BasicRandomRoutingTable { /** * Determine the next TrustGraphNodeId in a route containing * a given neighbor as the prior node . The next hop is the * TrustGraphNodeId paired with the given neighbor in the table . * @ param priorNeighbor the prior node on the route * @ return the next TrustGraphNod...
if ( priorNeighbor != null ) { return routingTable . get ( priorNeighbor ) ; } else { return null ; }
public class EvaluatorSupport { /** * Die Methode execute wird aufgerufen , wenn der Context eines Tags geprueft werden soll . Diese * Methode ueberschreibt , jene des Interface Evaluator . Falls diese Methode durch eine * Implementation nicht ueberschrieben wird , ruft sie wiederere , allenfalls implementierte eva...
return null ;
public class ConnectionDAODefaultImpl { public long ping ( final Connection connection ) throws DevFailed { } }
long result = 0 ; final int maxRetries = connection . transparent_reconnection ? 1 : 0 ; int nbRetries = 0 ; boolean retry ; do { try { result = doPing ( connection ) ; retry = false ; } catch ( final DevFailed e ) { if ( nbRetries < maxRetries ) { retry = true ; } else { throw e ; } nbRetries ++ ; } } while ( retry ) ...
public class Default { public void handlePut ( HttpServletRequest request , HttpServletResponse response , String pathInContext , Resource resource ) throws ServletException , IOException { } }
boolean exists = resource != null && resource . exists ( ) ; if ( exists && ! passConditionalHeaders ( request , response , resource ) ) return ; if ( pathInContext . endsWith ( "/" ) ) { if ( ! exists ) { if ( ! resource . getFile ( ) . mkdirs ( ) ) response . sendError ( HttpResponse . __403_Forbidden , "Directories ...
public class CmsEditProjectDialog { /** * Sets the name of the project . < p > * @ param name the name to set */ public void setName ( String name ) { } }
String oufqn = getOufqn ( ) ; if ( oufqn != null ) { if ( ! oufqn . endsWith ( "/" ) ) { oufqn += "/" ; } } else { oufqn = "/" ; } m_project . setName ( oufqn + name ) ;
public class IPBondLearningDescriptor { /** * This method calculates the ionization potential of a bond . * @ param atomContainer Parameter is the IAtomContainer . * @ return The ionization potential */ @ Override public DescriptorValue calculate ( IBond bond , IAtomContainer atomContainer ) { } }
double value = 0 ; // FIXME : for now I ' ll cache a few modified atomic properties , and restore them at the end of this method String originalAtomtypeName1 = bond . getBegin ( ) . getAtomTypeName ( ) ; Integer originalNeighborCount1 = bond . getBegin ( ) . getFormalNeighbourCount ( ) ; IAtomType . Hybridization origi...
public class AFactoryAppBeans { /** * < p > Get SrvI18n in lazy mode . < / p > * @ return SrvI18n - SrvI18n * @ throws Exception - an exception */ public final SrvI18n lazyGetSrvI18n ( ) throws Exception { } }
String beanName = getSrvI18nName ( ) ; SrvI18n srvI18n = ( SrvI18n ) this . beansMap . get ( beanName ) ; if ( srvI18n == null ) { srvI18n = new SrvI18n ( ) ; srvI18n . setLogger ( lazyGetLogger ( ) ) ; srvI18n . initDefault ( ) ; this . beansMap . put ( beanName , srvI18n ) ; lazyGetLogger ( ) . info ( null , AFactory...
public class LinuxTaskController { /** * Enables the task for cleanup by changing permissions of the specified path * in the local filesystem */ @ Override void enableTaskForCleanup ( PathDeletionContext context ) throws IOException { } }
if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( "Going to do " + TaskCommands . ENABLE_TASK_FOR_CLEANUP . toString ( ) + " for " + context . fullPath ) ; } if ( context instanceof TaskControllerPathDeletionContext ) { TaskControllerPathDeletionContext tContext = ( TaskControllerPathDeletionContext ) context ; if ( tCon...
public class Tree { /** * Sets the image name for a spacer image used to align the other images inside the tree . ( Defaults to " spacer . gif " ) . * @ param spacerImage the image name ( including extension ) * @ jsptagref . attributedescription Sets the image name for a spacer image used to align the other images...
String val = setNonEmptyValueAttribute ( spacerImage ) ; if ( val != null ) _iState . setImageSpacer ( setNonEmptyValueAttribute ( val ) ) ;
public class VBSFaxClientSpi { /** * This function formats the provided object to enable embedding * in VBS code . * @ param object * The object to format * @ return The formatted object */ protected Object formatObject ( Object object ) { } }
Object formattedObject = object ; if ( object == null ) { formattedObject = "" ; } else if ( object instanceof String ) { // get string String string = ( String ) object ; // remove characters string = string . replaceAll ( "\n" , "" ) ; string = string . replaceAll ( "\r" , "" ) ; string = string . replaceAll ( "\t" ,...
public class ZonalQuery { /** * ~ Methoden - - - - - */ @ Override public V apply ( Moment context ) { } }
ZonalOffset shift = ( ( this . offset == null ) ? this . tz . getOffset ( context ) : this . offset ) ; if ( ( this . element == PlainTime . SECOND_OF_MINUTE ) && context . isLeapSecond ( ) && ( shift . getFractionalAmount ( ) == 0 ) && ( ( shift . getAbsoluteSeconds ( ) % 60 ) == 0 ) ) { return this . element . getTyp...
public class Descriptor { /** * Look out for a typical error a plugin developer makes . * See http : / / hudson . 361315 . n4 . nabble . com / Help - Hint - needed - Post - build - action - doesn - t - stay - activated - td2308833 . html */ private T verifyNewInstance ( T t ) { } }
if ( t != null && t . getDescriptor ( ) != this ) { // TODO : should this be a fatal error ? LOGGER . warning ( "Father of " + t + " and its getDescriptor() points to two different instances. Probably malplaced @Extension. See http://hudson.361315.n4.nabble.com/Help-Hint-needed-Post-build-action-doesn-t-stay-activated-...
public class LoginProcessor { /** * Checks if the request URL matches the { @ code loginUrl } and the HTTP method matches the { @ code loginMethod } . If * it does , it proceeds to login the user using the username / password specified in the parameters . * @ param context the context which holds the current reques...
HttpServletRequest request = context . getRequest ( ) ; if ( isLoginRequest ( request ) ) { logger . debug ( "Processing login request" ) ; String [ ] tenants = tenantsResolver . getTenants ( ) ; if ( ArrayUtils . isEmpty ( tenants ) ) { throw new IllegalArgumentException ( "No tenants resolved for authentication" ) ; ...
public class AtsdMeta { /** * Prepare URL to retrieve metrics * @ param metricMasks filter specified in ` tables ` connection string parameter * @ param tableFilter filter specified in method parameter * @ param underscoreAsLiteral treat underscore as not a metacharacter * @ return MetricLocation */ @ Nonnull s...
if ( WildcardsUtil . isRetrieveAllPattern ( tableFilter ) || tableFilter . isEmpty ( ) ) { if ( metricMasks . isEmpty ( ) ) { return Collections . emptyList ( ) ; } else { return buildPatternDisjunction ( metricMasks , underscoreAsLiteral ) ; } } else { return Collections . singletonList ( buildAtsdPatternUrl ( tableFi...
public class ByteBuffersIO { /** * Merge the byte arrays of this class into a single one and return it . */ public byte [ ] createSingleByteArray ( ) { } }
byte [ ] buf = new byte [ totalSize ] ; int pos = 0 ; for ( Triple < byte [ ] , Integer , Integer > t : buffers ) { System . arraycopy ( t . getValue1 ( ) , t . getValue2 ( ) . intValue ( ) , buf , pos , t . getValue3 ( ) . intValue ( ) ) ; pos += t . getValue3 ( ) . intValue ( ) ; } return buf ;
public class AnnotatedValueResolver { /** * Returns an array of arguments which are resolved by each { @ link AnnotatedValueResolver } of the * specified { @ code resolvers } . */ static Object [ ] toArguments ( List < AnnotatedValueResolver > resolvers , ResolverContext resolverContext ) { } }
requireNonNull ( resolvers , "resolvers" ) ; requireNonNull ( resolverContext , "resolverContext" ) ; if ( resolvers . isEmpty ( ) ) { return emptyArguments ; } return resolvers . stream ( ) . map ( resolver -> resolver . resolve ( resolverContext ) ) . toArray ( ) ;
public class CXFEndpointProvider { /** * Extracts the bindingId from a Server . * @ param server * @ return */ private static String getBindingId ( Server server ) { } }
Endpoint ep = server . getEndpoint ( ) ; BindingInfo bi = ep . getBinding ( ) . getBindingInfo ( ) ; return bi . getBindingId ( ) ;
public class ApiOvhTelephony { /** * Delete the given scheduler event * REST : DELETE / telephony / { billingAccount } / scheduler / { serviceName } / events / { uid } * @ param billingAccount [ required ] The name of your billingAccount * @ param serviceName [ required ] * @ param uid [ required ] The unique I...
String qPath = "/telephony/{billingAccount}/scheduler/{serviceName}/events/{uid}" ; StringBuilder sb = path ( qPath , billingAccount , serviceName , uid ) ; exec ( qPath , "DELETE" , sb . toString ( ) , null ) ;
public class JPATxEmInvocation { /** * ( non - Javadoc ) * @ see javax . persistence . EntityManager # createNamedQuery ( java . lang . String ) */ @ Override public Query createNamedQuery ( String name ) { } }
try { return ivEm . createNamedQuery ( name ) ; } finally { if ( ! inJTATransaction ( ) ) { ivEm . clear ( ) ; } }
public class DBInstance { /** * Provides List of DB security group elements containing only < code > DBSecurityGroup . Name < / code > and * < code > DBSecurityGroup . Status < / code > subelements . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setDBSecu...
if ( this . dBSecurityGroups == null ) { setDBSecurityGroups ( new com . amazonaws . internal . SdkInternalList < DBSecurityGroupMembership > ( dBSecurityGroups . length ) ) ; } for ( DBSecurityGroupMembership ele : dBSecurityGroups ) { this . dBSecurityGroups . add ( ele ) ; } return this ;
public class TherianContext { /** * Convenience method to perform an operation , discarding its result , and report whether it succeeded . * @ param operation * @ param hints * @ return whether { @ code operation } was supported and successful * @ throws NullPointerException on { @ code null } input * @ throw...
final boolean dummyRoot = stack . isEmpty ( ) ; if ( dummyRoot ) { // add a root frame to preserve our cache " around " the supports / eval lifecycle , bypassing # push ( ) : stack . push ( Frame . ROOT ) ; } try { if ( supports ( operation , hints ) ) { eval ( operation , hints ) ; return operation . isSuccessful ( ) ...
public class RythmEngine { /** * Evaluate a script and return executing result . Note the API is not mature yet * don ' t use it in your application * @ param script * @ return the result */ public Object eval ( String script ) { } }
// / / use Java ' s ScriptEngine at the moment // ScriptEngineManager manager = new ScriptEngineManager ( ) ; // ScriptEngine jsEngine = manager . getEngineByName ( " JavaScript " ) ; // try { // return jsEngine . eval ( script ) ; // } catch ( ScriptException e ) { // throw new RuntimeException ( e ) ; return eval ( s...
public class Vector4d { /** * Set this { @ link Vector4d } to the values of the given < code > v < / code > . * @ param v * the vector whose values will be copied into this * @ return this */ public Vector4d set ( Vector4ic v ) { } }
return set ( v . x ( ) , v . y ( ) , v . z ( ) , v . w ( ) ) ;
public class TreeModelUtils { /** * Debug method to print tree node structure * @ param rootNode * @ param tab */ public static void printNodeData ( Node rootNode , String tab ) { } }
tab = tab == null ? "" : tab + " " ; for ( Node n : rootNode . getChilds ( ) ) { printNodeData ( n , tab ) ; }
public class LambdaDslObject { /** * Attribute that is an array of values with a minimum and maximum size that are not objects where each item must * match the following example * @ param name field name * @ param minSize minimum size of the array * @ param maxSize maximum size of the array * @ param value Va...
object . minMaxArrayLike ( name , minSize , maxSize , value , numberExamples ) ; return this ;
public class StringUtils { /** * < p > Checks if any of the CharSequences are empty ( " " ) or null . < / p > * < pre > * StringUtils . isAnyEmpty ( null ) = true * StringUtils . isAnyEmpty ( null , " foo " ) = true * StringUtils . isAnyEmpty ( " " , " bar " ) = true * StringUtils . isAnyEmpty ( " bob " , " "...
if ( ArrayUtils . isEmpty ( css ) ) { return false ; } for ( final CharSequence cs : css ) { if ( isEmpty ( cs ) ) { return true ; } } return false ;
public class DistCp { /** * < p > It contains two steps : < p > * < p > step 1 . change the src file list into the src chunk file list * src file list is a list of ( LongWritable , FilePair ) . LongWritable is * the length of the file while FilePair contains info of src and dst . * In order to copy file by chun...
boolean preserve_status = job . getBoolean ( Options . PRESERVE_STATUS . propertyname , false ) ; EnumSet < FileAttribute > preserved = null ; boolean preserve_block_size = false ; if ( preserve_status ) { preserved = FileAttribute . parse ( job . get ( PRESERVE_STATUS_LABEL ) ) ; if ( preserved . contains ( FileAttrib...
public class CalendarDay { /** * Get a new instance set to the specified day * @ param year new instance ' s year * @ param month new instance ' s month as defined by { @ linkplain java . util . Calendar } * @ param day new instance ' s day of month * @ return CalendarDay set to the specified date */ @ NonNull ...
return new CalendarDay ( year , month , day ) ;
public class SLF4JBridgeHandler { /** * Returns true if SLF4JBridgeHandler has been previously installed , returns false otherwise . * @ return true if SLF4JBridgeHandler is already installed , false other wise * @ throws SecurityException */ public static boolean isInstalled ( ) throws SecurityException { } }
java . util . logging . Logger rootLogger = getRootLogger ( ) ; Handler [ ] handlers = rootLogger . getHandlers ( ) ; for ( int i = 0 ; i < handlers . length ; i ++ ) { if ( handlers [ i ] instanceof SLF4JBridgeHandler ) { return true ; } } return false ;
public class CacheEntry { /** * Compare for FIFO * @ param other the other entry * @ return results */ private int compareToFIFO ( CacheEntry other ) { } }
int cmp = compareOrder ( other ) ; if ( cmp != 0 ) { return cmp ; } cmp = compareTime ( other ) ; if ( cmp != 0 ) { return cmp ; } return cmp = compareReadCount ( other ) ;
public class ComputationGraph { /** * Generate the output for all examples / batches in the input iterator , and concatenate them into a single array * per network output * @ param iterator Data to pass through the network * @ return output for all examples in the iterator */ public INDArray [ ] output ( MultiDat...
List < INDArray [ ] > outputs = new ArrayList < > ( ) ; while ( iterator . hasNext ( ) ) { MultiDataSet next = iterator . next ( ) ; INDArray [ ] out = output ( false , next . getFeatures ( ) , next . getFeaturesMaskArrays ( ) , next . getLabelsMaskArrays ( ) ) ; outputs . add ( out ) ; } INDArray [ ] [ ] arr = outputs...
public class RunInstancesAction { /** * Launches the specified number of instances using an AMI ( Amazon Image ) for which you have permissions . * Notes : When you launch an instance , it enters the pending state . After the instance is ready for you , it enters * the running state . To check the state of your ins...
@ Output ( RETURN_CODE ) , @ Output ( RETURN_RESULT ) , @ Output ( INSTANCE_ID_RESULT ) , @ Output ( EXCEPTION ) } , responses = { @ Response ( text = SUCCESS , field = RETURN_CODE , value = ReturnCodes . SUCCESS , matchType = MatchType . COMPARE_EQUAL , responseType = ResponseType . RESOLVED ) , @ Response ( text = FA...
public class SubClass { /** * Returns the constant map index to class * If entry doesn ' t exist it is created . * @ param type * @ return */ public final int resolveClassIndex ( TypeElement type ) { } }
int size = 0 ; int index = 0 ; constantReadLock . lock ( ) ; try { size = getConstantPoolSize ( ) ; index = getClassIndex ( type ) ; } finally { constantReadLock . unlock ( ) ; } if ( index == - 1 ) { String name = El . getInternalForm ( type ) ; int nameIndex = resolveNameIndex ( name ) ; index = addConstantInfo ( new...
public class JdbcWriter { /** * Saves data . * @ param row Data structure representing a row as a Map of column _ name : column _ value * @ throws SQLException */ public void save ( Map < String , Object > row ) throws Exception { } }
Tuple2 < List < String > , String > data = sqlFromRow ( row ) ; PreparedStatement statement = conn . prepareStatement ( data . _2 ( ) ) ; int i = 1 ; for ( String columnName : data . _1 ( ) ) { statement . setObject ( i , row . get ( columnName ) ) ; i ++ ; } statement . executeUpdate ( ) ;
public class ClassLoaderUtil { /** * 加载外部类 * @ param jarOrDir jar文件或者包含jar和class文件的目录 * @ param name 类名 * @ return 类 * @ since 4.4.2 */ public static Class < ? > loadClass ( File jarOrDir , String name ) { } }
try { return getJarClassLoader ( jarOrDir ) . loadClass ( name ) ; } catch ( ClassNotFoundException e ) { throw new UtilException ( e ) ; }
public class EventDefinition { /** * Method to execute the esjp . * @ param _ parameter Parameter * @ return Return * @ throws EFapsException on error */ @ Override public Return execute ( final Parameter _parameter ) throws EFapsException { } }
Return ret = null ; _parameter . put ( ParameterValues . PROPERTIES , new HashMap < > ( super . evalProperties ( ) ) ) ; try { EventDefinition . LOG . debug ( "Invoking method '{}' for Resource '{}'" , this . methodName , this . resourceName ) ; final Class < ? > cls = Class . forName ( this . resourceName , true , EFa...
public class Kute { /** * Finds the first resource in stream that matches given path . * @ param stream A stream of resources . * @ param path The path to search for . * @ param < R > The resource implementation . * @ return A matching resource , if found . */ public static < R extends Resource > Optional < R >...
return findFirstResource ( stream . filter ( r -> r . getPath ( ) . equals ( path ) ) ) ;
public class Result { /** * Create a Status from a previous status ' result / details * @ param value * @ param status * @ param details * @ return */ public static < R > Result < R > create ( R value , Result < ? > result ) { } }
return new Result < R > ( value , result . status , result . details , result . variables ) ;
public class JDBCCallableStatement { /** * # ifdef JAVA6 */ public synchronized void setNClob ( String parameterName , Reader reader ) throws SQLException { } }
super . setNClob ( findParameterIndex ( parameterName ) , reader ) ;
public class SchedulingHelper { /** * ( non - Javadoc ) * @ see java . util . concurrent . Future # get ( ) */ @ Override public V get ( ) throws InterruptedException , ExecutionException { } }
this . m_coordinationLatch . await ( ) ; if ( m_pendingException != null ) { throw m_pendingException ; } return m_defaultFuture . get ( ) ;
public class SpringPhysicalNamingStrategy { /** * Get an identifier for the specified details . By default this method will return an * identifier with the name adapted based on the result of * { @ link # isCaseInsensitive ( JdbcEnvironment ) } * @ param name the name of the identifier * @ param quoted if the i...
if ( isCaseInsensitive ( jdbcEnvironment ) ) { name = name . toLowerCase ( Locale . ROOT ) ; } return new Identifier ( name , quoted ) ;
public class TrifocalAlgebraicPoint7 { /** * Minimize the algebraic error using LM . The two epipoles are the parameters being optimized . */ private void minimizeWithGeometricConstraints ( ) { } }
extractEpipoles . setTensor ( solutionN ) ; extractEpipoles . extractEpipoles ( e2 , e3 ) ; // encode the parameters being optimized param [ 0 ] = e2 . x ; param [ 1 ] = e2 . y ; param [ 2 ] = e2 . z ; param [ 3 ] = e3 . x ; param [ 4 ] = e3 . y ; param [ 5 ] = e3 . z ; // adjust the error function for the current inpu...
public class OutbindRequestReceiver { /** * Notify that the outbind was accepted . * @ param outbind is the { @ link Outbind } command . * @ throws IllegalStateException if this method already called before . */ void notifyAcceptOutbind ( Outbind outbind ) throws IllegalStateException { } }
this . lock . lock ( ) ; try { if ( this . request == null ) { this . request = new OutbindRequest ( outbind ) ; this . requestCondition . signal ( ) ; } else { throw new IllegalStateException ( "Already waiting for acceptance outbind" ) ; } } finally { this . lock . unlock ( ) ; }
public class JLocaleChooser { /** * The ItemListener for the locales . */ public void itemStateChanged ( ItemEvent iEvt ) { } }
String item = ( String ) iEvt . getItem ( ) ; int i ; for ( i = 0 ; i < localeCount ; i ++ ) { if ( locales [ i ] . getDisplayName ( ) . equals ( item ) ) break ; } setLocale ( locales [ i ] , false ) ;