signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class CPDefinitionSpecificationOptionValueUtil { /** * Returns the last cp definition specification option value in the ordered set where uuid = & # 63 ; . * @ param uuid the uuid * @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > ) * @ return the last matc...
return getPersistence ( ) . fetchByUuid_Last ( uuid , orderByComparator ) ;
public class PackageUtils { /** * Returns whether the given package is a system package , i . e . it is the root system package or a * descendant of the root system package . * @ param aPackage package * @ return whether package is a system package */ public static boolean isSystemPackage ( @ Nullable @ CheckForN...
if ( aPackage == null ) { return false ; } return runAsSystem ( ( ) -> aPackage . getId ( ) . equals ( PACKAGE_SYSTEM ) || ( aPackage . getRootPackage ( ) != null && aPackage . getRootPackage ( ) . getId ( ) . equals ( PACKAGE_SYSTEM ) ) ) ;
public class BaseBigtableTableAdminClient { /** * Checks replication consistency based on a consistency token , that is , if replication has caught * up based on the conditions specified in the token and the check request . * < p > Sample code : * < pre > < code > * try ( BaseBigtableTableAdminClient baseBigtab...
CheckConsistencyRequest request = CheckConsistencyRequest . newBuilder ( ) . setName ( name ) . setConsistencyToken ( consistencyToken ) . build ( ) ; return checkConsistency ( request ) ;
public class PaymentSource { public static CreateUsingTempTokenRequest createUsingTempToken ( ) throws IOException { } }
String uri = uri ( "payment_sources" , "create_using_temp_token" ) ; return new CreateUsingTempTokenRequest ( Method . POST , uri ) ;
public class CreateProductRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( CreateProductRequest createProductRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( createProductRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( createProductRequest . getAcceptLanguage ( ) , ACCEPTLANGUAGE_BINDING ) ; protocolMarshaller . marshall ( createProductRequest . getName ( ) , NAME_BINDING ) ; prot...
public class MtasSolrMtasResult { /** * Merge . * @ param newItem the new item * @ throws IOException Signals that an I / O exception has occurred . */ void merge ( MtasSolrMtasResult newItem ) throws IOException { } }
HashMap < MtasDataCollector < ? , ? > , MtasDataCollector < ? , ? > > map = new HashMap < > ( ) ; if ( newItem . dataCollector . withTotal ( ) ) { dataCollector . setWithTotal ( ) ; } dataCollector . merge ( newItem . dataCollector , map , true ) ; if ( newItem . functionData != null ) { if ( functionData == null ) { f...
public class MapTilePersisterModel { /** * Count the active tiles . * @ param widthInTile The horizontal tiles . * @ param step The step number . * @ param s The s value . * @ return The active tiles . */ private int countTiles ( int widthInTile , int step , int s ) { } }
int count = 0 ; for ( int tx = 0 ; tx < widthInTile ; tx ++ ) { for ( int ty = 0 ; ty < map . getInTileHeight ( ) ; ty ++ ) { if ( map . getTile ( tx + s * step , ty ) != null ) { count ++ ; } } } return count ;
public class MeasureExtractor { /** * Obtains a HashMap with the measures extracted from a JSONObject representing the sensor data . * @ author Marcos García Casado */ public HashMap < String , Double > getArrayMeasures ( JSONObject jsonContent ) { } }
HashMap < String , Double > i = new HashMap < String , Double > ( ) ; return i ;
public class MCAAuthorizationManager { /** * Registers authentication listener for specified realm . * @ param realm authentication realm . * @ param listener authentication listener . */ public void registerAuthenticationListener ( String realm , AuthenticationListener listener ) { } }
if ( realm == null || realm . isEmpty ( ) ) { throw new InvalidParameterException ( "The realm name can't be null or empty." ) ; } if ( listener == null ) { throw new InvalidParameterException ( "The authentication listener object can't be null." ) ; } ChallengeHandler handler = new ChallengeHandler ( ) ; handler . ini...
public class LogWatchStorageManager { /** * Get index of the last plus one message that the follower has access to . * @ param follower * Follower in question . * @ return Ending message ID after { @ link # followerTerminated ( Follower ) } . * { @ link MessageStore # getLatestPosition ( ) } between * { @ lin...
if ( this . isFollowerActive ( follower ) ) { return this . messages . getLatestPosition ( ) ; } else if ( this . isFollowerTerminated ( follower ) ) { return this . terminatedFollowerRanges . get ( follower ) [ 1 ] ; } else { throw new IllegalStateException ( "Follower never before seen." ) ; }
public class StatusAPI { /** * Creates a new status message for a user on a specific space . A status * update is simply a short text message that the user wishes to share with * the rest of the space . * @ param status * The data for the new status message * @ return The id of the newly created status messag...
return getResourceFactory ( ) . getApiResource ( "/status/space/" + spaceId + "/" ) . entity ( status , MediaType . APPLICATION_JSON_TYPE ) . post ( StatusCreateResponse . class ) . getId ( ) ;
public class Stream { /** * Performs the given indexed action on each element . * < p > This is a terminal operation . * @ param from the initial value of the index ( inclusive ) * @ param step the step of the index * @ param action the action to be performed on each element * @ since 1.1.6 */ public void for...
int index = from ; while ( iterator . hasNext ( ) ) { action . accept ( index , iterator . next ( ) ) ; index += step ; }
public class SleepThrottle { /** * This method can only be called at the rate set by the { @ link # setRate } method , if it is called faster than this * it will inject short pauses to restrict the call rate to that rate . * @ throws InterruptedException If interrupted whilst performing a blocking wait on the throt...
// Get the current time in nanos . long currentTimeNanos = System . nanoTime ( ) ; // Don ' t introduce any pause on the first call . if ( ! firstCall ) { // Check if there is any time left in the cycle since the last call to this method and introduce a short pause // to fill that time if there is . long remainingTimeN...
public class DummyInternalTransaction { /** * ( non - Javadoc ) * @ see com . ibm . ws . objectManager . InternalTransaction # lock ( com . ibm . ws . objectManager . ManagedObject ) */ protected synchronized void lock ( ManagedObject managedObject ) throws ObjectManagerException { } }
throw new InvalidStateException ( this , InternalTransaction . stateTerminated , InternalTransaction . stateNames [ InternalTransaction . stateTerminated ] ) ;
public class ConstructorUtils { /** * < p > Finds an accessible constructor with compatible parameters . < / p > * < p > This checks all the constructor and finds one with compatible parameters * This requires that every parameter is assignable from the given parameter types . * This is a more flexible search tha...
Validate . notNull ( cls , "class cannot be null" ) ; // see if we can find the constructor directly // most of the time this works and it ' s much faster try { final Constructor < T > ctor = cls . getConstructor ( parameterTypes ) ; MemberUtils . setAccessibleWorkaround ( ctor ) ; return ctor ; } catch ( final NoSuchM...
public class ExampleUtils { /** * Fills the { @ link org . javasimon . SimonManager } with specified number of Simons ( or slightly more ) . * @ param roughCount how many Stopwatches to create ( or a bit more ) */ public static void fillManagerWithSimons ( int roughCount ) { } }
System . out . print ( "Filling manager with ~" + roughCount + " Simons..." ) ; while ( SimonManager . getSimonNames ( ) . size ( ) < roughCount ) { SimonManager . getStopwatch ( generateRandomName ( RANDOM . nextInt ( 10 ) + 1 ) ) ; } System . out . println ( " " + SimonManager . getSimonNames ( ) . size ( ) + " creat...
public class ClasspathFileReader { /** * Resolves the given file name , relative to the classpath , and returns a * corresponding < code > File < / code > object . Only files that actually exist * on their own on disk ( as opposed to being in a JAR ) will be resolved . * @ param fileName the name of the file to l...
final String methodName = "getFile(): " ; lastTimeDiskWasAccessed = System . currentTimeMillis ( ) ; List classpath = ClasspathUtils . getClasspathDirectories ( ) ; log . debug ( methodName + "looking for file '" + fileName + "' in classpath" ) ; File file = findFile ( fileName , classpath ) ; if ( file != null ) { log...
public class OkVolley { /** * build the default User - Agent * @ param context * @ return */ public static String generateUserAgent ( Context context ) { } }
StringBuilder ua = new StringBuilder ( "api-client/" ) ; ua . append ( VERSION ) ; String packageName = context . getApplicationContext ( ) . getPackageName ( ) ; ua . append ( " " ) ; ua . append ( packageName ) ; PackageInfo pi = null ; try { pi = context . getPackageManager ( ) . getPackageInfo ( packageName , 0 ) ;...
public class DicLibrary { /** * 动态添加词典 * @ param dicDefault * @ param dicDefault2 * @ param dic2 */ public static void put ( String key , String path , Forest forest ) { } }
DIC . put ( key , KV . with ( path , forest ) ) ; MyStaticValue . ENV . put ( key , path ) ;
public class DefaultKamCacheService { /** * { @ inheritDoc } */ @ Override public String loadKam ( KamInfo ki , KamFilter kf ) throws KamCacheServiceException { } }
if ( ki == null ) { throw new InvalidArgument ( "KamInfo required" ) ; } String ret ; Callable < String > callable ; if ( kf != null ) { // Check the fltrdMap cache first FilteredKAMKey key = new FilteredKAMKey ( ki , kf ) ; read . lock ( ) ; try { ret = fltrdMap . get ( key ) ; } finally { read . unlock ( ) ; } if ( r...
public class SqlUtils { /** * 通过Mapper方法名获取sql */ public static String getMapperSql ( SqlSession session , String fullMapperMethodName , Object ... args ) { } }
if ( args == null || args . length == 0 ) { return getNamespaceSql ( session , fullMapperMethodName , null ) ; } String methodName = fullMapperMethodName . substring ( fullMapperMethodName . lastIndexOf ( '.' ) + 1 ) ; Class < ? > mapperInterface = null ; try { mapperInterface = Class . forName ( fullMapperMethodName ....
public class MsgSettingController { /** * Download api . * @ param req the req * @ param method the method * @ param url the url * @ param res the res */ @ GetMapping ( "/setting/download/api/excel" ) public void downloadApi ( HttpServletRequest req , @ RequestParam ( "method" ) String method , @ RequestParam (...
this . validationSessionComponent . sessionCheck ( req ) ; url = new String ( Base64 . getDecoder ( ) . decode ( url ) ) ; PoiWorkBook workBook = this . msgExcelService . getExcel ( method , url ) ; workBook . writeFile ( "ValidationApis_" + System . currentTimeMillis ( ) , res ) ;
public class CoingiAdapters { /** * Adapts a CoingiBalances to an AccountInfo * @ param coingiBalances The Coingi balance * @ param userName The user name * @ return The account info */ public static AccountInfo adaptAccountInfo ( CoingiBalances coingiBalances , String userName ) { } }
List < Balance > balances = new ArrayList < > ( ) ; for ( CoingiBalance coingiBalance : coingiBalances . getList ( ) ) { BigDecimal total = coingiBalance . getAvailable ( ) . add ( coingiBalance . getBlocked ( ) ) . add ( coingiBalance . getWithdrawing ( ) ) . add ( coingiBalance . getDeposited ( ) ) ; Balance xchangeB...
public class TransactionHelper { /** * Returns all objects of the given class in persistence context . * @ param < T > * type of searched objects * @ param clazz * type of searched objects * @ return list of found objects * @ throws IllegalArgumentException * if the instance is not an entity * @ throws ...
final Entity entityAnnotation = clazz . getAnnotation ( Entity . class ) ; if ( entityAnnotation == null ) { throw new IllegalArgumentException ( "Unknown entity: " + clazz . getName ( ) ) ; } return executeInTransaction ( new Runnable < List < T > > ( ) { @ Override @ SuppressWarnings ( "unchecked" ) public List < T >...
public class LocalNetworkGatewaysInner { /** * Updates a local network gateway tags . * @ param resourceGroupName The name of the resource group . * @ param localNetworkGatewayName The name of the local network gateway . * @ param tags Resource tags . * @ throws IllegalArgumentException thrown if parameters fai...
return beginUpdateTagsWithServiceResponseAsync ( resourceGroupName , localNetworkGatewayName , tags ) . toBlocking ( ) . single ( ) . body ( ) ;
public class TypeRegistry { /** * Determine if something has changed in a particular type related to a particular descriptor and so the dispatcher * interface should be used . The type registry ID and class ID are merged in the ' ids ' parameter . This method is for * INVOKEINTERFACE rewrites and so performs additi...
if ( GlobalConfiguration . isRuntimeLogging && log . isLoggable ( Level . FINER ) ) { log . entering ( "TypeRegistry" , "iincheck" , new Object [ ] { ids , nameAndDescriptor } ) ; } int registryId = ids >>> 16 ; int typeId = ids & 0xffff ; TypeRegistry typeRegistry = registryInstances [ registryId ] . get ( ) ; Reloada...
public class cacheselector { /** * Use this API to fetch cacheselector resource of given name . */ public static cacheselector get ( nitro_service service , String selectorname ) throws Exception { } }
cacheselector obj = new cacheselector ( ) ; obj . set_selectorname ( selectorname ) ; cacheselector response = ( cacheselector ) obj . get_resource ( service ) ; return response ;
public class Queue { /** * Pushes a messages onto the queue . * @ param msg The array of the messages to push . * @ param delay The message ' s delay in seconds . * @ return The IDs of new messages * @ throws io . iron . ironmq . HTTPException If the IronMQ service returns a status other than 200 OK . * @ thr...
ArrayList < Message > messages = new ArrayList < Message > ( ) ; for ( String messageName : msg ) { Message message = new Message ( ) ; message . setBody ( messageName ) ; message . setDelay ( delay ) ; messages . add ( message ) ; } MessagesArrayList msgs = new MessagesArrayList ( messages ) ; IronReader reader = clie...
public class TasksBase { /** * Returns the compact representations of all of the dependents of a task . * @ param task The task to get dependents on . * @ return Request object */ public ItemRequest < Task > dependents ( String task ) { } }
String path = String . format ( "/tasks/%s/dependents" , task ) ; return new ItemRequest < Task > ( this , Task . class , path , "GET" ) ;
public class AddCacheRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( AddCacheRequest addCacheRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( addCacheRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( addCacheRequest . getGatewayARN ( ) , GATEWAYARN_BINDING ) ; protocolMarshaller . marshall ( addCacheRequest . getDiskIds ( ) , DISKIDS_BINDING ) ; } catch ( Exception e...
public class JSONs { /** * Read an expected list of nodes . * @ param mo the associated model to browse * @ param o the object to parse * @ param id the key in the map that points to the list * @ return the parsed list * @ throws JSONConverterException if the key does not point to a list of nodes identifiers ...
checkKeys ( o , id ) ; Object x = o . get ( id ) ; if ( ! ( x instanceof JSONArray ) ) { throw new JSONConverterException ( "integers expected at key '" + id + "'" ) ; } return nodesFromJSON ( mo , ( JSONArray ) x ) ;
public class HadoopDruidIndexerConfig { /** * Make the intermediate path for this job run . * @ return the intermediate path for this job run . */ public Path makeIntermediatePath ( ) { } }
return new Path ( StringUtils . format ( "%s/%s/%s_%s" , getWorkingPath ( ) , schema . getDataSchema ( ) . getDataSource ( ) , StringUtils . removeChar ( schema . getTuningConfig ( ) . getVersion ( ) , ':' ) , schema . getUniqueId ( ) ) ) ;
public class SocketBinding { /** * Create and bind a server socket * @ return the server socket * @ throws IOException */ public ServerSocket createServerSocket ( ) throws IOException { } }
final ServerSocket socket = getServerSocketFactory ( ) . createServerSocket ( name ) ; socket . bind ( getSocketAddress ( ) ) ; return socket ;
public class ProfilingTimer { /** * Same as { @ link # create ( Log , String , Object . . . ) } but logs subtasks as well */ public static ProfilingTimer createLoggingSubtasks ( final Log log , final String processName , final Object ... args ) { } }
return create ( log , false , null , processName , args ) ;
public class CuckooHashing { /** * Adds an element to one of the tables for Cuckoo Hashing . * @ param currentElement * entry to add in a table * @ param rehash * if < code > true < / code > the hash table will be rebuild when the * stash became too big . */ private void fileElement ( Entry < T > currentEleme...
int maxFailures = Math . max ( ( int ) Math . log ( this . numElements ) , this . numTables * 2 ) ; int currentTable = 0 ; for ( int i = 0 ; i < maxFailures ; i ++ ) { int hash = this . hashfunctions . get ( currentTable ) . hash ( currentElement . getKey ( ) ) ; currentElement = this . tables . get ( currentTable ) . ...
public class JobStatistics { /** * Set key value of type double */ public void setValue ( Enum key , double value ) { } }
this . _job . put ( key , Double . toString ( value ) ) ;
public class WebJarController { /** * Retrieves an asset . * @ param path the asset path * @ return the Asset object , or { @ literal null } if the current provider can ' t serve this asset . */ @ Override public Asset < ? > assetAt ( String path ) { } }
List < WebJarLib > candidates = findLibsContaining ( path ) ; if ( candidates . size ( ) == 1 ) { // Perfect ! only one match return new DefaultAsset < > ( "/libs/" + candidates . get ( 0 ) . name + "/" + candidates . get ( 0 ) . version + "/" + path , candidates . get ( 0 ) . get ( path ) , candidates . get ( 0 ) . to...
public class LTieFltConsumerBuilder { /** * One of ways of creating builder . This is possibly the least verbose way where compiler should be able to guess the generic parameters . */ @ Nonnull public static < T > LTieFltConsumer < T > tieFltConsumerFrom ( Consumer < LTieFltConsumerBuilder < T > > buildingFunction ) { ...
LTieFltConsumerBuilder builder = new LTieFltConsumerBuilder ( ) ; buildingFunction . accept ( builder ) ; return builder . build ( ) ;
public class SoapResponseMessageCallback { /** * Callback method called with actual web service response message . Method constructs a Spring Integration * message from this web service message for further processing . */ public void doWithMessage ( WebServiceMessage responseMessage ) throws IOException , Transformer...
// convert and set response for later access via getResponse ( ) : response = endpointConfiguration . getMessageConverter ( ) . convertInbound ( responseMessage , endpointConfiguration , context ) ;
public class AbstractTagLibrary { /** * ( non - Javadoc ) * @ see org . apache . myfaces . view . facelets . tag . TagLibrary # createTagHandler ( java . lang . String , java . lang . String , * org . apache . myfaces . view . facelets . tag . TagConfig ) */ public TagHandler createTagHandler ( String ns , String l...
if ( containsNamespace ( ns ) ) { TagHandlerFactory f = _factories . get ( localName ) ; if ( f != null ) { return f . createHandler ( tag ) ; } } return null ;
public class IfcBSplineCurveImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ SuppressWarnings ( "unchecked" ) @ Override public EList < IfcCartesianPoint > getControlPointsList ( ) { } }
return ( EList < IfcCartesianPoint > ) eGet ( Ifc4Package . Literals . IFC_BSPLINE_CURVE__CONTROL_POINTS_LIST , true ) ;
public class AmazonEC2Client { /** * Describes one or more launch templates . * @ param describeLaunchTemplatesRequest * @ return Result of the DescribeLaunchTemplates operation returned by the service . * @ sample AmazonEC2 . DescribeLaunchTemplates * @ see < a href = " http : / / docs . aws . amazon . com / g...
request = beforeClientExecution ( request ) ; return executeDescribeLaunchTemplates ( request ) ;
public class StructuredSyntaxDocumentFilter { /** * Parse the Document to update the character styles given an initial start * position . Called by the filter after it has updated the text . * @ param offset * @ param length * @ throws BadLocationException */ protected void parseDocument ( int offset , int leng...
// initialize the segment with the complete document so the segment doesn ' t // have an underlying gap in the buffer styledDocument . getText ( 0 , styledDocument . getLength ( ) , segment ) ; buffer = CharBuffer . wrap ( segment . array ) . asReadOnlyBuffer ( ) ; // initialize the lexer if necessary if ( ! lexer . is...
public class Canvas { /** * Draws a subregion of a image { @ code ( sw x sh ) @ ( sx , sy ) } at the specified size * { @ code ( dw x dh ) } and location { @ code ( dx , dy ) } . * TODO ( jgw ) : Document whether out - of - bounds source coordinates clamp , repeat , or do nothing . */ public Canvas draw ( Drawable ...
image . draw ( gc ( ) , dx , dy , dw , dh , sx , sy , sw , sh ) ; isDirty = true ; return this ;
public class Restarter { /** * Start the application . * @ param failureHandler a failure handler for application that won ' t start * @ throws Exception in case of errors */ protected void start ( FailureHandler failureHandler ) throws Exception { } }
do { Throwable error = doStart ( ) ; if ( error == null ) { return ; } if ( failureHandler . handle ( error ) == Outcome . ABORT ) { return ; } } while ( true ) ;
public class TaskTerminateOptions { /** * Set a timestamp indicating the last modified time of the resource known to the client . The operation will be performed only if the resource on the service has been modified since the specified time . * @ param ifModifiedSince the ifModifiedSince value to set * @ return the...
if ( ifModifiedSince == null ) { this . ifModifiedSince = null ; } else { this . ifModifiedSince = new DateTimeRfc1123 ( ifModifiedSince ) ; } return this ;
public class OWLObjectUnionOfImpl_CustomFieldSerializer { /** * Serializes the content of the object into the * { @ link com . google . gwt . user . client . rpc . SerializationStreamWriter } . * @ param streamWriter the { @ link com . google . gwt . user . client . rpc . SerializationStreamWriter } to write the ...
serialize ( streamWriter , instance ) ;
public class ConditionalCheck { /** * Ensures that a readable sequence of { @ code char } values matches a specified pattern . If the given character * sequence does not match against the passed pattern , an { @ link IllegalPatternArgumentException } will be thrown . * @ param condition * condition must be { @ co...
IllegalNullArgumentException . class , IllegalPatternArgumentException . class } ) public static < T extends CharSequence > void matchesPattern ( final boolean condition , @ Nonnull final Pattern pattern , @ Nonnull final T chars , @ Nullable final String name ) { if ( condition ) { Check . matchesPattern ( pattern , c...
public class DescribeCommentsRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DescribeCommentsRequest describeCommentsRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( describeCommentsRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( describeCommentsRequest . getAuthenticationToken ( ) , AUTHENTICATIONTOKEN_BINDING ) ; protocolMarshaller . marshall ( describeCommentsRequest . getDocumentId ( ...
public class TransactionEventListener { /** * Adds the { @ code List } of { @ code MeterValue } s to the { @ code Transaction } . * @ param transaction the { @ code Transaction } to which to add the { @ code MeterValue } s . * @ param meterValues the { @ code List } of { @ code MeterValue } s to add . */ private vo...
for ( MeterValue meterValue : meterValues ) { addMeterValueToTransaction ( transaction , meterValue ) ; }
public class AWSCodePipelineClient { /** * Provides information to AWS CodePipeline about new revisions to a source . * @ param putActionRevisionRequest * Represents the input of a PutActionRevision action . * @ return Result of the PutActionRevision operation returned by the service . * @ throws PipelineNotFou...
request = beforeClientExecution ( request ) ; return executePutActionRevision ( request ) ;
public class NTLMResponses { /** * Calculates the NTLMv2 Response for the given challenge , using the * specified authentication target , username , password , target information * block , and client nonce . * @ param target The authentication target ( i . e . , domain ) . * @ param user The username . * @ pa...
return getNTLMv2Response ( target , user , password , targetInformation , challenge , clientNonce , System . currentTimeMillis ( ) ) ;
public class MouseMoveAwt { /** * Teleport mouse with robot . * @ param nx The new X . * @ param ny The new Y . */ void robotTeleport ( int nx , int ny ) { } }
oldX = nx ; oldY = ny ; x = nx ; y = ny ; wx = nx ; wy = ny ; mx = 0 ; my = 0 ; moved = false ;
public class BitVector { /** * a , b not null a size not greater than b size */ private static int compareNumeric ( BitVector a , BitVector b ) { } }
final int aSize = a . size ( ) ; final int bSize = b . size ( ) ; if ( aSize != bSize && ! b . isAllZerosAdj ( b . finish - bSize + aSize , b . finish ) ) return - 1 ; // more optimizations are possible but probably not worthwhile if ( a . isAligned ( ) && b . isAligned ( ) ) { int pos = aSize & ~ ADDRESS_MASK ; if ( p...
public class CmsSecurityManager { /** * Returns a List of all siblings of the specified resource , * the specified resource being always part of the result set . < p > * @ param context the request context * @ param resource the specified resource * @ param filter a filter object * @ return a list of < code >...
List < CmsResource > result = null ; CmsDbContext dbc = m_dbContextFactory . getDbContext ( context ) ; try { result = m_driverManager . readSiblings ( dbc , resource , filter ) ; } catch ( Exception e ) { dbc . report ( null , Messages . get ( ) . container ( Messages . ERR_READ_SIBLINGS_1 , context . getSitePath ( re...
public class DeviceProxy { public void setPipeConfig ( PipeInfo pipeInfo ) throws DevFailed { } }
ArrayList < PipeInfo > infoList = new ArrayList < PipeInfo > ( 1 ) ; infoList . add ( pipeInfo ) ; setPipeConfig ( infoList ) ;
public class MultiKindFeedParser { /** * Parses the given HTTP response using the given feed class and entry classes . * @ param < T > feed type * @ param < E > entry type * @ param response HTTP response * @ param namespaceDictionary XML namespace dictionary * @ param feedClass feed class * @ param entryCl...
InputStream content = response . getContent ( ) ; try { Atom . checkContentType ( response . getContentType ( ) ) ; XmlPullParser parser = Xml . createParser ( ) ; parser . setInput ( content , null ) ; MultiKindFeedParser < T > result = new MultiKindFeedParser < T > ( namespaceDictionary , parser , content , feedClass...
public class AbstractDatabaseEngine { /** * Adds an entity to the engine . It will create tables and everything necessary so persistence can work . * @ param entity The entity to add . * @ param recovering True if entities are being add due to recovery . * @ throws DatabaseEngineException If something goes wrong ...
if ( ! recovering ) { try { getConnection ( ) ; } catch ( final Exception e ) { throw new DatabaseEngineException ( "Could not add entity" , e ) ; } validateEntity ( entity ) ; if ( entities . containsKey ( entity . getName ( ) ) ) { throw new DatabaseEngineException ( String . format ( "Entity '%s' is already defined"...
public class MkLocalShuffer { /** * Don ' t need to take care of multiple thread racing condition , one thread per task */ private void refreshLocalNodeTasks ( ) { } }
Set < Integer > localNodeTasks = workerData . getLocalNodeTasks ( ) ; if ( localNodeTasks == null || localNodeTasks . equals ( lastLocalNodeTasks ) ) { return ; } LOG . info ( "Old localNodeTasks:" + lastLocalNodeTasks + ", new:" + localNodeTasks ) ; lastLocalNodeTasks = localNodeTasks ; List < Integer > localNodeOutTa...
public class JmsJcaReferenceUtilsImpl { /** * Dynamically populates the reference that it has been given using the * properties currently stored in this ConnectionFactory . Note that this way * of doing things automatically handles the adding of extra properties * without the need to change this code . * @ para...
if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . entry ( this , TRACE , "populateReference" , new Object [ ] { reference , properties , defaults } ) ; } // Make sure no - one can pull the rug from beneath us . synchronized ( properties ) { // Convert the map of properties into an ...
public class OutputUtilities { /** * Creates a Map < String , String > with the RETURN _ CODE Success ( 0 ) , and the RETURN _ RESULT the returnResult string value * @ param returnResult the return result * @ return a Map < String , String > with the RETURN _ CODE Success ( 0 ) , and the RETURN _ RESULT the returnR...
final Map < String , String > results = new HashMap < > ( ) ; results . put ( OutputNames . RETURN_CODE , ReturnCodes . SUCCESS ) ; results . put ( OutputNames . RETURN_RESULT , returnResult ) ; return results ;
public class DefaultGoApiResponse { /** * Creates an instance DefaultGoApiResponse which represents incomplete request with response code 412 * @ param responseBody Response body * @ return an instance of DefaultGoApiResponse */ public static DefaultGoApiResponse incompleteRequest ( String responseBody ) { } }
DefaultGoApiResponse defaultGoApiResponse = new DefaultGoApiResponse ( 412 ) ; defaultGoApiResponse . setResponseBody ( responseBody ) ; return defaultGoApiResponse ;
public class PatriciaTrieFormatter { /** * Format trie and write to file * @ param trie trie to format * @ param file file to write to * @ param formatBitString true if the bits for this key should be included in the node * @ throws FileNotFoundException if the file exists but is a directory rather than a regul...
PrintWriter writer = new PrintWriter ( new FileOutputStream ( file ) ) ; writer . println ( format ( trie , formatBitString ) ) ; writer . close ( ) ;
public class vpntrafficaction { /** * Use this API to fetch filtered set of vpntrafficaction resources . * filter string should be in JSON format . eg : " port : 80 , servicetype : HTTP " . */ public static vpntrafficaction [ ] get_filtered ( nitro_service service , String filter ) throws Exception { } }
vpntrafficaction obj = new vpntrafficaction ( ) ; options option = new options ( ) ; option . set_filter ( filter ) ; vpntrafficaction [ ] response = ( vpntrafficaction [ ] ) obj . getfiltered ( service , option ) ; return response ;
public class BlobStoreWriter { /** * Call this to cancel before finishing the data . */ public void cancel ( ) { } }
try { // FileOutputStream is also closed cascadingly if ( outStream != null ) { outStream . close ( ) ; outStream = null ; } // Clear encryptor : encryptor = null ; } catch ( IOException e ) { Log . w ( Log . TAG_BLOB_STORE , "Exception closing buffered output stream" , e ) ; } tempFile . delete ( ) ;
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EClass getIfcMaterialLayer ( ) { } }
if ( ifcMaterialLayerEClass == null ) { ifcMaterialLayerEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 309 ) ; } return ifcMaterialLayerEClass ;
public class StateSaver { /** * Save the state of the given view and the other state inside of the returned { @ link Parcelable } . * @ param target The view containing fields annotated with { @ link State } . * @ param state The super state of the parent class of the view . Usually it isn ' t { @ code null } . *...
return IMPL . saveInstanceState ( target , state ) ;
public class PersistenceApi { /** * Entity exists * Find Managed Entity by primary Key within Partition ( optional ) and determine if it exists * @ param request Managed Entity Request Object ( required ) * @ return ApiResponse & lt ; Boolean & gt ; * @ throws ApiException If fail to call the API , e . g . serv...
com . squareup . okhttp . Call call = existsWithIdPostValidateBeforeCall ( request , null , null ) ; Type localVarReturnType = new TypeToken < Boolean > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnType ) ;
public class PowerShell { /** * Execute a single command in PowerShell console and gets result * @ param command the command to execute * @ return response with the output of the command */ public static PowerShellResponse executeSingleCommand ( String command ) { } }
PowerShellResponse response = null ; try ( PowerShell session = PowerShell . openSession ( ) ) { response = session . executeCommand ( command ) ; } catch ( PowerShellNotAvailableException ex ) { logger . log ( Level . SEVERE , "PowerShell not available" , ex ) ; } return response ;
public class MaterialListValueBox { /** * Returns all selected values of the list box , or empty array if none . * @ return the selected values of the list box */ public String [ ] getItemsSelected ( ) { } }
List < String > selected = new LinkedList < > ( ) ; for ( int i = getIndexOffset ( ) ; i < listBox . getItemCount ( ) ; i ++ ) { if ( listBox . isItemSelected ( i ) ) { selected . add ( listBox . getValue ( i ) ) ; } } return selected . toArray ( new String [ selected . size ( ) ] ) ;
public class AWTTerminalFontConfiguration { /** * Returns the default font to use depending on the platform * @ return Default font to use , system - dependent */ protected static Font [ ] selectDefaultFont ( ) { } }
String osName = System . getProperty ( "os.name" , "" ) . toLowerCase ( ) ; if ( osName . contains ( "win" ) ) { List < Font > windowsFonts = getDefaultWindowsFonts ( ) ; return windowsFonts . toArray ( new Font [ windowsFonts . size ( ) ] ) ; } else if ( osName . contains ( "linux" ) ) { List < Font > linuxFonts = get...
public class DescribeRaidArraysResult { /** * A < code > RaidArrays < / code > object that describes the specified RAID arrays . * @ return A < code > RaidArrays < / code > object that describes the specified RAID arrays . */ public java . util . List < RaidArray > getRaidArrays ( ) { } }
if ( raidArrays == null ) { raidArrays = new com . amazonaws . internal . SdkInternalList < RaidArray > ( ) ; } return raidArrays ;
public class CreatePublicDnsNamespaceRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( CreatePublicDnsNamespaceRequest createPublicDnsNamespaceRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( createPublicDnsNamespaceRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( createPublicDnsNamespaceRequest . getName ( ) , NAME_BINDING ) ; protocolMarshaller . marshall ( createPublicDnsNamespaceRequest . getCreatorRequestId ( ...
public class FormLayout { /** * Distributes free space over columns and rows and returns the sizes after this distribution * process . * @ param formSpecs the column / row specifications to work with * @ param totalSize the total available size * @ param totalPrefSize the sum of all preferred sizes * @ param ...
double totalFreeSpace = totalSize - totalPrefSize ; // Do nothing if there ' s no free space . if ( totalFreeSpace < 0 ) { return inputSizes ; } // Compute the total weight . int count = formSpecs . size ( ) ; double totalWeight = 0.0 ; for ( int i = 0 ; i < count ; i ++ ) { FormSpec formSpec = ( FormSpec ) formSpecs ....
public class ClientBuilder { /** * Creates a builder which is pre - configured from a { @ link KubeConfig } . * < p > To load a < tt > KubeConfig < / tt > , see { @ link KubeConfig # loadKubeConfig ( Reader ) } . * @ param config The { @ link KubeConfig } to configure the builder from . * @ return < tt > ClientBu...
final ClientBuilder builder = new ClientBuilder ( ) ; String server = config . getServer ( ) ; if ( ! server . contains ( "://" ) ) { if ( server . contains ( ":443" ) ) { server = "https://" + server ; } else { server = "http://" + server ; } } final byte [ ] caBytes = KubeConfig . getDataOrFile ( config . getCertific...
public class FilesImpl { /** * Deletes the specified task file from the compute node where the task ran . * @ param jobId The ID of the job that contains the task . * @ param taskId The ID of the task whose file you want to delete . * @ param filePath The path to the task file or directory that you want to delete...
return deleteFromTaskWithServiceResponseAsync ( jobId , taskId , filePath , recursive , fileDeleteFromTaskOptions ) . map ( new Func1 < ServiceResponseWithHeaders < Void , FileDeleteFromTaskHeaders > , Void > ( ) { @ Override public Void call ( ServiceResponseWithHeaders < Void , FileDeleteFromTaskHeaders > response ) ...
public class MapModel { /** * Update the visibility of the layers . * @ param event * change event */ public void onMapViewChanged ( MapViewChangedEvent event ) { } }
for ( Layer < ? > layer : layers ) { layer . updateShowing ( ) ; // If the map is resized quickly after a previous resize , tile requests are sent out , but when they come // back , the world - to - pan matrix will have altered , and so the tiles are placed at the wrong positions . . . . // so we clear the store . if (...
public class BaseStore { /** * Create an { @ code OperationObserver } using { @ code this } for the context . * @ param name name of the statistic * @ param outcome class of the possible outcomes * @ param canBeDisabled if this statistic can be disabled by a { @ link StoreStatisticsConfiguration } * @ param < T...
if ( ! operationStatisticsEnabled && canBeDisabled ) { return ZeroOperationStatistic . get ( ) ; } return operation ( outcome ) . named ( name ) . of ( this ) . tag ( getStatisticsTag ( ) ) . build ( ) ;
public class BuildInfoProvider { /** * Parses { @ code hazelcast - runtime . properties } for { @ code BuildInfo } ; also checks for overrides in System . properties . * Never cache result of this method in a static context - as it can change due versions overriding - this method * already does caching whenever it ...
if ( Overrides . isEnabled ( ) ) { // never use cache when override is enabled - > we need to re - parse everything Overrides overrides = Overrides . fromProperties ( ) ; return getBuildInfoInternalVersion ( overrides ) ; } return BUILD_INFO_CACHE ;
public class FutureConverter { /** * Converts { @ link ListenableFuture } to { @ link io . reactivex . Single } . * The original future is canceled upon unsubscribe . */ public static < T > Single < T > toSingle ( ListenableFuture < T > listenableFuture ) { } }
return RxJava2FutureUtils . createSingle ( SpringFutureUtils . createValueSource ( listenableFuture ) ) ;
public class ProcessGroovyMethods { /** * Gets the output and error streams from a process and reads them * to keep the process from blocking due to a full output buffer . * The processed stream data is appended to the supplied Appendable . * For this , two Threads are started , but join ( ) ed , so we wait . *...
Thread tout = consumeProcessOutputStream ( self , output ) ; Thread terr = consumeProcessErrorStream ( self , error ) ; try { tout . join ( ) ; } catch ( InterruptedException ignore ) { } try { terr . join ( ) ; } catch ( InterruptedException ignore ) { } try { self . waitFor ( ) ; } catch ( InterruptedException ignore...
public class VirtualMachineScaleSetRollingUpgradesInner { /** * Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image OS version . Instances which are already running the latest available OS version are not affected . * @ param resourceGroupName The name of th...
return beginStartOSUpgradeWithServiceResponseAsync ( resourceGroupName , vmScaleSetName ) . map ( new Func1 < ServiceResponse < OperationStatusResponseInner > , OperationStatusResponseInner > ( ) { @ Override public OperationStatusResponseInner call ( ServiceResponse < OperationStatusResponseInner > response ) { return...
public class LauncherModel { /** * Compute the vector used for launch . * @ param vector The initial vector used for launch . * @ return The vector used for launch . */ private Force computeVector ( Force vector ) { } }
if ( target != null ) { return computeVector ( vector , target ) ; } vector . setDestination ( vector . getDirectionHorizontal ( ) , vector . getDirectionVertical ( ) ) ; return vector ;
public class DefaultFastFileStorageClient { /** * 根据传入比例生成缩略图 * @ param inputStream * @ param thumbImage * @ return * @ throws IOException */ private ByteArrayInputStream generateThumbImageByPercent ( InputStream inputStream , ThumbImage thumbImage ) throws IOException { } }
LOGGER . debug ( "根据传入比例生成缩略图" ) ; // 在内存当中生成缩略图 ByteArrayOutputStream out = new ByteArrayOutputStream ( ) ; // @ formatter : off Thumbnails . of ( inputStream ) . scale ( thumbImage . getPercent ( ) ) . toOutputStream ( out ) ; // @ formatter : on return new ByteArrayInputStream ( out . toByteArray ( ) ) ;
public class Logger { /** * Log a message at the WARN level . * @ param marker The marker specific to this log statement * @ param message the message string to be logged * @ param object the argument * @ since 1.0.0 */ public void warn ( final Marker marker , final String message , final Object object ) { } }
log . warn ( marker , sanitize ( message ) , object ) ;
public class Properties { /** * Associates the specified map with the specified property key . If the properties previously contained a mapping for the property key , the old * value is replaced by the specified map . * @ param < K > * the type of keys maintained by the map * @ param < V > * the type of mappe...
properties . put ( property . getName ( ) , value ) ;
public class CmsModuleManager { /** * Initializes the list of export points from all configured modules . < p > */ private synchronized void initModuleExportPoints ( ) { } }
Set < CmsExportPoint > exportPoints = new HashSet < CmsExportPoint > ( ) ; Iterator < CmsModule > i = m_modules . values ( ) . iterator ( ) ; while ( i . hasNext ( ) ) { CmsModule module = i . next ( ) ; List < CmsExportPoint > moduleExportPoints = module . getExportPoints ( ) ; for ( int j = 0 ; j < moduleExportPoints...
public class MurmurHash3v2 { /** * Self mix of k1 * @ param k1 input argument * @ return mix */ private static long mixK1 ( long k1 ) { } }
k1 *= C1 ; k1 = Long . rotateLeft ( k1 , 31 ) ; k1 *= C2 ; return k1 ;
public class ExpressRoutePortsInner { /** * Update ExpressRoutePort tags . * @ param resourceGroupName The name of the resource group . * @ param expressRoutePortName The name of the ExpressRoutePort resource . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ throws CloudExceptio...
return beginUpdateTagsWithServiceResponseAsync ( resourceGroupName , expressRoutePortName ) . toBlocking ( ) . single ( ) . body ( ) ;
public class BureauRegistry { /** * Registers a launcher for a given type . When an agent is started and no bureaus are * running , the < code > bureauType < / code > is used to determine the < code > Launcher < / code > * instance to call . If the launched bureau does not connect within the given number of * mil...
if ( _launchers . get ( bureauType ) != null ) { log . warning ( "Launcher for type already exists" , "type" , bureauType ) ; return ; } _launchers . put ( bureauType , new LauncherEntry ( launcher , timeout ) ) ;
public class AuthLocalSessionDataFactory { /** * / * ( non - Javadoc ) * @ see org . jdiameter . common . api . app . IAppSessionDataFactory # getAppSessionData ( java . lang . Class , java . lang . String ) */ @ Override public IAuthSessionData getAppSessionData ( Class < ? extends AppSession > clazz , String sessio...
if ( clazz . equals ( ClientAuthSession . class ) ) { ClientAuthSessionDataLocalImpl data = new ClientAuthSessionDataLocalImpl ( ) ; data . setSessionId ( sessionId ) ; return data ; } else if ( clazz . equals ( ServerAuthSession . class ) ) { ServerAuthSessionDataLocalImpl data = new ServerAuthSessionDataLocalImpl ( )...
public class GDLHandler { /** * Append the given GDL string to the current database . * @ param asciiString GDL string ( must not be { @ code null } ) . */ public void append ( String asciiString ) { } }
if ( asciiString == null ) { throw new IllegalArgumentException ( "AsciiString must not be null" ) ; } ANTLRInputStream antlrInputStream = new ANTLRInputStream ( asciiString ) ; GDLLexer lexer = new GDLLexer ( antlrInputStream ) ; GDLParser parser = new GDLParser ( new CommonTokenStream ( lexer ) ) ; // update the load...
public class Escrows { /** * This method allows you to release a payment with escrow . * @ param escrowId * { @ code String } the Moip escrow external ID . * @ param setup * { @ code Setup } the setup object . * @ return { @ code Map < String , Object > } */ public Map < String , Object > release ( String esc...
this . requestMaker = new RequestMaker ( setup ) ; RequestProperties props = new RequestPropertiesBuilder ( ) . method ( "POST" ) . endpoint ( String . format ( "%s/%s/release" , ENDPOINT , escrowId ) ) . type ( Escrows . class ) . contentType ( CONTENT_TYPE ) . build ( ) ; return this . requestMaker . doRequest ( prop...
public class CompletableFuture { /** * Waits if necessary for this future to complete , and then * returns its result . * @ return the result value * @ throws CancellationException if this future was cancelled * @ throws ExecutionException if this future completed exceptionally * @ throws InterruptedException...
Object r ; return reportGet ( ( r = result ) == null ? waitingGet ( true ) : r ) ;
public class TypesafeConfigUtils { /** * Get list of sub - configurations . Return { @ code null } if missing or wrong type . * @ param config * @ param path * @ return */ public static Optional < List < ? extends Config > > getConfigListOptional ( Config config , String path ) { } }
return Optional . ofNullable ( getConfigList ( config , path ) ) ;
public class TrustedAdvisorResourcesSummaryMarshaller { /** * Marshall the given parameter object . */ public void marshall ( TrustedAdvisorResourcesSummary trustedAdvisorResourcesSummary , ProtocolMarshaller protocolMarshaller ) { } }
if ( trustedAdvisorResourcesSummary == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( trustedAdvisorResourcesSummary . getResourcesProcessed ( ) , RESOURCESPROCESSED_BINDING ) ; protocolMarshaller . marshall ( trustedAdvisorResourcesSummary...
public class Checks { /** * Performs emptiness and nullness check . * @ param reference reference to check * @ param errorMessage the exception message to use if the check fails ; will * be converted to a string using { @ link String # valueOf ( Object ) } * @ param < T > the reference type * @ return the che...
checkNotEmpty ( reference , String . valueOf ( errorMessage ) , EMPTY_ERROR_MESSAGE_ARGS ) ; return reference ;
public class Asserts { /** * Checks that a class has a no - argument private constructor and calls that * constructor to instantiate the class ( usually for code coverage * purposes ) . * @ param < T > * type of class being checked * @ param cls * class being checked */ static void assertConstructorIsPrivat...
Constructor < ? > constructor ; try { constructor = cls . getDeclaredConstructor ( ) ; } catch ( NoSuchMethodException e1 ) { throw new RuntimeException ( "private constructor without arguments not found" , e1 ) ; } catch ( SecurityException e1 ) { throw new RuntimeException ( e1 ) ; } assertTrue ( "constructor is not ...
public class PDIndexerManager { /** * Queue a new work item * @ param aParticipantID * Participant ID to use . * @ param eType * Action type . * @ param sOwnerID * Owner of this action * @ param sRequestingHost * Requesting host ( IP address ) * @ return { @ link EChange # UNCHANGED } if the item was ...
// Build item final IIndexerWorkItem aWorkItem = new IndexerWorkItem ( aParticipantID , eType , sOwnerID , sRequestingHost ) ; // And queue it return _queueUniqueWorkItem ( aWorkItem ) ;
public class Encoder { /** * Encode the given object into a series of statements and expressions . * The implementation simply finds the < code > PersistenceDelegate < / code > responsible for the object ' s class , and delegate the call to it . * @ param o * the object to encode */ protected void writeObject ( O...
if ( o == null ) { return ; } getPersistenceDelegate ( o . getClass ( ) ) . writeObject ( o , this ) ;