signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class JsonRpcHttpAsyncClient { /** * Set the request headers . * @ param request the request object * @ param headers to be used */ private void addHeaders ( HttpRequest request , Map < String , String > headers ) { } }
for ( Map . Entry < String , String > key : headers . entrySet ( ) ) { request . addHeader ( key . getKey ( ) , key . getValue ( ) ) ; }
public class DistributedQueue { /** * Wait until any pending puts are committed * @ param waitTime max wait time * @ param timeUnit time unit * @ return true if the flush was successful , false if it timed out first * @ throws InterruptedException if thread was interrupted */ @ Override public boolean flushPuts...
long msWaitRemaining = TimeUnit . MILLISECONDS . convert ( waitTime , timeUnit ) ; synchronized ( putCount ) { while ( putCount . get ( ) > 0 ) { if ( msWaitRemaining <= 0 ) { return false ; } long startMs = System . currentTimeMillis ( ) ; putCount . wait ( msWaitRemaining ) ; long elapsedMs = System . currentTimeMill...
public class CiphererWithStaticKeyImpl { /** * Encrypts / decrypts a message based on the underlying mode of operation . * @ param message if in encryption mode , the clear - text message , otherwise * the message to decrypt * @ return if in encryption mode , the encrypted message , otherwise the * decrypted me...
try { final Cipher cipher = ( ( ( provider == null ) || ( provider . length ( ) == 0 ) ) ? Cipher . getInstance ( cipherAlgorithm ) : Cipher . getInstance ( cipherAlgorithm , provider ) ) ; switch ( mode ) { case ENCRYPT : cipher . init ( Cipher . ENCRYPT_MODE , keySpec , initializationVectorSpec ) ; break ; case DECRY...
public class CommerceTierPriceEntryUtil { /** * Returns the last commerce tier price entry 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 matching commerce tier price entr...
return getPersistence ( ) . fetchByUuid_Last ( uuid , orderByComparator ) ;
public class QueryMaker { /** * 增加嵌套插 * @ param boolQuery * @ param where * @ param subQuery */ private void addSubQuery ( BoolQueryBuilder boolQuery , Where where , QueryBuilder subQuery ) { } }
if ( where instanceof Condition ) { Condition condition = ( Condition ) where ; if ( condition . isNested ( ) ) { boolean isNestedQuery = subQuery instanceof NestedQueryBuilder ; InnerHitBuilder ihb = null ; if ( condition . getInnerHits ( ) != null ) { try ( JsonXContentParser parser = new JsonXContentParser ( NamedXC...
public class WorkflowTriggerHistoriesInner { /** * Resubmits a workflow run based on the trigger history . * @ param resourceGroupName The resource group name . * @ param workflowName The workflow name . * @ param triggerName The workflow trigger name . * @ param historyName The workflow trigger history name . ...
return resubmitWithServiceResponseAsync ( resourceGroupName , workflowName , triggerName , historyName ) . map ( new Func1 < ServiceResponse < Void > , Void > ( ) { @ Override public Void call ( ServiceResponse < Void > response ) { return response . body ( ) ; } } ) ;
public class BaseLevel1 { /** * computes a vector by a scalar product . * @ param N * @ param alpha * @ param X */ @ Override public void scal ( long N , double alpha , INDArray X ) { } }
if ( Nd4j . getExecutioner ( ) . getProfilingMode ( ) == OpExecutioner . ProfilingMode . ALL ) OpProfiler . getInstance ( ) . processBlasCall ( false , X ) ; if ( X . isSparse ( ) ) { Nd4j . getSparseBlasWrapper ( ) . level1 ( ) . scal ( N , alpha , X ) ; } else if ( X . data ( ) . dataType ( ) == DataType . DOUBLE ) d...
public class Replication { /** * Triggers a replication request . */ public ReplicationResult trigger ( ) { } }
assertNotEmpty ( source , "Source" ) ; assertNotEmpty ( target , "Target" ) ; InputStream response = null ; try { JsonObject json = createJson ( ) ; if ( log . isLoggable ( Level . FINE ) ) { log . fine ( json . toString ( ) ) ; } final URI uri = new DatabaseURIHelper ( client . getBaseUri ( ) ) . path ( "_replicate" )...
public class AiMesh { /** * Returns the texture coordinates as n - dimensional vector . < p > * This method is part of the wrapped API ( see { @ link AiWrapperProvider } * for details on wrappers ) . < p > * The built - in behavior is to return a { @ link AiVector } . * @ param vertex the vertex index * @ par...
if ( ! hasTexCoords ( coords ) ) { throw new IllegalStateException ( "mesh has no texture coordinate set " + coords ) ; } checkVertexIndexBounds ( vertex ) ; return wrapperProvider . wrapVector3f ( m_texcoords [ coords ] , vertex * 3 * SIZEOF_FLOAT , getNumUVComponents ( coords ) ) ;
public class HeadDocumentRepositoryMongoImpl { /** * { @ inheritDoc } */ @ Override public final HeadDocument findByRootAndString ( final RootDocument rootDocument , final String string ) { } }
final HeadDocument headDocument = findByFileAndString ( rootDocument . getFilename ( ) , string ) ; if ( headDocument == null ) { return null ; } final Head head = headDocument . getGedObject ( ) ; head . setParent ( rootDocument . getGedObject ( ) ) ; return headDocument ;
public class LogPattern { /** * Generate a log string . */ public StringBuilder generate ( Log log ) { } }
StringBuilder s = new StringBuilder ( ) ; for ( int i = 0 ; i < parts . length ; ++ i ) parts [ i ] . append ( s , log ) ; if ( log . trace != null ) appendStack ( s , log . trace ) ; return s ;
public class Strings { /** * Java - unescapes all the elements in the target set . * @ param target the list of Strings to be unescaped . * If non - String objects , toString ( ) will be called . * @ return a Set with the result of each * each element of the target . * @ since 2.0.11 */ public Set < String > ...
if ( target == null ) { return null ; } final Set < String > result = new LinkedHashSet < String > ( target . size ( ) + 2 ) ; for ( final Object element : target ) { result . add ( unescapeJava ( element ) ) ; } return result ;
public class BusinessdayCalendarExcludingTARGETHolidays { /** * Test a given date for being easter sunday . * The method uses the algorithms sometimes cited as Meeus , Jones , Butcher Gregorian algorithm . * Taken from http : / / en . wikipedia . org / wiki / Computus * @ param date The date to check . * @ retu...
int y = date . getYear ( ) ; int a = y % 19 ; int b = y / 100 ; int c = y % 100 ; int d = b / 4 ; int e = b % 4 ; int f = ( b + 8 ) / 25 ; int g = ( b - f + 1 ) / 3 ; int h = ( 19 * a + b - d - g + 15 ) % 30 ; int i = c / 4 ; int k = c % 4 ; int l = ( 32 + 2 * e + 2 * i - h - k ) % 7 ; int m = ( a + 11 * h + 22 * l ) /...
public class ScopeDesktopWindowManager { /** * and unique within a single menu given either shortcutletter or pos */ public QuickMenuItem getQuickMenuItemByAction ( String action ) { } }
List < QuickMenuItem > itemList = getQuickMenuItemList ( ) ; for ( QuickMenuItem item : itemList ) { if ( item . getActionName ( ) . equals ( action ) ) { return item ; } } return null ;
public class ApproximateHistogram { /** * Returns a compact byte - buffer representation of this ApproximateHistogram object * storing actual values as opposed to histogram bins * Requires 3 + 4 * count bytes of storage with count & lt ; = 127 * @ param buf ByteBuffer to write the ApproximateHistogram to */ publi...
Preconditions . checkState ( canStoreCompact ( ) , "Approximate histogram cannot be stored in compact form" ) ; buf . putShort ( ( short ) ( - 1 * size ) ) ; // use negative size to indicate compact storage final long exactCount = getExactCount ( ) ; if ( exactCount != count ) { // use negative count to indicate approx...
public class CommerceShipmentItemLocalServiceBaseImpl { /** * Performs a dynamic query on the database and returns a range of the matching rows . * Useful when paginating results . Returns a maximum of < code > end - start < / code > instances . < code > start < / code > and < code > end < / code > are not primary ke...
return commerceShipmentItemPersistence . findWithDynamicQuery ( dynamicQuery , start , end ) ;
public class PersistenceDelegator { /** * Writes an entity into Persistence cache . ( Actual database write is done * while flushing ) */ public void persist ( Object e ) { } }
if ( e == null ) { throw new IllegalArgumentException ( "Entity object is invalid, operation failed. Please check previous log message for details" ) ; } // Create an object graph of the entity object . ObjectGraph graph = new GraphGenerator ( ) . generateGraph ( e , this ) ; // Call persist on each node in object grap...
public class Waiter { /** * Compares Activity classes . * @ param activityClass the Activity class to compare * @ param currentActivity the Activity that is currently active * @ return true if Activity classes match */ private boolean isActivityMatching ( Class < ? extends Activity > activityClass , Activity curr...
if ( currentActivity != null && currentActivity . getClass ( ) . equals ( activityClass ) ) { return true ; } return false ;
public class JMXExtension { /** * { @ inheritDoc } */ @ Override public void initializeParsers ( ExtensionParsingContext context ) { } }
context . setSubsystemXmlMapping ( SUBSYSTEM_NAME , Namespace . JMX_1_0 . getUriString ( ) , JMXSubsystemParser_1_0 :: new ) ; context . setSubsystemXmlMapping ( SUBSYSTEM_NAME , Namespace . JMX_1_1 . getUriString ( ) , JMXSubsystemParser_1_1 :: new ) ; context . setSubsystemXmlMapping ( SUBSYSTEM_NAME , Namespace . JM...
public class MessageFlush { /** * Deliver the message * @ param os the physical output stream * @ param writerHttp the writer context */ @ Override public void deliver ( WriteStream os , OutHttp2 outHttp ) throws IOException { } }
try { os . flush ( ) ; } finally { _future . ok ( null ) ; }
public class FctBnTradeProcessors { /** * < p > Lazy initialize retrievers . < / p > * @ param pAddParam additional param * @ throws Exception - an exception */ protected final void lazyInitRetrievers ( final Map < String , Object > pAddParam ) throws Exception { } }
if ( this . retrievers == null ) { this . retrievers = new HashMap < String , ICsvDataRetriever > ( ) ; GoodsPriceListRetriever < RS > gpr = new GoodsPriceListRetriever < RS > ( ) ; gpr . setSrvI18n ( getSrvI18n ( ) ) ; gpr . setSrvOrm ( getSrvOrm ( ) ) ; gpr . setSrvDatabase ( getSrvDatabase ( ) ) ; gpr . setSrvAccSet...
public class ArrayWrappedCallByReference { /** * processes a method call looking for parameters that are arrays . If this array was seen earlier as a simple wrapping array , then it marks it as being * having been used as a parameter . */ private void processMethodCall ( ) { } }
if ( "invoke" . equals ( getNameConstantOperand ( ) ) && "java/lang/reflect/Method" . equals ( getClassConstantOperand ( ) ) ) { return ; } String sig = getSigConstantOperand ( ) ; List < String > args = SignatureUtils . getParameterSignatures ( sig ) ; if ( stack . getStackDepth ( ) >= args . size ( ) ) { for ( int i ...
public class DependencyAnalyzer { /** * Checks the dependencies for a package from the " forbidden " section . * @ param dependencies * Dependency definition to use . * @ param forbiddenPkg * Package with forbidden imports . * @ param classInfo * Information extracted from the class . * @ return List of e...
final List < DependencyError > errors = new ArrayList < DependencyError > ( ) ; final Iterator < String > it = classInfo . getImports ( ) . iterator ( ) ; while ( it . hasNext ( ) ) { final String importedPkg = it . next ( ) ; if ( ! importedPkg . equals ( classInfo . getPackageName ( ) ) ) { final NotDependsOn ndo = U...
public class InstanceConverterFactory { /** * Gets an appropriate { @ link PropositionConverter } for constructing a * PROTEMPA proposition definition from the given Protege proposition * instance . * @ param proposition a Protege proposition { @ link Proposition } instance . * @ return an appropriate { @ link ...
if ( proposition == null ) { return null ; } else { if ( this . converterMap == null ) { populateConverterMap ( ) ; } Collection < Cls > types = ( Collection < Cls > ) proposition . getDirectTypes ( ) ; for ( Cls cls : types ) { PropositionConverter pc = this . converterMap . get ( cls ) ; if ( pc != null ) { return pc...
public class BootstrapHandlers { /** * Remove a configuration given its unique name from the given { @ link * ServerBootstrap } * @ param b a server bootstrap * @ param name a configuration name */ public static ServerBootstrap removeConfiguration ( ServerBootstrap b , String name ) { } }
Objects . requireNonNull ( b , "bootstrap" ) ; Objects . requireNonNull ( name , "name" ) ; if ( b . config ( ) . childHandler ( ) != null ) { b . childHandler ( removeConfiguration ( b . config ( ) . childHandler ( ) , name ) ) ; } return b ;
public class CommonOps_DDRM { /** * Returns the absolute value of the element in the matrix that has the smallest absolute value . < br > * < br > * Min { | a < sub > ij < / sub > | } for all i and j < br > * @ param a A matrix . Not modified . * @ return The max element value of the matrix . */ public static d...
final int size = a . getNumElements ( ) ; double min = Double . MAX_VALUE ; for ( int i = 0 ; i < size ; i ++ ) { double val = Math . abs ( a . get ( i ) ) ; if ( val < min ) { min = val ; } } return min ;
public class DateUtils { /** * Given a string that may be a date or a date range , extract a interval of * dates from that date range , up to the end milisecond of the last day . * @ see DateUtils # extractDateInterval ( String ) which returns a pair of DateMidnights . * @ param eventDate a string containing a dw...
Interval result = null ; DateTimeParser [ ] parsers = { DateTimeFormat . forPattern ( "yyyy-MM" ) . getParser ( ) , DateTimeFormat . forPattern ( "yyyy" ) . getParser ( ) , ISODateTimeFormat . dateOptionalTimeParser ( ) . getParser ( ) } ; DateTimeFormatter formatter = new DateTimeFormatterBuilder ( ) . append ( null ,...
public class nd6ravariables_binding { /** * Use this API to fetch nd6ravariables _ binding resource of given name . */ public static nd6ravariables_binding get ( nitro_service service , Long vlan ) throws Exception { } }
nd6ravariables_binding obj = new nd6ravariables_binding ( ) ; obj . set_vlan ( vlan ) ; nd6ravariables_binding response = ( nd6ravariables_binding ) obj . get_resource ( service ) ; return response ;
public class Proxy { /** * This method identifies whether we are able to close this proxy * object . If this object represents a session object , then this * can only be closed if we have not been closed and if the connection * has not been closed . If it represents a connection , then we * can only close if we...
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "isClosed" ) ; boolean retValue = false ; if ( connectionProxy == null ) { retValue = closed ; } else { retValue = closed || connectionProxy . isClosed ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isE...
public class VpnSitesInner { /** * Creates a VpnSite resource if it doesn ' t exist else updates the existing VpnSite . * @ param resourceGroupName The resource group name of the VpnSite . * @ param vpnSiteName The name of the VpnSite being created or updated . * @ param vpnSiteParameters Parameters supplied to c...
if ( this . client . subscriptionId ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.subscriptionId() is required and cannot be null." ) ; } if ( resourceGroupName == null ) { throw new IllegalArgumentException ( "Parameter resourceGroupName is required and cannot be null." ) ; } if ( vpnSite...
public class WebAppFilterManager { /** * Returns a FilterInstanceWrapper object corresponding to the passed in * filter name . If the filter inst has previously been created , return that * instance . . . if not , then create a new filter instance * @ param filterName * - String containing the name of the filte...
if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) logger . entering ( CLASS_NAME , "getFilterInstanceWrapper" , "entry for " + filterName ) ; try { FilterInstanceWrapper filterInstW ; // see if the filter is already loaded filterInstW = ( FilterInstanceWrapp...
public class AuthUtils { /** * Get all of the configured Credential Renwer Plugins . * @ param storm _ conf the storm configuration to use . * @ return the configured credential renewers . */ public static Collection < ICredentialsRenewer > GetCredentialRenewers ( Map conf ) { } }
try { Set < ICredentialsRenewer > ret = new HashSet < ICredentialsRenewer > ( ) ; Collection < String > clazzes = ( Collection < String > ) conf . get ( Config . NIMBUS_CREDENTIAL_RENEWERS ) ; if ( clazzes != null ) { for ( String clazz : clazzes ) { ICredentialsRenewer inst = ( ICredentialsRenewer ) Class . forName ( ...
public class ListLaunchPathsRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( ListLaunchPathsRequest listLaunchPathsRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( listLaunchPathsRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( listLaunchPathsRequest . getAcceptLanguage ( ) , ACCEPTLANGUAGE_BINDING ) ; protocolMarshaller . marshall ( listLaunchPathsRequest . getProductId ( ) , PRODUCTID_...
public class JSONAssert { /** * Asserts that the JSONArray provided matches the expected string . If it isn ' t it throws an * { @ link AssertionError } . * @ param message Error message to be displayed in case of assertion failure * @ param expectedStr Expected JSON string * @ param actualStr String to compare...
assertEquals ( message , expectedStr , actualStr , strict ? JSONCompareMode . STRICT : JSONCompareMode . LENIENT ) ;
public class UnionPayApi { /** * 文件传输类接口 * @ param reqData * 请求参数 * @ return { String } */ public static String fileTransfer ( Map < String , String > reqData ) { } }
return HttpUtils . post ( SDKConfig . getConfig ( ) . getFileTransUrl ( ) , reqData ) ;
public class MoleculeSignature { /** * Builder for molecules ( rather , for atom containers ) from signature * strings . * @ param signatureString the signature string to use * @ param coBuilder { @ link IChemObjectBuilder } to build the returned atom container from * @ return an atom container */ public static...
ColoredTree tree = AtomSignature . parse ( signatureString ) ; MoleculeFromSignatureBuilder builder = new MoleculeFromSignatureBuilder ( coBuilder ) ; builder . makeFromColoredTree ( tree ) ; return builder . getAtomContainer ( ) ;
public class SuggestedFixes { /** * Adds modifiers to the given declaration and corresponding modifiers tree . */ public static Optional < SuggestedFix > removeModifiers ( ModifiersTree originalModifiers , VisitorState state , Set < Modifier > toRemove ) { } }
SuggestedFix . Builder fix = SuggestedFix . builder ( ) ; List < ErrorProneToken > tokens = state . getTokensForNode ( originalModifiers ) ; int basePos = ( ( JCTree ) originalModifiers ) . getStartPosition ( ) ; boolean empty = true ; for ( ErrorProneToken tok : tokens ) { Modifier mod = getTokModifierKind ( tok ) ; i...
public class Watch { /** * Helper to clear the docs on RESET or filter mismatch . */ private void resetDocs ( ) { } }
changeMap . clear ( ) ; resumeToken = null ; for ( DocumentSnapshot snapshot : documentSet ) { // Mark each document as deleted . If documents are not deleted , they will be send again by // the server . changeMap . put ( snapshot . getReference ( ) . getResourcePath ( ) , null ) ; } current = false ;
public class HtmlDocletWriter { /** * Adds the user specified top . * @ param htmlTree the content tree to which user specified top will be added */ public void addTop ( Content htmlTree ) { } }
Content top = new RawHtml ( replaceDocRootDir ( configuration . top ) ) ; fixedNavDiv . addContent ( top ) ;
public class ModelsImpl { /** * Get All Entity Roles for a given entity . * @ param appId The application ID . * @ param versionId The version ID . * @ param entityId entity Id * @ throws IllegalArgumentException thrown if parameters fail the validation * @ throws ErrorResponseException thrown if the request ...
return getClosedListEntityRolesWithServiceResponseAsync ( appId , versionId , entityId ) . toBlocking ( ) . single ( ) . body ( ) ;
public class TextApplier { /** * { @ inheritDoc } */ public void apply ( HSSFCell cell , HSSFCellStyle cellStyle , Map < String , String > style ) { } }
HSSFWorkbook workBook = cell . getSheet ( ) . getWorkbook ( ) ; HSSFFont font = null ; if ( ITALIC . equals ( style . get ( FONT_STYLE ) ) ) { font = getFont ( cell , font ) ; font . setItalic ( true ) ; } int fontSize = CssUtils . getInt ( style . get ( FONT_SIZE ) ) ; if ( fontSize > 0 ) { font = getFont ( cell , fon...
public class GrowingSparseMatrix { /** * { @ inheritDoc } */ public void setColumn ( int column , double [ ] values ) { } }
for ( int row = 0 ; row < rows ( ) ; ++ row ) set ( row , column , values [ row ] ) ;
public class Models { /** * Fetch all the Frames so we can see if they are compatible with our Model ( s ) . */ private Pair < Map < String , Frame > , Map < String , Set < String > > > fetchFrames ( ) { } }
Map < String , Frame > all_frames = null ; Map < String , Set < String > > all_frames_cols = null ; if ( this . find_compatible_frames ) { // caches for this request all_frames = Frames . fetchAll ( ) ; all_frames_cols = new TreeMap < String , Set < String > > ( ) ; for ( Map . Entry < String , Frame > entry : all_fram...
public class CssHelper { /** * Binds the < code > css < / code > statement . */ public static ChainableStatement css ( String name , String value ) { } }
return new DefaultChainableStatement ( "css" , JsUtils . quotes ( name ) , JsUtils . quotes ( value ) ) ;
public class SVGUtil { /** * Set a SVG attribute * @ param el element * @ param name attribute name * @ param d double value */ public static void setAtt ( Element el , String name , double d ) { } }
el . setAttribute ( name , fmt ( d ) ) ;
public class AmazonKinesisAsyncClient { /** * Simplified method form for invoking the SplitShard operation with an AsyncHandler . * @ see # splitShardAsync ( SplitShardRequest , com . amazonaws . handlers . AsyncHandler ) */ @ Override public java . util . concurrent . Future < SplitShardResult > splitShardAsync ( St...
return splitShardAsync ( new SplitShardRequest ( ) . withStreamName ( streamName ) . withShardToSplit ( shardToSplit ) . withNewStartingHashKey ( newStartingHashKey ) , asyncHandler ) ;
public class StreamBuilderImpl { /** * Reduce with an accumulator and combiner */ @ Override public < R > StreamBuilderImpl < R , U > reduce ( R identity , BiFunctionSync < R , ? super T , R > accumulator , BinaryOperatorSync < R > combiner ) { } }
return new ReduceAccumSync < > ( this , identity , accumulator , combiner ) ;
public class CompileTask { /** * Converts { @ code < entrypoint / > } nested elements into Compiler entrypoint * replacements . */ private void convertEntryPointParameters ( CompilerOptions options ) { } }
ImmutableList . Builder < ModuleIdentifier > entryPointsBuilder = ImmutableList . builder ( ) ; for ( Parameter p : entryPointParams ) { entryPointsBuilder . add ( ModuleIdentifier . forClosure ( p . getName ( ) ) ) ; } if ( this . manageDependencies ) { options . setDependencyOptions ( DependencyOptions . pruneLegacyF...
public class SdpFactory { /** * Rejects a media description from an SDP offer . * @ param answer * The SDP answer to include the rejected media * @ param media * The offered media description to be rejected */ public static void rejectMediaField ( SessionDescription answer , MediaDescriptionField media ) { } }
MediaDescriptionField rejected = new MediaDescriptionField ( ) ; rejected . setMedia ( media . getMedia ( ) ) ; rejected . setPort ( 0 ) ; rejected . setProtocol ( media . getProtocol ( ) ) ; rejected . setPayloadTypes ( media . getPayloadTypes ( ) ) ; rejected . setSession ( answer ) ; answer . addMediaDescription ( r...
public class VirtualFileSystem { /** * Returns { @ linkplain OutputStream } to write the contents of the specified file from the beginning . Writing to * the returned stream doesn ' t change the { @ linkplain File } ' s last modified time . * @ param txn { @ linkplain Transaction } instance * @ param fileDescript...
return new VfsOutputStream ( this , txn , fileDescriptor , null ) ;
public class AmazonMTurkClient { /** * The < code > AssociateQualificationWithWorker < / code > operation gives a Worker a Qualification . * < code > AssociateQualificationWithWorker < / code > does not require that the Worker submit a Qualification request . It * gives the Qualification directly to the Worker . ...
request = beforeClientExecution ( request ) ; return executeAssociateQualificationWithWorker ( request ) ;
public class Reflection { /** * Get current value represented as a string for the property on the supplied target object . * @ param target the target on which the setter is to be called ; may not be null * @ param property the property that is to be set on the target * @ return the current value for the property...
Object value = getProperty ( target , property ) ; StringBuilder sb = new StringBuilder ( ) ; writeObjectAsString ( value , sb , false ) ; return sb . toString ( ) ;
public class Base64 { /** * Returns whether or not the < code > octet < / code > is in the base 64 alphabet . * @ param octet * The value to test * @ return < code > true < / code > if the value is defined in the the base 64 alphabet , < code > false < / code > otherwise . * @ since 1.4 */ public static boolean...
return octet == PAD || ( octet >= 0 && octet < DECODE_TABLE . length && DECODE_TABLE [ octet ] != - 1 ) ;
public class MutableInodeFile { /** * Updates this inode file ' s state from the given entry . * @ param entry the entry */ public void updateFromEntry ( UpdateInodeFileEntry entry ) { } }
if ( entry . hasPersistJobId ( ) ) { setPersistJobId ( entry . getPersistJobId ( ) ) ; } if ( entry . hasReplicationMax ( ) ) { setReplicationMax ( entry . getReplicationMax ( ) ) ; } if ( entry . hasReplicationMin ( ) ) { setReplicationMin ( entry . getReplicationMin ( ) ) ; } if ( entry . hasTempUfsPath ( ) ) { setTe...
public class TerminateInstancesRequest { /** * This method is intended for internal use only . Returns the marshaled request configured with additional * parameters to enable operation dry - run . */ @ Override public Request < TerminateInstancesRequest > getDryRunRequest ( ) { } }
Request < TerminateInstancesRequest > request = new TerminateInstancesRequestMarshaller ( ) . marshall ( this ) ; request . addParameter ( "DryRun" , Boolean . toString ( true ) ) ; return request ;
public class SaveOptions { /** * Transparently handles the deprecated options that could be passed as * map - entries to { @ link org . eclipse . emf . ecore . resource . Resource # save ( Map ) } * and converts them to semantically equal { @ link SaveOptions } . * @ param saveOptions the options - map or < code ...
if ( saveOptions == null || saveOptions . isEmpty ( ) ) return defaultOptions ( ) ; if ( saveOptions . containsKey ( KEY ) ) return ( SaveOptions ) saveOptions . get ( KEY ) ; if ( saveOptions . containsKey ( XtextResource . OPTION_SERIALIZATION_OPTIONS ) ) return ( ( org . eclipse . xtext . parsetree . reconstr . Seri...
public class TileMatrixDao { /** * { @ inheritDoc } */ @ Override public int updateId ( TileMatrix data , TileMatrixKey newId ) throws SQLException { } }
int count = 0 ; TileMatrix readData = queryForId ( data . getId ( ) ) ; if ( readData != null && newId != null ) { readData . setId ( newId ) ; count = update ( readData ) ; } return count ;
public class SQLiteDatabase { /** * Open the database according to the flags { @ link # OPEN _ READWRITE } * { @ link # OPEN _ READONLY } { @ link # CREATE _ IF _ NECESSARY } . * < p > Accepts input param : a concrete instance of { @ link DatabaseErrorHandler } to be * used to handle corruption when sqlite report...
SQLiteDatabase db = new SQLiteDatabase ( path , flags , walConnectionPoolSize , factory , errorHandler , connectionListener ) ; db . open ( ) ; return db ;
public class BigDecimal { /** * Returns a { @ code BigDecimal } created from { @ code BigInteger } value with * given scale rounded according to the MathContext settings */ private static BigDecimal doRound ( BigInteger intVal , int scale , MathContext mc ) { } }
int mcp = mc . precision ; int prec = 0 ; if ( mcp > 0 ) { long compactVal = compactValFor ( intVal ) ; int mode = mc . roundingMode . oldMode ; int drop ; if ( compactVal == INFLATED ) { prec = bigDigitLength ( intVal ) ; drop = prec - mcp ; while ( drop > 0 ) { scale = checkScaleNonZero ( ( long ) scale - drop ) ; in...
public class ListInstancesRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( ListInstancesRequest listInstancesRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( listInstancesRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( listInstancesRequest . getServiceId ( ) , SERVICEID_BINDING ) ; protocolMarshaller . marshall ( listInstancesRequest . getNextToken ( ) , NEXTTOKEN_BINDING ) ; prot...
public class WebUtil { /** * get user agent */ public static UserAgent getUserAgent ( HttpServletRequest request ) { } }
if ( request == null ) { return null ; } String userAgentHead = request . getHeader ( "User-Agent" ) ; return getUserAgent ( userAgentHead ) ;
public class Texture2dProgram { /** * Sets the size of the texture . This is used to find adjacent texels when filtering . */ public void setTexSize ( int width , int height ) { } }
mTexHeight = height ; mTexWidth = width ; float rw = 1.0f / width ; float rh = 1.0f / height ; // Don ' t need to create a new array here , but it ' s syntactically convenient . mTexOffset = new float [ ] { - rw , - rh , 0f , - rh , rw , - rh , - rw , 0f , 0f , 0f , rw , 0f , - rw , rh , 0f , rh , rw , rh } ; // Log . ...
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EClass getIfcPressureMeasure ( ) { } }
if ( ifcPressureMeasureEClass == null ) { ifcPressureMeasureEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 854 ) ; } return ifcPressureMeasureEClass ;
public class CqlBlockedDataReaderDAO { /** * Creates a Record instance for a given key and list of rows . All rows must be from the same Cassandra row ; * in other words , it is expected that row . getBytesUnsafe ( ROW _ KEY _ RESULT _ SET _ COLUMN ) returns the same value for * each row in rows . */ private Record...
Session session = placement . getKeyspace ( ) . getCqlSession ( ) ; ProtocolVersion protocolVersion = session . getCluster ( ) . getConfiguration ( ) . getProtocolOptions ( ) . getProtocolVersion ( ) ; CodecRegistry codecRegistry = session . getCluster ( ) . getConfiguration ( ) . getCodecRegistry ( ) ; Iterator < Map ...
public class GenListModuleReader { /** * List of files with " @ processing - role = resource - only " . * @ return the resource - only set */ public Set < URI > getResourceOnlySet ( ) { } }
final Set < URI > res = new HashSet < > ( resourceOnlySet ) ; res . removeAll ( normalProcessingRoleSet ) ; return res ;
public class Bytes { /** * Returns an array of byte arrays made from passed array of Text . * @ param t operands * @ return Array of byte arrays made from passed array of Text */ public static byte [ ] [ ] toByteArrays ( final String [ ] t ) { } }
byte [ ] [ ] result = new byte [ t . length ] [ ] ; for ( int i = 0 ; i < t . length ; i ++ ) { result [ i ] = Bytes . toBytes ( t [ i ] ) ; } return result ;
public class Item { /** * Sets the value of the specified attribute in the current item to the * given value . */ public Item withNumber ( String attrName , Number val ) { } }
checkInvalidAttribute ( attrName , val ) ; attributes . put ( attrName , toBigDecimal ( val ) ) ; return this ;
public class Comment { /** * { @ inheritDoc } */ @ Override public boolean write ( Writer out , boolean atNewline ) throws IOException { } }
if ( ! atNewline ) out . write ( DocletConstants . NL ) ; out . write ( "<!-- " ) ; out . write ( commentText ) ; out . write ( " -->" + DocletConstants . NL ) ; return true ;
public class BindTransformer { /** * Get Java primitive type Transformable . * @ param type * the type * @ return the primitive transform */ static BindTransform getPrimitiveTransform ( TypeName type ) { } }
if ( Integer . TYPE . toString ( ) . equals ( type . toString ( ) ) ) { return new IntegerBindTransform ( false ) ; } if ( Boolean . TYPE . toString ( ) . equals ( type . toString ( ) ) ) { return new BooleanBindTransform ( false ) ; } if ( Long . TYPE . toString ( ) . equals ( type . toString ( ) ) ) { return new Long...
public class Trash { /** * For each existing trash snapshot , uses a { @ link org . apache . gobblin . data . management . trash . SnapshotCleanupPolicy } to determine whether * the snapshot should be deleted . If so , delete it permanently . * Each existing snapshot will be passed to { @ link org . apache . gobbli...
List < FileStatus > snapshotsInTrash = Arrays . asList ( this . fs . listStatus ( this . trashLocation , TRASH_SNAPSHOT_PATH_FILTER ) ) ; Collections . sort ( snapshotsInTrash , new Comparator < FileStatus > ( ) { @ Override public int compare ( FileStatus o1 , FileStatus o2 ) { return TRASH_SNAPSHOT_NAME_FORMATTER . p...
public class AgentServlet { /** * Update the agent URL in the agent details if not already done */ private void updateAgentDetailsIfNeeded ( HttpServletRequest pReq ) { } }
// Lookup the Agent URL if needed AgentDetails details = backendManager . getAgentDetails ( ) ; if ( details . isInitRequired ( ) ) { synchronized ( details ) { if ( details . isInitRequired ( ) ) { if ( details . isUrlMissing ( ) ) { String url = getBaseUrl ( NetworkUtil . sanitizeLocalUrl ( pReq . getRequestURL ( ) ....
public class DeLiCluTree { /** * Creates a new directory entry representing the specified node . * @ param node the node to be represented by the new entry */ @ Override protected DeLiCluEntry createNewDirectoryEntry ( DeLiCluNode node ) { } }
return new DeLiCluDirectoryEntry ( node . getPageID ( ) , node . computeMBR ( ) , node . hasHandled ( ) , node . hasUnhandled ( ) ) ;
public class Grid { /** * Replies the element at the specified index . * @ param index the index . * @ return the element at the specified position . */ @ Pure public P getElementAt ( int index ) { } }
if ( index >= 0 ) { int idx = 0 ; int eIdx ; for ( final GridCell < P > cell : getGridCells ( ) ) { eIdx = idx + cell . getReferenceElementCount ( ) ; if ( index < eIdx ) { try { return cell . getElementAt ( index - idx ) ; } catch ( IndexOutOfBoundsException exception ) { throw new IndexOutOfBoundsException ( Integer ...
public class PersistInterfaceService { /** * Runs all registered post - commit hooks */ private void runEKBPostCommitHooks ( EKBCommit commit ) throws EKBException { } }
for ( EKBPostCommitHook hook : postCommitHooks ) { try { hook . onPostCommit ( commit ) ; } catch ( Exception e ) { LOGGER . warn ( "An exception is thrown in a EKB post commit hook." , e ) ; } }
public class RoleAssignmentsInner { /** * Gets role assignments for a scope . * @ param scope The scope of the role assignments . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the PagedList & lt ; RoleAssignmentInner & gt ; object */ public Observable < ...
return listForScopeWithServiceResponseAsync ( scope ) . map ( new Func1 < ServiceResponse < Page < RoleAssignmentInner > > , Page < RoleAssignmentInner > > ( ) { @ Override public Page < RoleAssignmentInner > call ( ServiceResponse < Page < RoleAssignmentInner > > response ) { return response . body ( ) ; } } ) ;
public class SynchronizationPoint { /** * Report this synchronization point as failed because of the given exception . The { @ code failureException } must be set . * @ param failureException the exception causing this synchronization point to fail . */ public void reportFailure ( E failureException ) { } }
assert failureException != null ; connectionLock . lock ( ) ; try { state = State . Failure ; this . failureException = failureException ; condition . signalAll ( ) ; } finally { connectionLock . unlock ( ) ; }
public class DefaultTokenMap { /** * Called when only the schema has changed . */ public DefaultTokenMap refresh ( @ NonNull Collection < Node > nodes , @ NonNull Collection < KeyspaceMetadata > keyspaces , @ NonNull ReplicationStrategyFactory replicationStrategyFactory ) { } }
Map < CqlIdentifier , Map < String , String > > newReplicationConfigs = buildReplicationConfigs ( keyspaces , logPrefix ) ; if ( newReplicationConfigs . equals ( replicationConfigs ) ) { LOG . debug ( "[{}] Schema changes do not impact the token map, no refresh needed" , logPrefix ) ; return this ; } ImmutableMap . Bui...
public class FileIngester { /** * Imports a csv file defined in the fileIngest entity * @ see FileIngestJobExecutionMetadata */ public FileMeta ingest ( String entityTypeId , String url , String loader , String jobExecutionID , Progress progress ) { } }
if ( ! "CSV" . equals ( loader ) ) { throw new FileIngestException ( "Unknown loader '" + loader + "'" ) ; } progress . setProgressMax ( 2 ) ; progress . progress ( 0 , "Downloading url '" + url + "'" ) ; File file = fileStoreDownload . downloadFile ( url , jobExecutionID , entityTypeId + ".csv" ) ; progress . progress...
public class TreeAppendable { /** * / * @ Nullable */ private static ILocationData createLocationData ( ITraceURIConverter converter , ILocationInFileProvider locationProvider , EObject object , ILocationInFileProviderExtension . RegionDescription query , boolean skipEmpty ) { } }
ITextRegion textRegion = locationProvider instanceof ILocationInFileProviderExtension ? ( ( ILocationInFileProviderExtension ) locationProvider ) . getTextRegion ( object , query ) : locationProvider . getFullTextRegion ( object ) ; if ( ! ( textRegion instanceof ITextRegionWithLineInformation ) ) { if ( log . isDebugE...
public class GUID { /** * ~ Methods / / / / / */ public static String generateFormattedGUID ( ) { } }
// xxxxx - xxxx - xxxx - xxxx - xxxxx String guid = generateGUID ( ) ; return guid . substring ( 0 , 8 ) + '-' + guid . substring ( 8 , 12 ) + '-' + guid . substring ( 12 , 16 ) + '-' + guid . substring ( 16 , 20 ) + '-' + guid . substring ( 20 ) ;
public class EventRef { /** * Helper method that computes the event descriptor sting for a method */ private String computeEventDescriptor ( Method method ) { } }
StringBuilder sb = new StringBuilder ( ) ; // Add event class and method name sb . append ( method . getDeclaringClass ( ) . getName ( ) ) ; sb . append ( "." ) ; sb . append ( method . getName ( ) ) ; // Add event arguments Class [ ] parms = method . getParameterTypes ( ) ; sb . append ( "(" ) ; for ( int i = 0 ; i < ...
public class GitLabApiClient { /** * Construct a REST URL with the specified path arguments . * @ param pathArgs variable list of arguments used to build the URI * @ return a REST URL with the specified path arguments * @ throws IOException if an error occurs while constructing the URL */ protected URL getApiUrl ...
String url = appendPathArgs ( this . hostUrl , pathArgs ) ; return ( new URL ( url ) ) ;
public class H2O { /** * Tell the embedding software that this H2O instance belongs to * a cloud of a certain size . * This may be non - blocking . * @ param ip IP address this H2O can be reached at . * @ param port Port this H2O can be reached at ( for REST API and browser ) . * @ param size Number of H2O in...
if ( ARGS . notify_local != null && ! ARGS . notify_local . trim ( ) . isEmpty ( ) ) { final File notifyFile = new File ( ARGS . notify_local ) ; final File parentDir = notifyFile . getParentFile ( ) ; if ( parentDir != null && ! parentDir . isDirectory ( ) ) { if ( ! parentDir . mkdirs ( ) ) { Log . err ( "Cannot make...
public class Fat16BootSector { /** * Sets the number of sectors / fat * @ param v the new number of sectors per fat */ @ Override public void setSectorsPerFat ( long v ) { } }
if ( v == getSectorsPerFat ( ) ) return ; if ( v > 0x7FFF ) throw new IllegalArgumentException ( "too many sectors for a FAT12/16" ) ; set16 ( SECTORS_PER_FAT_OFFSET , ( int ) v ) ;
public class FirewallClient { /** * Creates a firewall rule in the specified project using the data included in the request . * < p > Sample code : * < pre > < code > * try ( FirewallClient firewallClient = FirewallClient . create ( ) ) { * ProjectName project = ProjectName . of ( " [ PROJECT ] " ) ; * Firewa...
InsertFirewallHttpRequest request = InsertFirewallHttpRequest . newBuilder ( ) . setProject ( project == null ? null : project . toString ( ) ) . setFirewallResource ( firewallResource ) . build ( ) ; return insertFirewall ( request ) ;
public class Broadcaster { /** * A . m3u8 file was written in the recording directory . * Called on a background thread */ @ Subscribe public void onManifestUpdated ( HlsManifestWrittenEvent e ) { } }
if ( ! isRecording ( ) ) { if ( Kickflip . getBroadcastListener ( ) != null ) { if ( VERBOSE ) Log . i ( TAG , "Sending onBroadcastStop" ) ; Kickflip . getBroadcastListener ( ) . onBroadcastStop ( ) ; } } if ( VERBOSE ) Log . i ( TAG , "onManifestUpdated. Last segment? " + ! isRecording ( ) ) ; // Copy m3u8 at this mom...
public class MiriamLink { /** * To know if a URI of a data type is deprecated . * @ param uri ( URN or URL ) of a data type * @ return answer ( " true " or " false " ) to the question : is this URI deprecated ? */ public static boolean isDeprecated ( String uri ) { } }
Datatype datatype = datatypesHash . get ( uri ) ; String urn = getOfficialDataTypeURI ( datatype ) ; return ! uri . equalsIgnoreCase ( urn ) ;
public class MongoDBQuery { /** * ( non - Javadoc ) * @ see com . impetus . kundera . query . QueryImpl # iterate ( ) */ @ Override public Iterator iterate ( ) { } }
EntityMetadata m = getEntityMetadata ( ) ; Client client = persistenceDelegeator . getClient ( m ) ; return new ResultIterator ( ( MongoDBClient ) client , m , createMongoQuery ( m , getKunderaQuery ( ) . getFilterClauseQueue ( ) ) , getOrderByClause ( m ) , getKeys ( m , getKunderaQuery ( ) . getResult ( ) ) , persist...
public class Days { /** * Obtains an instance of { @ code Days } from a temporal amount . * This obtains an instance based on the specified amount . * A { @ code TemporalAmount } represents an amount of time , which may be * date - based or time - based , which this factory extracts to a { @ code Days } . * The...
if ( amount instanceof Days ) { return ( Days ) amount ; } Objects . requireNonNull ( amount , "amount" ) ; int days = 0 ; for ( TemporalUnit unit : amount . getUnits ( ) ) { long value = amount . get ( unit ) ; if ( value != 0 ) { long [ ] converted = Temporals . convertAmount ( value , unit , DAYS ) ; if ( converted ...
public class NS { /** * Returns an < code > IfNotExistsFunction < / code > object which represents an < a href = * " http : / / docs . aws . amazon . com / amazondynamodb / latest / developerguide / Expressions . Modifying . html " * > if _ not _ exists ( path , operand ) < / a > function call where path refers to ...
return new IfNotExistsFunction < NS > ( this , new LiteralOperand ( new LinkedHashSet < Number > ( Arrays . asList ( defaultValue ) ) ) ) ;
public class CPDefinitionOptionRelUtil { /** * Returns a range of all the cp definition option rels where companyId = & # 63 ; . * Useful when paginating results . Returns a maximum of < code > end - start < / code > instances . < code > start < / code > and < code > end < / code > are not primary keys , they are ind...
return getPersistence ( ) . findByCompanyId ( companyId , start , end ) ;
public class Ftp { /** * check if a file or directory exists * @ return FTPCLient * @ throws PageException * @ throws IOException */ private AFTPClient actionExists ( ) throws PageException , IOException { } }
required ( "item" , item ) ; AFTPClient client = getClient ( ) ; FTPFile file = existsFile ( client , item , false ) ; Struct cfftp = writeCfftp ( client ) ; cfftp . setEL ( RETURN_VALUE , Caster . toBoolean ( file != null ) ) ; cfftp . setEL ( SUCCEEDED , Boolean . TRUE ) ; return client ;
public class StorageSnippets { /** * [ VARIABLE " my _ unique _ bucket " ] */ public boolean deleteBucketAcl ( String bucketName ) { } }
// [ START deleteBucketAcl ] boolean deleted = storage . deleteAcl ( bucketName , User . ofAllAuthenticatedUsers ( ) ) ; if ( deleted ) { // the acl entry was deleted } else { // the acl entry was not found } // [ END deleteBucketAcl ] return deleted ;
public class QRDecompositionHouseholderTran_ZDRM { /** * To decompose the matrix ' A ' it must have full rank . ' A ' is a ' m ' by ' n ' matrix . * It requires about 2n * m < sup > 2 < / sup > - 2m < sup > 2 < / sup > / 3 flops . * The matrix provided here can be of different * dimension than the one specified i...
setExpectedMaxSize ( A . numRows , A . numCols ) ; CommonOps_ZDRM . transpose ( A , QR ) ; error = false ; for ( int j = 0 ; j < minLength ; j ++ ) { householder ( j ) ; updateA ( j ) ; } return ! error ;
public class MemoryManager { /** * Log memory usage to the console at regular interval . */ public static void logMemory ( long interval , Level level ) { } }
Task < Void , NoException > task = new Task . Cpu < Void , NoException > ( "Logging memory" , Task . PRIORITY_BACKGROUND ) { @ Override public Void run ( ) { logMemory ( level ) ; return null ; } } ; task . executeEvery ( interval , interval ) ; task . start ( ) ;
public class MemberLiteral { /** * Returns { @ code true } if this member is declared as default access . * @ return { @ code true } if default access */ public boolean isDefaultAccess ( ) { } }
return ! Modifier . isPrivate ( getModifiers ( ) ) && ! Modifier . isProtected ( getModifiers ( ) ) && ! Modifier . isPublic ( getModifiers ( ) ) ;
public class UIData { /** * Set the maximum number of rows displayed in the table . */ public void setRows ( int rows ) { } }
if ( rows < 0 ) { throw new IllegalArgumentException ( "rows: " + rows ) ; } getStateHelper ( ) . put ( PropertyKeys . rows , rows ) ;
public class Linear { /** * Returns the vector which was assigned the given internal id or null if the internal id does not exist . * The vector is taken either from the ram - based ( if loadIndexInMemory is true ) or from the disk - based * index . * @ param iid * The internal id of the vector * @ return The...
if ( iid < 0 || iid > loadCounter ) { System . out . println ( "Internal id " + iid + " is out of range!" ) ; return null ; } double [ ] vector = new double [ vectorLength ] ; if ( loadIndexInMemory ) { for ( int i = 0 ; i < vectorLength ; i ++ ) { vector [ i ] = vectorsList . getQuick ( iid * vectorLength + i ) ; } } ...
public class Filelistener { /** * In this method a subdirectory is being added to the system and watched . * This is necessary since the { @ link WatchService } doesn ' t support watching * a folder with higher depths than 1. * @ param root * @ param filePath * @ throws IOException */ private void addSubDirec...
String listener = getListenerRootPath ( root ) ; List < String > listeners = mSubDirectories . get ( listener ) ; if ( listeners != null ) { if ( mSubDirectories . get ( listener ) . contains ( filePath . toAbsolutePath ( ) ) ) { return ; } else { mSubDirectories . get ( listener ) . add ( filePath . toString ( ) ) ; }...
public class SiteTaskerQueue { /** * Block on the site tasker queue . */ public SiteTasker take ( ) throws InterruptedException { } }
SiteTasker task = m_tasks . poll ( ) ; if ( task == null ) { m_starvationTracker . beginStarvation ( ) ; } else { m_queueDepthTracker . pollUpdate ( task . getQueueOfferTime ( ) ) ; return task ; } try { task = CoreUtils . queueSpinTake ( m_tasks ) ; // task is never null m_queueDepthTracker . pollUpdate ( task . getQu...