signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class FileUtil { /** * Adds folder to the archive . * @ param path path to the folder * @ param srcFolder folder name * @ param zip zip archive * @ throws IOException */ public static void addFolderToZip ( String path , String srcFolder , ZipOutputStream zip ) throws IOException { } }
File folder = new File ( srcFolder ) ; if ( folder . list ( ) . length == 0 ) { addFileToZip ( path , srcFolder , zip , true ) ; } else { for ( String fileName : folder . list ( ) ) { if ( path . equals ( "" ) ) { addFileToZip ( folder . getName ( ) , srcFolder + "/" + fileName , zip , false ) ; } else { addFileToZip (...
public class ObjectMapperFactory { /** * Builds the core Jackson { @ link ObjectMapper } from the optional configuration and { @ link JsonFactory } . * @ param jacksonConfiguration The configuration * @ param jsonFactory The JSON factory * @ return The { @ link ObjectMapper } */ @ Singleton @ Primary @ BootstrapC...
ObjectMapper objectMapper = jsonFactory != null ? new ObjectMapper ( jsonFactory ) : new ObjectMapper ( ) ; final boolean hasConfiguration = jacksonConfiguration != null ; if ( ! hasConfiguration || jacksonConfiguration . isModuleScan ( ) ) { objectMapper . findAndRegisterModules ( ) ; } objectMapper . registerModules ...
public class InternalChannelz { /** * Adds a server socket . */ public void addServerSocket ( InternalInstrumented < ServerStats > server , InternalInstrumented < SocketStats > socket ) { } }
ServerSocketMap serverSockets = perServerSockets . get ( id ( server ) ) ; assert serverSockets != null ; add ( serverSockets , socket ) ;
public class Context { /** * Set the current template . * @ param template - current template */ public Context setTemplate ( Template template ) { } }
checkThread ( ) ; if ( template != null ) { setEngine ( template . getEngine ( ) ) ; } this . template = template ; return this ;
public class HikariPool { /** * { @ inheritDoc } */ @ Override public synchronized void suspendPool ( ) { } }
if ( suspendResumeLock == SuspendResumeLock . FAUX_LOCK ) { throw new IllegalStateException ( poolName + " - is not suspendable" ) ; } else if ( poolState != POOL_SUSPENDED ) { suspendResumeLock . suspend ( ) ; poolState = POOL_SUSPENDED ; }
public class AmazonIdentityManagementClient { /** * Lists all managed policies that are attached to the specified IAM role . * An IAM role can also have inline policies embedded with it . To list the inline policies for a role , use the * < a > ListRolePolicies < / a > API . For information about policies , see < a...
request = beforeClientExecution ( request ) ; return executeListAttachedRolePolicies ( request ) ;
public class DescribeTransitGatewayVpcAttachmentsResult { /** * Information about the VPC attachments . * @ return Information about the VPC attachments . */ public java . util . List < TransitGatewayVpcAttachment > getTransitGatewayVpcAttachments ( ) { } }
if ( transitGatewayVpcAttachments == null ) { transitGatewayVpcAttachments = new com . amazonaws . internal . SdkInternalList < TransitGatewayVpcAttachment > ( ) ; } return transitGatewayVpcAttachments ;
public class IdentityDescriptionMarshaller { /** * Marshall the given parameter object . */ public void marshall ( IdentityDescription identityDescription , ProtocolMarshaller protocolMarshaller ) { } }
if ( identityDescription == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( identityDescription . getIdentityId ( ) , IDENTITYID_BINDING ) ; protocolMarshaller . marshall ( identityDescription . getLogins ( ) , LOGINS_BINDING ) ; protocolMar...
public class Neo4JVertex { /** * Generates a Cypher MATCH statement for the vertex , example : * MATCH ( alias ) WHERE alias . id = { id } AND ( alias : Label1 OR alias : Label2) * @ param alias The node alias . * @ param idParameterName The name of the parameter that contains the vertex id . * @ return the Cyp...
Objects . requireNonNull ( alias , "alias cannot be null" ) ; Objects . requireNonNull ( idParameterName , "idParameterName cannot be null" ) ; // create statement return "MATCH " + matchPattern ( alias ) + " WHERE " + matchPredicate ( alias , idParameterName ) ;
public class Filtering { /** * Creates an iterator yielding last n elements from the source iterable . * Consuming the resulting iterator yields an IllegalArgumentException if * not enough elements can be fetched . E . g : * < code > takeLast ( 2 , [ 1 , 2 , 3 ] ) - > [ 2 , 3 ] < / code > * @ param < E > the it...
dbc . precondition ( from != null , "cannot call last with a null iterable" ) ; return takeLast ( howMany , from . iterator ( ) ) ;
public class RepositoryApi { /** * Creates a tag on a particular ref of a given project . A message and a File instance containing the * release notes are optional . This method is the same as { @ link # createTag ( Object , String , String , String , String ) } , * but instead allows the release notes to be suppli...
String releaseNotes ; if ( releaseNotesFile != null ) { try { releaseNotes = FileUtils . readFileContents ( releaseNotesFile ) ; } catch ( IOException ioe ) { throw ( new GitLabApiException ( ioe ) ) ; } } else { releaseNotes = null ; } return ( createTag ( projectIdOrPath , tagName , ref , message , releaseNotes ) ) ;
public class RollbackBean { /** * First store a list of persons then we * store the article using a failure store * method in ArticleManager . * @ ejb : interface - method */ public void rollbackOtherBeanUsing_2 ( ArticleVO article , List persons ) { } }
log . info ( "rollbackOtherBeanUsing_2 method was called" ) ; ArticleManagerPBLocal am = getArticleManager ( ) ; PersonManagerPBLocal pm = getPersonManager ( ) ; pm . storePersons ( persons ) ; am . failureStore ( article ) ;
public class DirectoryFactory { /** * < p > < em > INTERNAL API , only ot be used in class hierarchy < / em > < / p > * Creates a new { @ link DispatchKey } based on the directory - key and * relative path specified , see { @ link Directory # addWatchedDirectory ( WatchedDirectory ) } for further information . * ...
return fileKeyFactory . newKey ( pDirectoryKey , pRelativePath ) ;
public class FileIoUtil { /** * Reads a file from classpath to a list of String using default charset and log any exception . * @ param _ fileName * @ return file contents or empty list */ public static List < String > readFileFromClassPathAsList ( String _fileName ) { } }
List < String > result = readFileFromClassPathAsList ( _fileName , Charset . defaultCharset ( ) , false ) ; return result == null ? new ArrayList < String > ( ) : result ;
public class QrCode { /** * Returns true if input is in the Alphanumeric set ( see Table J . 1) */ private static boolean isAlpha ( int c ) { } }
return ( c >= '0' && c <= '9' ) || ( c >= 'A' && c <= 'Z' ) || ( c == ' ' ) || ( c == '$' ) || ( c == '%' ) || ( c == '*' ) || ( c == '+' ) || ( c == '-' ) || ( c == '.' ) || ( c == '/' ) || ( c == ':' ) ;
public class Ftp { /** * List data of a ftp connection * @ return FTPCLient * @ throws PageException * @ throws IOException */ private AFTPClient actionListDir ( ) throws PageException , IOException { } }
required ( "name" , name ) ; required ( "directory" , directory ) ; AFTPClient client = getClient ( ) ; FTPFile [ ] files = client . listFiles ( directory ) ; if ( files == null ) files = new FTPFile [ 0 ] ; pageContext . setVariable ( name , toQuery ( files , "ftp" , directory , client . getRemoteAddress ( ) . getHost...
public class SqlExecutor { /** * 批量执行非查询语句 < br > * 语句包括 插入 、 更新 、 删除 < br > * 此方法不会关闭Connection * @ param conn 数据库连接对象 * @ param sqls SQL列表 * @ return 每个SQL执行影响的行数 * @ throws SQLException SQL执行异常 * @ since 4.5.6 */ public static int [ ] executeBatch ( Connection conn , Iterable < String > sqls ) throws S...
Statement statement = null ; try { statement = conn . createStatement ( ) ; for ( String sql : sqls ) { statement . addBatch ( sql ) ; } return statement . executeBatch ( ) ; } finally { DbUtil . close ( statement ) ; }
public class Matchers { /** * Throwable matcher with only a type argument * @ param type the throwable type to match * @ param < T > type of the matched throwable * @ return the matcher */ public static < T extends Throwable > Matcher < T > isThrowable ( Class < ? > type ) { } }
return IsThrowable . isThrowable ( type ) ;
public class DateHelper { /** * Gets the UTC date and time in ' yyyy - MM - dd ' T ' HH : mm : ss . SSS ' Z ' ' format . * @ return UTC date and time . */ public static String getUTC ( long time ) { } }
SimpleDateFormat sdf = new SimpleDateFormat ( "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'" , Locale . ENGLISH ) ; sdf . setTimeZone ( TimeZone . getTimeZone ( "UTC" ) ) ; return sdf . format ( time ) ;
public class ExpressionTreeRewriter { /** * Invoke the default rewrite logic explicitly . Specifically , it skips the invocation of the expression rewriter for the provided node . */ @ SuppressWarnings ( "unchecked" ) public < T extends Expression > T defaultRewrite ( T node , C context ) { } }
return ( T ) visitor . process ( node , new Context < > ( context , true ) ) ;
public class PoolManager { /** * Reload allocations file if it hasn ' t been loaded in a while * return true if reloaded */ public boolean reloadAllocsIfNecessary ( ) { } }
if ( allocFile == null ) { // A warning has been logged when allocFile is null . // We should just return here . return false ; } long time = System . currentTimeMillis ( ) ; boolean reloaded = false ; if ( time > lastReloadAttempt + ALLOC_RELOAD_INTERVAL ) { lastReloadAttempt = time ; try { File file = new File ( allo...
public class LiveReloadServer { /** * Gracefully stop the livereload server . * @ throws IOException in case of I / O errors */ public void stop ( ) throws IOException { } }
synchronized ( this . monitor ) { if ( this . listenThread != null ) { closeAllConnections ( ) ; try { this . executor . shutdown ( ) ; this . executor . awaitTermination ( 1 , TimeUnit . MINUTES ) ; } catch ( InterruptedException ex ) { Thread . currentThread ( ) . interrupt ( ) ; } this . serverSocket . close ( ) ; t...
public class VariableAssignment { /** * getter for variableName - gets * @ generated * @ return value of the feature */ public String getVariableName ( ) { } }
if ( VariableAssignment_Type . featOkTst && ( ( VariableAssignment_Type ) jcasType ) . casFeat_variableName == null ) jcasType . jcas . throwFeatMissing ( "variableName" , "ch.epfl.bbp.uima.types.VariableAssignment" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( VariableAssignment_Type ) jcasType ) . cas...
public class CommandRegistry { /** * if { @ link # allowCommandsWithUsername } is enabled , the username of the bot is removed from * the command * @ param command Command to simplify * @ return Simplified command */ private String removeUsernameFromCommandIfNeeded ( String command ) { } }
if ( allowCommandsWithUsername ) { return command . replace ( "@" + botUsername , "" ) . trim ( ) ; } return command ;
public class OperationParkerImpl { /** * invalidated waiting ops will removed from queue eventually by notifiers . */ public void onMemberLeft ( MemberImpl leftMember ) { } }
for ( WaitSet waitSet : waitSetMap . values ( ) ) { waitSet . invalidateAll ( leftMember . getUuid ( ) ) ; }
public class JarFileResource { /** * Returns true if the respresenetd resource exists . */ public boolean exists ( ) { } }
if ( _exists ) return true ; if ( _urlString . endsWith ( "!/" ) ) { String file_url = _urlString . substring ( 4 , _urlString . length ( ) - 2 ) ; try { return newResource ( file_url ) . exists ( ) ; } catch ( Exception e ) { LogSupport . ignore ( log , e ) ; return false ; } } boolean check = checkConnection ( ) ; //...
public class DiskUtils { /** * Returns directory name to save cache data in the external storage < p > * This method always returns path of external storage even if it does not exist . < br > * As such , make sure to call isExternalStorageMounted method as state - testing method and then call this function only if ...
return Environment . getExternalStorageDirectory ( ) . getAbsolutePath ( ) + DATA_FOLDER + File . separator + context . getPackageName ( ) + CACHE_FOLDER ;
public class NodeReportsInner { /** * Retrieve the Dsc node report data by node id and report id . * @ param resourceGroupName Name of an Azure Resource group . * @ param automationAccountName The name of the automation account . * @ param nodeId The Dsc node id . * @ param reportId The report id . * @ throws...
return getWithServiceResponseAsync ( resourceGroupName , automationAccountName , nodeId , reportId ) . map ( new Func1 < ServiceResponse < DscNodeReportInner > , DscNodeReportInner > ( ) { @ Override public DscNodeReportInner call ( ServiceResponse < DscNodeReportInner > response ) { return response . body ( ) ; } } ) ...
public class KeyVaultClientBaseImpl { /** * Creates or updates a new storage account . This operation requires the storage / set permission . * @ param vaultBaseUrl The vault name , for example https : / / myvault . vault . azure . net . * @ param storageAccountName The name of the storage account . * @ param res...
return ServiceFuture . fromResponse ( setStorageAccountWithServiceResponseAsync ( vaultBaseUrl , storageAccountName , resourceId , activeKeyName , autoRegenerateKey , regenerationPeriod , storageAccountAttributes , tags ) , serviceCallback ) ;
public class FlowQueueService { /** * Returns the flows currently listed in the given { @ link Flow . Status } * @ param cluster The cluster where flows have run * @ param status The flows ' status * @ param limit Return up to this many Flow instances * @ param user Filter flows returned to only this user ( if ...
byte [ ] rowPrefix = ByteUtil . join ( Constants . SEP_BYTES , Bytes . toBytes ( cluster ) , status . code ( ) , Constants . EMPTY_BYTES ) ; if ( startRow == null ) { startRow = rowPrefix ; } Scan scan = new Scan ( startRow ) ; FilterList filters = new FilterList ( FilterList . Operator . MUST_PASS_ALL ) ; // early out...
public class UpdateUserDefinedFunctionRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( UpdateUserDefinedFunctionRequest updateUserDefinedFunctionRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( updateUserDefinedFunctionRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( updateUserDefinedFunctionRequest . getCatalogId ( ) , CATALOGID_BINDING ) ; protocolMarshaller . marshall ( updateUserDefinedFunctionRequest . getDataba...
public class Channel { /** * TODO add other methods to secure closing behavior */ @ Override public E take ( ) throws InterruptedException { } }
synchronized ( waiting ) { if ( closed ) throw new InterruptedException ( "Channel closed" ) ; waiting . add ( Thread . currentThread ( ) ) ; } E e = super . take ( ) ; synchronized ( waiting ) { waiting . remove ( Thread . currentThread ( ) ) ; } return e ;
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link ArcByBulgeType } { @ code > } * @ param value * Java instance representing xml element ' s value . * @ return * the new instance of { @ link JAXBElement } { @ code < } { @ link ArcByBulgeType } { @ code > } */ ...
return new JAXBElement < ArcByBulgeType > ( _ArcByBulge_QNAME , ArcByBulgeType . class , null , value ) ;
public class PermDAO { /** * Add a single Permission to the Role ' s Permission Collection * @ param trans * @ param roleFullName * @ param perm * @ param type * @ param action * @ return */ public Result < Void > addRole ( AuthzTrans trans , PermDAO . Data perm , String roleFullName ) { } }
// Note : Prepared Statements for Collection updates aren ' t supported // ResultSet rv = try { getSession ( trans ) . execute ( UPDATE_SP + TABLE + " SET roles = roles + {'" + roleFullName + "'} " + "WHERE " + "ns = '" + perm . ns + "' AND " + "type = '" + perm . type + "' AND " + "instance = '" + perm . instance + "'...
public class ShowCumulatedProducersAction { /** * { @ inheritDoc } */ @ Override protected String getLinkToCurrentPage ( HttpServletRequest req ) { } }
return "mskShowCumulatedProducers" + '?' + PARAM_DECORATOR + '=' + req . getParameter ( PARAM_DECORATOR ) + ( ! StringUtils . isEmpty ( req . getParameter ( PARAM_CATEGORY ) ) ? ( '&' + PARAM_CATEGORY + '=' + req . getParameter ( PARAM_CATEGORY ) ) : "" ) + ( ! StringUtils . isEmpty ( req . getParameter ( PARAM_SUBSYST...
public class UserGroup { /** * MakeScreen Method . */ public ScreenParent makeScreen ( ScreenLoc itsLocation , ComponentParent parentScreen , int iDocMode , Map < String , Object > properties ) { } }
ScreenParent screen = null ; if ( ( iDocMode & ScreenConstants . DOC_MODE_MASK ) == ScreenConstants . DETAIL_MODE ) screen = Record . makeNewScreen ( UserPermissionModel . USER_PERMISSION_GRID_SCREEN_CLASS , itsLocation , parentScreen , iDocMode | ScreenConstants . DONT_DISPLAY_FIELD_DESC , properties , this , true ) ;...
public class ToStringStyle { /** * < p > Append to the < code > toString < / code > a summary of an * < code > int < / code > array . < / p > * @ param buffer the < code > StringBuilder < / code > to populate * @ param fieldName the field name , typically not used as already appended * @ param array the array t...
appendSummarySize ( buffer , fieldName , array . length ) ;
public class LocIterator { /** * Get next window of specified size , then increment position by specified amount . * @ return Location of next window . * @ param windowSize Size of window to get . * @ param increment Amount by which to shift position . If increment is positive , the position is shifted * toward...
if ( windowSize <= 0 ) { throw new IllegalArgumentException ( "Window size must be positive." ) ; } if ( increment == 0 ) { throw new IllegalArgumentException ( "Increment must be non-zero." ) ; } Location r ; try { if ( increment > 0 ) { r = mBounds . suffix ( mPosition ) . prefix ( windowSize ) ; } else { if ( mPosit...
public class JvmTypeParameterDeclaratorImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public void eUnset ( int featureID ) { } }
switch ( featureID ) { case TypesPackage . JVM_TYPE_PARAMETER_DECLARATOR__TYPE_PARAMETERS : getTypeParameters ( ) . clear ( ) ; return ; } super . eUnset ( featureID ) ;
public class MiniSat { /** * Returns a new Glucose solver . * @ param f the formula factory * @ return the solver */ public static MiniSat glucose ( final FormulaFactory f ) { } }
return new MiniSat ( f , SolverStyle . GLUCOSE , new MiniSatConfig . Builder ( ) . build ( ) , new GlucoseConfig . Builder ( ) . build ( ) ) ;
public class DistributionPointFetcher { /** * Download CRL from given URI . */ private static X509CRL getCRL ( URIName name ) throws CertStoreException { } }
URI uri = name . getURI ( ) ; if ( debug != null ) { debug . println ( "Trying to fetch CRL from DP " + uri ) ; } CertStore ucs = null ; try { ucs = URICertStore . getInstance ( new URICertStore . URICertStoreParameters ( uri ) ) ; } catch ( InvalidAlgorithmParameterException | NoSuchAlgorithmException e ) { if ( debug...
public class DuffyModel { /** * Duffy function evaluation . * @ param input * initial condition values for every link . The structure is : * < br > * < ul > * < li > link1 initial discharge < / li > * < li > link2 initial discharge < / li > * < li > link3 initial discharge < / li > * < li > . . . < / li...
// the input ' s length is twice the number of links . . . the first half // corresponds to links // discharge and the second to hillslopes storage // System . out . println ( input . length ) ; // define the month long currentTimeInMillis = ( long ) ( currentTimeInMinutes * 60.0 * 1000.0 ) ; int linksNum = orderedHill...
public class RequestHttp1 { /** * Fills an ArrayList with the header values matching the key . * @ param values ArrayList which will contain the maching values . * @ param key the header key to select . */ @ Override public void getHeaderBuffers ( String key , ArrayList < CharSegment > values ) { } }
int i = - 1 ; while ( ( i = matchNextHeader ( i + 1 , key ) ) >= 0 ) { values . add ( _headerValues [ i ] ) ; }
public class MavenArtifactProvisionOption { /** * { @ inheritDoc } */ public MavenArtifactProvisionOption groupId ( final String groupId ) { } }
m_artifact . groupId ( groupId ) ; m_updateUsed = false ; return itself ( ) ;
public class ComponentType { /** * { @ inheritDoc } Get the type of a particular ( named ) property */ public Type getPropertyType ( String propertyName ) { } }
Type type = ( Type ) propertyTypes . get ( propertyName ) ; if ( null == type ) { Class < ? > propertyType = PropertyUtils . getPropertyType ( componentClass , propertyName ) ; if ( null != propertyType ) { return new IdentifierType ( propertyType ) ; } } return type ;
public class AbstractIntSet { /** * { @ inheritDoc } */ @ Override public void fill ( int from , int to ) { } }
if ( from > to ) throw new IndexOutOfBoundsException ( "from: " + from + " > to: " + to ) ; for ( int e = from ; e <= to ; e ++ ) add ( e ) ;
public class RDFDatabaseReader { /** * Iterates through the list of Seqs read in adding the parent node and * then adding children which belong to it . * @ param db The database to add nodes to . * @ param descriptionMap The list of RDF : Description nodes . * @ param seqMap The list of RDF : Seq nodes , which ...
// List of ID ' s used to avoid recursion ArrayList < String > parentIdStack = new ArrayList < String > ( ) ; // Verify the root node exists if ( ! seqMap . containsKey ( Account . ROOT_ACCOUNT_URI ) ) throw new Exception ( "File does not contain the root account, '" + Account . ROOT_ACCOUNT_URI + "'" ) ; parentIdStack...
public class ItemReferenceLink { /** * / * ( non - Javadoc ) * @ see com . ibm . ws . sib . msgstore . cache . xalist . Task # postAbort ( com . ibm . ws . sib . msgstore . Transaction ) */ public final void abortAdd ( final PersistentTransaction transaction ) throws SevereMessageStoreException { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "abortAdd" , transaction ) ; long _referredID = getTuple ( ) . getReferredID ( ) ; super . abortAdd ( transaction ) ; if ( AbstractItem . NO_ID != _referredID ) { MessageStoreImpl msi = getMessageStoreImpl ( ) ; ItemL...
public class SynchroLogger { /** * Log a byte array as a hex dump . * @ param data byte array */ public static void log ( byte [ ] data ) { } }
if ( LOG != null ) { LOG . println ( ByteArrayHelper . hexdump ( data , true , 16 , "" ) ) ; LOG . flush ( ) ; }
public class PageFlowController { /** * Store this object in the user session , in the appropriate place . Used by the framework ; normally should not be * called directly . */ public void persistInSession ( HttpServletRequest request , HttpServletResponse response ) { } }
PageFlowController currentPageFlow = PageFlowUtils . getCurrentPageFlow ( request , getServletContext ( ) ) ; // This code implicitly destroys the current page flow . In order to prevent multiple threads // from executing inside the JPF at once , synchronize on it in order to complete the " destroy " // atomically . if...
public class AutoJsonRpcClientProxyCreator { /** * Appends the base path to the path found in the interface . */ private String appendBasePath ( String path ) { } }
try { return new URL ( baseUrl , path ) . toString ( ) ; } catch ( MalformedURLException e ) { throw new IllegalArgumentException ( format ( "Cannot combine URLs '%s' and '%s' to valid URL." , baseUrl , path ) , e ) ; }
public class RestTemplate { /** * DELETE */ public void delete ( String url , Object ... urlVariables ) throws RestClientException { } }
execute ( url , HttpMethod . DELETE , null , null , urlVariables ) ;
public class Section508Compliance { /** * implements the visitor to reset the stack * @ param obj * the context object for the currently visited code block */ @ Override public void visitCode ( Code obj ) { } }
stack . resetForMethodEntry ( this ) ; localLabels . clear ( ) ; super . visitCode ( obj ) ; for ( SourceLineAnnotation sla : localLabels . values ( ) ) { BugInstance bug = new BugInstance ( this , BugType . S508C_NO_SETLABELFOR . name ( ) , NORMAL_PRIORITY ) . addClass ( this ) . addMethod ( this ) ; if ( sla != null ...
public class DTDEntityAttr { /** * Method called by the validator object * to ask attribute to verify that the default it has ( if any ) is * valid for such type . */ @ Override public void validateDefault ( InputProblemReporter rep , boolean normalize ) throws XMLStreamException { } }
String normStr = validateDefaultName ( rep , normalize ) ; if ( normalize ) { mDefValue . setValue ( normStr ) ; } // Ok , but was it declared ? /* 03 - Dec - 2004 , TSa : This is rather ugly - - need to know we * actually really get a DTD reader , and DTD reader needs * to expose a special method . . . but it gets...
public class NavMesh { /** * / it does not validate the reference . */ Tupple2 < MeshTile , Poly > getTileAndPolyByRefUnsafe ( long ref ) { } }
int [ ] saltitip = decodePolyId ( ref ) ; int it = saltitip [ 1 ] ; int ip = saltitip [ 2 ] ; return new Tupple2 < > ( m_tiles [ it ] , m_tiles [ it ] . data . polys [ ip ] ) ;
public class PreDestroyMonitor { /** * allows late - binding of scopes to PreDestroyMonitor , useful if more than one * Injector contributes scope bindings * @ param bindings additional annotation - to - scope bindings to add */ public void addScopeBindings ( Map < Class < ? extends Annotation > , Scope > bindings ...
if ( scopeCleaner . isRunning ( ) ) { scopeBindings . putAll ( bindings ) ; }
public class MultiMap { /** * Stores a { @ code key } - { @ code value } pair . */ public void put ( K key , V value ) { } }
Set < V > set = storage . get ( key ) ; if ( set == null ) { set = new HashSet < > ( ) ; storage . put ( key , set ) ; } set . add ( value ) ;
public class MpScheduler { /** * Just using " put " on the dup counter map is unsafe . * It won ' t detect the case where keys collide from two different transactions . */ void safeAddToDuplicateCounterMap ( long dpKey , DuplicateCounter counter ) { } }
DuplicateCounter existingDC = m_duplicateCounters . get ( dpKey ) ; if ( existingDC != null ) { // this is a collision and is bad existingDC . logWithCollidingDuplicateCounters ( counter ) ; VoltDB . crashGlobalVoltDB ( "DUPLICATE COUNTER MISMATCH: two duplicate counter keys collided." , true , null ) ; } else { m_dupl...
public class UserResource { /** * User confirm changing email . * The token is verified and the temporary stored email will not be permanently saved as the users email . * @ param userId unique email * @ return 204 if success */ @ POST @ Path ( "{id}/email/confirm" ) @ PermitAll public Response confirmChangeEmail...
checkNotNull ( userId ) ; checkNotNull ( request . getToken ( ) ) ; boolean isSuccess = userService . confirmEmailAddressChangeUsingToken ( userId , request . getToken ( ) ) ; return isSuccess ? Response . noContent ( ) . build ( ) : Response . status ( Response . Status . BAD_REQUEST ) . build ( ) ;
public class BoxFile { /** * Used to retrieve all collaborations associated with the item . * @ param fields the optional fields to retrieve . * @ return An iterable of metadata instances associated with the item . */ public BoxResourceIterable < BoxCollaboration . Info > getAllFileCollaborations ( String ... field...
return BoxCollaboration . getAllFileCollaborations ( this . getAPI ( ) , this . getID ( ) , GET_COLLABORATORS_PAGE_SIZE , fields ) ;
public class CmsDriverManager { /** * Returns the project driver for a given DB context . < p > * @ param dbc the database context * @ return the project driver for the database context */ public I_CmsProjectDriver getProjectDriver ( CmsDbContext dbc ) { } }
if ( ( dbc == null ) || ( dbc . getProjectId ( ) == null ) || dbc . getProjectId ( ) . isNullUUID ( ) ) { return m_projectDriver ; } I_CmsProjectDriver driver = dbc . getProjectDriver ( dbc . getProjectId ( ) ) ; return driver != null ? driver : m_projectDriver ;
public class FnFunc { /** * Builds a function that will execute the specified function < tt > thenFunction < / tt > * only if the result of executing < tt > condition < / tt > on the target object is true , * and will execute the specified function < tt > elseFunction < / tt > otherwise . * The built function can...
return new IfThenElse < T , R > ( true , targetType , condition , thenFunction , elseFunction ) ;
public class UrlStringBuilder { /** * Sets a URL parameter , replacing any existing parameter with the same name . * @ param name Parameter name , can not be null * @ param values Values for the parameter , null is valid * @ return this */ public UrlStringBuilder setParameter ( String name , String ... values ) {...
this . setParameter ( name , values != null ? Arrays . asList ( values ) : null ) ; return this ;
public class RebindConfiguration { /** * Return a { @ link MapperInstance } instantiating the deserializer for the given type * @ param type a { @ link com . google . gwt . core . ext . typeinfo . JType } object . * @ return a { @ link com . google . gwt . thirdparty . guava . common . base . Optional } object . */...
return Optional . fromNullable ( deserializers . get ( type . getQualifiedSourceName ( ) ) ) ;
public class FluentValidator { /** * 在某个数组对象上通过 { @ link com . baidu . unbiz . fluentvalidator . annotation . FluentValidate } 注解方式的验证 , * 需要保证 { @ link # configure ( Registry ) } 已经先执行配置完毕 < code > Registry < / code > * 注 : 当数组为空时 , 则会跳过 * @ param t 待验证对象 * @ return FluentValidator */ public < T > FluentValida...
if ( ArrayUtil . isEmpty ( t ) ) { lastAddCount = 0 ; return this ; } return onEach ( Arrays . asList ( t ) ) ;
public class CommitsApi { /** * Get a list of repository commits in a project . * < pre > < code > GitLab Endpoint : GET / projects / : id / repository / commits < / code > < / pre > * @ param projectIdOrPath the project in the form of an Integer ( ID ) , String ( path ) , or Project instance * @ param ref the na...
return ( getCommits ( projectIdOrPath , ref , since , until , path , getDefaultPerPage ( ) ) . all ( ) ) ;
public class ZProxy { /** * Sends a command message to the proxy actor . * Can be useful for programmatic interfaces . * Does not works with commands { @ link Command # CONFIG CONFIG } and { @ link Command # RESTART RESTART } . * @ param command the command to execute . * @ param sync true to read the status in...
return State . valueOf ( command ( command . name ( ) , sync ) ) ;
public class MessageFieldDesc { /** * Move the correct fields from this record to the map . * If this method is used , is must be overidden to move the correct fields . */ public int getRawRecordData ( Rec record ) { } }
Field fieldInfo = record . getField ( this . getKey ( ) ) ; if ( fieldInfo != null ) return this . getRawFieldData ( fieldInfo ) ; else return Constant . NORMAL_RETURN ;
public class CacheProviderWrapper { /** * Returns the value to which this map maps the specified cache id . Returns * < tt > null < / tt > if the map contains no mapping for this key . * @ param id cache id whose associated value is to be returned . * @ param template template name associated with cache id ( No e...
final String methodName = "getValue()" ; Object value = null ; com . ibm . websphere . cache . CacheEntry ce = this . coreCache . get ( id ) ; if ( ce != null ) { value = ce . getValue ( ) ; } if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , methodName + " cacheName=" + cacheName + " id=" + id + " value=" + value ) ;...
public class URLUtil { /** * 获得URL , 常用于使用绝对路径时的情况 * @ param file URL对应的文件对象 * @ return URL * @ exception UtilException MalformedURLException */ public static URL getURL ( File file ) { } }
Assert . notNull ( file , "File is null !" ) ; try { return file . toURI ( ) . toURL ( ) ; } catch ( MalformedURLException e ) { throw new UtilException ( e , "Error occured when get URL!" ) ; }
public class OptionsMethodProcessor { /** * < p > getSupportProduceMediaType . < / p > * @ param containerRequestContext a { @ link javax . ws . rs . container . ContainerRequestContext } object . * @ return a { @ link javax . ws . rs . core . MediaType } object . */ protected static MediaType getSupportProduceMedi...
for ( MediaType mediaType : containerRequestContext . getAcceptableMediaTypes ( ) ) { if ( mediaType . isCompatible ( TEXT_PLAIN_TYPE ) || ( mediaType . getType ( ) . equalsIgnoreCase ( "application" ) && ! mediaType . getSubtype ( ) . toLowerCase ( ) . contains ( "html" ) ) || mediaType . getSubtype ( ) . equalsIgnore...
public class MiscUtils { /** * Uses androids android . util . Patterns . WEB _ URL to check if an url is valid . * @ param url Address to check * @ return true if the < code > url < / code > is a valid web address . */ public final static boolean isValidURL ( String url ) { } }
if ( url == null ) { return false ; } else { return Patterns . WEB_URL . matcher ( url ) . matches ( ) ; }
public class KunderaCriteriaBuilder { /** * ( non - Javadoc ) * @ see * javax . persistence . criteria . CriteriaBuilder # avg ( javax . persistence . criteria * . Expression ) */ @ Override public < N extends Number > Expression < Double > avg ( Expression < N > arg0 ) { } }
// TODO Auto - generated method stub return null ;
public class DateTimeField { /** * Set to the min or max value . * @ param iAreaDesc END _ SELECT _ KEY means set to largest value , others mean smallest . */ public void setToLimit ( int iAreaDesc ) // Set this field to the largest or smallest value { } }
// By default compare as ASCII strings m_calendar . set ( DBConstants . FIRST_YEAR , Calendar . JANUARY , 1 , 0 , 0 , 0 ) ; if ( iAreaDesc == DBConstants . END_SELECT_KEY ) m_calendar . set ( DBConstants . LAST_YEAR , Calendar . DECEMBER , 31 , 23 , 59 , 59 ) ; // Highest value java . util . Date time = m_calendar . ge...
public class HtmlTool { /** * Finds a set of elements through a CSS selector and wraps them with the * received wrapper element . * @ param root * root element for the selection * @ param selector * CSS selector for the elements to wrap * @ param wrapper * HTML to use for wrapping the selected elements */...
final Iterable < Element > elements ; // Selected elements checkNotNull ( root , "Received a null pointer as root element" ) ; checkNotNull ( selector , "Received a null pointer as selector" ) ; checkNotNull ( wrapper , "Received a null pointer as HTML wrap" ) ; // Selects and iterates over the elements elements = root...
public class VdmDropAdapterAssistent { /** * Opens an error dialog if necessary . Takes care of complex rules necessary * for making the error dialog look nice . */ private void openError ( IStatus status ) { } }
if ( status == null ) { return ; } String genericTitle = WorkbenchNavigatorMessages . DropAdapter_title ; int codes = IStatus . ERROR | IStatus . WARNING ; // simple case : one error , not a multistatus if ( ! status . isMultiStatus ( ) ) { ErrorDialog . openError ( getShell ( ) , genericTitle , null , status , codes )...
public class Jsoup { /** * Parse a fragment of HTML , with the assumption that it forms the { @ code body } of the HTML . * @ param bodyHtml body HTML fragment * @ param baseUri URL to resolve relative URLs against . * @ return sane HTML document * @ see Document # body ( ) */ public static Document parseBodyFr...
return Parser . parseBodyFragment ( bodyHtml , baseUri ) ;
public class MicroMetaDao { /** * 锟斤拷荼锟斤拷锟斤拷询 */ public List < Map < String , Object > > queryObjByCondition ( String tableName , String condition , String cols , String orders , Object [ ] paramArray , int [ ] typeArray ) { } }
// String tableName = changeTableNameCase ( otableName ) ; /* JdbcTemplate jdbcTemplate = ( JdbcTemplate ) MicroDbHolder . getDbSource ( dbName ) ; */ JdbcTemplate jdbcTemplate = getMicroJdbcTemplate ( ) ; String sql = "select " + cols + " from " + tableName + " where " + condition + " order by " + orders ; logger . ...
public class FontDescriptorSpecificationImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public void eSet ( int featureID , Object newValue ) { } }
switch ( featureID ) { case AfplibPackage . FONT_DESCRIPTOR_SPECIFICATION__FT_WT_CLASS : setFtWtClass ( ( Integer ) newValue ) ; return ; case AfplibPackage . FONT_DESCRIPTOR_SPECIFICATION__FT_WD_CLASS : setFtWdClass ( ( Integer ) newValue ) ; return ; case AfplibPackage . FONT_DESCRIPTOR_SPECIFICATION__FT_HEIGHT : set...
public class ChangesHolder { /** * Returns the store parameter extracted from the flags . * @ param flags the flags of the Lucene field . * @ return the store parameter corresponding to the given flags . */ private static Field . Store getStoreParameter ( int flags ) { } }
if ( ( flags & STORED_FLAG ) > 0 ) { return Field . Store . YES ; } else { return Field . Store . NO ; }
public class ListComplianceSummariesResult { /** * A list of compliant and non - compliant summary counts based on compliance types . For example , this call returns * State Manager associations , patches , or custom compliance types according to the filter criteria that you * specified . * < b > NOTE : < / b > T...
if ( this . complianceSummaryItems == null ) { setComplianceSummaryItems ( new com . amazonaws . internal . SdkInternalList < ComplianceSummaryItem > ( complianceSummaryItems . length ) ) ; } for ( ComplianceSummaryItem ele : complianceSummaryItems ) { this . complianceSummaryItems . add ( ele ) ; } return this ;
public class ReflectionUtil { /** * 获取所有包含指定 < code > Annotation < / code > 的 < code > Field < / code > 数组 * @ param clazz 查找类 * @ param annotationClass 注解类名 * @ return < code > Field < / code > 数组 */ public static Field [ ] getAnnotationFields ( Class < ? > clazz , Class < ? extends Annotation > annotationClass ...
if ( clazz == null || annotationClass == null ) { return null ; } List < Field > fields = getAllFieldsOfClass0 ( clazz ) ; if ( CollectionUtil . isEmpty ( fields ) ) { return null ; } List < Field > list = CollectionUtil . createArrayList ( ) ; for ( Field field : fields ) { if ( null != field . getAnnotation ( annotat...
public class FileUtil { /** * Loads bytes of the given file . * @ return Bytes of the given file . */ public static byte [ ] readFile ( File file ) throws IOException { } }
// Open file RandomAccessFile f = new RandomAccessFile ( file , "r" ) ; try { // Get and check length long longlength = f . length ( ) ; int length = ( int ) longlength ; if ( length != longlength ) { throw new IOException ( "File size >= 2 GB" ) ; } // Read file and return data byte [ ] data = new byte [ length ] ; f ...
public class Serializer { /** * Reads a serializable object . * @ param id The serializable type ID . * @ param buffer The buffer from which to read the object . * @ param < T > The object type . * @ return The read object . */ @ SuppressWarnings ( "unchecked" ) private < T > T readById ( int id , BufferInput <...
Class < T > type = ( Class < T > ) registry . type ( id ) ; if ( type == null ) throw new SerializationException ( "cannot deserialize: unknown type" ) ; TypeSerializer < T > serializer = getSerializer ( type ) ; if ( serializer == null ) throw new SerializationException ( "cannot deserialize: unknown type" ) ; return ...
public class DefaultTemplatedURLFormatter { /** * Format the given URL using a URL template , if defined in a URL * template config file . The { @ link org . apache . beehive . netui . core . urls . URIContext } * encapsulates some additional data needed to write out the string form . * E . g . It defines if the ...
// Look for the template config and get the right template . // If it is found , apply the value to the template . String result = null ; URLTemplate template = null ; URLTemplatesFactory factory = URLTemplatesFactory . getURLTemplatesFactory ( request ) ; if ( factory != null ) { String templateName = factory . getTem...
public class JsonEscape { /** * Perform a ( configurable ) JSON < strong > escape < / strong > operation on a < tt > Reader < / tt > input , * writing results to a < tt > Writer < / tt > . * This method will perform an escape operation according to the specified * { @ link JsonEscapeType } and * { @ link JsonEs...
if ( writer == null ) { throw new IllegalArgumentException ( "Argument 'writer' cannot be null" ) ; } if ( type == null ) { throw new IllegalArgumentException ( "The 'type' argument cannot be null" ) ; } if ( level == null ) { throw new IllegalArgumentException ( "The 'level' argument cannot be null" ) ; } JsonEscapeUt...
public class SingletonActivationStrategy { /** * Internal method used by subclasses to activate a bean */ protected BeanO doActivation ( EJBThreadData threadData , ContainerTx tx , BeanId beanId , boolean takeInvocationRef ) throws RemoteException { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "doActivation" , new Object [ ] { tx , beanId , new Boolean ( takeInvocationRef ) } ) ; } BeanO bean = null ; Throwable exception = null ; MasterKey key = new MasterKey ( beanId ) ; boolean activate = false ; boolean pushedCa...
public class SaverDef { /** * < pre > * The name of the tensor in which to specify the filename when saving or * restoring a model checkpoint . * < / pre > * < code > optional string filename _ tensor _ name = 1 ; < / code > */ public com . google . protobuf . ByteString getFilenameTensorNameBytes ( ) { } }
java . lang . Object ref = filenameTensorName_ ; if ( ref instanceof java . lang . String ) { com . google . protobuf . ByteString b = com . google . protobuf . ByteString . copyFromUtf8 ( ( java . lang . String ) ref ) ; filenameTensorName_ = b ; return b ; } else { return ( com . google . protobuf . ByteString ) ref ...
public class RuntimeModelIo { /** * Loads an application from a directory . * @ param projectDirectory the project directory * @ param appDescriptor the application ' s descriptor * @ param result the result to populate * @ return a load result ( never null ) */ private static ApplicationLoadResult loadApplicat...
ApplicationTemplate app = result . applicationTemplate ; result . applicationTemplate . setDirectory ( projectDirectory ) ; // Load the graph File graphDirectory = new File ( projectDirectory , Constants . PROJECT_DIR_GRAPH ) ; GRAPH : if ( ! graphDirectory . exists ( ) ) { RoboconfError error = new RoboconfError ( Err...
public class EarDescriptorBuilder { /** * Wrires any module ( generates element ) . * @ return element to write data to */ private Element writeModule ( ) { } }
Element element = doc . createElement ( "module" ) ; rootElement . appendChild ( element ) ; return element ;
public class BuildDataHelper { /** * Gets SHA1 from the build . * @ param build * @ return SHA1 of the las * @ throws IOException Cannot get the info about commit ID */ @ Nonnull public static ObjectId getCommitSHA1 ( @ Nonnull Run < ? , ? > build ) throws IOException { } }
List < BuildData > buildDataList = build . getActions ( BuildData . class ) ; Job < ? , ? > parent = build . getParent ( ) ; BuildData buildData = calculateBuildData ( parent . getName ( ) , parent . getFullName ( ) , buildDataList ) ; if ( buildData == null ) { throw new IOException ( Messages . BuildDataHelper_NoBuil...
public class ModbusTCPTransaction { /** * incrementTransactionID - - Increment the transaction ID for the next * transaction . Note that the caller must get the new transaction ID with * getTransactionID ( ) . This is only done validity checking is enabled so * that dumb slaves don ' t cause problems . The origin...
if ( isCheckingValidity ( ) ) { if ( transactionID >= Modbus . MAX_TRANSACTION_ID ) { transactionID = Modbus . DEFAULT_TRANSACTION_ID ; } else { transactionID ++ ; } } request . setTransactionID ( getTransactionID ( ) ) ;
public class LongHashMap { /** * Resize the table to hold given capacity . * @ param newCapacity the new capacity , must be a power of two . */ private void resize ( int newCapacity ) { } }
// assert ( newCapacity & - newCapacity ) = = newCapacity ; / / power of 2 int newLength = newCapacity * 2 ; long [ ] oldTable = table ; int oldLength = oldTable . length ; if ( oldLength == 2 * MAXIMUM_CAPACITY ) { // can ' t expand any further if ( threshold == MAXIMUM_CAPACITY - 1 ) throw new IllegalStateException (...
public class SnapshotClient { /** * Sets the access control policy on the specified resource . Replaces any existing policy . * < p > Sample code : * < pre > < code > * try ( SnapshotClient snapshotClient = SnapshotClient . create ( ) ) { * ProjectGlobalSnapshotResourceName resource = ProjectGlobalSnapshotResou...
SetIamPolicySnapshotHttpRequest request = SetIamPolicySnapshotHttpRequest . newBuilder ( ) . setResource ( resource == null ? null : resource . toString ( ) ) . setGlobalSetPolicyRequestResource ( globalSetPolicyRequestResource ) . build ( ) ; return setIamPolicySnapshot ( request ) ;
public class MapSchema { /** * Validates a given value against the schema and configured validation rules . * @ param path a dot notation path to the value . * @ param value a value to be validated . * @ param results a list with validation results to add new results . */ @ SuppressWarnings ( "unchecked" ) @ Over...
String name = path != null ? path : "value" ; value = ObjectReader . getValue ( value ) ; super . performValidation ( path , value , results ) ; if ( value == null ) return ; if ( value instanceof Map < ? , ? > ) { Map < Object , Object > map = ( Map < Object , Object > ) value ; for ( Object key : map . keySet ( ) ) {...
public class Strings { /** * Encodes a { @ linkplain CharSequence } to a HTML conform representation by quoting special characters . * @ param buffer the { @ linkplain StringBuilder } to encode into . * @ param chars the { @ linkplain CharSequence } to encode . * @ return the encoded characters . */ public static...
chars . chars ( ) . forEach ( c -> { switch ( c ) { case '<' : buffer . append ( "&lt;" ) ; break ; case '>' : buffer . append ( "&gt;" ) ; break ; case '&' : buffer . append ( "&amp;" ) ; break ; case '"' : buffer . append ( "&quot;" ) ; break ; case '\'' : buffer . append ( "&#39;" ) ; break ; default : if ( Characte...
public class LogFactory { /** * Load log provider from Java services and return the first instance found . It is expected to have only one log service * provider deployed on runtime ; it more found just blindly select the first found . * Returns { @ link DefaultLogProvider } if no log provider service found . * @...
Iterable < LogProvider > providers = ServiceLoader . load ( LogProvider . class ) ; for ( LogProvider provider : providers ) { // for now ignore multiple implementations and choose blindly the first one return provider ; } return new DefaultLogProvider ( ) ;
public class HTTPChunkedInputStream { /** * Read a line of text from the given Stream and return it * as a String . Assumes lines end in CRLF . */ private String readLine ( InputStream in ) throws IOException { } }
StringBuffer buf = new StringBuffer ( ) ; int c , length = 0 ; while ( true ) { c = in . read ( ) ; if ( c == - 1 || c == '\n' || length > 512 ) { break ; } else if ( c == '\r' ) { in . read ( ) ; return buf . toString ( ) ; } else { buf . append ( ( char ) c ) ; length ++ ; } } return buf . toString ( ) ;
public class KeyTools { /** * 构建RSA密钥对 * @ param keySize keySize ( 必须大于等于512) * @ return RSA密钥对 */ public static KeyHolder buildRSAKey ( int keySize ) { } }
try { KeyPairGenerator generator = KeyPairGenerator . getInstance ( "RSA" ) ; generator . initialize ( keySize ) ; KeyPair keyPair = generator . generateKeyPair ( ) ; PrivateKey privateKey = keyPair . getPrivate ( ) ; PublicKey publicKey = keyPair . getPublic ( ) ; return new KeyHolder ( privateKey , publicKey ) ; } ca...
public class PrimitivePropertyEditor { /** * According the editor type , this methods checks if value equals * to one of the unknown values defined under { @ link org . biopax . paxtools . model . BioPAXElement } * or is an empty set or set of " unknown " values . * @ param value the value to be checked if it is ...
return ( value instanceof Set ) ? emptySetOrContainsOnlyUnknowns ( ( Set ) value ) : emptySetOrContainsOnlyUnknowns ( Collections . singleton ( value ) ) ;