signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class SpiceServiceListenerNotifier { /** * Add the request update to the observer message queue . * @ param runnable a runnable to be posted immediatly on the queue . */ protected void post ( Runnable runnable ) { } }
Ln . d ( "Message queue is " + messageQueue ) ; if ( messageQueue == null ) { return ; } messageQueue . postAtTime ( runnable , SystemClock . uptimeMillis ( ) ) ;
public class XLogInfoImpl { /** * Creates a new log info summary with a collection of custom * event classifiers . * @ param log The event log to create an info summary for . * @ param defaultClassifier The default event classifier to be used . * @ param classifiers A collection of additional event classifiers to * be covered by the created log info instance . * @ return The log info summary for this log . */ public static XLogInfo create ( XLog log , XEventClassifier defaultClassifier , Collection < XEventClassifier > classifiers ) { } }
return new XLogInfoImpl ( log , defaultClassifier , classifiers ) ;
public class Times { /** * Determines whether the specified date1 is the same month with the specified date2. * @ param date1 the specified date1 * @ param date2 the specified date2 * @ return { @ code true } if it is the same month , returns { @ code false } otherwise */ public static boolean isSameMonth ( final Date date1 , final Date date2 ) { } }
final Calendar cal1 = Calendar . getInstance ( ) ; cal1 . setTime ( date1 ) ; final Calendar cal2 = Calendar . getInstance ( ) ; cal2 . setTime ( date2 ) ; return cal1 . get ( Calendar . ERA ) == cal2 . get ( Calendar . ERA ) && cal1 . get ( Calendar . YEAR ) == cal2 . get ( Calendar . YEAR ) && cal1 . get ( Calendar . MONTH ) == cal2 . get ( Calendar . MONTH ) ;
public class AbstractResourceAdapterDeployer { /** * Is a support type * @ param t The type * @ return True if supported , otherwise false */ private boolean isSupported ( Class < ? > t ) { } }
if ( Boolean . class . equals ( t ) || boolean . class . equals ( t ) || Byte . class . equals ( t ) || byte . class . equals ( t ) || Short . class . equals ( t ) || short . class . equals ( t ) || Integer . class . equals ( t ) || int . class . equals ( t ) || Long . class . equals ( t ) || long . class . equals ( t ) || Float . class . equals ( t ) || float . class . equals ( t ) || Double . class . equals ( t ) || double . class . equals ( t ) || Character . class . equals ( t ) || char . class . equals ( t ) || String . class . equals ( t ) ) return true ; return false ;
public class JsonReader { /** * Check if the passed input stream can be resembled to valid Json content . * This is accomplished by fully parsing the Json file each time the method is * called . This consumes < b > less memory < / b > than calling any of the * < code > read . . . < / code > methods and checking for a non - < code > null < / code > * result . * @ param aIS * The input stream to use . Is automatically closed . May not be * < code > null < / code > . * @ param aFallbackCharset * The charset to be used in case no BOM is present . May not be * < code > null < / code > . * @ return < code > true < / code > if the Json is valid according to the version , * < code > false < / code > if not */ public static boolean isValidJson ( @ Nonnull @ WillClose final InputStream aIS , @ Nonnull final Charset aFallbackCharset ) { } }
ValueEnforcer . notNull ( aIS , "InputStream" ) ; ValueEnforcer . notNull ( aFallbackCharset , "FallbackCharset" ) ; try { final Reader aReader = CharsetHelper . getReaderByBOM ( aIS , aFallbackCharset ) ; return isValidJson ( aReader ) ; } finally { StreamHelper . close ( aIS ) ; }
public class Widget { /** * Searches the immediate children of { @ link GroupWidget groupWidget } for a * { @ link Widget } with the specified { @ link Widget # getName ( ) name } . * Any non - matching { @ code GroupWidget } children iterated prior to finding a * match will be added to { @ code groupChildren } . If no match is found , all * immediate { @ code GroupWidget } children will be added . * @ param name * The name of the { @ code Widget } to find . * @ param groupWidget * The { @ code GroupWidget } to search . * @ param groupChildren * Output array for non - matching { @ code GroupWidget } children . * @ return The first { @ code Widget } with the specified name or { @ code null } * if no child of { @ code groupWidget } has that name . */ private static Widget findChildByNameInOneGroup ( final String name , final Widget groupWidget , ArrayList < Widget > groupChildren ) { } }
Collection < Widget > children = groupWidget . getChildren ( ) ; for ( Widget child : children ) { if ( child . getName ( ) != null && child . getName ( ) . equals ( name ) ) { return child ; } if ( child instanceof GroupWidget ) { // Save the child for the next level of search if needed . groupChildren . add ( child ) ; } } return null ;
public class DataUtil { /** * little - endian or intel format . */ public static int readIntegerLittleEndian ( byte [ ] buffer , int offset ) { } }
int value ; value = ( buffer [ offset ] & 0xFF ) ; value |= ( buffer [ offset + 1 ] & 0xFF ) << 8 ; value |= ( buffer [ offset + 2 ] & 0xFF ) << 16 ; value |= ( buffer [ offset + 3 ] & 0xFF ) << 24 ; return value ;
public class CommerceAccountUserRelUtil { /** * Returns the first commerce account user rel in the ordered set where commerceAccountId = & # 63 ; . * @ param commerceAccountId the commerce account ID * @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > ) * @ return the first matching commerce account user rel * @ throws NoSuchAccountUserRelException if a matching commerce account user rel could not be found */ public static CommerceAccountUserRel findByCommerceAccountId_First ( long commerceAccountId , OrderByComparator < CommerceAccountUserRel > orderByComparator ) throws com . liferay . commerce . account . exception . NoSuchAccountUserRelException { } }
return getPersistence ( ) . findByCommerceAccountId_First ( commerceAccountId , orderByComparator ) ;
public class Driver { /** * Direct connection , with given | handler | and random URL . * @ param stmtHandler the statement handler * @ param resHandler the resource handler * @ param info Connection properties ( optional ) * @ return the configured connection * @ throws IllegalArgumentException if handler is null */ public static acolyte . jdbc . Connection connection ( final StatementHandler stmtHandler , final ResourceHandler resHandler , final Properties info ) { } }
if ( stmtHandler == null ) { throw new IllegalArgumentException ( "Statement handler" ) ; } // end of if if ( resHandler == null ) { throw new IllegalArgumentException ( "Resource handler" ) ; } // end of if return connection ( new ConnectionHandler . Default ( stmtHandler , resHandler ) , info ) ;
public class DatePickerSettings { /** * setDateRangeLimits , This is a convenience function , for setting a DateVetoPolicy that will * limit the allowed dates in the parent object to a specified minimum and maximum date value . * Calling this function will always replace any existing DateVetoPolicy . * If you only want to limit one side of the date range , then you can pass in " null " for the * other date variable . If you pass in null for both values , then the current veto policy will * be cleared . * Important Note : The DatePicker or independent CalendarPanel associated with this settings * instance is known as the " parent component " . This function can only be called after the * parent component is constructed with this settings instance . If this is called before the * parent is constructed , then an exception will be thrown . For more details , see : * " DatePickerSettings . setVetoPolicy ( ) " . * Return value : It ' s possible to set a veto policy that vetoes the currently selected date . * This function returns true if the selected date is allowed by the new veto policy and the * other current settings , or false if the selected date is vetoed or disallowed . Setting a new * veto policy does not modify the selected date . Is up to the programmer to resolve any * potential conflict between a new veto policy , and the currently selected date . */ public boolean setDateRangeLimits ( LocalDate firstAllowedDate , LocalDate lastAllowedDate ) { } }
if ( ! hasParent ( ) ) { throw new RuntimeException ( "DatePickerSettings.setDateRangeLimits(), " + "A date range limit can only be set after constructing the parent " + "DatePicker or the parent independent CalendarPanel. (The parent component " + "should be constructed using the DatePickerSettings instance where the " + "date range limits will be applied. The previous sentence is probably " + "simpler than it sounds.)" ) ; } if ( firstAllowedDate == null && lastAllowedDate == null ) { return setVetoPolicy ( null ) ; } return setVetoPolicy ( new DateVetoPolicyMinimumMaximumDate ( firstAllowedDate , lastAllowedDate ) ) ;
public class IdcardUtil { /** * 验证10位身份编码是否合法 * @ param idCard 身份编码 * @ return 身份证信息数组 * [ 0 ] - 台湾 、 澳门 、 香港 [ 1 ] - 性别 ( 男M , 女F , 未知N ) [ 2 ] - 是否合法 ( 合法true , 不合法false ) 若不是身份证件号码则返回null */ public static String [ ] isValidCard10 ( String idCard ) { } }
if ( StrUtil . isBlank ( idCard ) ) { return null ; } String [ ] info = new String [ 3 ] ; String card = idCard . replaceAll ( "[\\(|\\)]" , "" ) ; if ( card . length ( ) != 8 && card . length ( ) != 9 && idCard . length ( ) != 10 ) { return null ; } if ( idCard . matches ( "^[a-zA-Z][0-9]{9}$" ) ) { // 台湾 info [ 0 ] = "台湾" ; String char2 = idCard . substring ( 1 , 2 ) ; if ( char2 . equals ( "1" ) ) { info [ 1 ] = "M" ; } else if ( char2 . equals ( "2" ) ) { info [ 1 ] = "F" ; } else { info [ 1 ] = "N" ; info [ 2 ] = "false" ; return info ; } info [ 2 ] = isValidTWCard ( idCard ) ? "true" : "false" ; } else if ( idCard . matches ( "^[1|5|7][0-9]{6}\\(?[0-9A-Z]\\)?$" ) ) { // 澳门 info [ 0 ] = "澳门" ; info [ 1 ] = "N" ; } else if ( idCard . matches ( "^[A-Z]{1,2}[0-9]{6}\\(?[0-9A]\\)?$" ) ) { // 香港 info [ 0 ] = "香港" ; info [ 1 ] = "N" ; info [ 2 ] = isValidHKCard ( idCard ) ? "true" : "false" ; } else { return null ; } return info ;
public class TransportFrameUtil { /** * Returns { @ code true } if { @ code subject } ends with { @ code suffix } . */ private static boolean endsWith ( byte [ ] subject , byte [ ] suffix ) { } }
int start = subject . length - suffix . length ; if ( start < 0 ) { return false ; } for ( int i = start ; i < subject . length ; i ++ ) { if ( subject [ i ] != suffix [ i - start ] ) { return false ; } } return true ;
public class ParametricFactorGraph { /** * Accumulates sufficient statistics ( in { @ code statistics } ) for * estimating a model from { @ code this } family based on a point * distribution at { @ code assignment } . { @ code count } is the number * of times that { @ code assignment } has been observed in the * training data , and acts as a multiplier for the computed * statistics { @ code assignment } must contain a value for all of the * variables in { @ code this . getVariables ( ) } . * @ param statistics * @ param currentParameters * @ param assignment * @ param count */ public void incrementSufficientStatistics ( SufficientStatistics statistics , SufficientStatistics currentParameters , VariableNumMap variables , Assignment assignment , double count ) { } }
incrementSufficientStatistics ( statistics , currentParameters , FactorMarginalSet . fromAssignment ( variables , assignment , 1.0 ) , count ) ;
public class FnObject { /** * Determines whether the result of executing the specified function * on the target object and the specified object parameter are NOT equal * by calling the < tt > equals < / tt > method . * @ param object the object to compare to the target * @ return false if both objects are equal , true if not . */ public static final < X > Function < X , Boolean > notEqBy ( final IFunction < X , ? > by , final Object object ) { } }
return FnFunc . chain ( by , notEq ( object ) ) ;
public class TimestampUtils { /** * Returns the SQL Timestamp object matching the given bytes with { @ link Oid # TIMESTAMP } or * { @ link Oid # TIMESTAMPTZ } . * @ param tz The timezone used when received data is { @ link Oid # TIMESTAMP } , ignored if data * already contains { @ link Oid # TIMESTAMPTZ } . * @ param bytes The binary encoded timestamp value . * @ param timestamptz True if the binary is in GMT . * @ return The parsed timestamp object . * @ throws PSQLException If binary format could not be parsed . */ public Timestamp toTimestampBin ( TimeZone tz , byte [ ] bytes , boolean timestamptz ) throws PSQLException { } }
ParsedBinaryTimestamp parsedTimestamp = this . toParsedTimestampBin ( tz , bytes , timestamptz ) ; if ( parsedTimestamp . infinity == Infinity . POSITIVE ) { return new Timestamp ( PGStatement . DATE_POSITIVE_INFINITY ) ; } else if ( parsedTimestamp . infinity == Infinity . NEGATIVE ) { return new Timestamp ( PGStatement . DATE_NEGATIVE_INFINITY ) ; } Timestamp ts = new Timestamp ( parsedTimestamp . millis ) ; ts . setNanos ( parsedTimestamp . nanos ) ; return ts ;
public class RestApiClient { /** * Update chat room . * @ param chatRoom * the chat room * @ return the response */ public Response updateChatRoom ( MUCRoomEntity chatRoom ) { } }
return restClient . put ( "chatrooms/" + chatRoom . getRoomName ( ) , chatRoom , new HashMap < String , String > ( ) ) ;
public class CommonExpectations { /** * Sets expectations that will check : * < ol > * < li > 200 status code in the response for the specified test action * < li > Response title is equivalent to expected login page title * < / ol > */ public static Expectations successfullyReachedLoginPage ( String testAction ) { } }
Expectations expectations = new Expectations ( ) ; expectations . addSuccessStatusCodesForActions ( new String [ ] { testAction } ) ; expectations . addExpectation ( new ResponseTitleExpectation ( testAction , Constants . STRING_EQUALS , Constants . FORM_LOGIN_TITLE , "Title of page returned during test step " + testAction + " did not match expected value." ) ) ; return expectations ;
public class AmazonEC2Client { /** * Creates a VPC with the specified IPv4 CIDR block . The smallest VPC you can create uses a / 28 netmask ( 16 IPv4 * addresses ) , and the largest uses a / 16 netmask ( 65,536 IPv4 addresses ) . For more information about how large to * make your VPC , see < a href = " https : / / docs . aws . amazon . com / AmazonVPC / latest / UserGuide / VPC _ Subnets . html " > Your VPC and * Subnets < / a > in the < i > Amazon Virtual Private Cloud User Guide < / i > . * You can optionally request an Amazon - provided IPv6 CIDR block for the VPC . The IPv6 CIDR block uses a / 56 prefix * length , and is allocated from Amazon ' s pool of IPv6 addresses . You cannot choose the IPv6 range for your VPC . * By default , each instance you launch in the VPC has the default DHCP options , which include only a default DNS * server that we provide ( AmazonProvidedDNS ) . For more information , see < a * href = " https : / / docs . aws . amazon . com / AmazonVPC / latest / UserGuide / VPC _ DHCP _ Options . html " > DHCP Options Sets < / a > in the * < i > Amazon Virtual Private Cloud User Guide < / i > . * You can specify the instance tenancy value for the VPC when you create it . You can ' t change this value for the * VPC after you create it . For more information , see < a * href = " https : / / docs . aws . amazon . com / AWSEC2 / latest / UserGuide / dedicated - instance . html " > Dedicated Instances < / a > in the * < i > Amazon Elastic Compute Cloud User Guide < / i > . * @ param createVpcRequest * @ return Result of the CreateVpc operation returned by the service . * @ sample AmazonEC2 . CreateVpc * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / ec2-2016-11-15 / CreateVpc " target = " _ top " > AWS API * Documentation < / a > */ @ Override public CreateVpcResult createVpc ( CreateVpcRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeCreateVpc ( request ) ;
public class CacheManager { /** * Lookup the most suitable CacheManager available . * @ return CacheManager . */ public static Optional < CacheManager > lookup ( ) { } }
CacheManager manager = lookup . lookup ( CacheManager . class ) ; if ( manager != null ) { return Optional . of ( manager ) ; } else { return Optional . absent ( ) ; }
public class DCacheBase { /** * This is a helper method to remove invalidation listener for all entries . */ public synchronized boolean removeInvalidationListener ( InvalidationListener listener ) { } }
if ( bEnableListener && listener != null ) { eventSource . removeListener ( listener ) ; return true ; } return false ;
public class PluginAwareResourceBundleMessageSource { /** * Get a PropertiesHolder that contains the actually visible properties * for a Locale , after merging all specified resource bundles . * Either fetches the holder from the cache or freshly loads it . * < p > Only used when caching resource bundle contents forever , i . e . * with cacheSeconds < 0 . Therefore , merged properties are always * cached forever . */ protected PropertiesHolder getMergedPluginProperties ( final Locale locale ) { } }
return CacheEntry . getValue ( cachedMergedPluginProperties , locale , cacheMillis , new Callable < PropertiesHolder > ( ) { @ Override public PropertiesHolder call ( ) throws Exception { Properties mergedProps = new Properties ( ) ; PropertiesHolder mergedHolder = new PropertiesHolder ( mergedProps ) ; mergeBinaryPluginProperties ( locale , mergedProps ) ; return mergedHolder ; } } ) ;
public class AbstractEmbedderMojo { /** * Creates an instance of Embedder , either using * { @ link # injectableEmbedderClass } ( if set ) or defaulting to * { @ link # embedderClass } . * @ return An Embedder */ protected Embedder newEmbedder ( ) { } }
Embedder embedder = null ; EmbedderClassLoader classLoader = classLoader ( ) ; if ( injectableEmbedderClass != null ) { embedder = classLoader . newInstance ( InjectableEmbedder . class , injectableEmbedderClass ) . injectedEmbedder ( ) ; } else { embedder = classLoader . newInstance ( Embedder . class , embedderClass ) ; } URL codeLocation = codeLocation ( ) ; if ( codeLocation != null ) { embedder . configuration ( ) . storyReporterBuilder ( ) . withCodeLocation ( codeLocation ) ; } embedder . useClassLoader ( classLoader ) ; embedder . useEmbedderControls ( embedderControls ( ) ) ; if ( executorsClass != null ) { ExecutorServiceFactory executorServiceFactory = classLoader . newInstance ( ExecutorServiceFactory . class , executorsClass ) ; embedder . useExecutorService ( executorServiceFactory . create ( embedder . embedderControls ( ) ) ) ; } embedder . useEmbedderMonitor ( embedderMonitor ( ) ) ; if ( isNotEmpty ( metaFilters ) ) { List < String > filters = new ArrayList < > ( ) ; for ( String filter : metaFilters ) { if ( filter != null ) { filters . add ( filter ) ; } } embedder . useMetaFilters ( filters ) ; } if ( ! systemProperties . isEmpty ( ) ) { embedder . useSystemProperties ( systemProperties ) ; } return embedder ;
public class BELUtilities { /** * Returns { @ code true } if no null arguments are provided , { @ code false } * otherwise . * @ param objects Objects , may be null * @ return boolean */ public static boolean noNulls ( final Object ... objects ) { } }
if ( objects == null ) return false ; for ( final Object object : objects ) { if ( object == null ) return false ; } return true ;
public class TargetPerspectiveEditor { /** * View callbacks */ public void onGroupSelected ( String id ) { } }
navGroupId = id ; updateNavGroups ( ) ; if ( onUpdateCommand != null ) { onUpdateCommand . execute ( ) ; }
public class Dcs_fkeep { /** * Drops entries from a sparse matrix ; * @ param A * column - compressed matrix * @ param fkeep * drop aij if fkeep . fkeep ( i , j , aij , other ) is false * @ param other * optional parameter to fkeep * @ return nz , new number of entries in A , - 1 on error */ public static int cs_fkeep ( Dcs A , Dcs_ifkeep fkeep , Object other ) { } }
int j , p , nz = 0 , n , Ap [ ] , Ai [ ] ; double Ax [ ] ; if ( ! Dcs_util . CS_CSC ( A ) ) return ( - 1 ) ; /* check inputs */ n = A . n ; Ap = A . p ; Ai = A . i ; Ax = A . x ; for ( j = 0 ; j < n ; j ++ ) { p = Ap [ j ] ; /* get current location of col j */ Ap [ j ] = nz ; /* record new location of col j */ for ( ; p < Ap [ j + 1 ] ; p ++ ) { if ( fkeep . fkeep ( Ai [ p ] , j , Ax != null ? Ax [ p ] : 1 , other ) ) { if ( Ax != null ) Ax [ nz ] = Ax [ p ] ; /* keep A ( i , j ) */ Ai [ nz ++ ] = Ai [ p ] ; } } } Ap [ n ] = nz ; /* finalize A */ Dcs_util . cs_sprealloc ( A , 0 ) ; /* remove extra space from A */ return ( nz ) ;
public class AbstractProcessHandler { /** * Gets the PID for the SeLion - Grid ( main ) process * @ return the PID as an int * @ throws ProcessHandlerException */ protected int getCurrentProcessID ( ) throws ProcessHandlerException { } }
int pid ; // Not ideal but using JNA failed on RHEL5. RuntimeMXBean runtime = ManagementFactory . getRuntimeMXBean ( ) ; Field jvm = null ; try { jvm = runtime . getClass ( ) . getDeclaredField ( "jvm" ) ; jvm . setAccessible ( true ) ; VMManagement mgmt = ( VMManagement ) jvm . get ( runtime ) ; Method pid_method = mgmt . getClass ( ) . getDeclaredMethod ( "getProcessId" ) ; pid_method . setAccessible ( true ) ; pid = ( Integer ) pid_method . invoke ( mgmt ) ; } catch ( NoSuchFieldException | NoSuchMethodException | IllegalAccessException | InvocationTargetException e ) { throw new ProcessHandlerException ( e ) ; } return pid ;
public class ClassUtils { /** * Determine the name of the package of the given class , * e . g . " java . lang " for the { @ code java . lang . String } class . * @ param clazz the class * @ return the package name , or the empty String if the class * is defined in the default package */ public static String getPackageName ( Class < ? > clazz ) { } }
Assert . notNull ( clazz , "Class must not be null" ) ; return getPackageName ( clazz . getName ( ) ) ;
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link AbstractTextureParameterizationType } { @ code > } * @ param value * Java instance representing xml element ' s value . * @ return * the new instance of { @ link JAXBElement } { @ code < } { @ link AbstractTextureParameterizationType } { @ code > } */ @ XmlElementDecl ( namespace = "http://www.opengis.net/citygml/appearance/1.0" , name = "_TextureParameterization" , substitutionHeadNamespace = "http://www.opengis.net/gml" , substitutionHeadName = "_GML" ) public JAXBElement < AbstractTextureParameterizationType > create_TextureParameterization ( AbstractTextureParameterizationType value ) { } }
return new JAXBElement < AbstractTextureParameterizationType > ( __TextureParameterization_QNAME , AbstractTextureParameterizationType . class , null , value ) ;
public class BitsyElement { /** * WARNING : THERE IS ONE MORE COPY OF THIS CODE IN VERTEX */ @ Override public < T > Property < T > property ( String key ) { } }
T value = value ( key ) ; if ( value == null ) { return Property . < T > empty ( ) ; } else { return new BitsyProperty < T > ( this , key , value ) ; }
public class DevicesManagementApi { /** * Create a new task for one or more devices * Create a new task for one or more devices * @ param taskPayload Task object to be created ( required ) * @ return ApiResponse & lt ; TaskEnvelope & gt ; * @ throws ApiException If fail to call the API , e . g . server error or cannot deserialize the response body */ public ApiResponse < TaskEnvelope > createTasksWithHttpInfo ( TaskRequest taskPayload ) throws ApiException { } }
com . squareup . okhttp . Call call = createTasksValidateBeforeCall ( taskPayload , null , null ) ; Type localVarReturnType = new TypeToken < TaskEnvelope > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnType ) ;
public class ValidationMatcherRegistry { /** * Get library for validationMatcher prefix . * @ param validationMatcherPrefix to be searched for * @ return ValidationMatcherLibrary instance */ public ValidationMatcherLibrary getLibraryForPrefix ( String validationMatcherPrefix ) { } }
if ( validationMatcherLibraries != null ) { for ( ValidationMatcherLibrary validationMatcherLibrary : validationMatcherLibraries ) { if ( validationMatcherLibrary . getPrefix ( ) . equals ( validationMatcherPrefix ) ) { return validationMatcherLibrary ; } } } throw new NoSuchValidationMatcherLibraryException ( "Can not find validationMatcher library for prefix " + validationMatcherPrefix ) ;
public class ReloadablePropertiesBase { /** * 通过listener去通知 reload * @ param oldProperties */ protected void notifyPropertiesChanged ( Properties oldProperties ) { } }
PropertiesReloadedEvent event = new PropertiesReloadedEvent ( this , oldProperties ) ; for ( IReloadablePropertiesListener listener : listeners ) { listener . propertiesReloaded ( event ) ; }
public class DrpcTridentCoodinator { /** * { @ inheritDoc } */ @ Override public Object initializeTransaction ( long txid , Object prevMetadata , Object currMetadata ) { } }
if ( logger . isDebugEnabled ( ) == true ) { String logFormat = "initializeTransaction : txid={0}, prevMetadata={1}, currMetadata={2}" ; logger . debug ( MessageFormat . format ( logFormat , txid , prevMetadata , currMetadata ) ) ; } return null ;
public class BinaryJedis { /** * Set a timeout on the specified key . After the timeout the key will be automatically deleted by * the server . A key with an associated timeout is said to be volatile in Redis terminology . * Volatile keys are stored on disk like the other keys , the timeout is persistent too like all the * other aspects of the dataset . Saving a dataset containing expires and stopping the server does * not stop the flow of time as Redis stores on disk the time when the key will no longer be * available as Unix time , and not the remaining seconds . * Since Redis 2.1.3 you can update the value of the timeout of a key already having an expire * set . It is also possible to undo the expire at all turning the key into a normal key using the * { @ link # persist ( byte [ ] ) PERSIST } command . * Time complexity : O ( 1) * @ see < a href = " http : / / redis . io / commands / expire " > Expire Command < / a > * @ param key * @ param seconds * @ return Integer reply , specifically : 1 : the timeout was set . 0 : the timeout was not set since * the key already has an associated timeout ( this may happen only in Redis versions & lt ; * 2.1.3 , Redis & gt ; = 2.1.3 will happily update the timeout ) , or the key does not exist . */ @ Override public Long expire ( final byte [ ] key , final int seconds ) { } }
checkIsInMultiOrPipeline ( ) ; client . expire ( key , seconds ) ; return client . getIntegerReply ( ) ;
public class DeleteChannelRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DeleteChannelRequest deleteChannelRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( deleteChannelRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( deleteChannelRequest . getChannelName ( ) , CHANNELNAME_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class ChainableDecryptor { /** * { @ inheritDoc } */ @ Override public T decrypt ( final T encypted ) throws Exception { } }
T result = encypted ; for ( final Decryptor < T , T > encryptor : decryptors ) { result = encryptor . decrypt ( result ) ; } return result ;
public class CCEXAdapters { /** * Adapts a org . knowm . xchange . ccex . api . model . OrderBook to a OrderBook Object * @ param currencyPair ( e . g . BTC / USD ) * @ return The C - Cex OrderBook */ public static OrderBook adaptOrderBook ( CCEXGetorderbook ccexOrderBook , CurrencyPair currencyPair ) { } }
List < LimitOrder > asks = createOrders ( currencyPair , Order . OrderType . ASK , ccexOrderBook . getAsks ( ) ) ; List < LimitOrder > bids = createOrders ( currencyPair , Order . OrderType . BID , ccexOrderBook . getBids ( ) ) ; Date date = new Date ( ) ; return new OrderBook ( date , asks , bids ) ;
public class TPCHQuery3 { public static void main ( String [ ] args ) throws Exception { } }
if ( ! parseParameters ( args ) ) { return ; } final ExecutionEnvironment env = ExecutionEnvironment . getExecutionEnvironment ( ) ; // get input data DataSet < Lineitem > li = getLineitemDataSet ( env ) ; DataSet < Order > or = getOrdersDataSet ( env ) ; DataSet < Customer > cust = getCustomerDataSet ( env ) ; // Filter market segment " AUTOMOBILE " cust = cust . filter ( new FilterFunction < Customer > ( ) { @ Override public boolean filter ( Customer value ) { return value . getMktsegment ( ) . equals ( "AUTOMOBILE" ) ; } } ) ; // Filter all Orders with o _ orderdate < 12.03.1995 or = or . filter ( new FilterFunction < Order > ( ) { private DateFormat format = new SimpleDateFormat ( "yyyy-MM-dd" ) ; private Date date ; { Calendar cal = Calendar . getInstance ( ) ; cal . set ( 1995 , 3 , 12 ) ; date = cal . getTime ( ) ; } @ Override public boolean filter ( Order value ) throws ParseException { Date orderDate = format . parse ( value . getOrderdate ( ) ) ; return orderDate . before ( date ) ; } } ) ; // Filter all Lineitems with l _ shipdate > 12.03.1995 li = li . filter ( new FilterFunction < Lineitem > ( ) { private DateFormat format = new SimpleDateFormat ( "yyyy-MM-dd" ) ; private Date date ; { Calendar cal = Calendar . getInstance ( ) ; cal . set ( 1995 , 3 , 12 ) ; date = cal . getTime ( ) ; } @ Override public boolean filter ( Lineitem value ) throws ParseException { Date shipDate = format . parse ( value . getShipdate ( ) ) ; return shipDate . after ( date ) ; } } ) ; // Join customers with orders and package them into a ShippingPriorityItem DataSet < ShippingPriorityItem > customerWithOrders = cust . join ( or ) . where ( 0 ) . equalTo ( 0 ) . with ( new JoinFunction < Customer , Order , ShippingPriorityItem > ( ) { @ Override public ShippingPriorityItem join ( Customer first , Order second ) { return new ShippingPriorityItem ( 0 , 0.0 , second . getOrderdate ( ) , second . getShippriority ( ) , second . getOrderkey ( ) ) ; } } ) ; // Join the last join result with Lineitems DataSet < ShippingPriorityItem > joined = customerWithOrders . join ( li ) . where ( 4 ) . equalTo ( 0 ) . with ( new JoinFunction < ShippingPriorityItem , Lineitem , ShippingPriorityItem > ( ) { @ Override public ShippingPriorityItem join ( ShippingPriorityItem first , Lineitem second ) { first . setL_Orderkey ( second . getOrderkey ( ) ) ; first . setRevenue ( second . getExtendedprice ( ) * ( 1 - second . getDiscount ( ) ) ) ; return first ; } } ) ; // Group by l _ orderkey , o _ orderdate and o _ shippriority and compute revenue sum joined = joined . groupBy ( 0 , 2 , 3 ) . aggregate ( Aggregations . SUM , 1 ) ; // emit result joined . writeAsCsv ( outputPath , "\n" , "|" ) ; // execute program env . execute ( "TPCH Query 3 Example" ) ;
public class TerminalManager { /** * Returns a card reader that has a card in it . * Asks for card insertion , if the system only has a single reader . * @ return a CardTerminal containing a card * @ throws CardException if no suitable reader is found . */ public static CardTerminal getTheReader ( String spec ) throws CardException { } }
try { String msg = "This application expects one and only one card reader (with an inserted card)" ; TerminalFactory tf = getTerminalFactory ( spec ) ; CardTerminals tl = tf . terminals ( ) ; List < CardTerminal > list = tl . list ( State . CARD_PRESENT ) ; if ( list . size ( ) > 1 ) { throw new CardException ( msg ) ; } else if ( list . size ( ) == 1 ) { return list . get ( 0 ) ; } else { List < CardTerminal > wl = tl . list ( State . ALL ) ; // FIXME : JNA - s CardTerminals . waitForChange ( ) does not work if ( wl . size ( ) == 1 ) { CardTerminal t = wl . get ( 0 ) ; System . out . println ( "Waiting for a card insertion to " + t . getName ( ) ) ; if ( t . waitForCardPresent ( 0 ) ) { return t ; } else { throw new CardException ( "Could not find a reader with a card" ) ; } } else { throw new CardException ( msg ) ; } } } catch ( NoSuchAlgorithmException e ) { throw new CardException ( e ) ; }
public class Tesseract1 { /** * A wrapper for { @ link # setImage ( int , int , ByteBuffer , Rectangle , int ) } . * @ param image a rendered image * @ param rect region of interest * @ throws java . io . IOException */ protected void setImage ( RenderedImage image , Rectangle rect ) throws IOException { } }
ByteBuffer buff = ImageIOHelper . getImageByteBuffer ( image ) ; int bpp ; DataBuffer dbuff = image . getData ( new Rectangle ( 1 , 1 ) ) . getDataBuffer ( ) ; if ( dbuff instanceof DataBufferByte ) { bpp = image . getColorModel ( ) . getPixelSize ( ) ; } else { bpp = 8 ; // BufferedImage . TYPE _ BYTE _ GRAY image } setImage ( image . getWidth ( ) , image . getHeight ( ) , buff , rect , bpp ) ;
public class ManagedClustersInner { /** * Reset AAD Profile of a managed cluster . * Update the AAD Profile for a managed cluster . * @ param resourceGroupName The name of the resource group . * @ param resourceName The name of the managed cluster resource . * @ param parameters Parameters supplied to the Reset AAD Profile operation for a Managed Cluster . * @ param serviceCallback the async ServiceCallback to handle successful and failed responses . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the { @ link ServiceFuture } object */ public ServiceFuture < Void > resetAADProfileAsync ( String resourceGroupName , String resourceName , ManagedClusterAADProfile parameters , final ServiceCallback < Void > serviceCallback ) { } }
return ServiceFuture . fromResponse ( resetAADProfileWithServiceResponseAsync ( resourceGroupName , resourceName , parameters ) , serviceCallback ) ;
public class AwsSecurityFindingFilters { /** * The identifier of the VPC in which the instance was launched . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setResourceAwsEc2InstanceVpcId ( java . util . Collection ) } or * { @ link # withResourceAwsEc2InstanceVpcId ( java . util . Collection ) } if you want to override the existing values . * @ param resourceAwsEc2InstanceVpcId * The identifier of the VPC in which the instance was launched . * @ return Returns a reference to this object so that method calls can be chained together . */ public AwsSecurityFindingFilters withResourceAwsEc2InstanceVpcId ( StringFilter ... resourceAwsEc2InstanceVpcId ) { } }
if ( this . resourceAwsEc2InstanceVpcId == null ) { setResourceAwsEc2InstanceVpcId ( new java . util . ArrayList < StringFilter > ( resourceAwsEc2InstanceVpcId . length ) ) ; } for ( StringFilter ele : resourceAwsEc2InstanceVpcId ) { this . resourceAwsEc2InstanceVpcId . add ( ele ) ; } return this ;
public class Slices { /** * Creates a slice over the specified array range . * @ param offset the array position at which the slice begins * @ param length the number of array positions to include in the slice */ public static Slice wrappedDoubleArray ( double [ ] array , int offset , int length ) { } }
if ( length == 0 ) { return EMPTY_SLICE ; } return new Slice ( array , offset , length ) ;
public class CPInstanceUtil { /** * Returns all the cp instances where uuid = & # 63 ; and companyId = & # 63 ; . * @ param uuid the uuid * @ param companyId the company ID * @ return the matching cp instances */ public static List < CPInstance > findByUuid_C ( String uuid , long companyId ) { } }
return getPersistence ( ) . findByUuid_C ( uuid , companyId ) ;
public class IPAddressDivision { /** * Returns the number of consecutive trailing one or zero bits . * If network is true , returns the number of consecutive trailing zero bits . * Otherwise , returns the number of consecutive trailing one bits . * This method applies only to the lower value of the range if this segment represents multiple values . * @ param network * @ return */ public int getTrailingBitCount ( boolean network ) { } }
if ( network ) { // trailing zeros return Long . numberOfTrailingZeros ( getDivisionValue ( ) | ( ~ 0L << getBitCount ( ) ) ) ; } // trailing ones return Long . numberOfTrailingZeros ( ~ getDivisionValue ( ) ) ;
public class LogNormalDistribution { /** * Probability density function of the normal distribution . * < pre > * 1 / ( SQRT ( 2 * pi ) * sigma * x ) * e ^ ( - log ( x - mu ) ^ 2/2sigma ^ 2) * < / pre > * @ param x The value . * @ param mu The mean . * @ param sigma The standard deviation . * @ return PDF of the given normal distribution at x . */ public static double pdf ( double x , double mu , double sigma ) { } }
if ( x <= 0. ) { return 0. ; } final double xrel = ( FastMath . log ( x ) - mu ) / sigma ; return 1 / ( MathUtil . SQRTTWOPI * sigma * x ) * FastMath . exp ( - .5 * xrel * xrel ) ;
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link StringOrRefType } { @ code > } * @ param value * Java instance representing xml element ' s value . * @ return * the new instance of { @ link JAXBElement } { @ code < } { @ link StringOrRefType } { @ code > } */ @ XmlElementDecl ( namespace = "http://www.opengis.net/gml" , name = "description" ) public JAXBElement < StringOrRefType > createDescription ( StringOrRefType value ) { } }
return new JAXBElement < StringOrRefType > ( _Description_QNAME , StringOrRefType . class , null , value ) ;
public class DescribeConfigurationAggregatorSourcesStatusRequest { /** * Filters the status type . * < ul > * < li > * Valid value FAILED indicates errors while moving data . * < / li > * < li > * Valid value SUCCEEDED indicates the data was successfully moved . * < / li > * < li > * Valid value OUTDATED indicates the data is not the most recent . * < / li > * < / ul > * @ param updateStatus * Filters the status type . < / p > * < ul > * < li > * Valid value FAILED indicates errors while moving data . * < / li > * < li > * Valid value SUCCEEDED indicates the data was successfully moved . * < / li > * < li > * Valid value OUTDATED indicates the data is not the most recent . * < / li > * @ return Returns a reference to this object so that method calls can be chained together . * @ see AggregatedSourceStatusType */ public DescribeConfigurationAggregatorSourcesStatusRequest withUpdateStatus ( AggregatedSourceStatusType ... updateStatus ) { } }
com . amazonaws . internal . SdkInternalList < String > updateStatusCopy = new com . amazonaws . internal . SdkInternalList < String > ( updateStatus . length ) ; for ( AggregatedSourceStatusType value : updateStatus ) { updateStatusCopy . add ( value . toString ( ) ) ; } if ( getUpdateStatus ( ) == null ) { setUpdateStatus ( updateStatusCopy ) ; } else { getUpdateStatus ( ) . addAll ( updateStatusCopy ) ; } return this ;
public class RegexGatewayPersonAttributeDao { /** * / * ( non - Javadoc ) * @ see org . jasig . services . persondir . IPersonAttributeDao # getAvailableQueryAttributes ( ) */ @ JsonIgnore @ Override public Set < String > getAvailableQueryAttributes ( final IPersonAttributeDaoFilter filter ) { } }
return this . targetPersonAttributeDao . getAvailableQueryAttributes ( filter ) ;
public class ThemeManager { /** * Synonym for { @ link # cloneTheme ( Intent , Intent , boolean ) } with third arg - * false * @ see # cloneTheme ( Intent , Intent , boolean ) */ public static void cloneTheme ( Intent sourceIntent , Intent intent ) { } }
ThemeManager . cloneTheme ( sourceIntent , intent , false ) ;
public class BucketsBitmapPool { /** * Determine if this bitmap is reusable ( i . e . ) if subsequent { @ link # get ( int ) } requests can * use this value . * The bitmap is reusable if * - it has not already been recycled AND * - it is mutable * @ param value the value to test for reusability * @ return true , if the bitmap can be reused */ @ Override protected boolean isReusable ( Bitmap value ) { } }
Preconditions . checkNotNull ( value ) ; return ! value . isRecycled ( ) && value . isMutable ( ) ;
public class ForwardingGridDialect { /** * @ see org . hibernate . ogm . dialect . queryable . spi . QueryableGridDialect */ @ Override public ClosableIterator < Tuple > executeBackendQuery ( BackendQuery < T > query , QueryParameters queryParameters , TupleContext tupleContext ) { } }
return queryableGridDialect . executeBackendQuery ( query , queryParameters , tupleContext ) ;
public class ContainerMetrics { /** * Get a { @ link ContainerMetrics } instance given the { @ link State } of a container , the name of the application the * container belongs to , and the workerId of the container . * @ param containerState the { @ link State } of the container * @ param applicationName a { @ link String } representing the name of the application the container belongs to * @ return a { @ link ContainerMetrics } instance */ public static ContainerMetrics get ( final State containerState , final String applicationName , final String workerId ) { } }
return ( ContainerMetrics ) GOBBLIN_METRICS_REGISTRY . getOrDefault ( name ( workerId ) , new Callable < GobblinMetrics > ( ) { @ Override public GobblinMetrics call ( ) throws Exception { return new ContainerMetrics ( containerState , applicationName , workerId ) ; } } ) ;
public class GreenPepperXmlRpcServer { /** * { @ inheritDoc } */ public Vector < Object > createSpecification ( Vector < Object > specificationParams ) { } }
try { Specification specification = XmlRpcDataMarshaller . toSpecification ( specificationParams ) ; specification = service . createSpecification ( specification ) ; log . debug ( "Created specification: " + specification . getName ( ) ) ; return specification . marshallize ( ) ; } catch ( Exception e ) { return errorAsVector ( e , SPECIFICATION_CREATE_FAILED ) ; }
public class BinaryString { /** * Returns a substring of this . * @ param start the position of first code point * @ param until the position after last code point , exclusive . */ public BinaryString substring ( final int start , final int until ) { } }
ensureMaterialized ( ) ; if ( until <= start || start >= sizeInBytes ) { return EMPTY_UTF8 ; } if ( inFirstSegment ( ) ) { MemorySegment segment = segments [ 0 ] ; int i = 0 ; int c = 0 ; while ( i < sizeInBytes && c < start ) { i += numBytesForFirstByte ( segment . get ( i + offset ) ) ; c += 1 ; } int j = i ; while ( i < sizeInBytes && c < until ) { i += numBytesForFirstByte ( segment . get ( i + offset ) ) ; c += 1 ; } if ( i > j ) { byte [ ] bytes = new byte [ i - j ] ; segment . get ( offset + j , bytes , 0 , i - j ) ; return fromBytes ( bytes ) ; } else { return EMPTY_UTF8 ; } } else { return substringSlow ( start , until ) ; }
public class UserHandlerImpl { /** * Remove user and related membership entities . */ private User removeUser ( Session session , String userName , boolean broadcast ) throws Exception { } }
Node userNode = utils . getUserNode ( session , userName ) ; User user = readUser ( userNode ) ; if ( broadcast ) { preDelete ( user ) ; } removeMemberships ( userNode , broadcast ) ; userNode . remove ( ) ; session . save ( ) ; removeFromCache ( userName ) ; removeAllRelatedFromCache ( userName ) ; if ( broadcast ) { postDelete ( user ) ; } return user ;
public class SARLTypeComputer { /** * Compute the type of a break expression . * @ param object the expression . * @ param state the state of the type resolver . */ protected void _computeTypes ( SarlBreakExpression object , ITypeComputationState state ) { } }
final LightweightTypeReference primitiveVoid = getPrimitiveVoid ( state ) ; state . acceptActualType ( primitiveVoid ) ;
public class CommandLineArgumentParser { /** * Read a list file and return a list of the collection values contained in it * Any line that starts with { @ link CommandLineArgumentParser # ARGUMENT _ FILE _ COMMENT } is ignored . * @ param collectionListFile a text file containing list values * @ return false if a fatal error occurred */ private static List < String > loadCollectionListFile ( final String collectionListFile ) { } }
try ( BufferedReader reader = new BufferedReader ( new FileReader ( collectionListFile ) ) ) { return reader . lines ( ) . map ( String :: trim ) . filter ( line -> ! line . isEmpty ( ) ) . filter ( line -> ! line . startsWith ( ARGUMENT_FILE_COMMENT ) ) . collect ( Collectors . toList ( ) ) ; } catch ( final IOException e ) { throw new CommandLineException ( "I/O error loading list file:" + collectionListFile , e ) ; }
public class SampleSetEQOracle { /** * Adds words to the sample set . The expected output is determined by means of the specified membership oracle . * @ param oracle * the membership oracle used to determine the expected output * @ param words * the words to add * @ return { @ code this } , to enable chained { @ code add } or { @ code addAll } calls */ public SampleSetEQOracle < I , D > addAll ( MembershipOracle < I , D > oracle , Collection < ? extends Word < I > > words ) { } }
if ( words . isEmpty ( ) ) { return this ; } List < DefaultQuery < I , D > > newQueries = new ArrayList < > ( words . size ( ) ) ; for ( Word < I > w : words ) { newQueries . add ( new DefaultQuery < > ( w ) ) ; } oracle . processQueries ( newQueries ) ; testQueries . addAll ( newQueries ) ; return this ;
public class StreamUtils { /** * Returns the stream contents as an UTF - 8 encoded string * @ param is input stream * @ return string contents * @ throws java . io . IOException in any . SocketTimeout in example */ public static String getStreamContents ( InputStream is ) throws IOException { } }
Preconditions . checkNotNull ( is , "Cannot get String from a null object" ) ; final char [ ] buffer = new char [ 0x10000 ] ; final StringBuilder out = new StringBuilder ( ) ; try ( Reader in = new InputStreamReader ( is , "UTF-8" ) ) { int read ; do { read = in . read ( buffer , 0 , buffer . length ) ; if ( read > 0 ) { out . append ( buffer , 0 , read ) ; } } while ( read >= 0 ) ; } return out . toString ( ) ;
public class CompilerInput { /** * Generates the DependencyInfo by scanning and / or parsing the file . * This is called lazily by getDependencyInfo , and does not take into * account any extra requires / provides added by { @ link # addRequire } * or { @ link # addProvide } . */ private DependencyInfo generateDependencyInfo ( ) { } }
Preconditions . checkNotNull ( compiler , "Expected setCompiler to be called first: %s" , this ) ; Preconditions . checkNotNull ( compiler . getErrorManager ( ) , "Expected compiler to call an error manager: %s" , this ) ; // If the code is a JsAst , then it was originally JS code , and is compatible with the // regex - based parsing of JsFileParser . if ( ast instanceof JsAst && JsFileParser . isSupported ( ) ) { // Look at the source code . // Note : it ' s OK to use getName ( ) instead of // getPathRelativeToClosureBase ( ) here because we ' re not using // this to generate deps files . ( We ' re only using it for // symbol dependencies . ) try { DependencyInfo info = new JsFileParser ( compiler . getErrorManager ( ) ) . setModuleLoader ( compiler . getModuleLoader ( ) ) . setIncludeGoogBase ( true ) . parseFile ( getName ( ) , getName ( ) , getCode ( ) ) ; return new LazyParsedDependencyInfo ( info , ( JsAst ) ast , compiler ) ; } catch ( IOException e ) { compiler . getErrorManager ( ) . report ( CheckLevel . ERROR , JSError . make ( AbstractCompiler . READ_ERROR , getName ( ) , e . getMessage ( ) ) ) ; return SimpleDependencyInfo . EMPTY ; } } else { // Otherwise , just look at the AST . DepsFinder finder = new DepsFinder ( getPath ( ) ) ; Node root = getAstRoot ( compiler ) ; if ( root == null ) { return SimpleDependencyInfo . EMPTY ; } finder . visitTree ( root ) ; JSDocInfo info = root . getJSDocInfo ( ) ; // TODO ( nicksantos | user ) : This caching behavior is a bit // odd , and only works if you assume the exact call flow that // clients are currently using . In that flow , they call // getProvides ( ) , then remove the goog . provide calls from the // AST , and then call getProvides ( ) again . // This won ' t work for any other call flow , or any sort of incremental // compilation scheme . The API needs to be fixed so callers aren ' t // doing weird things like this , and then we should get rid of the // multiple - scan strategy . return SimpleDependencyInfo . builder ( "" , "" ) . setProvides ( finder . provides ) . setRequires ( finder . requires ) . setTypeRequires ( finder . typeRequires ) . setLoadFlags ( finder . loadFlags ) . setHasExternsAnnotation ( info != null && info . isExterns ( ) ) . setHasNoCompileAnnotation ( info != null && info . isNoCompile ( ) ) . build ( ) ; }
public class WebApplicationContext { private void resolveWebApp ( ) throws IOException { } }
if ( _webApp == null && _war != null && _war . length ( ) > 0 ) { // Set dir or WAR _webApp = Resource . newResource ( _war ) ; // Accept aliases for WAR files if ( _webApp . getAlias ( ) != null ) { log . info ( _webApp + " anti-aliased to " + _webApp . getAlias ( ) ) ; _webApp = Resource . newResource ( _webApp . getAlias ( ) ) ; } if ( log . isDebugEnabled ( ) ) log . debug ( "Try webapp=" + _webApp + ", exists=" + _webApp . exists ( ) + ", directory=" + _webApp . isDirectory ( ) ) ; // Is the WAR usable directly ? if ( _webApp . exists ( ) && ! _webApp . isDirectory ( ) && ! _webApp . toString ( ) . startsWith ( "jar:" ) ) { // No - then lets see if it can be turned into a jar URL . Resource jarWebApp = Resource . newResource ( "jar:" + _webApp + "!/" ) ; if ( jarWebApp . exists ( ) && jarWebApp . isDirectory ( ) ) { _webApp = jarWebApp ; _war = _webApp . toString ( ) ; if ( log . isDebugEnabled ( ) ) log . debug ( "Try webapp=" + _webApp + ", exists=" + _webApp . exists ( ) + ", directory=" + _webApp . isDirectory ( ) ) ; } } // If we should extract or the URL is still not usable if ( _webApp . exists ( ) && ( ! _webApp . isDirectory ( ) || ( _extract && _webApp . getFile ( ) == null ) || ( _extract && _webApp . getFile ( ) != null && ! _webApp . getFile ( ) . isDirectory ( ) ) ) ) { // Then extract it . File tempDir = new File ( getTempDirectory ( ) , "webapp" ) ; if ( tempDir . exists ( ) ) tempDir . delete ( ) ; tempDir . mkdir ( ) ; tempDir . deleteOnExit ( ) ; log . info ( "Extract " + _war + " to " + tempDir ) ; JarResource . extract ( _webApp , tempDir , true ) ; _webApp = Resource . newResource ( tempDir . getCanonicalPath ( ) ) ; if ( log . isDebugEnabled ( ) ) log . debug ( "Try webapp=" + _webApp + ", exists=" + _webApp . exists ( ) + ", directory=" + _webApp . isDirectory ( ) ) ; } // Now do we have something usable ? if ( ! _webApp . exists ( ) || ! _webApp . isDirectory ( ) ) { log . warn ( "Web application not found " + _war ) ; throw new java . io . FileNotFoundException ( _war ) ; } if ( log . isDebugEnabled ( ) ) log . debug ( "webapp=" + _webApp ) ; // Iw there a WEB - INF directory ? _webInf = _webApp . addPath ( "WEB-INF/" ) ; if ( ! _webInf . exists ( ) || ! _webInf . isDirectory ( ) ) _webInf = null ; else { // Is there a WEB - INF work directory Resource work = _webInf . addPath ( "work" ) ; if ( work . exists ( ) && work . isDirectory ( ) && work . getFile ( ) != null && work . getFile ( ) . canWrite ( ) && getAttribute ( "javax.servlet.context.tempdir" ) == null ) setAttribute ( "javax.servlet.context.tempdir" , work . getFile ( ) ) ; } // ResourcePath super . setBaseResource ( _webApp ) ; }
public class MathUtil { /** * Replies the chord of the specified angle . * < p > < code > crd ( a ) = 2 sin ( a / 2 ) < / code > * < p > < img src = " . / doc - files / chord . png " alt = " [ Chord function ] " > * @ param angle the angle . * @ return the chord of the angle . */ @ Pure @ Inline ( value = "2.*Math.sin(($1)/2.)" , imported = { } }
Math . class } ) public static double crd ( double angle ) { return 2. * Math . sin ( angle / 2. ) ;
public class PcapPktHdr { /** * Copy this instance . * @ return returns new { @ link PcapPktHdr } instance . */ public PcapPktHdr copy ( ) { } }
PcapPktHdr pktHdr = new PcapPktHdr ( ) ; pktHdr . caplen = this . caplen ; pktHdr . len = this . len ; pktHdr . tv_sec = this . tv_sec ; pktHdr . tv_usec = this . tv_usec ; return pktHdr ;
public class BurstableConstructor { /** * Returns all fields of any visibility on type and all of type ' s superclasses . * Aka { @ link Class # getFields ( ) } , but returns all fields , not just public ones . */ private static Collection < Field > getAllFields ( Class < ? > type ) { } }
final Collection < Field > allFields = new ArrayList < > ( ) ; while ( type != Object . class ) { Collections . addAll ( allFields , type . getDeclaredFields ( ) ) ; type = type . getSuperclass ( ) ; } return Collections . unmodifiableCollection ( allFields ) ;
public class PipelineApi { /** * Get a list of pipelines in a project . * < pre > < code > GitLab Endpoint : GET / projects / : id / pipelines < / code > < / pre > * @ param projectIdOrPath the project in the form of an Integer ( ID ) , String ( path ) , or Project instance * @ param scope the scope of pipelines , one of : RUNNING , PENDING , FINISHED , BRANCHES , TAGS * @ param status the status of pipelines , one of : RUNNING , PENDING , SUCCESS , FAILED , CANCELED , SKIPPED * @ param ref the ref of pipelines * @ param yamlErrors returns pipelines with invalid configurations * @ param name the name of the user who triggered pipelines * @ param username the username of the user who triggered pipelines * @ param orderBy order pipelines by ID , STATUS , REF , USER _ ID ( default : ID ) * @ param sort sort pipelines in ASC or DESC order ( default : DESC ) * @ return a list containing the pipelines for the specified project ID * @ throws GitLabApiException if any exception occurs during execution */ public List < Pipeline > getPipelines ( Object projectIdOrPath , PipelineScope scope , PipelineStatus status , String ref , boolean yamlErrors , String name , String username , PipelineOrderBy orderBy , SortOrder sort ) throws GitLabApiException { } }
return ( getPipelines ( projectIdOrPath , scope , status , ref , yamlErrors , name , username , orderBy , sort , getDefaultPerPage ( ) ) . all ( ) ) ;
public class BagObject { /** * Returns an array of the keys contained in the underlying container . it does not enumerate the * container and all of its children . * @ return The keys in the underlying map as an array of Strings . */ public String [ ] keys ( ) { } }
String [ ] keys = new String [ count ] ; for ( int i = 0 ; i < count ; ++ i ) { keys [ i ] = container [ i ] . key ; } return keys ;
public class CPRuleAssetCategoryRelPersistenceImpl { /** * Returns the first cp rule asset category rel in the ordered set where assetCategoryId = & # 63 ; . * @ param assetCategoryId the asset category ID * @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > ) * @ return the first matching cp rule asset category rel , or < code > null < / code > if a matching cp rule asset category rel could not be found */ @ Override public CPRuleAssetCategoryRel fetchByAssetCategoryId_First ( long assetCategoryId , OrderByComparator < CPRuleAssetCategoryRel > orderByComparator ) { } }
List < CPRuleAssetCategoryRel > list = findByAssetCategoryId ( assetCategoryId , 0 , 1 , orderByComparator ) ; if ( ! list . isEmpty ( ) ) { return list . get ( 0 ) ; } return null ;
public class Combination { /** * 全组合 * @ return 全排列结果 */ public List < String [ ] > selectAll ( ) { } }
final List < String [ ] > result = new ArrayList < > ( ( int ) countAll ( this . datas . length ) ) ; for ( int i = 1 ; i <= this . datas . length ; i ++ ) { result . addAll ( select ( i ) ) ; } return result ;
public class SignUpRequest { /** * An array of name - value pairs representing user attributes . * For custom attributes , you must prepend the < code > custom : < / code > prefix to the attribute name . * @ param userAttributes * An array of name - value pairs representing user attributes . < / p > * For custom attributes , you must prepend the < code > custom : < / code > prefix to the attribute name . */ public void setUserAttributes ( java . util . Collection < AttributeType > userAttributes ) { } }
if ( userAttributes == null ) { this . userAttributes = null ; return ; } this . userAttributes = new java . util . ArrayList < AttributeType > ( userAttributes ) ;
public class CPOptionPersistenceImpl { /** * Returns the last cp option in the ordered set where groupId = & # 63 ; . * @ param groupId the group ID * @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > ) * @ return the last matching cp option , or < code > null < / code > if a matching cp option could not be found */ @ Override public CPOption fetchByGroupId_Last ( long groupId , OrderByComparator < CPOption > orderByComparator ) { } }
int count = countByGroupId ( groupId ) ; if ( count == 0 ) { return null ; } List < CPOption > list = findByGroupId ( groupId , count - 1 , count , orderByComparator ) ; if ( ! list . isEmpty ( ) ) { return list . get ( 0 ) ; } return null ;
public class Config { /** * Sets the map of scheduled executor configurations , mapped by config name . * The config name may be a pattern with which the configuration will be * obtained in the future . * @ param scheduledExecutorConfigs the scheduled executor configuration * map to set * @ return this config instance */ public Config setScheduledExecutorConfigs ( Map < String , ScheduledExecutorConfig > scheduledExecutorConfigs ) { } }
this . scheduledExecutorConfigs . clear ( ) ; this . scheduledExecutorConfigs . putAll ( scheduledExecutorConfigs ) ; for ( Entry < String , ScheduledExecutorConfig > entry : scheduledExecutorConfigs . entrySet ( ) ) { entry . getValue ( ) . setName ( entry . getKey ( ) ) ; } return this ;
public class DirectoryOperation { /** * Determine whether the directory operation contains an SftpFile * @ param f * @ return boolean */ public boolean containsFile ( SftpFile f ) { } }
return unchangedFiles . contains ( f ) || newFiles . contains ( f ) || updatedFiles . contains ( f ) || deletedFiles . contains ( f ) || recursedDirectories . contains ( f . getAbsolutePath ( ) ) || failedTransfers . containsKey ( f ) ;
public class MigrateToExtensionSettings { /** * Gets the site links from a feed . * @ return a map of feed item ID to SiteLinkFromFeed */ private static Map < Long , SiteLinkFromFeed > getSiteLinksFromFeed ( AdWordsServicesInterface adWordsServices , AdWordsSession session , Feed feed ) throws RemoteException { } }
// Retrieve the feed ' s attribute mapping . Multimap < Long , Integer > feedMappings = getFeedMapping ( adWordsServices , session , feed , PLACEHOLDER_SITELINKS ) ; Map < Long , SiteLinkFromFeed > feedItems = Maps . newHashMap ( ) ; for ( FeedItem feedItem : getFeedItems ( adWordsServices , session , feed ) ) { SiteLinkFromFeed siteLinkFromFeed = new SiteLinkFromFeed ( ) ; for ( FeedItemAttributeValue attributeValue : feedItem . getAttributeValues ( ) ) { // Skip this attribute if it hasn ' t been mapped to a field . if ( ! feedMappings . containsKey ( attributeValue . getFeedAttributeId ( ) ) ) { continue ; } for ( Integer fieldId : feedMappings . get ( attributeValue . getFeedAttributeId ( ) ) ) { switch ( fieldId ) { case PLACEHOLDER_FIELD_SITELINK_LINK_TEXT : siteLinkFromFeed . text = attributeValue . getStringValue ( ) ; break ; case PLACEHOLDER_FIELD_SITELINK_URL : siteLinkFromFeed . url = attributeValue . getStringValue ( ) ; break ; case PLACEHOLDER_FIELD_FINAL_URLS : siteLinkFromFeed . finalUrls = attributeValue . getStringValues ( ) ; break ; case PLACEHOLDER_FIELD_FINAL_MOBILE_URLS : siteLinkFromFeed . finalMobileUrls = attributeValue . getStringValues ( ) ; break ; case PLACEHOLDER_FIELD_TRACKING_URL_TEMPLATE : siteLinkFromFeed . trackingUrlTemplate = attributeValue . getStringValue ( ) ; break ; case PLACEHOLDER_FIELD_LINE_2_TEXT : siteLinkFromFeed . line2 = attributeValue . getStringValue ( ) ; break ; case PLACEHOLDER_FIELD_LINE_3_TEXT : siteLinkFromFeed . line3 = attributeValue . getStringValue ( ) ; break ; default : // Ignore attributes that do not map to a predefined placeholder field . break ; } } } feedItems . put ( feedItem . getFeedItemId ( ) , siteLinkFromFeed ) ; } return feedItems ;
public class VFS { /** * Initialize VFS protocol handlers package property . */ private static void init ( ) { } }
String pkgs = System . getProperty ( "java.protocol.handler.pkgs" ) ; if ( pkgs == null || pkgs . trim ( ) . length ( ) == 0 ) { pkgs = "org.jboss.net.protocol|org.jboss.vfs.protocol" ; System . setProperty ( "java.protocol.handler.pkgs" , pkgs ) ; } else if ( pkgs . contains ( "org.jboss.vfs.protocol" ) == false ) { if ( pkgs . contains ( "org.jboss.net.protocol" ) == false ) { pkgs += "|org.jboss.net.protocol" ; } pkgs += "|org.jboss.vfs.protocol" ; System . setProperty ( "java.protocol.handler.pkgs" , pkgs ) ; }
public class SCMController { /** * Adding a change log file filter */ @ RequestMapping ( value = "changeLog/fileFilter/{projectId}/create" , method = RequestMethod . POST ) public Resource < SCMFileChangeFilter > createChangeLogFileFilter ( @ PathVariable ID projectId , @ RequestBody SCMFileChangeFilter filter ) { } }
securityService . checkProjectFunction ( projectId . get ( ) , ProjectConfig . class ) ; return securityService . asAdmin ( ( ) -> { // Loads the project Project project = structureService . getProject ( projectId ) ; // Gets the store SCMFileChangeFilters config = entityDataService . retrieve ( project , SCMFileChangeFilters . class . getName ( ) , SCMFileChangeFilters . class ) ; if ( config == null ) config = SCMFileChangeFilters . create ( ) ; // Updates the store config = config . save ( filter ) ; // Saves the store back entityDataService . store ( project , SCMFileChangeFilters . class . getName ( ) , config ) ; // OK return getChangeLogFileFilter ( projectId , filter . getName ( ) ) ; } ) ;
public class MaybeReachingVariableUse { /** * Sets the variable for the given name to the node value in the upward * exposed lattice . Do nothing if the variable name is one of the escaped * variable . */ private void addToUseIfLocal ( String name , Node node , ReachingUses use ) { } }
Var var = allVarsInFn . get ( name ) ; if ( var == null ) { return ; } if ( ! escaped . contains ( var ) ) { use . mayUseMap . put ( var , node ) ; }
public class FNIImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public boolean eIsSet ( int featureID ) { } }
switch ( featureID ) { case AfplibPackage . FNI__RG : return rg != null && ! rg . isEmpty ( ) ; } return super . eIsSet ( featureID ) ;
public class AsyncHttpClientFactoryEmbed { /** * Disable certificate verification . * @ throws KeyManagementException * the key management exception * @ throws NoSuchAlgorithmException * the no such algorithm exception */ private void disableCertificateVerification ( ) throws KeyManagementException , NoSuchAlgorithmException { } }
// Create a trust manager that does not validate certificate chains final TrustManager [ ] trustAllCerts = new TrustManager [ ] { new CustomTrustManager ( ) } ; // Install the all - trusting trust manager final SSLContext sslContext = SSLContext . getInstance ( "SSL" ) ; sslContext . init ( null , trustAllCerts , new SecureRandom ( ) ) ; final SSLSocketFactory sslSocketFactory = sslContext . getSocketFactory ( ) ; HttpsURLConnection . setDefaultSSLSocketFactory ( sslSocketFactory ) ; final HostnameVerifier verifier = new HostnameVerifier ( ) { @ Override public boolean verify ( final String hostname , final SSLSession session ) { return true ; } } ; HttpsURLConnection . setDefaultHostnameVerifier ( verifier ) ;
public class CmsBasicDialog { /** * Display the resource indos panel with panel message . < p > * @ param resources to show info for * @ param messageKey of the panel */ public void displayResourceInfo ( List < CmsResource > resources , String messageKey ) { } }
m_infoResources = Lists . newArrayList ( resources ) ; if ( m_infoComponent != null ) { m_mainPanel . removeComponent ( m_infoComponent ) ; m_infoComponent = null ; } if ( ( resources != null ) && ! resources . isEmpty ( ) ) { if ( resources . size ( ) == 1 ) { m_infoComponent = new CmsResourceInfo ( resources . get ( 0 ) ) ; m_mainPanel . addComponent ( m_infoComponent , 0 ) ; } else { m_infoComponent = createResourceListPanel ( messageKey == null ? null : Messages . get ( ) . getBundle ( A_CmsUI . get ( ) . getLocale ( ) ) . key ( messageKey ) , resources ) ; m_mainPanel . addComponent ( m_infoComponent , 0 ) ; m_mainPanel . setExpandRatio ( m_infoComponent , 1 ) ; // reset expand ratio of the content panel m_contentPanel . setSizeUndefined ( ) ; m_contentPanel . setWidth ( "100%" ) ; m_mainPanel . setExpandRatio ( m_contentPanel , 0 ) ; } }
public class WebUtils { /** * 是否内网调用 * @ param request * @ return */ public static boolean isInternalRequest ( HttpServletRequest request ) { } }
if ( Boolean . parseBoolean ( request . getHeader ( WebConstants . HEADER_INTERNAL_REQUEST ) ) ) { return true ; } boolean isInner = IpUtils . isInnerIp ( request . getServerName ( ) ) ; String forwardHost = request . getHeader ( WebConstants . HEADER_FORWARDED_HOST ) ; // 来源于网关 if ( StringUtils . isNotBlank ( forwardHost ) ) { isInner = IpUtils . isInnerIp ( StringUtils . split ( forwardHost , ":" ) [ 0 ] ) ; } else { if ( ! isInner ) { isInner = IpUtils . isInnerIp ( IpUtils . getinvokerIpAddr ( request ) ) ; } } return isInner ;
public class Event { /** * setter for themes _ protein - sets * @ generated * @ param v value to set into the feature */ public void setThemes_protein ( FSArray v ) { } }
if ( Event_Type . featOkTst && ( ( Event_Type ) jcasType ) . casFeat_themes_protein == null ) jcasType . jcas . throwFeatMissing ( "themes_protein" , "ch.epfl.bbp.uima.genia.Event" ) ; jcasType . ll_cas . ll_setRefValue ( addr , ( ( Event_Type ) jcasType ) . casFeatCode_themes_protein , jcasType . ll_cas . ll_getFSRef ( v ) ) ;
public class CmsProjectDriver { /** * Creates a < code > CmsPublishJobInfoBean < / code > from a result set . < p > * @ param res the result set * @ return an initialized < code > CmsPublishJobInfoBean < / code > * @ throws SQLException if something goes wrong */ protected CmsPublishJobInfoBean createPublishJobInfoBean ( ResultSet res ) throws SQLException { } }
return new CmsPublishJobInfoBean ( new CmsUUID ( res . getString ( "HISTORY_ID" ) ) , new CmsUUID ( res . getString ( "PROJECT_ID" ) ) , res . getString ( "PROJECT_NAME" ) , new CmsUUID ( res . getString ( "USER_ID" ) ) , res . getString ( "PUBLISH_LOCALE" ) , res . getInt ( "PUBLISH_FLAGS" ) , res . getInt ( "RESOURCE_COUNT" ) , res . getLong ( "ENQUEUE_TIME" ) , res . getLong ( "START_TIME" ) , res . getLong ( "FINISH_TIME" ) ) ;
public class LocalForage { /** * Loads the offline library . You normally never have to do this manually */ public static void load ( ) { } }
if ( ! isLoaded ( ) ) { ScriptInjector . fromString ( LocalForageResources . INSTANCE . js ( ) . getText ( ) ) . setWindow ( ScriptInjector . TOP_WINDOW ) . inject ( ) ; }
public class DateFormat { /** * Gets the date / time formatter with the default formatting style * for the default locale . * @ return a date / time formatter . */ public final static DateFormat getDateTimeInstance ( ) { } }
return get ( DEFAULT , DEFAULT , 3 , Locale . getDefault ( Locale . Category . FORMAT ) ) ;
public class CollectionUtils { /** * Returns the index of the first occurrence in the list of the specified * object , using object identity ( = = ) not equality as the criterion for object * presence . If this list does not contain the element , return - 1. * @ param l * The { @ link List } to find the object in . * @ param o * The sought - after object . * @ return Whether or not the List was changed . */ public static < T > int getIndex ( List < T > l , T o ) { } }
int i = 0 ; for ( Object o1 : l ) { if ( o == o1 ) return i ; else i ++ ; } return - 1 ;
public class DateTimeExpression { /** * Create a ISO yearweek expression * @ return year week */ public NumberExpression < Integer > yearWeek ( ) { } }
if ( yearWeek == null ) { yearWeek = Expressions . numberOperation ( Integer . class , Ops . DateTimeOps . YEAR_WEEK , mixin ) ; } return yearWeek ;
public class Utils { /** * Reads characters until any ' end ' character is encountered . * @ param out * The StringBuilder to write to . * @ param in * The Input String . * @ param start * Starting position . * @ param end * End characters . * @ return The new position or - 1 if no ' end ' char was found . */ public final static int readUntil ( final StringBuilder out , final String in , final int start , final char ... end ) { } }
int pos = start ; while ( pos < in . length ( ) ) { final char ch = in . charAt ( pos ) ; if ( ch == '\\' && pos + 1 < in . length ( ) ) { pos = escape ( out , in . charAt ( pos + 1 ) , pos ) ; } else { boolean endReached = false ; for ( int n = 0 ; n < end . length ; n ++ ) { if ( ch == end [ n ] ) { endReached = true ; break ; } } if ( endReached ) { break ; } out . append ( ch ) ; } pos ++ ; } return ( pos == in . length ( ) ) ? - 1 : pos ;
public class TwitterImpl { /** * / * Trends Resources */ @ Override public Trends getPlaceTrends ( int woeid ) throws TwitterException { } }
return factory . createTrends ( get ( conf . getRestBaseURL ( ) + "trends/place.json?id=" + woeid ) ) ;
public class BootstrapCircleThumbnail { /** * This method is called when the Circle Image needs to be recreated due to changes in size etc . * A Paint object uses a BitmapShader to draw a center - cropped , circular image onto the View * Canvas . A Matrix on the BitmapShader scales the original Bitmap to match the current view * bounds , avoiding any inefficiencies in duplicating Bitmaps . * < a href = " http : / / www . curious - creature . com / 2012/12/11 / android - recipe - 1 - image - with - rounded - corners " > * Further reading < / a > */ protected void updateImageState ( ) { } }
float viewWidth = getWidth ( ) ; float viewHeight = getHeight ( ) ; if ( ( int ) viewWidth <= 0 || ( int ) viewHeight <= 0 ) { return ; } if ( sourceBitmap != null ) { BitmapShader imageShader = new BitmapShader ( sourceBitmap , Shader . TileMode . CLAMP , Shader . TileMode . CLAMP ) ; imagePaint . setShader ( imageShader ) ; // Scale the bitmap using a matrix , ensuring that it always matches the view bounds . float bitmapWidth = sourceBitmap . getWidth ( ) ; float bitmapHeight = sourceBitmap . getHeight ( ) ; float scaleFactor = ( bitmapWidth < bitmapHeight ) ? bitmapWidth : bitmapHeight ; float xScale = viewWidth / scaleFactor ; float yScale = viewHeight / scaleFactor ; // Translate image to center crop ( if it is not a perfect square bitmap ) float dx = 0 ; float dy = 0 ; if ( bitmapWidth > bitmapHeight ) { dx = ( viewWidth - bitmapWidth * xScale ) * 0.5f ; } else if ( bitmapHeight > bitmapWidth ) { dy = ( viewHeight - bitmapHeight * yScale ) * 0.5f ; } matrix . set ( null ) ; matrix . setScale ( xScale , yScale ) ; matrix . postTranslate ( ( dx + 0.5f ) , ( dy + 0.5f ) ) ; imageShader . setLocalMatrix ( matrix ) ; imageRectF . set ( 0 , 0 , viewWidth , viewHeight ) ; } updateBackground ( ) ; invalidate ( ) ;
public class DescribeDirectoriesResult { /** * The list of < a > DirectoryDescription < / a > objects that were retrieved . * It is possible that this list contains less than the number of items specified in the < code > Limit < / code > member * of the request . This occurs if there are less than the requested number of items left to retrieve , or if the * limitations of the operation have been exceeded . * @ param directoryDescriptions * The list of < a > DirectoryDescription < / a > objects that were retrieved . < / p > * It is possible that this list contains less than the number of items specified in the < code > Limit < / code > * member of the request . This occurs if there are less than the requested number of items left to retrieve , * or if the limitations of the operation have been exceeded . */ public void setDirectoryDescriptions ( java . util . Collection < DirectoryDescription > directoryDescriptions ) { } }
if ( directoryDescriptions == null ) { this . directoryDescriptions = null ; return ; } this . directoryDescriptions = new com . amazonaws . internal . SdkInternalList < DirectoryDescription > ( directoryDescriptions ) ;
public class CreateJobQueueRequest { /** * The set of compute environments mapped to a job queue and their order relative to each other . The job scheduler * uses this parameter to determine which compute environment should execute a given job . Compute environments must * be in the < code > VALID < / code > state before you can associate them with a job queue . You can associate up to three * compute environments with a job queue . * @ param computeEnvironmentOrder * The set of compute environments mapped to a job queue and their order relative to each other . The job * scheduler uses this parameter to determine which compute environment should execute a given job . Compute * environments must be in the < code > VALID < / code > state before you can associate them with a job queue . You * can associate up to three compute environments with a job queue . */ public void setComputeEnvironmentOrder ( java . util . Collection < ComputeEnvironmentOrder > computeEnvironmentOrder ) { } }
if ( computeEnvironmentOrder == null ) { this . computeEnvironmentOrder = null ; return ; } this . computeEnvironmentOrder = new java . util . ArrayList < ComputeEnvironmentOrder > ( computeEnvironmentOrder ) ;
public class ReplaceTopicRuleRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( ReplaceTopicRuleRequest replaceTopicRuleRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( replaceTopicRuleRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( replaceTopicRuleRequest . getRuleName ( ) , RULENAME_BINDING ) ; protocolMarshaller . marshall ( replaceTopicRuleRequest . getTopicRulePayload ( ) , TOPICRULEPAYLOAD_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class CreateUploadRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( CreateUploadRequest createUploadRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( createUploadRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( createUploadRequest . getProjectArn ( ) , PROJECTARN_BINDING ) ; protocolMarshaller . marshall ( createUploadRequest . getName ( ) , NAME_BINDING ) ; protocolMarshaller . marshall ( createUploadRequest . getType ( ) , TYPE_BINDING ) ; protocolMarshaller . marshall ( createUploadRequest . getContentType ( ) , CONTENTTYPE_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class OldBasicMidiConverter { /** * Returns the corresponding midi events for a tuplet . */ public MidiEvent [ ] getMidiEventsFor ( Tuplet tuplet , KeySignature key , long elapsedTime ) throws InvalidMidiDataException { } }
float totalTupletLength = tuplet . getTotalRelativeLength ( ) ; Vector tupletAsVector = tuplet . getNotesAsVector ( ) ; int notesNb = tupletAsVector . size ( ) ; MidiEvent [ ] events = new MidiEvent [ 3 * notesNb ] ; for ( int j = 0 ; j < tupletAsVector . size ( ) ; j ++ ) { Note note = null ; // to be fixed : this can be a note or a multi note . // if ( tupletAsVector . elementAt ( j ) instanceof Note ) note = ( Note ) ( tupletAsVector . elementAt ( j ) ) ; // else // note = ( Note ) ( ( MultiNote ) tupletAsVector . elementAt ( j ) ) . getNotesAsVector ( ) . elementAt ( 0 ) ; long noteLength = getNoteLengthInTicks ( note ) ; // , defaultLength ) ; noteLength = ( long ) ( noteLength * totalTupletLength / notesNb ) ; if ( ! note . isRest ( ) ) { ShortMessage myNoteOn = new ShortMessage ( ) ; myNoteOn . setMessage ( ShortMessage . NOTE_ON , getMidiNoteNumber ( note , key ) , 50 ) ; events [ 3 * j ] = new MidiEvent ( myNoteOn , elapsedTime ) ; events [ 3 * j + 1 ] = new MidiEvent ( new NotationMarkerMessage ( ( Note ) note ) , elapsedTime ) ; ShortMessage myNoteOff = new ShortMessage ( ) ; myNoteOff . setMessage ( ShortMessage . NOTE_OFF , getMidiNoteNumber ( note , key ) , 50 ) ; elapsedTime += noteLength ; events [ 3 * j + 2 ] = new MidiEvent ( myNoteOff , elapsedTime ) ; } /* else if ( tupletAsVector . elementAt ( j ) instanceof MultiNote ) events = getMidiEventsFor ( ( MultiNote ) tupletAsVector . elementAt ( j ) , key , elapsedTime ) ; long noteLength = events [ 1 + ( events . length - 1 ) / 2 ] . getTick ( ) - events [ 0 ] . getTick ( ) ; noteLength = ( long ) ( noteLength * totalTupletLength / tuplet . countNotes ( ) ) ; for ( int i = 0 ; i < ( events . length - 1 ) / 2-1 ; i + + ) events [ i ] . setTick ( elapsedTime ) ; events [ 2 * i + 1 ] . setTick ( elapsedTime + noteLength ) ; */ } return events ;
public class ExtendedClassPathClassLoader { /** * Retrieves resource as byte array from a directory or jar in the file system . * @ param fileName * @ param location * @ return * @ throws IOException */ private static byte [ ] getData ( String fileName , Object location ) throws IOException { } }
byte [ ] data ; if ( location instanceof String ) { data = FileSupport . getBinaryFromJar ( fileName , ( String ) location ) ; } else if ( location instanceof File ) { InputStream in = new FileInputStream ( ( File ) location ) ; data = StreamSupport . absorbInputStream ( in ) ; in . close ( ) ; } else { throw new NoClassDefFoundError ( "file '" + fileName + "' could not be loaded from '" + location + '\'' ) ; } return data ;
public class BlockHeartbeatPRequest { /** * < pre > * * the map of added blocks on all tiers * < / pre > * < code > map & lt ; string , . alluxio . grpc . block . TierList & gt ; addedBlocksOnTiers = 4 ; < / code > */ public java . util . Map < java . lang . String , alluxio . grpc . TierList > getAddedBlocksOnTiersMap ( ) { } }
return internalGetAddedBlocksOnTiers ( ) . getMap ( ) ;
public class CPDefinitionVirtualSettingServiceUtil { /** * NOTE FOR DEVELOPERS : * Never modify this class directly . Add custom service methods to { @ link com . liferay . commerce . product . type . virtual . service . impl . CPDefinitionVirtualSettingServiceImpl } and rerun ServiceBuilder to regenerate this class . */ public static com . liferay . commerce . product . type . virtual . model . CPDefinitionVirtualSetting addCPDefinitionVirtualSetting ( String className , long classPK , long fileEntryId , String url , int activationStatus , long duration , int maxUsages , boolean useSample , long sampleFileEntryId , String sampleUrl , boolean termsOfUseRequired , java . util . Map < java . util . Locale , String > termsOfUseContentMap , long termsOfUseJournalArticleResourcePrimKey , boolean override , com . liferay . portal . kernel . service . ServiceContext serviceContext ) throws com . liferay . portal . kernel . exception . PortalException { } }
return getService ( ) . addCPDefinitionVirtualSetting ( className , classPK , fileEntryId , url , activationStatus , duration , maxUsages , useSample , sampleFileEntryId , sampleUrl , termsOfUseRequired , termsOfUseContentMap , termsOfUseJournalArticleResourcePrimKey , override , serviceContext ) ;
public class SecureUtil { /** * 创建Sign算法对象 < br > * 私钥和公钥同时为空时生成一对新的私钥和公钥 < br > * 私钥和公钥可以单独传入一个 , 如此则只能使用此钥匙来做签名或验证 * @ param privateKey 私钥 * @ param publicKey 公钥 * @ return { @ link Sign } * @ since 3.3.0 */ public static Sign sign ( SignAlgorithm algorithm , byte [ ] privateKey , byte [ ] publicKey ) { } }
return new Sign ( algorithm , privateKey , publicKey ) ;
public class SearchView { /** * Handles the key down event for dealing with action keys . * @ param keyCode This is the keycode of the typed key , and is the same value as * found in the KeyEvent parameter . * @ param event The complete event record for the typed key * @ return true if the event was handled here , or false if not . */ @ Override public boolean onKeyDown ( int keyCode , KeyEvent event ) { } }
if ( mSearchable == null ) { return false ; } // if it ' s an action specified by the searchable activity , launch the // entered query with the action key // TODO SearchableInfo . ActionKeyInfo actionKey = mSearchable . findActionKey ( keyCode ) ; // TODO if ( ( actionKey ! = null ) & & ( actionKey . getQueryActionMsg ( ) ! = null ) ) { // TODO launchQuerySearch ( keyCode , actionKey . getQueryActionMsg ( ) , mQueryTextView . getText ( ) // TODO . toString ( ) ) ; // TODO return true ; // TODO } return super . onKeyDown ( keyCode , event ) ;