signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class Iterables { /** * Combines four iterables into a single iterable . The returned iterable has * an iterator that traverses the elements in { @ code a } , followed by the * elements in { @ code b } , followed by the elements in { @ code c } , followed by * the elements in { @ code d } . The source iterators are not polled until * necessary . * < p > The returned iterable ' s iterator supports { @ code remove ( ) } when the * corresponding input iterator supports it . */ public static < T > Iterable < T > concat ( Iterable < ? extends T > a , Iterable < ? extends T > b , Iterable < ? extends T > c , Iterable < ? extends T > d ) { } }
return concat ( ImmutableList . of ( a , b , c , d ) ) ;
public class ListFuncSup { /** * define a function to deal with each element in the list with given * start index * @ param func * a function takes in each element from list and * iterator info * @ param index * the index where to start iteration * @ return return ' last loop value ' . < br > * check * < a href = " https : / / github . com / wkgcass / Style / " > tutorial < / a > for * more info about ' last loop value ' * @ see IteratorInfo */ @ SuppressWarnings ( "unchecked" ) public < R > R forEach ( VFunc2 < T , IteratorInfo < R > > func , int index ) { } }
return ( R ) forEach ( $ ( func ) , index ) ;
public class DNSOutput { /** * Writes an unsigned 16 bit value to the stream . * @ param val The value to be written */ public void writeU16 ( int val ) { } }
check ( val , 16 ) ; need ( 2 ) ; array [ pos ++ ] = ( byte ) ( ( val >>> 8 ) & 0xFF ) ; array [ pos ++ ] = ( byte ) ( val & 0xFF ) ;
public class GrafeasV1Beta1Client { /** * Deletes the specified note . * < p > Sample code : * < pre > < code > * try ( GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client . create ( ) ) { * NoteName name = NoteName . of ( " [ PROJECT ] " , " [ NOTE ] " ) ; * grafeasV1Beta1Client . deleteNote ( name ) ; * < / code > < / pre > * @ param name The name of the note in the form of ` projects / [ PROVIDER _ ID ] / notes / [ NOTE _ ID ] ` . * @ throws com . google . api . gax . rpc . ApiException if the remote call fails */ public final void deleteNote ( NoteName name ) { } }
DeleteNoteRequest request = DeleteNoteRequest . newBuilder ( ) . setName ( name == null ? null : name . toString ( ) ) . build ( ) ; deleteNote ( request ) ;
public class ApiOvhTelephony { /** * Alter this object properties * REST : PUT / telephony / { billingAccount } / rsva / { serviceName } * @ param body [ required ] New object properties * @ param billingAccount [ required ] The name of your billingAccount * @ param serviceName [ required ] */ public void billingAccount_rsva_serviceName_PUT ( String billingAccount , String serviceName , OvhRsva body ) throws IOException { } }
String qPath = "/telephony/{billingAccount}/rsva/{serviceName}" ; StringBuilder sb = path ( qPath , billingAccount , serviceName ) ; exec ( qPath , "PUT" , sb . toString ( ) , body ) ;
public class CmsImportVersion7 { /** * Associates the stored resources to the created organizational units . < p > * This is a global process that occurs only once at the end of the import , * after all resources have been imported , to make sure that the resources * of the organizational units are available . < p > * @ see # addAccountsOrgunitRules ( Digester , String ) * @ see # addXmlDigesterRules ( Digester ) */ public void associateOrgUnitResources ( ) { } }
if ( ( m_orgUnitResources == null ) || m_orgUnitResources . isEmpty ( ) ) { // no organizational resources to associate return ; } String site = getCms ( ) . getRequestContext ( ) . getSiteRoot ( ) ; try { getCms ( ) . getRequestContext ( ) . setSiteRoot ( "" ) ; List < String > orgUnits = new ArrayList < String > ( m_orgUnitResources . keySet ( ) ) ; Collections . sort ( orgUnits ) ; Iterator < String > it = orgUnits . iterator ( ) ; while ( it . hasNext ( ) ) { String orgUnitName = it . next ( ) ; List < String > resources = m_orgUnitResources . get ( orgUnitName ) ; if ( orgUnitName . equals ( "" ) ) { continue ; } Iterator < String > itResources = resources . iterator ( ) ; while ( itResources . hasNext ( ) ) { String resourceName = itResources . next ( ) ; try { // Add the resource to the organizational unit OpenCms . getOrgUnitManager ( ) . addResourceToOrgUnit ( getCms ( ) , orgUnitName , resourceName ) ; } catch ( CmsException e ) { getReport ( ) . addWarning ( e ) ; if ( LOG . isWarnEnabled ( ) ) { LOG . warn ( e . getLocalizedMessage ( ) ) ; } if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( e . getLocalizedMessage ( ) , e ) ; } } } // remove the meanwhile used first resource of the parent organizational unit try { String resName = ( OpenCms . getOrgUnitManager ( ) . getResourcesForOrganizationalUnit ( getCms ( ) , CmsOrganizationalUnit . getParentFqn ( orgUnitName ) ) . get ( 0 ) ) . getRootPath ( ) ; if ( ! resources . contains ( resName ) ) { OpenCms . getOrgUnitManager ( ) . removeResourceFromOrgUnit ( getCms ( ) , orgUnitName , resName ) ; } } catch ( CmsException e ) { getReport ( ) . addWarning ( e ) ; if ( LOG . isWarnEnabled ( ) ) { LOG . warn ( e . getLocalizedMessage ( ) ) ; } if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( e . getLocalizedMessage ( ) , e ) ; } } } } finally { getCms ( ) . getRequestContext ( ) . setSiteRoot ( site ) ; } m_orgUnitResources = null ;
public class Registration { /** * Checks the syntax of the given URL . * @ param url The URL . * @ return true , if valid . */ private boolean checkUrl ( String url ) { } }
try { URI uri = new URI ( url ) ; return uri . isAbsolute ( ) ; } catch ( URISyntaxException e ) { return false ; }
public class AptUtil { /** * Returns unqualified class name ( e . g . String , if java . lang . String ) * NB : This method requires the given element has the kind of { @ link ElementKind # CLASS } . * @ param element * @ return unqualified class name * @ author vvakame */ public static String getNameForNew ( Element element ) { } }
if ( element . getKind ( ) != ElementKind . CLASS ) { throw new IllegalStateException ( ) ; } return getNameForNew ( "" , element ) ;
public class Attributes { /** * Remove an attribute by key . < b > Case sensitive . < / b > * @ param key attribute key to remove */ public void remove ( String key ) { } }
int i = indexOfKey ( key ) ; if ( i != NotFound ) remove ( i ) ;
public class ResolveFileAction { /** * { @ inheritDoc } */ @ Override public void execute ( ExecutorService executor ) { } }
File f = new File ( _locAdmin . resolveString ( _location ) ) ; if ( f . isAbsolute ( ) ) { resolve ( _location , _filesToMonitor ) ; } else { resolve ( AppManagerConstants . SERVER_APPS_DIR + _location , _filesToMonitor ) ; resolve ( AppManagerConstants . SHARED_APPS_DIR + _location , _filesToMonitor ) ; } _mon . setProperty ( FileMonitor . MONITOR_DIRECTORIES , _filesToMonitor ) ; _mon . setProperty ( FileMonitor . MONITOR_FILES , _filesToMonitor ) ; if ( _trigger == UpdateTrigger . DISABLED ) { findFile ( true ) ; } else { _mon . register ( _ctx , FileMonitor . class , this ) ; if ( _container . get ( ) == null ) { if ( _file . get ( ) == null ) { if ( ! FrameworkState . isStopping ( ) ) { // Don ' t issue this message if the server is stopping AppMessageHelper . get ( _handler . get ( ) ) . warning ( "APPLICATION_NOT_FOUND" , _name , _location ) ; } } } }
public class ControllerLinkRelationProvider { /** * ( non - Javadoc ) * @ see org . springframework . hateoas . server . LinkRelationProvider # getCollectionResourceRelFor ( java . lang . Class ) */ @ Override public LinkRelation getCollectionResourceRelFor ( Class < ? > resource ) { } }
LookupContext context = LookupContext . forCollectionResourceRelLookup ( entityType ) ; return providers . getRequiredPluginFor ( context ) . getCollectionResourceRelFor ( resource ) ;
public class BoxApiFile { /** * Gets a request to fetch the upload session using the upload session id . It contains the number of parts that are processed so far , * the total number of parts required for the commit and expiration date and time of the upload session . * @ return the status . */ public BoxRequestsFile . GetUploadSession getUploadSession ( String uploadSessionId ) { } }
return new BoxRequestsFile . GetUploadSession ( uploadSessionId , getUploadSessionInfoUrl ( uploadSessionId ) , mSession ) ;
public class R2jsUtils { /** * Parse an expression containing multiple lines , functions or sub - expressions * in a list of inline sub - expressions . This function also cleanup comments . * @ param expr expression to parse * @ return a list of inline sub - expressions */ public static List < String > parse ( String expr ) { } }
List < String > expressions = new ArrayList < > ( ) ; int parenthesis = 0 ; // ' ( ' and ' ) ' int brackets = 0 ; // ' { ' and ' } ' int brackets2 = 0 ; // ' [ ' and ' ] ' String [ ] lines = expr . split ( "\n" ) ; StringBuilder sb = new StringBuilder ( ) ; for ( String line : lines ) { line = line . trim ( ) ; if ( line . startsWith ( "#" ) ) { // Ignore commented lines } else { char currentChar = 0 ; for ( int i = 0 ; i < line . length ( ) ; i ++ ) { currentChar = line . charAt ( i ) ; if ( currentChar == '#' ) { // Ignore rest of line line = line . substring ( 0 , i ) ; break ; } else if ( currentChar == '(' ) { parenthesis ++ ; } else if ( currentChar == ')' ) { parenthesis -- ; } else if ( currentChar == '{' ) { brackets ++ ; } else if ( currentChar == '}' ) { brackets -- ; } else if ( currentChar == '[' ) { brackets2 ++ ; } else if ( currentChar == ']' ) { brackets2 -- ; } else if ( parenthesis == 0 && brackets == 0 && brackets2 == 0 ) { if ( currentChar == ';' ) { String firstLine = line . substring ( 0 , i + 1 ) ; sb . append ( firstLine ) ; expressions . add ( sb . toString ( ) ) ; sb = new StringBuilder ( ) ; String remainder = line . substring ( i + 1 ) ; line = remainder . trim ( ) + "\n" ; i = 0 ; } } } if ( line . trim ( ) . length ( ) > 0 ) { sb . append ( line ) ; if ( parenthesis == 0 && brackets == 0 && brackets2 == 0 ) { expressions . add ( sb . toString ( ) ) ; sb = new StringBuilder ( ) ; } else { if ( currentChar != ',' && currentChar != '+' && currentChar != '-' && currentChar != '*' && currentChar != '/' && currentChar != '=' ) sb . append ( ";\n" ) ; } } } } return expressions ;
public class BoneCP { /** * Return total number of connections created in all partitions . * @ return number of created connections */ public int getTotalCreatedConnections ( ) { } }
int total = 0 ; for ( int i = 0 ; i < this . partitionCount && this . partitions [ i ] != null ; i ++ ) { total += this . partitions [ i ] . getCreatedConnections ( ) ; } return total ;
public class BrowserPattern { /** * Compares all attributes of this instance with the given instance of a { @ code BrowserPattern } . * This method is < em > consistent with equals < / em > . * @ param other * another instance of { @ code OperatingSystemPattern } * @ return negative value if one of the attributes of this instance is less , 0 if equal , or positive value if * greater than the other one */ @ Override public int compareTo ( final BrowserPattern other ) { } }
int result = other == null ? - 1 : 0 ; if ( result == 0 ) { result = compareInt ( getPosition ( ) , other . getPosition ( ) ) ; if ( result == 0 ) { result = compareInt ( getId ( ) , other . getId ( ) ) ; } if ( result == 0 ) { result = getPattern ( ) . pattern ( ) . compareTo ( other . getPattern ( ) . pattern ( ) ) ; } if ( result == 0 ) { result = compareInt ( getPattern ( ) . flags ( ) , other . getPattern ( ) . flags ( ) ) ; } } return result ;
public class CORSFilter { /** * Parses each param - value and populates configuration variables . If a param is provided , it overrides the default . * @ param allowedOrigins A { @ link String } of comma separated origins . * @ param allowedHttpMethods A { @ link String } of comma separated HTTP methods . * @ param allowedHttpHeaders A { @ link String } of comma separated HTTP headers . * @ param exposedHeaders A { @ link String } of comma separated headers that needs to be exposed . * @ param supportsCredentials " true " if support credentials needs to be enabled . * @ param preflightMaxAge The amount of seconds the user agent is allowed to cache the result of the pre - flight * request . * @ param loggingEnabled Flag to control logging to access log . * @ throws ServletException ex */ private void parseAndStore ( final String allowedOrigins , final String allowedHttpMethods , final String allowedHttpHeaders , final String exposedHeaders , final String supportsCredentials , final String preflightMaxAge , final String loggingEnabled , final String decorateRequest ) throws ServletException { } }
if ( allowedOrigins != null ) { if ( allowedOrigins . trim ( ) . equals ( "*" ) ) { this . anyOriginAllowed = true ; } else { this . anyOriginAllowed = false ; Set < String > setAllowedOrigins = parseStringToSet ( allowedOrigins ) ; this . allowedOrigins . clear ( ) ; this . allowedOrigins . addAll ( setAllowedOrigins ) ; } } if ( allowedHttpMethods != null ) { Set < String > setAllowedHttpMethods = parseStringToSet ( allowedHttpMethods ) ; this . allowedHttpMethods . clear ( ) ; this . allowedHttpMethods . addAll ( setAllowedHttpMethods ) ; } if ( allowedHttpHeaders != null ) { Set < String > setAllowedHttpHeaders = parseStringToSet ( allowedHttpHeaders ) ; Set < String > lowerCaseHeaders = new HashSet < > ( ) ; for ( String header : setAllowedHttpHeaders ) { String lowerCase = header . toLowerCase ( ) ; lowerCaseHeaders . add ( lowerCase ) ; } this . allowedHttpHeaders . clear ( ) ; this . allowedHttpHeaders . addAll ( lowerCaseHeaders ) ; } if ( exposedHeaders != null ) { Set < String > setExposedHeaders = parseStringToSet ( exposedHeaders ) ; this . exposedHeaders . clear ( ) ; this . exposedHeaders . addAll ( setExposedHeaders ) ; } if ( supportsCredentials != null ) { // For any value other then ' true ' this will be false . this . supportsCredentials = Boolean . parseBoolean ( supportsCredentials ) ; } if ( preflightMaxAge != null ) { try { if ( ! preflightMaxAge . isEmpty ( ) ) { this . preflightMaxAge = Long . parseLong ( preflightMaxAge ) ; } else { this . preflightMaxAge = 0L ; } } catch ( NumberFormatException e ) { throw new ServletException ( "Unable to parse preflightMaxAge" , e ) ; } } if ( loggingEnabled != null ) { // For any value other then ' true ' this will be false . this . loggingEnabled = Boolean . parseBoolean ( loggingEnabled ) ; } if ( decorateRequest != null ) { // For any value other then ' true ' this will be false . this . decorateRequest = Boolean . parseBoolean ( decorateRequest ) ; }
public class MimeTypeUtil { /** * Detects the mime type of a binary resource ( nt : file , nt : resource or another asset type ) . * @ param resource the binary resource * @ param defaultValue the default value if the detection has no useful result * @ return he detected mime type or the default value given */ public static String getMimeType ( Resource resource , String defaultValue ) { } }
MimeType mimeType = getMimeType ( resource ) ; return mimeType != null ? mimeType . toString ( ) : defaultValue ;
public class CSVDirConfiguration { /** * from http : / / hsqldb . org / doc / 2.0 / guide / texttables - chapt . html # ttc _ configuration * @ return field delimiter expression to be used with HSQLDB */ public String getEscapedFieldDelimiter ( ) { } }
final String escaped ; switch ( fieldDelimiter ) { case ';' : escaped = "\\semi" ; break ; case '\'' : escaped = "\\quote" ; break ; case ' ' : escaped = "\\space" ; break ; case '`' : escaped = "\\apos" ; break ; default : escaped = String . valueOf ( fieldDelimiter ) ; } return escaped ;
public class CProductLocalServiceWrapper { /** * Returns a range of all the c products . * Useful when paginating results . Returns a maximum of < code > end - start < / code > instances . < code > start < / code > and < code > end < / code > are not primary keys , they are indexes in the result set . Thus , < code > 0 < / code > refers to the first result in the set . Setting both < code > start < / code > and < code > end < / code > to { @ link com . liferay . portal . kernel . dao . orm . QueryUtil # ALL _ POS } will return the full result set . If < code > orderByComparator < / code > is specified , then the query will include the given ORDER BY logic . If < code > orderByComparator < / code > is absent and pagination is required ( < code > start < / code > and < code > end < / code > are not { @ link com . liferay . portal . kernel . dao . orm . QueryUtil # ALL _ POS } ) , then the query will include the default ORDER BY logic from { @ link com . liferay . commerce . product . model . impl . CProductModelImpl } . If both < code > orderByComparator < / code > and pagination are absent , for performance reasons , the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order . * @ param start the lower bound of the range of c products * @ param end the upper bound of the range of c products ( not inclusive ) * @ return the range of c products */ @ Override public java . util . List < com . liferay . commerce . product . model . CProduct > getCProducts ( int start , int end ) { } }
return _cProductLocalService . getCProducts ( start , end ) ;
public class Webhook { /** * Create a WebhookCreator to execute create . * @ param pathSessionSid The unique id of the Session for this webhook . * @ param target The target of this webhook . * @ return WebhookCreator capable of executing the create */ public static WebhookCreator creator ( final String pathSessionSid , final Webhook . Target target ) { } }
return new WebhookCreator ( pathSessionSid , target ) ;
public class GoogleHadoopFileSystemBase { /** * { @ inheritDoc } * < p > Returns the service if delegation tokens are configured , otherwise , null . */ @ Override public String getCanonicalServiceName ( ) { } }
String service = null ; if ( delegationTokens != null ) { service = delegationTokens . getService ( ) . toString ( ) ; } logger . atFine ( ) . log ( "GHFS.getCanonicalServiceName:=> %s" , service ) ; return service ;
public class StatisticsJDBCStorageConnection { /** * { @ inheritDoc } */ public boolean isOpened ( ) { } }
Statistics s = ALL_STATISTICS . get ( IS_OPENED_DESCR ) ; try { s . begin ( ) ; return wcs . isOpened ( ) ; } finally { s . end ( ) ; }
public class RequestLaunchTemplateData { /** * The elastic inference accelerator for the instance . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setElasticInferenceAccelerators ( java . util . Collection ) } or * { @ link # withElasticInferenceAccelerators ( java . util . Collection ) } if you want to override the existing values . * @ param elasticInferenceAccelerators * The elastic inference accelerator for the instance . * @ return Returns a reference to this object so that method calls can be chained together . */ public RequestLaunchTemplateData withElasticInferenceAccelerators ( LaunchTemplateElasticInferenceAccelerator ... elasticInferenceAccelerators ) { } }
if ( this . elasticInferenceAccelerators == null ) { setElasticInferenceAccelerators ( new com . amazonaws . internal . SdkInternalList < LaunchTemplateElasticInferenceAccelerator > ( elasticInferenceAccelerators . length ) ) ; } for ( LaunchTemplateElasticInferenceAccelerator ele : elasticInferenceAccelerators ) { this . elasticInferenceAccelerators . add ( ele ) ; } return this ;
public class MapperScannerConfigurer { /** * BeanDefinitionRegistries are called early in application startup , before * BeanFactoryPostProcessors . This means that PropertyResourceConfigurers will not have been * loaded and any property substitution of this class ' properties will fail . To avoid this , find * any PropertyResourceConfigurers defined in the context and run them on this class ' bean * definition . Then update the values . */ private void processPropertyPlaceHolders ( ) { } }
Map < String , PropertyResourceConfigurer > prcs = applicationContext . getBeansOfType ( PropertyResourceConfigurer . class ) ; if ( ! prcs . isEmpty ( ) && applicationContext instanceof ConfigurableApplicationContext ) { BeanDefinition mapperScannerBean = ( ( ConfigurableApplicationContext ) applicationContext ) . getBeanFactory ( ) . getBeanDefinition ( beanName ) ; // PropertyResourceConfigurer does not expose any methods to explicitly perform // property placeholder substitution . Instead , create a BeanFactory that just // contains this mapper scanner and post process the factory . DefaultListableBeanFactory factory = new DefaultListableBeanFactory ( ) ; factory . registerBeanDefinition ( beanName , mapperScannerBean ) ; for ( PropertyResourceConfigurer prc : prcs . values ( ) ) { prc . postProcessBeanFactory ( factory ) ; } PropertyValues values = mapperScannerBean . getPropertyValues ( ) ; this . basePackage = updatePropertyValue ( "basePackage" , values ) ; this . sqlSessionFactoryBeanName = updatePropertyValue ( "sqlSessionFactoryBeanName" , values ) ; this . sqlSessionTemplateBeanName = updatePropertyValue ( "sqlSessionTemplateBeanName" , values ) ; }
public class SREConfigurationBlock { /** * Invoked when the user want to search for a SARL runtime environment . */ protected void handleInstalledSREsButtonSelected ( ) { } }
PreferencesUtil . createPreferenceDialogOn ( getControl ( ) . getShell ( ) , SREsPreferencePage . ID , new String [ ] { SREsPreferencePage . ID } , null ) . open ( ) ;
public class ProgressiveRendering { /** * { @ link BoundObjectTable # releaseMe } just cannot work the way we need it to . */ private void release ( ) { } }
try { Method release = BoundObjectTable . Table . class . getDeclaredMethod ( "release" , String . class ) ; release . setAccessible ( true ) ; release . invoke ( boundObjectTable , boundId ) ; } catch ( Exception x ) { LOG . log ( Level . WARNING , "failed to unbind " + boundId , x ) ; }
public class PooledByteArrayBufferedInputStream { /** * Checks if there is some data left in the buffer . If not but buffered stream still has some * data to be read , then more data is buffered . * @ return false if and only if there is no more data and underlying input stream has no more data * to be read * @ throws IOException */ private boolean ensureDataInBuffer ( ) throws IOException { } }
if ( mBufferOffset < mBufferedSize ) { return true ; } final int readData = mInputStream . read ( mByteArray ) ; if ( readData <= 0 ) { return false ; } mBufferedSize = readData ; mBufferOffset = 0 ; return true ;
public class ClassPathUtils { /** * Scan the classpath string provided , and collect a set of package paths found in jars and classes on the path . * On the resulting path set , first exclude those that match any exclude prefixes , and then include * those that match a set of include prefixes . * @ param classPath the classpath string * @ param excludeJarSet a set of jars to exclude from scanning * @ param excludePrefixes a set of path prefixes that determine what is excluded * @ param includePrefixes a set of path prefixes that determine what is included * @ return the results of the scan , as a set of package paths ( separated by ' / ' ) . */ public static Set < String > scanClassPath ( final String classPath , final Set < String > excludeJarSet , final Set < String > excludePrefixes , final Set < String > includePrefixes ) { } }
final Set < String > pathSet = new HashSet < String > ( ) ; // Defer to JDKPaths to do the actual classpath scanning . __JDKPaths . processClassPathItem ( classPath , excludeJarSet , pathSet ) ; return filterPathSet ( pathSet , excludePrefixes , includePrefixes ) ;
public class StreamScanner { /** * Method that does full resolution of an entity reference , be it * character entity , internal entity or external entity , including * updating of input buffers , and depending on whether result is * a character entity ( or one of 5 pre - defined entities ) , returns * char in question , or null character ( code 0 ) to indicate it had * to change input source . * @ param allowExt If true , is allowed to expand external entities * ( expanding text ) ; if false , is not ( expanding attribute value ) . * @ return Either single - character replacement ( which is NOT to be * reparsed ) , or null char ( 0 ) to indicate expansion is done via * input source . */ protected int fullyResolveEntity ( boolean allowExt ) throws XMLStreamException { } }
char c = getNextCharFromCurrent ( SUFFIX_IN_ENTITY_REF ) ; // Do we have a ( numeric ) character entity reference ? if ( c == '#' ) { // numeric final StringBuffer originalSurface = new StringBuffer ( "#" ) ; int ch = resolveCharEnt ( originalSurface ) ; if ( mCfgTreatCharRefsAsEntities ) { final char [ ] originalChars = new char [ originalSurface . length ( ) ] ; originalSurface . getChars ( 0 , originalSurface . length ( ) , originalChars , 0 ) ; mCurrEntity = getIntEntity ( ch , originalChars ) ; return 0 ; } return ch ; } String id = parseEntityName ( c ) ; // Perhaps we have a pre - defined char reference ? c = id . charAt ( 0 ) ; /* * 16 - May - 2004 , TSa : Should custom entities ( or ones defined in int / ext subset ) override * pre - defined settings for these ? */ char d = CHAR_NULL ; if ( c == 'a' ) { // amp or apos ? if ( id . equals ( "amp" ) ) { d = '&' ; } else if ( id . equals ( "apos" ) ) { d = '\'' ; } } else if ( c == 'g' ) { // gt ? if ( id . length ( ) == 2 && id . charAt ( 1 ) == 't' ) { d = '>' ; } } else if ( c == 'l' ) { // lt ? if ( id . length ( ) == 2 && id . charAt ( 1 ) == 't' ) { d = '<' ; } } else if ( c == 'q' ) { // quot ? if ( id . equals ( "quot" ) ) { d = '"' ; } } if ( d != CHAR_NULL ) { if ( mCfgTreatCharRefsAsEntities ) { final char [ ] originalChars = new char [ id . length ( ) ] ; id . getChars ( 0 , id . length ( ) , originalChars , 0 ) ; mCurrEntity = getIntEntity ( d , originalChars ) ; return 0 ; } return d ; } final EntityDecl e = expandEntity ( id , allowExt , null ) ; if ( mCfgTreatCharRefsAsEntities ) { mCurrEntity = e ; } return 0 ;
public class CreateIbanLengthMapConstantsClass { /** * Instantiates a class via deferred binding . * @ return the new instance , which must be cast to the requested class */ public static IbanLengthMapSharedConstants create ( ) { } }
if ( ibanLengthMapConstants == null ) { // NOPMD it ' s thread save ! synchronized ( IbanLengthMapConstantsClient . class ) { if ( ibanLengthMapConstants == null ) { final IbanLengthMapConstants ibanLengthMap = GWT . create ( IbanLengthMapConstants . class ) ; ibanLengthMapConstants = new IbanLengthMapConstantsClient ( ibanLengthMap . ibanLengths ( ) ) ; } } } return ibanLengthMapConstants ;
public class DataStorage { /** * Analyze which and whether a transition of the fs state is required and * perform it if necessary . * Rollback if ( previousLV > = LAYOUT _ VERSION & & previousLV > * FEDERATION _ VERSION ) * Upgrade if this . LV > LAYOUT _ VERSION & & this . LV > FEDERATION _ VERSION * Regular startup if this . LV = LAYOUT _ VERSION & & this . cTime = namenode . cTime * @ param nsInfo * namespace info * @ param startOpt * startup option * @ throws IOException */ private void doTransition ( List < StorageDirectory > sds , NamespaceInfo nsInfo , StartupOption startOpt ) throws IOException { } }
if ( startOpt == StartupOption . ROLLBACK ) doRollback ( nsInfo ) ; // rollback if applicable int numOfDirs = sds . size ( ) ; List < StorageDirectory > dirsToUpgrade = new ArrayList < StorageDirectory > ( numOfDirs ) ; List < StorageInfo > dirsInfo = new ArrayList < StorageInfo > ( numOfDirs ) ; for ( StorageDirectory sd : sds ) { sd . read ( ) ; layoutMap . put ( sd . getRoot ( ) , this . layoutVersion ) ; checkVersionUpgradable ( this . layoutVersion ) ; assert this . layoutVersion >= FSConstants . LAYOUT_VERSION : "Future version is not allowed" ; boolean federationSupported = this . layoutVersion <= FSConstants . FEDERATION_VERSION ; // For pre - federation version - validate the namespaceID if ( ! federationSupported && getNamespaceID ( ) != nsInfo . getNamespaceID ( ) ) { sd . unlock ( ) ; throw new IOException ( "Incompatible namespaceIDs in " + sd . getRoot ( ) . getCanonicalPath ( ) + ": namenode namespaceID = " + nsInfo . getNamespaceID ( ) + "; datanode namespaceID = " + getNamespaceID ( ) ) ; } if ( this . layoutVersion == FSConstants . LAYOUT_VERSION && this . cTime == nsInfo . getCTime ( ) ) continue ; // regular startup // verify necessity of a distributed upgrade verifyDistributedUpgradeProgress ( nsInfo ) ; // do a global upgrade iff layout version changes and current layout is // older than FEDERATION . if ( this . layoutVersion > FSConstants . LAYOUT_VERSION && this . layoutVersion > FSConstants . FEDERATION_VERSION ) { if ( isNsLevelUpgraded ( getNamespaceID ( ) , sd ) ) { throw new IOException ( "Ns level directory already upgraded for : " + sd . getRoot ( ) + " ignoring upgrade" ) ; } dirsToUpgrade . add ( sd ) ; // upgrade dirsInfo . add ( new StorageInfo ( this ) ) ; continue ; } if ( this . cTime >= nsInfo . getCTime ( ) ) { // layoutVersion = = LAYOUT _ VERSION & & this . cTime > nsInfo . cTime // must shutdown sd . unlock ( ) ; throw new IOException ( "Datanode state: LV = " + this . getLayoutVersion ( ) + " CTime = " + this . getCTime ( ) + " is newer than the namespace state: LV = " + nsInfo . getLayoutVersion ( ) + " CTime = " + nsInfo . getCTime ( ) ) ; } } // Now do upgrade if dirsToUpgrade is not empty if ( ! dirsToUpgrade . isEmpty ( ) ) { doUpgrade ( dirsToUpgrade , dirsInfo , nsInfo ) ; }
public class JsonGetterContextCache { /** * Cleanup on best effort basis . Concurrent calls to this method may * leave the cache empty . In that case , lost entries are re - cached * at a later call to { @ link # getContext ( String ) } . * @ param excluded */ private void cleanupIfNeccessary ( JsonGetterContext excluded ) { } }
int cacheCount ; while ( ( cacheCount = internalCache . size ( ) ) > maxContexts ) { int sampleCount = Math . max ( cacheCount - maxContexts , cleanupRemoveAtLeastItems ) + 1 ; for ( SamplingEntry sample : internalCache . getRandomSamples ( sampleCount ) ) { if ( excluded != sample . getEntryValue ( ) ) { internalCache . remove ( sample . getEntryKey ( ) ) ; } } }
public class DeviceTemplateMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DeviceTemplate deviceTemplate , ProtocolMarshaller protocolMarshaller ) { } }
if ( deviceTemplate == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( deviceTemplate . getDeviceType ( ) , DEVICETYPE_BINDING ) ; protocolMarshaller . marshall ( deviceTemplate . getCallbackOverrides ( ) , CALLBACKOVERRIDES_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class StatsTraceContext { /** * See { @ link StreamTracer # inboundMessageRead } . * < p > Called from { @ link io . grpc . internal . MessageDeframer } . */ public void inboundMessageRead ( int seqNo , long optionalWireSize , long optionalUncompressedSize ) { } }
for ( StreamTracer tracer : tracers ) { tracer . inboundMessageRead ( seqNo , optionalWireSize , optionalUncompressedSize ) ; }
public class ComputeNodesImpl { /** * Gets information about the specified compute node . * @ param poolId The ID of the pool that contains the compute node . * @ param nodeId The ID of the compute node that you want to get information about . * @ param computeNodeGetOptions Additional parameters for the operation * @ param serviceCallback the async ServiceCallback to handle successful and failed responses . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the { @ link ServiceFuture } object */ public ServiceFuture < ComputeNode > getAsync ( String poolId , String nodeId , ComputeNodeGetOptions computeNodeGetOptions , final ServiceCallback < ComputeNode > serviceCallback ) { } }
return ServiceFuture . fromHeaderResponse ( getWithServiceResponseAsync ( poolId , nodeId , computeNodeGetOptions ) , serviceCallback ) ;
public class CreateResolverEndpointRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( CreateResolverEndpointRequest createResolverEndpointRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( createResolverEndpointRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( createResolverEndpointRequest . getCreatorRequestId ( ) , CREATORREQUESTID_BINDING ) ; protocolMarshaller . marshall ( createResolverEndpointRequest . getName ( ) , NAME_BINDING ) ; protocolMarshaller . marshall ( createResolverEndpointRequest . getSecurityGroupIds ( ) , SECURITYGROUPIDS_BINDING ) ; protocolMarshaller . marshall ( createResolverEndpointRequest . getDirection ( ) , DIRECTION_BINDING ) ; protocolMarshaller . marshall ( createResolverEndpointRequest . getIpAddresses ( ) , IPADDRESSES_BINDING ) ; protocolMarshaller . marshall ( createResolverEndpointRequest . getTags ( ) , TAGS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class HasInputStream { /** * Create a new object with a supplier that can read multiple times . * @ param aISP * { @ link InputStream } provider . May not be < code > null < / code > . * @ return Never < code > null < / code > . */ @ Nonnull @ ReturnsMutableCopy public static HasInputStream multiple ( @ Nonnull final ISupplier < ? extends InputStream > aISP ) { } }
return new HasInputStream ( aISP , true ) ;
public class IpUtil { /** * 获取ip位置信息 * @ param ip ip地址 * @ return json数据 * @ throws IOException io异常 */ public static JSONObject getIpInfo ( String ip ) throws IOException { } }
String param = "?ip=" + ip ; String ipInfoStr = getIpInfoByIp ( URL . IP_INFO_URI + param ) ; JSONObject jsonObject = JSON . parseObject ( ipInfoStr ) ; Integer code = ( Integer ) jsonObject . get ( "code" ) ; if ( code == 0 ) { return jsonObject . getJSONObject ( "data" ) ; } return null ;
public class CmsUserInfo { /** * Creates an user image upload button . < p > * @ param label the label to use * @ param icon the icon to use * @ param user the user * @ param uploadListener the upload listener * @ return the button */ private CmsUploadButton createImageUploadButton ( String label , Resource icon , CmsUser user , I_UploadListener uploadListener ) { } }
CmsUploadButton uploadButton = new CmsUploadButton ( CmsUserIconHelper . USER_IMAGE_FOLDER + CmsUserIconHelper . TEMP_FOLDER ) ; if ( label != null ) { uploadButton . setCaption ( label ) ; } if ( icon != null ) { uploadButton . setIcon ( icon ) ; } uploadButton . getState ( ) . setUploadType ( UploadType . singlefile ) ; uploadButton . getState ( ) . setTargetFileNamePrefix ( user . getId ( ) . toString ( ) ) ; uploadButton . getState ( ) . setDialogTitle ( CmsVaadinUtils . getMessageText ( Messages . GUI_USER_INFO_UPLOAD_IMAGE_DIALOG_TITLE_0 ) ) ; uploadButton . addUploadListener ( uploadListener ) ; return uploadButton ;
public class AmazonRoute53Client { /** * Creates a new public or private hosted zone . You create records in a public hosted zone to define how you want to * route traffic on the internet for a domain , such as example . com , and its subdomains ( apex . example . com , * acme . example . com ) . You create records in a private hosted zone to define how you want to route traffic for a * domain and its subdomains within one or more Amazon Virtual Private Clouds ( Amazon VPCs ) . * < important > * You can ' t convert a public hosted zone to a private hosted zone or vice versa . Instead , you must create a new * hosted zone with the same name and create new resource record sets . * < / important > * For more information about charges for hosted zones , see < a href = " http : / / aws . amazon . com / route53 / pricing / " > Amazon * Route 53 Pricing < / a > . * Note the following : * < ul > * < li > * You can ' t create a hosted zone for a top - level domain ( TLD ) such as . com . * < / li > * < li > * For public hosted zones , Amazon Route 53 automatically creates a default SOA record and four NS records for the * zone . For more information about SOA and NS records , see < a * href = " http : / / docs . aws . amazon . com / Route53 / latest / DeveloperGuide / SOA - NSrecords . html " > NS and SOA Records that Route * 53 Creates for a Hosted Zone < / a > in the < i > Amazon Route 53 Developer Guide < / i > . * If you want to use the same name servers for multiple public hosted zones , you can optionally associate a * reusable delegation set with the hosted zone . See the < code > DelegationSetId < / code > element . * < / li > * < li > * If your domain is registered with a registrar other than Route 53 , you must update the name servers with your * registrar to make Route 53 the DNS service for the domain . For more information , see < a * href = " http : / / docs . aws . amazon . com / Route53 / latest / DeveloperGuide / MigratingDNS . html " > Migrating DNS Service for an * Existing Domain to Amazon Route 53 < / a > in the < i > Amazon Route 53 Developer Guide < / i > . * < / li > * < / ul > * When you submit a < code > CreateHostedZone < / code > request , the initial status of the hosted zone is * < code > PENDING < / code > . For public hosted zones , this means that the NS and SOA records are not yet available on * all Route 53 DNS servers . When the NS and SOA records are available , the status of the zone changes to * < code > INSYNC < / code > . * @ param createHostedZoneRequest * A complex type that contains information about the request to create a public or private hosted zone . * @ return Result of the CreateHostedZone operation returned by the service . * @ throws InvalidDomainNameException * The specified domain name is not valid . * @ throws HostedZoneAlreadyExistsException * The hosted zone you ' re trying to create already exists . Amazon Route 53 returns this error when a hosted * zone has already been created with the specified < code > CallerReference < / code > . * @ throws TooManyHostedZonesException * This operation can ' t be completed either because the current account has reached the limit on the number * of hosted zones or because you ' ve reached the limit on the number of hosted zones that can be associated * with a reusable delegation set . < / p > * For information about default limits , see < a * href = " https : / / docs . aws . amazon . com / Route53 / latest / DeveloperGuide / DNSLimitations . html " > Limits < / a > in the * < i > Amazon Route 53 Developer Guide < / i > . * To get the current limit on hosted zones that can be created by an account , see < a * href = " https : / / docs . aws . amazon . com / Route53 / latest / APIReference / API _ GetAccountLimit . html " * > GetAccountLimit < / a > . * To get the current limit on hosted zones that can be associated with a reusable delegation set , see < a * href = " https : / / docs . aws . amazon . com / Route53 / latest / APIReference / API _ GetReusableDelegationSetLimit . html " > * GetReusableDelegationSetLimit < / a > . * To request a higher limit , < a href = " http : / / aws . amazon . com / route53 - request " > create a case < / a > with the AWS * Support Center . * @ throws InvalidVPCIdException * The VPC ID that you specified either isn ' t a valid ID or the current account is not authorized to access * this VPC . * @ throws InvalidInputException * The input is not valid . * @ throws DelegationSetNotAvailableException * You can create a hosted zone that has the same name as an existing hosted zone ( example . com is common ) , * but there is a limit to the number of hosted zones that have the same name . If you get this error , Amazon * Route 53 has reached that limit . If you own the domain name and Route 53 generates this error , contact * Customer Support . * @ throws ConflictingDomainExistsException * The cause of this error depends on whether you ' re trying to create a public or a private hosted zone : * < ul > * < li > * < b > Public hosted zone : < / b > Two hosted zones that have the same name or that have a parent / child * relationship ( example . com and test . example . com ) can ' t have any common name servers . You tried to create a * hosted zone that has the same name as an existing hosted zone or that ' s the parent or child of an * existing hosted zone , and you specified a delegation set that shares one or more name servers with the * existing hosted zone . For more information , see < a * href = " https : / / docs . aws . amazon . com / Route53 / latest / APIReference / API _ CreateReusableDelegationSet . html " * > CreateReusableDelegationSet < / a > . * < / li > * < li > * < b > Private hosted zone : < / b > You specified an Amazon VPC that you ' re already using for another hosted * zone , and the domain that you specified for one of the hosted zones is a subdomain of the domain that you * specified for the other hosted zone . For example , you can ' t use the same Amazon VPC for the hosted zones * for example . com and test . example . com . * < / li > * @ throws NoSuchDelegationSetException * A reusable delegation set with the specified ID does not exist . * @ throws DelegationSetNotReusableException * A reusable delegation set with the specified ID does not exist . * @ sample AmazonRoute53 . CreateHostedZone * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / route53-2013-04-01 / CreateHostedZone " target = " _ top " > AWS API * Documentation < / a > */ @ Override public CreateHostedZoneResult createHostedZone ( CreateHostedZoneRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeCreateHostedZone ( request ) ;
public class AbstractCachedGenerator { /** * Adds the linked resource to the linked resource map * @ param path * the resource path * @ param context * the generator context * @ param fMapping * the file path mapping linked to the resource */ protected void addLinkedResources ( String path , GeneratorContext context , FilePathMapping fMapping ) { } }
addLinkedResources ( path , context , Arrays . asList ( fMapping ) ) ;
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EClass getIfcCartesianTransformationOperator ( ) { } }
if ( ifcCartesianTransformationOperatorEClass == null ) { ifcCartesianTransformationOperatorEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 81 ) ; } return ifcCartesianTransformationOperatorEClass ;
public class Feed { /** * Gets the systemFeedGenerationData value for this Feed . * @ return systemFeedGenerationData * The system data for the Feed . This data specifies information * for generating the feed items * of the system generated feed . * < span class = " constraint Selectable " > This field can * be selected using the value " SystemFeedGenerationData " . < / span > */ public com . google . api . ads . adwords . axis . v201809 . cm . SystemFeedGenerationData getSystemFeedGenerationData ( ) { } }
return systemFeedGenerationData ;
public class WavImpl { /** * Flush and close audio data and stream . * @ param input The audio input . * @ param dataLine Audio source data . * @ throws IOException If error on closing . */ private static void close ( AudioInputStream input , DataLine dataLine ) throws IOException { } }
dataLine . drain ( ) ; dataLine . flush ( ) ; dataLine . stop ( ) ; dataLine . close ( ) ; input . close ( ) ;
public class ComputeNodesImpl { /** * Disables task scheduling on the specified compute node . * You can disable task scheduling on a node only if its current scheduling state is enabled . * @ param poolId The ID of the pool that contains the compute node . * @ param nodeId The ID of the compute node on which you want to disable task scheduling . * @ param nodeDisableSchedulingOption What to do with currently running tasks when disabling task scheduling on the compute node . The default value is requeue . Possible values include : ' requeue ' , ' terminate ' , ' taskCompletion ' * @ param computeNodeDisableSchedulingOptions Additional parameters for the operation * @ throws IllegalArgumentException thrown if parameters fail the validation * @ throws BatchErrorException thrown if the request is rejected by server * @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent */ public void disableScheduling ( String poolId , String nodeId , DisableComputeNodeSchedulingOption nodeDisableSchedulingOption , ComputeNodeDisableSchedulingOptions computeNodeDisableSchedulingOptions ) { } }
disableSchedulingWithServiceResponseAsync ( poolId , nodeId , nodeDisableSchedulingOption , computeNodeDisableSchedulingOptions ) . toBlocking ( ) . single ( ) . body ( ) ;
public class AbstractFCKConnector { /** * Return FCKeditor current folder path . * @ param context * @ return String path */ protected String getCurrentFolderPath ( GenericWebAppContext context ) { } }
// To limit browsing set Servlet init param " digitalAssetsPath " with desired JCR path String rootFolderStr = ( String ) context . get ( "org.exoplatform.frameworks.jcr.command.web.fckeditor.digitalAssetsPath" ) ; if ( rootFolderStr == null ) rootFolderStr = "/" ; // set current folder String currentFolderStr = ( String ) context . get ( "CurrentFolder" ) ; if ( currentFolderStr == null ) currentFolderStr = "" ; else if ( currentFolderStr . length ( ) < rootFolderStr . length ( ) ) currentFolderStr = rootFolderStr ; return currentFolderStr ;
public class HeadersSerializer { /** * Gets a module wrapping this serializer as an adapter for the Jackson * ObjectMapper . * @ return a simple module to be plugged onto Jackson ObjectMapper . */ public static SimpleModule getModule ( ) { } }
SimpleModule module = new SimpleModule ( ) ; module . addSerializer ( Headers . class , new HeadersSerializer ( ) ) ; return module ;
public class Selectable { /** * Selector that matches any descendant element with a given name that satisfies the * specified constraints . If no constraints are provided , accepts all descendant elements * with the given name . * @ param qname element QName * @ param constraints element constraints * @ return element selector */ public final ElementSelector < T > descendant ( QName qname , ElementConstraint ... constraints ) { } }
ElementEqualsConstraint nameConstraint = new ElementEqualsConstraint ( qname ) ; return new DescendantSelector < T > ( getContext ( ) , getCurrentSelector ( ) , ElementSelector . gatherConstraints ( nameConstraint , constraints ) ) ;
public class CPRuleUserSegmentRelPersistenceImpl { /** * Returns the cp rule user segment rel with the primary key or returns < code > null < / code > if it could not be found . * @ param primaryKey the primary key of the cp rule user segment rel * @ return the cp rule user segment rel , or < code > null < / code > if a cp rule user segment rel with the primary key could not be found */ @ Override public CPRuleUserSegmentRel fetchByPrimaryKey ( Serializable primaryKey ) { } }
Serializable serializable = entityCache . getResult ( CPRuleUserSegmentRelModelImpl . ENTITY_CACHE_ENABLED , CPRuleUserSegmentRelImpl . class , primaryKey ) ; if ( serializable == nullModel ) { return null ; } CPRuleUserSegmentRel cpRuleUserSegmentRel = ( CPRuleUserSegmentRel ) serializable ; if ( cpRuleUserSegmentRel == null ) { Session session = null ; try { session = openSession ( ) ; cpRuleUserSegmentRel = ( CPRuleUserSegmentRel ) session . get ( CPRuleUserSegmentRelImpl . class , primaryKey ) ; if ( cpRuleUserSegmentRel != null ) { cacheResult ( cpRuleUserSegmentRel ) ; } else { entityCache . putResult ( CPRuleUserSegmentRelModelImpl . ENTITY_CACHE_ENABLED , CPRuleUserSegmentRelImpl . class , primaryKey , nullModel ) ; } } catch ( Exception e ) { entityCache . removeResult ( CPRuleUserSegmentRelModelImpl . ENTITY_CACHE_ENABLED , CPRuleUserSegmentRelImpl . class , primaryKey ) ; throw processException ( e ) ; } finally { closeSession ( session ) ; } } return cpRuleUserSegmentRel ;
public class InstantiateOperation { /** * Returns a list containing the classes of the elements in the given object list as array . */ private Class < ? > [ ] getClassList ( List < Object > objects ) { } }
Class < ? > [ ] classes = new Class < ? > [ objects . size ( ) ] ; for ( int i = 0 ; i < objects . size ( ) ; i ++ ) { classes [ i ] = objects . get ( i ) . getClass ( ) ; } return classes ;
public class State { /** * Get the value of a property . * @ param key property key * @ return value associated with the key as a string or < code > null < / code > if the property is not set */ public String getProp ( String key ) { } }
if ( this . specProperties . containsKey ( key ) ) { return this . specProperties . getProperty ( key ) ; } return this . commonProperties . getProperty ( key ) ;
public class GVRAsynchronousResourceLoader { /** * Load a compressed texture asynchronously . * This is the implementation of * { @ link GVRContext # loadCompressedTexture ( GVRAndroidResource . CompressedTextureCallback , GVRAndroidResource ) } * : it will usually be more convenient ( and more efficient ) to call that * directly . * @ param gvrContext * The GVRF context * @ param textureCache * Texture cache - may be { @ code null } * @ param callback * Asynchronous notifications * @ param resource * Stream containing a compressed texture * @ throws IllegalArgumentException * If { @ code gvrContext } or { @ code callback } parameters are * { @ code null } */ public static void loadCompressedTexture ( final GVRContext gvrContext , ResourceCache < GVRImage > textureCache , final CompressedTextureCallback callback , final GVRAndroidResource resource ) { } }
loadCompressedTexture ( gvrContext , textureCache , callback , resource , GVRCompressedImage . DEFAULT_QUALITY ) ;
public class AbstractCommonShapeFileReader { /** * Invoked to initialize the buffer for the content of the file . * @ throws IOException in case of error . */ private void initializeContentBuffer ( ) throws IOException { } }
if ( this . seekEnabled ) { this . buffer = ByteBuffer . allocate ( this . fileSize - HEADER_BYTES ) ; final int read = this . stream . read ( this . buffer ) ; if ( read < 0 ) { throw new EOFException ( ) ; } this . buffer . rewind ( ) ; this . buffer . limit ( read ) ; this . bufferPosition = HEADER_BYTES ; } else { this . buffer = ByteBuffer . allocate ( BLOCK_SIZE ) ; final int read = this . stream . read ( this . buffer ) ; if ( read < 0 ) { throw new EOFException ( ) ; } this . buffer . rewind ( ) ; this . buffer . limit ( read ) ; this . bufferPosition = HEADER_BYTES ; }
public class DoorType { /** * Gets the value of the genericApplicationPropertyOfDoor property . * This accessor method returns a reference to the live list , * not a snapshot . Therefore any modification you make to the * returned list will be present inside the JAXB object . * This is why there is not a < CODE > set < / CODE > method for the genericApplicationPropertyOfDoor property . * For example , to add a new item , do as follows : * < pre > * get _ GenericApplicationPropertyOfDoor ( ) . add ( newItem ) ; * < / pre > * Objects of the following type ( s ) are allowed in the list * { @ link JAXBElement } { @ code < } { @ link Object } { @ code > } * { @ link JAXBElement } { @ code < } { @ link Object } { @ code > } */ public List < JAXBElement < Object > > get_GenericApplicationPropertyOfDoor ( ) { } }
if ( _GenericApplicationPropertyOfDoor == null ) { _GenericApplicationPropertyOfDoor = new ArrayList < JAXBElement < Object > > ( ) ; } return this . _GenericApplicationPropertyOfDoor ;
public class BatchDeletePhoneNumberRequest { /** * List of phone number IDs . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setPhoneNumberIds ( java . util . Collection ) } or { @ link # withPhoneNumberIds ( java . util . Collection ) } if you want * to override the existing values . * @ param phoneNumberIds * List of phone number IDs . * @ return Returns a reference to this object so that method calls can be chained together . */ public BatchDeletePhoneNumberRequest withPhoneNumberIds ( String ... phoneNumberIds ) { } }
if ( this . phoneNumberIds == null ) { setPhoneNumberIds ( new java . util . ArrayList < String > ( phoneNumberIds . length ) ) ; } for ( String ele : phoneNumberIds ) { this . phoneNumberIds . add ( ele ) ; } return this ;
public class AbstractRasMethodAdapter { /** * Begin processing a method . This is called when the instruction stream * for a method is first encountered . Since this is the first callback , we * use this to add the byte codes required for entry tracing . */ @ Override public void visitCode ( ) { } }
if ( injectedTraceAnnotationVisitor == null && classAdapter . isInjectedTraceAnnotationRequired ( ) ) { AnnotationVisitor av = visitAnnotation ( INJECTED_TRACE_TYPE . getDescriptor ( ) , true ) ; av . visitEnd ( ) ; } super . visitCode ( ) ; // Label the entry to the method so we can update the local var // debug data and indicate that we ' re referencing them during // method entry methodEntryLabel = new Label ( ) ; visitLabel ( methodEntryLabel ) ; if ( ! waitingForSuper ) { // This must be done before all instruction callbacks , but it must // also be done before the visitLabel ( ) callback , which might have // an associated UNINITIALIZED entry in the stack map frame that is // supposed to be pointing at a NEW opcode . processMethodEntry ( ) ; }
public class WidgetUtil { /** * Creates the HTML to display a transparent Flash movie for the browser on which we ' re running . * @ param flashVars a pre - URLEncoded string containing flash variables , or null . * http : / / www . adobe . com / cfusion / knowledgebase / index . cfm ? id = tn _ 16417 */ public static HTML createTransparentFlashContainer ( String ident , String movie , int width , int height , String flashVars ) { } }
FlashObject obj = new FlashObject ( ident , movie , width , height , flashVars ) ; obj . transparent = true ; return createContainer ( obj ) ;
public class ApiOvhTelephony { /** * Create a new token * REST : POST / telephony / { billingAccount } / easyHunting / { serviceName } / hunting / eventToken * @ param expiration [ required ] Time to live in seconds for the token * @ param billingAccount [ required ] The name of your billingAccount * @ param serviceName [ required ] */ public String billingAccount_easyHunting_serviceName_hunting_eventToken_POST ( String billingAccount , String serviceName , OvhTokenExpirationEnum expiration ) throws IOException { } }
String qPath = "/telephony/{billingAccount}/easyHunting/{serviceName}/hunting/eventToken" ; StringBuilder sb = path ( qPath , billingAccount , serviceName ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "expiration" , expiration ) ; String resp = exec ( qPath , "POST" , sb . toString ( ) , o ) ; return convertTo ( resp , String . class ) ;
public class UserApiKeyAuthProviderClientImpl { /** * Deletes a user API key associated with the current user . * @ param id The id of the API key to delete . * @ return A { @ link Task } that completes when the API key is deleted . */ @ Override public Task < Void > deleteApiKey ( @ NonNull final ObjectId id ) { } }
return dispatcher . dispatchTask ( new Callable < Void > ( ) { @ Override public Void call ( ) { deleteApiKeyInternal ( id ) ; return null ; } } ) ;
public class ActionRequestProcessor { /** * Fire the action , creating , populating , performing and to next . * @ param runtime The runtime meta of action execute , which has action execute , path parameter and states . ( NotNull ) * @ throws IOException When the action fails about the IO . * @ throws ServletException When the action fails about the Servlet . */ protected void fire ( ActionRuntime runtime ) throws IOException , ServletException { } }
final ActionResponseReflector reflector = createResponseReflector ( runtime ) ; ready ( runtime , reflector ) ; final OptionalThing < VirtualForm > form = prepareActionForm ( runtime ) ; populateParameter ( runtime , form ) ; final VirtualAction action = createAction ( runtime , reflector ) ; final NextJourney journey = performAction ( action , form , runtime ) ; // # to _ action toNext ( runtime , journey ) ;
public class PortletRequestContextImpl { /** * / * ( non - Javadoc ) * @ see org . apache . pluto . container . PortletRequestContext # getPublicParameterMap ( ) */ @ Override public Map < String , String [ ] > getPublicParameterMap ( ) { } }
// Only re - use render parameters on a render request if ( this . portalRequestInfo . getUrlType ( ) == UrlType . RENDER ) { return this . portletWindow . getPublicRenderParameters ( ) ; } return Collections . emptyMap ( ) ;
public class ErrorDetails { /** * Details for an exception name . * @ param t a throwable * @ return an object with error details */ public static ErrorDetails exceptionName ( Throwable t ) { } }
return new ErrorDetails ( t . getClass ( ) . getName ( ) , ErrorDetailsKind . EXCEPTION_NAME ) ;
public class AfplibPackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EClass getCDD ( ) { } }
if ( cddEClass == null ) { cddEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( AfplibPackage . eNS_URI ) . getEClassifiers ( ) . get ( 225 ) ; } return cddEClass ;
public class MigrateProcessInstanceCmd { /** * delete unmapped instances in a bottom - up fashion ( similar to deleteCascade and regular BPMN execution ) */ protected void deleteUnmappedActivityInstances ( MigratingProcessInstance migratingProcessInstance ) { } }
Set < MigratingScopeInstance > leafInstances = collectLeafInstances ( migratingProcessInstance ) ; final DeleteUnmappedInstanceVisitor visitor = new DeleteUnmappedInstanceVisitor ( executionBuilder . isSkipCustomListeners ( ) , executionBuilder . isSkipIoMappings ( ) ) ; for ( MigratingScopeInstance leafInstance : leafInstances ) { MigratingScopeInstanceBottomUpWalker walker = new MigratingScopeInstanceBottomUpWalker ( leafInstance ) ; walker . addPreVisitor ( visitor ) ; walker . walkUntil ( new ReferenceWalker . WalkCondition < MigratingScopeInstance > ( ) { @ Override public boolean isFulfilled ( MigratingScopeInstance element ) { // walk until top of instance tree is reached or until // a node is reached for which we have not yet visited every child return element == null || ! visitor . hasVisitedAll ( element . getChildScopeInstances ( ) ) ; } } ) ; }
public class BinaryBAMShardIndexWriter { /** * Write this content as binary output */ @ Override public void writeReference ( final BAMIndexContent content ) { } }
if ( content == null ) { writeNullContent ( ) ; return ; } // write bins final BAMIndexContent . BinList bins = content . getBins ( ) ; final int size = bins == null ? 0 : content . getNumberOfNonNullBins ( ) ; if ( size == 0 ) { writeNullContent ( ) ; return ; } // final List < Chunk > chunks = content . getMetaData ( ) = = null ? null // : content . getMetaData ( ) . getMetaDataChunks ( ) ; final BAMIndexMetaData metaData = content . getMetaData ( ) ; codec . writeInt ( size + ( ( metaData != null ) ? 1 : 0 ) ) ; // codec . writeInt ( size ) ; for ( final Bin bin : bins ) { // note , bins will always be sorted if ( bin . getBinNumber ( ) == GenomicIndexUtil . MAX_BINS ) continue ; writeBin ( bin ) ; } // write metadata " bin " and chunks if ( metaData != null ) writeChunkMetaData ( metaData ) ; // write linear index final LinearIndex linearIndex = content . getLinearIndex ( ) ; final long [ ] entries = linearIndex == null ? null : linearIndex . getIndexEntries ( ) ; final int indexStart = linearIndex == null ? 0 : linearIndex . getIndexStart ( ) ; final int n_intv = entries == null ? indexStart : entries . length + indexStart ; codec . writeInt ( n_intv ) ; if ( entries == null ) { return ; } // since indexStart is usually 0 , this is usually a no - op for ( int i = 0 ; i < indexStart ; i ++ ) { codec . writeLong ( 0 ) ; } for ( int k = 0 ; k < entries . length ; k ++ ) { codec . writeLong ( entries [ k ] ) ; } try { codec . getOutputStream ( ) . flush ( ) ; } catch ( final IOException e ) { throw new SAMException ( "IOException in BinaryBAMIndexWriter reference " + content . getReferenceSequence ( ) , e ) ; }
public class Database { public String [ ] get_device_property_list ( String devname , String wildcard ) throws DevFailed { } }
return databaseDAO . get_device_property_list ( this , devname , wildcard ) ;
public class ReframingResponseObserver { /** * Accept a new response from inner / upstream callable . This message will be processed by the * { @ link Reframer } in the delivery loop and the output will be delivered to the downstream { @ link * ResponseObserver } . * < p > If the delivery loop is stopped , this will restart it . */ @ Override protected void onResponseImpl ( InnerT response ) { } }
IllegalStateException error = null ; // Guard against unsolicited notifications if ( ! awaitingInner || ! newItem . compareAndSet ( null , response ) ) { // Notify downstream if it ' s still open error = new IllegalStateException ( "Received unsolicited response from upstream." ) ; cancellation . compareAndSet ( null , error ) ; } deliver ( ) ; // Notify upstream by throwing an exception if ( error != null ) { throw error ; }
public class MsgpackIOUtil { /** * Serializes the { @ code message } into an { @ link MessageBufferOutput } using the given { @ code schema } . */ public static < T > void writeTo ( MessageBufferOutput out , T message , Schema < T > schema , boolean numeric ) throws IOException { } }
MessagePacker packer = MessagePack . newDefaultPacker ( out ) ; try { writeTo ( packer , message , schema , numeric ) ; } finally { packer . flush ( ) ; }
public class RouteFilterPrefixMarshaller { /** * Marshall the given parameter object . */ public void marshall ( RouteFilterPrefix routeFilterPrefix , ProtocolMarshaller protocolMarshaller ) { } }
if ( routeFilterPrefix == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( routeFilterPrefix . getCidr ( ) , CIDR_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class QuerySelect { /** * Returns an Observable of the results of pushing one set of parameters * through a select query . * @ param params * one set of parameters to be run with the query * @ return */ private < T > Observable < T > executeOnce ( final List < Parameter > params , ResultSetMapper < ? extends T > function ) { } }
return QuerySelectOnSubscribe . execute ( this , params , function ) . subscribeOn ( context . scheduler ( ) ) ;
public class NamePhraseRenderer { /** * { @ inheritDoc } */ @ Override public final String renderAsPhrase ( ) { } }
final Name name = nameRenderer . getGedObject ( ) ; final String prefix = escapeString ( name . getPrefix ( ) ) ; final String surname = escapeString ( name . getSurname ( ) ) ; final String suffix = escapeString ( name . getSuffix ( ) ) ; return separate ( prefix , surname , suffix ) ;
public class ListItem { /** * Mock data */ static List < ListItem > createItemsV1 ( Context context ) { } }
final List < ListItem > items = new ArrayList < > ( ) ; final Painting [ ] paintings = Painting . list ( context . getResources ( ) ) ; items . add ( new ListItem ( "Donec sem arcu, feugiat sit amet purus ut, cursus tristique" + " justo. Quisque eu ligula sed massa tristique elementum eu vel augue." ) ) ; items . add ( new ListItem ( paintings [ 0 ] , paintings [ 1 ] ) ) ; items . add ( new ListItem ( paintings [ 2 ] ) ) ; items . add ( new ListItem ( "Vivamus orci nulla, euismod ac purus id, porttitor vulputate" + " purus. Proin at aliquam justo. Integer eget eros vitae metus ornare lacinia eu" + " sit amet justo. Integer aliquam sit amet diam ac laoreet. Cras tincidunt dolor" + " ut nisl aliquet." ) ) ; items . add ( new ListItem ( "Nulla sed eleifend quam" ) ) ; items . add ( new ListItem ( paintings [ 3 ] , paintings [ 4 ] ) ) ; items . add ( new ListItem ( "Suspendisse dignissim pretium nisi nec tincidunt. In ut" + " finibus arcu. Nunc pretium purus a eros convallis finibus. Vestibulum eleifend" + " efficitur arcu, ut fringilla lorem molestie nec." ) ) ; items . add ( new ListItem ( paintings [ 0 ] ) ) ; items . add ( new ListItem ( paintings [ 1 ] , paintings [ 2 ] ) ) ; return items ;
public class ClusterJspHelper { /** * Helper function that generates the decommissioning report . */ DecommissionStatus generateDecommissioningReport ( ) { } }
List < InetSocketAddress > isas = null ; ArrayList < String > suffixes = null ; if ( isAvatar ) { suffixes = new ArrayList < String > ( ) ; suffixes . add ( "0" ) ; suffixes . add ( "1" ) ; } try { isas = DFSUtil . getClientRpcAddresses ( conf , suffixes ) ; sort ( isas ) ; } catch ( Exception e ) { // catch any exception encountered other than connecting to namenodes DecommissionStatus dInfo = new DecommissionStatus ( e ) ; LOG . error ( e ) ; return dInfo ; } // Outer map key is datanode . Inner map key is namenode and the value is // decom status of the datanode for the corresponding namenode Map < String , Map < String , String > > statusMap = new HashMap < String , Map < String , String > > ( ) ; // Map of exceptions encountered when connecting to namenode // key is namenode and value is exception Map < String , Exception > decommissionExceptions = new HashMap < String , Exception > ( ) ; List < String > unreportedNamenode = new ArrayList < String > ( ) ; DecommissionStatusFetcher [ ] threads = new DecommissionStatusFetcher [ isas . size ( ) ] ; for ( int i = 0 ; i < isas . size ( ) ; i ++ ) { threads [ i ] = new DecommissionStatusFetcher ( isas . get ( i ) , statusMap ) ; threads [ i ] . start ( ) ; } for ( DecommissionStatusFetcher thread : threads ) { try { thread . join ( ) ; if ( thread . e != null ) { // catch exceptions encountered while connecting to namenodes decommissionExceptions . put ( thread . isa . toString ( ) , thread . e ) ; unreportedNamenode . add ( thread . isa . toString ( ) ) ; } } catch ( InterruptedException ex ) { LOG . warn ( ex ) ; } } updateUnknownStatus ( statusMap , unreportedNamenode ) ; getDecommissionNodeClusterState ( statusMap ) ; return new DecommissionStatus ( statusMap , isas , getDatanodeHttpPort ( conf ) , decommissionExceptions ) ;
public class BaseMessage { /** * Setup this message given this internal data structure . * @ param data The data in an intermediate format . */ public static BaseMessage createMessage ( String strMessageClassName , BaseMessageHeader messageHeader , Object data ) { } }
BaseMessage message = null ; if ( ( strMessageClassName == null ) && ( messageHeader != null ) ) { strMessageClassName = ( String ) messageHeader . get ( BaseMessageHeader . INTERNAL_MESSAGE_CLASS ) ; if ( ( strMessageClassName == null ) || ( strMessageClassName . length ( ) == 0 ) ) { // ? String strRequestType = ( String ) messageHeader . get ( TrxMessageHeader . MESSAGE _ REQUEST _ TYPE ) ; // ? if ( ( strRequestType = = null ) | | ( strRequestType . length ( ) = = 0 ) | | ( RequestType . MANUAL . equalsIgnoreCase ( strRequestType ) ) ) // ? strMessageClass = ManualMessage . class . getName ( ) ; } } if ( ( strMessageClassName != null ) && ( strMessageClassName . length ( ) > 0 ) ) { strMessageClassName = ClassServiceUtility . getFullClassName ( strMessageClassName ) ; Object obj = ClassServiceUtility . getClassService ( ) . makeObjectFromClassName ( strMessageClassName ) ; if ( obj instanceof BaseMessage ) { message = ( BaseMessage ) obj ; message . init ( messageHeader , null ) ; } else if ( obj instanceof MessageRecordDesc ) { message = new TreeMessage ( messageHeader , null ) ; ( ( MessageRecordDesc ) obj ) . init ( message , null ) ; } } return message ;
public class MetaSnapshotDAO { /** * 删除interval秒之前的数据 */ public Integer deleteByTimestamp ( String destination , int interval ) { } }
HashMap params = Maps . newHashMapWithExpectedSize ( 2 ) ; long timestamp = System . currentTimeMillis ( ) - interval * 1000 ; params . put ( "timestamp" , timestamp ) ; params . put ( "destination" , destination ) ; return getSqlMapClientTemplate ( ) . delete ( "meta_snapshot.deleteByTimestamp" , params ) ;
public class CompensationBehavior { /** * With compensation , we have a dedicated scope execution for every handler , even if the handler is not * a scope activity ; this must be respected when invoking end listeners , etc . */ public static boolean executesNonScopeCompensationHandler ( PvmExecutionImpl execution ) { } }
ActivityImpl activity = execution . getActivity ( ) ; return execution . isScope ( ) && activity != null && activity . isCompensationHandler ( ) && ! activity . isScope ( ) ;
public class MgcpEndpointManager { /** * Unregisters an active endpoint . * @ param endpointId The ID of the endpoint to be unregistered * @ throws MgcpEndpointNotFoundException If there is no registered endpoint with such ID */ public void unregisterEndpoint ( String endpointId ) throws MgcpEndpointNotFoundException { } }
MgcpEndpoint endpoint = this . endpoints . remove ( endpointId ) ; if ( endpoint == null ) { throw new MgcpEndpointNotFoundException ( "Endpoint " + endpointId + " not found" ) ; } endpoint . forget ( ( MgcpMessageObserver ) this ) ; endpoint . forget ( ( MgcpEndpointObserver ) this ) ; if ( log . isDebugEnabled ( ) ) { log . debug ( "Unregistered endpoint " + endpoint . getEndpointId ( ) . toString ( ) + ". Count: " + this . endpoints . size ( ) ) ; }
public class A_CmsSelectBox { /** * Sets the form value of this select box . < p > * @ param value the new value * @ param fireEvents true if change events should be fired */ public void setFormValue ( Object value , boolean fireEvents ) { } }
if ( value == null ) { value = "" ; } if ( ! "" . equals ( value ) && ! m_selectCells . containsKey ( value ) ) { OPTION option = createUnknownOption ( ( String ) value ) ; if ( option != null ) { addOption ( option ) ; } } if ( value instanceof String ) { String strValue = ( String ) value ; onValueSelect ( strValue , fireEvents ) ; }
public class SourceFile { /** * Returns a copy of code as a list of lines . */ public List < String > getLines ( ) { } }
try { return CharSource . wrap ( sourceBuilder ) . readLines ( ) ; } catch ( IOException e ) { throw new AssertionError ( "IOException not possible, as the string is in-memory" ) ; }
public class PdfTransparencyGroup { /** * Determining whether the objects within the stack are composited with one another or only with the group ' s backdrop . * @ param knockout */ public void setKnockout ( boolean knockout ) { } }
if ( knockout ) put ( PdfName . K , PdfBoolean . PDFTRUE ) ; else remove ( PdfName . K ) ;
public class QueryBuilder { /** * Query for selecting changes ( or snapshots ) made on a concrete ValueObject * ( so a ValueObject owned by a concrete Entity instance ) . * < br / > < br / > * < b > Path parameter < / b > is a relative path from owning Entity instance to ValueObject that you are looking for . * < br / > < br / > * When ValueObject is just < b > a property < / b > , use propertyName . For example : * < pre > * class Employee { * & # 64 ; Id String name ; * Address primaryAddress ; * javers . findChanges ( QueryBuilder . byValueObjectId ( " bob " , Employee . class , " primaryAddress " ) . build ( ) ) ; * < / pre > * When ValueObject is stored in < b > a List < / b > , use propertyName and list index separated by " / " , for example : * < pre > * class Employee { * & # 64 ; Id String name ; * List & lt ; Address & gt ; addresses ; * javers . findChanges ( QueryBuilder . byValueObjectId ( " bob " , Employee . class , " addresses / 0 " ) . build ( ) ) ; * < / pre > * When ValueObject is stored as < b > a Map value < / b > , use propertyName and map key separated by " / " , for example : * < pre > * class Employee { * & # 64 ; Id String name ; * Map & lt ; String , Address & gt ; addressMap ; * javers . findChanges ( QueryBuilder . byValueObjectId ( " bob " , Employee . class , " addressMap / HOME " ) . build ( ) ) ; * < / pre > */ public static QueryBuilder byValueObjectId ( Object ownerLocalId , Class ownerEntityClass , String path ) { } }
Validate . argumentsAreNotNull ( ownerEntityClass , ownerLocalId , path ) ; return new QueryBuilder ( new IdFilterDefinition ( ValueObjectIdDTO . valueObjectId ( ownerLocalId , ownerEntityClass , path ) ) ) ;
public class AccessLogInterceptor { /** * 记录访问日志 * @ param ip 访问IP * @ param visitor 访问者 * @ param userId 用户id * @ param browser 浏览器 * @ param url 访问URL * @ param elapsedTime 请求耗时 * @ return 记录日志行 */ private String getAccessLog ( String ip , User visitor , Integer userId , String browser , String url , long elapsedTime ) { } }
StringBuilder sb = new StringBuilder ( ) ; sb . append ( null != ip ? ip : "unknown" ) . append ( "\t" ) ; if ( visitor == null ) { sb . append ( "-\t-\t" ) ; } else { if ( userId == null ) { sb . append ( "-\t" ) ; } else { sb . append ( visitor . getUserId ( ) == userId ? AccessLogType . PORTAL_USER : AccessLogType . MANAGER ) . append ( "\t" ) ; } sb . append ( visitor . getUserId ( ) ) . append ( "," ) . append ( visitor . getUserName ( ) ) . append ( "," ) . append ( visitor . getRoles ( ) ) . append ( "\t" ) ; } sb . append ( null != userId ? userId : "-" ) . append ( "\t" ) ; sb . append ( url ) . append ( "\t" ) ; sb . append ( browser ) . append ( "\t" ) ; sb . append ( elapsedTime ) . append ( "ms" ) ; return sb . toString ( ) ;
public class GVRRigidBody { /** * Set a { @ linkplain GVRRigidBody rigid body } to be ignored ( true ) or not ( false ) * @ param collisionObject rigidbody object on the collision check * @ param ignore boolean to indicate if the specified object will be ignored or not */ public void setIgnoreCollisionCheck ( GVRRigidBody collisionObject , boolean ignore ) { } }
Native3DRigidBody . setIgnoreCollisionCheck ( getNative ( ) , collisionObject . getNative ( ) , ignore ) ;
public class AbstractEditor { /** * This method is called when an editor is removed from the * workspace . */ public void dispose ( ) { } }
if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Disposing of editor " + getId ( ) ) ; } context . register ( GlobalCommandIds . SAVE , null ) ; context . register ( GlobalCommandIds . SAVE_AS , null ) ; // descriptor . removePropertyChangeListener ( ( PropertyChangeListener ) context . getPane ( ) ) ; concreteDispose ( ) ;
public class MultiPartReader { /** * Reads uploaded files and form variables from POSTed data . * Files are stored on disk in case uploadDir is not null . * Otherwise files are stored as attributes on the http - request in the form of FileObjects , using the name of the html - form - variable as key . * Plain properties are stored as String attributes on the http - request . * In case a file to be stored on disk already exists , the existing file is preserved * and renamed by adding a sequence number to its name . * @ return total nr of bytes read * @ throws IOException * @ see org . ijsberg . iglu . util . io . FileData */ public long readMultipartUpload ( ) throws IOException { } }
input = request . getInputStream ( ) ; // the next variable stores all post data and is useful for debug purposes bytesReadAsLine = input . readLine ( line , 0 , BUFFER_SIZE ) ; if ( bytesReadAsLine <= 2 ) { return 0 ; } bytesRead = bytesReadAsLine ; // save the multipart boundary string String boundary = new String ( line , 0 , bytesReadAsLine - 2 ) ; while ( ( bytesReadAsLine = input . readLine ( line , 0 , BUFFER_SIZE ) ) != - 1 ) { readPropertiesUntilEmptyLine ( ) ; // TODO fullFileName may be empty in which case storage output stream cannot be opened bytesRead += bytesReadAsLine ; bytesReadAsLine = input . readLine ( line , 0 , BUFFER_SIZE ) ; // before the boundary that indicates the end of the file // there is a line separator which does not belong to the file // it ' s necessary to filter it out without too much memory overhead // it ' s not clear where the line separator comes from . // this has to work on Windows and UNIX partialCopyOutputStream = getStorageOutputStream ( ) ; readUploadedFile ( boundary , partialCopyOutputStream ) ; bytesRead += bytesReadAsLine ; if ( fullFileName != null ) { if ( uploadDir == null ) { FileData file = new FileData ( fullFileName , contentType ) ; file . setDescription ( "Obtained from: " + fullFileName ) ; file . setRawData ( ( ( ByteArrayOutputStream ) partialCopyOutputStream ) . toByteArray ( ) ) ; // propertyName is specified in HTML form like < INPUT TYPE = " FILE " NAME = " myPropertyName " > request . setAttribute ( propertyName , file ) ; System . out . println ( new LogEntry ( "file found in multi-part data: " + file ) ) ; } } else { String propertyValue = partialCopyOutputStream . toString ( ) ; request . setAttribute ( propertyName , propertyValue ) ; System . out . println ( new LogEntry ( "property found in multi-part data:" + propertyName + '=' + propertyValue ) ) ; } partialCopyOutputStream . close ( ) ; fullFileName = null ; } System . out . println ( new LogEntry ( "post data retrieved from multi-part data: " + bytesRead + " bytes" ) ) ; return bytesRead ;
public class HBaseTableUtil { /** * Creates a hbase table if it does not exists . Same as calling * { @ link # createTableIfNotExists ( org . apache . hadoop . hbase . client . HBaseAdmin , byte [ ] , * org . apache . hadoop . hbase . HTableDescriptor , byte [ ] [ ] , long , java . util . concurrent . TimeUnit ) } * with timeout = { @ link # MAX _ CREATE _ TABLE _ WAIT } milliseconds . */ public void createTableIfNotExists ( HBaseAdmin admin , byte [ ] tableName , HTableDescriptor tableDescriptor , byte [ ] [ ] splitKeys ) throws IOException { } }
createTableIfNotExists ( admin , tableName , tableDescriptor , splitKeys , MAX_CREATE_TABLE_WAIT , TimeUnit . MILLISECONDS ) ;
public class MvpDelegate { /** * < p > Attach delegated object as view to presenter fields of this object . * If delegate did not enter at { @ link # onCreate ( Bundle ) } ( or * { @ link # onCreate ( ) } ) before this method , then view will not be attached to * presenters < / p > */ public void onAttach ( ) { } }
for ( MvpPresenter < ? super Delegated > presenter : mPresenters ) { if ( mIsAttached && presenter . getAttachedViews ( ) . contains ( mDelegated ) ) { continue ; } presenter . attachView ( mDelegated ) ; } for ( MvpDelegate < ? > childDelegate : mChildDelegates ) { childDelegate . onAttach ( ) ; } mIsAttached = true ;
public class TokenList { /** * Detects variable values using another token list . * Usually , one is working with two token lists . One list contains literals and variables and the other token list * contains only literals . Both lists match are then compared to find values ( literals of the second list ) for * variables in the first list . * Example : * - Token list 1 : " a " , " b " , var " x " , var " y " * - Token list 2 : " a " , " b " , " c " , " d " * The detected variables are : * - variable [ " x " ] = " c " * - variable [ " y " ] = " d " * Note : Only one list may contain zero or more variables . An exception is thrown if both lists contain variables . * @ param tokenList The other token list . * @ return A map containing variable names and variable values . * @ throws de . codecentric . zucchini . bdd . resolver . token . VariableValueDetectionException Thrown if both lists contain * variables . */ public Map < String , String > detectVariableValues ( TokenList tokenList ) { } }
Map < String , String > variables = new HashMap < String , String > ( ) ; boolean thisContainsVariables = containsVariables ( ) ; boolean thatContainsVariables = tokenList . containsVariables ( ) ; // If both lists contain variables , we get into trouble . if ( thisContainsVariables && thatContainsVariables ) { throw new VariableValueDetectionException ( "Cannot detect variable values if both token lists contain variables." ) ; } // If both lists don ' t contain variables , no variables can be detected and we can return the empty map . if ( ! thisContainsVariables && ! thatContainsVariables ) { return variables ; } ListIterator < Token > iteratorWithVariables = ( thisContainsVariables ? this : tokenList ) . listIterator ( ) ; ListIterator < Token > iteratorWithoutVariables = ( thisContainsVariables ? tokenList : this ) . listIterator ( ) ; // We now know that { @ code iteratorWithVariables } contains at least one variable . We iterate over both lists // simultaneously and if { @ code possibleVariableToken } is a { @ link VariableToken } , we know that // { @ code literalToken } contains the value for this variable . while ( iteratorWithVariables . hasNext ( ) && iteratorWithoutVariables . hasNext ( ) ) { Token possibleVariableToken = iteratorWithVariables . next ( ) ; Token literalToken = iteratorWithoutVariables . next ( ) ; if ( possibleVariableToken instanceof VariableToken ) { variables . put ( possibleVariableToken . getText ( ) , literalToken . getText ( ) ) ; } } return variables ;
public class ObjectUtil { /** * - - - - - LIST / ARRAY UTILITIES */ public static Object findFirstIn ( Object obj , Object [ ] arr ) { } }
for ( Object o : arr ) { if ( obj . equals ( o ) ) { return o ; } } return null ;
public class ProjectOperations { /** * Returns all the { @ link JavaEnumSource } objects from the given { @ link Project } */ public List < JavaResource > getProjectEnums ( Project project ) { } }
final List < JavaResource > enums = new ArrayList < > ( ) ; if ( project != null ) { project . getFacet ( JavaSourceFacet . class ) . visitJavaSources ( new JavaResourceVisitor ( ) { @ Override public void visit ( VisitContext context , JavaResource resource ) { try { JavaSource < ? > javaSource = resource . getJavaType ( ) ; if ( javaSource . isEnum ( ) ) { enums . add ( resource ) ; } } catch ( ResourceException | FileNotFoundException e ) { // ignore } } } ) ; } return enums ;
public class KeyTypeData { /** * Reads : * typeInfo { * deprecated { * co { * direct { " true " } * tz { * camtr { " true " } */ private static void getTypeInfo ( UResourceBundle typeInfoRes ) { } }
Map < String , Set < String > > _deprecatedKeyTypes = new LinkedHashMap < String , Set < String > > ( ) ; for ( UResourceBundleIterator keyInfoIt = typeInfoRes . getIterator ( ) ; keyInfoIt . hasNext ( ) ; ) { UResourceBundle keyInfoEntry = keyInfoIt . next ( ) ; String key = keyInfoEntry . getKey ( ) ; TypeInfoType typeInfo = TypeInfoType . valueOf ( key ) ; for ( UResourceBundleIterator keyInfoIt2 = keyInfoEntry . getIterator ( ) ; keyInfoIt2 . hasNext ( ) ; ) { UResourceBundle keyInfoEntry2 = keyInfoIt2 . next ( ) ; String key2 = keyInfoEntry2 . getKey ( ) ; Set < String > _deprecatedTypes = new LinkedHashSet < String > ( ) ; for ( UResourceBundleIterator keyInfoIt3 = keyInfoEntry2 . getIterator ( ) ; keyInfoIt3 . hasNext ( ) ; ) { UResourceBundle keyInfoEntry3 = keyInfoIt3 . next ( ) ; String key3 = keyInfoEntry3 . getKey ( ) ; switch ( typeInfo ) { // allow for expansion case deprecated : _deprecatedTypes . add ( key3 ) ; break ; } } _deprecatedKeyTypes . put ( key2 , Collections . unmodifiableSet ( _deprecatedTypes ) ) ; } } DEPRECATED_KEY_TYPES = Collections . unmodifiableMap ( _deprecatedKeyTypes ) ;
public class OgmEntityEntryState { /** * state chain management ops below */ @ Override public void addExtraState ( EntityEntryExtraState extraState ) { } }
if ( next == null ) { next = extraState ; } else { next . addExtraState ( extraState ) ; }
public class EasyReader { /** * 读取 * @ param handler 处理逻辑 * @ param size 读取多少个文件 * @ throws Exception */ public void read ( LineHandler handler , int size ) throws Exception { } }
File rootFile = new File ( root ) ; File [ ] files ; if ( rootFile . isDirectory ( ) ) { files = rootFile . listFiles ( new FileFilter ( ) { @ Override public boolean accept ( File pathname ) { return pathname . isFile ( ) && ! pathname . getName ( ) . endsWith ( ".bin" ) ; } } ) ; if ( files == null ) { if ( rootFile . isFile ( ) ) files = new File [ ] { rootFile } ; else return ; } } else { files = new File [ ] { rootFile } ; } int n = 0 ; int totalAddress = 0 ; long start = System . currentTimeMillis ( ) ; for ( File file : files ) { if ( size -- == 0 ) break ; if ( file . isDirectory ( ) ) continue ; if ( verbose ) System . out . printf ( "正在处理%s, %d / %d\n" , file . getName ( ) , ++ n , files . length ) ; IOUtil . LineIterator lineIterator = new IOUtil . LineIterator ( file . getAbsolutePath ( ) ) ; while ( lineIterator . hasNext ( ) ) { ++ totalAddress ; String line = lineIterator . next ( ) ; if ( line . length ( ) == 0 ) continue ; handler . handle ( line ) ; } } handler . done ( ) ; if ( verbose ) System . out . printf ( "处理了 %.2f 万行,花费了 %.2f min\n" , totalAddress / 10000.0 , ( System . currentTimeMillis ( ) - start ) / 1000.0 / 60.0 ) ;
public class EntityGraphLoader { /** * Get the entity by id and load its graph using loadGraph . */ public T getById ( PK pk ) { } }
try { tx . begin ( ) ; T entity = repository . getById ( pk ) ; loadGraph ( entity ) ; tx . commit ( ) ; return entity ; } catch ( Exception x ) { throw new RuntimeException ( x ) ; }
public class Utils { /** * Logs target object */ static void log ( Object targetObj , String msg ) { } }
if ( EventsParams . isDebug ( ) ) { Log . d ( TAG , toLogStr ( targetObj , msg ) ) ; }
public class Uninterruptibles { /** * Invokes { @ code latch . } { @ link CountDownLatch # await ( ) await ( ) } * uninterruptibly . */ public static void awaitUninterruptibly ( CountDownLatch latch ) { } }
boolean interrupted = false ; try { while ( true ) { try { latch . await ( ) ; return ; } catch ( InterruptedException e ) { interrupted = true ; } } } finally { if ( interrupted ) { Thread . currentThread ( ) . interrupt ( ) ; } }
public class WayDecorator { /** * Finds the segments of a line along which a name can be drawn and then adds WayTextContainers * to the list of drawable items . * @ param upperLeft the tile in the upper left corner of the drawing pane * @ param lowerRight the tile in the lower right corner of the drawing pane * @ param text the text to draw * @ param priority priority of the text * @ param dy if 0 , then a line parallel to the coordinates will be calculated first * @ param fill fill paint for text * @ param stroke stroke paint for text * @ param coordinates the list of way coordinates * @ param currentLabels the list of labels to which a new WayTextContainer will be added */ static void renderText ( GraphicFactory graphicFactory , Tile upperLeft , Tile lowerRight , String text , Display display , int priority , float dy , Paint fill , Paint stroke , boolean repeat , float repeatGap , float repeatStart , boolean rotate , Point [ ] [ ] coordinates , List < MapElementContainer > currentLabels ) { } }
if ( coordinates . length == 0 ) { return ; } Point [ ] c ; if ( dy == 0f ) { c = coordinates [ 0 ] ; } else { c = RendererUtils . parallelPath ( coordinates [ 0 ] , dy ) ; } if ( c . length < 2 ) { return ; } LineString path = new LineString ( ) ; for ( int i = 1 ; i < c . length ; i ++ ) { LineSegment segment = new LineSegment ( c [ i - 1 ] , c [ i ] ) ; path . segments . add ( segment ) ; } int textWidth = ( stroke == null ) ? fill . getTextWidth ( text ) : stroke . getTextWidth ( text ) ; int textHeight = ( stroke == null ) ? fill . getTextHeight ( text ) : stroke . getTextHeight ( text ) ; double pathLength = path . length ( ) ; for ( float pos = repeatStart ; pos + textWidth < pathLength ; pos += repeatGap + textWidth ) { LineString linePart = path . extractPart ( pos , pos + textWidth ) ; boolean tooSharp = false ; for ( int i = 1 ; i < linePart . segments . size ( ) ; i ++ ) { double cornerAngle = linePart . segments . get ( i - 1 ) . angleTo ( linePart . segments . get ( i ) ) ; if ( Math . abs ( cornerAngle ) > MAX_LABEL_CORNER_ANGLE ) { tooSharp = true ; break ; } } if ( tooSharp ) continue ; currentLabels . add ( new WayTextContainer ( graphicFactory , linePart , display , priority , text , fill , stroke , textHeight ) ) ; }
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EClass getIfcBuildingElementProxy ( ) { } }
if ( ifcBuildingElementProxyEClass == null ) { ifcBuildingElementProxyEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 61 ) ; } return ifcBuildingElementProxyEClass ;
public class Asm { /** * Create mmword ( 8 bytes ) pointer operand * ! @ note This constructor is provided only for convenience for mmx programming . */ public static final Mem mmword_ptr_abs ( long target , long disp , SEGMENT segmentPrefix ) { } }
return _ptr_build_abs ( target , disp , segmentPrefix , SIZE_QWORD ) ;
public class TypeParser { /** * org / javaruntype / type / parser / Type . g : 111:1 : typeParameterization : ( typeExpression | UNKNOWN | UNKNOWN EXTENDS typExp = typeExpression - > ^ ( EXT $ typExp ) | UNKNOWN SUPER typExp = typeExpression - > ^ ( SUP $ typExp ) ) ; */ public final TypeParser . typeParameterization_return typeParameterization ( ) throws RecognitionException { } }
TypeParser . typeParameterization_return retval = new TypeParser . typeParameterization_return ( ) ; retval . start = input . LT ( 1 ) ; CommonTree root_0 = null ; Token UNKNOWN8 = null ; Token UNKNOWN9 = null ; Token EXTENDS10 = null ; Token UNKNOWN11 = null ; Token SUPER12 = null ; TypeParser . typeExpression_return typExp = null ; TypeParser . typeExpression_return typeExpression7 = null ; CommonTree UNKNOWN8_tree = null ; CommonTree UNKNOWN9_tree = null ; CommonTree EXTENDS10_tree = null ; CommonTree UNKNOWN11_tree = null ; CommonTree SUPER12_tree = null ; RewriteRuleTokenStream stream_SUPER = new RewriteRuleTokenStream ( adaptor , "token SUPER" ) ; RewriteRuleTokenStream stream_UNKNOWN = new RewriteRuleTokenStream ( adaptor , "token UNKNOWN" ) ; RewriteRuleTokenStream stream_EXTENDS = new RewriteRuleTokenStream ( adaptor , "token EXTENDS" ) ; RewriteRuleSubtreeStream stream_typeExpression = new RewriteRuleSubtreeStream ( adaptor , "rule typeExpression" ) ; try { // org / javaruntype / type / parser / Type . g : 112:5 : ( typeExpression | UNKNOWN | UNKNOWN EXTENDS typExp = typeExpression - > ^ ( EXT $ typExp ) | UNKNOWN SUPER typExp = typeExpression - > ^ ( SUP $ typExp ) ) int alt5 = 4 ; int LA5_0 = input . LA ( 1 ) ; if ( ( LA5_0 == CLASSNAME ) ) { alt5 = 1 ; } else if ( ( LA5_0 == UNKNOWN ) ) { switch ( input . LA ( 2 ) ) { case EXTENDS : { alt5 = 3 ; } break ; case SUPER : { alt5 = 4 ; } break ; case ENDTYPEPARAM : case COMMA : { alt5 = 2 ; } break ; default : NoViableAltException nvae = new NoViableAltException ( "" , 5 , 2 , input ) ; throw nvae ; } } else { NoViableAltException nvae = new NoViableAltException ( "" , 5 , 0 , input ) ; throw nvae ; } switch ( alt5 ) { case 1 : // org / javaruntype / type / parser / Type . g : 112:7 : typeExpression { root_0 = ( CommonTree ) adaptor . nil ( ) ; pushFollow ( FOLLOW_typeExpression_in_typeParameterization291 ) ; typeExpression7 = typeExpression ( ) ; state . _fsp -- ; adaptor . addChild ( root_0 , typeExpression7 . getTree ( ) ) ; } break ; case 2 : // org / javaruntype / type / parser / Type . g : 113:7 : UNKNOWN { root_0 = ( CommonTree ) adaptor . nil ( ) ; UNKNOWN8 = ( Token ) match ( input , UNKNOWN , FOLLOW_UNKNOWN_in_typeParameterization299 ) ; UNKNOWN8_tree = ( CommonTree ) adaptor . create ( UNKNOWN8 ) ; adaptor . addChild ( root_0 , UNKNOWN8_tree ) ; } break ; case 3 : // org / javaruntype / type / parser / Type . g : 114:7 : UNKNOWN EXTENDS typExp = typeExpression { UNKNOWN9 = ( Token ) match ( input , UNKNOWN , FOLLOW_UNKNOWN_in_typeParameterization307 ) ; stream_UNKNOWN . add ( UNKNOWN9 ) ; EXTENDS10 = ( Token ) match ( input , EXTENDS , FOLLOW_EXTENDS_in_typeParameterization309 ) ; stream_EXTENDS . add ( EXTENDS10 ) ; pushFollow ( FOLLOW_typeExpression_in_typeParameterization313 ) ; typExp = typeExpression ( ) ; state . _fsp -- ; stream_typeExpression . add ( typExp . getTree ( ) ) ; // AST REWRITE // elements : typExp // token labels : // rule labels : retval , typExp // token list labels : // rule list labels : // wildcard labels : retval . tree = root_0 ; RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream ( adaptor , "rule retval" , retval != null ? retval . tree : null ) ; RewriteRuleSubtreeStream stream_typExp = new RewriteRuleSubtreeStream ( adaptor , "rule typExp" , typExp != null ? typExp . tree : null ) ; root_0 = ( CommonTree ) adaptor . nil ( ) ; // 114:45 : - > ^ ( EXT $ typExp ) { // org / javaruntype / type / parser / Type . g : 114:48 : ^ ( EXT $ typExp ) { CommonTree root_1 = ( CommonTree ) adaptor . nil ( ) ; root_1 = ( CommonTree ) adaptor . becomeRoot ( ( CommonTree ) adaptor . create ( EXT , "EXT" ) , root_1 ) ; adaptor . addChild ( root_1 , stream_typExp . nextTree ( ) ) ; adaptor . addChild ( root_0 , root_1 ) ; } } retval . tree = root_0 ; } break ; case 4 : // org / javaruntype / type / parser / Type . g : 115:7 : UNKNOWN SUPER typExp = typeExpression { UNKNOWN11 = ( Token ) match ( input , UNKNOWN , FOLLOW_UNKNOWN_in_typeParameterization330 ) ; stream_UNKNOWN . add ( UNKNOWN11 ) ; SUPER12 = ( Token ) match ( input , SUPER , FOLLOW_SUPER_in_typeParameterization332 ) ; stream_SUPER . add ( SUPER12 ) ; pushFollow ( FOLLOW_typeExpression_in_typeParameterization336 ) ; typExp = typeExpression ( ) ; state . _fsp -- ; stream_typeExpression . add ( typExp . getTree ( ) ) ; // AST REWRITE // elements : typExp // token labels : // rule labels : retval , typExp // token list labels : // rule list labels : // wildcard labels : retval . tree = root_0 ; RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream ( adaptor , "rule retval" , retval != null ? retval . tree : null ) ; RewriteRuleSubtreeStream stream_typExp = new RewriteRuleSubtreeStream ( adaptor , "rule typExp" , typExp != null ? typExp . tree : null ) ; root_0 = ( CommonTree ) adaptor . nil ( ) ; // 115:43 : - > ^ ( SUP $ typExp ) { // org / javaruntype / type / parser / Type . g : 115:46 : ^ ( SUP $ typExp ) { CommonTree root_1 = ( CommonTree ) adaptor . nil ( ) ; root_1 = ( CommonTree ) adaptor . becomeRoot ( ( CommonTree ) adaptor . create ( SUP , "SUP" ) , root_1 ) ; adaptor . addChild ( root_1 , stream_typExp . nextTree ( ) ) ; adaptor . addChild ( root_0 , root_1 ) ; } } retval . tree = root_0 ; } break ; } retval . stop = input . LT ( - 1 ) ; retval . tree = ( CommonTree ) adaptor . rulePostProcessing ( root_0 ) ; adaptor . setTokenBoundaries ( retval . tree , retval . start , retval . stop ) ; } catch ( RecognitionException e ) { throw e ; } finally { } return retval ;