signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class Unchecked { /** * Wrap a { @ link CheckedDoubleUnaryOperator } in a { @ link DoubleUnaryOperator } with a custom handler for checked exceptions . * Example : * < code > < pre > * LongStream . of ( 1.0 , 2.0 , 3.0 ) . map ( Unchecked . doubleUnaryOperator ( * if ( d & lt ; 0.0) * throw new Excepti...
return t -> { try { return operator . applyAsDouble ( t ) ; } catch ( Throwable e ) { handler . accept ( e ) ; throw new IllegalStateException ( "Exception handler must throw a RuntimeException" , e ) ; } } ;
public class ScriptPattern { /** * Returns true if this script is of the form { @ code DUP HASH160 < pubkey hash > EQUALVERIFY CHECKSIG } , ie , payment to an * address like { @ code 1VayNert3x1KzbpzMGt2qdqrAThiRovi8 } . This form was originally intended for the case where you wish * to send somebody money with a w...
List < ScriptChunk > chunks = script . chunks ; if ( chunks . size ( ) != 5 ) return false ; if ( ! chunks . get ( 0 ) . equalsOpCode ( OP_DUP ) ) return false ; if ( ! chunks . get ( 1 ) . equalsOpCode ( OP_HASH160 ) ) return false ; byte [ ] chunk2data = chunks . get ( 2 ) . data ; if ( chunk2data == null ) return fa...
public class AllianceApi { /** * Get alliance information Public information about an alliance - - - This * route is cached for up to 3600 seconds * @ param allianceId * An EVE alliance ID ( required ) * @ param datasource * The server name you would like data from ( optional , default to * tranquility ) ...
com . squareup . okhttp . Call call = getAlliancesAllianceIdValidateBeforeCall ( allianceId , datasource , ifNoneMatch , null ) ; Type localVarReturnType = new TypeToken < AllianceResponse > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnType ) ;
public class JDBCStorageConnection { /** * Read Property Values . * @ param identifier * property identifier * @ param cid * Property id * @ param pdata * PropertyData * @ return list of ValueData * @ throws IOException * i / O error * @ throws SQLException * if database errro occurs * @ throws ...
List < ValueDataWrapper > data = new ArrayList < ValueDataWrapper > ( ) ; final ResultSet valueRecords = findValuesByPropertyId ( cid ) ; try { while ( valueRecords . next ( ) ) { final int orderNum = valueRecords . getInt ( COLUMN_VORDERNUM ) ; final String storageId = valueRecords . getString ( COLUMN_VSTORAGE_DESC )...
public class HikariConnectionProvider { @ SuppressWarnings ( "rawtypes" ) @ Override public void configure ( Map props ) throws HibernateException { } }
try { LOGGER . debug ( "Configuring HikariCP" ) ; this . hcfg = HikariConfigurationUtil . loadConfiguration ( props ) ; this . hds = new HikariDataSource ( this . hcfg ) ; } catch ( Exception e ) { throw new HibernateException ( e ) ; } LOGGER . debug ( "HikariCP Configured" ) ;
public class PyramidOps { /** * Computes the gradient for each image the pyramid . * It is assumed that the gradient has the same scales as the input . If not * initialized then it will be initialized . If already initialized it is * assumed to be setup for the same input image size . * @ param input Input pyra...
for ( int i = 0 ; i < input . getNumLayers ( ) ; i ++ ) { I imageIn = input . getLayer ( i ) ; gradient . process ( imageIn , derivX [ i ] , derivY [ i ] ) ; }
public class PaySignUtil { /** * 根据参数map获取待签名字符串 * @ param params 待签名参数map * @ param includeEmptyParam 是否包含值为空的参数 : * 与 HMS - SDK 支付能力交互的签名或验签 , 需要为false ( 不包含空参数 ) * 由华为支付服务器回调给开发者的服务器的支付结果验签 , 需要为true ( 包含空参数 ) * @ return 待签名字符串 */ private static String getNoSign ( Map < String , Object > params , boolean i...
// 对参数按照key做升序排序 , 对map的所有value进行处理 , 转化成string类型 // 拼接成key = value & key = value & . . . . 格式的字符串 StringBuilder content = new StringBuilder ( ) ; // 按照key做排序 List < String > keys = new ArrayList < String > ( params . keySet ( ) ) ; Collections . sort ( keys ) ; String value = null ; Object object = null ; boolean isFi...
public class PtoPLocalMsgsItemStream { /** * Sets the name currently in use by this localization . * @ param newIdentifier */ private void setName ( String newName ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "setName" , newName ) ; this . _name = newName ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "setName" ) ;
public class VirtualNetworksInner { /** * Checks whether a private IP address is available for use . * @ param resourceGroupName The name of the resource group . * @ param virtualNetworkName The name of the virtual network . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return...
if ( resourceGroupName == null ) { throw new IllegalArgumentException ( "Parameter resourceGroupName is required and cannot be null." ) ; } if ( virtualNetworkName == null ) { throw new IllegalArgumentException ( "Parameter virtualNetworkName is required and cannot be null." ) ; } if ( this . client . subscriptionId ( ...
public class Query { /** * @ see org . eclipse . datatools . connectivity . oda . IQuery # setTime ( java . lang . String , java . sql . Time ) */ public void setTime ( String parameterName , Time value ) throws OdaException { } }
// only applies to named input parameter parameters . put ( parameterName , value ) ;
public class HadoopUtils { /** * Set the System properties into Hadoop configuration . * This method won ' t override existing properties even if they are set as System properties . * @ param configuration Hadoop configuration * @ param propertyNames the properties to be set */ private static void setConfiguratio...
for ( PropertyKey propertyName : propertyNames ) { setConfigurationFromSystemProperty ( configuration , propertyName . toString ( ) ) ; }
public class AbstractRemoteClient { /** * { @ inheritDoc } */ @ Override public void removeConnectionStateObserver ( final Observer < Remote , ConnectionState . State > observer ) { } }
connectionStateObservable . removeObserver ( observer ) ;
public class InterceptionProcessor { /** * < p > Accepts the { @ link InvocationContext } and executes any { @ link Interceptor } s which fall within * the scope of the current proxy invocation by passing in the provided { @ link HttpRequestBase } . < / p > * < p > See { @ link AbstractRequestProcessor # process ( ...
try { List < Class < ? extends Interceptor > > interceptors = new ArrayList < Class < ? extends Interceptor > > ( ) ; Intercept endpointMetadata = context . getEndpoint ( ) . getAnnotation ( Intercept . class ) ; Intercept requestMetadata = context . getRequest ( ) . getAnnotation ( Intercept . class ) ; if ( isDetache...
public class Tree { /** * This method will report all collected errors . * @ param error */ public void collectChildError ( String error ) { } }
if ( _errorText == null ) { _errorText = new InternalStringBuilder ( 32 ) ; } _errorText . append ( error ) ;
public class AccountFiltersInner { /** * Update an Account Filter . * Updates an existing Account Filter in the Media Services account . * @ param resourceGroupName The name of the resource group within the Azure subscription . * @ param accountName The Media Services account name . * @ param filterName The Acc...
return updateWithServiceResponseAsync ( resourceGroupName , accountName , filterName , parameters ) . toBlocking ( ) . single ( ) . body ( ) ;
public class NettyHelper { /** * 关闭服务端IO线程 ( 只有最后一个使用者关闭才生效 ) * @ param config 服务端配置 */ public static void closeServerIoEventLoopGroup ( ServerTransportConfig config ) { } }
EventLoopGroup ioGroup = serverIoGroups . get ( config . getProtocolType ( ) ) ; if ( closeEventLoopGroupIfNoRef ( ioGroup ) ) { serverIoGroups . remove ( config . getProtocolType ( ) ) ; }
public class LoadBalancersInner { /** * Deletes the specified load balancer . * @ param resourceGroupName The name of the resource group . * @ param loadBalancerName The name of the load balancer . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ throws CloudException thrown if t...
beginDeleteWithServiceResponseAsync ( resourceGroupName , loadBalancerName ) . toBlocking ( ) . single ( ) . body ( ) ;
public class ListParentsRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( ListParentsRequest listParentsRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( listParentsRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( listParentsRequest . getChildId ( ) , CHILDID_BINDING ) ; protocolMarshaller . marshall ( listParentsRequest . getNextToken ( ) , NEXTTOKEN_BINDING ) ; protocolMarsha...
public class I18nController { /** * Gets the internationalized messages as a JSON document compliant with the I18Next format . * @ param listOfLocales the list of locales * @ param ifNoneMatch the received ETAG if any * @ return the JSON document containing the messages */ @ Route ( method = HttpMethod . GET , ur...
// Parse the list of locale List < Locale > locales = new ArrayList < > ( ) ; if ( ! Strings . isNullOrEmpty ( listOfLocales ) ) { String [ ] items = listOfLocales . split ( " " ) ; for ( String item : items ) { // Manage the ' dev ' value ( it ' s the default locale used by i18next if ( "dev" . equalsIgnoreCase ( item...
public class Scalr { /** * Used to apply padding around the edges of an image using the given color * to fill the extra padded space and then return the result . { @ link Color } s * using an alpha channel ( i . e . transparency ) are supported . * The amount of < code > padding < / code > specified is applied to...
long t = - 1 ; if ( DEBUG ) t = System . currentTimeMillis ( ) ; if ( src == null ) throw new IllegalArgumentException ( "src cannot be null" ) ; if ( padding < 1 ) throw new IllegalArgumentException ( "padding [" + padding + "] must be > 0" ) ; if ( color == null ) throw new IllegalArgumentException ( "color cannot be...
public class SimpleSolrPersistentEntity { /** * ( non - Javadoc ) * @ see org . springframework . data . solr . core . mapping . SolrPersistentEntity # getScoreProperty ( ) */ @ Nullable @ Override public SolrPersistentProperty getScoreProperty ( ) { } }
SolrPersistentProperty scoreProperty = getPersistentProperty ( Score . class ) ; if ( scoreProperty != null ) { return scoreProperty ; } return getPersistentProperty ( org . springframework . data . solr . repository . Score . class ) ;
public class AmazonWorkLinkClient { /** * Describes the device policy configuration for the specified fleet . * @ param describeDevicePolicyConfigurationRequest * @ return Result of the DescribeDevicePolicyConfiguration operation returned by the service . * @ throws UnauthorizedException * You are not authorize...
request = beforeClientExecution ( request ) ; return executeDescribeDevicePolicyConfiguration ( request ) ;
public class Property_Builder { /** * Sets the value to be returned by { @ link * org . inferred . freebuilder . processor . property . Property # getGetterName ( ) } . * @ return this { @ code Builder } object * @ throws NullPointerException if { @ code getterName } is null */ public org . inferred . freebuilder...
this . getterName = Objects . requireNonNull ( getterName ) ; _unsetProperties . remove ( Property . GETTER_NAME ) ; return ( org . inferred . freebuilder . processor . property . Property . Builder ) this ;
public class CmsCommentImages { /** * Performs the comment images operation . < p > * @ return true , if the resources were successfully processed , otherwise false * @ throws CmsException if commenting is not successful */ protected boolean performDialogOperation ( ) throws CmsException { } }
// lock the image gallery folder checkLock ( getParamResource ( ) ) ; Iterator < CmsResource > i = getImages ( ) . iterator ( ) ; // loop over all image resources to change the properties while ( i . hasNext ( ) ) { CmsResource res = i . next ( ) ; String imageName = res . getName ( ) ; String propertySuffix = "" + ima...
public class AbstractCommonShapeFileWriter { /** * Write the Shape file and its associated files . * @ param elements are the elements to write down * @ throws IOException in case of error . */ public void write ( Collection < ? extends E > elements ) throws IOException { } }
final Progression progressBar = getTaskProgression ( ) ; Progression subTask = null ; if ( progressBar != null ) { progressBar . setProperties ( 0 , 0 , ( elements . size ( ) + 1 ) * 100 , false ) ; } if ( this . fileBounds == null ) { this . fileBounds = getFileBounds ( ) ; } if ( this . fileBounds != null ) { writeHe...
public class Pages { /** * Inserts a widget into the tab panel . If the Widget is already attached to * the TabPanel , it will be moved to the requested index . * @ param widget the widget to be inserted * @ param tabText the text to be shown on its tab * @ param asHTML < code > true < / code > to treat the spe...
// Delegate updates to the TabBar to our DeckPanel implementation deck . insertProtected ( widget , tabText , asHTML , beforeIndex ) ;
public class Period { /** * Returns a copy of this period with the specified days subtracted . * This subtracts the amount from the days unit in a copy of this period . * The years and months units are unaffected . * For example , " 1 year , 6 months and 3 days " minus 2 days returns " 1 year , 6 months and 1 day...
return ( daysToSubtract == Long . MIN_VALUE ? plusDays ( Long . MAX_VALUE ) . plusDays ( 1 ) : plusDays ( - daysToSubtract ) ) ;
public class ApiOvhOrder { /** * Get prices and contracts information * REST : GET / order / email / pro / { service } / account / { duration } * @ param number [ required ] Number of Accounts to order * @ param service [ required ] The internal name of your pro organization * @ param duration [ required ] Dura...
String qPath = "/order/email/pro/{service}/account/{duration}" ; StringBuilder sb = path ( qPath , service , duration ) ; query ( sb , "number" , number ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , OvhOrder . class ) ;
public class AssetDeliveryPolicy { /** * Create an operation that will list all the asset delivery policies at the * given link . * @ param link * Link to request all the asset delivery policies . * @ return The list operation . */ public static DefaultListOperation < AssetDeliveryPolicyInfo > list ( LinkInfo <...
return new DefaultListOperation < AssetDeliveryPolicyInfo > ( link . getHref ( ) , new GenericType < ListResult < AssetDeliveryPolicyInfo > > ( ) { } ) ;
public class AddDynamicSearchAdsCampaign { /** * Runs the example . * @ param adWordsServices the services factory . * @ param session the session . * @ throws ApiException if the API request failed with one or more service errors . * @ throws RemoteException if the API request failed due to other errors . */ p...
Budget budget = createBudget ( adWordsServices , session ) ; Campaign campaign = createCampaign ( adWordsServices , session , budget ) ; AdGroup adGroup = createAdGroup ( adWordsServices , session , campaign ) ; createExpandedDSA ( adWordsServices , session , adGroup ) ; addWebPageCriteria ( adWordsServices , session ,...
public class DefaultOAuthAuthorizationCodeService { /** * ~ Methods * * * * * */ @ Transactional @ Override public OAuthAuthorizationCode create ( OAuthAuthorizationCode authCodeEntity ) { } }
requireNotDisposed ( ) ; requireArgument ( StringUtils . isNotBlank ( authCodeEntity . getAuthorizationCode ( ) ) , "authorization_code cannot be null or empty" ) ; requireArgument ( StringUtils . isNotBlank ( authCodeEntity . getState ( ) ) , "state cannot be null or empty" ) ; requireArgument ( StringUtils . isNotBla...
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EClass getIfcRampFlight ( ) { } }
if ( ifcRampFlightEClass == null ) { ifcRampFlightEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 497 ) ; } return ifcRampFlightEClass ;
public class ASN1 { /** * Encode a private key into a PKCS # 8 private key structure . * @ param algorithm - EC curve OID * @ param keyBytes - raw bytes of the key * @ param spki - optional subject public key info structure to include * @ return byte array of encoded bytes * @ throws CoseException - ASN . 1 e...
// PKCS # 8 : : = SEQUENCE { // version INTEGER { 0} // privateKeyALgorithm SEQUENCE { // algorithm OID , // parameters ANY // privateKey ECPrivateKey , // attributes [ 0 ] IMPLICIT Attributes OPTIONAL // publicKey [ 1 ] IMPLICIT BIT STRING OPTIONAL try { ArrayList < byte [ ] > xxx = new ArrayList < byte [ ] > ( ) ; xx...
public class VBSFaxClientSpi { /** * This function will cancel an existing fax job . * @ param faxJob * The fax job object containing the needed information */ @ Override protected void cancelFaxJobImpl ( FaxJob faxJob ) { } }
String name = VBSFaxClientSpi . VBS_WIN_XP_CANCEL_SCRIPT ; if ( this . useWin2kAPI ) { name = VBSFaxClientSpi . VBS_WIN_2K_CANCEL_SCRIPT ; } // invoke script this . invokeExistingFaxJobAction ( name , faxJob , FaxActionType . CANCEL_FAX_JOB ) ;
public class XElement { /** * Reads the contents of a indexed column as an XML . * @ param rs the result set to read from * @ param index the column index * @ return the parsed XNElement or null if the column contained null * @ throws SQLException on SQL error * @ throws IOException on IO error * @ throws X...
try ( InputStream is = rs . getBinaryStream ( index ) ) { if ( is != null ) { return parseXML ( is ) ; } return null ; }
public class MigrationExample { /** * Precondition : * 1 . Make sure the two redis version is same . * 2 . Make sure the single key - value is not very big . ( highly recommend less then 1 MB ) * We running following steps to sync two redis . * 1 . Get rdb stream from source redis . * 2 . Convert source rdb s...
RedisURI suri = new RedisURI ( sourceUri ) ; RedisURI turi = new RedisURI ( targetUri ) ; final ExampleClient target = new ExampleClient ( turi . getHost ( ) , turi . getPort ( ) ) ; Configuration tconfig = Configuration . valueOf ( turi ) ; if ( tconfig . getAuthPassword ( ) != null ) { Object auth = target . send ( A...
public class CodeBook { /** * returns the number of bits and * modifies a * to the quantization value */ int encodev ( int best , float [ ] a , Buffer b ) { } }
for ( int k = 0 ; k < dim ; k ++ ) { a [ k ] = valuelist [ best * dim + k ] ; } return ( encode ( best , b ) ) ;
public class TaskModel { /** * This method is called from the task class each time an attribute * is added , ensuring that all of the attributes present in each task * record are present in the resource model . * @ param field field identifier */ private void add ( int field ) { } }
if ( field < m_flags . length ) { if ( m_flags [ field ] == false ) { m_flags [ field ] = true ; m_fields [ m_count ] = field ; ++ m_count ; } }
public class HTMLMacro { /** * Parse the passed context using a wiki syntax parser and render the result as an XHTML string . * @ param content the content to parse * @ param transformation the macro transformation to execute macros when wiki is set to true * @ param context the context of the macros transformati...
String xhtml ; try { // Parse the wiki syntax XDOM xdom = this . contentParser . parse ( content , context , false , false ) ; // Force clean = false for sub HTML macro : // - at this point we don ' t know the context of the macro , it can be some < div > directly followed by the // html macro , it this case the macro ...
public class SentenceSeg { /** * loop the reader until the specifield char is found . * @ param echar * @ throws IOException */ protected void readUntil ( char echar ) throws IOException { } }
int ch , i = 0 ; IStringBuffer sb = new IStringBuffer ( ) ; while ( ( ch = readNext ( ) ) != - 1 ) { if ( ++ i >= MAX_QUOTE_LENGTH ) { /* * push back the readed chars * and reset the global idx value . */ for ( int j = sb . length ( ) - 1 ; j >= 0 ; j -- ) { reader . unread ( sb . charAt ( j ) ) ; } idx -= sb . lengt...
public class AbstractRouter { /** * Gets the url of the route handled by the specified action method . This * implementation delegates to { @ link # getReverseRouteFor ( java . lang . Class , String , java . util . Map ) } . * @ param controller the controller object * @ param method the controller method * @ p...
return getReverseRouteFor ( controller . getClass ( ) , method , params ) ;
public class DbDevice { public void putPipeProperty ( ArrayList < DbPipe > dbPipes ) throws DevFailed { } }
for ( DbPipe dbPipe : dbPipes ) database . putDevicePipeProperty ( deviceName , dbPipe ) ;
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EEnum getIfcEnergySequenceEnum ( ) { } }
if ( ifcEnergySequenceEnumEEnum == null ) { ifcEnergySequenceEnumEEnum = ( EEnum ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 832 ) ; } return ifcEnergySequenceEnumEEnum ;
public class Notation { /** * Get local paths for notations * @ param localRepoPath String path * @ param notations List of notations * @ return List of paths * @ throws NaetherException exception */ public static List < String > getLocalPaths ( String localRepoPath , List < String > notations ) throws NaetherE...
DefaultServiceLocator locator = new DefaultServiceLocator ( ) ; SimpleLocalRepositoryManagerFactory factory = new SimpleLocalRepositoryManagerFactory ( ) ; factory . initService ( locator ) ; LocalRepository localRepo = new LocalRepository ( localRepoPath ) ; LocalRepositoryManager manager = null ; try { manager = fact...
public class MPPUtility { /** * Reads a combined date and time value expressed in tenths of a minute . * @ param data byte array of data * @ param offset location of data as offset into the array * @ return time value */ public static final Date getTimestampFromTenths ( byte [ ] data , int offset ) { } }
long ms = ( ( long ) getInt ( data , offset ) ) * 6000 ; return ( DateHelper . getTimestampFromLong ( EPOCH + ms ) ) ;
public class IntTupleIterables { /** * Returns an iterable returning an iterator that returns * { @ link MutableIntTuple } s up to the given maximum values , in * lexicographical order . < br > * < br > * A copy of the given tuple will be stored internally . < br > * < br > * Also see < a href = " . . / . ....
return iterable ( Order . LEXICOGRAPHICAL , IntTuples . zero ( max . getSize ( ) ) , max ) ;
public class AccountFiltersInner { /** * List Account Filters . * List Account Filters in the Media Services account . * @ param resourceGroupName The name of the resource group within the Azure subscription . * @ param accountName The Media Services account name . * @ throws IllegalArgumentException thrown if ...
return listWithServiceResponseAsync ( resourceGroupName , accountName ) . map ( new Func1 < ServiceResponse < Page < AccountFilterInner > > , Page < AccountFilterInner > > ( ) { @ Override public Page < AccountFilterInner > call ( ServiceResponse < Page < AccountFilterInner > > response ) { return response . body ( ) ;...
public class MockitoDebuggerImpl { /** * TODO : when MockitoDebugger is deleted , delete this implementation , too */ @ Deprecated public String printInvocations ( Object ... mocks ) { } }
String out = "" ; List < Invocation > invocations = AllInvocationsFinder . find ( asList ( mocks ) ) ; out += line ( "********************************" ) ; out += line ( "*** Mockito interactions log ***" ) ; out += line ( "********************************" ) ; for ( Invocation i : invocations ) { out += line ( i . toS...
public class WindowsJNIFaxClientSpi { /** * This function will resume an existing fax job . * @ param faxJob * The fax job object containing the needed information */ @ Override protected void resumeFaxJobImpl ( FaxJob faxJob ) { } }
// get fax job ID int faxJobIDInt = WindowsFaxClientSpiHelper . getFaxJobID ( faxJob ) ; // invoke fax action this . winResumeFaxJob ( this . faxServerName , faxJobIDInt ) ;
public class ArithmeticUtils { /** * Negate a number */ public static Number minus ( Number n ) { } }
Number value = normalize ( n ) ; Class < ? > type = value . getClass ( ) ; if ( type == Long . class ) return Long . valueOf ( - n . longValue ( ) ) ; return new Double ( - n . doubleValue ( ) ) ;
public class CounterManager { /** * { @ inheritDoc } */ public synchronized void shutdown ( final boolean killTimer ) { } }
if ( ! m_bShutdown ) { try { // shutdown the counters of this counterManager for ( final ICounter counter : m_aCounters ) if ( counter instanceof ISampledCounter ) ( ( ISampledCounter ) counter ) . shutdown ( ) ; if ( killTimer ) m_aTimer . cancel ( ) ; } finally { m_bShutdown = true ; } }
public class ValidatorWrapper { /** * { @ inheritDoc } */ @ Override public int compareTo ( ValidatorWrapper < T > other ) { } }
if ( this == other || getName ( ) . equals ( other . getName ( ) ) ) { return 0 ; } int result = getPriority ( ) . compareTo ( other . getPriority ( ) ) ; if ( result == 0 ) { result = getInsertionOrder ( ) . compareTo ( other . getInsertionOrder ( ) ) ; } return result ;
public class ExtendedLikeFilterImpl { /** * Convenience method to escape any character that is special to the regex system . * @ param inString * the string to fix * @ return the fixed string */ private String fixSpecials ( final String inString ) { } }
StringBuilder tmp = new StringBuilder ( ) ; for ( int i = 0 ; i < inString . length ( ) ; i ++ ) { char chr = inString . charAt ( i ) ; if ( isSpecial ( chr ) ) { tmp . append ( this . escape ) ; tmp . append ( chr ) ; } else { tmp . append ( chr ) ; } } return tmp . toString ( ) ;
public class SavedState { /** * Get number stored at given location * @ param nameOfField The name of the number to retrieve * @ param defaultValue The value to return if the specified value hasn ' t been set * @ return The number saved at this location */ public double getNumber ( String nameOfField , double def...
Double value = ( ( Double ) numericData . get ( nameOfField ) ) ; if ( value == null ) { return defaultValue ; } return value . doubleValue ( ) ;
public class ParameterHistory { /** * Information about the policies assigned to a parameter . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setPolicies ( java . util . Collection ) } or { @ link # withPolicies ( java . util . Collection ) } if you want to ...
if ( this . policies == null ) { setPolicies ( new com . amazonaws . internal . SdkInternalList < ParameterInlinePolicy > ( policies . length ) ) ; } for ( ParameterInlinePolicy ele : policies ) { this . policies . add ( ele ) ; } return this ;
public class AfplibPackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EClass getEFG ( ) { } }
if ( efgEClass == null ) { efgEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( AfplibPackage . eNS_URI ) . getEClassifiers ( ) . get ( 243 ) ; } return efgEClass ;
public class Gamma { /** * Gamma function of the specified value . * @ param x Value . * @ return Result . */ public static double Function ( double x ) { } }
double [ ] P = { 1.60119522476751861407E-4 , 1.19135147006586384913E-3 , 1.04213797561761569935E-2 , 4.76367800457137231464E-2 , 2.07448227648435975150E-1 , 4.94214826801497100753E-1 , 9.99999999999999996796E-1 } ; double [ ] Q = { - 2.31581873324120129819E-5 , 5.39605580493303397842E-4 , - 4.45641913851797240494E-3 , ...
public class ViewFrustum { /** * Checks if the frustum of this camera intersects the given cuboid vertices . * @ param vertices The cuboid local vertices to check the frustum against * @ param position The position of the cuboid * @ return Whether or not the frustum intersects the cuboid */ public boolean interse...
return intersectsCuboid ( vertices , position . getX ( ) , position . getY ( ) , position . getZ ( ) ) ;
public class ContextSensitiveCodeRunner { /** * Intended for use with a debugger to evaluate arbitrary expressions / programs * in the context of a source position being debugged , usually at a breakpoint . * @ param enclosingInstance The instance of the object immediately enclosing the source position . * @ para...
// Must execute in caller ' s classloader try { Class < ? > cls ; try { cls = Class . forName ( ContextSensitiveCodeRunner . class . getName ( ) , false , cl ) ; } catch ( Exception e ) { cls = ContextSensitiveCodeRunner . class ; } Method m = cls . getDeclaredMethod ( "_runMeSomeCode" , Object . class , Object [ ] . c...
public class JAutoSuggest { /** * Force the suggestions to be displayed ( Useful for buttons * e . g . for using JSuggestionField like a ComboBox ) */ public void showSuggest ( ) { } }
assert ( getText ( ) != null ) ; lastWord = getText ( ) . trim ( ) ; // autoSuggestProvider . getSuggestion ( lastWord ) ; if ( ! getText ( ) . toLowerCase ( ) . contains ( lastWord . toLowerCase ( ) ) ) { suggestions . clear ( ) ; } if ( matcher != null ) { matcher . setStop ( ) ; } matcher = new SuggestionFetcher ( )...
public class MarkLogicClient { /** * start Timer task ( write cache ) */ public void initTimer ( ) { } }
stopTimer ( ) ; if ( this . WRITE_CACHE_ENABLED ) { logger . debug ( "configuring write cache with defaults" ) ; timerWriteCache = new TripleWriteCache ( this ) ; writeTimer = new Timer ( ) ; writeTimer . scheduleAtFixedRate ( timerWriteCache , TripleWriteCache . DEFAULT_INITIAL_DELAY , TripleWriteCache . DEFAULT_CACHE...
public class RankingComparator { /** * Compares two solutions according to the ranking attribute . The lower the ranking the better * @ param solution1 Object representing the first solution . * @ param solution2 Object representing the second solution . * @ return - 1 , or 0 , or 1 if o1 is less than , equal , o...
int result ; if ( solution1 == null ) { if ( solution2 == null ) { result = 0 ; } else { result = 1 ; } } else if ( solution2 == null ) { result = - 1 ; } else { int rank1 = Integer . MAX_VALUE ; int rank2 = Integer . MAX_VALUE ; if ( ranking . getAttribute ( solution1 ) != null ) { rank1 = ( int ) ranking . getAttribu...
public class DatePartitionedNestedRetriever { /** * This method could be overwritten to support more complicated file - loading scheme , * e . g . recursively browsing of the source path . */ protected FileStatus [ ] getFilteredFileStatuses ( Path sourcePath , PathFilter pathFilter ) throws IOException { } }
return this . fs . listStatus ( sourcePath , pathFilter ) ;
public class CommerceTierPriceEntryUtil { /** * Returns all the commerce tier price entries where uuid = & # 63 ; and companyId = & # 63 ; . * @ param uuid the uuid * @ param companyId the company ID * @ return the matching commerce tier price entries */ public static List < CommerceTierPriceEntry > findByUuid_C ...
return getPersistence ( ) . findByUuid_C ( uuid , companyId ) ;
public class BaasDocument { /** * Synchronously retrieves the number of document readable to the user that match < code > filter < / code > * in < code > collection < / code > * @ param collection the collection to doCount not < code > null < / code > * @ param filter a filter to apply to the request * @ return...
BaasBox box = BaasBox . getDefaultChecked ( ) ; if ( collection == null ) throw new IllegalArgumentException ( "collection cannot be null" ) ; filter = filter == null ? BaasQuery . builder ( ) . count ( true ) . criteria ( ) : filter . buildUpon ( ) . count ( true ) . criteria ( ) ; Count request = new Count ( box , co...
public class PickerSpinnerAdapter { /** * Finds a spinner item by its id value ( excluding any temporary selection ) . * @ param id The id of the item to search . * @ return The specified TwinTextItem , or null if no item with the given id was found . */ public @ Nullable TwinTextItem getItemById ( int id ) { } }
for ( int index = getCount ( ) - 1 ; index >= 0 ; index -- ) { TwinTextItem item = getItem ( index ) ; if ( item . getId ( ) == id ) return item ; } return null ;
public class UtilValidate { /** * isUSPhoneNumber returns true if string s is a valid U . S . Phone Number . Must be 10 digits . */ public static boolean isUSPhoneNumber ( String s ) { } }
if ( isEmpty ( s ) ) return defaultEmptyOK ; String normalizedPhone = stripCharsInBag ( s , phoneNumberDelimiters ) ; return ( isInteger ( normalizedPhone ) && normalizedPhone . length ( ) == digitsInUSPhoneNumber ) ;
public class ReplacedStep { /** * Groups the idHasContainers by SchemaTable . * Each SchemaTable has a list representing the idHasContainers with the relevant BiPredicate and RecordId * @ return */ private Map < SchemaTable , List < Multimap < BiPredicate , RecordId > > > groupIdsBySchemaTable ( ) { } }
Map < SchemaTable , List < Multimap < BiPredicate , RecordId > > > result = new HashMap < > ( ) ; for ( HasContainer idHasContainer : this . idHasContainers ) { Map < SchemaTable , Boolean > newHasContainerMap = new HashMap < > ( ) ; @ SuppressWarnings ( "unchecked" ) P < Object > idPredicate = ( P < Object > ) idHasCo...
public class MMFF94BasedParameterSetReader { /** * Sets the torsion attribute stored into the parameter set * @ throws Exception Description of the Exception */ private void setTorsion ( ) throws Exception { } }
List data = null ; st . nextToken ( ) ; String scode = st . nextToken ( ) ; // String scode String sid1 = st . nextToken ( ) ; String sid2 = st . nextToken ( ) ; String sid3 = st . nextToken ( ) ; String sid4 = st . nextToken ( ) ; String value1 = st . nextToken ( ) ; String value2 = st . nextToken ( ) ; String value3 ...
public class MsgSubstUnitBaseVarNameUtils { /** * Private helper for { @ code genShortestBaseNameForExpr ( ) } and { @ code * genNoncollidingBaseNamesForExprs ( ) } . * < p > Given an expression that ' s a data ref or a global , generates the list of all possible base * names , from short to long . Shortest conta...
if ( exprNode instanceof VarRefNode || exprNode instanceof DataAccessNode ) { List < String > baseNames = Lists . newArrayList ( ) ; String baseName = null ; while ( exprNode != null ) { String nameSegment = null ; if ( exprNode instanceof VarRefNode ) { nameSegment = ( ( VarRefNode ) exprNode ) . getName ( ) ; exprNod...
public class F0 { /** * Returns a composed function that applies this function to it ' s input and * then applies the { @ code after } function to the result . If evaluation of either * function throws an exception , it is relayed to the caller of the composed * function . * @ param after * the function appli...
E . NPE ( after ) ; final F0 < R > me = this ; return new Producer < T > ( ) { @ Override public T produce ( ) { return after . apply ( me . apply ( ) ) ; } } ;
public class BELUtilities { /** * Returns { @ code true } if { @ code path } ends with * { @ value PathConstants # BEL _ SCRIPT _ EXTENSION } or * { @ value PathConstants # XBEL _ EXTENSION } , { @ code false } otherwise . * @ param path { @ link String } path * @ return boolean */ public static boolean isBELDo...
if ( path == null ) { return false ; } if ( path . endsWith ( BEL_SCRIPT_EXTENSION ) ) { return true ; } if ( path . endsWith ( XBEL_EXTENSION ) ) { return true ; } return false ;
public class DescribeInterconnectsRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DescribeInterconnectsRequest describeInterconnectsRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( describeInterconnectsRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( describeInterconnectsRequest . getInterconnectId ( ) , INTERCONNECTID_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marsha...
public class DisableDomainAutoRenewRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DisableDomainAutoRenewRequest disableDomainAutoRenewRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( disableDomainAutoRenewRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( disableDomainAutoRenewRequest . getDomainName ( ) , DOMAINNAME_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall req...
public class SyncMembersInner { /** * Updates an existing sync member . * @ param resourceGroupName The name of the resource group that contains the resource . You can obtain this value from the Azure Resource Manager API or the portal . * @ param serverName The name of the server . * @ param databaseName The nam...
return updateWithServiceResponseAsync ( resourceGroupName , serverName , databaseName , syncGroupName , syncMemberName , parameters ) . toBlocking ( ) . last ( ) . body ( ) ;
public class WMultiFileWidget { /** * Remove the file . * @ param file the file to remove */ public void removeFile ( final FileWidgetUpload file ) { } }
List < FileWidgetUpload > files = ( List < FileWidgetUpload > ) getData ( ) ; if ( files != null ) { files . remove ( file ) ; if ( files . isEmpty ( ) ) { setData ( null ) ; } }
public class SipServletRequestImpl { /** * ( non - Javadoc ) * @ see javax . servlet . sip . SipServletRequest # setRoutingDirective ( javax . servlet . sip . SipApplicationRoutingDirective , javax . servlet . sip . SipServletRequest ) */ public void setRoutingDirective ( SipApplicationRoutingDirective directive , Si...
if ( logger . isDebugEnabled ( ) ) { logger . debug ( "setRoutingDirective - directive=" + directive + ", origRequest=" + origRequest ) ; } checkReadOnly ( ) ; SipServletRequestImpl origRequestImpl = ( SipServletRequestImpl ) origRequest ; final MobicentsSipSession session = getSipSession ( ) ; // @ jean . deruelle Com...
public class RESTClient { /** * Add standard headers to the given request and send it . */ private RESTResponse sendAndReceive ( HttpMethod method , String uri , Map < String , String > headers , byte [ ] body ) throws IOException { } }
// Add standard headers assert headers != null ; headers . put ( HttpDefs . HOST , m_host ) ; headers . put ( HttpDefs . ACCEPT , m_acceptFormat . toString ( ) ) ; headers . put ( HttpDefs . CONTENT_LENGTH , Integer . toString ( body == null ? 0 : body . length ) ) ; if ( m_bCompress ) { headers . put ( HttpDefs . ACCE...
public class ASrvEdit { /** * This is alternative * to avoid problems of overriding Object . equals ( Object other ) * @ param coll1 * @ param coll2 * @ param isOrdered * @ param srvIsEquals * @ return */ @ SuppressWarnings ( "unchecked" ) public < E > boolean isEqualsCollections ( Collection < E > coll1 , ...
if ( ( coll1 == null && coll2 != null ) || ( coll1 != null && coll2 == null ) ) { return false ; } if ( coll1 != null && coll2 != null ) { if ( coll1 . size ( ) != coll2 . size ( ) ) { return false ; } if ( isOrdered ) { Object [ ] arr1 = coll1 . toArray ( ) ; Object [ ] arr2 = coll2 . toArray ( ) ; for ( int i = 0 ; i...
public class MEDDIT { /** * Computes the medoid of the data * @ param parallel whether or not the computation should be done using multiple cores * @ param X the list of all data * @ param dm the distance metric to get the medoid with respect to * @ return the index of the point in < tt > X < / tt > that is the...
return medoid ( parallel , X , 1.0 / X . size ( ) , dm ) ;
public class Strings { /** * Try to trim a String to the given size . * @ param s The String to trim . * @ param length The trim length . * @ param trimSuffix Flag the specifies if trimming should be applied to the suffix of the String . * @ return */ public static String tryToTrimToSize ( String s , int length...
if ( s == null || s . isEmpty ( ) ) { return s ; } else if ( s . length ( ) <= length ) { return s ; } else if ( s . contains ( File . separator ) ) { String before = s . substring ( 0 , s . lastIndexOf ( File . separator ) ) ; String after = s . substring ( s . lastIndexOf ( File . separator ) ) ; if ( ! trimSuffix &&...
public class DefaultMailMessageParser { /** * This function returns the file info from the request data . * @ param inputData * The input data * @ return The file info */ @ Override protected FileInfo getFileInfoFromInputDataImpl ( Message inputData ) { } }
FileInfo fileInfo = null ; try { // get file info fileInfo = this . getFileInfo ( inputData ) ; } catch ( MessagingException exception ) { throw new FaxException ( "Unable to extract fax job file data from mail message." , exception ) ; } catch ( IOException exception ) { throw new FaxException ( "Unable to extract fax...
public class TypedElementLoader { /** * This method will load instances of all public and non - abstract classes that * implements / extends the interface / class specified as ` value ` option * @ param options must contains an entry indexed with " value " and the value should be a Class type * @ param container ...
ElementType elementType = ( ElementType ) options . get ( "elementType" ) ; boolean loadNonPublic = ( Boolean ) options . get ( "loadNonPublic" ) ; boolean loadRoot = ( Boolean ) options . get ( "loadRoot" ) ; $ . Var < ElementType > typeVar = $ . var ( elementType ) ; Class < T > targetClass = targetClass ( typeVar , ...
public class Identity { /** * { @ inheritDoc } */ @ Override public < B > Identity < B > flatMap ( Function < ? super A , ? extends Monad < B , Identity < ? > > > f ) { } }
return f . apply ( runIdentity ( ) ) . coerce ( ) ;
public class NettyHelper { /** * 关闭客户端IO线程池 */ public synchronized static void closeClientIOEventGroup ( ) { } }
if ( clientIOEventLoopGroup != null ) { AtomicInteger ref = refCounter . get ( clientIOEventLoopGroup ) ; if ( ref . decrementAndGet ( ) <= 0 ) { if ( ! clientIOEventLoopGroup . isShutdown ( ) && ! clientIOEventLoopGroup . isShuttingDown ( ) ) { clientIOEventLoopGroup . shutdownGracefully ( ) ; } refCounter . remove ( ...
public class Types { /** * Perform glb for a list of non - primitive , non - error , non - compound types ; * redundant elements are removed . Bounds should be ordered according to * { @ link Symbol # precedes ( TypeSymbol , Types ) } . * @ param flatBounds List of type to glb * @ param errT Original type to us...
List < Type > bounds = closureMin ( flatBounds ) ; if ( bounds . isEmpty ( ) ) { // length = = 0 return syms . objectType ; } else if ( bounds . tail . isEmpty ( ) ) { // length = = 1 return bounds . head ; } else { // length > 1 int classCount = 0 ; List < Type > cvars = List . nil ( ) ; List < Type > lowers = List . ...
public class LongStreamEx { /** * Return an ordered stream produced by consecutive calls of the supplied * producer until it returns false . * The producer function may call the passed consumer any number of times * and return true if the producer should be called again or false * otherwise . It ' s guaranteed ...
Box < LongEmitter > box = new Box < > ( ) ; return ( box . a = action -> producer . test ( action ) ? box . a : null ) . stream ( ) ;
public class SVGUtil { /** * Remove an element from its parent , if defined . * @ param elem Element to remove */ public static void removeFromParent ( Element elem ) { } }
if ( elem != null && elem . getParentNode ( ) != null ) { elem . getParentNode ( ) . removeChild ( elem ) ; }
public class Files { /** * Returns a buffered writer that writes to a file using the given character set . * @ param file the file to write to * @ param charset the charset used to encode the output stream ; see { @ link StandardCharsets } for * helpful predefined constants * @ return the buffered writer */ pub...
checkNotNull ( file ) ; checkNotNull ( charset ) ; return new BufferedWriter ( new OutputStreamWriter ( new FileOutputStream ( file ) , charset ) ) ;
public class LObjIntConsumerBuilder { /** * Adds full new case for the argument that are of specific classes ( matched by instanceOf , null is a wildcard ) . */ @ Nonnull public < V extends T > LObjIntConsumerBuilder < T > aCase ( Class < V > argC1 , LObjIntConsumer < V > function ) { } }
PartialCase . The pc = partialCaseFactoryMethod ( ( a1 , a2 ) -> ( argC1 == null || argC1 . isInstance ( a1 ) ) ) ; pc . evaluate ( function ) ; return self ( ) ;
public class ThriftConnectionPartition { /** * 添加空闲连接的方法 * @ param thriftConnectionHandle * thrift连接代理对象 * @ throws ThriftConnectionPoolException * 当向连接分区添加空闲连接出现问题时抛出该异常 */ public void addFreeConnection ( ThriftConnectionHandle < T > thriftConnectionHandle ) throws ThriftConnectionPoolException { } }
thriftConnectionHandle . setOriginatingPartition ( this ) ; // 更新创建的连接数 创建数 + 1 updateCreatedConnections ( 1 ) ; if ( ! this . freeConnections . offer ( thriftConnectionHandle ) ) { // 将连接放入队列失败 创建数 - 1 updateCreatedConnections ( - 1 ) ; // 关闭原始连接 thriftConnectionHandle . internalClose ( ) ; }
public class ResourceAdapterImpl { /** * Verify activation spec against bean validation * @ param as The activation spec * @ exception Exception Thrown in case of a violation */ @ SuppressWarnings ( "unchecked" ) private void verifyBeanValidation ( Object as ) throws Exception { } }
if ( beanValidation != null ) { ValidatorFactory vf = null ; try { vf = beanValidation . getValidatorFactory ( ) ; Validator v = vf . getValidator ( ) ; Collection < String > l = bvGroups ; if ( l == null || l . isEmpty ( ) ) l = Arrays . asList ( javax . validation . groups . Default . class . getName ( ) ) ; Collecti...
public class DataFormatFilter { /** * Add newline and indentation prior to start tag . * < p > Each tag will begin on a new line , and will be * indented by the current indent step times the number * of ancestors that the element has . < / p > * < p > The newline and indentation will be passed on down * the f...
if ( ! stateStack . empty ( ) ) { doNewline ( ) ; doIndent ( ) ; } stateStack . push ( SEEN_ELEMENT ) ; state = SEEN_NOTHING ; super . startElement ( uri , localName , qName , atts ) ;
public class DefaultGroovyMethods { /** * Treats the object as iterable , iterating through the values it represents and returns the first non - null result obtained from calling the closure , otherwise returns the defaultResult . * < pre class = " groovyTestCase " > * int [ ] numbers = [ 1 , 2 , 3] * assert numb...
Object result = findResult ( self , condition ) ; if ( result == null ) return defaultResult ; return result ;
public class AbstractHtmlTableCell { /** * Sets the onMouseOver javascript event for the HTML table cell . * @ param onMouseOver the onMouseOver event . * @ jsptagref . attributedescription The onMouseOver JavaScript event for the HTML table cell . * @ jsptagref . attributesyntaxvalue < i > string _ cellOnMouseOv...
_cellState . registerAttribute ( AbstractHtmlState . ATTR_JAVASCRIPT , HtmlConstants . ONMOUSEOVER , onMouseOver ) ;
public class ListDataModel { /** * < p > If row data is available , return the array element at the index * specified by < code > rowIndex < / code > . If no wrapped data is available , * return < code > null < / code > . < / p > * @ throws javax . faces . FacesException if an error occurs getting the row data ...
if ( list == null ) { return ( null ) ; } else if ( ! isRowAvailable ( ) ) { throw new NoRowAvailableException ( ) ; } else { return ( ( E ) list . get ( index ) ) ; }
public class JSONObject { /** * Put a key / long pair in the JSONObject . * @ param key A key string . * @ param value A long which is the value . * @ return this . * @ throws JSONException If the key is null . */ public JSONObject element ( String key , long value ) { } }
verifyIsNull ( ) ; return element ( key , new Long ( value ) ) ;
public class DescribeReplicationTaskAssessmentResultsRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DescribeReplicationTaskAssessmentResultsRequest describeReplicationTaskAssessmentResultsRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( describeReplicationTaskAssessmentResultsRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( describeReplicationTaskAssessmentResultsRequest . getReplicationTaskArn ( ) , REPLICATIONTASKARN_BINDING ) ; protocolMarshaller . marshal...
public class AsyncLibrary { /** * @ see com . ibm . io . async . IAsyncProvider # closeCompletionPort ( long ) */ @ Override public synchronized void closeCompletionPort ( long completionPort ) { } }
final int listSize = completionPorts . size ( ) ; for ( int i = 0 ; i < listSize ; i ++ ) { if ( completionPorts . get ( i ) . longValue ( ) == completionPort ) { try { aio_closeport2 ( completionPort ) ; } catch ( AsyncException ae ) { // just log any errors and continue if ( TraceComponent . isAnyTracingEnabled ( ) &...
public class ServiceBroker { /** * Returns an action by name and nodeID . * @ param actionName * name of the action ( in " service . action " syntax , eg . * " math . add " ) * @ param nodeID * node identifier where the service is located * @ return local or remote action container */ public Action getActio...
return serviceRegistry . getAction ( actionName , nodeID ) ;