signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class FreeVarCollector { /** * If tree refers to a qualified this or super expression * for anything but the current class , add the outer this * stack as a free variable . */ public void visitSelect ( JCFieldAccess tree ) { } }
if ( ( tree . name == names . _this || tree . name == names . _super ) && tree . selected . type . tsym != clazz && outerThisStack . head != null ) visitSymbol ( outerThisStack . head ) ; super . visitSelect ( tree ) ;
public class DateUtils { /** * 字符串转换为日期java . util . Date * @ param dateString * 字符串 * @ param format * 日期格式 * @ return */ public static Date stringToDate ( String dateString , String format ) { } }
return stringToDate ( dateString , format , LENIENT_DATE ) ;
public class ConfigMgrImpl { /** * 主要用于邮箱发送 * @ return */ private String getConfigUrlHtml ( Config config ) { } }
return "<br/>点击<a href='http://" + applicationPropertyConfig . getDomain ( ) + "/modifyFile.html?configId=" + config . getId ( ) + "'> 这里 </a> 进入查看<br/>" ;
public class JSONNavi { /** * get the current object value as Long if the current Object can not be * cast as Long return null . */ public Long asLongObj ( ) { } }
if ( current == null ) return null ; if ( current instanceof Number ) { if ( current instanceof Long ) return ( Long ) current ; if ( current instanceof Integer ) return Long . valueOf ( ( ( Number ) current ) . longValue ( ) ) ; return null ; } return null ;
public class PatternRuleQueryBuilder { /** * Iterate over all elements , ignore those not supported , add the other ones to a BooleanQuery . * @ throws UnsupportedPatternRuleException if no query could be created for the rule */ public Query buildRelaxedQuery ( AbstractPatternRule rule ) throws UnsupportedPatternRule...
BooleanQuery . Builder builder = new BooleanQuery . Builder ( ) ; for ( PatternToken patternToken : rule . getPatternTokens ( ) ) { try { BooleanClause clause = makeQuery ( patternToken ) ; builder . add ( clause ) ; } catch ( UnsupportedPatternRuleException e ) { // System . out . println ( " Ignoring because it ' s n...
public class SecondsDescriptor { /** * Provide a human readable description for And instance . * @ param and - And * @ return human readable description - String */ protected String describe ( final And and ) { } }
final List < FieldExpression > expressions = new ArrayList < > ( ) ; final List < FieldExpression > onExpressions = new ArrayList < > ( ) ; for ( final FieldExpression fieldExpression : and . getExpressions ( ) ) { if ( fieldExpression instanceof On ) { onExpressions . add ( fieldExpression ) ; } else { expressions . a...
public class MoverModel { /** * Mover */ @ Override public void moveLocation ( double extrp , Direction direction , Direction ... directions ) { } }
double vx = direction . getDirectionHorizontal ( ) ; double vy = direction . getDirectionVertical ( ) ; for ( final Direction current : directions ) { vx += current . getDirectionHorizontal ( ) ; vy += current . getDirectionVertical ( ) ; } setLocation ( x + vx * extrp , y + vy * extrp ) ;
public class AbstractBeanDefinition { /** * Resolves a bean for the given { @ link FieldInjectionPoint } . * @ param resolutionContext The { @ link BeanResolutionContext } * @ param context The { @ link BeanContext } * @ param injectionPoint The { @ link FieldInjectionPoint } * @ return The resolved bean * @ ...
Class beanType = injectionPoint . getType ( ) ; if ( beanType . isArray ( ) ) { Collection beansOfType = getBeansOfTypeForField ( resolutionContext , context , injectionPoint ) ; return beansOfType . toArray ( ( Object [ ] ) Array . newInstance ( beanType . getComponentType ( ) , beansOfType . size ( ) ) ) ; } else if ...
public class FileValueStorage { /** * Prepare RootDir . * @ param rootDirPath * path * @ throws IOException * if error * @ throws RepositoryConfigurationException * if confog error */ protected void prepareRootDir ( String rootDirPath ) throws IOException , RepositoryConfigurationException { } }
this . rootDir = new File ( rootDirPath ) ; if ( ! rootDir . exists ( ) ) { if ( rootDir . mkdirs ( ) ) { LOG . info ( "Value storage directory created: " + rootDir . getAbsolutePath ( ) ) ; // create internal temp dir File tempDir = new File ( rootDir , TEMP_DIR_NAME ) ; tempDir . mkdirs ( ) ; if ( tempDir . exists ( ...
public class Mimetypes { /** * Loads MIME type info from the file ' mime . types ' in the classpath , if it ' s available . */ public synchronized static Mimetypes getInstance ( ) { } }
if ( mimetypes != null ) return mimetypes ; mimetypes = new Mimetypes ( ) ; InputStream is = mimetypes . getClass ( ) . getResourceAsStream ( "/mime.types" ) ; if ( is != null ) { if ( log . isDebugEnabled ( ) ) { log . debug ( "Loading mime types from file in the classpath: mime.types" ) ; } try { mimetypes . loadAndR...
public class XImportSectionImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public boolean eIsSet ( int featureID ) { } }
switch ( featureID ) { case XtypePackage . XIMPORT_SECTION__IMPORT_DECLARATIONS : return importDeclarations != null && ! importDeclarations . isEmpty ( ) ; } return super . eIsSet ( featureID ) ;
public class DerIndefLenConverter { /** * Parse the length and if it is an indefinite length then add * the current position to the < code > ndefsList < / code > vector . */ private int parseLength ( ) throws IOException { } }
int curLen = 0 ; if ( dataPos == dataSize ) return curLen ; int lenByte = data [ dataPos ++ ] & 0xff ; if ( isIndefinite ( lenByte ) ) { ndefsList . add ( new Integer ( dataPos ) ) ; unresolved ++ ; return curLen ; } if ( isLongForm ( lenByte ) ) { lenByte &= LEN_MASK ; if ( lenByte > 4 ) { throw new IOException ( "Too...
public class JTAXAResourceImpl { /** * Write information about the resource to the transaction log * @ exception SystemException */ @ Override public void log ( RecoverableUnitSection rus ) throws SystemException { } }
if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "log" , new Object [ ] { this , rus } ) ; if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "about to log stoken " + Util . toHexString ( ( ( XidImpl ) _xid ) . getStoken ( ) ) ) ; Tr . debug ( tc , "about to log recoveryId " + getRecoveryId ( ) ) ; Tr . debug ( tc , "a...
public class AnnotationTypeOptionalMemberWriterImpl { /** * { @ inheritDoc } */ public void addSummaryAnchor ( TypeElement typeElement , Content memberTree ) { } }
memberTree . addContent ( writer . getMarkerAnchor ( SectionName . ANNOTATION_TYPE_OPTIONAL_ELEMENT_SUMMARY ) ) ;
public class IntrospectionLevelMember { /** * Make a string that describes this object * @ param value * The value needing a description * @ return The description */ private String makeDescription ( Object value ) { } }
String answer ; // Not initialized , so the compiler tells if we miss a // case if ( value == null ) { answer = "null" ; } else if ( value instanceof String ) { answer = "\"" + value + "\"" ; } else { Class < ? > objClass = value . getClass ( ) ; if ( ( objClass == Boolean . class ) || ( objClass == Character . class )...
public class MacroTextDecorator { /** * Get the target text and execute each text decorator on its results * @ return the text results */ public String getText ( ) { } }
// loop thru text StringText stringText = new StringText ( ) ; stringText . setText ( this . target . getText ( ) ) ; TextDecorator < Textable > textDecorator = null ; // loop thru decorator and get results from each for ( Iterator < TextDecorator < Textable > > i = textables . iterator ( ) ; i . hasNext ( ) ; ) { text...
public class IntStreamEx { /** * Folds the elements of this stream using the provided accumulation * function , going left to right . This is equivalent to : * < pre > * { @ code * boolean foundAny = false ; * int result = 0; * for ( int element : this stream ) { * if ( ! foundAny ) { * foundAny = true ...
PrimitiveBox b = new PrimitiveBox ( ) ; forEachOrdered ( t -> { if ( b . b ) b . i = accumulator . applyAsInt ( b . i , t ) ; else { b . i = t ; b . b = true ; } } ) ; return b . asInt ( ) ;
public class FactoryBuilderSupport { /** * A hook before the factory creates the node . < br > * It will call any registered preInstantiateDelegates , if you override this * method be sure to call this impl somewhere in your code . * @ param name the name of the node * @ param attributes the attributes of the n...
for ( Closure preInstantiateDelegate : getProxyBuilder ( ) . getPreInstantiateDelegates ( ) ) { ( preInstantiateDelegate ) . call ( new Object [ ] { this , attributes , value } ) ; }
public class ZeroMQNetworkService { /** * Build the byte array that may be used for the ZeroMQ filtering associated with { @ link Socket # subscribe ( byte [ ] ) } . For a given contextID * ( translated into a byte array with an { @ link EventSerializer } ) , this function must always reply the same sequence of bytes...
final byte [ ] header = new byte [ Ints . BYTES + contextID . length ] ; final byte [ ] length = Ints . toByteArray ( contextID . length ) ; System . arraycopy ( length , 0 , header , 0 , length . length ) ; System . arraycopy ( contextID , 0 , header , length . length , contextID . length ) ; return header ;
public class SocksSocketFactory { /** * Set the proxy of this socket factory as described in the string * parameter * @ param proxyStr the proxy address using the format " host : port " */ private void setProxy ( String proxyStr ) { } }
String [ ] strs = proxyStr . split ( ":" , 2 ) ; if ( strs . length != 2 ) throw new RuntimeException ( "Bad SOCKS proxy parameter: " + proxyStr ) ; String host = strs [ 0 ] ; int port = Integer . parseInt ( strs [ 1 ] ) ; this . proxy = new Proxy ( Proxy . Type . SOCKS , InetSocketAddress . createUnresolved ( host , p...
public class POICellFormatter { /** * セルの値をフォーマットする 。 * @ param poiCell フォーマット対象のセル * @ param locale ロケール * @ return フォーマットした結果 */ private CellFormatResult getCellValue ( final POICell poiCell , final Locale locale ) { } }
final short formatIndex = poiCell . getFormatIndex ( ) ; final String formatPattern = poiCell . getFormatPattern ( ) ; if ( formatterResolver . canResolve ( formatIndex ) ) { final CellFormatter cellFormatter = formatterResolver . getFormatter ( formatIndex ) ; return cellFormatter . format ( poiCell , locale ) ; } els...
public class XMLElement { /** * Returns children that have the specified name as a XMLElement array . * @ param name The name to search . * @ return The children . */ public XMLElement [ ] getChildren ( String name ) { } }
java . util . List < XMLElement > list = new java . util . ArrayList < XMLElement > ( ) ; for ( XMLElement child : getChildren ( ) ) { if ( child . getName ( ) . equals ( name ) ) { list . add ( child ) ; } } return ( 0 < list . size ( ) ) ? list . toArray ( new XMLElement [ 0 ] ) : null ;
public class FeedbackTransformation { /** * Adds a feedback edge . The parallelism of the { @ code StreamTransformation } must match * the parallelism of the input { @ code StreamTransformation } of this * { @ code FeedbackTransformation } * @ param transform The new feedback { @ code StreamTransformation } . */ ...
if ( transform . getParallelism ( ) != this . getParallelism ( ) ) { throw new UnsupportedOperationException ( "Parallelism of the feedback stream must match the parallelism of the original" + " stream. Parallelism of original stream: " + this . getParallelism ( ) + "; parallelism of feedback stream: " + transform . ge...
public class LeaderState { /** * Commits the given configuration . */ protected CompletableFuture < Long > configure ( Collection < Member > members ) { } }
final long index ; try ( ConfigurationEntry entry = context . getLog ( ) . create ( ConfigurationEntry . class ) ) { entry . setTerm ( context . getTerm ( ) ) . setTimestamp ( System . currentTimeMillis ( ) ) . setMembers ( members ) ; index = context . getLog ( ) . append ( entry ) ; LOGGER . trace ( "{} - Appended {}...
public class MapperTemplate { /** * 重新设置SqlSource * @ param ms * @ param sqlSource */ protected void setSqlSource ( MappedStatement ms , SqlSource sqlSource ) { } }
MetaObject msObject = MetaObjectUtil . forObject ( ms ) ; msObject . setValue ( "sqlSource" , sqlSource ) ;
public class StringUtilities { /** * Test to see if a String is null or contains only whitespace . * @ param input The String to test * @ return true if input is null or contains only whitespace , and false otherwise */ public static boolean isStringNullOrEmpty ( final String input ) { } }
if ( input == null || input . trim ( ) . isEmpty ( ) ) { return true ; } return false ;
public class AmazonDirectConnectClient { /** * Lists the attachments between your Direct Connect gateways and virtual interfaces . You must specify a Direct * Connect gateway , a virtual interface , or both . If you specify a Direct Connect gateway , the response contains all * virtual interfaces attached to the Di...
request = beforeClientExecution ( request ) ; return executeDescribeDirectConnectGatewayAttachments ( request ) ;
public class SingleFileRepositoryConnection { /** * Create an empty single file Repository connection . * Repository data will be stored in { @ code jsonFile } which must not exist and will be created by this method . * @ param jsonFile the location for the repository file * @ return the repository connection *...
if ( jsonFile . exists ( ) ) { throw new IOException ( "Cannot create empty repository as the file already exists: " + jsonFile . getAbsolutePath ( ) ) ; } OutputStreamWriter writer = null ; try { writer = new OutputStreamWriter ( new FileOutputStream ( jsonFile ) , "UTF-8" ) ; writer . write ( "[]" ) ; } finally { if ...
public class FileEventStore { /** * Gets the cache directory for the given project . Optionally creates the directory if it * doesn ' t exist . * @ param projectId The project ID . * @ return The cache directory for the project . * @ throws IOException */ private File getProjectDir ( String projectId , boolean ...
File projectDir = new File ( getKeenCacheDirectory ( ) , projectId ) ; if ( create && ! projectDir . exists ( ) ) { KeenLogging . log ( "Cache directory for project '" + projectId + "' doesn't exist. " + "Creating it." ) ; if ( ! projectDir . mkdirs ( ) ) { throw new IOException ( "Could not create project cache direct...
public class SizeBoundedQueue { /** * For testing only - should always be the same as size ( ) */ public int queueSize ( ) { } }
return queue . stream ( ) . map ( el -> el . size ) . reduce ( 0 , ( l , r ) -> l + r ) ;
public class RoundRobinPolicy { /** * The policy uses the first fetch of worker info list as the base , and visits each of them in a * round - robin manner in the subsequent calls . The policy doesn ' t assume the list of worker info * in the subsequent calls has the same order from the first , and it will skip the...
Set < WorkerNetAddress > eligibleAddresses = new HashSet < > ( ) ; for ( BlockWorkerInfo info : options . getBlockWorkerInfos ( ) ) { eligibleAddresses . add ( info . getNetAddress ( ) ) ; } WorkerNetAddress address = mBlockLocationCache . get ( options . getBlockInfo ( ) . getBlockId ( ) ) ; if ( address != null && el...
public class BProgramJsProxy { /** * sync ( " bp . sync " ) related code */ @ Override public void sync ( NativeObject jsRWB , Object data ) { } }
synchronizationPoint ( jsRWB , null , data ) ;
public class ConfigConcatenation { /** * Add left and right , or their merger , to builder . */ private static void join ( ArrayList < AbstractConfigValue > builder , AbstractConfigValue origRight ) { } }
AbstractConfigValue left = builder . get ( builder . size ( ) - 1 ) ; AbstractConfigValue right = origRight ; // check for an object which can be converted to a list // ( this will be an object with numeric keys , like foo . 0 , foo . 1) if ( left instanceof ConfigObject && right instanceof SimpleConfigList ) { left = ...
public class CachingResourceLoaderImpl { /** * Check if any of the Resources used to load the { @ link CachedResource } have been modified . */ protected < T > boolean checkIfModified ( CachedResource < T > cachedResource ) { } }
final Resource resource = cachedResource . getResource ( ) ; // Check if the resource has been modified since it was last loaded . final long lastLoadTime = cachedResource . getLastLoadTime ( ) ; final long mainLastModified = this . getLastModified ( resource ) ; boolean resourceModified = lastLoadTime < mainLastModifi...
import java . util . * ; class SortNestedLists { /** * Function to sort a nested list based on list length and elements . * The function first sorts the sublists by their values , and then sorts * the entire list by the length of sublists . * @ param inputList The list of lists to be sorted . * @ return The sor...
for ( List < String > list : inputList ) { Collections . sort ( list ) ; } inputList . sort ( new Comparator < List < String > > ( ) { @ Override public int compare ( List < String > list1 , List < String > list2 ) { return Integer . compare ( list1 . size ( ) , list2 . size ( ) ) ; } } ) ; return inputList ;
public class SecurityConfig { /** * Configures the unsecured public resources . * @ param web web sec object * @ throws Exception ex */ @ Override public void configure ( WebSecurity web ) throws Exception { } }
web . ignoring ( ) . requestMatchers ( IgnoredRequestMatcher . INSTANCE ) ; DefaultHttpFirewall firewall = new DefaultHttpFirewall ( ) ; firewall . setAllowUrlEncodedSlash ( true ) ; web . httpFirewall ( firewall ) ; // web . debug ( true ) ;
public class Node { /** * Return if this node has the same columns and lines than another one . * @ param node2 * the node to compare * @ return if this node has the same columns and lines than another one . */ public boolean isInEqualLocation ( Node node2 ) { } }
if ( ! isNewNode ( ) && ! node2 . isNewNode ( ) ) { return getBeginLine ( ) == node2 . getBeginLine ( ) && getBeginColumn ( ) == node2 . getBeginColumn ( ) && getEndLine ( ) == node2 . getEndLine ( ) && getEndColumn ( ) == node2 . getEndColumn ( ) ; } return false ;
public class ZonalDateTime { /** * benutzt in ChronoFormatter / FractionProcessor */ @ Override public < V > V getMaximum ( ChronoElement < V > element ) { } }
V max ; if ( this . timestamp . contains ( element ) ) { max = this . timestamp . getMaximum ( element ) ; } else { max = this . moment . getMaximum ( element ) ; } if ( ( element == SECOND_OF_MINUTE ) && ( this . timestamp . getYear ( ) >= 1972 ) ) { PlainTimestamp ts = this . timestamp . with ( element , max ) ; if (...
public class CommerceShipmentPersistenceImpl { /** * Removes the commerce shipment with the primary key from the database . Also notifies the appropriate model listeners . * @ param primaryKey the primary key of the commerce shipment * @ return the commerce shipment that was removed * @ throws NoSuchShipmentExcep...
Session session = null ; try { session = openSession ( ) ; CommerceShipment commerceShipment = ( CommerceShipment ) session . get ( CommerceShipmentImpl . class , primaryKey ) ; if ( commerceShipment == null ) { if ( _log . isDebugEnabled ( ) ) { _log . debug ( _NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey ) ; } throw ...
public class PrincipalComponentAnalysis { /** * Converts a vector from sample space into eigen space . * @ param sampleData Sample space data . * @ return Eigen space projection . */ public double [ ] sampleToEigenSpace ( double [ ] sampleData ) { } }
if ( sampleData . length != A . getNumCols ( ) ) throw new IllegalArgumentException ( "Unexpected sample length" ) ; DMatrixRMaj mean = DMatrixRMaj . wrap ( A . getNumCols ( ) , 1 , this . mean ) ; DMatrixRMaj s = new DMatrixRMaj ( A . getNumCols ( ) , 1 , true , sampleData ) ; DMatrixRMaj r = new DMatrixRMaj ( numComp...
public class Representation { /** * Creates a representation based on the byte array specified . The length of the byte array * will be reflected in the returned representation metadata ( property { @ link NFO # FILE _ SIZE } ) . * Note that the byte array should not be changed after calling this method , as modifi...
final Representation representation = new Representation ( new ByteArrayInputStream ( bytes ) ) ; representation . metadata . set ( NFO . FILE_SIZE , ( long ) bytes . length ) ; return representation ;
public class TokenSub { /** * Given a static config map , substitute occurrences of $ { HERON _ * } variables * in the provided path string * @ param config a static map config object of key value pairs * @ param pathString string representing a path including $ { HERON _ * } variables * @ return String string ...
// trim the leading and trailing spaces String trimmedPath = pathString . trim ( ) ; if ( isURL ( trimmedPath ) ) { return substituteURL ( config , trimmedPath ) ; } // get platform independent file separator String fileSeparator = Matcher . quoteReplacement ( File . separator ) ; // split the trimmed path into a list ...
public class DirectoryPoller { /** * Adds the given < code > directory < / code > into this instance . * The < code > directory < / code > will be polled in the next coming poll - cycle . * Registering an already registered directory will be ignored . * @ param directory implementation of { @ link PolledDirectory...
if ( directory == null ) { throw new NullPointerException ( NULL_ARGUMENT_ERROR ) ; } scheduledRunnable . addDirectory ( directory ) ;
public class LayerWorkspaceMgr { /** * Get the pointer to the helper memory . Usually used for CUDNN workspace memory sharing . * NOTE : Don ' t use this method unless you are fully aware of how it is used to manage CuDNN memory ! * Will ( by design ) throw a NPE if the underlying map ( set from MultiLayerNetwork o...
return helperWorkspacePointers == null ? null : ( T ) helperWorkspacePointers . get ( key ) ;
public class IfcConstraintImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ SuppressWarnings ( "unchecked" ) public EList < IfcConstraintRelationship > getRelatesConstraints ( ) { } }
return ( EList < IfcConstraintRelationship > ) eGet ( Ifc2x3tc1Package . Literals . IFC_CONSTRAINT__RELATES_CONSTRAINTS , true ) ;
public class NFSFileVec { /** * Make a new NFSFileVec key which holds the filename implicitly . This name * is used by the Chunks to load data on - demand . Blocking * @ return A NFSFileVec mapped to this file . */ public static NFSFileVec make ( File f ) { } }
Futures fs = new Futures ( ) ; NFSFileVec nfs = make ( f , fs ) ; fs . blockForPending ( ) ; return nfs ;
public class RangeToken { /** * for RANGE : Creates complement . for NRANGE : Creates the same meaning * RANGE . */ static Token complementRanges ( Token token ) { } }
if ( token . type != RANGE && token . type != NRANGE ) throw new IllegalArgumentException ( "Token#complementRanges(): must be RANGE: " + token . type ) ; RangeToken tok = ( RangeToken ) token ; tok . sortRanges ( ) ; tok . compactRanges ( ) ; int len = tok . ranges . length + 2 ; if ( tok . ranges [ 0 ] == 0 ) len -= ...
public class JMArrays { /** * Build array with delimiter string [ ] . * @ param stringWithDelimiter the string with delimiter * @ param delimiter the delimiter * @ return the string [ ] */ public static String [ ] buildArrayWithDelimiter ( String stringWithDelimiter , String delimiter ) { } }
return toArray ( JMCollections . buildListWithDelimiter ( stringWithDelimiter , delimiter ) ) ;
public class AbstractItemLink { /** * Declare the receiver stable * This is used to drive the softening / disposal of the * indirect reference to the receivers item . * The item can be discarded if the link is stable and * available ( always assuming the storage strategy allows ) . * If the item becomes unsta...
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "persistentRepresentationIsStable" ) ; boolean notifyRequired = false ; AbstractItem item = null ; synchronized ( this ) { if ( ! _persistentRepresentationIsStable ) { // if we have become stable and were releasable ,...
public class FileUtils { /** * < p > Attempts to get the base name for a given file / directory . Removes the suffix from the name as well . This * command should work in the same way as the unix < code > basename < / code > command . < / p > * @ param file The file path / name * @ param suffix The suffix to remo...
if ( StringUtils . isNullOrBlank ( file ) ) { return StringUtils . EMPTY ; } file = StringUtils . trim ( file ) ; int index = indexOfLastSeparator ( file ) ; if ( index == - 1 ) { return file . replaceAll ( Pattern . quote ( suffix ) + "$" , "" ) ; } else if ( index == file . length ( ) - 1 ) { return baseName ( file ....
public class CodedConstant { /** * Gets the descriptor . * @ param cls the cls * @ return the descriptor * @ throws IOException Signals that an I / O exception has occurred . */ public static Descriptor getDescriptor ( Class < ? > cls ) throws IOException { } }
String idl = ProtobufIDLGenerator . getIDL ( cls ) ; ProtoFile file = ProtoSchemaParser . parse ( ProtobufIDLProxy . DEFAULT_FILE_NAME , idl ) ; FileDescriptorProtoPOJO fileDescriptorProto = new FileDescriptorProtoPOJO ( ) ; fileDescriptorProto . name = ProtobufIDLProxy . DEFAULT_FILE_NAME ; fileDescriptorProto . pkg =...
public class PluginWrapper { /** * Called when there appears to be a core or plugin version which is too old for a stated dependency . * Normally records an error in { @ link # dependencyErrors } . * But if one or both versions { @ link # isSnapshot } , just issue a warning ( JENKINS - 52665 ) . */ private void ver...
if ( isSnapshot ( actual ) || isSnapshot ( minimum ) ) { LOGGER . log ( WARNING , "Suppressing dependency error in {0} v{1}: {2}" , new Object [ ] { getLongName ( ) , getVersion ( ) , message } ) ; } else { dependencyErrors . put ( message , false ) ; }
public class IpHelper { /** * Determines if a specified address is a valid Cisco Wildcard ( cisco ' s representation of a netmask ) * @ param wildcard * InetAddress * @ return boolean */ public static boolean isValidCiscoWildcard ( InetAddress wildcard ) { } }
byte [ ] segments = wildcard . getAddress ( ) ; for ( int i = 0 ; i < segments . length ; i ++ ) { assert ( ( ( byte ) ~ ( byte ) ~ segments [ i ] ) == segments [ i ] ) ; segments [ i ] = ( byte ) ~ segments [ i ] ; } return isValidNetmask ( segments ) ;
public class AWSOrganizationsClient { /** * Removes a member account from its parent organization . This version of the operation is performed by the account * that wants to leave . To remove a member account as a user in the master account , use * < a > RemoveAccountFromOrganization < / a > instead . * This oper...
request = beforeClientExecution ( request ) ; return executeLeaveOrganization ( request ) ;
public class CopyProductRequest { /** * The copy options . If the value is < code > CopyTags < / code > , the tags from the source product are copied to the * target product . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setCopyOptions ( java . util . Co...
if ( this . copyOptions == null ) { setCopyOptions ( new java . util . ArrayList < String > ( copyOptions . length ) ) ; } for ( String ele : copyOptions ) { this . copyOptions . add ( ele ) ; } return this ;
public class N { /** * Mostly it ' s designed for one - step operation to complete the operation in one step . * < code > java . util . stream . Stream < / code > is preferred for multiple phases operation . * @ param a * @ param fromIndex * @ param toIndex * @ param func * @ return */ public static < T , E...
checkFromToIndex ( fromIndex , toIndex , len ( a ) ) ; N . checkArgNotNull ( func ) ; if ( N . isNullOrEmpty ( a ) ) { return new ShortList ( ) ; } final ShortList result = new ShortList ( toIndex - fromIndex ) ; for ( int i = fromIndex ; i < toIndex ; i ++ ) { result . add ( func . applyAsShort ( a [ i ] ) ) ; } retur...
public class HttpFields { /** * Sets the value of a date field . * @ param name the field name * @ param date the field date value */ public void addDateField ( String name , long date ) { } }
String d = DateGenerator . formatDate ( date ) ; add ( name , d ) ;
public class SequenceLabelerFactory { /** * Creates the { @ link AdaptiveFeatureGenerator } . Usually this is a set of * generators contained in the { @ link AggregatedFeatureGenerator } . * Note : The generators are created on every call to this method . * @ return the feature generator or null if there is no de...
if ( this . featureGeneratorBytes == null && this . artifactProvider != null ) { this . featureGeneratorBytes = ( byte [ ] ) this . artifactProvider . getArtifact ( SequenceLabelerModel . GENERATOR_DESCRIPTOR_ENTRY_NAME ) ; } if ( this . featureGeneratorBytes == null ) { System . err . println ( "WARNING: loading the d...
public class VodClient { /** * Publish the specific media resource managed by VOD service , so that it can be access and played . * The caller < i > must < / i > authenticate with a valid BCE Access Key / Private Key pair . * @ param mediaId The unique ID for each media resource * @ return empty response will be ...
PublishMediaResourceRequest request = new PublishMediaResourceRequest ( ) . withMediaId ( mediaId ) ; return publishMediaResource ( request ) ;
public class PeerManager { /** * Determines the owner of the specified lock , waiting for any resolution to complete before * notifying the supplied listener . */ public void queryLock ( NodeObject . Lock lock , ResultListener < String > listener ) { } }
// if it ' s being resolved , add the listener to the list LockHandler handler = _locks . get ( lock ) ; if ( handler != null ) { handler . listeners . add ( listener ) ; return ; } // otherwise , return its present value listener . requestCompleted ( queryLock ( lock ) ) ;
public class RxUtils { /** * Add a log statement to the onNext , onError , and onCompleted parts of an observable * @ param name the log tag name * @ param < T > the transformation type * @ return the transformer */ public static < T > Observable . Transformer < T , T > applyLogging ( final String name , final Lo...
return new Observable . Transformer < T , T > ( ) { @ Override public Observable < T > call ( Observable < T > observable ) { return observable . doOnNext ( new Action1 < T > ( ) { @ Override public void call ( T t ) { logger . log ( Log . DEBUG , "[%s] onNext(%s)" , name , t ) ; } } ) . doOnError ( new Action1 < Throw...
public class QueryEngine { /** * refreshes the cached Namespace information */ public synchronized void refreshNamespaces ( ) { } }
/* * cache namespaces */ if ( this . namespaceCache == null ) { this . namespaceCache = new TreeMap < String , Namespace > ( ) ; Node [ ] nodes = client . getNodes ( ) ; for ( Node node : nodes ) { try { String namespaceString = Info . request ( getInfoPolicy ( ) , node , "namespaces" ) ; if ( ! namespaceString . isEmp...
public class WaveformPreviewComponent { /** * Clear the playback state stored for a player , such as when it has unloaded the track . * @ param player the player number whose playback state is no longer valid * @ since 0.5.0 */ public synchronized void clearPlaybackState ( int player ) { } }
long oldMaxPosition = 0 ; PlaybackState furthestState = getFurthestPlaybackState ( ) ; if ( furthestState != null ) { oldMaxPosition = furthestState . position ; } PlaybackState oldState = playbackStateMap . remove ( player ) ; long newMaxPosition = 0 ; furthestState = getFurthestPlaybackState ( ) ; if ( furthestState ...
public class FlatRowAdapter { /** * { @ inheritDoc } Convert a { @ link FlatRow } to a { @ link Result } . */ @ Override public Result adaptResponse ( FlatRow flatRow ) { } }
// flatRow shouldn ' t ever have a null row key . The second check is defensive only . if ( flatRow == null || flatRow . getRowKey ( ) == null ) { return Result . EMPTY_RESULT ; } byte [ ] RowKey = ByteStringer . extract ( flatRow . getRowKey ( ) ) ; List < FlatRow . Cell > cells = flatRow . getCells ( ) ; List < Cell ...
public class Value { /** * The FAST path get - POJO as a { @ link Freezable } - final method for speed . * Will ( re ) build the POJO from the _ mem array . Never returns NULL . * @ return The POJO , probably the cached instance . */ public final < T extends Freezable > T getFreezable ( ) { } }
touch ( ) ; Freezable pojo = _pojo ; // Read once ! if ( pojo != null ) return ( T ) pojo ; pojo = TypeMap . newFreezable ( _type ) ; pojo . reloadFromBytes ( memOrLoad ( ) ) ; return ( T ) ( _pojo = pojo ) ;
public class TypeValidator { /** * Expect that the first type can be assigned to a symbol of the second type . * @ param t The node traversal . * @ param n The node to issue warnings on . * @ param rightType The type on the RHS of the assign . * @ param leftType The type of the symbol on the LHS of the assign ....
// The NoType check is a hack to make typedefs work OK . if ( ! leftType . isNoType ( ) && ! rightType . isSubtypeOf ( leftType ) ) { // Do not type - check interface methods , because we expect that // they will have dummy implementations that do not match the type // annotations . JSType ownerType = getJSType ( owner...
public class SharedObject { /** * Send update notification over data channel of RTMP connection */ protected synchronized void sendUpdates ( ) { } }
log . debug ( "sendUpdates" ) ; // get the current version final int currentVersion = getVersion ( ) ; log . debug ( "Current version: {}" , currentVersion ) ; // get the name final String name = getName ( ) ; // get owner events Set < ISharedObjectEvent > ownerEvents = ownerMessage . getEvents ( ) ; if ( ! ownerEvents...
public class SuggestedAdUnitServiceLocator { /** * For the given interface , get the stub implementation . * If this service has no port for the given interface , * then ServiceException is thrown . */ public java . rmi . Remote getPort ( Class serviceEndpointInterface ) throws javax . xml . rpc . ServiceException ...
try { if ( com . google . api . ads . admanager . axis . v201805 . SuggestedAdUnitServiceInterface . class . isAssignableFrom ( serviceEndpointInterface ) ) { com . google . api . ads . admanager . axis . v201805 . SuggestedAdUnitServiceSoapBindingStub _stub = new com . google . api . ads . admanager . axis . v201805 ....
public class CmsPushButton { /** * Sets the size . < p > * @ param size the size to set */ public void setSize ( I_CmsButton . Size size ) { } }
if ( m_size != null ) { removeStyleName ( m_size . getCssClassName ( ) ) ; } if ( size != null ) { addStyleName ( size . getCssClassName ( ) ) ; } m_size = size ;
public class ServiceInstanceUtils { /** * Validate the ServiceInstance Metadata . * @ param metadata * the service instance metadata map . * @ throws ServiceException */ public static void validateMetadata ( Map < String , String > metadata ) throws ServiceException { } }
for ( String key : metadata . keySet ( ) ) { if ( ! validateRequiredField ( key , metaKeyRegEx ) ) { throw new ServiceException ( ErrorCode . SERVICE_INSTANCE_METAKEY_FORMAT_ERROR , ErrorCode . SERVICE_INSTANCE_METAKEY_FORMAT_ERROR . getMessageTemplate ( ) , key ) ; } }
public class OneDReader { /** * Records the size of successive runs of white and black pixels in a row , starting at a given point . * The values are recorded in the given array , and the number of runs recorded is equal to the size * of the array . If the row starts on a white pixel at the given start point , then...
int numCounters = counters . length ; Arrays . fill ( counters , 0 , numCounters , 0 ) ; int end = row . getSize ( ) ; if ( start >= end ) { throw NotFoundException . getNotFoundInstance ( ) ; } boolean isWhite = ! row . get ( start ) ; int counterPosition = 0 ; int i = start ; while ( i < end ) { if ( row . get ( i ) ...
public class VariableTranslator { /** * Deserializes variable string values to runtime objects . * @ param pkg workflow package * @ param type variable type * @ param value string value * @ return deserialized object */ public static Object realToObject ( Package pkg , String type , String value ) { } }
if ( StringHelper . isEmpty ( value ) ) return null ; com . centurylink . mdw . variable . VariableTranslator trans = getTranslator ( pkg , type ) ; if ( trans instanceof DocumentReferenceTranslator ) return ( ( DocumentReferenceTranslator ) trans ) . realToObject ( value ) ; else return trans . toObject ( value ) ;
public class SiteMapServlet { /** * Gets the most recent of the last modified of all views applicable to the given * book and accessible to the search engines . If any view returns { @ code null } * from { @ link View # getLastModified ( javax . servlet . ServletContext , javax . servlet . http . HttpServletRequest...
assert book . equals ( SemanticCMS . getInstance ( servletContext ) . getPublishedBooks ( ) . get ( book . getBookRef ( ) . getPath ( ) ) ) : "Book not published: " + book ; assert book . isAccessible ( ) ; // The most recent is kept here , but set to null the first time a missing // per page / view last modified time ...
public class Visibility { /** * The default implementation of this method returns a null Animator . Subclasses should * override this method to make targets appear with the desired transition . The * method should only be called from * { @ link # onAppear ( ViewGroup , TransitionValues , int , TransitionValues , ...
return null ;
public class IdentityMap { /** * Returns an iterator for the keys in the map . Remove is supported . Note that the same iterator instance is returned each * time this method is called . Use the { @ link Entries } constructor for nested or multithreaded iteration . */ public Keys < K > keys ( ) { } }
if ( keys == null ) keys = new Keys ( this ) ; else keys . reset ( ) ; return keys ;
public class PagingParams { /** * Gets the number of items to return in a page . * @ param maxTake the maximum number of items to return . * @ return the number of items to return . */ public long getTake ( long maxTake ) { } }
if ( _take == null ) return maxTake ; if ( _take < 0 ) return 0 ; if ( _take > maxTake ) return maxTake ; return _take ;
public class KabschAlignment { /** * Perform an alignment . * This method aligns to set of atoms which should have been specified * prior to this call */ public void align ( ) { } }
Matrix tmp ; // get center of gravity and translate both to 0,0,0 this . cm1 = new Point3d ( ) ; this . cm2 = new Point3d ( ) ; this . cm1 = getCenterOfMass ( p1 , atwt1 ) ; this . cm2 = getCenterOfMass ( p2 , atwt2 ) ; // move the points for ( int i = 0 ; i < this . npoint ; i ++ ) { p1 [ i ] . x = p1 [ i ] . x - this...
public class DefaultVfs { /** * 从jar包中找到URL资源 . * @ param url url * @ return url */ private URL findJarForResource ( URL url ) { } }
// 如果URL的文件部分本身是一个URL , 那么该URL可能指向JAR try { long startTime = System . currentTimeMillis ( ) ; while ( true ) { url = new URL ( url . getFile ( ) ) ; if ( System . currentTimeMillis ( ) - startTime > MAX_LIMIT ) { break ; } } } catch ( MalformedURLException expected ) { // This will happen at some point and serves as a ...
public class PositiveDepthConstraintCheck { /** * Checks to see if a single point meets the constraint . * @ param viewA View of the 3D point from the first camera . Calibrated coordinates . * @ param viewB View of the 3D point from the second camera . Calibrated coordinates . * @ param fromAtoB Transform from th...
triangulate . triangulate ( viewA , viewB , fromAtoB , P ) ; if ( P . z > 0 ) { SePointOps_F64 . transform ( fromAtoB , P , P ) ; return P . z > 0 ; } return false ;
public class Manager { /** * This method reconfigures the manager . * It is NOT invoked DIRECTLY by iPojo anymore . */ @ Override public void reconfigure ( ) { } }
// Update the messaging client this . logger . info ( "Reconfiguration requested in the DM." ) ; if ( this . messagingClient != null ) { this . messagingClient . setDomain ( this . domain ) ; this . messagingClient . switchMessagingType ( this . messagingType ) ; try { if ( this . messagingClient . isConnected ( ) ) th...
public class DataGrid { /** * Sets the border attribute for the HTML table tag . * @ param border * @ jsptagref . attributedescription The border attribute for the HTML table tag . * @ jsptagref . attributesyntaxvalue < i > string _ dir < / i > * @ netui : attribute required = " false " rtexprvalue = " true " d...
_tableState . registerAttribute ( AbstractHtmlState . ATTR_GENERAL , HtmlConstants . BORDER , border ) ;
public class TmdbCompanies { /** * This method is used to retrieve the basic information about a production company on TMDb . * @ param companyId * @ return * @ throws MovieDbException */ public Company getCompanyInfo ( int companyId ) throws MovieDbException { } }
TmdbParameters parameters = new TmdbParameters ( ) ; parameters . add ( Param . ID , companyId ) ; URL url = new ApiUrl ( apiKey , MethodBase . COMPANY ) . buildUrl ( parameters ) ; String webpage = httpTools . getRequest ( url ) ; try { return MAPPER . readValue ( webpage , Company . class ) ; } catch ( IOException ex...
public class TrieMap { /** * { @ inheritDoc } */ @ Override public Collection < V > values ( ) { } }
final Collection < V > v = values ; return v != null ? v : ( values = new Values ( ) ) ;
public class AtomSymbol { /** * Create a new atom symbol ( from this symbol ) but with the specified * alignment . * @ param alignment element alignment * @ return new atom symbol */ AtomSymbol alignTo ( SymbolAlignment alignment ) { } }
return new AtomSymbol ( element , adjuncts , annotationAdjuncts , alignment , hull ) ;
public class RpcLoggerFactory { /** * 获取日志对象 * @ param name 日志的名字 * @ return 日志实现 */ public static org . slf4j . Logger getLogger ( String name , String appname ) { } }
// 从 " com / alipay / sofa / rpc / log " 中获取 rpc 的日志配置并寻找对应logger对象 , log 为默认添加的后缀 if ( name == null || name . isEmpty ( ) ) { return null ; } Map < String , String > properties = new HashMap < String , String > ( ) ; properties . put ( APPNAME , appname == null ? "" : appname ) ; SpaceId spaceId = new SpaceId ( RPC_LO...
public class MathUtil { /** * Find the next larger number with all ones . * Classic bit operation , for signed 32 - bit . Valid for positive integers only * ( - 1 otherwise ) . * @ param x original integer * @ return Next number with all bits set */ public static int nextAllOnesInt ( int x ) { } }
x |= x >>> 1 ; x |= x >>> 2 ; x |= x >>> 4 ; x |= x >>> 8 ; x |= x >>> 16 ; return x ;
public class Windowing { /** * Adapts an iterator to an iterator showing predecessors of the contained * elements . This iterator always yields an alias to the same queue , beware * of aliasing problems . e . g : * < code > * iterable : [ 1,2,3,4 ] , trailSize : 3 - > * [ [ Nothing , Nothing , Just 1 ] , [ No...
dbc . precondition ( iterable != null , "cannot create a trails iterator from a null iterable" ) ; return new TrailsIterator < > ( iterable . iterator ( ) , trailSize , Function . identity ( ) ) ;
public class BouncyCastleCertProcessingFactory { /** * Returns a chain of X509Certificate ' s that are instances of X509CertificateObject * This is related to http : / / bugzilla . globus . org / globus / show _ bug . cgi ? id = 4933 * @ param certs input certificate chain * @ return a new chain where all X509Cer...
X509Certificate [ ] bcCerts = new X509Certificate [ certs . length ] ; for ( int i = 0 ; i < certs . length ; i ++ ) { if ( ! ( certs [ i ] instanceof X509CertificateObject ) ) { bcCerts [ i ] = CertificateLoadUtil . loadCertificate ( new ByteArrayInputStream ( certs [ i ] . getEncoded ( ) ) ) ; } else { bcCerts [ i ] ...
public class Log { /** * Various writeXXX ( ) methods are used for logging statements . */ void writeStatement ( Session session , String s ) { } }
try { dbLogWriter . writeLogStatement ( session , s ) ; } catch ( IOException e ) { throw Error . error ( ErrorCode . FILE_IO_ERROR , logFileName ) ; } if ( maxLogSize > 0 && dbLogWriter . size ( ) > maxLogSize ) { database . logger . needsCheckpoint = true ; }
public class CmsTemplateFinder { /** * Returns a bean representing the given template resource . < p > * @ param cms the cms context to use for VFS operations * @ param resource the template resource * @ return bean representing the given template resource * @ throws CmsException if something goes wrong */ priv...
CmsProperty titleProp = cms . readPropertyObject ( resource , CmsPropertyDefinition . PROPERTY_TITLE , false ) ; CmsProperty descProp = cms . readPropertyObject ( resource , CmsPropertyDefinition . PROPERTY_DESCRIPTION , false ) ; CmsProperty imageProp = cms . readPropertyObject ( resource , CmsPropertyDefinition . PRO...
public class TimeBasedKeys { /** * Create a new generator that uses the specified number of bits for the counter portion of the keys . * @ param bitsUsedInCounter the number of bits in the counter portion of the keys ; must be a positive number for which theere * is enough space to left shift without overflowing . ...
CheckArg . isPositive ( bitsUsedInCounter , "bitsUsedInCounter" ) ; int maxAvailableBitsToShift = Long . numberOfLeadingZeros ( System . currentTimeMillis ( ) ) ; CheckArg . isLessThan ( bitsUsedInCounter , maxAvailableBitsToShift , "bitsUsedInCounter" ) ; return new TimeBasedKeys ( ( short ) bitsUsedInCounter ) ;
public class Priority { /** * Converts this priority to its two - character CUA code . * @ return the CUA code ( e . g . " B1 " for " 4 " ) or null if the priority cannot * be converted to a CUA code */ public String toCuaPriority ( ) { } }
if ( value == null || value < 1 || value > 9 ) { return null ; } int letter = ( ( value - 1 ) / 3 ) + 'A' ; int number = ( ( value - 1 ) % 3 ) + 1 ; return ( char ) letter + "" + number ;
public class CommsByteBufferPool { /** * Gets a CommsByteBuffer from the pool . * @ return CommsString */ public synchronized CommsByteBuffer allocate ( ) { } }
if ( tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "allocate" ) ; // Remove a CommsByteBuffer from the pool CommsByteBuffer buff = ( CommsByteBuffer ) pool . remove ( ) ; // If the buffer is null then there was none available in the pool // So create a new one if ( buff == null ) { if ( tc . isDebugEnabled ( ) ...
public class TableDemo { /** * Initializes the frame by creating its contents . */ private void init ( ) { } }
setTitle ( "Validation Framework Test" ) ; setDefaultCloseOperation ( WindowConstants . EXIT_ON_CLOSE ) ; // Add contents JPanel contentPane = new JPanel ( new MigLayout ( "fill, wrap 1" , "[]" , "[grow]unrelated[]" ) ) ; setContentPane ( contentPane ) ; contentPane . add ( new JScrollPane ( table ) , "grow" ) ; instal...
public class ProcessManagerImpl { /** * - - - - - Process Properties */ public synchronized Properties getProcessProperties ( final String processName ) { } }
final NamedProcess namedProcess = processes . get ( processName ) ; return namedProcess == null ? null : namedProcess . getProperties ( ) ;
public class StreamUtils { /** * Determines if a byte array is compressed . The java . util . zip GZip * implementation does not expose the GZip header so it is difficult to determine * if a string is compressed . * Copied from Helix GZipCompressionUtil * @ param bytes an array of bytes * @ return true if the...
if ( ( bytes == null ) || ( bytes . length < 2 ) ) { return false ; } else { return ( ( bytes [ 0 ] == ( byte ) ( GZIPInputStream . GZIP_MAGIC ) ) && ( bytes [ 1 ] == ( byte ) ( GZIPInputStream . GZIP_MAGIC >> 8 ) ) ) ; }
public class BeanUtil { /** * 使用Map填充Bean对象 * @ param < T > Bean类型 * @ param map Map * @ param bean Bean * @ param isIgnoreError 是否忽略注入错误 * @ return Bean */ public static < T > T fillBeanWithMap ( Map < ? , ? > map , T bean , boolean isIgnoreError ) { } }
return fillBeanWithMap ( map , bean , false , isIgnoreError ) ;
public class Predictors { /** * Gets a { @ code Predictor } that puts all of its probability mass on * { @ code outputValue } . * @ param outputValue * @ return */ public static < I , O > Predictor < I , O > constant ( O outputValue ) { } }
Map < O , Double > outputProbabilities = Maps . newHashMap ( ) ; outputProbabilities . put ( outputValue , 1.0 ) ; return new ConstantPredictor < I , O > ( outputProbabilities ) ;
public class UpdateIdentityPoolRequest { /** * Optional key : value pairs mapping provider names to provider app IDs . * @ param supportedLoginProviders * Optional key : value pairs mapping provider names to provider app IDs . * @ return Returns a reference to this object so that method calls can be chained toget...
setSupportedLoginProviders ( supportedLoginProviders ) ; return this ;
public class TaskQueue { /** * Fetch a TaskQueue by name . If the TaskQueue doesn ' t already exist , * creates the TaskQueue . * @ param logger An optional logger . * @ param strQueueName The unique name for the queue . * @ return The TaskQueue associated with the specified name . */ public static TaskQueue ge...
if ( strQueueName == null ) { return null ; } TaskQueue taskQueue = QUEUE_MAP . get ( strQueueName ) ; if ( taskQueue == null ) { taskQueue = new TaskQueue ( logger , strQueueName ) ; QUEUE_MAP . put ( strQueueName , taskQueue ) ; } return taskQueue ;