signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class HttpRequest { /** * 获取请求URL最后的一个 / 后面的部分的int值 < br > * 例如请求URL / pipes / record / query / 2 < br > * 获取type参数 : int type = request . getRequstURILastPath ( 0 ) ; / / type = 2 * @ param defvalue 默认int值 * @ return int值 */ public int getRequstURILastPath ( int defvalue ) { } }
String val = getRequstURILastPath ( ) ; try { return val . isEmpty ( ) ? defvalue : Integer . parseInt ( val ) ; } catch ( NumberFormatException e ) { return defvalue ; }
public class EmulatedFields { /** * Finds and returns the boolean value of a given field named { @ code name } in * the receiver . If the field has not been assigned any value yet , the * default value { @ code defaultValue } is returned instead . * @ param name * the name of the field to find . * @ param defaultValue * return value in case the field has not been assigned to yet . * @ return the value of the given field if it has been assigned , the default * value otherwise . * @ throws IllegalArgumentException * if the corresponding field can not be found . */ public boolean get ( String name , boolean defaultValue ) throws IllegalArgumentException { } }
ObjectSlot slot = findMandatorySlot ( name , boolean . class ) ; return slot . defaulted ? defaultValue : ( ( Boolean ) slot . fieldValue ) . booleanValue ( ) ;
public class AmazonEC2Client { /** * Reports the current modification status of EBS volumes . * Current - generation EBS volumes support modification of attributes including type , size , and ( for < code > io1 < / code > * volumes ) IOPS provisioning while either attached to or detached from an instance . Following an action from the * API or the console to modify a volume , the status of the modification may be < code > modifying < / code > , * < code > optimizing < / code > , < code > completed < / code > , or < code > failed < / code > . If a volume has never been modified , * then certain elements of the returned < code > VolumeModification < / code > objects are null . * You can also use CloudWatch Events to check the status of a modification to an EBS volume . For information about * CloudWatch Events , see the < a href = " https : / / docs . aws . amazon . com / AmazonCloudWatch / latest / events / " > Amazon * CloudWatch Events User Guide < / a > . For more information , see < a * href = " https : / / docs . aws . amazon . com / AWSEC2 / latest / UserGuide / ebs - expand - volume . html # monitoring _ mods " > Monitoring * Volume Modifications " < / a > in the < i > Amazon Elastic Compute Cloud User Guide < / i > . * @ param describeVolumesModificationsRequest * @ return Result of the DescribeVolumesModifications operation returned by the service . * @ sample AmazonEC2 . DescribeVolumesModifications * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / ec2-2016-11-15 / DescribeVolumesModifications " * target = " _ top " > AWS API Documentation < / a > */ @ Override public DescribeVolumesModificationsResult describeVolumesModifications ( DescribeVolumesModificationsRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeDescribeVolumesModifications ( request ) ;
public class Consumers { /** * Consumes the input iterator to the output iterator . * @ param < E > the iterator element type * @ param iterator the iterator that will be consumed * @ param outputIterator the iterator that will be filled */ public static < E > void pipe ( Iterator < E > iterator , OutputIterator < E > outputIterator ) { } }
new ConsumeIntoOutputIterator < > ( outputIterator ) . apply ( iterator ) ;
public class TransactionImpl { /** * Registers the object ( without locking ) with this transaction . This method * expects that the object was already locked , no check is done ! ! ! */ void doSingleRegister ( RuntimeObject rtObject , int lockMode ) throws LockNotGrantedException , PersistenceBrokerException { } }
if ( log . isDebugEnabled ( ) ) log . debug ( "Register object " + rtObject . getIdentity ( ) ) ; Object objectToRegister = rtObject . getObj ( ) ; /* if the object is a Proxy there are two options : 1 . The proxies real subject has already been materialized : we take this real subject as the object to register and proceed as if it were a ordinary object . 2 . The real subject has not been materialized : Then there is nothing to be registered now ! Of course we might just materialize the real subject to have something to register . But this would make proxies useless for ODMG as proxies would get materialized even if their real subjects were not used by the client app . Thus we register the current transaction as a Listener to the IndirectionHandler of the Proxy . Only when the IndirectionHandler performs the materialization of the real subject at some later point in time it invokes callbacks on all it ' s listeners . Using this callback we can defer the registering until it ' s really needed . */ if ( rtObject . isProxy ( ) ) { IndirectionHandler handler = rtObject . getHandler ( ) ; if ( handler == null ) { throw new OJBRuntimeException ( "Unexpected error, expect an proxy object as indicated: " + rtObject ) ; } if ( handler . alreadyMaterialized ( ) ) { objectToRegister = handler . getRealSubject ( ) ; } else { registerToIndirectionHandler ( handler ) ; registerUnmaterializedLocks ( rtObject . getObj ( ) ) ; // all work is done , so set to null objectToRegister = null ; } } // no Proxy and is not null , register real object if ( objectToRegister != null ) { ObjectEnvelope envelope = objectEnvelopeTable . getByIdentity ( rtObject . getIdentity ( ) ) ; // if we found an envelope , object is already registered - - > we do nothing // than refreshing the object ! if ( ( envelope == null ) ) { // register object itself envelope = objectEnvelopeTable . get ( rtObject . getIdentity ( ) , objectToRegister , rtObject . isNew ( ) ) ; } else { /* arminw : if an different instance of the same object was locked again we should replace the old instance with new one to make accessible the changed fields */ envelope . refreshObjectIfNeeded ( objectToRegister ) ; } /* arminw : For better performance we check if this object has already a write lock in this case we don ' t need to acquire a write lock on commit */ if ( lockMode == Transaction . WRITE ) { // signal ObjectEnvelope that a WRITE lock is already acquired envelope . setWriteLocked ( true ) ; } }
public class MapsforgeTilesGenerator { /** * Convert a tile coordinate at a given zoom to its lat / lon bounds . * @ param tx tile x . * @ param ty tile y . * @ param zoom the zoom level . * @ return the bounds as [ n , s , w , e ] . */ public double [ ] tile2Bounds ( final int tx , final int ty , final int zoom ) { } }
double [ ] nswe = new double [ 4 ] ; nswe [ 0 ] = tile2lat ( ty , zoom ) ; nswe [ 1 ] = tile2lat ( ty + 1 , zoom ) ; nswe [ 2 ] = tile2lon ( tx , zoom ) ; nswe [ 3 ] = tile2lon ( tx + 1 , zoom ) ; return nswe ;
public class DateUtil { /** * Adds or subtracts the specified amount of time to the given time unit , * based on the calendar ' s rules . For example , to subtract 5 days from the * current time of the calendar , you can achieve it by calling : * < code > N . roll ( c , - 5 , TimeUnit . DAYS ) < / code > . * @ param calendar * @ param amount * @ param unit * @ return a new instance of Calendar with the specified amount rolled . * @ deprecated replaced by { @ code addYears / addMonths / addWeeks / . . . } */ @ Deprecated public static < T extends Calendar > T roll ( final T calendar , final long amount , final TimeUnit unit ) { } }
N . checkArgNotNull ( calendar , "calendar" ) ; return createCalendar ( calendar , calendar . getTimeInMillis ( ) + unit . toMillis ( amount ) ) ;
public class JmxService { /** * Return subtree of nodes for a domain */ public DynaTreeNode getDomainTree ( String domainName ) { } }
DynaTreeNode domainNode = new DynaTreeNode ( ) . setTitle ( domainName ) . setKey ( domainName ) . setMode ( MODE_DOMAIN ) ; try { // List all objects in the domain ObjectName name = new ObjectName ( domainName + ":*" ) ; Set < ObjectName > objs = mBeanServer . queryNames ( name , null ) ; // Convert object naems to a tree for ( ObjectName objName : objs ) { MBeanInfo info = mBeanServer . getMBeanInfo ( objName ) ; Matcher m = csvRE . matcher ( objName . getKeyPropertyListString ( ) ) ; DynaTreeNode node = domainNode ; StringBuilder innerKey = new StringBuilder ( ) ; innerKey . append ( domainName ) . append ( ":" ) ; while ( m . find ( ) ) { String title = StringUtils . removeEnd ( m . group ( ) , "," ) ; String key = StringUtils . substringBefore ( title , "=" ) ; String value = StringUtils . substringAfter ( title , "=" ) ; value = StringUtils . removeStart ( value , "\"" ) ; value = StringUtils . removeEnd ( value , "\"" ) ; innerKey . append ( title ) . append ( "," ) ; DynaTreeNode next = node . getChild ( value ) ; if ( next == null ) { next = new DynaTreeNode ( ) . setTitle ( value ) . setMode ( MODE_INNER ) . setKey ( innerKey . toString ( ) + "*" ) . setNoLink ( false ) ; node . putChild ( next ) ; } node = next ; } node . setKey ( objName . getCanonicalName ( ) ) . setMode ( MODE_LEAF ) ; if ( info . getAttributes ( ) != null || info . getOperations ( ) != null || info . getNotifications ( ) != null ) { node . setNoLink ( false ) ; } } } catch ( MalformedObjectNameException e ) { LOG . error ( "Exception in getDomainTree " , e ) ; } catch ( IntrospectionException e ) { LOG . error ( "Exception in getDomainTree " , e ) ; } catch ( ReflectionException e ) { LOG . error ( "Exception in getDomainTree " , e ) ; } catch ( InstanceNotFoundException e ) { LOG . error ( "Exception in getDomainTree " , e ) ; } catch ( RuntimeException e ) { LOG . error ( "Exception in getDomainTree " , e ) ; } return domainNode ;
public class FurnaceClasspathScanner { /** * Scans all Forge addons for classes accepted by given filter . * TODO : Could be refactored - scan ( ) is almost the same . */ public List < Class < ? > > scanClasses ( Predicate < String > filter ) { } }
List < Class < ? > > discoveredClasses = new ArrayList < > ( 128 ) ; // For each Forge addon . . . for ( Addon addon : furnace . getAddonRegistry ( ) . getAddons ( AddonFilters . allStarted ( ) ) ) { List < String > discoveredFileNames = filterAddonResources ( addon , filter ) ; // Then try to load the classes . for ( String discoveredFilename : discoveredFileNames ) { String clsName = PathUtil . classFilePathToClassname ( discoveredFilename ) ; try { Class < ? > clazz = addon . getClassLoader ( ) . loadClass ( clsName ) ; discoveredClasses . add ( clazz ) ; } catch ( ClassNotFoundException ex ) { LOG . log ( Level . WARNING , "Failed to load class for name '" + clsName + "':\n" + ex . getMessage ( ) , ex ) ; } } } return discoveredClasses ;
public class PrepareRequestInterceptor { /** * Method returns true if this request expects PDF as response * @ param map * @ return */ private boolean isDownloadPDF ( Map < String , String > map ) { } }
return StringUtils . hasText ( map . get ( RequestElements . REQ_PARAM_ENTITY_SELECTOR ) ) && map . get ( RequestElements . REQ_PARAM_ENTITY_SELECTOR ) . equalsIgnoreCase ( ContentTypes . PDF . name ( ) ) ;
public class JSConsumerSet { /** * / * ( non - Javadoc ) * @ see com . ibm . wsspi . sib . extension . ConsumerSet # getFlows ( ) */ public Flow [ ] getFlows ( ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "getFlows" ) ; } Flow [ ] flows = classifications . getFlows ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . exit ( tc , "getFlows" , flows ) ; } return flows ;
public class Configuration { /** * Register a schema specific table override * @ param schema schema of table * @ param oldTable table to override * @ param newSchema override schema * @ param newTable override table * @ return previous override value * @ deprecated Use { @ link # setDynamicNameMapping ( NameMapping ) } instead . */ @ Deprecated public SchemaAndTable registerTableOverride ( String schema , String oldTable , String newSchema , String newTable ) { } }
return registerTableOverride ( new SchemaAndTable ( schema , oldTable ) , new SchemaAndTable ( newSchema , newTable ) ) ;
public class AcceleratedScreen { /** * Copy the contents of the GL backbuffer to the screen * @ return success or failure */ public boolean swapBuffers ( ) { } }
boolean result = false ; synchronized ( NativeScreen . framebufferSwapLock ) { result = egl . eglSwapBuffers ( eglDisplay , eglSurface ) ; // TODO this shouldn ' t happen . In case the surface is invalid , we need to have recreated it before this method is called if ( ! result ) { createSurface ( ) ; result = egl . eglSwapBuffers ( eglDisplay , eglSurface ) ; } } return result ;
public class RocksDbWrapper { /** * Open a { @ link RocksDB } with default options in read - only mode . * @ param dirPath * existing { @ link RocksDB } data directory * @ return * @ throws RocksDbException * @ throws IOException */ public static RocksDbWrapper openReadOnly ( String dirPath ) throws RocksDbException , IOException { } }
RocksDbWrapper rocksDbWrapper = new RocksDbWrapper ( dirPath , true ) ; rocksDbWrapper . init ( ) ; return rocksDbWrapper ;
public class Grantee { /** * Full or partial rights are added to existing */ void addToFullRights ( HashMap map ) { } }
Iterator it = map . keySet ( ) . iterator ( ) ; while ( it . hasNext ( ) ) { Object key = it . next ( ) ; Right add = ( Right ) map . get ( key ) ; Right existing = ( Right ) fullRightsMap . get ( key ) ; if ( existing == null ) { existing = add . duplicate ( ) ; fullRightsMap . put ( key , existing ) ; } else { existing . add ( add ) ; } if ( add . grantableRights == null ) { continue ; } if ( existing . grantableRights == null ) { existing . grantableRights = add . grantableRights . duplicate ( ) ; } else { existing . grantableRights . add ( add . grantableRights ) ; } }
public class CmsRfsFileDisposalDialog { /** * Generates the output . < p > * @ throws IOException if something goes wrong */ public void generateOutput ( ) throws IOException { } }
HttpServletResponse res = CmsFlexController . getController ( getJsp ( ) . getRequest ( ) ) . getTopResponse ( ) ; res . setContentType ( "application/octet-stream" ) ; res . setHeader ( "Content-Disposition" , new StringBuffer ( "attachment; filename=\"" ) . append ( getDownloadFile ( ) . getName ( ) ) . append ( "\"" ) . toString ( ) ) ; res . setContentLength ( ( int ) getDownloadFile ( ) . length ( ) ) ; // getOutputStream ( ) throws IllegalStateException if the jsp directive buffer = " none " is set . ServletOutputStream outStream = res . getOutputStream ( ) ; InputStream in = new BufferedInputStream ( new FileInputStream ( getDownloadFile ( ) ) ) ; try { // don ' t write the last ' - 1' int bit = in . read ( ) ; while ( ( bit ) >= 0 ) { outStream . write ( bit ) ; bit = in . read ( ) ; } } catch ( SocketException soe ) { // this is the case for ie if cancel in download window is chosen : // " Connection reset by peer : socket write error " . But not for firefox - > don ' t care } finally { if ( outStream != null ) { try { outStream . flush ( ) ; outStream . close ( ) ; } catch ( SocketException soe ) { // ignore } } in . close ( ) ; }
public class CountCondition { /** * Note : Check has a side effect ( it increments a counter ) . Invoking it multiple times may * result in a different answer . */ @ Override public boolean check ( EmbeddedBrowser browser ) { } }
if ( condition . check ( browser ) ) { count . getAndIncrement ( ) ; } return count . get ( ) <= maxCount ;
public class SystemManager { /** * Returns the system for the given class . */ @ SuppressWarnings ( "unchecked" ) public < T extends SubSystem > T getSystem ( Class < T > cl ) { } }
return ( T ) _systemMap . get ( cl ) ;
public class RaidNode { /** * only used by test */ public static boolean doRaid ( Configuration conf , FileStatus stat , Path destPath , Codec codec , Statistics statistics , Progressable reporter , boolean doSimulate , int targetRepl , int metaRepl ) throws IOException { } }
boolean succeed = false ; for ( EncodingCandidate ec : RaidNode . splitPaths ( conf , codec , stat ) ) { succeed = succeed || doRaid ( conf , ec , destPath , codec , statistics , reporter , doSimulate , targetRepl , metaRepl ) ; } return succeed ;
public class TrainingsImpl { /** * Get information about a specific domain . * @ param domainId The id of the domain to get information about * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the Domain object */ public Observable < Domain > getDomainAsync ( UUID domainId ) { } }
return getDomainWithServiceResponseAsync ( domainId ) . map ( new Func1 < ServiceResponse < Domain > , Domain > ( ) { @ Override public Domain call ( ServiceResponse < Domain > response ) { return response . body ( ) ; } } ) ;
public class StringMan { /** * Decompresses a string encoded by { @ link # compressHexString } */ public static String decompressHexString ( String in ) { } }
StringBuilder out = new StringBuilder ( ) ; for ( int i = 0 ; i < in . length ( ) ; i ++ ) { char thisChar = in . charAt ( i ) ; if ( thisChar != '^' ) { out . append ( thisChar ) ; } else { thisChar = in . charAt ( i + 1 ) ; int count = "abcdefghijklmnopqrstuvwxyz01234567890" . indexOf ( in . charAt ( i + 2 ) ) ; for ( int j = 0 ; j < count ; j ++ ) out . append ( thisChar ) ; i += 2 ; } } return out . toString ( ) ;
public class AuditCheckConfigurationMarshaller { /** * Marshall the given parameter object . */ public void marshall ( AuditCheckConfiguration auditCheckConfiguration , ProtocolMarshaller protocolMarshaller ) { } }
if ( auditCheckConfiguration == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( auditCheckConfiguration . getEnabled ( ) , ENABLED_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class MonthPeriod { /** * 返回与指定时间点相差的秒数 . * @ return */ public int getSeconds ( ) { } }
// TODO ahai 如果当月时间未到呢 ? Calendar cld = Calendar . getInstance ( ) ; cld . add ( Calendar . MONTH , 1 ) ; cld . set ( Calendar . DAY_OF_MONTH , day ) ; cld . set ( Calendar . HOUR_OF_DAY , this . hour ) ; cld . set ( Calendar . MINUTE , this . minute ) ; cld . set ( Calendar . SECOND , this . second ) ; long time = cld . getTimeInMillis ( ) ; long diff = time - System . currentTimeMillis ( ) ; if ( diff <= 0 ) { // 一定要小于等于0 // 本周的时间已过 , 下周再执行 diff += 7 * 24 * 60 * 60 * 1000L ; } int seconds = ( int ) ( diff / 1000 ) ; return seconds ;
public class Resource { /** * - - - - - protected methods - - - - - */ protected PropertyKey findPropertyKey ( final TypedIdResource typedIdResource , final TypeResource typeResource ) { } }
Class sourceNodeType = typedIdResource . getTypeResource ( ) . getEntityClass ( ) ; String rawName = typeResource . getRawType ( ) ; PropertyKey key = StructrApp . getConfiguration ( ) . getPropertyKeyForJSONName ( sourceNodeType , rawName , false ) ; if ( key == null ) { // try to convert raw name into lower - case variable name key = StructrApp . getConfiguration ( ) . getPropertyKeyForJSONName ( sourceNodeType , CaseHelper . toLowerCamelCase ( rawName ) , false ) ; } return key ;
public class SARLPackageExplorerPart { /** * Replies the viewer . * @ return the viewer . */ protected ProblemTreeViewer getViewer ( ) { } }
try { return ( ProblemTreeViewer ) this . reflect . get ( this , "fViewer" ) ; // $ NON - NLS - 1 $ } catch ( SecurityException | NoSuchFieldException | IllegalArgumentException | IllegalAccessException e ) { throw new Error ( e ) ; }
public class LongArrayList { /** * Returns < tt > true < / tt > if this list contains the specified element . * @ param elem element whose presence in this List is to be tested . * @ return < code > true < / code > if the specified element is present ; * < code > false < / code > otherwise . */ @ Override public boolean contains ( Object elem ) { } }
if ( elem == null ) return false ; if ( elem instanceof Number ) return contains ( ( ( Number ) elem ) . longValue ( ) ) ; return false ;
public class StatefulBeanO { /** * Inform this < code > SessionBeanO < / code > that a method * invocation has completed on its associated enterprise bean . < p > * @ param id an < code > int < / code > indicating which method is being * invoked on this < code > BeanO < / code > < p > * @ param s the < code > EJSDeployedSupport < / code > instance passed to * both pre and postInvoke < p > */ @ Override public synchronized void postInvoke ( int id , EJSDeployedSupport s ) // LIDB2018-1 throws RemoteException { } }
currentIsolationLevel = s . oldIsolationLevel ; if ( removed ) { return ; } switch ( state ) { case IN_METHOD : setState ( METHOD_READY ) ; break ; case TX_IN_METHOD : setState ( TX_METHOD_READY ) ; break ; case DESTROYED : return ; default : throw new InvalidBeanOStateException ( StateStrs [ state ] , "IN_METHOD | TX_IN_METHOD " + "| DESTROYED" ) ; } // If the current method exiting is a Remove method ( @ Remove ) on a // business interface and there was no exception , or an app exception // and retain was not specified , then set the bean in the current tx // for removal after the transaction completes . 390657 if ( s . methodInfo . ivSFSBRemove && ( s . ivWrapper . ivInterface == BUSINESS_LOCAL || s . ivWrapper . ivInterface == BUSINESS_REMOTE || s . ivWrapper . ivInterface == BUSINESS_RMI_REMOTE ) && ( s . getExceptionType ( ) == ExceptionType . NO_EXCEPTION || ( ! s . methodInfo . ivRetainIfException && s . getExceptionType ( ) == ExceptionType . CHECKED_EXCEPTION ) ) ) { s . currentTx . ivRemoveBeanO = this ; }
public class Scope { /** * Removes all the child scopes */ public void removeChildren ( ) { } }
log . trace ( "removeChildren of {}" , name ) ; for ( IBasicScope child : children . keySet ( ) ) { removeChildScope ( child ) ; }
public class GramAttributes { /** * Checks if dryryn is enabled . * @ return true only if dryrun is enabled . False , * otherwise . */ public boolean isDryRun ( ) { } }
String run = getSingle ( "dryrun" ) ; if ( run == null ) return false ; if ( run . equalsIgnoreCase ( "yes" ) ) return true ; return false ;
public class LookasideCache { /** * Eviction occurs if the cache is full , we free up a specified * percentage of the cache on every run . This method is synchronized * so that only one thread is doing the eviction . */ synchronized void checkEvict ( ) throws IOException { } }
if ( cacheSize . get ( ) < cacheSizeMax ) { return ; // nothing to do , plenty of free space } // Only one thread should be doing the eviction . Do not block // current thread , it is ok to oversubscribe the cache size // temporarily . if ( evictionInProgress ) { return ; } // record the fact that eviction has started . evictionInProgress = true ; try { // if the cache has reached a threshold size , then free old entries . long curSize = cacheSize . get ( ) ; // how much to evict in one iteration long targetSize = cacheSizeMax - ( cacheSizeMax * cacheEvictPercent ) / 100 ; if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( "Cache size " + curSize + " has exceeded the " + " maximum configured cacpacity " + cacheSizeMax + ". Eviction has to reduce cache size to " + targetSize ) ; } // sort all entries based on their accessTimes Collection < CacheEntry > values = cacheMap . values ( ) ; CacheEntry [ ] records = values . toArray ( new CacheEntry [ values . size ( ) ] ) ; Arrays . sort ( records , LRU_COMPARATOR ) ; for ( int i = 0 ; i < records . length ; i ++ ) { if ( cacheSize . get ( ) <= targetSize ) { break ; // we reclaimed everything we wanted to } CacheEntry c = records [ i ] ; evictCache ( c . hdfsPath ) ; } } finally { evictionInProgress = false ; // eviction done . } if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( "Cache eviction complete. Current cache size is " + cacheSize . get ( ) ) ; }
public class DeprecatedListWriter { /** * Get the contents list . * @ param deprapi the deprecated list builder * @ return a content tree for the contents list */ public Content getContentsList ( DeprecatedAPIListBuilder deprapi ) { } }
Content headContent = contents . deprecatedAPI ; Content heading = HtmlTree . HEADING ( HtmlConstants . TITLE_HEADING , true , HtmlStyle . title , headContent ) ; Content div = HtmlTree . DIV ( HtmlStyle . header , heading ) ; Content headingContent = contents . contentsHeading ; div . addContent ( HtmlTree . HEADING ( HtmlConstants . CONTENT_HEADING , true , headingContent ) ) ; Content ul = new HtmlTree ( HtmlTag . UL ) ; for ( DeprElementKind kind : DeprElementKind . values ( ) ) { addIndexLink ( deprapi , kind , ul ) ; } div . addContent ( ul ) ; return div ;
public class MpxjFilter { /** * This method opens the named project , applies the named filter * and displays the filtered list of tasks or resources . If an * invalid filter name is supplied , a list of valid filter names * is shown . * @ param filename input file name * @ param filtername input filter name */ private static void filter ( String filename , String filtername ) throws Exception { } }
ProjectFile project = new UniversalProjectReader ( ) . read ( filename ) ; Filter filter = project . getFilters ( ) . getFilterByName ( filtername ) ; if ( filter == null ) { displayAvailableFilters ( project ) ; } else { System . out . println ( filter ) ; System . out . println ( ) ; if ( filter . isTaskFilter ( ) ) { processTaskFilter ( project , filter ) ; } else { processResourceFilter ( project , filter ) ; } }
public class StoreSwitch { /** * Calls < code > caseXXX < / code > for each class of the model until one returns a non null result ; it yields that result . * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ return the first non - null result returned by a < code > caseXXX < / code > call . * @ generated */ @ Override protected T doSwitch ( int classifierID , EObject theEObject ) { } }
switch ( classifierID ) { case StorePackage . PROJECT : { Project project = ( Project ) theEObject ; T result = caseProject ( project ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . USER : { User user = ( User ) theEObject ; T result = caseUser ( user ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . REVISION : { Revision revision = ( Revision ) theEObject ; T result = caseRevision ( revision ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . CONCRETE_REVISION : { ConcreteRevision concreteRevision = ( ConcreteRevision ) theEObject ; T result = caseConcreteRevision ( concreteRevision ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . GEO_TAG : { GeoTag geoTag = ( GeoTag ) theEObject ; T result = caseGeoTag ( geoTag ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . CHECKOUT : { Checkout checkout = ( Checkout ) theEObject ; T result = caseCheckout ( checkout ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . SERVER_SETTINGS : { ServerSettings serverSettings = ( ServerSettings ) theEObject ; T result = caseServerSettings ( serverSettings ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . USER_SETTINGS : { UserSettings userSettings = ( UserSettings ) theEObject ; T result = caseUserSettings ( userSettings ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . PLUGIN_CONFIGURATION : { PluginConfiguration pluginConfiguration = ( PluginConfiguration ) theEObject ; T result = casePluginConfiguration ( pluginConfiguration ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . SERIALIZER_PLUGIN_CONFIGURATION : { SerializerPluginConfiguration serializerPluginConfiguration = ( SerializerPluginConfiguration ) theEObject ; T result = caseSerializerPluginConfiguration ( serializerPluginConfiguration ) ; if ( result == null ) result = casePluginConfiguration ( serializerPluginConfiguration ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . OBJECT_IDM_PLUGIN_CONFIGURATION : { ObjectIDMPluginConfiguration objectIDMPluginConfiguration = ( ObjectIDMPluginConfiguration ) theEObject ; T result = caseObjectIDMPluginConfiguration ( objectIDMPluginConfiguration ) ; if ( result == null ) result = casePluginConfiguration ( objectIDMPluginConfiguration ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . RENDER_ENGINE_PLUGIN_CONFIGURATION : { RenderEnginePluginConfiguration renderEnginePluginConfiguration = ( RenderEnginePluginConfiguration ) theEObject ; T result = caseRenderEnginePluginConfiguration ( renderEnginePluginConfiguration ) ; if ( result == null ) result = casePluginConfiguration ( renderEnginePluginConfiguration ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . DESERIALIZER_PLUGIN_CONFIGURATION : { DeserializerPluginConfiguration deserializerPluginConfiguration = ( DeserializerPluginConfiguration ) theEObject ; T result = caseDeserializerPluginConfiguration ( deserializerPluginConfiguration ) ; if ( result == null ) result = casePluginConfiguration ( deserializerPluginConfiguration ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . DOWNLOAD_RESULT : { DownloadResult downloadResult = ( DownloadResult ) theEObject ; T result = caseDownloadResult ( downloadResult ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . CHECKOUT_RESULT : { CheckoutResult checkoutResult = ( CheckoutResult ) theEObject ; T result = caseCheckoutResult ( checkoutResult ) ; if ( result == null ) result = caseDownloadResult ( checkoutResult ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . DATA_VALUE : { DataValue dataValue = ( DataValue ) theEObject ; T result = caseDataValue ( dataValue ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . DATA_OBJECT : { DataObject dataObject = ( DataObject ) theEObject ; T result = caseDataObject ( dataObject ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . USER_SESSION : { UserSession userSession = ( UserSession ) theEObject ; T result = caseUserSession ( userSession ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . MIGRATION : { Migration migration = ( Migration ) theEObject ; T result = caseMigration ( migration ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . REFERENCE_DATA_VALUE : { ReferenceDataValue referenceDataValue = ( ReferenceDataValue ) theEObject ; T result = caseReferenceDataValue ( referenceDataValue ) ; if ( result == null ) result = caseDataValue ( referenceDataValue ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . LIST_DATA_VALUE : { ListDataValue listDataValue = ( ListDataValue ) theEObject ; T result = caseListDataValue ( listDataValue ) ; if ( result == null ) result = caseDataValue ( listDataValue ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . SIMPLE_DATA_VALUE : { SimpleDataValue simpleDataValue = ( SimpleDataValue ) theEObject ; T result = caseSimpleDataValue ( simpleDataValue ) ; if ( result == null ) result = caseDataValue ( simpleDataValue ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . DATABASE_INFORMATION_ITEM : { DatabaseInformationItem databaseInformationItem = ( DatabaseInformationItem ) theEObject ; T result = caseDatabaseInformationItem ( databaseInformationItem ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . DATABASE_INFORMATION_CATEGORY : { DatabaseInformationCategory databaseInformationCategory = ( DatabaseInformationCategory ) theEObject ; T result = caseDatabaseInformationCategory ( databaseInformationCategory ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . DATABASE_INFORMATION : { DatabaseInformation databaseInformation = ( DatabaseInformation ) theEObject ; T result = caseDatabaseInformation ( databaseInformation ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . PLUGIN_DESCRIPTOR : { PluginDescriptor pluginDescriptor = ( PluginDescriptor ) theEObject ; T result = casePluginDescriptor ( pluginDescriptor ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . REVISION_SUMMARY_TYPE : { RevisionSummaryType revisionSummaryType = ( RevisionSummaryType ) theEObject ; T result = caseRevisionSummaryType ( revisionSummaryType ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . REVISION_SUMMARY_CONTAINER : { RevisionSummaryContainer revisionSummaryContainer = ( RevisionSummaryContainer ) theEObject ; T result = caseRevisionSummaryContainer ( revisionSummaryContainer ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . REVISION_SUMMARY : { RevisionSummary revisionSummary = ( RevisionSummary ) theEObject ; T result = caseRevisionSummary ( revisionSummary ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . LONG_ACTION : { LongAction longAction = ( LongAction ) theEObject ; T result = caseLongAction ( longAction ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . OBJECT_IDM_PLUGIN_DESCRIPTOR : { ObjectIDMPluginDescriptor objectIDMPluginDescriptor = ( ObjectIDMPluginDescriptor ) theEObject ; T result = caseObjectIDMPluginDescriptor ( objectIDMPluginDescriptor ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . COMPARE_ITEM : { CompareItem compareItem = ( CompareItem ) theEObject ; T result = caseCompareItem ( compareItem ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . OBJECT_ADDED : { ObjectAdded objectAdded = ( ObjectAdded ) theEObject ; T result = caseObjectAdded ( objectAdded ) ; if ( result == null ) result = caseCompareItem ( objectAdded ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . OBJECT_REMOVED : { ObjectRemoved objectRemoved = ( ObjectRemoved ) theEObject ; T result = caseObjectRemoved ( objectRemoved ) ; if ( result == null ) result = caseCompareItem ( objectRemoved ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . OBJECT_MODIFIED : { ObjectModified objectModified = ( ObjectModified ) theEObject ; T result = caseObjectModified ( objectModified ) ; if ( result == null ) result = caseCompareItem ( objectModified ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . COMPARE_CONTAINER : { CompareContainer compareContainer = ( CompareContainer ) theEObject ; T result = caseCompareContainer ( compareContainer ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . COMPARE_RESULT : { CompareResult compareResult = ( CompareResult ) theEObject ; T result = caseCompareResult ( compareResult ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . LONG_ACTION_STATE : { LongActionState longActionState = ( LongActionState ) theEObject ; T result = caseLongActionState ( longActionState ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . SERVER_INFO : { ServerInfo serverInfo = ( ServerInfo ) theEObject ; T result = caseServerInfo ( serverInfo ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . VERSION : { Version version = ( Version ) theEObject ; T result = caseVersion ( version ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . FILE : { File file = ( File ) theEObject ; T result = caseFile ( file ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . EXTENDED_DATA_SCHEMA : { ExtendedDataSchema extendedDataSchema = ( ExtendedDataSchema ) theEObject ; T result = caseExtendedDataSchema ( extendedDataSchema ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . EXTENDED_DATA : { ExtendedData extendedData = ( ExtendedData ) theEObject ; T result = caseExtendedData ( extendedData ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . QUERY_ENGINE_PLUGIN_CONFIGURATION : { QueryEnginePluginConfiguration queryEnginePluginConfiguration = ( QueryEnginePluginConfiguration ) theEObject ; T result = caseQueryEnginePluginConfiguration ( queryEnginePluginConfiguration ) ; if ( result == null ) result = casePluginConfiguration ( queryEnginePluginConfiguration ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . WEB_MODULE_PLUGIN_CONFIGURATION : { WebModulePluginConfiguration webModulePluginConfiguration = ( WebModulePluginConfiguration ) theEObject ; T result = caseWebModulePluginConfiguration ( webModulePluginConfiguration ) ; if ( result == null ) result = casePluginConfiguration ( webModulePluginConfiguration ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . MODEL_MERGER_PLUGIN_CONFIGURATION : { ModelMergerPluginConfiguration modelMergerPluginConfiguration = ( ModelMergerPluginConfiguration ) theEObject ; T result = caseModelMergerPluginConfiguration ( modelMergerPluginConfiguration ) ; if ( result == null ) result = casePluginConfiguration ( modelMergerPluginConfiguration ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . MODEL_COMPARE_PLUGIN_CONFIGURATION : { ModelComparePluginConfiguration modelComparePluginConfiguration = ( ModelComparePluginConfiguration ) theEObject ; T result = caseModelComparePluginConfiguration ( modelComparePluginConfiguration ) ; if ( result == null ) result = casePluginConfiguration ( modelComparePluginConfiguration ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . PROFILE_DESCRIPTOR : { ProfileDescriptor profileDescriptor = ( ProfileDescriptor ) theEObject ; T result = caseProfileDescriptor ( profileDescriptor ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . SERVICE_DESCRIPTOR : { ServiceDescriptor serviceDescriptor = ( ServiceDescriptor ) theEObject ; T result = caseServiceDescriptor ( serviceDescriptor ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . SERVICE : { Service service = ( Service ) theEObject ; T result = caseService ( service ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . TOKEN : { Token token = ( Token ) theEObject ; T result = caseToken ( token ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . INTERNAL_SERVICE_PLUGIN_CONFIGURATION : { InternalServicePluginConfiguration internalServicePluginConfiguration = ( InternalServicePluginConfiguration ) theEObject ; T result = caseInternalServicePluginConfiguration ( internalServicePluginConfiguration ) ; if ( result == null ) result = casePluginConfiguration ( internalServicePluginConfiguration ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . SERVICE_INTERFACE : { ServiceInterface serviceInterface = ( ServiceInterface ) theEObject ; T result = caseServiceInterface ( serviceInterface ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . SERVICE_METHOD : { ServiceMethod serviceMethod = ( ServiceMethod ) theEObject ; T result = caseServiceMethod ( serviceMethod ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . SERVICE_FIELD : { ServiceField serviceField = ( ServiceField ) theEObject ; T result = caseServiceField ( serviceField ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . SERVICE_TYPE : { ServiceType serviceType = ( ServiceType ) theEObject ; T result = caseServiceType ( serviceType ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . SERVICE_PARAMETER : { ServiceParameter serviceParameter = ( ServiceParameter ) theEObject ; T result = caseServiceParameter ( serviceParameter ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . TYPE_DEFINITION : { TypeDefinition typeDefinition = ( TypeDefinition ) theEObject ; T result = caseTypeDefinition ( typeDefinition ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . OBJECT_DEFINITION : { ObjectDefinition objectDefinition = ( ObjectDefinition ) theEObject ; T result = caseObjectDefinition ( objectDefinition ) ; if ( result == null ) result = caseTypeDefinition ( objectDefinition ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . PRIMITIVE_DEFINITION : { PrimitiveDefinition primitiveDefinition = ( PrimitiveDefinition ) theEObject ; T result = casePrimitiveDefinition ( primitiveDefinition ) ; if ( result == null ) result = caseTypeDefinition ( primitiveDefinition ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . ARRAY_DEFINITION : { ArrayDefinition arrayDefinition = ( ArrayDefinition ) theEObject ; T result = caseArrayDefinition ( arrayDefinition ) ; if ( result == null ) result = caseTypeDefinition ( arrayDefinition ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . PARAMETER_DEFINITION : { ParameterDefinition parameterDefinition = ( ParameterDefinition ) theEObject ; T result = caseParameterDefinition ( parameterDefinition ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . TYPE : { Type type = ( Type ) theEObject ; T result = caseType ( type ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . OBJECT_TYPE : { ObjectType objectType = ( ObjectType ) theEObject ; T result = caseObjectType ( objectType ) ; if ( result == null ) result = caseType ( objectType ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . PRIMITIVE_TYPE : { PrimitiveType primitiveType = ( PrimitiveType ) theEObject ; T result = casePrimitiveType ( primitiveType ) ; if ( result == null ) result = caseType ( primitiveType ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . LONG_TYPE : { LongType longType = ( LongType ) theEObject ; T result = caseLongType ( longType ) ; if ( result == null ) result = casePrimitiveType ( longType ) ; if ( result == null ) result = caseType ( longType ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . BYTE_ARRAY_TYPE : { ByteArrayType byteArrayType = ( ByteArrayType ) theEObject ; T result = caseByteArrayType ( byteArrayType ) ; if ( result == null ) result = casePrimitiveType ( byteArrayType ) ; if ( result == null ) result = caseType ( byteArrayType ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . DOUBLE_TYPE : { DoubleType doubleType = ( DoubleType ) theEObject ; T result = caseDoubleType ( doubleType ) ; if ( result == null ) result = casePrimitiveType ( doubleType ) ; if ( result == null ) result = caseType ( doubleType ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . STRING_TYPE : { StringType stringType = ( StringType ) theEObject ; T result = caseStringType ( stringType ) ; if ( result == null ) result = casePrimitiveType ( stringType ) ; if ( result == null ) result = caseType ( stringType ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . BOOLEAN_TYPE : { BooleanType booleanType = ( BooleanType ) theEObject ; T result = caseBooleanType ( booleanType ) ; if ( result == null ) result = casePrimitiveType ( booleanType ) ; if ( result == null ) result = caseType ( booleanType ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . ARRAY_TYPE : { ArrayType arrayType = ( ArrayType ) theEObject ; T result = caseArrayType ( arrayType ) ; if ( result == null ) result = caseType ( arrayType ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . PARAMETER : { Parameter parameter = ( Parameter ) theEObject ; T result = caseParameter ( parameter ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . IMMEDIATE_NOTIFICATION_RESULT : { ImmediateNotificationResult immediateNotificationResult = ( ImmediateNotificationResult ) theEObject ; T result = caseImmediateNotificationResult ( immediateNotificationResult ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . REMOTE_SERVICE_UPDATE : { RemoteServiceUpdate remoteServiceUpdate = ( RemoteServiceUpdate ) theEObject ; T result = caseRemoteServiceUpdate ( remoteServiceUpdate ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . PERCENTAGE_CHANGE : { PercentageChange percentageChange = ( PercentageChange ) theEObject ; T result = casePercentageChange ( percentageChange ) ; if ( result == null ) result = caseRemoteServiceUpdate ( percentageChange ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . SYSTEM_INFO : { SystemInfo systemInfo = ( SystemInfo ) theEObject ; T result = caseSystemInfo ( systemInfo ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . JAVA_INFO : { JavaInfo javaInfo = ( JavaInfo ) theEObject ; T result = caseJavaInfo ( javaInfo ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . BIM_SERVER_INFO : { BimServerInfo bimServerInfo = ( BimServerInfo ) theEObject ; T result = caseBimServerInfo ( bimServerInfo ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . PROJECT_SMALL : { ProjectSmall projectSmall = ( ProjectSmall ) theEObject ; T result = caseProjectSmall ( projectSmall ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . IFC_HEADER : { IfcHeader ifcHeader = ( IfcHeader ) theEObject ; T result = caseIfcHeader ( ifcHeader ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . MODEL_CHECKER_RESULT_ITEM : { ModelCheckerResultItem modelCheckerResultItem = ( ModelCheckerResultItem ) theEObject ; T result = caseModelCheckerResultItem ( modelCheckerResultItem ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . MODEL_CHECKER_RESULT_HEADER : { ModelCheckerResultHeader modelCheckerResultHeader = ( ModelCheckerResultHeader ) theEObject ; T result = caseModelCheckerResultHeader ( modelCheckerResultHeader ) ; if ( result == null ) result = caseModelCheckerResultItem ( modelCheckerResultHeader ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . MODEL_CHECKER_RESULT_LINE : { ModelCheckerResultLine modelCheckerResultLine = ( ModelCheckerResultLine ) theEObject ; T result = caseModelCheckerResultLine ( modelCheckerResultLine ) ; if ( result == null ) result = caseModelCheckerResultItem ( modelCheckerResultLine ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . MODEL_CHECKER_RESULT : { ModelCheckerResult modelCheckerResult = ( ModelCheckerResult ) theEObject ; T result = caseModelCheckerResult ( modelCheckerResult ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . MODEL_CHECKER_INSTANCE : { ModelCheckerInstance modelCheckerInstance = ( ModelCheckerInstance ) theEObject ; T result = caseModelCheckerInstance ( modelCheckerInstance ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . MESSAGING_SERIALIZER_PLUGIN_CONFIGURATION : { MessagingSerializerPluginConfiguration messagingSerializerPluginConfiguration = ( MessagingSerializerPluginConfiguration ) theEObject ; T result = caseMessagingSerializerPluginConfiguration ( messagingSerializerPluginConfiguration ) ; if ( result == null ) result = caseSerializerPluginConfiguration ( messagingSerializerPluginConfiguration ) ; if ( result == null ) result = casePluginConfiguration ( messagingSerializerPluginConfiguration ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . METRICS : { Metrics metrics = ( Metrics ) theEObject ; T result = caseMetrics ( metrics ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . INTERFACE_METRIC : { InterfaceMetric interfaceMetric = ( InterfaceMetric ) theEObject ; T result = caseInterfaceMetric ( interfaceMetric ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . METHOD_METRIC : { MethodMetric methodMetric = ( MethodMetric ) theEObject ; T result = caseMethodMetric ( methodMetric ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . PLUGIN_BUNDLE_VERSION : { PluginBundleVersion pluginBundleVersion = ( PluginBundleVersion ) theEObject ; T result = casePluginBundleVersion ( pluginBundleVersion ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . PLUGIN_BUNDLE : { PluginBundle pluginBundle = ( PluginBundle ) theEObject ; T result = casePluginBundle ( pluginBundle ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . PLUGIN_INFORMATION : { PluginInformation pluginInformation = ( PluginInformation ) theEObject ; T result = casePluginInformation ( pluginInformation ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . OAUTH_SERVER : { OAuthServer oAuthServer = ( OAuthServer ) theEObject ; T result = caseOAuthServer ( oAuthServer ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . OAUTH_AUTHORIZATION_CODE : { OAuthAuthorizationCode oAuthAuthorizationCode = ( OAuthAuthorizationCode ) theEObject ; T result = caseOAuthAuthorizationCode ( oAuthAuthorizationCode ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . AUTHORIZATION : { Authorization authorization = ( Authorization ) theEObject ; T result = caseAuthorization ( authorization ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . SINGLE_PROJECT_AUTHORIZATION : { SingleProjectAuthorization singleProjectAuthorization = ( SingleProjectAuthorization ) theEObject ; T result = caseSingleProjectAuthorization ( singleProjectAuthorization ) ; if ( result == null ) result = caseAuthorization ( singleProjectAuthorization ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . NEW_SERVICE_DESCRIPTOR : { NewServiceDescriptor newServiceDescriptor = ( NewServiceDescriptor ) theEObject ; T result = caseNewServiceDescriptor ( newServiceDescriptor ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . FORMAT_SERIALIZER_MAP : { FormatSerializerMap formatSerializerMap = ( FormatSerializerMap ) theEObject ; T result = caseFormatSerializerMap ( formatSerializerMap ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . ACTION : { Action action = ( Action ) theEObject ; T result = caseAction ( action ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . STORE_EXTENDED_DATA : { StoreExtendedData storeExtendedData = ( StoreExtendedData ) theEObject ; T result = caseStoreExtendedData ( storeExtendedData ) ; if ( result == null ) result = caseAction ( storeExtendedData ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . CHECKIN_REVISION : { CheckinRevision checkinRevision = ( CheckinRevision ) theEObject ; T result = caseCheckinRevision ( checkinRevision ) ; if ( result == null ) result = caseAction ( checkinRevision ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . NEW_SERVICE : { NewService newService = ( NewService ) theEObject ; T result = caseNewService ( newService ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . RUN_SERVICE_AUTHORIZATION : { RunServiceAuthorization runServiceAuthorization = ( RunServiceAuthorization ) theEObject ; T result = caseRunServiceAuthorization ( runServiceAuthorization ) ; if ( result == null ) result = caseAuthorization ( runServiceAuthorization ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . DENSITY_COLLECTION : { DensityCollection densityCollection = ( DensityCollection ) theEObject ; T result = caseDensityCollection ( densityCollection ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . DENSITY : { Density density = ( Density ) theEObject ; T result = caseDensity ( density ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } case StorePackage . LONG_CHECKIN_ACTION_STATE : { LongCheckinActionState longCheckinActionState = ( LongCheckinActionState ) theEObject ; T result = caseLongCheckinActionState ( longCheckinActionState ) ; if ( result == null ) result = caseLongActionState ( longCheckinActionState ) ; if ( result == null ) result = defaultCase ( theEObject ) ; return result ; } default : return defaultCase ( theEObject ) ; }
public class PyramidOps { /** * Scales down the input by a factor of 2 . Every other pixel along both axises is skipped . */ public static < T extends ImageGray < T > > void scaleDown2 ( T input , T output ) { } }
if ( input instanceof GrayF32 ) { ImplPyramidOps . scaleDown2 ( ( GrayF32 ) input , ( GrayF32 ) output ) ; } else if ( input instanceof GrayU8 ) { ImplPyramidOps . scaleDown2 ( ( GrayU8 ) input , ( GrayU8 ) output ) ; } else { throw new IllegalArgumentException ( "Image type not yet supported" ) ; }
public class HttpServletResourceAdaptor { /** * ( non - Javadoc ) * @ see javax . slee . resource . ResourceAdaptor # queryLiveness ( javax . slee . resource . ActivityHandle ) */ public void queryLiveness ( javax . slee . resource . ActivityHandle activityHandle ) { } }
// end any idle activity , it should be a leak , this is true assuming // that jboss web session timeout is smaller than the container timeout // to invoke this method if ( tracer . isInfoEnabled ( ) ) { tracer . info ( "Activity " + activityHandle + " is idle in the container, terminating." ) ; } endActivity ( ( AbstractHttpServletActivity ) activityHandle ) ;
public class Options { /** * Return the length of the longest synopsis message in a list of options . Useful for aligning * options in usage strings . * @ param optList the options whose synopsis messages to measure * @ param showUnpublicized if true , include unpublicized options in the computation * @ return the length of the longest synopsis message in a list of options */ private int maxOptionLength ( List < OptionInfo > optList , boolean showUnpublicized ) { } }
int maxLength = 0 ; for ( OptionInfo oi : optList ) { if ( oi . unpublicized && ! showUnpublicized ) { continue ; } int len = oi . synopsis ( ) . length ( ) ; if ( len > maxLength ) { maxLength = len ; } } return maxLength ;
public class UserAttributesSet { /** * Sets a key - value pair into the attribute set of an user . The method will * search for the key and if the key already exists it will update the user * attribute in this set . If the key does not exist a new user attribute * will be added to this set . * @ param _ key key to be set * @ param _ value value to be set * @ param _ definition type of the key - value pair * @ throws EFapsException if < code > _ key < / code > or < code > _ value < / code > is * < code > null < / code > */ public void set ( final String _key , final String _value , final UserAttributesDefinition _definition ) throws EFapsException { } }
if ( _key == null || _value == null ) { throw new EFapsException ( this . getClass ( ) , "set" , _key , _value , _definition ) ; } else { final UserAttribute userattribute = this . attributes . get ( _key ) ; if ( userattribute == null ) { this . attributes . put ( _key , new UserAttribute ( _definition . name , _value . trim ( ) , true ) ) ; } else if ( ! userattribute . getValue ( ) . equals ( _value . trim ( ) ) ) { userattribute . setUpdate ( true ) ; userattribute . setValue ( _value . trim ( ) ) ; } }
public class CustomizedTableHeader { /** * Add the column and the custom component at the given index * @ param index The index */ private void addColumn ( int index ) { } }
TableColumnModel columnModel = getColumnModel ( ) ; TableColumn column = columnModel . getColumn ( index ) ; while ( tableColumns . size ( ) - 1 < index ) { tableColumns . add ( null ) ; } tableColumns . set ( index , column ) ; column . addPropertyChangeListener ( widthListener ) ; JComponent component = componentFactory . apply ( index ) ; while ( customComponents . size ( ) - 1 < index ) { customComponents . add ( null ) ; } customComponents . set ( index , component ) ; add ( component ) ;
public class PrefixFilterAdapter { /** * { @ inheritDoc } */ @ Override public Filter adapt ( FilterAdapterContext context , PrefixFilter filter ) throws IOException { } }
ByteString . Output output = ByteString . newOutput ( filter . getPrefix ( ) . length * 2 ) ; ReaderExpressionHelper . writeQuotedRegularExpression ( output , filter . getPrefix ( ) ) ; // Unquoted all bytes : output . write ( ReaderExpressionHelper . ALL_QUALIFIERS_BYTES ) ; return FILTERS . key ( ) . regex ( output . toByteString ( ) ) ;
public class ExtendedSwidProcessor { /** * Defines product release date ( tag : release _ date ) . * @ param releaseDate * product release date * @ return a reference to this object . */ public ExtendedSwidProcessor setReleaseDate ( final Date releaseDate ) { } }
swidTag . setReleaseDate ( new DateTime ( JAXBUtils . convertDateToXMLGregorianCalendar ( releaseDate ) , idGenerator . nextId ( ) ) ) ; return this ;
public class ShanksAgentBayesianReasoningCapability { /** * Add soft - evidence to the Bayesian network to reason with it . * @ param agent * @ param nodeName * @ param softEvidence * @ throws ShanksException */ public static void addSoftEvidence ( BayesianReasonerShanksAgent agent , String nodeName , HashMap < String , Double > softEvidence ) throws ShanksException { } }
ShanksAgentBayesianReasoningCapability . addSoftEvidence ( agent . getBayesianNetwork ( ) , nodeName , softEvidence ) ;
public class JdbcTemplateTool { /** * return the singleton proxy */ private JdbcTemplateProxy getProxy ( ) { } }
if ( _proxy == null ) { _proxy = new JdbcTemplateProxy ( ) ; _proxy . setJdbcTemplate ( jdbcTemplate ) ; } return _proxy ;
public class WicketSettings { /** * Should Croquet minify CSS and JavaScript resources ? Defaults to follow dev vs deploy . * @ return true if resources should be minified */ public Boolean getMinifyResources ( ) { } }
if ( getDevelopment ( ) ) { return minifyResources != null ? minifyResources : false ; } else { return minifyResources != null ? minifyResources : true ; }
public class YearWeek { /** * Returns a copy of this year - week with the specified number of weeks added . * This instance is immutable and unaffected by this method call . * @ param weeksToAdd the weeks to add , may be negative * @ return the year - week with the weeks added , not null */ public YearWeek plusWeeks ( long weeksToAdd ) { } }
if ( weeksToAdd == 0 ) { return this ; } LocalDate mondayOfWeek = atDay ( DayOfWeek . MONDAY ) . plusWeeks ( weeksToAdd ) ; return YearWeek . from ( mondayOfWeek ) ;
public class FavoritesEditController { /** * Un - favorite a favorite node ( portlet or collection ) identified by node ID . Routed by the * action = delete parameter . If no favorites remain after un - favoriting , switches portlet mode to * VIEW . * < p > Sets render parameters : successMessageCode : message code of success message if applicable * errorMessageCode : message code of error message if applicable nameOfFavoriteActedUpon : * user - facing name of favorite acted upon . action : will be set to " list " to facilitate not * repeatedly attempting delete . * < p > Exactly one of [ successMessageCode | errorMessageCode ] render parameters will be set . * nameOfFavoriteActedUpon and action will always be set . * @ param nodeId identifier of target node * @ param response ActionResponse onto which render parameters will , mode may , be set */ @ ActionMapping ( params = { } }
"action=delete" } ) public void unFavoriteNode ( @ RequestParam ( "nodeId" ) String nodeId , ActionResponse response ) { try { // ferret out the layout manager HttpServletRequest servletRequest = this . portalRequestUtils . getCurrentPortalRequest ( ) ; IUserInstance userInstance = this . userInstanceManager . getUserInstance ( servletRequest ) ; IUserPreferencesManager preferencesManager = userInstance . getPreferencesManager ( ) ; IUserLayoutManager layoutManager = preferencesManager . getUserLayoutManager ( ) ; IUserLayoutNodeDescription nodeDescription = layoutManager . getNode ( nodeId ) ; String userFacingNodeName = nodeDescription . getName ( ) ; response . setRenderParameter ( "nameOfFavoriteActedUpon" , userFacingNodeName ) ; if ( nodeDescription . isDeleteAllowed ( ) ) { boolean nodeSuccessfullyDeleted = layoutManager . deleteNode ( nodeId ) ; if ( nodeSuccessfullyDeleted ) { layoutManager . saveUserLayout ( ) ; response . setRenderParameter ( "successMessageCode" , "favorites.unfavorite.success.parameterized" ) ; IUserLayout updatedLayout = layoutManager . getUserLayout ( ) ; // if removed last favorite , return to VIEW mode if ( ! favoritesUtils . hasAnyFavorites ( updatedLayout ) ) { response . setPortletMode ( PortletMode . VIEW ) ; } logger . debug ( "Successfully unfavorited [{}]" , nodeDescription ) ; } else { logger . error ( "Failed to delete node [{}] on unfavorite request, but this should have succeeded?" , nodeDescription ) ; response . setRenderParameter ( "errorMessageCode" , "favorites.unfavorite.fail.parameterized" ) ; } } else { logger . warn ( "Attempt to unfavorite [{}] failed because user lacks permission to delete that layout node." , nodeDescription ) ; response . setRenderParameter ( "errorMessageCode" , "favorites.unfavorite.fail.lack.permission.parameterized" ) ; } } catch ( Exception e ) { // TODO : this log message is kind of useless without the username to put the node in // context logger . error ( "Something went wrong unfavoriting nodeId [{}]." , nodeId ) ; // may have failed to load node description , so fall back on describing by id final String fallbackUserFacingNodeName = "node with id " + nodeId ; response . setRenderParameter ( "errorMessageCode" , "favorites.unfavorite.fail.parameterized" ) ; response . setRenderParameter ( "nameOfFavoriteActedUpon" , fallbackUserFacingNodeName ) ; } response . setRenderParameter ( "action" , "list" ) ;
public class ObjectDigestUtil { /** * MD5编码 * @ param origin * 原始字符串 * @ return 经过MD5加密之后的结果 */ public static String MD5Encode ( String origin ) { } }
String resultString = null ; try { resultString = origin ; MessageDigest md = MessageDigest . getInstance ( "MD5" ) ; md . update ( resultString . getBytes ( "UTF-8" ) ) ; resultString = byteArrayToHexString ( md . digest ( ) ) ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; } return resultString ;
public class ConvolveImageNoBorderSparse { /** * Convolves a 1D kernels around the specified pixel in the horizontal and vertical direction . * @ param horizontal Horizontal convolution kernel . Not modified . * @ param vertical Vertical convolution kernel . Not modified . * @ param input Image that is being convolved . Not modified . * @ param c _ x Pixel the convolution is centered around . x - coordinate . * @ param c _ y Pixel the convolution is centered around . y - coordinate . * @ param storage Must be as long as the kernel ' s width . * @ return The pixel ' s value after the convolution */ public static float convolve ( Kernel1D_F32 horizontal , Kernel1D_F32 vertical , GrayF32 input , int c_x , int c_y , float storage [ ] ) { } }
return ConvolveImageStandardSparse . convolve ( horizontal , vertical , input , c_x , c_y , storage ) ;
public class ManagedClustersInner { /** * Gets upgrade profile for a managed cluster . * Gets the details of the upgrade profile for a managed cluster with a specified resource group and name . * @ param resourceGroupName The name of the resource group . * @ param resourceName The name of the managed cluster resource . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the ManagedClusterUpgradeProfileInner object */ public Observable < ManagedClusterUpgradeProfileInner > getUpgradeProfileAsync ( String resourceGroupName , String resourceName ) { } }
return getUpgradeProfileWithServiceResponseAsync ( resourceGroupName , resourceName ) . map ( new Func1 < ServiceResponse < ManagedClusterUpgradeProfileInner > , ManagedClusterUpgradeProfileInner > ( ) { @ Override public ManagedClusterUpgradeProfileInner call ( ServiceResponse < ManagedClusterUpgradeProfileInner > response ) { return response . body ( ) ; } } ) ;
public class ResultHierarchy { /** * Informs all registered { @ link ResultListener } that a new result has been * removed . * @ param child result that has been removed * @ param parent Parent result that has been removed */ private void fireResultRemoved ( Result child , Result parent ) { } }
if ( LOG . isDebugging ( ) ) { LOG . debug ( "Result removed: " + child + " <- " + parent ) ; } for ( int i = listenerList . size ( ) ; -- i >= 0 ; ) { listenerList . get ( i ) . resultRemoved ( child , parent ) ; }
public class InfiniteRecursiveLoop { /** * Signal an infinite loop if either : we see a call to the same method with * the same parameters , or we see a call to the same ( dynamically dispatched * method ) , and there has been no transfer of control . */ @ Override public void sawOpcode ( int seen ) { } }
if ( seenReturn && seenTransferOfControl && seenStateChange ) { return ; } if ( DEBUG ) { System . out . println ( stack ) ; System . out . println ( getPC ( ) + " : " + Const . getOpcodeName ( seen ) ) ; } if ( ( seen == Const . INVOKEVIRTUAL || seen == Const . INVOKEINTERFACE ) && "add" . equals ( getNameConstantOperand ( ) ) && "(Ljava/lang/Object;)Z" . equals ( getSigConstantOperand ( ) ) && stack . getStackDepth ( ) >= 2 ) { OpcodeStack . Item it0 = stack . getStackItem ( 0 ) ; int r0 = it0 . getRegisterNumber ( ) ; OpcodeStack . Item it1 = stack . getStackItem ( 1 ) ; int r1 = it1 . getRegisterNumber ( ) ; if ( r0 == r1 && r0 > 0 ) { bugReporter . reportBug ( new BugInstance ( this , "IL_CONTAINER_ADDED_TO_ITSELF" , NORMAL_PRIORITY ) . addClassAndMethod ( this ) . addSourceLine ( this ) ) ; } } if ( ( seen == Const . INVOKEVIRTUAL || seen == Const . INVOKESPECIAL || seen == Const . INVOKEINTERFACE || seen == Const . INVOKESTATIC ) && getNameConstantOperand ( ) . equals ( getMethodName ( ) ) && getSigConstantOperand ( ) . equals ( getMethodSig ( ) ) && ( seen == Const . INVOKESTATIC ) == getMethod ( ) . isStatic ( ) && ( seen == Const . INVOKESPECIAL ) == ( getMethod ( ) . isPrivate ( ) && ! getMethod ( ) . isStatic ( ) || Const . CONSTRUCTOR_NAME . equals ( getMethodName ( ) ) ) ) { Type arguments [ ] = getMethod ( ) . getArgumentTypes ( ) ; // stack . getStackDepth ( ) > = parameters int parameters = arguments . length ; if ( ! getMethod ( ) . isStatic ( ) ) { parameters ++ ; } XMethod xMethod = XFactory . createReferencedXMethod ( this ) ; if ( DEBUG ) { System . out . println ( "IL: Checking..." ) ; System . out . println ( xMethod ) ; System . out . println ( "vs. " + getClassName ( ) + "." + getMethodName ( ) + " : " + getMethodSig ( ) ) ; } if ( xMethod . getClassName ( ) . replace ( '.' , '/' ) . equals ( getClassName ( ) ) || seen == Const . INVOKEINTERFACE ) { // Invocation of same method // Now need to see if parameters are the same int firstParameter = 0 ; if ( Const . CONSTRUCTOR_NAME . equals ( getMethodName ( ) ) ) { firstParameter = 1 ; } // match1 should be true if it is any call to the exact same // method // and no state has been change . // if match1 is true , the method may not always perform // a recursive infinite loop , but this particular method call is // an infinite // recursive loop boolean match1 = ! seenStateChange ; for ( int i = firstParameter ; match1 && i < parameters ; i ++ ) { OpcodeStack . Item it = stack . getStackItem ( parameters - 1 - i ) ; if ( ! it . isInitialParameter ( ) || it . getRegisterNumber ( ) != i ) { match1 = false ; } } boolean sameMethod = seen == Const . INVOKESTATIC || Const . CONSTRUCTOR_NAME . equals ( getNameConstantOperand ( ) ) ; if ( ! sameMethod ) { // Have to check if first parmeter is the same // know there must be a this argument if ( DEBUG ) { System . out . println ( "Stack is " + stack ) ; } OpcodeStack . Item p = stack . getStackItem ( parameters - 1 ) ; if ( DEBUG ) { System . out . println ( "parameters = " + parameters + ", Item is " + p ) ; } String sig = p . getSignature ( ) ; sameMethod = p . isInitialParameter ( ) && p . getRegisterNumber ( ) == 0 && sig . equals ( "L" + getClassName ( ) + ";" ) ; } // match2 and match3 are two different ways of seeing if the // call site // postdominates the method entry . // technically , we use ( ! seenTransferOfControl | | ! seenReturn & & // largestBranchTarget < getPC ( ) ) // as a check that the call site postdominates the method entry . // If those are true , // and sameMethod is true , we have a guaranteed IL . boolean match2 = sameMethod && ! seenTransferOfControl ; boolean match3 = sameMethod && ! seenReturn && largestBranchTarget < getPC ( ) ; if ( match1 || match2 || match3 ) { if ( DEBUG ) { System . out . println ( "IL: " + sameMethod + " " + match1 + " " + match2 + " " + match3 ) ; } // int priority = HIGH _ PRIORITY ; // if ( ! match1 & & ! match2 & & seenThrow ) // priority = NORMAL _ PRIORITY ; // if ( seen = = Const . INVOKEINTERFACE ) // priority = NORMAL _ PRIORITY ; bugReporter . reportBug ( new BugInstance ( this , "IL_INFINITE_RECURSIVE_LOOP" , HIGH_PRIORITY ) . addClassAndMethod ( this ) . addSourceLine ( this ) ) ; } } } switch ( seen ) { case Const . ARETURN : case Const . IRETURN : case Const . LRETURN : case Const . RETURN : case Const . DRETURN : case Const . FRETURN : seenReturn = true ; seenTransferOfControl = true ; break ; case Const . ATHROW : // seenThrow = true ; seenTransferOfControl = true ; break ; case Const . PUTSTATIC : case Const . PUTFIELD : case Const . IASTORE : case Const . AASTORE : case Const . DASTORE : case Const . FASTORE : case Const . LASTORE : case Const . SASTORE : case Const . CASTORE : case Const . BASTORE : seenStateChange = true ; break ; case Const . INVOKEVIRTUAL : case Const . INVOKESPECIAL : case Const . INVOKEINTERFACE : case Const . INVOKESTATIC : if ( "print" . equals ( getNameConstantOperand ( ) ) || "println" . equals ( getNameConstantOperand ( ) ) || "log" . equals ( getNameConstantOperand ( ) ) || "toString" . equals ( getNameConstantOperand ( ) ) ) { break ; } seenStateChange = true ; break ; default : break ; }
public class Tuple9 { /** * Limit this tuple to degree 9. */ public final Tuple9 < T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 > limit9 ( ) { } }
return this ;
public class BarChartItem { /** * * * * * * Initialization * * * * * */ private void initGraphics ( ) { } }
if ( Double . compare ( getPrefWidth ( ) , 0.0 ) <= 0 || Double . compare ( getPrefHeight ( ) , 0.0 ) <= 0 || Double . compare ( getWidth ( ) , 0.0 ) <= 0 || Double . compare ( getHeight ( ) , 0.0 ) <= 0 ) { if ( getPrefWidth ( ) > 0 && getPrefHeight ( ) > 0 ) { setPrefSize ( getPrefWidth ( ) , getPrefHeight ( ) ) ; } else { setPrefSize ( PREFERRED_WIDTH , PREFERRED_HEIGHT ) ; } } nameText = new Text ( getName ( ) ) ; nameText . setTextOrigin ( VPos . TOP ) ; valueText = new Text ( String . format ( locale , formatString , getValue ( ) ) ) ; valueText . setTextOrigin ( VPos . TOP ) ; barBackground = new Rectangle ( ) ; bar = new Rectangle ( ) ; pane = new Pane ( nameText , valueText , barBackground , bar ) ; pane . setBackground ( new Background ( new BackgroundFill ( Color . TRANSPARENT , CornerRadii . EMPTY , Insets . EMPTY ) ) ) ; getChildren ( ) . setAll ( pane ) ;
public class CmsQuickLaunchEditor { /** * Initializes the app icon items . < p > */ protected void resetAppIcons ( ) { } }
CmsObject cms = A_CmsUI . getCmsObject ( ) ; Locale locale = UI . getCurrent ( ) . getLocale ( ) ; m_standardApps . removeAllComponents ( ) ; m_userApps . removeAllComponents ( ) ; m_availableApps . removeAllComponents ( ) ; Collection < I_CmsWorkplaceAppConfiguration > allApps = OpenCms . getWorkplaceAppManager ( ) . getWorkplaceApps ( ) ; Collection < I_CmsWorkplaceAppConfiguration > standardApps = OpenCms . getWorkplaceAppManager ( ) . getDefaultQuickLaunchConfigurations ( ) ; Collection < I_CmsWorkplaceAppConfiguration > userApps = OpenCms . getWorkplaceAppManager ( ) . getUserQuickLauchConfigurations ( cms ) ; for ( I_CmsWorkplaceAppConfiguration config : standardApps ) { CmsAppVisibilityStatus visibility = config . getVisibility ( cms ) ; if ( visibility . isVisible ( ) ) { Button button = CmsDefaultAppButtonProvider . createAppIconButton ( config , locale ) ; m_standardApps . addComponent ( button ) ; } } for ( I_CmsWorkplaceAppConfiguration config : userApps ) { CmsAppVisibilityStatus visibility = config . getVisibility ( cms ) ; if ( visibility . isVisible ( ) && visibility . isActive ( ) ) { Button button = CmsDefaultAppButtonProvider . createAppIconButton ( config , locale ) ; // button . setWidth ( " 166px " ) ; DragSourceExtension < Button > extButton = new DragSourceExtension < > ( button ) ; button . setData ( config . getId ( ) ) ; extButton . setDataTransferText ( config . getId ( ) ) ; m_userApps . addComponent ( button ) ; } } for ( I_CmsWorkplaceAppConfiguration config : allApps ) { CmsAppVisibilityStatus visibility = config . getVisibility ( cms ) ; if ( ! standardApps . contains ( config ) && ! userApps . contains ( config ) && visibility . isVisible ( ) && visibility . isActive ( ) ) { Button button = CmsDefaultAppButtonProvider . createAppIconButton ( config , locale ) ; // button . setWidth ( " 166px " ) ; DragSourceExtension < Button > extButton = new DragSourceExtension < > ( button ) ; button . setData ( config . getId ( ) ) ; extButton . setDataTransferText ( config . getId ( ) ) ; m_availableApps . addComponent ( button ) ; } }
public class FileSystem { /** * The IDs of the elastic network interface from which a specific file system is accessible . The elastic network * interface is automatically created in the same VPC that the Amazon FSx file system was created in . For more * information , see < a href = " https : / / docs . aws . amazon . com / AWSEC2 / latest / UserGuide / using - eni . html " > Elastic Network * Interfaces < / a > in the < i > Amazon EC2 User Guide . < / i > * For an Amazon FSx for Windows File Server file system , you can have one network interface Id . For an Amazon FSx * for Lustre file system , you can have more than one . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setNetworkInterfaceIds ( java . util . Collection ) } or { @ link # withNetworkInterfaceIds ( java . util . Collection ) } * if you want to override the existing values . * @ param networkInterfaceIds * The IDs of the elastic network interface from which a specific file system is accessible . The elastic * network interface is automatically created in the same VPC that the Amazon FSx file system was created in . * For more information , see < a * href = " https : / / docs . aws . amazon . com / AWSEC2 / latest / UserGuide / using - eni . html " > Elastic Network Interfaces < / a > * in the < i > Amazon EC2 User Guide . < / i > < / p > * For an Amazon FSx for Windows File Server file system , you can have one network interface Id . For an * Amazon FSx for Lustre file system , you can have more than one . * @ return Returns a reference to this object so that method calls can be chained together . */ public FileSystem withNetworkInterfaceIds ( String ... networkInterfaceIds ) { } }
if ( this . networkInterfaceIds == null ) { setNetworkInterfaceIds ( new java . util . ArrayList < String > ( networkInterfaceIds . length ) ) ; } for ( String ele : networkInterfaceIds ) { this . networkInterfaceIds . add ( ele ) ; } return this ;
public class HBaseWriter { /** * ( non - Javadoc ) * @ see * com . impetus . client . hbase . Writer # writeColumns ( org . apache . hadoop . hbase . * client . HTable , java . lang . String , java . lang . Object , java . util . Set , * java . lang . Object ) */ @ Override public void writeColumns ( HTableInterface htable , String columnFamily , Object rowKey , Map < String , Attribute > columns , Map < String , Object > values , Object columnFamilyObj ) throws IOException { } }
Put p = preparePut ( columnFamily , rowKey , columns , values ) ; htable . put ( p ) ;
public class SQLExpressions { /** * REGR _ INTERCEPT returns the y - intercept of the regression line . * @ param arg1 first arg * @ param arg2 second arg * @ return regr _ intercept ( arg1 , arg2) */ public static WindowOver < Double > regrIntercept ( Expression < ? extends Number > arg1 , Expression < ? extends Number > arg2 ) { } }
return new WindowOver < Double > ( Double . class , SQLOps . REGR_INTERCEPT , arg1 , arg2 ) ;
public class AuthorizedList { /** * Adds a compartment that the user should be allowed to access * @ param theCompartments The compartment names , e . g . " Patient / 123 " ( in this example the user would be allowed to access Patient / 123 as well as Observations where Observation . subject = " Patient / 123 " m , etc . * @ return Returns < code > this < / code > for easy method chaining */ public AuthorizedList addCompartments ( String ... theCompartments ) { } }
Validate . notNull ( theCompartments , "theCompartments must not be null" ) ; for ( String next : theCompartments ) { addCompartment ( next ) ; } return this ;
public class PyGenerator { /** * Generate a Python docstring with the given comment . * @ param comment the comment . * @ param it the receiver of the docstring . * @ return { @ code true } if the docstring is added , { @ code false } otherwise . */ protected static boolean generateDocString ( String comment , PyAppendable it ) { } }
final String cmt = comment == null ? null : comment . trim ( ) ; if ( ! Strings . isEmpty ( cmt ) ) { assert cmt != null ; it . append ( "\"\"\"" ) . increaseIndentation ( ) ; // $ NON - NLS - 1 $ for ( final String line : cmt . split ( "[\n\r\f]+" ) ) { // $ NON - NLS - 1 $ it . newLine ( ) . append ( line ) ; } it . decreaseIndentation ( ) . newLine ( ) ; it . append ( "\"\"\"" ) . newLine ( ) ; // $ NON - NLS - 1 $ return true ; } return false ;
public class CommerceNotificationQueueEntryPersistenceImpl { /** * Returns the commerce notification queue entry with the primary key or returns < code > null < / code > if it could not be found . * @ param primaryKey the primary key of the commerce notification queue entry * @ return the commerce notification queue entry , or < code > null < / code > if a commerce notification queue entry with the primary key could not be found */ @ Override public CommerceNotificationQueueEntry fetchByPrimaryKey ( Serializable primaryKey ) { } }
Serializable serializable = entityCache . getResult ( CommerceNotificationQueueEntryModelImpl . ENTITY_CACHE_ENABLED , CommerceNotificationQueueEntryImpl . class , primaryKey ) ; if ( serializable == nullModel ) { return null ; } CommerceNotificationQueueEntry commerceNotificationQueueEntry = ( CommerceNotificationQueueEntry ) serializable ; if ( commerceNotificationQueueEntry == null ) { Session session = null ; try { session = openSession ( ) ; commerceNotificationQueueEntry = ( CommerceNotificationQueueEntry ) session . get ( CommerceNotificationQueueEntryImpl . class , primaryKey ) ; if ( commerceNotificationQueueEntry != null ) { cacheResult ( commerceNotificationQueueEntry ) ; } else { entityCache . putResult ( CommerceNotificationQueueEntryModelImpl . ENTITY_CACHE_ENABLED , CommerceNotificationQueueEntryImpl . class , primaryKey , nullModel ) ; } } catch ( Exception e ) { entityCache . removeResult ( CommerceNotificationQueueEntryModelImpl . ENTITY_CACHE_ENABLED , CommerceNotificationQueueEntryImpl . class , primaryKey ) ; throw processException ( e ) ; } finally { closeSession ( session ) ; } } return commerceNotificationQueueEntry ;
public class Input { /** * Reads a char array in bulk . This may be more efficient than reading them individually . */ public char [ ] readChars ( int length ) throws KryoException { } }
char [ ] array = new char [ length ] ; if ( optional ( length << 1 ) == length << 1 ) { byte [ ] buffer = this . buffer ; int p = this . position ; for ( int i = 0 ; i < length ; i ++ , p += 2 ) array [ i ] = ( char ) ( ( buffer [ p ] & 0xFF ) | ( ( buffer [ p + 1 ] & 0xFF ) ) << 8 ) ; position = p ; } else { for ( int i = 0 ; i < length ; i ++ ) array [ i ] = readChar ( ) ; } return array ;
public class CreateVersionMethod { /** * < pre > * Create version request . * < / pre > * < code > . google . appengine . v1 . CreateVersionRequest request = 1 ; < / code > */ public com . google . appengine . v1 . CreateVersionRequest getRequest ( ) { } }
return request_ == null ? com . google . appengine . v1 . CreateVersionRequest . getDefaultInstance ( ) : request_ ;
public class ScheduledPipelineLoader { /** * TODO : Do we need to do this differently than PipelineService # fullPipeline ? */ public Pipeline pipelineWithPasswordAwareBuildCauseByBuildId ( final long buildId ) { } }
Pipeline pipeline = pipelineDao . pipelineWithMaterialsAndModsByBuildId ( buildId ) ; MaterialRevisions scheduledRevs = pipeline . getBuildCause ( ) . getMaterialRevisions ( ) ; MaterialConfigs knownMaterials = knownMaterials ( pipeline , scheduledRevs ) ; for ( MaterialRevision materialRevision : scheduledRevs ) { MaterialConfig materialConfig = materialFrom ( knownMaterials , materialRevision ) ; Material usedMaterial = materialRevision . getMaterial ( ) ; if ( materialConfig == null ) { final JobInstance jobInstance = jobInstanceService . buildByIdWithTransitions ( buildId ) ; scheduleService . failJob ( jobInstance ) ; final String message = "Cannot load job '" + jobInstance . buildLocator ( ) + "' because material " + usedMaterial . config ( ) + " was not found in config." ; final String description = "Job for pipeline '" + jobInstance . buildLocator ( ) + "' has been failed as one or more material configurations were either changed or removed." ; transactionSynchronizationManager . registerSynchronization ( new TransactionSynchronizationAdapter ( ) { @ Override public void afterCommit ( ) { final ServerHealthState error = ServerHealthState . error ( message , description , HealthStateType . general ( HealthStateScope . forJob ( jobInstance . getPipelineName ( ) , jobInstance . getStageName ( ) , jobInstance . getName ( ) ) ) ) ; error . setTimeout ( Timeout . FIVE_MINUTES ) ; serverHealthService . update ( error ) ; appendToConsoleLog ( jobInstance , message ) ; appendToConsoleLog ( jobInstance , description ) ; } } ) ; throw new StaleMaterialsOnBuildCause ( message ) ; } usedMaterial . updateFromConfig ( materialConfig ) ; } return pipeline ;
public class Signature { /** * Initializes this object for verification , using the public key from * the given certificate . * < p > If the certificate is of type X . 509 and has a < i > key usage < / i > * extension field marked as critical , and the value of the < i > key usage < / i > * extension field implies that the public key in * the certificate and its corresponding private key are not * supposed to be used for digital signatures , an * { @ code InvalidKeyException } is thrown . * @ param certificate the certificate of the identity whose signature is * going to be verified . * @ exception InvalidKeyException if the public key in the certificate * is not encoded properly or does not include required parameter * information or cannot be used for digital signature purposes . * @ since 1.3 */ public final void initVerify ( Certificate certificate ) throws InvalidKeyException { } }
// If the certificate is of type X509Certificate , // we should check whether it has a Key Usage // extension marked as critical . if ( certificate instanceof java . security . cert . X509Certificate ) { // Check whether the cert has a key usage extension // marked as a critical extension . // The OID for KeyUsage extension is 2.5.29.15. X509Certificate cert = ( X509Certificate ) certificate ; Set < String > critSet = cert . getCriticalExtensionOIDs ( ) ; if ( critSet != null && ! critSet . isEmpty ( ) && critSet . contains ( "2.5.29.15" ) ) { boolean [ ] keyUsageInfo = cert . getKeyUsage ( ) ; // keyUsageInfo [ 0 ] is for digitalSignature . if ( ( keyUsageInfo != null ) && ( keyUsageInfo [ 0 ] == false ) ) throw new InvalidKeyException ( "Wrong key usage" ) ; } } PublicKey publicKey = certificate . getPublicKey ( ) ; engineInitVerify ( publicKey ) ; state = VERIFY ; // BEGIN Android - removed : this debugging mechanism is not supported in Android . /* if ( ! skipDebug & & pdebug ! = null ) { pdebug . println ( " Signature . " + algorithm + " verification algorithm from : " + this . provider . getName ( ) ) ; */ // END Android - removed : this debugging mechanism is not supported in Android .
public class Assert { /** * Asserts that a cookies with the provided name has a value matching the * expected pattern . This information will be logged and recorded , with a * screenshot for traceability and added debugging support . * @ param cookieName the name of the cookie * @ param expectedCookiePattern the expected value of the cookie */ @ Override public void cookieMatches ( String cookieName , String expectedCookiePattern ) { } }
String cookie = checkCookieMatches ( cookieName , expectedCookiePattern , 0 , 0 ) ; assertTrue ( "Cookie Value Mismatch: cookie value of '" + cookie + DOES_NOT_MATCH_PATTERN + expectedCookiePattern + "'" , cookie . matches ( expectedCookiePattern ) ) ;
public class FileGetFromComputeNodeOptions { /** * Set a timestamp indicating the last modified time of the resource known to the client . The operation will be performed only if the resource on the service has not been modified since the specified time . * @ param ifUnmodifiedSince the ifUnmodifiedSince value to set * @ return the FileGetFromComputeNodeOptions object itself . */ public FileGetFromComputeNodeOptions withIfUnmodifiedSince ( DateTime ifUnmodifiedSince ) { } }
if ( ifUnmodifiedSince == null ) { this . ifUnmodifiedSince = null ; } else { this . ifUnmodifiedSince = new DateTimeRfc1123 ( ifUnmodifiedSince ) ; } return this ;
public class CurrentMetricResultMarshaller { /** * Marshall the given parameter object . */ public void marshall ( CurrentMetricResult currentMetricResult , ProtocolMarshaller protocolMarshaller ) { } }
if ( currentMetricResult == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( currentMetricResult . getDimensions ( ) , DIMENSIONS_BINDING ) ; protocolMarshaller . marshall ( currentMetricResult . getCollections ( ) , COLLECTIONS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class Formatter { /** * 将String转换成Integer * @ param string 需要转换的字符串 * @ return 转换结果 , 如果数值非法 , 则返回 - 1 */ public static int stringToInteger ( String string ) { } }
string = string . trim ( ) ; if ( Checker . isNumber ( string ) ) { return Integer . parseInt ( string ) ; } return - 1 ;
public class Document { /** * Create a valid , empty shell of a document , suitable for adding more elements to . * @ param baseUri baseUri of document * @ return document with html , head , and body elements . */ public static Document createShell ( String baseUri ) { } }
Validate . notNull ( baseUri ) ; Document doc = new Document ( baseUri ) ; doc . parser = doc . parser ( ) ; Element html = doc . appendElement ( "html" ) ; html . appendElement ( "head" ) ; html . appendElement ( "body" ) ; return doc ;
public class DataFrameJoiner { /** * Joins to the given tables assuming that they have a column of the name we ' re joining on * @ param allowDuplicateColumnNames if { @ code false } the join will fail if any columns other than the join column have the same name * if { @ code true } the join will succeed and duplicate columns are renamed * @ param tables The tables to join with * @ return The resulting table */ public Table rightOuter ( boolean allowDuplicateColumnNames , Table ... tables ) { } }
Table joined = table ; for ( Table table2 : tables ) { joined = rightOuter ( table2 , allowDuplicateColumnNames , columnNames ) ; } return joined ;
public class CmsStringUtil { /** * Returns the java String literal for the given String . < p > * This is the form of the String that had to be written into source code * using the unicode escape sequence for special characters . < p > * Example : " & Auml " would be transformed to " \ \ u00C4 " . < p > * @ param s a string that may contain non - ascii characters * @ return the java unicode escaped string Literal of the given input string */ public static String toUnicodeLiteral ( String s ) { } }
StringBuffer result = new StringBuffer ( ) ; char [ ] carr = s . toCharArray ( ) ; String unicode ; for ( int i = 0 ; i < carr . length ; i ++ ) { result . append ( "\\u" ) ; // append leading zeros unicode = Integer . toHexString ( carr [ i ] ) . toUpperCase ( ) ; for ( int j = 4 - unicode . length ( ) ; j > 0 ; j -- ) { result . append ( "0" ) ; } result . append ( unicode ) ; } return result . toString ( ) ;
public class DeciderService { /** * Populates the workflow input data and the tasks input / output data if stored in external payload storage . * This method creates a deep copy of the workflow instance where the payloads will be stored after downloading from external payload storage . * @ param workflow the workflow for which the data needs to be populated * @ return a copy of the workflow with the payload data populated */ @ VisibleForTesting Workflow populateWorkflowAndTaskData ( Workflow workflow ) { } }
Workflow workflowInstance = workflow . copy ( ) ; if ( StringUtils . isNotBlank ( workflow . getExternalInputPayloadStoragePath ( ) ) ) { // download the workflow input from external storage here and plug it into the workflow Map < String , Object > workflowInputParams = externalPayloadStorageUtils . downloadPayload ( workflow . getExternalInputPayloadStoragePath ( ) ) ; Monitors . recordExternalPayloadStorageUsage ( workflow . getWorkflowName ( ) , ExternalPayloadStorage . Operation . READ . toString ( ) , ExternalPayloadStorage . PayloadType . WORKFLOW_INPUT . toString ( ) ) ; workflowInstance . setInput ( workflowInputParams ) ; workflowInstance . setExternalInputPayloadStoragePath ( null ) ; } workflowInstance . getTasks ( ) . stream ( ) . filter ( task -> StringUtils . isNotBlank ( task . getExternalInputPayloadStoragePath ( ) ) || StringUtils . isNotBlank ( task . getExternalOutputPayloadStoragePath ( ) ) ) . forEach ( task -> { if ( StringUtils . isNotBlank ( task . getExternalOutputPayloadStoragePath ( ) ) ) { task . setOutputData ( externalPayloadStorageUtils . downloadPayload ( task . getExternalOutputPayloadStoragePath ( ) ) ) ; Monitors . recordExternalPayloadStorageUsage ( task . getTaskDefName ( ) , ExternalPayloadStorage . Operation . READ . toString ( ) , ExternalPayloadStorage . PayloadType . TASK_OUTPUT . toString ( ) ) ; task . setExternalOutputPayloadStoragePath ( null ) ; } if ( StringUtils . isNotBlank ( task . getExternalInputPayloadStoragePath ( ) ) ) { task . setInputData ( externalPayloadStorageUtils . downloadPayload ( task . getExternalInputPayloadStoragePath ( ) ) ) ; Monitors . recordExternalPayloadStorageUsage ( task . getTaskDefName ( ) , ExternalPayloadStorage . Operation . READ . toString ( ) , ExternalPayloadStorage . PayloadType . TASK_INPUT . toString ( ) ) ; task . setExternalInputPayloadStoragePath ( null ) ; } } ) ; return workflowInstance ;
public class HintRule { /** * Adds a given product to the list of evidence to remove when matched . * @ param source the source of the evidence * @ param name the name of the evidence * @ param value the value of the evidence * @ param regex whether value is a regex * @ param confidence the confidence of the evidence */ public void addRemoveProduct ( String source , String name , String value , boolean regex , Confidence confidence ) { } }
removeProduct . add ( new EvidenceMatcher ( source , name , value , regex , confidence ) ) ;
public class MMCRGImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public void eUnset ( int featureID ) { } }
switch ( featureID ) { case AfplibPackage . MMCRG__KEY : setKey ( KEY_EDEFAULT ) ; return ; case AfplibPackage . MMCRG__VALUE : setValue ( VALUE_EDEFAULT ) ; return ; } super . eUnset ( featureID ) ;
public class DistortSupport { /** * Creates a { @ link boofcv . alg . distort . PixelTransformAffine _ F32 } from the dst image into the src image . * @ param x0 Center of rotation in input image coordinates . * @ param y0 Center of rotation in input image coordinates . * @ param x1 Center of rotation in output image coordinates . * @ param y1 Center of rotation in output image coordinates . * @ param angle Angle of rotation . */ public static PixelTransformAffine_F32 transformRotate ( float x0 , float y0 , float x1 , float y1 , float angle ) { } }
// make the coordinate system ' s origin the image center Se2_F32 imageToCenter = new Se2_F32 ( - x0 , - y0 , 0 ) ; Se2_F32 rotate = new Se2_F32 ( 0 , 0 , angle ) ; Se2_F32 centerToImage = new Se2_F32 ( x1 , y1 , 0 ) ; InvertibleTransformSequence sequence = new InvertibleTransformSequence ( ) ; sequence . addTransform ( true , imageToCenter ) ; sequence . addTransform ( true , rotate ) ; sequence . addTransform ( true , centerToImage ) ; Se2_F32 total = new Se2_F32 ( ) ; sequence . computeTransform ( total ) ; Se2_F32 inv = total . invert ( null ) ; Affine2D_F32 affine = ConvertTransform_F32 . convert ( inv , ( Affine2D_F32 ) null ) ; PixelTransformAffine_F32 distort = new PixelTransformAffine_F32 ( ) ; distort . set ( affine ) ; return distort ;
public class AccessibilityNodeInfoUtils { /** * Recycles the given nodes . * @ param nodes The nodes to recycle . */ public static void recycleNodes ( Collection < AccessibilityNodeInfoCompat > nodes ) { } }
if ( nodes == null ) { return ; } for ( AccessibilityNodeInfoCompat node : nodes ) { if ( node != null ) { node . recycle ( ) ; } } nodes . clear ( ) ;
public class XmlStringBuilder { /** * Write the contents of this < code > XmlStringBuilder < / code > to a { @ link Writer } . This will write * the single parts one - by - one , avoiding allocation of a big continuous memory block holding the * XmlStringBuilder contents . * @ param writer * @ throws IOException */ public void write ( Writer writer , String enclosingNamespace ) throws IOException { } }
for ( CharSequence csq : sb . getAsList ( ) ) { if ( csq instanceof XmlStringBuilder ) { ( ( XmlStringBuilder ) csq ) . write ( writer , enclosingNamespace ) ; } else if ( csq instanceof XmlNsAttribute ) { XmlNsAttribute xmlNsAttribute = ( XmlNsAttribute ) csq ; if ( ! xmlNsAttribute . value . equals ( enclosingNamespace ) ) { writer . write ( xmlNsAttribute . toString ( ) ) ; enclosingNamespace = xmlNsAttribute . value ; } } else { writer . write ( csq . toString ( ) ) ; } }
public class OtpNode { /** * internal info about the message formats . . . * the request : - > REG _ SEND { 6 , # Pid < bingo @ aule . 1.0 > , ' ' , net _ kernel } * { ' $ gen _ call ' , { # Pid < bingo @ aule . 1.0 > , # Ref < bingo @ aule . 2 > } , { is _ auth , bingo @ aule } } * the reply : < - SEND { 2 , ' ' , # Pid < bingo @ aule . 1.0 > } { # Ref < bingo @ aule . 2 > , yes } */ public boolean ping ( final String anode , final long timeout ) { } }
if ( anode . equals ( node ) ) { return true ; } else if ( anode . indexOf ( '@' , 0 ) < 0 && anode . equals ( node . substring ( 0 , node . indexOf ( '@' , 0 ) ) ) ) { return true ; } // other node OtpMbox mbox = null ; try { mbox = createMbox ( ) ; mbox . send ( "net_kernel" , anode , getPingTuple ( mbox ) ) ; final OtpErlangObject reply = mbox . receive ( timeout ) ; final OtpErlangTuple t = ( OtpErlangTuple ) reply ; final OtpErlangAtom a = ( OtpErlangAtom ) t . elementAt ( 1 ) ; return "yes" . equals ( a . atomValue ( ) ) ; } catch ( final Exception e ) { } finally { closeMbox ( mbox ) ; } return false ;
public class EC2InstanceCountsMarshaller { /** * Marshall the given parameter object . */ public void marshall ( EC2InstanceCounts eC2InstanceCounts , ProtocolMarshaller protocolMarshaller ) { } }
if ( eC2InstanceCounts == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( eC2InstanceCounts . getDESIRED ( ) , DESIRED_BINDING ) ; protocolMarshaller . marshall ( eC2InstanceCounts . getMINIMUM ( ) , MINIMUM_BINDING ) ; protocolMarshaller . marshall ( eC2InstanceCounts . getMAXIMUM ( ) , MAXIMUM_BINDING ) ; protocolMarshaller . marshall ( eC2InstanceCounts . getPENDING ( ) , PENDING_BINDING ) ; protocolMarshaller . marshall ( eC2InstanceCounts . getACTIVE ( ) , ACTIVE_BINDING ) ; protocolMarshaller . marshall ( eC2InstanceCounts . getIDLE ( ) , IDLE_BINDING ) ; protocolMarshaller . marshall ( eC2InstanceCounts . getTERMINATING ( ) , TERMINATING_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class PageUtil { /** * 分页彩虹算法 < br > * 来自 : https : / / github . com / iceroot / iceroot / blob / master / src / main / java / com / icexxx / util / IceUtil . java < br > * 通过传入的信息 , 生成一个分页列表显示 * @ param currentPage 当前页 * @ param pageCount 总页数 * @ param displayCount 每屏展示的页数 * @ return 分页条 */ public static int [ ] rainbow ( int currentPage , int pageCount , int displayCount ) { } }
boolean isEven = true ; isEven = displayCount % 2 == 0 ; int left = displayCount / 2 ; int right = displayCount / 2 ; int length = displayCount ; if ( isEven ) { right ++ ; } if ( pageCount < displayCount ) { length = pageCount ; } int [ ] result = new int [ length ] ; if ( pageCount >= displayCount ) { if ( currentPage <= left ) { for ( int i = 0 ; i < result . length ; i ++ ) { result [ i ] = i + 1 ; } } else if ( currentPage > pageCount - right ) { for ( int i = 0 ; i < result . length ; i ++ ) { result [ i ] = i + pageCount - displayCount + 1 ; } } else { for ( int i = 0 ; i < result . length ; i ++ ) { result [ i ] = i + currentPage - left + ( isEven ? 1 : 0 ) ; } } } else { for ( int i = 0 ; i < result . length ; i ++ ) { result [ i ] = i + 1 ; } } return result ;
public class BigIntegerUtil { /** * This is in use by FAT only at the writing time */ public static BigInteger decode ( String s ) { } }
byte [ ] bytes = Base64 . decodeBase64 ( s ) ; BigInteger bi = new BigInteger ( 1 , bytes ) ; return bi ;
public class SplittableIterator { /** * Splits this iterator into < i > n < / i > partitions and returns the < i > i - th < / i > partition * out of those . * @ param num The partition to return ( < i > i < / i > ) . * @ param numPartitions The number of partitions to split into ( < i > n < / i > ) . * @ return The iterator for the partition . */ public Iterator < T > getSplit ( int num , int numPartitions ) { } }
if ( numPartitions < 1 || num < 0 || num >= numPartitions ) { throw new IllegalArgumentException ( ) ; } return split ( numPartitions ) [ num ] ;
public class EncryptionProvider { /** * decrypt * Decrypts a file given the key and iv . Uses AES decryption . */ public static void decrypt ( File file , String keyBase64 , String ivBase64 , RemoteStoreFileEncryptionMaterial encMat ) throws NoSuchAlgorithmException , NoSuchPaddingException , InvalidKeyException , IllegalBlockSizeException , BadPaddingException , InvalidAlgorithmParameterException , IOException { } }
byte [ ] keyBytes = Base64 . decode ( keyBase64 ) ; byte [ ] ivBytes = Base64 . decode ( ivBase64 ) ; byte [ ] qsmkBytes = Base64 . decode ( encMat . getQueryStageMasterKey ( ) ) ; final SecretKey fileKey ; // Decrypt file key { final Cipher keyCipher = Cipher . getInstance ( KEY_CIPHER ) ; SecretKey queryStageMasterKey = new SecretKeySpec ( qsmkBytes , 0 , qsmkBytes . length , AES ) ; keyCipher . init ( Cipher . DECRYPT_MODE , queryStageMasterKey ) ; byte [ ] fileKeyBytes = keyCipher . doFinal ( keyBytes ) ; // NB : we assume qsmk . length = = fileKey . length // ( fileKeyBytes . length may be bigger due to padding ) fileKey = new SecretKeySpec ( fileKeyBytes , 0 , qsmkBytes . length , AES ) ; } // Decrypt file { final Cipher fileCipher = Cipher . getInstance ( FILE_CIPHER ) ; final IvParameterSpec iv = new IvParameterSpec ( ivBytes ) ; final byte [ ] buffer = new byte [ BUFFER_SIZE ] ; fileCipher . init ( Cipher . DECRYPT_MODE , fileKey , iv ) ; long totalBytesRead = 0 ; // Overwrite file contents buffer - wise with decrypted data try ( InputStream is = Files . newInputStream ( file . toPath ( ) , READ ) ; InputStream cis = new CipherInputStream ( is , fileCipher ) ; OutputStream os = Files . newOutputStream ( file . toPath ( ) , CREATE ) ; ) { int bytesRead ; while ( ( bytesRead = cis . read ( buffer ) ) > - 1 ) { os . write ( buffer , 0 , bytesRead ) ; totalBytesRead += bytesRead ; } } // Discard any padding that the encrypted file had try ( FileChannel fc = new FileOutputStream ( file , true ) . getChannel ( ) ) { fc . truncate ( totalBytesRead ) ; } }
public class FileUtils { /** * Copy the file from the source to the destination . * @ param source the source file to be copied . * @ param destination the destination file to copy . * @ see java . nio . channels . FileChannel # transferTo ( long , long , java . nio . channels . WritableByteChannel ) . * @ return the transferred byte count . * @ throws FileNotFoundException * @ throws IOException */ public static long copy ( File source , File destination ) throws FileNotFoundException , IOException { } }
FileInputStream in = null ; FileOutputStream out = null ; try { in = new FileInputStream ( source ) ; out = new FileOutputStream ( destination ) ; return copy ( in , out ) ; } finally { CloseableUtils . close ( in ) ; CloseableUtils . close ( out ) ; }
public class HFClient { /** * Configures a channel based on information loaded from a Network Config file . * Note that it is up to the caller to initialize the returned channel . * @ param channelName The name of the channel to be configured * @ param networkConfig The network configuration to use to configure the channel * @ param networkConfigAddPeerHandler A handler that will create and add peers to the channel . * @ param networkConfigAddOrdererHandler A handler that will create orderers and add orderers to the channel . * @ return The configured channel , or null if the channel is not defined in the configuration * @ throws InvalidArgumentException */ public Channel loadChannelFromConfig ( String channelName , NetworkConfig networkConfig , NetworkConfig . NetworkConfigAddPeerHandler networkConfigAddPeerHandler , NetworkConfig . NetworkConfigAddOrdererHandler networkConfigAddOrdererHandler ) throws InvalidArgumentException , NetworkConfigurationException { } }
clientCheck ( ) ; // Sanity checks if ( channelName == null || channelName . isEmpty ( ) ) { throw new InvalidArgumentException ( "channelName must be specified" ) ; } if ( networkConfig == null ) { throw new InvalidArgumentException ( "networkConfig must be specified" ) ; } if ( null == networkConfigAddPeerHandler ) { throw new InvalidArgumentException ( "networkConfigAddPeerHandler is null." ) ; } if ( null == networkConfigAddOrdererHandler ) { throw new InvalidArgumentException ( "networkConfigAddOrdererHandler is null." ) ; } if ( channels . containsKey ( channelName ) ) { throw new InvalidArgumentException ( format ( "Channel with name %s already exists" , channelName ) ) ; } return networkConfig . loadChannel ( this , channelName , networkConfigAddPeerHandler , networkConfigAddOrdererHandler ) ;
public class MBeans { /** * ( non - Javadoc ) * @ see com . ibm . ws . cache . CacheAdmin # getCacheStatisticNames ( com . ibm . ws . cache . intf . DCache ) */ @ Override public String [ ] getCacheStatisticNames ( DCache cache ) { } }
Map statistics = getCacheStatisticsMap ( cache . getCacheStatistics ( ) ) ; String names [ ] = new String [ statistics . size ( ) ] ; Iterator it = statistics . keySet ( ) . iterator ( ) ; int i = 0 ; while ( it . hasNext ( ) ) { names [ i ] = ( String ) it . next ( ) ; i ++ ; } return names ;
public class ModelsImpl { /** * Create an entity role for an entity in the application . * @ param appId The application ID . * @ param versionId The version ID . * @ param entityId The entity model ID . * @ param createClosedListEntityRoleOptionalParameter the object representing the optional parameters to be set before calling this API * @ throws IllegalArgumentException thrown if parameters fail the validation * @ throws ErrorResponseException thrown if the request is rejected by server * @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @ return the UUID object if successful . */ public UUID createClosedListEntityRole ( UUID appId , String versionId , UUID entityId , CreateClosedListEntityRoleOptionalParameter createClosedListEntityRoleOptionalParameter ) { } }
return createClosedListEntityRoleWithServiceResponseAsync ( appId , versionId , entityId , createClosedListEntityRoleOptionalParameter ) . toBlocking ( ) . single ( ) . body ( ) ;
public class StateBasedGame { /** * Enter a particular game state with the transitions provided * @ param id The ID of the state to enter * @ param leave The transition to use when leaving the current state * @ param enter The transition to use when entering the new state */ public void enterState ( int id , Transition leave , Transition enter ) { } }
if ( leave == null ) { leave = new EmptyTransition ( ) ; } if ( enter == null ) { enter = new EmptyTransition ( ) ; } leaveTransition = leave ; enterTransition = enter ; nextState = getState ( id ) ; if ( nextState == null ) { throw new RuntimeException ( "No game state registered with the ID: " + id ) ; } leaveTransition . init ( currentState , nextState ) ;
public class BrowserSteps { /** * switchToWindow switch to an other Window . */ private void switchToWindow ( String key , String handleToKeep ) { } }
Context . addWindow ( key , handleToKeep ) ; Context . setMainWindow ( key ) ; Context . getDriver ( ) . switchTo ( ) . window ( handleToKeep ) ;
public class CancelWorkflowExecutionDecisionAttributesMarshaller { /** * Marshall the given parameter object . */ public void marshall ( CancelWorkflowExecutionDecisionAttributes cancelWorkflowExecutionDecisionAttributes , ProtocolMarshaller protocolMarshaller ) { } }
if ( cancelWorkflowExecutionDecisionAttributes == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( cancelWorkflowExecutionDecisionAttributes . getDetails ( ) , DETAILS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class HtmlElement { /** * Html " class " attribute . Adds a single , space - separated value while preserving existing ones . * @ param value Value of attribute * @ return Self reference */ public final T addCssClass ( String value ) { } }
if ( StringUtils . isNotEmpty ( value ) ) { return setCssClass ( StringUtils . isNotEmpty ( getCssClass ( ) ) ? getCssClass ( ) + " " + value : value ) ; } else { return ( T ) this ; }
public class SearchApi { /** * Search on a string Search for entities that match a given sub - string . - - - * This route is cached for up to 3600 seconds SSO Scope : * esi - search . search _ structures . v1 * @ param categories * Type of entities to search for ( required ) * @ param search * The string to search on ( required ) * @ param acceptLanguage * Language to use in the response ( optional , default to en - us ) * @ param datasource * The server name you would like data from ( optional , default to * tranquility ) * @ param ifNoneMatch * ETag from a previous request . A 304 will be returned if this * matches the current ETag ( optional ) * @ param language * Language to use in the response , takes precedence over * Accept - Language ( optional , default to en - us ) * @ param strict * Whether the search should be a strict match ( optional , default * to false ) * @ return ApiResponse & lt ; SearchResponse & gt ; * @ throws ApiException * If fail to call the API , e . g . server error or cannot * deserialize the response body */ public ApiResponse < SearchResponse > getSearchWithHttpInfo ( List < String > categories , String search , String acceptLanguage , String datasource , String ifNoneMatch , String language , Boolean strict ) throws ApiException { } }
com . squareup . okhttp . Call call = getSearchValidateBeforeCall ( categories , search , acceptLanguage , datasource , ifNoneMatch , language , strict , null ) ; Type localVarReturnType = new TypeToken < SearchResponse > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnType ) ;
public class MapView { /** * adjusts the mapCoordinateElement ' s position in the map . * @ param id * the id of the element to move */ private void moveMapCoordinateElementInMap ( final String id ) { } }
if ( getInitialized ( ) && null != id ) { final WeakReference < MapCoordinateElement > weakReference = mapCoordinateElements . get ( id ) ; if ( null != weakReference ) { final MapCoordinateElement mapCoordinateElement = weakReference . get ( ) ; if ( null != mapCoordinateElement ) { if ( logger . isTraceEnabled ( ) ) { logger . trace ( "move element in OpenLayers map to {}" , mapCoordinateElement ) ; } jsMapView . call ( "moveMapObject" , mapCoordinateElement . getId ( ) , mapCoordinateElement . getPosition ( ) . getLatitude ( ) , mapCoordinateElement . getPosition ( ) . getLongitude ( ) ) ; } } }
public class TextReport { /** * Log a message line to the output . */ private void logShort ( CharSequence message , boolean trim ) throws IOException { } }
int length = message . length ( ) ; if ( trim ) { while ( length > 0 && Character . isWhitespace ( message . charAt ( length - 1 ) ) ) { length -- ; } } char [ ] chars = new char [ length + 1 ] ; for ( int i = 0 ; i < length ; i ++ ) { chars [ i ] = message . charAt ( i ) ; } chars [ length ] = '\n' ; output . write ( chars ) ;
public class Jaguar { /** * Bootstraps Jaguar . */ public static synchronized void bootstrap ( ) { } }
if ( container != null ) { logger . debug ( "Jaguar has already started" ) ; return ; } logger . info ( "Starting Jaguar on Java Runtime Environment [" + Environment . getProperty ( "java.version" ) + "]" ) ; try { container = new Container ( ) ; container . initialize ( ) ; } catch ( Exception e ) { container = null ; throw new UncheckedException ( e ) ; }
public class AmazonDirectConnectClient { /** * Deletes the specified interconnect . * < note > * Intended for use by AWS Direct Connect Partners only . * < / note > * @ param deleteInterconnectRequest * @ return Result of the DeleteInterconnect operation returned by the service . * @ throws DirectConnectServerException * A server - side error occurred . * @ throws DirectConnectClientException * One or more parameters are not valid . * @ sample AmazonDirectConnect . DeleteInterconnect * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / directconnect - 2012-10-25 / DeleteInterconnect " * target = " _ top " > AWS API Documentation < / a > */ @ Override public DeleteInterconnectResult deleteInterconnect ( DeleteInterconnectRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeDeleteInterconnect ( request ) ;
public class CascadingClassLoadHelper { /** * Return the class with the given name . */ @ Nonnull public Class < ? > loadClass ( final String sClassName ) throws ClassNotFoundException { } }
if ( m_aBestCandidate != null ) { try { return m_aBestCandidate . loadClass ( sClassName ) ; } catch ( final Throwable t ) { m_aBestCandidate = null ; } } Throwable aThrowable = null ; Class < ? > ret = null ; IClassLoadHelper aLoadHelper = null ; final Iterator < IClassLoadHelper > iter = m_aLoadHelpers . iterator ( ) ; while ( iter . hasNext ( ) ) { aLoadHelper = iter . next ( ) ; try { ret = aLoadHelper . loadClass ( sClassName ) ; break ; } catch ( final Throwable t ) { aThrowable = t ; } } if ( ret == null ) { if ( aThrowable instanceof ClassNotFoundException ) throw ( ClassNotFoundException ) aThrowable ; throw new ClassNotFoundException ( "Unable to load class " + sClassName + " by any known loaders." , aThrowable ) ; } // Remember m_aBestCandidate = aLoadHelper ; return ret ;
public class PasswordEditText { /** * Adds all constraints , which are contained by a specific collection . * @ param constraints * A collection , which contains the constraints , which should be added , as an instance * of the type { @ link Collection } or an empty collection , if no constraints should be * added */ public final void addAllConstraints ( @ NonNull final Collection < Constraint < CharSequence > > constraints ) { } }
Condition . INSTANCE . ensureNotNull ( constraints , "The collection may not be null" ) ; for ( Constraint < CharSequence > constraint : constraints ) { addConstraint ( constraint ) ; }
public class HttpSender { /** * Sets whether or not the global state should be used . * Refer to { @ link # HttpSender ( ConnectionParam , boolean , int ) } for details on how the global state is used . * @ param enableGlobalState { @ code true } if the global state should be used , { @ code false } otherwise . * @ since TODO add version */ public void setUseGlobalState ( boolean enableGlobalState ) { } }
if ( enableGlobalState ) { checkState ( ) ; } else { client . setState ( new HttpState ( ) ) ; clientViaProxy . setState ( new HttpState ( ) ) ; setClientsCookiePolicy ( CookiePolicy . BROWSER_COMPATIBILITY ) ; }
public class ScriptOpCodes { /** * Converts the given OpCode into a string ( eg " 0 " , " PUSHDATA " , or " NON _ OP ( 10 ) " ) */ public static String getOpCodeName ( int opcode ) { } }
if ( opCodeMap . containsKey ( opcode ) ) return opCodeMap . get ( opcode ) ; return "NON_OP(" + opcode + ")" ;
public class AbstractSubCodeBuilderFragment { /** * Replies the getter function for accessing to the top element collection of the script . * @ return the name of the getter function . */ @ Pure protected String getLanguageScriptMemberGetter ( ) { } }
final Grammar grammar = getGrammar ( ) ; final AbstractRule scriptRule = GrammarUtil . findRuleForName ( grammar , getCodeBuilderConfig ( ) . getScriptRuleName ( ) ) ; for ( final Assignment assignment : GrammarUtil . containedAssignments ( scriptRule ) ) { if ( ( assignment . getTerminal ( ) instanceof RuleCall ) && Objects . equals ( ( ( RuleCall ) assignment . getTerminal ( ) ) . getRule ( ) . getName ( ) , getCodeBuilderConfig ( ) . getTopElementRuleName ( ) ) ) { return "get" + Strings . toFirstUpper ( assignment . getFeature ( ) ) ; // $ NON - NLS - 1 $ } } throw new IllegalStateException ( "member not found" ) ; // $ NON - NLS - 1 $