signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class Utils { /** * Reads a { @ code T } instance from { @ code source } using { @ code adapter } . This method can handle * { @ code null } values . It should be used for reading objects that were written using * { @ link # writeNullable ( Object , Parcel , int , TypeAdapter ) } . */ @ Nullable public static < T > T readNullable ( @ NonNull Parcel source , @ NonNull TypeAdapter < T > adapter ) { } }
T value = null ; if ( source . readInt ( ) == 1 ) { value = adapter . readFromParcel ( source ) ; } return value ;
public class GetAccountSettingsRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( GetAccountSettingsRequest getAccountSettingsRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( getAccountSettingsRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( getAccountSettingsRequest . getAccountId ( ) , ACCOUNTID_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class LiteProtoSubject { /** * Checks whether the MessageLite is equivalent to the argument , using the standard equals ( ) * implementation . */ @ Override public void isEqualTo ( @ NullableDecl Object expected ) { } }
// TODO ( user ) : Do better here when MessageLite descriptors are available . if ( Objects . equal ( actual ( ) , expected ) ) { return ; } if ( actual ( ) == null || expected == null ) { super . isEqualTo ( expected ) ; } else if ( actual ( ) . getClass ( ) != expected . getClass ( ) ) { failWithoutActual ( simpleFact ( lenientFormat ( "Not true that (%s) %s is equal to the expected (%s) object. " + "They are not of the same class." , actual ( ) . getClass ( ) . getName ( ) , internalCustomName ( ) != null ? internalCustomName ( ) + " (proto)" : "proto" , expected . getClass ( ) . getName ( ) ) ) ) ; } else { /* * TODO ( cpovirk ) : If we someday let subjects override formatActualOrExpected ( ) , change this * class to do so , and make this code path always delegate to super . isEqualTo ( ) . */ String ourString = getTrimmedToString ( actual ( ) ) ; String theirString = getTrimmedToString ( ( MessageLite ) expected ) ; if ( ! ourString . equals ( theirString ) ) { check ( ) . that ( ourString ) . isEqualTo ( theirString ) ; // fails } else { // This will include the Object . toString ( ) headers . super . isEqualTo ( expected ) ; } }
public class ViewControlsLayer { /** * Sets the relative viewport location to display the view controls . Can be one of { @ link AVKey # NORTHEAST } , { @ link * AVKey # NORTHWEST } , { @ link AVKey # SOUTHEAST } , or { @ link AVKey # SOUTHWEST } ( the default ) . These indicate the corner of * the viewport to place view controls . * @ param position the desired view controls position , in screen coordinates . */ public void setPosition ( String position ) { } }
if ( position == null ) { String message = Logging . getMessage ( "nullValue.PositionIsNull" ) ; Logging . logger ( ) . severe ( message ) ; throw new IllegalArgumentException ( message ) ; } this . position = position ; clearControls ( ) ;
public class GobblinMetrics { /** * Build scheduled metrics reporters by reflection from the property * { @ link org . apache . gobblin . configuration . ConfigurationKeys # METRICS _ CUSTOM _ BUILDERS } . This allows users to specify custom * reporters for Gobblin runtime without having to modify the code . */ private void buildCustomMetricReporters ( Properties properties ) { } }
String reporterClasses = properties . getProperty ( ConfigurationKeys . METRICS_CUSTOM_BUILDERS ) ; if ( Strings . isNullOrEmpty ( reporterClasses ) ) { return ; } for ( String reporterClass : Splitter . on ( "," ) . split ( reporterClasses ) ) { buildScheduledReporter ( properties , reporterClass , Optional . < String > absent ( ) ) ; }
public class DriverRestartManager { /** * Sets the driver restart status to be completed if not yet set and notifies the restart completed event handlers . */ private synchronized void onDriverRestartCompleted ( final boolean isTimedOut ) { } }
if ( this . state != DriverRestartState . COMPLETED ) { final Set < String > outstandingEvaluatorIds = getOutstandingEvaluatorsAndMarkExpired ( ) ; driverRuntimeRestartManager . informAboutEvaluatorFailures ( outstandingEvaluatorIds ) ; this . state = DriverRestartState . COMPLETED ; final DriverRestartCompleted driverRestartCompleted = new DriverRestartCompletedImpl ( System . currentTimeMillis ( ) , isTimedOut ) ; for ( final EventHandler < DriverRestartCompleted > serviceRestartCompletedHandler : this . serviceDriverRestartCompletedHandlers ) { serviceRestartCompletedHandler . onNext ( driverRestartCompleted ) ; } for ( final EventHandler < DriverRestartCompleted > restartCompletedHandler : this . driverRestartCompletedHandlers ) { restartCompletedHandler . onNext ( driverRestartCompleted ) ; } LOG . log ( Level . FINE , "Restart completed. Evaluators that have not reported back are: " + outstandingEvaluatorIds ) ; } restartCompletedTimer . cancel ( ) ;
public class RDBMEntityLockStore { /** * Updates the lock ' s < code > expiration < / code > and < code > lockType < / code > in the underlying store . * Param < code > lockType < / code > may be null . * @ param lock * @ param newExpiration java . util . Date * @ param newLockType Integer */ @ Override public void update ( IEntityLock lock , Date newExpiration , Integer newLockType ) throws LockingException { } }
Connection conn = null ; try { conn = RDBMServices . getConnection ( ) ; if ( newLockType != null ) { primDeleteExpired ( new Date ( ) , lock . getEntityType ( ) , lock . getEntityKey ( ) , conn ) ; } primUpdate ( lock , newExpiration , newLockType , conn ) ; } catch ( SQLException sqle ) { throw new LockingException ( "Problem updating " + lock , sqle ) ; } finally { RDBMServices . releaseConnection ( conn ) ; }
public class AndroidEventBuilderHelper { /** * Get the total amount of external storage , in bytes , or null if no external storage * is mounted . * @ return the total amount of external storage , in bytes , or null if no external storage * is mounted */ protected static Long getTotalExternalStorage ( ) { } }
try { if ( isExternalStorageMounted ( ) ) { File path = Environment . getExternalStorageDirectory ( ) ; StatFs stat = new StatFs ( path . getPath ( ) ) ; long blockSize = stat . getBlockSize ( ) ; long totalBlocks = stat . getBlockCount ( ) ; return totalBlocks * blockSize ; } } catch ( Exception e ) { Log . e ( TAG , "Error getting total external storage amount." , e ) ; } return null ;
public class AspectranNodeParser { /** * Adds the type alias nodelets . */ private void addTypeAliasNodelets ( ) { } }
parser . setXpath ( "/aspectran/typeAliases" ) ; parser . addNodeEndlet ( text -> { if ( StringUtils . hasLength ( text ) ) { Parameters parameters = new VariableParameters ( text ) ; for ( String alias : parameters . getParameterNameSet ( ) ) { assistant . addTypeAlias ( alias , parameters . getString ( alias ) ) ; } } } ) ; parser . setXpath ( "/aspectran/typeAliases/typeAlias" ) ; parser . addNodelet ( attrs -> { String alias = attrs . get ( "alias" ) ; String type = attrs . get ( "type" ) ; assistant . addTypeAlias ( alias , type ) ; } ) ;
public class OutputStreamBitWriter { /** * byte based methods */ @ Override protected void writeByte ( int value ) throws BitStreamException { } }
try { out . write ( value ) ; } catch ( IOException e ) { throw new BitStreamException ( e ) ; }
public class ExceptionSoftener { /** * Soften a Callable that throws a ChecekdException into a Supplier * < pre > * { @ code * Supplier < String > supplier = ExceptionSoftener . softenCallable ( this ) ; * supplier . getValue ( ) ; / / thows IOException but doesn ' t need to declare it * public String call ( ) throws IOException { * return " hello " ; * < / pre > * @ param s Callable with CheckedException * @ return Supplier that throws the same exception , but doesn ' t need to declare it as a * checked Exception */ public static < T > Supplier < T > softenCallable ( final Callable < T > s ) { } }
return ( ) -> { try { return s . call ( ) ; } catch ( final Throwable e ) { throw throwSoftenedException ( e ) ; } } ;
public class IFixCompareCommandTask { /** * Returns < code > true < / code > if the IFixInfo applies the current installation version . * @ param productVersion * @ param iFixInfo * @ return */ private boolean isIFixApplicable ( Version productVersion , IFixInfo iFixInfo ) throws VersionParsingException { } }
// If we don ' t know the product version just return true if ( productVersion == null ) { return true ; } // Get the applicability for the iFix Applicability applicability = iFixInfo . getApplicability ( ) ; if ( applicability == null ) { throw new VersionParsingException ( getMessage ( "compare.unable.to.find.offering" , iFixInfo . getId ( ) ) ) ; } List < Offering > offerings = applicability . getOfferings ( ) ; if ( offerings == null || offerings . isEmpty ( ) ) { throw new VersionParsingException ( getMessage ( "compare.unable.to.find.offering" , iFixInfo . getId ( ) ) ) ; } // All offerings do not have the same version range so we need to iterate to see if we match // an of the applicable ranges boolean matches = false ; for ( Offering offering : offerings ) { String tolerance = offering . getTolerance ( ) ; VersionRange toleranceRange = VersionRange . parseVersionRange ( tolerance ) ; // Make sure the product version is in the range of the tolerance if ( toleranceRange . matches ( productVersion ) ) { matches = true ; break ; } } return matches ;
public class LoadingLayout { /** * create loading mask * @ return */ @ Override protected View createOverlayView ( ) { } }
LinearLayout ll = new LinearLayout ( getContext ( ) ) ; ll . setLayoutParams ( new FrameLayout . LayoutParams ( FrameLayout . LayoutParams . MATCH_PARENT , FrameLayout . LayoutParams . MATCH_PARENT ) ) ; ll . setGravity ( Gravity . CENTER ) ; View progressBar = createProgressBar ( ) ; ll . addView ( progressBar ) ; return ll ;
public class PlanAssembler { /** * Create an order by node as required by the statement and make it a parent of root . * @ param parsedStmt Parsed statement , for context * @ param root The root of the plan needing ordering * @ return new orderByNode ( the new root ) or the original root if no orderByNode was required . */ private static AbstractPlanNode handleOrderBy ( AbstractParsedStmt parsedStmt , AbstractPlanNode root ) { } }
assert ( parsedStmt instanceof ParsedSelectStmt || parsedStmt instanceof ParsedUnionStmt || parsedStmt instanceof ParsedDeleteStmt ) ; if ( ! isOrderByNodeRequired ( parsedStmt , root ) ) { return root ; } OrderByPlanNode orderByNode = buildOrderByPlanNode ( parsedStmt . orderByColumns ( ) ) ; orderByNode . addAndLinkChild ( root ) ; return orderByNode ;
public class SamplingEvictionStrategy { /** * Processes sampling based eviction logic on { @ link SampleableEvictableStore } . * @ param sampleableEvictableStore { @ link SampleableEvictableStore } that holds { @ link Evictable } entries * @ param evictionPolicyEvaluator { @ link EvictionPolicyEvaluator } to evaluate * @ param evictionListener { @ link EvictionListener } to listen evicted entries * @ return true is an entry was evicted , otherwise false */ protected boolean evictInternal ( S sampleableEvictableStore , EvictionPolicyEvaluator < A , E > evictionPolicyEvaluator , EvictionListener < A , E > evictionListener ) { } }
final Iterable < EvictionCandidate < A , E > > samples = sampleableEvictableStore . sample ( SAMPLE_COUNT ) ; final EvictionCandidate < A , E > evictionCandidate = evictionPolicyEvaluator . evaluate ( samples ) ; return sampleableEvictableStore . tryEvict ( evictionCandidate , evictionListener ) ;
public class HashMapImpl { /** * Clears the cache */ @ Override public void clear ( ) { } }
if ( _size > 0 ) { final K [ ] keys = _keys ; final V [ ] values = _values ; final int length = values . length ; for ( int i = length - 1 ; i >= 0 ; i -- ) { keys [ i ] = null ; values [ i ] = null ; } _size = 0 ; } _nullValue = null ;
public class StandardConversions { /** * Converts a java object to a sequence of bytes applying standard java serialization . * @ param source source the java object to convert . * @ param sourceMediaType the MediaType matching application / x - application - object describing the source . * @ return byte [ ] representation of the java object . * @ throws EncodingException if the sourceMediaType is not a application / x - java - object or if the conversion is * not supported . */ public static byte [ ] convertJavaToOctetStream ( Object source , MediaType sourceMediaType , Marshaller marshaller ) throws IOException , InterruptedException { } }
if ( source == null ) return null ; if ( ! sourceMediaType . match ( MediaType . APPLICATION_OBJECT ) ) { throw new EncodingException ( "destination MediaType not conforming to application/x-java-object!" ) ; } Object decoded = decodeObjectContent ( source , sourceMediaType ) ; if ( decoded instanceof byte [ ] ) return ( byte [ ] ) decoded ; if ( decoded instanceof String && isJavaString ( sourceMediaType ) ) return ( ( String ) decoded ) . getBytes ( StandardCharsets . UTF_8 ) ; return marshaller . objectToByteBuffer ( source ) ;
public class CryptoUtil { /** * 生成HMAC - SHA1密钥 , 返回字节数组 , 长度为160位 ( 20字节 ) . HMAC - SHA1算法对密钥无特殊要求 , RFC2401建议最少长度为160位 ( 20字节 ) . */ public static byte [ ] generateHmacSha1Key ( ) { } }
try { KeyGenerator keyGenerator = KeyGenerator . getInstance ( HMACSHA1_ALG ) ; keyGenerator . init ( DEFAULT_HMACSHA1_KEYSIZE ) ; SecretKey secretKey = keyGenerator . generateKey ( ) ; return secretKey . getEncoded ( ) ; } catch ( GeneralSecurityException e ) { throw ExceptionUtil . unchecked ( e ) ; }
public class QueueBuilder { /** * Create the new Queue using the currently set properties . */ public Queue < B > newQueue ( ) { } }
return new Queue < B > ( parent_queue , queue_restriction , index , process_builder_class , process_server_class , default_occurence , default_visibility , default_access , default_resilience , default_output , implementation_options ) ;
public class MainController { /** * Activates the property grid once the provider and group ids are set . */ private void init ( ) { } }
if ( provider != null ) { propertyGrid . setTarget ( StringUtils . isEmpty ( groupId ) ? null : new Settings ( groupId , provider ) ) ; }
public class MapDBEngine { /** * { @ inheritDoc } */ @ Override @ SuppressWarnings ( "unchecked" ) public < T extends Serializable > T loadObject ( String name , Class < T > klass ) throws NoSuchElementException { } }
assertConnectionOpen ( ) ; if ( ! existsObject ( name ) ) { throw new NoSuchElementException ( "Can't find any object with name '" + name + "'" ) ; } DB storage = openStorage ( StorageType . PRIMARY_STORAGE ) ; Atomic . Var < T > atomicVar = storage . getAtomicVar ( name ) ; T serializableObject = klass . cast ( atomicVar . get ( ) ) ; postDeserializer ( serializableObject ) ; return serializableObject ;
public class CircuitBreakerBuilder { /** * Sets the time length of sliding window to accumulate the count of events . * Defaults to { @ value Defaults # COUNTER _ SLIDING _ WINDOW _ SECONDS } seconds if unspecified . */ public CircuitBreakerBuilder counterSlidingWindow ( Duration counterSlidingWindow ) { } }
requireNonNull ( counterSlidingWindow , "counterSlidingWindow" ) ; if ( counterSlidingWindow . isNegative ( ) || counterSlidingWindow . isZero ( ) ) { throw new IllegalArgumentException ( "counterSlidingWindow: " + counterSlidingWindow + " (expected: > 0)" ) ; } this . counterSlidingWindow = counterSlidingWindow ; return this ;
public class ClassNode { /** * The complete class structure will be initialized only when really * needed to avoid having too many objects during compilation */ private void lazyClassInit ( ) { } }
if ( lazyInitDone ) return ; synchronized ( lazyInitLock ) { if ( redirect != null ) { throw new GroovyBugError ( "lazyClassInit called on a proxy ClassNode, that must not happen." + "A redirect() call is missing somewhere!" ) ; } if ( lazyInitDone ) return ; VMPluginFactory . getPlugin ( ) . configureClassNode ( compileUnit , this ) ; lazyInitDone = true ; }
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EClass getIfcApplication ( ) { } }
if ( ifcApplicationEClass == null ) { ifcApplicationEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 20 ) ; } return ifcApplicationEClass ;
public class OS { /** * Returns the name of the current Windows visual style . * < ul > * < li > it looks for a property name " win . xpstyle . name " in UIManager and if * not found * < li > it queries the win . xpstyle . colorName desktop property * ( { @ link Toolkit # getDesktopProperty ( java . lang . String ) } ) * < / ul > * @ return the name of the current Windows visual style if any . */ public static String getWindowsVisualStyle ( ) { } }
String style = UIManager . getString ( "win.xpstyle.name" ) ; if ( style == null ) { // guess the name of the current XPStyle // ( win . xpstyle . colorName property found in awt _ DesktopProperties . cpp in // JDK source ) style = ( String ) Toolkit . getDefaultToolkit ( ) . getDesktopProperty ( "win.xpstyle.colorName" ) ; } return style ;
public class HttpConnection { /** * 建立连接 * @ return { @ link URLConnection } * @ throws IOException */ private URLConnection openConnection ( ) throws IOException { } }
return ( null == this . proxy ) ? url . openConnection ( ) : url . openConnection ( this . proxy ) ;
public class CustomerSession { /** * Force an update of the current customer , regardless of how much time has passed . * @ param listener a { @ link CustomerRetrievalListener } to invoke with the result of getting * the customer from the server */ public void updateCurrentCustomer ( @ NonNull CustomerRetrievalListener listener ) { } }
mCustomer = null ; final String operationId = UUID . randomUUID ( ) . toString ( ) ; mCustomerRetrievalListeners . put ( operationId , listener ) ; mEphemeralKeyManager . retrieveEphemeralKey ( operationId , null , null ) ;
public class OpDouble { /** * Create a String expression from a Expression * @ param left * @ param right * @ param operation * @ return String expression * @ throws TemplateException */ public static ExprDouble toExprDouble ( Expression left , Expression right , int operation ) { } }
return new OpDouble ( left , right , operation ) ;
public class UkrainianHybridDisambiguator { /** * all uppercase mostly are abbreviations , e . g . " АТО " is not part / intj */ private void removeLowerCaseHomonymsForAbbreviations ( AnalyzedSentence input ) { } }
AnalyzedTokenReadings [ ] tokens = input . getTokensWithoutWhitespace ( ) ; for ( int i = 1 ; i < tokens . length ; i ++ ) { if ( StringUtils . isAllUpperCase ( tokens [ i ] . getToken ( ) ) && PosTagHelper . hasPosTagPart ( tokens [ i ] , ":abbr" ) ) { List < AnalyzedToken > analyzedTokens = tokens [ i ] . getReadings ( ) ; for ( int j = analyzedTokens . size ( ) - 1 ; j >= 0 ; j -- ) { AnalyzedToken analyzedToken = analyzedTokens . get ( j ) ; if ( ! PosTagHelper . hasPosTagPart ( analyzedToken , ":abbr" ) && ! JLanguageTool . SENTENCE_END_TAGNAME . equals ( analyzedToken ) ) { tokens [ i ] . removeReading ( analyzedToken ) ; } } } }
public class KllFloatsSketch { /** * Heapify takes the sketch image in Memory and instantiates an on - heap sketch . * The resulting sketch will not retain any link to the source Memory . * @ param mem a Memory image of a sketch . * < a href = " { @ docRoot } / resources / dictionary . html # mem " > See Memory < / a > * @ return a heap - based sketch based on the given Memory */ public static KllFloatsSketch heapify ( final Memory mem ) { } }
final int preambleInts = mem . getByte ( PREAMBLE_INTS_BYTE ) & 0xff ; final int serialVersion = mem . getByte ( SER_VER_BYTE ) & 0xff ; final int family = mem . getByte ( FAMILY_BYTE ) & 0xff ; final int flags = mem . getByte ( FLAGS_BYTE ) & 0xff ; final int m = mem . getByte ( M_BYTE ) & 0xff ; if ( m != DEFAULT_M ) { throw new SketchesArgumentException ( "Possible corruption: M must be " + DEFAULT_M + ": " + m ) ; } final boolean isEmpty = ( flags & ( 1 << Flags . IS_EMPTY . ordinal ( ) ) ) > 0 ; final boolean isSingleItem = ( flags & ( 1 << Flags . IS_SINGLE_ITEM . ordinal ( ) ) ) > 0 ; if ( isEmpty || isSingleItem ) { if ( preambleInts != PREAMBLE_INTS_SHORT ) { throw new SketchesArgumentException ( "Possible corruption: preambleInts must be " + PREAMBLE_INTS_SHORT + " for an empty or single item sketch: " + preambleInts ) ; } } else { if ( preambleInts != PREAMBLE_INTS_FULL ) { throw new SketchesArgumentException ( "Possible corruption: preambleInts must be " + PREAMBLE_INTS_FULL + " for a sketch with more than one item: " + preambleInts ) ; } } if ( ( serialVersion != serialVersionUID1 ) && ( serialVersion != serialVersionUID2 ) ) { throw new SketchesArgumentException ( "Possible corruption: serial version mismatch: expected " + serialVersionUID1 + " or " + serialVersionUID2 + ", got " + serialVersion ) ; } if ( family != Family . KLL . getID ( ) ) { throw new SketchesArgumentException ( "Possible corruption: family mismatch: expected " + Family . KLL . getID ( ) + ", got " + family ) ; } return new KllFloatsSketch ( mem ) ;
public class AfplibPackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EEnum getMediaFidelityStpMedEx ( ) { } }
if ( mediaFidelityStpMedExEEnum == null ) { mediaFidelityStpMedExEEnum = ( EEnum ) EPackage . Registry . INSTANCE . getEPackage ( AfplibPackage . eNS_URI ) . getEClassifiers ( ) . get ( 165 ) ; } return mediaFidelityStpMedExEEnum ;
public class ApiOvhOrder { /** * Get prices and contracts information * REST : GET / order / license / windows / new / { duration } * @ param serviceType [ required ] # DEPRECATED # The kind of service on which this license will be used # Will not be used , keeped only for compatibility # * @ param sqlVersion [ required ] The SQL Server version to enable on this license Windows license * @ param version [ required ] This license version * @ param ip [ required ] Ip on which this license would be installed ( for dedicated your main server Ip ) * @ param duration [ required ] Duration */ public OvhOrder license_windows_new_duration_GET ( String duration , String ip , OvhLicenseTypeEnum serviceType , OvhWindowsSqlVersionEnum sqlVersion , OvhWindowsOsVersionEnum version ) throws IOException { } }
String qPath = "/order/license/windows/new/{duration}" ; StringBuilder sb = path ( qPath , duration ) ; query ( sb , "ip" , ip ) ; query ( sb , "serviceType" , serviceType ) ; query ( sb , "sqlVersion" , sqlVersion ) ; query ( sb , "version" , version ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , OvhOrder . class ) ;
public class LogFileEntry { /** * Writes the contents of the entry into the given outputWriter . * @ param outputWriter * @ throws IOException */ public void write ( final Writer outputWriter ) throws IOException { } }
try ( final DataInputStream keyStream = entry . getKeyStream ( ) ; final DataInputStream valueStream = entry . getValueStream ( ) ; ) { outputWriter . write ( "Container: " ) ; outputWriter . write ( keyStream . readUTF ( ) ) ; outputWriter . write ( "\n" ) ; this . writeFiles ( valueStream , outputWriter ) ; }
public class JsAdminFactoryImpl { @ Override public DestinationDefinition createDestinationDefinition ( DestinationType type , String name ) { } }
return new DestinationDefinitionImpl ( type , name ) ;
public class SwingBindingFactory { /** * Binds the values specified in the collection contained within * < code > selectableItemsHolder < / code > to a { @ link ShuttleList } , with any * user selection being placed in the form property referred to by * < code > selectionFormProperty < / code > . Each item in the list will be * rendered by looking up a property on the item by the name contained in * < code > renderedProperty < / code > , retrieving the value of the property , * and rendering that value in the UI . * Note that the selection in the bound list will track any changes to the * < code > selectionFormProperty < / code > . This is especially useful to * preselect items in the list - if < code > selectionFormProperty < / code > is * not empty when the list is bound , then its content will be used for the * initial selection . * @ param selectionFormProperty form property to hold user ' s selection . This * property must be a < code > Collection < / code > or array type . * @ param selectableItemsHolder < code > ValueModel < / code > containing the * items with which to populate the list . * @ param renderedProperty the property to be queried for each item in the * list , the result of which will be used to render that item in the * UI . May be null , in which case the selectable items will be * rendered as strings . * @ return constructed { @ link Binding } . Note that the bound control is of * type { @ link ShuttleList } . Access this component to set specific * display properties . */ public Binding createBoundShuttleList ( String selectionFormProperty , ValueModel selectableItemsHolder , String renderedProperty ) { } }
Map context = ShuttleListBinder . createBindingContext ( getFormModel ( ) , selectionFormProperty , selectableItemsHolder , renderedProperty ) ; return createBinding ( ShuttleList . class , selectionFormProperty , context ) ;
public class JSMinPostProcessor { /** * Convert a byte array to a String buffer taking into account the charset * @ param charset * the charset * @ param minified * the byte array * @ return the string buffer * @ throws IOException * if an IO exception occurs */ private StringBuffer byteArrayToString ( Charset charset , byte [ ] minified ) throws IOException { } }
// Write the data into a string ReadableByteChannel chan = Channels . newChannel ( new ByteArrayInputStream ( minified ) ) ; Reader rd = Channels . newReader ( chan , charset . newDecoder ( ) , - 1 ) ; StringWriter writer = new StringWriter ( ) ; IOUtils . copy ( rd , writer , true ) ; return writer . getBuffer ( ) ;
public class SeMetricName { /** * { @ inheritDoc } */ @ Override public Metadata metadataOf ( AnnotatedMember < ? > member , Class < ? > type ) { } }
String name = of ( member ) ; return metadataOf ( member , name , type ) ;
public class TransformerFactoryImpl { /** * Allows the user to retrieve specific attributes on the underlying * implementation . * @ param name The name of the attribute . * @ return value The value of the attribute . * @ throws IllegalArgumentException thrown if the underlying * implementation doesn ' t recognize the attribute . */ public Object getAttribute ( String name ) throws IllegalArgumentException { } }
if ( name . equals ( FEATURE_INCREMENTAL ) ) { return new Boolean ( m_incremental ) ; } else if ( name . equals ( FEATURE_OPTIMIZE ) ) { return new Boolean ( m_optimize ) ; } else if ( name . equals ( FEATURE_SOURCE_LOCATION ) ) { return new Boolean ( m_source_location ) ; } else throw new IllegalArgumentException ( XSLMessages . createMessage ( XSLTErrorResources . ER_ATTRIB_VALUE_NOT_RECOGNIZED , new Object [ ] { name } ) ) ; // name + " attribute not recognized " ) ;
public class Ifc2x3tc1FactoryImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public IfcBoilerTypeEnum createIfcBoilerTypeEnumFromString ( EDataType eDataType , String initialValue ) { } }
IfcBoilerTypeEnum result = IfcBoilerTypeEnum . get ( initialValue ) ; if ( result == null ) throw new IllegalArgumentException ( "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType . getName ( ) + "'" ) ; return result ;
public class PropertiesManagerCore { /** * Remove the extension from a specified GeoPackage * @ param geoPackage * GeoPackage name */ public void removeExtension ( String geoPackage ) { } }
PropertiesCoreExtension < T , ? , ? , ? > properties = propertiesMap . get ( geoPackage ) ; if ( properties != null ) { properties . removeExtension ( ) ; }
public class CmsProjectDriver { /** * Checks if the given resource ( by id ) is available in the online project , * if there exists a resource with a different path ( a moved file ) , then the * online entry is moved to the right ( new ) location before publishing . < p > * @ param dbc the db context * @ param onlineProject the online project * @ param offlineResource the offline resource to check * @ param publishHistoryId the publish history id * @ param publishTag the publish tag * @ return < code > true < / code > if the resource has actually been moved * @ throws CmsDataAccessException if something goes wrong */ protected CmsResourceState fixMovedResource ( CmsDbContext dbc , CmsProject onlineProject , CmsResource offlineResource , CmsUUID publishHistoryId , int publishTag ) throws CmsDataAccessException { } }
CmsResource onlineResource ; // check if the resource has been moved since last publishing try { onlineResource = m_driverManager . getVfsDriver ( dbc ) . readResource ( dbc , onlineProject . getUuid ( ) , offlineResource . getStructureId ( ) , true ) ; if ( onlineResource . getRootPath ( ) . equals ( offlineResource . getRootPath ( ) ) ) { // resource changed , not moved return offlineResource . getState ( ) ; } } catch ( CmsVfsResourceNotFoundException e ) { // ok , resource new , not moved return offlineResource . getState ( ) ; } // move the online resource to the new position m_driverManager . getVfsDriver ( dbc ) . moveResource ( dbc , onlineProject . getUuid ( ) , onlineResource , offlineResource . getRootPath ( ) ) ; try { // write the resource to the publish history m_driverManager . getProjectDriver ( dbc ) . writePublishHistory ( dbc , publishHistoryId , new CmsPublishedResource ( onlineResource , publishTag , CmsPublishedResource . STATE_MOVED_SOURCE ) ) ; } catch ( CmsDataAccessException e ) { if ( LOG . isErrorEnabled ( ) ) { LOG . error ( Messages . get ( ) . getBundle ( ) . key ( Messages . LOG_WRITING_PUBLISHING_HISTORY_1 , onlineResource . getRootPath ( ) ) , e ) ; } throw e ; } return offlineResource . getState ( ) . isDeleted ( ) ? CmsResource . STATE_DELETED : CmsPublishedResource . STATE_MOVED_DESTINATION ;
public class IOUtil { /** * The { @ code buf } size limits the size of the message that must be read . * A ProtobufException ( sizeLimitExceeded ) will be thrown if the * size of the delimited message is larger . */ static int mergeDelimitedFrom ( InputStream in , byte [ ] buf , Object message , Schema schema , boolean decodeNestedMessageAsGroup ) throws IOException { } }
final int size = in . read ( ) ; if ( size == - 1 ) throw new EOFException ( "mergeDelimitedFrom" ) ; final int len = size < 0x80 ? size : CodedInput . readRawVarint32 ( in , size ) ; if ( len < 0 ) throw ProtobufException . negativeSize ( ) ; if ( len != 0 ) { // not an empty message if ( len > buf . length ) { // size limit exceeded . throw new ProtobufException ( "size limit exceeded. " + len + " > " + buf . length ) ; } fillBufferFrom ( in , buf , 0 , len ) ; final ByteArrayInput input = new ByteArrayInput ( buf , 0 , len , decodeNestedMessageAsGroup ) ; try { schema . mergeFrom ( input , message ) ; } catch ( ArrayIndexOutOfBoundsException e ) { throw ProtobufException . truncatedMessage ( e ) ; } input . checkLastTagWas ( 0 ) ; } return len ;
public class Model { /** * Update model . */ public boolean update ( ) { } }
filter ( FILTER_BY_UPDATE ) ; if ( _getModifyFlag ( ) . isEmpty ( ) ) { return false ; } Table table = _getTable ( ) ; String [ ] pKeys = table . getPrimaryKey ( ) ; for ( String pKey : pKeys ) { Object id = attrs . get ( pKey ) ; if ( id == null ) throw new ActiveRecordException ( "You can't update model without Primary Key, " + pKey + " can not be null." ) ; } Config config = _getConfig ( ) ; StringBuilder sql = new StringBuilder ( ) ; List < Object > paras = new ArrayList < Object > ( ) ; config . dialect . forModelUpdate ( table , attrs , _getModifyFlag ( ) , sql , paras ) ; if ( paras . size ( ) <= 1 ) { // Needn ' t update return false ; } Connection conn = null ; try { conn = config . getConnection ( ) ; int result = Db . update ( config , conn , sql . toString ( ) , paras . toArray ( ) ) ; if ( result >= 1 ) { _getModifyFlag ( ) . clear ( ) ; return true ; } return false ; } catch ( Exception e ) { throw new ActiveRecordException ( e ) ; } finally { config . close ( conn ) ; }
public class StreamName { /** * stuck with it , this is just a hack to work around that . */ private int compareKinds ( Kind kind1 , Kind kind2 ) { } }
if ( kind1 == Kind . LENGTH && kind2 == Kind . DATA ) { return - 1 ; } if ( kind1 == Kind . DATA && kind2 == Kind . LENGTH ) { return 1 ; } return kind1 . compareTo ( kind2 ) ;
public class MappingsManager { /** * Transform the full qualified name of { @ code clazz } by applying the rules * on namespace / package mappings . The mappings on the class name is not * applied here . Does not work on inner class . * @ param clazz * the class to get namespace from . * @ return the associate namespace associate to { @ code clazz } . */ private List < String > getNamespaceMapping ( Class < ? > clazz ) { } }
int bestScore = 0 ; String bestNamespace = clazz . getName ( ) . replaceAll ( "\\." , "::" ) ; for ( Namespace namespace : mappings . getNamespaces ( ) ) { if ( namespace . getJavaPackage ( ) . length ( ) > bestScore && clazz . getName ( ) . matches ( namespace . getJavaPackage ( ) ) ) { bestScore = namespace . getJavaPackage ( ) . length ( ) ; bestNamespace = Utils . isNullOrEmpty ( namespace . getNamespace ( ) ) ? clazz . getSimpleName ( ) : String . format ( "%s::%s" , namespace . getNamespace ( ) , clazz . getSimpleName ( ) ) ; } } return Arrays . asList ( bestNamespace . split ( "::" ) ) ;
public class InterfaceExtractor { /** * Extract the fixed interface for a class and a type descriptor with more details on the methods . * @ param classbytes bytes for the class which is going through interface extraction * @ param registry type registry related to the classloader for this class * @ param typeDescriptor previously extracted type descriptor for the class * @ return class bytes for extracted interface */ public static byte [ ] extract ( byte [ ] classbytes , TypeRegistry registry , TypeDescriptor typeDescriptor ) { } }
return new InterfaceExtractor ( registry ) . extract ( classbytes , typeDescriptor ) ;
public class KeyIgnoringVCFOutputFormat { /** * Allows wrappers to provide their own work file . */ public RecordWriter < K , VariantContextWritable > getRecordWriter ( TaskAttemptContext ctx , Path out ) throws IOException { } }
if ( this . header == null ) throw new IOException ( "Can't create a RecordWriter without the VCF header" ) ; final boolean wh = ctx . getConfiguration ( ) . getBoolean ( WRITE_HEADER_PROPERTY , true ) ; switch ( format ) { case BCF : return new KeyIgnoringBCFRecordWriter < K > ( out , header , wh , ctx ) ; case VCF : return new KeyIgnoringVCFRecordWriter < K > ( out , header , wh , ctx ) ; default : assert false ; return null ; }
public class AmqpArguments { /** * Returns a list of AmqpTableEntry objects that matches the specified key . * If a null key is passed in , then a null is returned . Also , if the internal * structure is null , then a null is returned . * @ param key name of the entry * @ return List < AmqpTableEntry > object with matching key */ public List < AmqpTableEntry > getEntries ( String key ) { } }
if ( ( key == null ) || ( tableEntryArray == null ) ) { return null ; } List < AmqpTableEntry > entries = new ArrayList < AmqpTableEntry > ( ) ; for ( AmqpTableEntry entry : tableEntryArray ) { if ( entry . key . equals ( key ) ) { entries . add ( entry ) ; } } return entries ;
public class DateBetween { /** * 计算两个日期相差月数 < br > * 在非重置情况下 , 如果起始日期的天小于结束日期的天 , 月数要少算1 ( 不足1个月 ) * @ param isReset 是否重置时间为起始时间 ( 重置天时分秒 ) * @ return 相差月数 * @ since 3.0.8 */ public long betweenMonth ( boolean isReset ) { } }
final Calendar beginCal = DateUtil . calendar ( begin ) ; final Calendar endCal = DateUtil . calendar ( end ) ; final int betweenYear = endCal . get ( Calendar . YEAR ) - beginCal . get ( Calendar . YEAR ) ; final int betweenMonthOfYear = endCal . get ( Calendar . MONTH ) - beginCal . get ( Calendar . MONTH ) ; int result = betweenYear * 12 + betweenMonthOfYear ; if ( false == isReset ) { endCal . set ( Calendar . YEAR , beginCal . get ( Calendar . YEAR ) ) ; endCal . set ( Calendar . MONTH , beginCal . get ( Calendar . MONTH ) ) ; long between = endCal . getTimeInMillis ( ) - beginCal . getTimeInMillis ( ) ; if ( between < 0 ) { return result - 1 ; } } return result ;
public class MtasToken { /** * Creates the automaton map . * @ param prefix the prefix * @ param valueList the value list * @ param filter the filter * @ return the map */ public static Map < String , Automaton > createAutomatonMap ( String prefix , List < String > valueList , Boolean filter ) { } }
HashMap < String , Automaton > automatonMap = new HashMap < > ( ) ; if ( valueList != null ) { for ( String item : valueList ) { if ( filter ) { item = item . replaceAll ( "([\\\"\\)\\(\\<\\>\\.\\@\\#\\]\\[\\{\\}])" , "\\\\$1" ) ; } automatonMap . put ( item , new RegExp ( prefix + MtasToken . DELIMITER + item + "\u0000*" ) . toAutomaton ( ) ) ; } } return automatonMap ;
public class OMVRBTreeRIDEntryProvider { /** * Lazy unmarshall the RID if not in memory . */ public OIdentifiable getKeyAt ( final int iIndex ) { } }
if ( rids != null && rids [ iIndex ] != null ) return rids [ iIndex ] ; final ORecordId rid = itemFromStream ( iIndex ) ; if ( rids != null ) rids [ iIndex ] = rid ; return rid ;
public class ConfigurationBuilder { /** * Create an immutable Configuration instance . * @ return Configuration Immutable configuration instance . */ public Configuration build ( ) { } }
if ( configuration . connector == null || configuration . address == null ) { throw new IllegalArgumentException ( "You must call either withRemoteSocket or withSerialPort." ) ; } return configuration ;
public class Document { /** * Adds the subject to a Document . * @ param subject * the subject * @ return < CODE > true < / CODE > if successful , < CODE > false < / CODE > otherwise */ public boolean addSubject ( String subject ) { } }
try { return add ( new Meta ( Element . SUBJECT , subject ) ) ; } catch ( DocumentException de ) { throw new ExceptionConverter ( de ) ; }
public class ImplEnhanceFilter_MT { /** * Handle outside image pixels by extending the image . */ public static float safeGet ( GrayF32 input , int x , int y ) { } }
if ( x < 0 ) x = 0 ; else if ( x >= input . width ) x = input . width - 1 ; if ( y < 0 ) y = 0 ; else if ( y >= input . height ) y = input . height - 1 ; return input . unsafe_get ( x , y ) ;
public class snmpmanager { /** * Use this API to add snmpmanager resources . */ public static base_responses add ( nitro_service client , snmpmanager resources [ ] ) throws Exception { } }
base_responses result = null ; if ( resources != null && resources . length > 0 ) { snmpmanager addresources [ ] = new snmpmanager [ resources . length ] ; for ( int i = 0 ; i < resources . length ; i ++ ) { addresources [ i ] = new snmpmanager ( ) ; addresources [ i ] . ipaddress = resources [ i ] . ipaddress ; addresources [ i ] . netmask = resources [ i ] . netmask ; addresources [ i ] . domainresolveretry = resources [ i ] . domainresolveretry ; } result = add_bulk_request ( client , addresources ) ; } return result ;
public class Signature { /** * FormalTypeParameters : * < FormalTypeParameter + > * @ param clazz * @ return */ private static void formalTypeParameters ( Result sb , List < ? extends TypeParameterElement > typeParameters ) throws IOException { } }
if ( ! typeParameters . isEmpty ( ) ) { sb . setNeedsSignature ( true ) ; sb . append ( '<' ) ; for ( TypeParameterElement typeParameter : typeParameters ) { formalTypeParameter ( sb , typeParameter ) ; } sb . append ( '>' ) ; }
public class DocumentViewContentExporter { /** * ( non - Javadoc ) * @ see * org . exoplatform . services . jcr . dataflow . ItemDataTraversingVisitor # leaving ( org . exoplatform . services * . jcr . datamodel . NodeData , int ) */ protected void leaving ( NodeData node , int level ) throws RepositoryException { } }
try { if ( ! node . getQPath ( ) . getName ( ) . equals ( Constants . JCR_XMLTEXT ) ) { if ( Constants . ROOT_PATH . equals ( node . getQPath ( ) ) ) contentHandler . endElement ( Constants . NS_JCR_URI , Constants . NS_JCR_PREFIX , JCR_ROOT ) ; else contentHandler . endElement ( node . getQPath ( ) . getName ( ) . getNamespace ( ) , node . getQPath ( ) . getName ( ) . getName ( ) , getExportName ( node , true ) ) ; } } catch ( SAXException e ) { throw new RepositoryException ( e ) ; }
public class ServiceEndpointPolicyDefinitionsInner { /** * Creates or updates a service endpoint policy definition in the specified service endpoint policy . * @ param resourceGroupName The name of the resource group . * @ param serviceEndpointPolicyName The name of the service endpoint policy . * @ param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition name . * @ param serviceEndpointPolicyDefinitions Parameters supplied to the create or update service endpoint policy operation . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the ServiceEndpointPolicyDefinitionInner object */ public Observable < ServiceEndpointPolicyDefinitionInner > beginCreateOrUpdateAsync ( String resourceGroupName , String serviceEndpointPolicyName , String serviceEndpointPolicyDefinitionName , ServiceEndpointPolicyDefinitionInner serviceEndpointPolicyDefinitions ) { } }
return beginCreateOrUpdateWithServiceResponseAsync ( resourceGroupName , serviceEndpointPolicyName , serviceEndpointPolicyDefinitionName , serviceEndpointPolicyDefinitions ) . map ( new Func1 < ServiceResponse < ServiceEndpointPolicyDefinitionInner > , ServiceEndpointPolicyDefinitionInner > ( ) { @ Override public ServiceEndpointPolicyDefinitionInner call ( ServiceResponse < ServiceEndpointPolicyDefinitionInner > response ) { return response . body ( ) ; } } ) ;
public class JulianChronology { /** * Serialization singleton */ private Object readResolve ( ) { } }
Chronology base = getBase ( ) ; int minDays = getMinimumDaysInFirstWeek ( ) ; minDays = ( minDays == 0 ? 4 : minDays ) ; // handle rename of BaseGJChronology return base == null ? getInstance ( DateTimeZone . UTC , minDays ) : getInstance ( base . getZone ( ) , minDays ) ;
public class XML { /** * Try to convert a string into a number , boolean , or null . If the string * can ' t be converted , return the string . This is much less ambitious than * JSONObject . stringToValue , especially because it does not attempt to * convert plus forms , octal forms , hex forms , or E forms lacking decimal * points . * @ param string A String . * @ return A simple JSON value . */ public static Object stringToValue ( String string ) { } }
if ( "true" . equalsIgnoreCase ( string ) ) { return Boolean . TRUE ; } if ( "false" . equalsIgnoreCase ( string ) ) { return Boolean . FALSE ; } if ( "null" . equalsIgnoreCase ( string ) ) { return JSONObject . NULL ; } // If it might be a number , try converting it , first as a Long , and then as a // Double . If that doesn ' t work , return the string . try { char initial = string . charAt ( 0 ) ; if ( initial == '-' || ( initial >= '0' && initial <= '9' ) ) { Long value = new Long ( string ) ; if ( value . toString ( ) . equals ( string ) ) { return value ; } } } catch ( Exception ignore ) { try { Double value = new Double ( string ) ; if ( value . toString ( ) . equals ( string ) ) { return value ; } } catch ( Exception ignoreAlso ) { } } return string ;
public class ResourceFactoryTrackerData { /** * Gets an array of resource service properties from a { @ link ResourceFactory } service reference . * @ param ref a ResourceFactory service reference * @ return service properties */ private Dictionary < String , Object > getServiceProperties ( ServiceReference < ResourceFactory > ref ) { } }
String [ ] keys = ref . getPropertyKeys ( ) ; Dictionary < String , Object > properties = new Hashtable < String , Object > ( keys . length ) ; for ( String key : keys ) { if ( ! key . equals ( ResourceFactory . JNDI_NAME ) && ! key . equals ( ResourceFactory . CREATES_OBJECT_CLASS ) ) { properties . put ( key , ref . getProperty ( key ) ) ; } } properties . put ( ResourceFactory . class . getName ( ) , "true" ) ; properties . put ( JNDI_SERVICENAME , ref . getProperty ( ResourceFactory . JNDI_NAME ) ) ; return properties ;
public class CloudHarmonySPECint { /** * Gets the SPECint of the specified instance of the specified offerings provider * @ param providerName the name of the offerings provider * @ param instanceType istance type as specified in the CloudHarmony API * @ return SPECint of the specified instance */ public static Integer getSPECint ( String providerName , String instanceType ) { } }
String key = providerName + "." + instanceType ; return SPECint . get ( key ) ;
public class Section { /** * This method will process the section in the context of the Template * @ return returns the integer code doEndTag ( ) will return . */ private int processTemplate ( ) { } }
ServletRequest req = pageContext . getRequest ( ) ; Template . TemplateContext tc = ( Template . TemplateContext ) req . getAttribute ( TEMPLATE_SECTIONS ) ; if ( tc . secs == null ) { tc . secs = new HashMap ( ) ; } assert ( tc . secs != null ) ; if ( ! _visible ) { // set the section so that it doesn ' t contain anything tc . secs . put ( _name , "" ) ; localRelease ( ) ; return EVAL_PAGE ; } if ( hasErrors ( ) ) { String s = getErrorsReport ( ) ; tc . secs . put ( _name , s ) ; localRelease ( ) ; return EVAL_PAGE ; } BodyContent bc = getBodyContent ( ) ; String content = ( bc != null ) ? bc . getString ( ) : "" ; tc . secs . put ( _name , content ) ; localRelease ( ) ; return EVAL_PAGE ;
public class LoadProperties { /** * Loads in the properties file * @ param props Properties being loaded from the file * @ param file File declartion that is being used * @ throws java . io . IOException IOException is thrown */ public static void loadProps ( Properties props , File file ) throws IOException { } }
FileInputStream fis = null ; try { fis = new FileInputStream ( file ) ; props . load ( fis ) ; } finally { if ( null != fis ) { fis . close ( ) ; } }
public class JSONComposer { /** * Method to call to complete composition , flush any pending content , * and return instance of specified result type . */ @ SuppressWarnings ( "unchecked" ) public T finish ( ) throws IOException { } }
if ( _open ) { _closeChild ( ) ; _open = false ; if ( _closeGenerator ) { _generator . close ( ) ; } else if ( Feature . FLUSH_AFTER_WRITE_VALUE . isEnabled ( _features ) ) { _generator . flush ( ) ; } } if ( _result == null ) { Object x ; if ( _stringWriter != null ) { x = _stringWriter . getAndClear ( ) ; _stringWriter = null ; } else if ( _byteWriter != null ) { x = _byteWriter . toByteArray ( ) ; _byteWriter = null ; } else { x = _generator . getOutputTarget ( ) ; } _result = ( T ) x ; } return _result ;
public class RtfParser { /** * Imports a complete RTF document . * @ param readerIn * The Reader to read the RTF document from . * @ param rtfDoc * The RtfDocument to add the imported document to . * @ throws IOException On I / O errors . * @ since 2.1.3 */ public void importRtfDocument ( InputStream readerIn , RtfDocument rtfDoc ) throws IOException { } }
if ( readerIn == null || rtfDoc == null ) return ; this . init ( TYPE_IMPORT_FULL , rtfDoc , readerIn , this . document , null ) ; this . setCurrentDestination ( RtfDestinationMgr . DESTINATION_NULL ) ; this . groupLevel = 0 ; try { this . tokenise ( ) ; } catch ( RuntimeException e ) { // TODO Auto - generated catch block e . printStackTrace ( ) ; } catch ( Exception e ) { // TODO Auto - generated catch block e . printStackTrace ( ) ; }
public class Pubsub { /** * Acknowledge a batch of received messages . * @ param project The Google Cloud project . * @ param subscription The subscription to acknowledge messages on . * @ param ackIds List of message ID ' s to acknowledge . * @ return A future that is completed when this request is completed . */ public PubsubFuture < Void > acknowledge ( final String project , final String subscription , final String ... ackIds ) { } }
return acknowledge ( project , subscription , asList ( ackIds ) ) ;
public class Bean { /** * Creates { @ link Session } instance , connected to the database . * @ throws NamingException * @ throws SQLException */ protected Session createSession ( ) throws Exception { } }
Config config = configBean . getConfig ( ) ; DataSource dataSource = InitialContext . doLookup ( config . getDataSourceJNDI ( ) ) ; return new Session ( dataSource , config . getDialect ( ) ) ;
public class Command { /** * Get the { @ link ApplicationDefinition } for the given application name . If the * connected Doradus server has no such application defined , null is returned . * @ param appName Application name . * @ return Application ' s { @ link ApplicationDefinition } , if it exists , * otherwise null . */ public static ApplicationDefinition getAppDef ( RESTClient restClient , String appName ) { } }
// GET / _ applications / { application } Utils . require ( ! restClient . isClosed ( ) , "Client has been closed" ) ; Utils . require ( appName != null && appName . length ( ) > 0 , "appName" ) ; try { StringBuilder uri = new StringBuilder ( Utils . isEmpty ( restClient . getApiPrefix ( ) ) ? "" : "/" + restClient . getApiPrefix ( ) ) ; uri . append ( "/_applications/" ) ; uri . append ( Utils . urlEncode ( appName ) ) ; RESTResponse response = restClient . sendRequest ( HttpMethod . GET , uri . toString ( ) ) ; logger . debug ( "listApplication() response: {}" , response . toString ( ) ) ; if ( response . getCode ( ) == HttpCode . NOT_FOUND ) { return null ; } ApplicationDefinition appDef = new ApplicationDefinition ( ) ; appDef . parse ( getUNodeResult ( response ) ) ; return appDef ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; }
public class SqlServerParser { /** * 复制 OrderByElement * @ param orig 原 OrderByElement * @ param alias 新 OrderByElement 的排序要素 * @ return 复制的新 OrderByElement */ protected OrderByElement cloneOrderByElement ( OrderByElement orig , String alias ) { } }
return cloneOrderByElement ( orig , new Column ( alias ) ) ;
public class BpmPlatformXmlParse { /** * parse a < code > & lt ; job - acquisition . . . / & gt ; < / code > element and add it to the * list of parsed elements */ protected void parseJobAcquisition ( Element element , List < JobAcquisitionXml > jobAcquisitions ) { } }
JobAcquisitionXmlImpl jobAcquisition = new JobAcquisitionXmlImpl ( ) ; // set name jobAcquisition . setName ( element . attribute ( NAME ) ) ; Map < String , String > properties = new HashMap < String , String > ( ) ; for ( Element childElement : element . elements ( ) ) { if ( JOB_EXECUTOR_CLASS_NAME . equals ( childElement . getTagName ( ) ) ) { jobAcquisition . setJobExecutorClassName ( childElement . getText ( ) ) ; } else if ( PROPERTIES . equals ( childElement . getTagName ( ) ) ) { parseProperties ( childElement , properties ) ; } } // set collected properties jobAcquisition . setProperties ( properties ) ; // add to list jobAcquisitions . add ( jobAcquisition ) ;
public class AdapterUtil { /** * This method returns the Level based on a string representation fo the level * possbile values are : < br > * ALL < br > * SEVERE ( highest value ) < br > * WARNING < br > * INFO < br > * CONFIG < br > * FINE < br > * FINER < br > * FINEST ( lowest value ) < br > */ public static Level getLevelBasedOnName ( String level ) { } }
Level _level = Level . INFO ; // default if ( level == null ) return _level ; // default is all char firstLetter = level . charAt ( 0 ) ; switch ( firstLetter ) { case 'i' : case 'I' : _level = Level . INFO ; break ; case 'A' : case 'a' : _level = Level . ALL ; break ; case 's' : case 'S' : _level = Level . SEVERE ; break ; case 'w' : case 'W' : _level = Level . WARNING ; break ; case 'c' : case 'C' : _level = Level . CONFIG ; break ; case 'f' : case 'F' : // now here i will match the whole word if ( level . equalsIgnoreCase ( "fine" ) ) _level = Level . FINE ; if ( level . equalsIgnoreCase ( "finer" ) ) _level = Level . FINER ; if ( level . equalsIgnoreCase ( "finest" ) ) _level = Level . FINEST ; break ; default : break ; } if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "The level returned is: " , _level ) ; return _level ;
public class Cache { /** * lookup without stats */ public synchronized V probe ( K key ) { } }
Item < V > item ; item = items . get ( key ) ; return item == null ? null : item . value ;
public class ListUsersInGroupResult { /** * The users returned in the request to list users . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setUsers ( java . util . Collection ) } or { @ link # withUsers ( java . util . Collection ) } if you want to override the * existing values . * @ param users * The users returned in the request to list users . * @ return Returns a reference to this object so that method calls can be chained together . */ public ListUsersInGroupResult withUsers ( UserType ... users ) { } }
if ( this . users == null ) { setUsers ( new java . util . ArrayList < UserType > ( users . length ) ) ; } for ( UserType ele : users ) { this . users . add ( ele ) ; } return this ;
public class CmsLogout { /** * Returns the context menu command according to * { @ link org . opencms . gwt . client . ui . contextmenu . I _ CmsHasContextMenuCommand } . < p > * @ return the context menu command */ public static I_CmsContextMenuCommand getContextMenuCommand ( ) { } }
return new I_CmsContextMenuCommand ( ) { public void execute ( CmsUUID structureId , final I_CmsContextMenuHandler handler , CmsContextMenuEntryBean bean ) { CmsConfirmDialog dialog = new CmsConfirmDialog ( Messages . get ( ) . key ( Messages . GUI_DIALOG_LOGOUT_TITLE_0 ) , Messages . get ( ) . key ( Messages . GUI_DIALOG_LOGOUT_TEXT_0 ) ) ; dialog . setOkText ( Messages . get ( ) . key ( Messages . GUI_YES_0 ) ) ; dialog . setCloseText ( Messages . get ( ) . key ( Messages . GUI_NO_0 ) ) ; dialog . setHandler ( new I_CmsConfirmDialogHandler ( ) { public void onClose ( ) { // nothing to do } public void onOk ( ) { String logoutTarget = CmsCoreProvider . get ( ) . link ( CmsCoreProvider . get ( ) . getLoginURL ( ) ) + "?logout=true" ; handler . leavePage ( logoutTarget ) ; } } ) ; dialog . center ( ) ; } public A_CmsContextMenuItem getItemWidget ( CmsUUID structureId , I_CmsContextMenuHandler handler , CmsContextMenuEntryBean bean ) { return null ; } public boolean hasItemWidget ( ) { return false ; } } ;
public class EigenValueDecomposition { /** * Symmetric Householder reduction to tridiagonal form . */ private void tred2 ( ) { } }
for ( int j = 0 ; j < n ; j ++ ) d [ j ] = V . get ( n - 1 , j ) ; // Householder reduction to tridiagonal form . for ( int i = n - 1 ; i > 0 ; i -- ) { // Scale to avoid under / overflow . double scale = 0.0 ; double h = 0.0 ; for ( int k = 0 ; k < i ; k ++ ) { scale = scale + abs ( d [ k ] ) ; } if ( scale == 0.0 ) { e [ i ] = d [ i - 1 ] ; for ( int j = 0 ; j < i ; j ++ ) { d [ j ] = V . get ( i - 1 , j ) ; V . set ( i , j , 0.0 ) ; V . set ( j , i , 0.0 ) ; } } else { // Generate Householder vector . for ( int k = 0 ; k < i ; k ++ ) { d [ k ] /= scale ; h += d [ k ] * d [ k ] ; } double f = d [ i - 1 ] ; double g = sqrt ( h ) ; if ( f > 0 ) g = - g ; e [ i ] = scale * g ; h -= f * g ; d [ i - 1 ] = f - g ; Arrays . fill ( e , 0 , i , 0.0 ) ; // Apply similarity transformation to remaining columns . for ( int j = 0 ; j < i ; j ++ ) { f = d [ j ] ; V . set ( j , i , f ) ; g = e [ j ] + V . get ( j , j ) * f ; for ( int k = j + 1 ; k <= i - 1 ; k ++ ) { g += V . get ( k , j ) * d [ k ] ; e [ k ] += V . get ( k , j ) * f ; } e [ j ] = g ; } f = 0.0 ; for ( int j = 0 ; j < i ; j ++ ) { e [ j ] /= h ; f += e [ j ] * d [ j ] ; } double hh = f / ( h + h ) ; for ( int j = 0 ; j < i ; j ++ ) { e [ j ] -= hh * d [ j ] ; } for ( int j = 0 ; j < i ; j ++ ) { f = d [ j ] ; g = e [ j ] ; for ( int k = j ; k <= i - 1 ; k ++ ) { V . increment ( k , j , - ( f * e [ k ] + g * d [ k ] ) ) ; } d [ j ] = V . get ( i - 1 , j ) ; V . set ( i , j , 0.0 ) ; } } d [ i ] = h ; } // Accumulate transformations . for ( int i = 0 ; i < n - 1 ; i ++ ) { V . set ( n - 1 , i , V . get ( i , i ) ) ; V . set ( i , i , 1.0 ) ; double h = d [ i + 1 ] ; if ( h != 0.0 ) { for ( int k = 0 ; k <= i ; k ++ ) { d [ k ] = V . get ( k , i + 1 ) / h ; } for ( int j = 0 ; j <= i ; j ++ ) { double g = 0.0 ; for ( int k = 0 ; k <= i ; k ++ ) { g += V . get ( k , i + 1 ) * V . get ( k , j ) ; } RowColumnOps . addMultCol ( V , j , 0 , i + 1 , - g , d ) ; } } RowColumnOps . fillCol ( V , i + 1 , 0 , i + 1 , 0.0 ) ; } for ( int j = 0 ; j < n ; j ++ ) { d [ j ] = V . get ( n - 1 , j ) ; V . set ( n - 1 , j , 0.0 ) ; } V . set ( n - 1 , n - 1 , 1.0 ) ; e [ 0 ] = 0.0 ;
public class JsMessageVisitor { /** * Initializes a message builder from a FUNCTION node . * < pre > * The tree should look something like : * function * | - - name * | - - lp * | | - - name < arg1 > * | - - name < arg2 > * - - block * - - return * - - add * | - - string foo * - - name < arg1 > * < / pre > * @ param builder the message builder * @ param node the function node that contains a message * @ throws MalformedException if the parsed message is invalid */ private void extractFromFunctionNode ( Builder builder , Node node ) throws MalformedException { } }
Set < String > phNames = new HashSet < > ( ) ; for ( Node fnChild : node . children ( ) ) { switch ( fnChild . getToken ( ) ) { case NAME : // This is okay . The function has a name , but it is empty . break ; case PARAM_LIST : // Parse the placeholder names from the function argument list . for ( Node argumentNode : fnChild . children ( ) ) { if ( argumentNode . isName ( ) ) { String phName = argumentNode . getString ( ) ; if ( phNames . contains ( phName ) ) { throw new MalformedException ( "Duplicate placeholder name: " + phName , argumentNode ) ; } else { phNames . add ( phName ) ; } } } break ; case BLOCK : // Build the message ' s value by examining the return statement Node returnNode = fnChild . getFirstChild ( ) ; if ( ! returnNode . isReturn ( ) ) { throw new MalformedException ( "RETURN node expected; found: " + returnNode . getToken ( ) , returnNode ) ; } for ( Node child : returnNode . children ( ) ) { extractFromReturnDescendant ( builder , child ) ; } // Check that all placeholders from the message text have appropriate // object literal keys for ( String phName : builder . getPlaceholders ( ) ) { if ( ! phNames . contains ( phName ) ) { throw new MalformedException ( "Unrecognized message placeholder referenced: " + phName , returnNode ) ; } } break ; default : throw new MalformedException ( "NAME, PARAM_LIST, or BLOCK node expected; found: " + node , fnChild ) ; } }
public class StochasticLaw { /** * Extract a parameter value from a map of parameters . * @ param paramName is the nameof the parameter to extract . * @ param parameters is the map of available parameters * @ return the extract value * @ throws LawParameterNotFoundException if the parameter was not found or the value is not a double . */ @ Pure protected static boolean paramBoolean ( String paramName , Map < String , String > parameters ) throws LawParameterNotFoundException { } }
final String svalue = parameters . get ( paramName ) ; if ( svalue != null && ! "" . equals ( svalue ) ) { // $ NON - NLS - 1 $ try { return Boolean . parseBoolean ( svalue ) ; } catch ( AssertionError e ) { throw e ; } catch ( Throwable e ) { } } throw new LawParameterNotFoundException ( paramName ) ;
public class PrintStreamOutput { /** * Looks up the format pattern for the event output by key , conventionally * equal to the method name . The pattern is used by the * { # format ( String , String , Object . . . ) } method and by default is formatted * using the { @ link MessageFormat # format ( String , Object . . . ) } method . If no * pattern is found for key or needs to be overridden , the default pattern * should be returned . * @ param key the format pattern key * @ param defaultPattern the default pattern if no pattern is * @ return The format patter for the given key */ protected String lookupPattern ( String key , String defaultPattern ) { } }
if ( outputPatterns . containsKey ( key ) ) { return outputPatterns . getProperty ( key ) ; } return defaultPattern ;
public class FeatureUtilities { /** * Create a featurecollection from a vector of features * @ param features - the vectore of features * @ return the created featurecollection */ public static SimpleFeatureCollection createFeatureCollection ( SimpleFeature ... features ) { } }
DefaultFeatureCollection fcollection = new DefaultFeatureCollection ( ) ; for ( SimpleFeature feature : features ) { fcollection . add ( feature ) ; } return fcollection ;
public class ListDatastreams { /** * Parses an XML based response and removes the items that are not * permitted . * @ param request * the http servlet request * @ param response * the http servlet response * @ return the new response body without non - permissable objects . * @ throws ServletException */ private String filterXML ( HttpServletRequest request , DataResponseWrapper response ) throws ServletException { } }
String body = new String ( response . getData ( ) ) ; DocumentBuilder docBuilder = null ; Document doc = null ; try { DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory . newInstance ( ) ; docBuilderFactory . setNamespaceAware ( true ) ; docBuilder = docBuilderFactory . newDocumentBuilder ( ) ; doc = docBuilder . parse ( new ByteArrayInputStream ( response . getData ( ) ) ) ; } catch ( Exception e ) { throw new ServletException ( e ) ; } XPath xpath = XPathFactory . newInstance ( ) . newXPath ( ) ; String pid = null ; NodeList datastreams = null ; try { pid = xpath . evaluate ( "/objectDatastreams/@pid" , doc ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( "filterXML: pid = [" + pid + "]" ) ; } datastreams = ( NodeList ) xpath . evaluate ( "/objectDatastreams/datastream" , doc , XPathConstants . NODESET ) ; } catch ( XPathExpressionException xpe ) { throw new ServletException ( "Error parsing HTML for search results: " , xpe ) ; } if ( datastreams . getLength ( ) == 0 ) { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "No results to filter." ) ; } return body ; } Map < String , Node > dsids = new HashMap < String , Node > ( ) ; for ( int x = 0 ; x < datastreams . getLength ( ) ; x ++ ) { String dsid = datastreams . item ( x ) . getAttributes ( ) . getNamedItem ( "dsid" ) . getNodeValue ( ) ; dsids . put ( dsid , datastreams . item ( x ) ) ; } Set < Result > results = evaluatePids ( dsids . keySet ( ) , pid , request , response ) ; for ( Result r : results ) { String resource = r . getResource ( ) ; if ( resource == null || resource . isEmpty ( ) ) { logger . warn ( "This resource has no resource identifier in the xacml response results!" ) ; } else if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Checking: " + r . getResource ( ) ) ; } int lastSlash = resource . lastIndexOf ( '/' ) ; String rid = resource . substring ( lastSlash + 1 ) ; if ( r . getStatus ( ) . getCode ( ) . contains ( Status . STATUS_OK ) && r . getDecision ( ) != Result . DECISION_PERMIT ) { Node node = dsids . get ( rid ) ; node . getParentNode ( ) . removeChild ( node ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Removing: " + resource + "[" + rid + "]" ) ; } } } Source src = new DOMSource ( doc ) ; ByteArrayOutputStream os = new ByteArrayOutputStream ( ) ; javax . xml . transform . Result dst = new StreamResult ( os ) ; try { xFormer . transform ( src , dst ) ; } catch ( TransformerException te ) { throw new ServletException ( "error generating output" , te ) ; } return new String ( os . toByteArray ( ) ) ;
public class Validator { /** * Validate Required for urlPara . */ protected void validateRequired ( int index , String errorKey , String errorMessage ) { } }
String value = controller . getPara ( index ) ; if ( value == null /* | | " " . equals ( value ) */ ) { addError ( errorKey , errorMessage ) ; }
public class LFltToIntFunctionBuilder { /** * One of ways of creating builder . This is possibly the least verbose way where compiler should be able to guess the generic parameters . */ @ Nonnull public static LFltToIntFunction fltToIntFunctionFrom ( Consumer < LFltToIntFunctionBuilder > buildingFunction ) { } }
LFltToIntFunctionBuilder builder = new LFltToIntFunctionBuilder ( ) ; buildingFunction . accept ( builder ) ; return builder . build ( ) ;
public class CmsProperty { /** * Transforms a Map of String values into a list of * { @ link CmsProperty } objects with the property name set from the * Map key , and the structure value set from the Map value . < p > * @ param map a Map with String keys and String values * @ return a list of { @ link CmsProperty } objects */ public static List < CmsProperty > toList ( Map < String , String > map ) { } }
if ( ( map == null ) || ( map . size ( ) == 0 ) ) { return Collections . emptyList ( ) ; } List < CmsProperty > result = new ArrayList < CmsProperty > ( map . size ( ) ) ; Iterator < Map . Entry < String , String > > i = map . entrySet ( ) . iterator ( ) ; while ( i . hasNext ( ) ) { Map . Entry < String , String > e = i . next ( ) ; CmsProperty property = new CmsProperty ( e . getKey ( ) , e . getValue ( ) , null ) ; result . add ( property ) ; } return result ;
public class Sanitizers { /** * Checks that the input is part of the name of an innocuous element . */ public static String filterHtmlElementName ( SoyValue value ) { } }
value = normalizeNull ( value ) ; return filterHtmlElementName ( value . coerceToString ( ) ) ;
public class InternalXbaseParser { /** * InternalXbase . g : 1458:1 : entryRuleXTryCatchFinallyExpression : ruleXTryCatchFinallyExpression EOF ; */ public final void entryRuleXTryCatchFinallyExpression ( ) throws RecognitionException { } }
try { // InternalXbase . g : 1459:1 : ( ruleXTryCatchFinallyExpression EOF ) // InternalXbase . g : 1460:1 : ruleXTryCatchFinallyExpression EOF { if ( state . backtracking == 0 ) { before ( grammarAccess . getXTryCatchFinallyExpressionRule ( ) ) ; } pushFollow ( FOLLOW_1 ) ; ruleXTryCatchFinallyExpression ( ) ; state . _fsp -- ; if ( state . failed ) return ; if ( state . backtracking == 0 ) { after ( grammarAccess . getXTryCatchFinallyExpressionRule ( ) ) ; } match ( input , EOF , FOLLOW_2 ) ; if ( state . failed ) return ; } } catch ( RecognitionException re ) { reportError ( re ) ; recover ( input , re ) ; } finally { } return ;
public class CommercePaymentMethodGroupRelWrapper { /** * Returns the localized description of this commerce payment method group rel in the language , optionally using the default language if no localization exists for the requested language . * @ param languageId the ID of the language * @ param useDefault whether to use the default language if no localization exists for the requested language * @ return the localized description of this commerce payment method group rel */ @ Override public String getDescription ( String languageId , boolean useDefault ) { } }
return _commercePaymentMethodGroupRel . getDescription ( languageId , useDefault ) ;
public class HBaseDataHandler { /** * Gets the object from byte array . * @ param entityType * the entity type * @ param value * the value * @ param jpaColumnName * the jpa column name * @ param m * the m * @ return the object from byte array */ private Object getObjectFromByteArray ( EntityType entityType , byte [ ] value , String jpaColumnName , EntityMetadata m ) { } }
if ( jpaColumnName != null ) { String fieldName = m . getFieldName ( jpaColumnName ) ; if ( fieldName != null ) { Attribute attribute = fieldName != null ? entityType . getAttribute ( fieldName ) : null ; EntityMetadata relationMetadata = KunderaMetadataManager . getEntityMetadata ( kunderaMetadata , attribute . getJavaType ( ) ) ; Object colValue = PropertyAccessorHelper . getObject ( relationMetadata . getIdAttribute ( ) . getJavaType ( ) , value ) ; return colValue ; } } logger . warn ( "No value found for column {}, returning null." , jpaColumnName ) ; return null ;
public class JodaBeanReferencingBinReader { /** * reads the input stream */ @ Override < T > T read ( Class < T > rootType ) { } }
try { try { return parseRemaining ( rootType ) ; } finally { input . close ( ) ; } } catch ( RuntimeException ex ) { throw ex ; } catch ( Exception ex ) { throw new RuntimeException ( ex ) ; }
public class InformedArrayList { /** * Extract the upper class that contains all the elements of * this array . * @ param < E > is the type of the list ' s elements . * @ param collection is the collection to scan * @ return the top class of all the elements . */ @ SuppressWarnings ( "unchecked" ) protected static < E > Class < ? extends E > extractClassFrom ( Collection < ? extends E > collection ) { } }
Class < ? extends E > clazz = null ; for ( final E elt : collection ) { clazz = ( Class < ? extends E > ) ReflectionUtil . getCommonType ( clazz , elt . getClass ( ) ) ; } return clazz == null ? ( Class < E > ) Object . class : clazz ;
public class NodeSequence { /** * Create a sequence of nodes that all satisfy the supplied filter . * @ param sequence the original sequence that is to be limited ; may be null * @ param filter the filter to apply to the nodes ; if null this method simply returns < code > sequence < / code > * @ return the sequence of filtered nodes ; never null */ public static NodeSequence filter ( final NodeSequence sequence , final RowFilter filter ) { } }
if ( sequence == null ) return emptySequence ( 0 ) ; if ( filter == null || sequence . isEmpty ( ) ) return sequence ; return new NodeSequence ( ) { @ Override public long getRowCount ( ) { // we don ' t know how the filter affects the row count . . . return - 1 ; } @ Override public int width ( ) { return sequence . width ( ) ; } @ Override public boolean isEmpty ( ) { // not known to be empty , so always return false . . . return false ; } @ Override public Batch nextBatch ( ) { Batch next = sequence . nextBatch ( ) ; return batchFilteredWith ( next , filter ) ; } @ Override public void close ( ) { sequence . close ( ) ; } @ Override public String toString ( ) { return "(filtered width=" + width ( ) + " " + filter + " " + sequence + ")" ; } } ;
public class JBossDetector { /** * { @ inheritDoc } */ public ServerHandle detect ( MBeanServerExecutor pMBeanServerExecutor ) { } }
ServerHandle handle = checkFromJSR77 ( pMBeanServerExecutor ) ; if ( handle == null ) { handle = checkFor5viaJMX ( pMBeanServerExecutor ) ; if ( handle == null ) { handle = checkForManagementRootServerViaJMX ( pMBeanServerExecutor ) ; } if ( handle == null ) { handle = checkForWildflySwarm ( ) ; } if ( handle == null ) { handle = fallbackForVersion7Check ( pMBeanServerExecutor ) ; } } return handle ;
public class TimeBasedAvroWriterPartitioner { /** * Retrieve the value of the partition column field specified by this . partitionColumns */ private Optional < Object > getWriterPartitionColumnValue ( GenericRecord record ) { } }
if ( ! this . partitionColumns . isPresent ( ) ) { return Optional . absent ( ) ; } for ( String partitionColumn : this . partitionColumns . get ( ) ) { Optional < Object > fieldValue = AvroUtils . getFieldValue ( record , partitionColumn ) ; if ( fieldValue . isPresent ( ) ) { return fieldValue ; } } return Optional . absent ( ) ;
public class ClassUtils { /** * 使用默认ClassLoader加载class * @ param className class名字 * @ param < T > class实际类型 * @ return class */ @ SuppressWarnings ( "unchecked" ) public static < T > Class < T > loadClass ( String className ) { } }
return ( Class < T > ) loadClass ( className , getDefaultClassLoader ( ) ) ;
public class OccupantDirector { /** * Deals with all of the processing when an occupant shows up . */ public void entryAdded ( EntryAddedEvent < OccupantInfo > event ) { } }
// bail if this isn ' t for the OCCUPANT _ INFO field if ( ! event . getName ( ) . equals ( PlaceObject . OCCUPANT_INFO ) ) { return ; } // now let the occupant observers know what ' s up final OccupantInfo info = event . getEntry ( ) ; _observers . apply ( new ObserverList . ObserverOp < OccupantObserver > ( ) { public boolean apply ( OccupantObserver observer ) { observer . occupantEntered ( info ) ; return true ; } } ) ;
public class BlurDialogEngine { /** * Must be linked to the original lifecycle . */ @ SuppressLint ( "NewApi" ) public void onDismiss ( ) { } }
// remove blurred background and clear memory , could be null if dismissed before blur effect // processing ends // cancel async task if ( mBluringTask != null ) { mBluringTask . cancel ( true ) ; } if ( mBlurredBackgroundView != null ) { if ( Build . VERSION . SDK_INT >= Build . VERSION_CODES . ICE_CREAM_SANDWICH ) { mBlurredBackgroundView . animate ( ) . alpha ( 0f ) . setDuration ( mAnimationDuration ) . setInterpolator ( new AccelerateInterpolator ( ) ) . setListener ( new AnimatorListenerAdapter ( ) { @ Override public void onAnimationEnd ( Animator animation ) { super . onAnimationEnd ( animation ) ; removeBlurredView ( ) ; } @ Override public void onAnimationCancel ( Animator animation ) { super . onAnimationCancel ( animation ) ; removeBlurredView ( ) ; } } ) . start ( ) ; } else { removeBlurredView ( ) ; } }
public class AccountController { /** * Creation of an account group */ @ RequestMapping ( value = "groups/create" , method = RequestMethod . POST ) public AccountGroup create ( @ RequestBody @ Valid NameDescription nameDescription ) { } }
return accountService . createGroup ( nameDescription ) ;
public class BasicAtomGenerator { /** * Checks a carbon atom to see if it should be shown . * @ param carbonAtom the carbon atom to check * @ param container the atom container * @ param model the renderer model * @ return true if the carbon should be shown */ protected boolean showCarbon ( IAtom carbonAtom , IAtomContainer container , RendererModel model ) { } }
if ( ( Boolean ) model . get ( KekuleStructure . class ) ) return true ; if ( carbonAtom . getFormalCharge ( ) != 0 ) return true ; int connectedBondCount = container . getConnectedBondsList ( carbonAtom ) . size ( ) ; if ( connectedBondCount < 1 ) return true ; if ( ( Boolean ) model . get ( ShowEndCarbons . class ) && connectedBondCount == 1 ) return true ; if ( carbonAtom . getProperty ( ProblemMarker . ERROR_MARKER ) != null ) return true ; if ( container . getConnectedSingleElectronsCount ( carbonAtom ) > 0 ) return true ; return false ;
public class AcpService { /** * 请求报文签名 ( 使用配置文件中配置的私钥证书或者对称密钥签名 ) < br > * 功能 : 对请求报文进行签名 , 并计算赋值certid , signature字段并返回 < br > * @ param reqData 请求报文map < br > * @ param encoding 上送请求报文域encoding字段的值 < br > * @ return 签名后的map对象 < br > */ public static Map < String , String > sign ( Map < String , String > reqData , String encoding ) { } }
reqData = SDKUtil . filterBlank ( reqData ) ; SDKUtil . sign ( reqData , encoding ) ; return reqData ;
public class Artwork { /** * Deserializes an artwork object from a { @ link Bundle } . * @ param bundle Bundle generated by { @ link # toBundle } to deserialize . * @ return the artwork from the given { @ link Bundle } */ @ NonNull public static Artwork fromBundle ( @ NonNull Bundle bundle ) { } }
@ SuppressWarnings ( "WrongConstant" ) // Assume the KEY _ META _ FONT is valid Builder builder = new Builder ( ) . title ( bundle . getString ( KEY_TITLE ) ) . byline ( bundle . getString ( KEY_BYLINE ) ) . attribution ( bundle . getString ( KEY_ATTRIBUTION ) ) . token ( bundle . getString ( KEY_TOKEN ) ) . metaFont ( bundle . getString ( KEY_META_FONT ) ) . dateAdded ( new Date ( bundle . getLong ( KEY_DATE_ADDED , 0 ) ) ) ; String componentName = bundle . getString ( KEY_COMPONENT_NAME ) ; if ( ! TextUtils . isEmpty ( componentName ) ) { builder . componentName ( ComponentName . unflattenFromString ( componentName ) ) ; } String imageUri = bundle . getString ( KEY_IMAGE_URI ) ; if ( ! TextUtils . isEmpty ( imageUri ) ) { builder . imageUri ( Uri . parse ( imageUri ) ) ; } try { String viewIntent = bundle . getString ( KEY_VIEW_INTENT ) ; if ( ! TextUtils . isEmpty ( viewIntent ) ) { builder . viewIntent ( Intent . parseUri ( viewIntent , Intent . URI_INTENT_SCHEME ) ) ; } } catch ( URISyntaxException ignored ) { } return builder . build ( ) ;