signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class KeyEncoder { /** * Encodes the given optional BigInteger into a variable amount of bytes * for descending order . If the BigInteger is null , exactly 1 byte is * written . Otherwise , the amount written can be determined by calling * calculateEncodedLength . * @ param value BigInteger value to enco...
/* Encoding of first byte : 0x00 : null high ( unused ) 0x01 : positive signum ; four bytes follow for value length 0x02 . . 0x7f : positive signum ; value length 7e range , 1 . . 126 0x80 . . 0xfd : negative signum ; value length 7e range , 1 . . 126 0xfe : negative signum ; four bytes follow for value lengt...
public class FrameworkUtils { /** * find work object specified by name , create and attach it if not exists */ static Object workObject ( Map < String , Object > workList , String name , boolean isArray ) { } }
logger . trace ( "get working object for {}" , name ) ; if ( workList . get ( name ) != null ) return workList . get ( name ) ; else { String [ ] parts = splitName ( name ) ; // parts : ( parent , name , isArray ) Map < String , Object > parentObj = ( Map < String , Object > ) workObject ( workList , parts [ 0 ] , fals...
public class SimpleASCIITableImpl { /** * Each string item rendering requires the border and a space on both sides . * 12 3 12 3 12 34 * abc venkat last * @ param colCount * @ param colMaxLenList * @ param data * @ return */ private String getRowLineBuf ( int colCount , List < Integer > colMaxLenList , Stri...
StringBuilder rowBuilder = new StringBuilder ( ) ; int colWidth = 0 ; for ( int i = 0 ; i < colCount ; i ++ ) { colWidth = colMaxLenList . get ( i ) + 3 ; for ( int j = 0 ; j < colWidth ; j ++ ) { if ( j == 0 ) { rowBuilder . append ( "+" ) ; } else if ( ( i + 1 == colCount && j + 1 == colWidth ) ) { // for last column...
public class Cache { /** * List all objects in the cache . * @ return the list */ @ Override public List < ApiType > list ( ) { } }
lock . lock ( ) ; try { List < ApiType > itemList = new ArrayList < > ( this . items . size ( ) ) ; for ( Map . Entry < String , ApiType > entry : this . items . entrySet ( ) ) { itemList . add ( entry . getValue ( ) ) ; } return itemList ; } finally { lock . unlock ( ) ; }
public class ErrorPageFilter { /** * Return the description for the given request . By default this method will return a * description based on the request { @ code servletPath } and { @ code pathInfo } . * @ param request the source request * @ return the description * @ since 1.5.0 */ protected String getDesc...
String pathInfo = ( request . getPathInfo ( ) != null ) ? request . getPathInfo ( ) : "" ; return "[" + request . getServletPath ( ) + pathInfo + "]" ;
public class Http2ClientChannel { /** * Adds a in - flight message . * @ param streamId stream id * @ param inFlightMessage { @ link OutboundMsgHolder } which holds the in - flight message */ public void putInFlightMessage ( int streamId , OutboundMsgHolder inFlightMessage ) { } }
if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( "In flight message added to channel: {} with stream id: {} " , this , streamId ) ; } inFlightMessages . put ( streamId , inFlightMessage ) ;
public class ApiUtilDAODefaultImpl { public int pending_asynch_call ( final DeviceProxy dev , final int reply_model ) { } }
int cnt = 0 ; final Enumeration _enum = async_request_table . keys ( ) ; while ( _enum . hasMoreElements ( ) ) { int n = ( Integer ) _enum . nextElement ( ) ; final AsyncCallObject aco = async_request_table . get ( n ) ; if ( aco . dev == dev && ( reply_model == ApiDefs . ALL_ASYNCH || aco . reply_model == reply_model ...
public class X509Factory { /** * Returns a ( possibly empty ) collection view of X . 509 CRLs read * from the given input stream < code > is < / code > . * @ param is the input stream with the CRLs . * @ return a ( possibly empty ) collection view of X . 509 CRL objects * initialized with the data from the inpu...
if ( is == null ) { throw new CRLException ( "Missing input stream" ) ; } try { return parseX509orPKCS7CRL ( is ) ; } catch ( IOException ioe ) { throw new CRLException ( ioe . getMessage ( ) ) ; }
public class DescribeRepositoriesRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DescribeRepositoriesRequest describeRepositoriesRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( describeRepositoriesRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( describeRepositoriesRequest . getRegistryId ( ) , REGISTRYID_BINDING ) ; protocolMarshaller . marshall ( describeRepositoriesRequest . getRepositoryNames ( )...
public class Runner { /** * Write the following job details as a JSON encoded file : runtime environment * job ID , runtime , parameters , and accumulators . * @ param env the execution environment * @ param jobDetailsPath filesystem path to write job details * @ throws IOException on error writing to jobDetail...
JobExecutionResult result = env . getLastJobExecutionResult ( ) ; File jsonFile = new File ( jobDetailsPath ) ; try ( JsonGenerator json = new JsonFactory ( ) . createGenerator ( jsonFile , JsonEncoding . UTF8 ) ) { json . writeStartObject ( ) ; json . writeObjectFieldStart ( "Apache Flink" ) ; json . writeStringField ...
public class PermissionAwareCrudService { /** * This method returns a { @ link Map } that maps { @ link PersistentObject } s * to PermissionCollections for the passed { @ link User } . I . e . the keySet * of the map is the collection of all { @ link PersistentObject } s where the * user has at least one permissi...
return dao . findAllUserPermissionsOfUser ( user ) ;
public class AppIdNamespace { /** * Converts an encoded appId / namespace to { @ link AppIdNamespace } . * < p > Only one form of an appId / namespace pair will be allowed . i . e . " app ! " * is an illegal form and must be encoded as " app " . * < p > An appId / namespace pair may contain at most one " ! " char...
if ( encodedAppIdNamespace == null ) { throw new IllegalArgumentException ( "appIdNamespaceString may not be null" ) ; } int index = encodedAppIdNamespace . indexOf ( NamespaceResources . NAMESPACE_SEPARATOR ) ; if ( index == - 1 ) { return new AppIdNamespace ( encodedAppIdNamespace , "" ) ; } String appId = encodedApp...
public class GetLifecyclePoliciesResult { /** * Summary information about the lifecycle policies . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setPolicies ( java . util . Collection ) } or { @ link # withPolicies ( java . util . Collection ) } if you want...
if ( this . policies == null ) { setPolicies ( new java . util . ArrayList < LifecyclePolicySummary > ( policies . length ) ) ; } for ( LifecyclePolicySummary ele : policies ) { this . policies . add ( ele ) ; } return this ;
public class LdaGibbsSampler { /** * Main method : Select initial state ? Repeat a large number of times : 1. * Select an element 2 . Update conditional on other elements . If * appropriate , output summary for each run . * @ param K * number of topics * @ param alpha * symmetric prior parameter on document...
this . K = K ; this . alpha = alpha ; this . beta = beta ; // init sampler statistics if ( SAMPLE_LAG > 0 ) { thetasum = new float [ documents . length ] [ K ] ; phisum = new float [ K ] [ V ] ; numstats = 0 ; } // initial state of the Markov chain : initialState ( K ) ; System . out . println ( "Sampling " + ITERATION...
public class Config { /** * Returns the { @ code channel } as a { @ link ConfigurableChannel } . * @ throws IllegalArgumentException if { @ code channel } was not created by Lyra */ public static ConfigurableChannel of ( Channel channel ) { } }
Assert . isTrue ( channel instanceof ConfigurableChannel , "The channel {} was not created by Lyra" , channel ) ; return ( ConfigurableChannel ) channel ;
public class LogWriter { /** * Initializes the log writer on basis of the given log format . < br > * It ensures the proper creation of the output file and writes the file header . * @ param logFormat * @ throws IOException if output file creation or header writing cause an exception . * @ throws CompatibilityE...
setLogFormat ( logFormat ) ; try { setEOLString ( EOLType . LF ) ; } catch ( ParameterException e ) { // Is only thrown if setEOLString ( ) is called with a null - parameter . // Cannot happen , since EOLType . LF is not null throw new RuntimeException ( e ) ; }
public class EventsHelper { /** * Bind a function to the unload event of each matched element . * @ param jsScope * Scope to use * @ return the jQuery code */ public static ChainableStatement unload ( JsScope jsScope ) { } }
return new DefaultChainableStatement ( StateEvent . UNLOAD . getEventLabel ( ) , jsScope . render ( ) ) ;
public class FixedLengthRecordSorter { @ Override public int compare ( int i , int j ) { } }
final int segmentNumberI = i / this . recordsPerSegment ; final int segmentOffsetI = ( i % this . recordsPerSegment ) * this . recordSize ; final int segmentNumberJ = j / this . recordsPerSegment ; final int segmentOffsetJ = ( j % this . recordsPerSegment ) * this . recordSize ; return compare ( segmentNumberI , segmen...
public class SelfAssignment { /** * We expect that the lhs is a field and the rhs is an identifier , specifically a parameter to the * method . We base our suggested fixes on this expectation . * < p > Case 1 : If lhs is a field and rhs is an identifier , find a method parameter of the same type * and similar nam...
// the statement that is the parent of the self - assignment expression Tree parent = state . getPath ( ) . getParentPath ( ) . getLeaf ( ) ; // default fix is to delete assignment Fix fix = SuggestedFix . delete ( parent ) ; ExpressionTree lhs = assignmentTree . getVariable ( ) ; ExpressionTree rhs = assignmentTree . ...
public class AWSElasticBeanstalkClient { /** * Checks if the specified CNAME is available . * @ param checkDNSAvailabilityRequest * Results message indicating whether a CNAME is available . * @ return Result of the CheckDNSAvailability operation returned by the service . * @ sample AWSElasticBeanstalk . CheckDN...
request = beforeClientExecution ( request ) ; return executeCheckDNSAvailability ( request ) ;
public class InjectorConfiguration { /** * Defines that instead of the class / interface passed in abstractDefinition , the class specified in * implementationDefinition should be used . The specified replacement class must be defined as injectable . * @ param abstractDefinition the abstract class or interface to r...
if ( abstractDefinition . equals ( Injector . class ) ) { throw new DependencyInjectionFailedException ( "Cowardly refusing to define a global alias for Injector since that would lead to a Service Locator pattern. If you need the injector, please define it on a per-class or per-method basis." ) ; } // noinspection unch...
public class UnderFileSystemConfiguration { /** * Creates a new instance from the current configuration and adds in new properties . * @ param mountConf the mount specific configuration map * @ return the updated configuration object */ public UnderFileSystemConfiguration createMountSpecificConf ( Map < String , St...
UnderFileSystemConfiguration ufsConf = new UnderFileSystemConfiguration ( mProperties . copy ( ) ) ; ufsConf . mProperties . merge ( mountConf , Source . MOUNT_OPTION ) ; ufsConf . mReadOnly = mReadOnly ; ufsConf . mShared = mShared ; return ufsConf ;
public class UIInput { /** * < p > Remove a { @ link Validator } instance from the set associated with * this { @ link UIInput } , if it was previously associated . * Otherwise , do nothing . < / p > * @ param validator The { @ link Validator } to remove */ public void removeValidator ( Validator validator ) { } ...
if ( validator == null ) { return ; } if ( validators != null ) { validators . remove ( validator ) ; }
public class PartitionLevelWatermarker { /** * Sets the actual high watermark by reading the expected high watermark * { @ inheritDoc } * @ see org . apache . gobblin . data . management . conversion . hive . watermarker . HiveSourceWatermarker # setActualHighWatermark ( org . apache . gobblin . configuration . Wor...
if ( Boolean . valueOf ( wus . getPropAsBoolean ( IS_WATERMARK_WORKUNIT_KEY ) ) ) { wus . setActualHighWatermark ( wus . getWorkunit ( ) . getExpectedHighWatermark ( MultiKeyValueLongWatermark . class ) ) ; } else { wus . setActualHighWatermark ( wus . getWorkunit ( ) . getExpectedHighWatermark ( LongWatermark . class ...
public class Utils { /** * Access the specified class as a resource accessible through the specified loader and return the bytes . The * classname should be ' dot ' separated ( eg . com . foo . Bar ) and not suffixed . class * @ param loader the classloader against which getResourceAsStream ( ) will be invoked * ...
if ( GlobalConfiguration . assertsMode ) { if ( slashedclassname . endsWith ( ".class" ) ) { throw new IllegalStateException ( ".class suffixed name should not be passed:" + slashedclassname ) ; } if ( slashedclassname . indexOf ( '.' ) != - 1 ) { throw new IllegalStateException ( "Should be a slashed name, no dots:" +...
public class CompareExpression { /** * { @ inheritDoc } */ @ Override public Condition build ( ) { } }
switch ( type ) { case EQUAL : return new Equal ( trigger , value ) ; case NOT_EQUAL : return new NotEqual ( trigger , value ) ; case LESS_THAN : return new LessThan ( trigger , value ) ; case LESS_THAN_OR_EQUAL : return new LessThanOrEqual ( trigger , value ) ; case GREATER_THAN : return new GreaterThan ( trigger , va...
public class LuceneIndex { /** * Deletes all the { @ link Document } s satisfying the specified { @ link Query } . * @ param query The { @ link Query } to identify the documents to be deleted . */ public void delete ( Query query ) { } }
Log . debug ( "Deleting by query %s" , query ) ; try { indexWriter . deleteDocuments ( query ) ; } catch ( IOException e ) { Log . error ( e , "Error while deleting by query %s" , query ) ; throw new RuntimeException ( e ) ; }
public class AppServiceEnvironmentsInner { /** * Resume an App Service Environment . * Resume an App Service Environment . * @ param resourceGroupName Name of the resource group to which the resource belongs . * @ param name Name of the App Service Environment . * @ throws IllegalArgumentException thrown if par...
syncVirtualNetworkInfoWithServiceResponseAsync ( resourceGroupName , name ) . toBlocking ( ) . single ( ) . body ( ) ;
public class AWSGreengrassClient { /** * Retrieves the role associated with a particular group . * @ param getAssociatedRoleRequest * @ return Result of the GetAssociatedRole operation returned by the service . * @ throws BadRequestException * invalid request * @ throws InternalServerErrorException * server...
request = beforeClientExecution ( request ) ; return executeGetAssociatedRole ( request ) ;
public class CPDefinitionGroupedEntryPersistenceImpl { /** * Returns all the cp definition grouped entries . * @ return the cp definition grouped entries */ @ Override public List < CPDefinitionGroupedEntry > findAll ( ) { } }
return findAll ( QueryUtil . ALL_POS , QueryUtil . ALL_POS , null ) ;
public class LogicalZipFile { /** * Extract a value from the manifest , and return the value as a string , along with the index after the * terminating newline . Manifest files support three different line terminator types , and entries can be split * across lines with a line terminator followed by a space . * @ ...
// See if manifest entry is split across multiple lines int curr = startIdx ; final int len = manifest . length ; while ( curr < len && manifest [ curr ] == ( byte ) ' ' ) { // Skip initial spaces curr ++ ; } final int firstNonSpaceIdx = curr ; boolean isMultiLine = false ; for ( ; curr < len && ! isMultiLine ; curr ++...
public class CommentImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public Object eGet ( int featureID , boolean resolve , boolean coreType ) { } }
switch ( featureID ) { case AfplibPackage . COMMENT__COMMENT : return getComment ( ) ; } return super . eGet ( featureID , resolve , coreType ) ;
public class SocketIOServer { /** * Starts Socket . IO server with current configuration settings . * @ throws IllegalStateException * if server already started */ public synchronized void start ( ) { } }
if ( isStarted ( ) ) { throw new IllegalStateException ( "Failed to start Socket.IO server: server already started" ) ; } log . info ( "Socket.IO server starting" ) ; // Configure heartbeat scheduler timer = new HashedWheelTimer ( ) ; timer . start ( ) ; SocketIOHeartbeatScheduler . setHashedWheelTimer ( timer ) ; Sock...
public class NikeFS2LazyRandomAccessStorageImpl { /** * ( non - Javadoc ) * @ see * org . processmining . framework . log . rfb . fsio . FS2RandomAccessStorage # write * ( byte [ ] , int , int ) */ @ Override public synchronized void write ( byte [ ] b , int off , int len ) throws IOException { } }
consolidateSoftCopy ( ) ; alertSoftCopies ( ) ; super . write ( b , off , len ) ;
public class Utils { /** * Compare two docs fast if they are the same , excluding exclusions * @ return true if documents are different */ public static boolean fastCompareDocs ( JsonNode sourceDocument , JsonNode destinationDocument , List < String > exclusionPaths , boolean ignoreTimestampMSDiffs ) { } }
try { JsonDiff diff = new JsonDiff ( ) ; diff . setOption ( JsonDiff . Option . ARRAY_ORDER_INSIGNIFICANT ) ; diff . setOption ( JsonDiff . Option . RETURN_LEAVES_ONLY ) ; diff . setFilter ( new AbstractFieldFilter ( ) { public boolean includeField ( List < String > fieldName ) { return ! fieldName . get ( fieldName . ...
public class NamespaceBlock { /** * Creates a new instance of { @ link NamespaceBlock } using * { @ link Properties block properties } . * @ param resourceLocation the { @ link String resource location } of the * namespace used for exception reporting ; which cannot be { @ code null } * @ param blockProperties ...
if ( resourceLocation == null ) { throw new InvalidArgument ( "resourceLocation" , resourceLocation ) ; } if ( blockProperties == null ) { throw new InvalidArgument ( "blockProperties" , blockProperties ) ; } // handle blank keyword String keyword = blockProperties . getProperty ( PROPERTY_KEYWORD ) ; if ( StringUtils ...
public class Serializer { /** * Serializes output to a core data type object * @ param out * Output writer * @ param any * Object to serialize */ public static void serialize ( Output out , Object any ) { } }
Serializer . serialize ( out , null , null , null , any ) ;
public class AbstractReferencedValueMap { /** * Reallocates the array being used within toArray when the iterator * returned more elements than expected , and finishes filling it from * the iterator . * @ param < T > the type of the elements in the array . * @ param array the array , replete with previously sto...
T [ ] rp = array ; int i = rp . length ; while ( it . hasNext ( ) ) { final int cap = rp . length ; if ( i == cap ) { int newCap = ( ( cap / 2 ) + 1 ) * 3 ; if ( newCap <= cap ) { // integer overflow if ( cap == Integer . MAX_VALUE ) { throw new OutOfMemoryError ( ) ; } newCap = Integer . MAX_VALUE ; } rp = Arrays . co...
public class BurpSuiteTab { /** * Highlights the tab using Burp ' s color scheme . The highlight disappears * after 3 seconds . */ public void highlight ( ) { } }
final JTabbedPane parent = ( JTabbedPane ) this . getUiComponent ( ) . getParent ( ) ; // search through tabs until we find this one for ( int i = 0 ; i < parent . getTabCount ( ) ; i ++ ) { String title = parent . getTitleAt ( i ) ; if ( getTabCaption ( ) . equals ( title ) ) { // found this tab // create new colored ...
public class TypeAnnotationPosition { /** * Create a { @ code TypeAnnotationPosition } for a throws clause . * @ param location The type path . * @ param onLambda The lambda for this variable . * @ param type _ index The index of the exception . * @ param pos The position from the associated tree node . */ publ...
return new TypeAnnotationPosition ( TargetType . THROWS , pos , Integer . MIN_VALUE , onLambda , type_index , Integer . MIN_VALUE , location ) ;
public class PhotosLicensesApi { /** * Sets the license for a photo . * < br > * This method requires authentication with ' write ' permission . * @ param photoId ( Required ) The photo to update the license for . * @ param licenseId ( Required ) The license to apply , or 0 ( zero ) to remove the current licens...
JinxUtils . validateParams ( photoId , licenseId ) ; Map < String , String > params = new TreeMap < > ( ) ; params . put ( "method" , "flickr.photos.licenses.setLicense" ) ; params . put ( "photo_id" , photoId ) ; params . put ( "license_id" , licenseId . toString ( ) ) ; return jinx . flickrPost ( params , Response . ...
public class FSNamesystem { /** * Persist all metadata about this file . * @ param src The string representation of the path * @ param clientName The string representation of the client * @ throws IOException if path does not exist */ void fsync ( String src , String clientName ) throws IOException { } }
NameNode . stateChangeLog . info ( "BLOCK* NameSystem.fsync: file " + src + " for " + clientName ) ; writeLock ( ) ; try { if ( isInSafeMode ( ) ) { throw new SafeModeException ( "Cannot fsync file " + src , safeMode ) ; } INodeFileUnderConstruction pendingFile = checkLease ( src , clientName ) ; // If the block has a ...
public class Origination { /** * The call distribution properties defined for your SIP hosts . Valid range : Minimum value of 1 . Maximum value of * 20. * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setRoutes ( java . util . Collection ) } or { @ link # w...
if ( this . routes == null ) { setRoutes ( new java . util . ArrayList < OriginationRoute > ( routes . length ) ) ; } for ( OriginationRoute ele : routes ) { this . routes . add ( ele ) ; } return this ;
public class BeanMappingExecutor { /** * 获取set操作的BatchExecutor */ private static BatchExecutor getSetBatchExecutor ( BeanMappingParam param , BeanMappingObject config ) { } }
BatchExecutor executor = config . getSetBatchExecutor ( ) ; if ( executor != null ) { // 如果已经生成 , 则直接返回 return executor ; } if ( canBatch ( config . getBehavior ( ) ) == false ) { config . setBatch ( false ) ; return null ; } // 处理target操作数据搜集 List < String > targetFields = new ArrayList < String > ( ) ; List < Class >...
public class CloseDownServiceImp { /** * ( non - Javadoc ) * @ see com . popbill . api . CloseDownService # CheckCorpNum */ @ Override public CorpState [ ] CheckCorpNum ( String MemberCorpNum , String [ ] CorpNumList ) throws PopbillException { } }
String PostData = toJsonString ( CorpNumList ) ; return httppost ( "/CloseDown" , MemberCorpNum , PostData , null , CorpState [ ] . class ) ;
public class RowKey { /** * Get the value of the specified column . * @ param columnName the name of the column * @ return the corresponding value of the column , { @ code null } if the column does not exist in the row key */ public Object getColumnValue ( String columnName ) { } }
for ( int j = 0 ; j < columnNames . length ; j ++ ) { if ( columnNames [ j ] . equals ( columnName ) ) { return columnValues [ j ] ; } } return null ;
public class AWSKafkaClient { /** * Returns a list of the broker nodes in the cluster . * @ param listNodesRequest * @ return Result of the ListNodes operation returned by the service . * @ throws NotFoundException * The resource could not be found due to incorrect input . Correct your request and then retry it...
request = beforeClientExecution ( request ) ; return executeListNodes ( request ) ;
public class JmsSessionImpl { /** * Indicates if the session is managed . < p > * ( i . e . running in the application server ) . */ boolean isManaged ( ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "isManaged" ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "isManaged" , isManaged ) ; return isManaged ;
public class Buffer { /** * Copy { @ code byteCount } bytes from this , starting at { @ code offset } , to * { @ code out } . */ public Buffer copyTo ( OutputStream out , long offset , long byteCount ) throws IOException { } }
if ( out == null ) throw new IllegalArgumentException ( "out == null" ) ; checkOffsetAndCount ( size , offset , byteCount ) ; if ( byteCount == 0 ) return this ; // Skip segments that we aren ' t copying from . Segment s = head ; for ( ; offset >= ( s . limit - s . pos ) ; s = s . next ) { offset -= ( s . limit - s . p...
public class JavaParser { /** * Parses the Java code contained in a { @ link File } and returns a * { @ link CompilationUnit } that represents it . * @ param file * { @ link File } containing Java source code * @ param encoding * encoding of the source code * @ return CompilationUnit representing the Java s...
FileInputStream in = new FileInputStream ( file ) ; try { return parse ( in , encoding ) ; } finally { in . close ( ) ; }
public class LibUtils { /** * Obtain an input stream to the resource with the given name , and write * it to the specified file ( which may not be < code > null < / code > , and * may not exist yet ) * @ param resourceName The name of the resource * @ param file The file to write to * @ throws NullPointerExce...
if ( file == null ) { throw new NullPointerException ( "Target file may not be null" ) ; } if ( file . exists ( ) ) { throw new IllegalArgumentException ( "Target file already exists: " + file ) ; } InputStream inputStream = LibUtils . class . getResourceAsStream ( resourceName ) ; if ( inputStream == null ) { throw ne...
public class ObjectOperation { /** * Returns a new instance of MapperConstructor * @ param dName destination name * @ return the mapper */ private MapperConstructor getMapper ( String dName ) { } }
return new MapperConstructor ( destinationType ( ) , sourceType ( ) , dName , dName , getSName ( ) , configChosen , xml , methodsToGenerate ) ;
public class Strings { /** * Compare two strings . * Both or one of them may be null . * @ param me * @ param you * @ return true if object equals or intern = = , else false . */ public static boolean compare ( final String me , final String you ) { } }
// If both null or intern equals if ( me == you ) return true ; // if me null and you are not if ( me == null && you != null ) return false ; // me will not be null , test for equality return me . equals ( you ) ;
public class GetResourceMetricsRequest { /** * An array of one or more queries to perform . Each query must specify a Performance Insights metric , and can * optionally specify aggregation and filtering criteria . * @ param metricQueries * An array of one or more queries to perform . Each query must specify a Per...
if ( metricQueries == null ) { this . metricQueries = null ; return ; } this . metricQueries = new java . util . ArrayList < MetricQuery > ( metricQueries ) ;
public class CPRulePersistenceImpl { /** * Returns the cp rule with the primary key or throws a { @ link com . liferay . portal . kernel . exception . NoSuchModelException } if it could not be found . * @ param primaryKey the primary key of the cp rule * @ return the cp rule * @ throws NoSuchCPRuleException if a ...
CPRule cpRule = fetchByPrimaryKey ( primaryKey ) ; if ( cpRule == null ) { if ( _log . isDebugEnabled ( ) ) { _log . debug ( _NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey ) ; } throw new NoSuchCPRuleException ( _NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey ) ; } return cpRule ;
public class ClusterNodeInfo { /** * Returns true if field corresponding to fieldID is set ( has been assigned a value ) and false otherwise */ public boolean isSet ( _Fields field ) { } }
if ( field == null ) { throw new IllegalArgumentException ( ) ; } switch ( field ) { case NAME : return isSetName ( ) ; case ADDRESS : return isSetAddress ( ) ; case TOTAL : return isSetTotal ( ) ; case FREE : return isSetFree ( ) ; case RESOURCE_INFOS : return isSetResourceInfos ( ) ; } throw new IllegalStateException...
public class StockholmFileParser { /** * # = GS & lt ; seqname & gt ; & lt ; feature & gt ; & lt ; Generic per - Sequence annotation , free text & gt ; * @ param line * the line to be parsed */ private void handleSequenceAnnotation ( String seqName , String featureName , String value ) { } }
if ( featureName . equals ( GS_ACCESSION_NUMBER ) ) { stockholmStructure . addGSAccessionNumber ( seqName , value ) ; } else if ( featureName . equals ( GS_DESCRIPTION ) ) { stockholmStructure . addGSDescription ( seqName , value ) ; } else if ( featureName . equals ( GS_DATABASE_REFERENCE ) ) { stockholmStructure . ad...
public class ReplayRelay { /** * Creates a size - bounded replay relay . * In this setting , the { @ code ReplayRelay } holds at most { @ code size } items in its internal buffer and * discards the oldest item . * When observers subscribe to a terminated { @ code ReplayRelay } , they are guaranteed to see at most...
return new ReplayRelay < T > ( new SizeBoundReplayBuffer < T > ( maxSize ) ) ;
public class TwitterExample { public static void main ( String [ ] args ) throws Exception { } }
// Checking input parameters final ParameterTool params = ParameterTool . fromArgs ( args ) ; System . out . println ( "Usage: TwitterExample [--output <path>] " + "[--twitter-source.consumerKey <key> --twitter-source.consumerSecret <secret> --twitter-source.token <token> --twitter-source.tokenSecret <tokenSecret>]" ) ...
public class StatementServiceImp { /** * ( non - Javadoc ) * @ see com . popbill . api . StatementService # updateEmailConfig ( java . lang . String , java . lang . String , java . lang . Boolean ) */ @ Override public Response updateEmailConfig ( String CorpNum , String EmailType , Boolean SendYN ) throws PopbillExc...
return updateEmailConfig ( CorpNum , EmailType , SendYN , null ) ;
public class SherlockListActivity { @ Override public void addContentView ( View view , LayoutParams params ) { } }
getSherlock ( ) . addContentView ( view , params ) ;
public class DeltaIterator { /** * converts utf - 8 encoded hex to int by building it digit by digit . */ private int getNumBlocks ( R delta ) { } }
ByteBuffer content = getValue ( delta ) ; int numBlocks = 0 ; // build numBlocks by adding together each hex digit for ( int i = 0 ; i < _prefixLength ; i ++ ) { byte b = content . get ( i ) ; numBlocks = numBlocks << 4 | ( b <= '9' ? b - '0' : b - 'A' + 10 ) ; } return numBlocks ;
public class BeangleFreemarkerManager { /** * The default template loader is a MultiTemplateLoader which includes * BeangleClassTemplateLoader ( classpath : ) and a WebappTemplateLoader * ( webapp : ) and FileTemplateLoader ( file : ) . All template path described * in init parameter templatePath or TemplatePlath...
// construct a FileTemplateLoader for the init - param ' TemplatePath ' String [ ] paths = split ( templatePath , "," ) ; List < TemplateLoader > loaders = CollectUtils . newArrayList ( ) ; for ( String path : paths ) { if ( path . startsWith ( "class://" ) ) { loaders . add ( new BeangleClassTemplateLoader ( substring...
public class GraphViz { /** * Writes the graph ' s image in a file . * @ param img * A byte array containing the image of the graph . * @ param file * Name of the file to where we want to write . * @ return Success : 1 , Failure : - 1 */ public int writeGraphToFile ( byte [ ] img , String file ) { } }
File to = new File ( file ) ; return writeGraphToFile ( img , to ) ;
public class DisassemblyTool { /** * Disassembles a class file , sending the results to standard out . * < pre > * DisassemblyTool [ - f & lt ; format style & gt ; ] & lt ; file or class name & gt ; * < / pre > * The format style may be " assembly " ( the default ) or " builder " . */ public static void main ( ...
if ( args . length == 0 ) { System . out . println ( "DisassemblyTool [-f <format style>] <file or class name>" ) ; System . out . println ( ) ; System . out . println ( "The format style may be \"assembly\" (the default) or \"builder\"" ) ; return ; } String style ; String name ; if ( "-f" . equals ( args [ 0 ] ) ) { ...
public class CmsAppHierarchyBuilder { /** * Builds the tree of categories and apps . < p > * This tree will only include those categories which are reachable by following the parent chain of * an available app configuration up to the root category ( null ) . * @ return the root node of the tree */ public CmsAppCa...
// STEP 0 : Initialize everything and sort categories by priority Collections . sort ( m_appCategoryList , new Comparator < I_CmsAppCategory > ( ) { public int compare ( I_CmsAppCategory cat1 , I_CmsAppCategory cat2 ) { return ComparisonChain . start ( ) . compare ( cat1 . getPriority ( ) , cat2 . getPriority ( ) ) . r...
public class MySQLPacketPayload { /** * Read lenenc integer from byte buffers . * @ see < a href = " https : / / dev . mysql . com / doc / internals / en / integer . html # packet - Protocol : : LengthEncodedInteger " > LengthEncodedInteger < / a > * @ return lenenc integer */ public long readIntLenenc ( ) { } }
int firstByte = readInt1 ( ) ; if ( firstByte < 0xfb ) { return firstByte ; } if ( 0xfb == firstByte ) { return 0 ; } if ( 0xfc == firstByte ) { return byteBuf . readShortLE ( ) ; } if ( 0xfd == firstByte ) { return byteBuf . readMediumLE ( ) ; } return byteBuf . readLongLE ( ) ;
public class AbstractDataDistributionType { /** * { @ inheritDoc } */ public Node getOrCreateDataNode ( Node rootNode , String dataId , String nodeType ) throws RepositoryException { } }
return getOrCreateDataNode ( rootNode , dataId , nodeType , null ) ;
public class ControlBeanContext { /** * / * package */ String getControlID ( ) { } }
if ( _controlID != null || _bean == null ) return _controlID ; // Initially set to the local beans relative ID String id = _bean . getLocalID ( ) ; // If there is a parent context , prepend its ID and the ID separator BeanContext bc = getBeanContext ( ) ; if ( bc != null && bc instanceof ControlBeanContext ) { String p...
public class Strman { /** * Count the number of times substr appears in value * @ param value input * @ param subStr search string * @ param caseSensitive whether search should be case sensitive * @ param allowOverlapping boolean to take into account overlapping * @ return count of times substring exists */ p...
validate ( value , NULL_STRING_PREDICATE , NULL_STRING_MSG_SUPPLIER ) ; return countSubstr ( caseSensitive ? value : value . toLowerCase ( ) , caseSensitive ? subStr : subStr . toLowerCase ( ) , allowOverlapping , 0L ) ;
public class DeviceUpdate { /** * Get the raw data bytes of the device update packet . * @ return the data sent by the device to update its status */ public byte [ ] getPacketBytes ( ) { } }
byte [ ] result = new byte [ packetBytes . length ] ; System . arraycopy ( packetBytes , 0 , result , 0 , packetBytes . length ) ; return result ;
public class SecurityFunctions { /** * Applies an AES decryption on the byte array { @ code cipherBytes } with they given key . The key has to be the same * key used during encryption , else null is returned * @ param cipherBytes the byte array to decrypt * @ param key the key to use during the decryption * @ r...
String plainText = null ; Security . addProvider ( new org . bouncycastle . jce . provider . BouncyCastleProvider ( ) ) ; try { Cipher cipher = Cipher . getInstance ( "AES" , "BC" ) ; cipher . init ( Cipher . DECRYPT_MODE , key ) ; byte [ ] bytePlainText = cipher . doFinal ( cipherBytes ) ; plainText = new String ( byt...
public class InternalXbaseWithAnnotationsParser { /** * InternalXbaseWithAnnotations . g : 2817:1 : ruleXSetLiteral returns [ EObject current = null ] : ( ( ) otherlv _ 1 = ' # ' otherlv _ 2 = ' { ' ( ( ( lv _ elements _ 3_0 = ruleXExpression ) ) ( otherlv _ 4 = ' , ' ( ( lv _ elements _ 5_0 = ruleXExpression ) ) ) * )...
EObject current = null ; Token otherlv_1 = null ; Token otherlv_2 = null ; Token otherlv_4 = null ; Token otherlv_6 = null ; EObject lv_elements_3_0 = null ; EObject lv_elements_5_0 = null ; enterRule ( ) ; try { // InternalXbaseWithAnnotations . g : 2823:2 : ( ( ( ) otherlv _ 1 = ' # ' otherlv _ 2 = ' { ' ( ( ( lv _ e...
public class ServiceCatalog { /** * < p > Setter for item . < / p > * @ param pItem reference */ @ Override public final void setItem ( final ServiceToSale pItem ) { } }
this . item = pItem ; if ( getItsId ( ) == null ) { setItsId ( new ServiceCatalogId ( ) ) ; } getItsId ( ) . setItem ( this . item ) ;
public class ExpressionFilter { /** * Determines if event matches the filter . * @ param event logging event ; * @ return { @ link Filter # NEUTRAL } is there is no string match . */ public int decide ( final LoggingEvent event ) { } }
if ( expressionRule . evaluate ( event , null ) ) { if ( acceptOnMatch ) { return Filter . ACCEPT ; } else { return Filter . DENY ; } } return Filter . NEUTRAL ;
public class GaliosFieldTableOps { /** * Performs polynomial division using a synthetic division algorithm . * < p > Coefficients for largest powers are first , e . g . 2 * x * * 3 + 8 * x * * 2 + 1 = [ 2,8,0,1 ] < / p > * @ param dividend ( Input ) Polynomial dividend * @ param divisor ( Input ) Polynomial divis...
// handle special case if ( divisor . size > dividend . size ) { remainder . setTo ( dividend ) ; quotient . resize ( 0 ) ; return ; } else { remainder . resize ( divisor . size - 1 ) ; quotient . setTo ( dividend ) ; } int normalizer = divisor . data [ 0 ] & 0xFF ; int N = dividend . size - divisor . size + 1 ; for ( ...
public class PhysicalEntityWrapper { /** * Get all related Conversions of the given Interaction set . * @ param inters Interactions to query * @ return Related Conversions */ private Set < Conversion > getRelatedConversions ( Collection < Interaction > inters ) { } }
Set < Conversion > set = new HashSet < Conversion > ( ) ; for ( Interaction inter : inters ) { if ( inter instanceof Conversion ) { set . add ( ( Conversion ) inter ) ; } else if ( inter instanceof Control ) { getRelatedConversions ( ( Control ) inter , set ) ; } } return set ;
public class CertUtil { /** * 用配置文件acp _ sdk . properties配置路径 加载银联公钥上级证书 ( 中级证书 ) */ private static void initEncryptCert ( ) { } }
LogUtil . writeLog ( "加载敏感信息加密证书==>" + SDKConfig . getConfig ( ) . getEncryptCertPath ( ) ) ; if ( ! isEmpty ( SDKConfig . getConfig ( ) . getEncryptCertPath ( ) ) ) { encryptCert = initCert ( SDKConfig . getConfig ( ) . getEncryptCertPath ( ) ) ; LogUtil . writeLog ( "Load EncryptCert Successful" ) ; } else { LogUtil ...
public class BlockBasedDataStoreTools { /** * Delete the filesystem of a store */ public static void delete ( String baseName , File dataFolder , boolean force ) throws DataStoreException { } }
File [ ] journalFiles = findJournalFiles ( baseName , dataFolder ) ; if ( journalFiles . length > 0 ) { if ( force ) { for ( int i = 0 ; i < journalFiles . length ; i ++ ) { if ( ! journalFiles [ i ] . delete ( ) ) throw new DataStoreException ( "Cannot delete file : " + journalFiles [ i ] . getAbsolutePath ( ) ) ; } }...
public class CProductPersistenceImpl { /** * Removes all the c products where groupId = & # 63 ; from the database . * @ param groupId the group ID */ @ Override public void removeByGroupId ( long groupId ) { } }
for ( CProduct cProduct : findByGroupId ( groupId , QueryUtil . ALL_POS , QueryUtil . ALL_POS , null ) ) { remove ( cProduct ) ; }
public class PresentationManager { /** * Executes a custom loader . */ private void customLoad ( ) { } }
final String s = getCfg ( ) . getProperty ( "custom-loader" ) ; if ( s != null ) { try { final CustomLoader customLoader = ( CustomLoader ) Class . forName ( s ) . newInstance ( ) ; logItem ( "Custom Loader" , s , "*" ) ; customLoader . execute ( this ) ; } catch ( ClassNotFoundException e ) { error = true ; logItem ( ...
public class Collections { /** * Returns a set backed by the specified map . The resulting set displays * the same ordering , concurrency , and performance characteristics as the * backing map . In essence , this factory method provides a { @ link Set } * implementation corresponding to any { @ link Map } impleme...
return new SetFromMap < > ( map ) ;
public class ProjectedCentroid { /** * Static Constructor from a relation . * @ param dims Dimensions to use ( indexed with 0) * @ param relation Relation to process * @ param ids IDs to process * @ return Centroid */ public static ProjectedCentroid make ( long [ ] dims , Relation < ? extends NumberVector > rel...
ProjectedCentroid c = new ProjectedCentroid ( dims , RelationUtil . dimensionality ( relation ) ) ; for ( DBIDIter iter = ids . iter ( ) ; iter . valid ( ) ; iter . advance ( ) ) { c . put ( relation . get ( iter ) ) ; } return c ;
public class TokenCompleteTextView { /** * Add the TextChangedListeners */ protected void addListeners ( ) { } }
Editable text = getText ( ) ; if ( text != null ) { text . setSpan ( spanWatcher , 0 , text . length ( ) , Spanned . SPAN_INCLUSIVE_INCLUSIVE ) ; addTextChangedListener ( textWatcher ) ; }
public class HijrahDate { /** * Returns month - of - year . 0 - based . * @ param dayOfYear day - of - year * @ param year a year * @ return month - of - year */ private static int getMonthOfYear ( int dayOfYear , int year ) { } }
Integer [ ] newMonths = getAdjustedMonthDays ( year ) ; if ( dayOfYear >= 0 ) { for ( int i = 0 ; i < newMonths . length ; i ++ ) { if ( dayOfYear < newMonths [ i ] . intValue ( ) ) { return i - 1 ; } } return 11 ; } else { dayOfYear = ( isLeapYear ( year ) ? ( dayOfYear + 355 ) : ( dayOfYear + 354 ) ) ; for ( int i = ...
public class cudaResourceViewFormat { /** * Returns the String identifying the given cudaResourceViewFormat * @ param m The cudaResourceViewFormat * @ return The String identifying the given cudaResourceViewFormat */ public static String stringFor ( int m ) { } }
switch ( m ) { case cudaResViewFormatNone : return "cudaResViewFormatNone" ; case cudaResViewFormatUnsignedChar1 : return "cudaResViewFormatUnsignedChar1" ; case cudaResViewFormatUnsignedChar2 : return "cudaResViewFormatUnsignedChar2" ; case cudaResViewFormatUnsignedChar4 : return "cudaResViewFormatUnsignedChar4" ; cas...
public class ViewQuery { /** * Sets the response in the event of an error . * See the " OnError " enum for more details on the available options . * @ param onError The appropriate error handling type . * @ return the { @ link ViewQuery } object for proper chaining . */ public ViewQuery onError ( final OnError on...
params [ PARAM_ONERROR_OFFSET ] = "on_error" ; params [ PARAM_ONERROR_OFFSET + 1 ] = onError . identifier ( ) ; return this ;
public class RabbitMqUtils { /** * Declares the global exchanges ( those that do not depend on an application ) . * It includes the DM exchange and the one for inter - application exchanges . * @ param channel the RabbitMQ channel * @ throws IOException if an error occurs */ public static void declareGlobalExchan...
// " topic " is a keyword for RabbitMQ . channel . exchangeDeclare ( buildExchangeNameForTheDm ( domain ) , "topic" ) ; channel . exchangeDeclare ( buildExchangeNameForInterApp ( domain ) , "topic" ) ;
public class Fingerprint { /** * / * package */ static @ CheckForNull Fingerprint load ( @ Nonnull File file ) throws IOException { } }
XmlFile configFile = getConfigFile ( file ) ; if ( ! configFile . exists ( ) ) return null ; long start = 0 ; if ( logger . isLoggable ( Level . FINE ) ) start = System . currentTimeMillis ( ) ; try { Object loaded = configFile . read ( ) ; if ( ! ( loaded instanceof Fingerprint ) ) { throw new IOException ( "Unexpecte...
public class SarlCapacityImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public boolean eIsSet ( int featureID ) { } }
switch ( featureID ) { case SarlPackage . SARL_CAPACITY__EXTENDS : return extends_ != null && ! extends_ . isEmpty ( ) ; } return super . eIsSet ( featureID ) ;
public class ServiceBuilder { /** * Attaches the given DurableDataLogFactory creator to this ServiceBuilder . The given Function will only not be invoked * right away ; it will be called when needed . * @ param dataLogFactoryCreator The Function to attach . * @ return This ServiceBuilder . */ public ServiceBuilde...
Preconditions . checkNotNull ( dataLogFactoryCreator , "dataLogFactoryCreator" ) ; this . dataLogFactoryCreator = dataLogFactoryCreator ; return this ;
public class SoyNodeCompiler { /** * Computes a single range argument . * @ param varName The variable name to use if this value should be stored in a local * @ param expression The expression * @ param defaultValue The value to use if there is no expression * @ param scope The current variable scope to add var...
if ( ! expression . isPresent ( ) ) { return constant ( defaultValue ) ; } else if ( expression . get ( ) instanceof IntegerNode && ( ( IntegerNode ) expression . get ( ) ) . isInt ( ) ) { int value = Ints . checkedCast ( ( ( IntegerNode ) expression . get ( ) ) . getValue ( ) ) ; return constant ( value ) ; } else { L...
public class Ifc4FactoryImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public String convertIfcMedicalDeviceTypeEnumToString ( EDataType eDataType , Object instanceValue ) { } }
return instanceValue == null ? null : instanceValue . toString ( ) ;
public class X509CertSelector { /** * Sets the subjectPublicKey criterion . The { @ code X509Certificate } * must contain the specified subject public key . If { @ code null } , * no subjectPublicKey check will be done . * Because this method allows the public key to be specified as a byte * array , it may be u...
if ( key == null ) { subjectPublicKey = null ; subjectPublicKeyBytes = null ; } else { subjectPublicKeyBytes = key . clone ( ) ; subjectPublicKey = X509Key . parse ( new DerValue ( subjectPublicKeyBytes ) ) ; }
public class BaseTypeConverterRegistrar { /** * Register all type converters for the 15 base types : < br > * < ul > * < li > Boolean < / li > * < li > Byte < / li > * < li > Character < / li > * < li > Double < / li > * < li > Float < / li > * < li > Integer < / li > * < li > Long < / li > * < li > S...
// to Boolean aRegistry . registerTypeConverterRuleAssignableSourceFixedDestination ( Number . class , Boolean . class , aSource -> Boolean . valueOf ( aSource . intValue ( ) != 0 ) ) ; aRegistry . registerTypeConverter ( Character . class , Boolean . class , aSource -> Boolean . valueOf ( aSource . charValue ( ) != 0 ...
public class ContainerGroupsInner { /** * Get a list of container groups in the specified subscription and resource group . * Get a list of container groups in a specified subscription and resource group . This operation returns properties of each container group including containers , image registry credentials , re...
return listByResourceGroupWithServiceResponseAsync ( resourceGroupName ) . map ( new Func1 < ServiceResponse < Page < ContainerGroupInner > > , Page < ContainerGroupInner > > ( ) { @ Override public Page < ContainerGroupInner > call ( ServiceResponse < Page < ContainerGroupInner > > response ) { return response . body ...
public class CPDefinitionSpecificationOptionValueLocalServiceBaseImpl { /** * Adds the cp definition specification option value to the database . Also notifies the appropriate model listeners . * @ param cpDefinitionSpecificationOptionValue the cp definition specification option value * @ return the cp definition s...
cpDefinitionSpecificationOptionValue . setNew ( true ) ; return cpDefinitionSpecificationOptionValuePersistence . update ( cpDefinitionSpecificationOptionValue ) ;
public class TemporaryZipFile { /** * Creates an entry under the specifeid path with the content from the provided resource . * @ param pathToFile * the path to the file in the zip file . * @ param resource * the resource providing the content for the file . Must not be null . * @ throws IOException */ privat...
final Path parent = pathToFile . getParent ( ) ; if ( parent != null ) { addFolder ( parent ) ; } try ( InputStream inputStream = resource . openStream ( ) ) { Files . copy ( inputStream , pathToFile ) ; }
public class JSONArray { /** * Creates a JSONArray . < br > * Inspects the object type to call the correct JSONArray factory method . * Accepts JSON formatted strings , arrays and Collections . * @ param object * @ throws JSONException if the object can not be converted to a proper * JSONArray . */ public sta...
if ( object instanceof JSONString ) { return _fromJSONString ( ( JSONString ) object , jsonConfig ) ; } else if ( object instanceof JSONArray ) { return _fromJSONArray ( ( JSONArray ) object , jsonConfig ) ; } else if ( object instanceof Collection ) { return _fromCollection ( ( Collection ) object , jsonConfig ) ; } e...
public class GettingStarted { /** * Make a model with 4 online nodes , 6 VMs ( 5 running , 1 ready ) . * Declare 2 resources . */ private Model makeModel ( ) { } }
Model model = new DefaultModel ( ) ; Mapping map = model . getMapping ( ) ; // Create 4 online nodes for ( int i = 0 ; i < 4 ; i ++ ) { Node n = model . newNode ( ) ; nodes . add ( n ) ; map . addOnlineNode ( n ) ; } // Create 6 VMs : vm0 . . vm5 for ( int i = 0 ; i < 6 ; i ++ ) { VM v = model . newVM ( ) ; vms . add (...