signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class Message { /** * / * Returns true if the message could be rendered . */ private boolean toWire ( DNSOutput out , int maxLength ) { } }
if ( maxLength < Header . LENGTH ) return false ; Header newheader = null ; int tempMaxLength = maxLength ; if ( tsigkey != null ) tempMaxLength -= tsigkey . recordLength ( ) ; OPTRecord opt = getOPT ( ) ; byte [ ] optBytes = null ; if ( opt != null ) { optBytes = opt . toWire ( Section . ADDITIONAL ) ; tempMaxLength -...
public class StorePackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EClass getFormatSerializerMap ( ) { } }
if ( formatSerializerMapEClass == null ) { formatSerializerMapEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( StorePackage . eNS_URI ) . getEClassifiers ( ) . get ( 113 ) ; } return formatSerializerMapEClass ;
public class CmsExtendedWorkflowManager { /** * Generates the name for a new workflow project based on the user for whom it is created . < p > * @ param userCms the user ' s current CMS context * @ return the workflow project name */ protected String generateProjectName ( CmsObject userCms ) { } }
String projectName = generateProjectName ( userCms , true ) ; if ( existsProject ( projectName ) ) { projectName = generateProjectName ( userCms , false ) ; } return projectName ;
public class ManagedBeanBuilder { /** * Checks if the scope of the property value is valid for a bean to be stored in targetScope . * If one of the scopes is a custom scope ( since jsf 2.0 ) , this method only checks the * references if the current ProjectStage is not Production . * @ param facesContext * @ par...
if ( ! property . isValueReference ( ) ) { // no value reference but a literal value - > nothing to check return true ; } // get the targetScope ( since 2.0 this could be an EL ValueExpression ) String targetScope = null ; if ( beanConfiguration . isManagedBeanScopeValueExpression ( ) ) { // the scope is a custom scope...
public class AWSCodeStarClient { /** * Gets the tags for a project . * @ param listTagsForProjectRequest * @ return Result of the ListTagsForProject operation returned by the service . * @ throws ProjectNotFoundException * The specified AWS CodeStar project was not found . * @ throws ValidationException * T...
request = beforeClientExecution ( request ) ; return executeListTagsForProject ( request ) ;
public class TextPair { /** * Returns the deltas between beforeText and afterText as a line separated String . * For more detailed diffs , use getPatch ( ) or getUnifiedDiffStrings ( ) * @ return diffs as line - separated String */ public String getLongDiffString ( ) { } }
StringBuilder deltas = new StringBuilder ( ) ; for ( Delta delta : getPatch ( ) . getDeltas ( ) ) { deltas . append ( "DeltaType: " + delta . getType ( ) . toString ( ) ) ; deltas . append ( System . getProperty ( "line.separator" ) ) ; deltas . append ( "Original (Non-Neutral):" ) ; deltas . append ( System . getPrope...
public class StringUtility { /** * Word wraps a < code > String < / code > to be no longer than the provided number of characters wide . * TODO : Make this more efficient by eliminating the internal use of substring . */ public static void wordWrap ( String string , int width , Appendable out ) throws IOException { }...
width ++ ; boolean useCR = false ; do { int pos = string . indexOf ( '\n' ) ; if ( ! useCR && pos > 0 && string . charAt ( pos - 1 ) == '\r' ) useCR = true ; int linelength = pos == - 1 ? string . length ( ) : pos + 1 ; if ( ( pos == - 1 ? linelength - 1 : pos ) <= width ) { // No wrap required out . append ( string , ...
public class RevisionApi { /** * Returns the number of revisions for the specified article . * @ param articleID * ID of the article * @ return number of revisions * @ throws WikiApiException * if an error occurs */ public int getNumberOfRevisions ( final int articleID ) throws WikiApiException { } }
try { if ( articleID < 1 ) { throw new IllegalArgumentException ( ) ; } PreparedStatement statement = null ; ResultSet result = null ; String revCounters ; try { // Retrieve the fullRevisionPK and calculate the limit statement = this . connection . prepareStatement ( "SELECT RevisionCounter " + "FROM index_articleID_rc...
public class Setup { /** * Creates a package if it doesn ' t exist . Only works from 6.1. */ public void mkPackage ( String name ) throws IOException { } }
File metaDir = new File ( getAssetLoc ( ) + "/" + name . replace ( '.' , '/' ) + "/.mdw" ) ; if ( ! metaDir . exists ( ) && ! metaDir . mkdirs ( ) ) throw new IOException ( "Cannot create directory: " + metaDir . getAbsolutePath ( ) ) ; File pkgFile = new File ( metaDir + "/package.yaml" ) ; if ( ! pkgFile . exists ( )...
public class CookieUtils { /** * 获取cookie中的value < br > * 自动负责解码 < br > * @ param request * @ param cookieName * @ return null when cannot find the cookie */ public static String getCookieValue ( HttpServletRequest request , String cookieName ) { } }
try { Cookie cookie = getCookie ( request , cookieName ) ; if ( null == cookie ) { return null ; } else { return URLDecoder . decode ( cookie . getValue ( ) , "utf-8" ) ; } } catch ( Exception e ) { return null ; }
public class CommerceWishListPersistenceImpl { /** * Returns an ordered range of all the commerce wish lists where groupId = & # 63 ; and userId = & # 63 ; and defaultWishList = & # 63 ; . * Useful when paginating results . Returns a maximum of < code > end - start < / code > instances . < code > start < / code > and...
return findByG_U_D ( groupId , userId , defaultWishList , start , end , orderByComparator , true ) ;
public class RedisInner { /** * Import data into Redis cache . * @ param resourceGroupName The name of the resource group . * @ param name The name of the Redis cache . * @ param parameters Parameters for Redis import operation . * @ throws IllegalArgumentException thrown if parameters fail the validation * @...
return beginImportDataWithServiceResponseAsync ( resourceGroupName , name , parameters ) . map ( new Func1 < ServiceResponse < Void > , Void > ( ) { @ Override public Void call ( ServiceResponse < Void > response ) { return response . body ( ) ; } } ) ;
public class ComputeNodesImpl { /** * Deletes a user account from the specified compute node . * You can delete a user account to a node only when it is in the idle or running state . * @ param poolId The ID of the pool that contains the compute node . * @ param nodeId The ID of the machine on which you want to d...
return ServiceFuture . fromHeaderResponse ( deleteUserWithServiceResponseAsync ( poolId , nodeId , userName ) , serviceCallback ) ;
public class CheckConformance { /** * Gets requirements from all configs . Merges whitelists of requirements with ' extends ' equal to * ' rule _ id ' of other rule . */ static List < Requirement > mergeRequirements ( AbstractCompiler compiler , List < ConformanceConfig > configs ) { } }
List < Requirement . Builder > builders = new ArrayList < > ( ) ; Map < String , Requirement . Builder > extendable = new HashMap < > ( ) ; for ( ConformanceConfig config : configs ) { for ( Requirement requirement : config . getRequirementList ( ) ) { Requirement . Builder builder = requirement . toBuilder ( ) ; if ( ...
public class UtilLepetitEPnP { /** * Computes the Jacobian given 3 control points . */ public static void jacobian_Control3 ( DMatrixRMaj L_full , double beta [ ] , DMatrixRMaj A ) { } }
int indexA = 0 ; double b0 = beta [ 0 ] ; double b1 = beta [ 1 ] ; double b2 = beta [ 2 ] ; final double ld [ ] = L_full . data ; for ( int i = 0 ; i < 3 ; i ++ ) { int li = L_full . numCols * i ; A . data [ indexA ++ ] = 2 * ld [ li + 0 ] * b0 + ld [ li + 1 ] * b1 + ld [ li + 2 ] * b2 ; A . data [ indexA ++ ] = ld [ l...
public class JbcSrcJavaValue { /** * Constructs a JbcSrcJavaValue specifically for ' constantNull ' , in which case the ' allowedType ' * is any valid type ( including specific proto or proto enum types ) . There ' s no SoyType we can use * to indicate this , and we can ' t construct our own SoyType because the cxt...
return new JbcSrcJavaValue ( SoyExpression . NULL , /* method = */ null , /* allowedType = */ null , /* constantNull = */ true , /* error = */ false , reporter ) ;
public class ActionType { /** * The configuration properties for the action type . * @ param actionConfigurationProperties * The configuration properties for the action type . */ public void setActionConfigurationProperties ( java . util . Collection < ActionConfigurationProperty > actionConfigurationProperties ) {...
if ( actionConfigurationProperties == null ) { this . actionConfigurationProperties = null ; return ; } this . actionConfigurationProperties = new java . util . ArrayList < ActionConfigurationProperty > ( actionConfigurationProperties ) ;
public class CreateInputRequest { /** * Destination settings for PUSH type inputs . * @ param destinations * Destination settings for PUSH type inputs . */ public void setDestinations ( java . util . Collection < InputDestinationRequest > destinations ) { } }
if ( destinations == null ) { this . destinations = null ; return ; } this . destinations = new java . util . ArrayList < InputDestinationRequest > ( destinations ) ;
public class ImgUtil { /** * 缩放图像 ( 按比例缩放 ) < br > * 缩放后默认为jpeg格式 , 此方法并不关闭流 * @ param srcImg 源图像来源流 * @ param destFile 缩放后的图像写出到的流 * @ param scale 缩放比例 。 比例大于1时为放大 , 小于1大于0为缩小 * @ throws IORuntimeException IO异常 * @ since 3.2.2 */ public static void scale ( Image srcImg , File destFile , float scale ) throw...
write ( scale ( srcImg , scale ) , destFile ) ;
public class ListUserPoolClientsRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( ListUserPoolClientsRequest listUserPoolClientsRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( listUserPoolClientsRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( listUserPoolClientsRequest . getUserPoolId ( ) , USERPOOLID_BINDING ) ; protocolMarshaller . marshall ( listUserPoolClientsRequest . getMaxResults ( ) , MAXRE...
public class MemberRemoval { /** * Specifies that any method or constructor that matches the specified matcher should be removed . * @ param matcher The matcher that decides upon method and constructor removal . * @ return A new member removal instance that removes all previously specified members and any method or...
return new MemberRemoval ( fieldMatcher , methodMatcher . or ( matcher ) ) ;
public class ContentCryptoScheme { /** * Increment the rightmost 32 bits of a 16 - byte counter by the specified * delta . Both the specified delta and the resultant value must stay within * the capacity of 32 bits . * ( Package private for testing purposes . ) * @ param counter * a 16 - byte counter used in ...
if ( blockDelta == 0 ) return counter ; if ( counter == null || counter . length != 16 ) throw new IllegalArgumentException ( ) ; // Can optimize this later . KISS for now . if ( blockDelta > MAX_GCM_BLOCKS ) throw new IllegalStateException ( ) ; // Allocate 8 bytes for a long ByteBuffer bb = ByteBuffer . allocate ( 8 ...
public class AfplibPackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EEnum getFNCResXUBase ( ) { } }
if ( fncResXUBaseEEnum == null ) { fncResXUBaseEEnum = ( EEnum ) EPackage . Registry . INSTANCE . getEPackage ( AfplibPackage . eNS_URI ) . getEClassifiers ( ) . get ( 29 ) ; } return fncResXUBaseEEnum ;
public class MicrodataChecker { /** * Check itemref constraints . * This mirrors the " the properties of an item " algorithm , * modified to recursively check sub - items . * http : / / www . whatwg . org / specs / web - apps / current - work / multipage / microdata . html # the - properties - of - an - item */ p...
Deque < Element > pending = new ArrayDeque < Element > ( ) ; Set < Element > memory = new HashSet < Element > ( ) ; memory . add ( root ) ; for ( Element child : root . children ) { pending . push ( child ) ; } if ( root . itemRef != null ) { for ( String id : root . itemRef ) { Element refElm = idmap . get ( id ) ; if...
public class MapELResolver { /** * If the base object is a map , returns whether a call to * { @ link # setValue } will always fail . * < p > If the base is a < code > Map < / code > , the < code > propertyResolved < / code > * property of the < code > ELContext < / code > object must be set to * < code > true ...
if ( context == null ) { throw new NullPointerException ( ) ; } if ( base != null && base instanceof Map ) { context . setPropertyResolved ( true ) ; Map map = ( Map ) base ; return isReadOnly || map . getClass ( ) == theUnmodifiableMapClass ; } return false ;
public class DatabaseURIHelper { /** * Returns URI for { @ code _ changes } endpoint using passed * { @ code query } . */ public URI changesUri ( String queryKey , Object queryValue ) { } }
if ( queryKey . equals ( "since" ) ) { if ( ! ( queryValue instanceof String ) ) { // json encode the seq number since it isn ' t a string Gson gson = new Gson ( ) ; queryValue = gson . toJson ( queryValue ) ; } } return this . path ( "_changes" ) . query ( queryKey , queryValue ) . build ( ) ;
public class XDSSourceAuditor { /** * Get an instance of the XDS Document Source Auditor from the * global context * @ return XDS Document Source Auditor instance */ public static XDSSourceAuditor getAuditor ( ) { } }
AuditorModuleContext ctx = AuditorModuleContext . getContext ( ) ; return ( XDSSourceAuditor ) ctx . getAuditor ( XDSSourceAuditor . class ) ;
public class XVariableDeclarationImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public void setName ( String newName ) { } }
String oldName = name ; name = newName ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , XbasePackage . XVARIABLE_DECLARATION__NAME , oldName , name ) ) ;
public class GetActivityTaskRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( GetActivityTaskRequest getActivityTaskRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( getActivityTaskRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( getActivityTaskRequest . getActivityArn ( ) , ACTIVITYARN_BINDING ) ; protocolMarshaller . marshall ( getActivityTaskRequest . getWorkerName ( ) , WORKERNAME_BIND...
public class Groups { /** * 查询所有分组 * @ return */ public List < Group > list ( ) { } }
String url = WxEndpoint . get ( "url.group.list" ) ; String response = wxClient . get ( url ) ; logger . debug ( "list groups: {}" , response ) ; GroupList groupList = JsonMapper . defaultMapper ( ) . fromJson ( response , GroupList . class ) ; return groupList . getGroups ( ) ;
public class MrVector { /** * Inflates a < vector > drawable , using framework implementation when available * @ param resources * Resources to use for inflation * @ param resId * < vector > drawable resource * @ return * < p > Framework { @ link android . graphics . drawable . VectorDrawable } if running l...
if ( LOLLIPOP_PLUS ) { return resources . getDrawable ( resId ) ; } else { return inflateCompatOnly ( resources , resId ) ; }
public class Ix { /** * Calls the given function ( with per - iterator state ) to generate a value or terminate * whenever the next ( ) is called on the resulting Ix . iterator ( ) . * The result ' s iterator ( ) doesn ' t support remove ( ) . * The action may call { @ code onNext } at most once to signal the nex...
return generate ( stateSupplier , nextSupplier , IxEmptyAction . instance1 ( ) ) ;
public class WeeklyAutoScalingSchedule { /** * The schedule for Thursday . * @ param thursday * The schedule for Thursday . */ public void setThursday ( java . util . Map < String , String > thursday ) { } }
this . thursday = thursday == null ? null : new com . amazonaws . internal . SdkInternalMap < String , String > ( thursday ) ;
public class DroolsFactoryImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public String convertPriorityTypeToString ( EDataType eDataType , Object instanceValue ) { } }
return XMLTypeFactory . eINSTANCE . convertToString ( XMLTypePackage . Literals . INTEGER , instanceValue ) ;
public class StateController { /** * Updates state ( or resets state if reset was scheduled , see { @ link # resetState ( State ) } ) . * @ param state State to be updated * @ return { @ code true } if state was reset to initial state or { @ code false } if state was * updated . */ boolean updateState ( State sta...
if ( isResetRequired ) { // Applying initial state state . set ( 0f , 0f , zoomBounds . set ( state ) . getFitZoom ( ) , 0f ) ; GravityUtils . getImagePosition ( state , settings , tmpRect ) ; state . translateTo ( tmpRect . left , tmpRect . top ) ; // We can correctly reset state only when we have both image size and ...
public class HardwareBinder { /** * A very simple main that prints out the machine UUID to the standard * output . * This code takes into account the hardware address ( Ethernet MAC ) when * calculating the hardware UUID . * @ param args not used in this version * @ throws UnknownHostException in case some er...
final var hb = new HardwareBinder ( ) ; System . out . println ( "The UUID of the machine is:\n" + hb . getMachineIdString ( ) + "\n" ) ;
public class ReplicatorBuilder { /** * Sets the username to use when authenticating with the server . * Setting the username and password ( using the { @ link ReplicatorBuilder # password ( String ) } ) * method * takes precedence over credentials passed via the URI . * @ param username The username to use when...
Misc . checkNotNull ( username , "username" ) ; this . username = username ; // noinspection unchecked return ( E ) this ;
public class CSSStyleRuleImpl { /** * Sets the selector text . * @ param selectorText the new selector text * @ throws DOMException in clase of error */ public void setSelectorText ( final String selectorText ) throws DOMException { } }
try { final CSSOMParser parser = new CSSOMParser ( ) ; selectors_ = parser . parseSelectors ( selectorText ) ; } catch ( final CSSException e ) { throw new DOMExceptionImpl ( DOMException . SYNTAX_ERR , DOMExceptionImpl . SYNTAX_ERROR , e . getMessage ( ) ) ; } catch ( final IOException e ) { throw new DOMExceptionImpl...
public class SemanticPredicates { /** * Distinguish between local variable declaration and method call , e . g . ` a b ` */ public static boolean isInvalidLocalVariableDeclaration ( TokenStream ts ) { } }
int index = 2 ; Token token ; int tokenType ; int tokenType2 = ts . LT ( index ) . getType ( ) ; int tokenType3 ; if ( DOT == tokenType2 ) { int tokeTypeN = tokenType2 ; do { index = index + 2 ; tokeTypeN = ts . LT ( index ) . getType ( ) ; } while ( DOT == tokeTypeN ) ; if ( LT == tokeTypeN || LBRACK == tokeTypeN ) { ...
public class AbstractGenericRowMapper { /** * Generate UPDATE statement to update an existing BO . * The generated SQL will look like this * { @ code UPDATE table SET col1 = ? , col2 = ? . . . WHERE pk - 1 = ? AND pk - 2 = ? . . . } * @ param tableName * @ return * @ since 0.8.5 */ public String generateSqlUp...
try { return cacheSQLs . get ( "UPDATE:" + tableName , ( ) -> { return MessageFormat . format ( "UPDATE {0} SET {2} WHERE {1}" , tableName , strWherePkClause , strUpdateSetClause ) ; } ) ; } catch ( ExecutionException e ) { throw new RuntimeException ( e ) ; }
public class ResourcesInner { /** * Checks by ID whether a resource exists . * @ param resourceId The fully qualified ID of the resource , including the resource name and resource type . Use the format , / subscriptions / { guid } / resourceGroups / { resource - group - name } / { resource - provider - namespace } / ...
return ServiceFuture . fromResponse ( checkExistenceByIdWithServiceResponseAsync ( resourceId , apiVersion ) , serviceCallback ) ;
public class CmsLruCache { /** * Removes an object from the list of all cached objects in this cache , * no matter what position it has inside the list . < p > * @ param theCacheObject the object being removed from the list of all cached objects * @ return a reference to the object that was removed */ public sync...
if ( ! isCached ( theCacheObject ) ) { // theCacheObject is null or not inside the cache return null ; } // set the list pointers correct boolean nextNull = ( theCacheObject . getNextLruObject ( ) == null ) ; boolean prevNull = ( theCacheObject . getPreviousLruObject ( ) == null ) ; if ( prevNull && nextNull ) { m_list...
public class RestFileManager { /** * Will create a unique sub folder in the temp directory . This is done so that we can name the file with the original file * name without having to worry about file name collisions . The bh rest apis will name the attached file what the system File * created in this method is name...
String newFolderPath = FileUtils . getTempDirectoryPath ( ) + "/" + System . currentTimeMillis ( ) ; File newFolder = new File ( newFolderPath ) ; FileUtils . forceMkdir ( newFolder ) ; String originalFileName = multipartFile . getOriginalFilename ( ) ; String filePath = newFolderPath + "/" + originalFileName ; File fi...
public class MethodBase { /** * Parse the request body , and return the object . * @ param is Input stream for content * @ param cl The class we expect * @ param resp for status * @ return Object Parsed body or null for no body * @ exception ServletException Some error occurred . */ protected Object readJson ...
if ( is == null ) { return null ; } try { return getMapper ( ) . readValue ( is , cl ) ; } catch ( Throwable t ) { resp . setStatus ( HttpServletResponse . SC_INTERNAL_SERVER_ERROR ) ; if ( debug ( ) ) { error ( t ) ; } throw new ServletException ( t ) ; }
public class SVDModelV99 { /** * Version & Schema - specific filling into the impl */ @ Override public SVDModel createImpl ( ) { } }
SVDModel . SVDParameters parms = parameters . createImpl ( ) ; return new SVDModel ( model_id . key ( ) , parms , null ) ;
public class TransmissionData { /** * Resets the transmission data instance so that it can be reused . This is invoked * as part of the TransmissionDataIterator . next ( ) method so that it can keep hold of * only one instance of this class . * @ param jfapBuffer * @ param isUserRequest * @ param isTerminal ...
if ( tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "reset" , new Object [ ] { jfapBuffer , "" + isTerminal , connection } ) ; this . isTerminal = isTerminal ; this . connection = connection ; this . xmitDataBuffers = jfapBuffer . getBuffersForTransmission ( ) ; if ( tc . isEntryEnabled ( ) ) SibTr . exit ( this...
public class PropertiesCoreExtension { /** * Delete the property and all the property values * @ param property * property name * @ return deleted values count */ public int deleteProperty ( String property ) { } }
int count = 0 ; if ( has ( ) ) { TDao dao = getDao ( ) ; String where = dao . buildWhere ( COLUMN_PROPERTY , property ) ; String [ ] whereArgs = dao . buildWhereArgs ( property ) ; count = dao . delete ( where , whereArgs ) ; } return count ;
public class BaseNsStreamWriter { /** * Method that is called to ensure that we can start writing an * element , both from structural point of view , and from syntactic * ( close previously open start element , if any ) . */ protected void checkStartElement ( String localName , String prefix ) throws XMLStreamExcep...
// Need to finish an open start element ? if ( mStartElementOpen ) { closeStartElement ( mEmptyElement ) ; } else if ( mState == STATE_PROLOG ) { verifyRootElement ( localName , prefix ) ; } else if ( mState == STATE_EPILOG ) { if ( mCheckStructure ) { String name = ( prefix == null || prefix . length ( ) == 0 ) ? loca...
public class BasicRequestExecutor { /** * < p > Executes an { @ link HttpRequestBase } using the endpoint ' s { @ link HttpClient } and handles the * resulting { @ link HttpResponse } using this executor ' s { @ link ExecutionHandler } . < / p > * < p > See { @ link # fetchResponse ( InvocationContext , HttpRequest...
HttpResponse response = null ; try { response = fetchResponse ( context , request ) ; } catch ( RequestExecutionException ree ) { executionHandler . onError ( context , ree ) ; } if ( response != null ) { if ( successful ( response ) ) { executionHandler . onSuccess ( context , response ) ; } else { executionHandler . ...
public class InitializationListener { /** * ( non - Javadoc ) * @ see javax . servlet . ServletContextListener # contextDestroyed ( javax . servlet . ServletContextEvent ) */ public void contextDestroyed ( ServletContextEvent arg0 ) { } }
Iterator < Driver > drivers = DriverManager . getDrivers ( ) ; while ( drivers . hasNext ( ) ) { Driver driver = drivers . next ( ) ; DriverManager . deregisterDriver ( driver ) ; DriverImpl impl = ( DriverImpl ) driver ; impl . shutdown ( ) ; }
public class ConfigureLogback { /** * Configure logback logging system using the provided file . */ static void configure ( final File f ) { } }
new Configurator ( ) { @ Override void withConfigurator ( JoranConfigurator configurator ) throws JoranException { configurator . doConfigure ( f ) ; } } . configure ( ) ;
public class Diff { /** * return wether field is in changedfieldlist and old value of this field * @ param fieldId * @ return */ public Pair < Boolean , Object > hasValueChanged ( String fieldId ) { } }
for ( int i = 0 ; i < changedFields . length ; i ++ ) { String changedField = changedFields [ i ] ; if ( fieldId . equals ( changedField ) ) { return new Pair < > ( true , oldValues [ i ] ) ; } } return new Pair < > ( false , null ) ;
public class IdentitySourceMapGenerator { /** * Returns an array of integers representing the line lengths ( including CRLF ) of each of the * lines in the input source . * @ return array of line length integers ( one based ) */ private int [ ] getLineLengths ( ) { } }
List < Integer > lineLengthsList = new ArrayList < Integer > ( ) ; int linelength = 0 ; for ( int i = 0 ; i < source . length ( ) ; i ++ ) { linelength ++ ; char ch = source . charAt ( i ) ; if ( ch == '\n' ) { lineLengthsList . add ( linelength ) ; linelength = 0 ; } } lineLengthsList . add ( linelength ) ; int [ ] re...
public class ExecutionGraphCache { /** * Gets the { @ link AccessExecutionGraph } for the given { @ link JobID } and caches it . The * { @ link AccessExecutionGraph } will be requested again after the refresh interval has passed * or if the graph could not be retrieved from the given gateway . * @ param jobId ide...
return getExecutionGraphInternal ( jobId , restfulGateway ) . thenApply ( Function . identity ( ) ) ;
public class EJBJarDescriptorHandler { /** * Insert EJB references in all of the descriptors of the EJB ' s in the supplied list * @ param document DOM tree of an ejb - jar . xml file . * @ param ejbInfo Contains information about the EJB control . * @ param ejbLinkValue The ejb - link value for the EJBs . * @ ...
for ( Object ejb : ejbList ) { if ( ejbInfo . isLocal ( ) ) insertEJBLocalRefInEJBJar ( ( Element ) ejb , ejbInfo , ejbLinkValue , document ) ; else insertEJBRefInEJBJar ( ( Element ) ejb , ejbInfo , ejbLinkValue , document ) ; }
public class JsonTokener { /** * Consume the next character , skipping whitespace , and check that it matches a * specified character . * @ param c The character to match . * @ return The character . */ public char nextClean ( char c ) { } }
char n = nextClean ( ) ; if ( n != c ) { throw syntaxError ( "Expected '" + c + "' and instead saw '" + n + "'" ) ; } return n ;
public class GenericGenbankHeaderFormat { /** * private String _ write _ multi _ entries ( String tag , ArrayList < String > * text _ list ) { String output = _ write _ single _ line ( tag , text _ list . remove ( 0 ) ) ; * for ( String s : text _ list ) { output + = _ write _ single _ line ( " " , s ) ; } return ...
Date sysdate = Calendar . getInstance ( ) . getTime ( ) ; // String default _ date = // sysdate . get ( Calendar . DAY _ OF _ MONTH ) + " - " + sysdate . get ( Calendar . MONTH ) + " - " + sysdate . get ( Calendar . YEAR ) ; String default_date = new SimpleDateFormat ( "dd-MMM-yyyy" ) . format ( sysdate ) ; return defa...
public class Configuration { /** * Checks for the presence of the property < code > name < / code > in the * deprecation map . Returns the first of the list of new keys if present * in the deprecation map or the < code > name < / code > itself . If the property * is not presently set but the property map contains...
ArrayList < String > names = new ArrayList < String > ( ) ; if ( isDeprecated ( name ) ) { DeprecatedKeyInfo keyInfo = deprecatedKeyMap . get ( name ) ; warnOnceIfDeprecated ( name ) ; for ( String newKey : keyInfo . newKeys ) { if ( newKey != null ) { names . add ( newKey ) ; } } } if ( names . isEmpty ( ) ) { names ....
public class QueryBuilder { /** * Perform a UNION ALL between the query as defined prior to this method and the query that will be defined following this * method . * @ return this builder object , for convenience in method chaining */ public QueryBuilder unionAll ( ) { } }
this . firstQuery = query ( ) ; this . firstQuerySetOperation = Operation . UNION ; this . firstQueryAll = true ; clear ( false ) ; return this ;
public class DefaultAnnotationProvider { /** * taken from org . apache . myfaces . view . facelets . util . Classpath * For URLs to JARs that do not use JarURLConnection - allowed by the servlet spec - attempt to produce a JarFile * object all the same . Known servlet engines that function like this include Weblogi...
String urlFile = url . getFile ( ) ; // Trim off any suffix - which is prefixed by " ! / " on Weblogic int separatorIndex = urlFile . indexOf ( "!/" ) ; // OK , didn ' t find that . Try the less safe " ! " , used on OC4J if ( separatorIndex == - 1 ) { separatorIndex = urlFile . indexOf ( '!' ) ; } if ( separatorIndex !...
public class VisDialog { /** * Hides the dialog . Called automatically when a button is clicked . The default implementation fades out the dialog over 400 * milliseconds and then removes it from the stage . */ public void hide ( ) { } }
hide ( sequence ( Actions . fadeOut ( FADE_TIME , Interpolation . fade ) , Actions . removeListener ( ignoreTouchDown , true ) , Actions . removeActor ( ) ) ) ;
public class AutoFringer { /** * Compute and return the fringe tile to be inserted at the specified location . */ public BaseTile getFringeTile ( MisoSceneModel scene , int col , int row , Map < FringeTile , WeakReference < FringeTile > > fringes , Map < Long , BufferedImage > masks ) { } }
// get the tileset id of the base tile we are considering int underset = adjustTileSetId ( scene . getBaseTileId ( col , row ) >> 16 ) ; // start with a clean temporary fringer map _fringers . clear ( ) ; boolean passable = true ; // walk through our influence tiles for ( int y = row - 1 , maxy = row + 2 ; y < maxy ; y...
public class WorkSheet { /** * Get back a list of unique values in the row * @ param row * @ return * @ throws Exception */ public ArrayList < String > getDiscreteRowValues ( String row ) throws Exception { } }
HashMap < String , String > hashMapValues = new HashMap < String , String > ( ) ; ArrayList < String > values = new ArrayList < String > ( ) ; for ( String column : getColumns ( ) ) { String value = getCell ( row , column ) ; if ( ! hashMapValues . containsKey ( value ) ) { hashMapValues . put ( value , value ) ; value...
public class CalcPoint { /** * Needs documentation ! * @ param x * @ param y * @ param maxDistance * @ return */ public static int contacts ( Point3d [ ] x , Point3d [ ] y , double maxDistance ) { } }
int contacts = 0 ; for ( int i = 0 ; i < x . length ; i ++ ) { double minDist = Double . MAX_VALUE ; for ( int j = 0 ; j < y . length ; j ++ ) { minDist = Math . min ( minDist , x [ i ] . distanceSquared ( y [ j ] ) ) ; } if ( minDist < maxDistance * maxDistance ) { contacts ++ ; } } return contacts ;
public class DoStuffFromPairwiseGraph { /** * Scores the motion for its ability to capture 3D structure */ public static double score ( PairwiseImageGraph2 . Motion m ) { } }
// countF and countF will be < = totalFeatures // Prefer a scene more features from a fundamental matrix than a homography . // This can be sign that the scene has a rich 3D structure and is poorly represented by // a plane or rotational motion double score = Math . min ( 5 , m . countF / ( double ) ( m . countH + 1 ) ...
public class DefaultLoginWebflowConfigurer { /** * Create renew check state . * @ param flow the flow */ protected void createRenewCheckActionState ( final Flow flow ) { } }
val action = createActionState ( flow , CasWebflowConstants . STATE_ID_RENEW_REQUEST_CHECK , CasWebflowConstants . ACTION_ID_RENEW_AUTHN_REQUEST ) ; createTransitionForState ( action , CasWebflowConstants . TRANSITION_ID_PROCEED , CasWebflowConstants . STATE_ID_GENERATE_SERVICE_TICKET ) ; createTransitionForState ( act...
public class Validator { /** * 验证是否为汉字 * @ param < T > 字符串类型 * @ param value 表单值 * @ param errorMsg 验证错误的信息 * @ return 验证后的值 * @ throws ValidateException 验证异常 */ public static < T extends CharSequence > T validateChinese ( T value , String errorMsg ) throws ValidateException { } }
if ( false == isChinese ( value ) ) { throw new ValidateException ( errorMsg ) ; } return value ;
public class DescribeTransitGatewayAttachmentsResult { /** * Information about the attachments . * @ return Information about the attachments . */ public java . util . List < TransitGatewayAttachment > getTransitGatewayAttachments ( ) { } }
if ( transitGatewayAttachments == null ) { transitGatewayAttachments = new com . amazonaws . internal . SdkInternalList < TransitGatewayAttachment > ( ) ; } return transitGatewayAttachments ;
public class GrammaticalStructure { /** * Returns the dependency path as a list of String , from node to root , it is assumed that * that root is an ancestor of node * @ return A list of dependency labels */ public List < String > getDependencyPath ( int nodeIndex , int rootIndex ) { } }
TreeGraphNode node = getNodeByIndex ( nodeIndex ) ; TreeGraphNode rootTree = getNodeByIndex ( rootIndex ) ; return getDependencyPath ( node , rootTree ) ;
public class RpcInvokeContext { /** * 删除一个调用上下文数据 * @ param key Key * @ return 删除前的值 */ public Object remove ( String key ) { } }
if ( key != null ) { return map . remove ( key ) ; } return null ;
public class CmsAdminEditorWrapper { /** * Performs the dialog actions depending on the initialized action and displays the dialog form . < p > * @ throws Exception if writing to the JSP out fails */ public void displayDialog ( ) throws Exception { } }
initAdminTool ( ) ; getToolManager ( ) . setCurrentToolPath ( this , getParentPath ( ) ) ; JspWriter out = getJsp ( ) . getJspContext ( ) . getOut ( ) ; out . print ( htmlStart ( ) ) ; out . print ( bodyStart ( null ) ) ; out . print ( "<form name='editor' method='post' target='_top' action='" ) ; out . print ( getJsp ...
public class ClockInterval { /** * / * [ deutsch ] * < p > Liefert die L & auml ; nge dieses Intervalls . < / p > * @ return duration in hours , minutes , seconds and nanoseconds * @ since 2.0 */ public Duration < ClockUnit > getDuration ( ) { } }
PlainTime t1 = this . getTemporalOfClosedStart ( ) ; PlainTime t2 = this . getEnd ( ) . getTemporal ( ) ; if ( this . getEnd ( ) . isClosed ( ) ) { if ( t2 . getHour ( ) == 24 ) { if ( t1 . equals ( PlainTime . midnightAtStartOfDay ( ) ) ) { return Duration . of ( 24 , HOURS ) . plus ( 1 , NANOS ) ; } else { t1 = t1 . ...
public class HelloSignClient { /** * Sends the provided signature request to HelloSign . * @ param req SignatureRequest * @ return SignatureRequest * @ throws HelloSignException thrown if there ' s a problem processing the * HTTP request or the JSON response . */ public SignatureRequest sendSignatureRequest ( S...
if ( req . hasId ( ) ) { throw new HelloSignException ( "Sending an existing signature request is not supported" ) ; } return new SignatureRequest ( httpClient . withAuth ( auth ) . withPostFields ( req . getPostFields ( ) ) . post ( BASE_URI + SIGNATURE_REQUEST_SEND_URI ) . asJson ( ) ) ;
public class BookRef { /** * Ordered by domain , path . */ public int compareTo ( BookRef o ) { } }
int diff = domain . compareTo ( o . domain ) ; if ( diff != 0 ) return diff ; return path . compareTo ( o . path ) ;
public class ZPoller { /** * filters items to get the first one matching the criteria , or null if none found */ protected PollItem filter ( final Object socketOrChannel , int events ) { } }
if ( socketOrChannel == null ) { return null ; } CompositePollItem item = items . get ( socketOrChannel ) ; if ( item == null ) { return null ; } PollItem pollItem = item . item ( ) ; if ( pollItem == null ) { return null ; } if ( pollItem . hasEvent ( events ) ) { return pollItem ; } return null ;
public class NIODirectorySocket { /** * { @ inheritDoc } */ @ Override public boolean connect ( InetSocketAddress address ) { } }
nioThread = new NIOThread ( address ) ; nioThread . start ( ) ; isConnecting = true ; long timeToSleep = this . connectTimeOut ; if ( LOGGER . isTraceEnabled ( ) ) { LOGGER . trace ( "NIO connect go to sleep - " + timeToSleep ) ; } while ( isConnecting && timeToSleep > 0 ) { long now = System . currentTimeMillis ( ) ; ...
public class CoreZK { /** * Checks if the cluster suffered an aborted join or node shutdown and is still in the process of cleaning up . * @ param zk ZooKeeper client * @ return true if the cluster is still cleaning up . * @ throws KeeperException * @ throws InterruptedException */ public static boolean isParti...
List < String > children = zk . getChildren ( VoltZK . leaders_initiators , null ) ; List < ZKUtil . ChildrenCallback > childrenCallbacks = Lists . newArrayList ( ) ; for ( String child : children ) { ZKUtil . ChildrenCallback callback = new ZKUtil . ChildrenCallback ( ) ; zk . getChildren ( ZKUtil . joinZKPath ( VoltZ...
public class TileSetBundler { /** * Creates a tileset bundle at the location specified by the * < code > targetPath < / code > parameter , based on the description * provided via the < code > bundleDesc < / code > parameter . * @ param idBroker the tileset id broker that will be used to map * tileset names to t...
createBundle ( idBroker , bundleDesc , new File ( targetPath ) ) ;
public class AbstractChart { /** * Adiciona uma serie * @ param serie Add serie of chart * @ return AbstractChart */ public AbstractChart < T , S > addSerie ( Serie serie ) { } }
Collection < Serie > series = getSeries ( ) ; if ( series == null ) { series = new ArrayList < Serie > ( ) ; } series . add ( serie ) ; return this ;
public class LoggerCreator { /** * Extract the logging level from the system properties . * @ return the logging level . */ public static Level getLoggingLevelFromProperties ( ) { } }
if ( levelFromProperties == null ) { final String verboseLevel = JanusConfig . getSystemProperty ( JanusConfig . VERBOSE_LEVEL_NAME , JanusConfig . VERBOSE_LEVEL_VALUE ) ; levelFromProperties = parseLoggingLevel ( verboseLevel ) ; } return levelFromProperties ;
public class NounFeats { /** * getter for gender - gets Gender , C * @ generated * @ return value of the feature */ public String getGender ( ) { } }
if ( NounFeats_Type . featOkTst && ( ( NounFeats_Type ) jcasType ) . casFeat_gender == null ) jcasType . jcas . throwFeatMissing ( "gender" , "de.julielab.jules.types.NounFeats" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( NounFeats_Type ) jcasType ) . casFeatCode_gender ) ;
public class QueryAtomContainer { /** * { @ inheritDoc } */ @ Override public Iterable < IStereoElement > stereoElements ( ) { } }
return new Iterable < IStereoElement > ( ) { @ Override public Iterator < IStereoElement > iterator ( ) { return stereoElements . iterator ( ) ; } } ;
public class AnnotationMetadataWriter { /** * Writes out the byte code necessary to instantiate the given { @ link DefaultAnnotationMetadata } . * @ param owningType The owning type * @ param declaringClassWriter The declaring class writer * @ param generatorAdapter The generator adapter * @ param annotationMet...
instantiateInternal ( owningType , declaringClassWriter , generatorAdapter , annotationMetadata , true , loadTypeMethods ) ;
public class SwiftAPIClient { /** * Swift has a bug where container listing might wrongly report size 0 * for large objects . It ' s seems to be a well known issue in Swift without * solution . * We have to provide work around for this . * If container listing reports size 0 for some object , we send * additi...
long objectSize = tmp . getContentLength ( ) ; if ( objectSize == 0 ) { // we may hit a well known Swift bug . // container listing reports 0 for large objects . StoredObject soDirect = cObj . getObject ( tmp . getName ( ) ) ; long contentLength = soDirect . getContentLength ( ) ; if ( contentLength > 0 ) { tmp . setCo...
public class MultiThreadedPOWEngine { /** * This method will block until all pending nonce calculations are done , but not wait for its own calculation * to finish . * ( This implementation becomes very inefficient if multiple nonce are calculated at the same time . ) * @ param initialHash the SHA - 512 hash of t...
waiterPool . execute ( new Runnable ( ) { @ Override public void run ( ) { long startTime = System . currentTimeMillis ( ) ; int cores = Runtime . getRuntime ( ) . availableProcessors ( ) ; if ( cores > 255 ) cores = 255 ; LOG . info ( "Doing POW using " + cores + " cores" ) ; List < Worker > workers = new ArrayList < ...
public class ByteBufUtil { /** * Writes a big - endian 24 - bit medium integer to the buffer . */ @ SuppressWarnings ( "deprecation" ) public static ByteBuf writeMediumBE ( ByteBuf buf , int mediumValue ) { } }
return buf . order ( ) == ByteOrder . BIG_ENDIAN ? buf . writeMedium ( mediumValue ) : buf . writeMediumLE ( mediumValue ) ;
public class Matrix4d { /** * Apply a symmetric orthographic projection transformation for a left - handed coordinate system * using the given NDC z range to this matrix and store the result in < code > dest < / code > . * This method is equivalent to calling { @ link # orthoLH ( double , double , double , double ,...
if ( ( properties & PROPERTY_IDENTITY ) != 0 ) return dest . setOrthoSymmetricLH ( width , height , zNear , zFar , zZeroToOne ) ; return orthoSymmetricLHGeneric ( width , height , zNear , zFar , zZeroToOne , dest ) ;
public class OperationValidator { /** * { @ inheritDoc } */ @ Override public void validate ( ValidationHelper helper , Context context , String key , Operation t ) { } }
if ( t != null ) { final String id = t . getOperationId ( ) ; if ( id != null && helper . addOperationId ( id ) ) { final String message = Tr . formatMessage ( tc , "operationIdsMustBeUnique" , id ) ; helper . addValidationEvent ( new ValidationEvent ( Severity . ERROR , context . getLocation ( "operationId" ) , messag...
public class Encoding { /** * Returns the canonical mime name for the given character encoding . * @ param encoding character encoding name , possibly an alias * @ return canonical mime name for the encoding . */ public static String getMimeName ( String encoding ) { } }
if ( encoding == null ) return null ; String value = _mimeName . get ( encoding ) ; if ( value != null ) return value ; String upper = normalize ( encoding ) ; String lookup = _mimeName . get ( upper ) ; value = lookup == null ? upper : lookup ; _mimeName . put ( encoding , value ) ; return value ;
public class AbstractProject { /** * Schedules a build of this project , and returns a { @ link Future } object * to wait for the completion of the build . */ @ WithBridgeMethods ( Future . class ) public QueueTaskFuture < R > scheduleBuild2 ( int quietPeriod , Cause c ) { } }
return scheduleBuild2 ( quietPeriod , c , new Action [ 0 ] ) ;
public class DatamappingHelper { /** * Find a datamapping to create an element based on class annotation , uses static cache . * @ param clazz * @ return */ public static List < ElementConfig > getElements ( Class clazz ) { } }
if ( ! cacheEC . containsKey ( clazz ) ) { cacheEC . put ( clazz , new ArrayList < > ( 1 ) ) ; Element e = ( Element ) clazz . getAnnotation ( Element . class ) ; if ( e != null ) { cacheEC . get ( clazz ) . add ( fromAnnotation ( e ) ) ; } Elements es = ( Elements ) clazz . getAnnotation ( com . vectorprint . report ....
public class PdfContentParser { /** * Reads a pdf object . * @ return the pdf object * @ throws IOException on error */ public PdfObject readPRObject ( ) throws IOException { } }
if ( ! nextValidToken ( ) ) return null ; int type = tokeniser . getTokenType ( ) ; switch ( type ) { case PRTokeniser . TK_START_DIC : { PdfDictionary dic = readDictionary ( ) ; return dic ; } case PRTokeniser . TK_START_ARRAY : return readArray ( ) ; case PRTokeniser . TK_STRING : PdfString str = new PdfString ( toke...
public class DurationFormatUtils { /** * < p > Converts a { @ code long } to a { @ code String } with optional * zero padding . < / p > * @ param value the value to convert * @ param padWithZeros whether to pad with zeroes * @ param count the size to pad to ( ignored if { @ code padWithZeros } is false ) * @ ...
final String longString = Long . toString ( value ) ; return padWithZeros ? StringUtils . leftPad ( longString , count , '0' ) : longString ;
public class CommercePriceListUtil { /** * Returns an ordered range of all the commerce price lists where commerceCurrencyId = & # 63 ; . * Useful when paginating results . Returns a maximum of < code > end - start < / code > instances . < code > start < / code > and < code > end < / code > are not primary keys , the...
return getPersistence ( ) . findByCommerceCurrencyId ( commerceCurrencyId , start , end , orderByComparator ) ;
public class SearchCriteria { /** * Sets the specified ordering criteria to sort the result objects . * < p > If the specified list is null or empty , * it clears the previous list . * If one of the element in the list is null , * the previous list is not modified and an exception is thrown . * @ param orders...
if ( orders == getOrders ( ) ) { return this ; } if ( orders == null || orders . size ( ) == 0 ) { clearOrders ( ) ; return this ; } synchronized ( orders ) { for ( Order order : orders ) { if ( order == null ) { throw new IllegalArgumentException ( "null element" ) ; } } clearOrders ( ) ; for ( Order order : orders ) ...
public class ImageCreator { /** * Must be called before loading images . * Initializes a new { @ link Picasso } instance as well as the * { @ link ArrayList } of { @ link InstructionTarget } . * @ param context to init Picasso */ public void initialize ( Context context ) { } }
if ( ! isInitialized ) { initializePicasso ( context ) ; initializeData ( context ) ; isInitialized = true ; }
public class SRTServletRequest { /** * Note for MultiRead : * If this is the first call - register an observer to get a notification ( alertClose ( ) ) when input stream is closed . * If the is first call after alerClose , restart the input stream . This will cause a notification ( alertOpen ( ) ) that the input st...
if ( TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . logp ( Level . FINE , CLASS_NAME , "getReader" , "this->" + this + ": gotInputStream = " + _srtRequestHelper . _gotInputStream ) ; } if ( WCCustomProperties . CHECK_REQUEST_OBJECT_IN_USE ) { checkRequestObjectInUse ( ) ; ...
public class PropertiesMigrationReport { /** * Return a report for all the properties that are no longer supported . If no such * properties were found , return { @ code null } . * @ return a report with the configurations keys that are no longer supported */ public String getErrorReport ( ) { } }
Map < String , List < PropertyMigration > > content = getContent ( LegacyProperties :: getUnsupported ) ; if ( content . isEmpty ( ) ) { return null ; } StringBuilder report = new StringBuilder ( ) ; report . append ( String . format ( "%nThe use of configuration keys that are no longer " + "supported was found in the ...
public class CmsTypesTab { /** * Updates the type mode switch . < p > */ protected void updateTypeModeToggle ( ) { } }
m_typeModeToggle . setVisible ( false ) ; if ( m_types != null ) { for ( CmsResourceTypeBean type : m_types . values ( ) ) { if ( type . getVisibility ( ) == TypeVisibility . showOptional ) { m_typeModeToggle . setVisible ( true ) ; return ; } } }
public class FSATraversal { /** * Finds a matching path in the dictionary for a given sequence of labels from * < code > sequence < / code > and starting at node < code > node < / code > . * @ param sequence Input sequence to look for in the automaton . * @ param start Start index in the sequence array . * @ pa...
return match ( new MatchResult ( ) , sequence , start , length , node ) ;