signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class LockAdviser { /** * Reads { @ link LockAdviser # lockPath lock path directory } and finds the
* { @ link File write lock file } , if any .
* @ return the { @ link write lock file } , or < tt > null < / tt > if no write lock
* exists */
private File getWriteLock ( ) { } } | File [ ] lckFiles = this . lockPath . listFiles ( lockFilter ) ; for ( final File lckFile : lckFiles ) { if ( lockFilter . isWriterLockFile ( lckFile ) ) { return lckFile ; } } return null ; |
public class Shape { /** * Get array shape from the buffer , as an int [ ]
* @ param buffer Buffer to get the shape from
* @ return Shape array */
public static long [ ] shape ( DataBuffer buffer ) { } } | val ret = new long [ rank ( buffer ) ] ; for ( int i = 0 ; i < ret . length ; i ++ ) ret [ i ] = buffer . getInt ( 1 + i ) ; return ret ; |
public class OperationAggregator { /** * Combines { @ code op } with the other operation ( s ) merged into this instance .
* @ param other an { @ code Operation } to merge into the aggregate . */
public void add ( Operation other ) { } } | op . addAllLogEntries ( other . getLogEntriesList ( ) ) ; mergeMetricValues ( other ) ; mergeTimestamps ( other ) ; |
public class JavaScriptParser { /** * Parse the file content and return variants of the file .
* @ param fileContent to parse
* @ return the parsing result */
public ParseResult parse ( String fileContent ) { } } | ParseResult result = null ; // setup environment and initialize the parser .
CompilerEnvirons environment = new CompilerEnvirons ( ) ; environment . setLanguageVersion ( 180 ) ; environment . setStrictMode ( false ) ; environment . setRecordingComments ( true ) ; environment . setAllowSharpComments ( true ) ; environme... |
public class UpdateClusterRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( UpdateClusterRequest updateClusterRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( updateClusterRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( updateClusterRequest . getClusterName ( ) , CLUSTERNAME_BINDING ) ; protocolMarshaller . marshall ( updateClusterRequest . getDescription ( ) , DESCRIPTION_BINDING ... |
public class WidgetUtil { /** * Given an HTML string that defines a Flash object , creates a new DOM node for it and adds it
* to the appropriate container . Please note : the container should be added to the page prior
* to calling this function . */
public static HTML embedFlashObject ( Panel container , String h... | // Please note : the following is a work - around for an IE7 bug . If we create a Flash object
// node * before * attaching it to the DOM tree , IE will silently fail to register
// the Flash object ' s callback functions for access from JavaScript . To make this work ,
// create an empty node first , add it to the DOM... |
public class ORecordIteratorClusters { /** * Tell to the iterator that the upper limit must be checked at every cycle . Useful when concurrent deletes or additions change
* the size of the cluster while you ' re browsing it . Default is false .
* @ param iLiveUpdated
* True to activate it , otherwise false ( defa... | super . setLiveUpdated ( iLiveUpdated ) ; // SET THE UPPER LIMIT TO - 1 IF IT ' S ENABLED
lastClusterPosition = iLiveUpdated ? - 1 : database . countClusterElements ( current . clusterId ) ; if ( iLiveUpdated ) { firstClusterPosition = - 1 ; lastClusterPosition = - 1 ; } else { updateClusterRange ( ) ; } return this ; |
public class ExportManager { /** * Creates the initial export processor if export is enabled */
private void initialize ( CatalogContext catalogContext , List < Pair < Integer , Integer > > localPartitionsToSites , boolean isRejoin ) { } } | try { CatalogMap < Connector > connectors = CatalogUtil . getConnectors ( catalogContext ) ; if ( exportLog . isDebugEnabled ( ) ) { exportLog . debug ( "initialize for " + connectors . size ( ) + " connectors." ) ; CatalogUtil . dumpConnectors ( exportLog , connectors ) ; } if ( ! CatalogUtil . hasExportedTables ( con... |
public class AsmUtils { /** * Loads the class defined with the given name and bytecode using the given class loader .
* Since package and class idendity includes the ClassLoader instance used to load a class we use reflection
* on the given class loader to define generated classes . If we used our own class loader ... | checkArgNotNull ( className , "className" ) ; checkArgNotNull ( code , "code" ) ; checkArgNotNull ( classLoader , "classLoader" ) ; try { Class < ? > classLoaderBaseClass = Class . forName ( "java.lang.ClassLoader" ) ; Method defineClassMethod = classLoaderBaseClass . getDeclaredMethod ( "defineClass" , String . class ... |
public class WriterBasedGenerator { /** * Method called to try to either prepend character escape at front of
* given buffer ; or if not possible , to write it out directly .
* @ return Pointer to start of prepended entity ( if prepended ) ; or ' ptr '
* if not . */
private final int _prependOrWriteCharacterEscap... | if ( escCode >= 0 ) { // \ \ N ( 2 char )
if ( ptr > 1 && ptr < end ) { // fits , just prepend
ptr -= 2 ; buffer [ ptr ] = '\\' ; buffer [ ptr + 1 ] = ( char ) escCode ; } else { // won ' t fit , write
char [ ] ent = _entityBuffer ; if ( ent == null ) { ent = _allocateEntityBuffer ( ) ; } ent [ 1 ] = ( char ) escCode ;... |
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public EClass getIfcRamp ( ) { } } | if ( ifcRampEClass == null ) { ifcRampEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 496 ) ; } return ifcRampEClass ; |
public class ArchiveBase { /** * { @ inheritDoc }
* @ see org . jboss . shrinkwrap . api . Archive # addAsDirectory ( java . lang . String ) */
@ Override public T addAsDirectory ( final String path ) throws IllegalArgumentException { } } | // Precondition check
Validate . notNullOrEmpty ( path , "path must be specified" ) ; // Delegate and return
return this . addAsDirectory ( ArchivePaths . create ( path ) ) ; |
public class ParserUtils { /** * Determines if the given line is the first part of a multiline record . It does this by verifying that the
* qualifer on the last element is not closed
* @ param chrArry -
* char data of the line
* @ param delimiter -
* delimiter being used
* @ param qualifier -
* qualifier... | // check if the last char is the qualifier , if so then this a good
// chance it is not multiline
if ( chrArry [ chrArry . length - 1 ] != qualifier ) { // could be a potential line break
boolean qualiFound = false ; for ( int i = chrArry . length - 1 ; i >= 0 ; i -- ) { if ( chrArry [ i ] == ' ' ) { continue ; } // ch... |
public class TensorShapeProto { /** * < pre >
* Dimensions of the tensor , such as { " input " , 30 } , { " output " , 40}
* for a 30 x 40 2D tensor . If an entry has size - 1 , this
* corresponds to a dimension of unknown size . The names are
* optional .
* The order of entries in " dim " matters : It indica... | return dim_ ; |
public class JavaNetClientTransport { /** * { @ inheritDoc } */
@ Override public TransportResult doPut ( URI uri , String payload ) { } } | return doit ( "PUT" , uri , payload ) ; |
public class EnumConverter { /** * < p > Convert the enum constant given by the < code > value < / code >
* argument into a String . If no target class argument has been
* provided to the constructor of this instance , throw a
* < code > ConverterException < / code > containing the { @ link
* # ENUM _ NO _ CLAS... | if ( context == null || component == null ) { throw new NullPointerException ( ) ; } if ( targetClass == null ) { throw new ConverterException ( MessageFactory . getMessage ( context , ENUM_NO_CLASS_ID , value , MessageFactory . getLabel ( context , component ) ) ) ; } // If the specified value is null , return null
if... |
public class JavaParser { /** * $ ANTLR start synpred286 _ Java */
public final void synpred286_Java_fragment ( ) throws RecognitionException { } } | // src / main / resources / org / drools / compiler / semantics / java / parser / Java . g : 1262:29 : ( ' [ ' expression ' ] ' )
// src / main / resources / org / drools / compiler / semantics / java / parser / Java . g : 1262:29 : ' [ ' expression ' ] '
{ match ( input , 59 , FOLLOW_59_in_synpred286_Java6139 ) ; if (... |
public class TransactionException { /** * Throw when trying to add instances to an abstract Type */
public static TransactionException addingInstancesToAbstractType ( Type type ) { } } | return create ( ErrorMessage . IS_ABSTRACT . getMessage ( type . label ( ) ) ) ; |
public class ListJobsResult { /** * A list of job objects . Each job object contains metadata describing the job .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setJobList ( java . util . Collection ) } or { @ link # withJobList ( java . util . Collection )... | if ( this . jobList == null ) { setJobList ( new java . util . ArrayList < GlacierJobDescription > ( jobList . length ) ) ; } for ( GlacierJobDescription ele : jobList ) { this . jobList . add ( ele ) ; } return this ; |
public class GrailsResourceUtils { /** * Takes any number of Strings and appends them into a uri , making
* sure that a forward slash is inserted between each piece and
* making sure that no duplicate slashes are in the uri
* < pre >
* Input : " "
* Output : " "
* Input : " / alpha " , " / beta " , " / gamm... | if ( pieces == null || pieces . length == 0 ) return "" ; // join parts & & strip double slashes
StringBuilder builder = new StringBuilder ( 16 * pieces . length ) ; char previous = 0 ; for ( int i = 0 ; i < pieces . length ; i ++ ) { String piece = pieces [ i ] ; if ( piece != null && piece . length ( ) > 0 ) { for ( ... |
public class ListInstanceGroupsResult { /** * The list of instance groups for the cluster and given filters .
* @ return The list of instance groups for the cluster and given filters . */
public java . util . List < InstanceGroup > getInstanceGroups ( ) { } } | if ( instanceGroups == null ) { instanceGroups = new com . amazonaws . internal . SdkInternalList < InstanceGroup > ( ) ; } return instanceGroups ; |
public class CeServer { /** * Can ' t be started as is . Needs to be bootstrapped by sonar - application */
public static void main ( String [ ] args ) { } } | ProcessEntryPoint entryPoint = ProcessEntryPoint . createForArguments ( args ) ; Props props = entryPoint . getProps ( ) ; new CeProcessLogging ( ) . configure ( props ) ; CeServer server = new CeServer ( new ComputeEngineImpl ( props , new ComputeEngineContainerImpl ( ) ) , new MinimumViableSystem ( ) ) ; entryPoint .... |
public class XMLDecoder { /** * Close the input stream of xml data . */
public void close ( ) { } } | if ( inputStream == null ) { return ; } try { inputStream . close ( ) ; } catch ( Exception e ) { listener . exceptionThrown ( e ) ; } |
public class StandardBullhornData { /** * { @ inheritDoc } */
@ Override public FileWrapper getFile ( Class < ? extends FileEntity > type , Integer entityId , Integer fileId ) { } } | return this . handleGetFileContentWithMetaData ( type , entityId , fileId ) ; |
public class CoverageUtilities { /** * Simple method to get a value from a single band raster .
* < p > Note that this method does always return a value . If invalid , a novalue is returned . < / p >
* @ param raster the single band raster .
* @ param col the column .
* @ param row the row .
* @ return the va... | double [ ] values = null ; try { values = raster . evaluate ( new GridCoordinates2D ( col , row ) , ( double [ ] ) null ) ; } catch ( Exception e ) { return doubleNovalue ; } return values [ 0 ] ; |
public class XmlRpcHandler { /** * Convenience method that creates a XMLReader configured with this
* XmlRpcHandler instance .
* @ return
* @ throws ParserConfigurationException
* @ throws SAXException
* @ throws FactoryConfigurationError */
XMLReader newXMLReader ( ) throws ParserConfigurationException , SAX... | SAXParserFactory parserFactory = SAXParserFactory . newInstance ( ) ; SAXParser saxParser = parserFactory . newSAXParser ( ) ; XMLReader reader = saxParser . getXMLReader ( ) ; reader . setContentHandler ( this ) ; return reader ; |
public class LightMetaProperty { /** * Creates an instance from a { @ code Method } .
* @ param < P > the property type
* @ param metaBean the meta bean , not null
* @ param getMethod the method , not null
* @ param setMethod the method , not null
* @ param constructorIndex the index of the property in the co... | MethodHandle getter ; try { MethodType type = MethodType . methodType ( getMethod . getReturnType ( ) , getMethod . getParameterTypes ( ) ) ; getter = lookup . findVirtual ( field . getDeclaringClass ( ) , getMethod . getName ( ) , type ) ; } catch ( IllegalArgumentException | NoSuchMethodException | IllegalAccessExcep... |
public class Utils { /** * For the class return all implemented interfaces including the
* superinterfaces of the implementing interfaces , also iterate over for
* all the superclasses . For interface return all the extended interfaces
* as well as superinterfaces for those extended interfaces .
* @ param type ... | Map < ClassDoc , Type > results = sort ? new TreeMap < ClassDoc , Type > ( ) : new LinkedHashMap < ClassDoc , Type > ( ) ; Type [ ] interfaceTypes = null ; Type superType = null ; if ( type instanceof ParameterizedType ) { interfaceTypes = ( ( ParameterizedType ) type ) . interfaceTypes ( ) ; superType = ( ( Parameteri... |
public class Grefenstette { /** * Checks to see if tag marks a phrase or clause */
private boolean isPhraseOrClause ( String tag ) { } } | // find out why adding more reduced the number of relations
return ( ! tag . equals ( "SYM" ) && tag . startsWith ( "S" ) ) || tag . equals ( "ADJP" ) || tag . equals ( "ADVP" ) || tag . equals ( "CONJP" ) || tag . equals ( "FRAG" ) || tag . equals ( "INTJ" ) || tag . equals ( "LST" ) || tag . equals ( "NAC" ) || tag .... |
public class Consumers { /** * Yields all elements of the iterable ' s iterator ( in a list ) .
* @ param < E > the iterable element type
* @ param iterable the iterable that will be consumed
* @ return a list filled with iterable values */
public static < E > List < E > all ( Iterable < E > iterable ) { } } | dbc . precondition ( iterable != null , "cannot call all with a null iterable" ) ; final Function < Iterator < E > , ArrayList < E > > consumer = new ConsumeIntoCollection < > ( new ArrayListFactory < E > ( ) ) ; return consumer . apply ( iterable . iterator ( ) ) ; |
public class KeyRange { /** * Create a { @ link KeyRangeType # BACKWARD _ AT _ MOST } range .
* @ param < T > buffer type
* @ param stop stop key ( required )
* @ return a key range ( never null ) */
public static < T > KeyRange < T > atMostBackward ( final T stop ) { } } | return new KeyRange < > ( KeyRangeType . BACKWARD_AT_MOST , null , stop ) ; |
public class PactDslJsonArray { /** * Element that must be an ISO formatted timestamp */
public PactDslJsonArray timestamp ( ) { } } | String pattern = DateFormatUtils . ISO_DATETIME_FORMAT . getPattern ( ) ; body . put ( DateFormatUtils . ISO_DATETIME_FORMAT . format ( new Date ( DATE_2000 ) ) ) ; generators . addGenerator ( Category . BODY , rootPath + appendArrayIndex ( 0 ) , new DateTimeGenerator ( pattern ) ) ; matchers . addRule ( rootPath + app... |
public class AWSGlueClient { /** * Deletes a specified batch of versions of a table .
* @ param batchDeleteTableVersionRequest
* @ return Result of the BatchDeleteTableVersion operation returned by the service .
* @ throws EntityNotFoundException
* A specified entity does not exist
* @ throws InvalidInputExce... | request = beforeClientExecution ( request ) ; return executeBatchDeleteTableVersion ( request ) ; |
public class ParameterUtil { /** * Get parent dependent parameters
* @ param report next report object
* @ param p current parameter
* @ return a map of all parameters that are used in the source definition of the current parameter */
public static Map < String , QueryParameter > getParentDependentParameters ( Re... | return getParentDependentParameters ( report . getParameters ( ) , p ) ; |
public class DirectedGraph { /** * Remove an edge from the graph . Nothing happens if no such edge .
* @ throws { @ link IllegalArgumentException } if either vertex doesn ' t exist . */
public void removeEdge ( V from , V to ) { } } | if ( ! containsVertex ( from ) ) { throw new IllegalArgumentException ( "Nonexistent vertex " + from ) ; } if ( ! containsVertex ( to ) ) { throw new IllegalArgumentException ( "Nonexistent vertex " + to ) ; } neighbors . get ( from ) . remove ( to ) ; |
public class SAML2AuthnResponseValidator { /** * Validate the given authnStatements :
* - authnInstant
* - sessionNotOnOrAfter
* @ param authnStatements the authn statements
* @ param context the context */
protected final void validateAuthenticationStatements ( final List < AuthnStatement > authnStatements , f... | for ( final AuthnStatement statement : authnStatements ) { if ( ! isAuthnInstantValid ( statement . getAuthnInstant ( ) ) ) { throw new SAMLAuthnInstantException ( "Authentication issue instant is too old or in the future" ) ; } if ( statement . getSessionNotOnOrAfter ( ) != null && statement . getSessionNotOnOrAfter (... |
public class MapParser { /** * New method based on Reader . Reads the XMLDocument for a PZMetaData
* file from an InputStream , WebStart compatible . Parses the XML file , and
* returns a Map containing Lists of ColumnMetaData .
* @ param xmlStreamReader
* @ param pzparser
* Can be null . Allows additional op... | final Map map = parse ( xmlStreamReader , pzparser ) ; final List < ColumnMetaData > col = ( List < ColumnMetaData > ) map . get ( FPConstants . DETAIL_ID ) ; map . remove ( FPConstants . DETAIL_ID ) ; final Map m = ( Map ) map . get ( FPConstants . COL_IDX ) ; map . remove ( FPConstants . COL_IDX ) ; // loop through t... |
public class Queries { /** * Returns query . getParameters ( ) { @ link Observable } but only after query
* dependencies have been fully emitted ( and ignored ) .
* @ return query parameters */
static Observable < Parameter > parametersAfterDependencies ( Query query ) { } } | return concatButIgnoreFirstSequence ( query . depends ( ) , query . parameters ( ) ) ; |
public class MockDriverRestartContext { /** * Generate a DriverRestarted event to be passed to the
* { @ link org . apache . reef . driver . parameters . DriverRestartHandler } .
* @ return DriverRestarted event based on the state at the time of driver failure */
public DriverRestarted getDriverRestarted ( ) { } } | final Set < String > expectedEvaluatorIds = new HashSet < > ( ) ; for ( final MockAllocatedEvaluator allocatedEvaluator : this . allocatedEvaluators ) { expectedEvaluatorIds . add ( allocatedEvaluator . getId ( ) ) ; } return new DriverRestarted ( ) { @ Override public int getResubmissionAttempts ( ) { return restartAt... |
public class KllFloatsSketch { /** * Updates this sketch with the given data item .
* @ param value an item from a stream of items . NaNs are ignored . */
public void update ( final float value ) { } } | if ( Float . isNaN ( value ) ) { return ; } if ( isEmpty ( ) ) { minValue_ = value ; maxValue_ = value ; } else { if ( value < minValue_ ) { minValue_ = value ; } if ( value > maxValue_ ) { maxValue_ = value ; } } if ( levels_ [ 0 ] == 0 ) { compressWhileUpdating ( ) ; } n_ ++ ; isLevelZeroSorted_ = false ; final int n... |
public class AbstractHttpMessageConverter { /** * This implementation simple delegates to { @ link # readInternal ( Class , HttpInputMessage ) } .
* Future implementations might add some default behavior , however . */
public final T read ( Class < ? extends T > clazz , HttpInputMessage inputMessage ) throws IOExcept... | return readInternal ( clazz , inputMessage ) ; |
public class StateManager { /** * < p > Return the tree structure and component state information for the
* view contained in the specified { @ link FacesContext } instance as an
* object of type < code > StateManager . SerializedView < / code > . If there
* is no state information to be saved , return < code > n... | context . getAttributes ( ) . put ( IS_CALLED_FROM_API_CLASS , Boolean . TRUE ) ; Object stateObj = null ; try { stateObj = saveView ( context ) ; } finally { context . getAttributes ( ) . remove ( IS_CALLED_FROM_API_CLASS ) ; } SerializedView result = null ; if ( null != stateObj ) { if ( stateObj instanceof Object [ ... |
public class TransactionLog { /** * Maps this instance to another { @ code MapTransaction } with different key and value types .
* @ param mapper function for mapping record types
* @ param < U > record type of returned instance
* @ return newly typed instance */
public < U > TransactionLog < U > map ( Function <... | return new TransactionLog < > ( transactionId , version , Lists . transform ( records , mapper :: apply ) ) ; |
public class SingularOps_DDRM { /** * TODO the number of copies can probably be reduced here */
public static void descendingOrder ( DMatrixRMaj U , boolean tranU , DMatrixRMaj W , DMatrixRMaj V , boolean tranV ) { } } | int numSingular = Math . min ( W . numRows , W . numCols ) ; checkSvdMatrixSize ( U , tranU , W , V , tranV ) ; for ( int i = 0 ; i < numSingular ; i ++ ) { double bigValue = - 1 ; int bigIndex = - 1 ; // find the smallest singular value in the submatrix
for ( int j = i ; j < numSingular ; j ++ ) { double v = W . get (... |
public class FileLock { /** * returns the last log entry
* @ param fs
* @ param lockFile
* @ return
* @ throws IOException */
public static LogEntry getLastEntry ( FileSystem fs , Path lockFile ) throws IOException { } } | FSDataInputStream in = fs . open ( lockFile ) ; BufferedReader reader = new BufferedReader ( new InputStreamReader ( in ) ) ; String lastLine = null ; for ( String line = reader . readLine ( ) ; line != null ; line = reader . readLine ( ) ) { lastLine = line ; } return LogEntry . deserialize ( lastLine ) ; |
public class ManagedBackupShortTermRetentionPoliciesInner { /** * Updates a managed database ' s short term retention policy .
* @ param resourceGroupName The name of the resource group that contains the resource . You can obtain this value from the Azure Resource Manager API or the portal .
* @ param managedInstan... | return createOrUpdateWithServiceResponseAsync ( resourceGroupName , managedInstanceName , databaseName , retentionDays ) . toBlocking ( ) . last ( ) . body ( ) ; |
public class InlineRendition { /** * Builds URL to rescaled version of the binary image .
* @ return Media URL */
private String buildDownloadMediaUrl ( ) { } } | String resourcePath = this . resource . getPath ( ) ; // if parent resource is a nt : file resource , use this one as path for scaled image
Resource parentResource = this . resource . getParent ( ) ; if ( JcrBinary . isNtFile ( parentResource ) ) { resourcePath = parentResource . getPath ( ) ; } // URL to render scaled... |
public class OpenIabHelper { /** * Returns a mapped application internal SKU using the store name and a store SKU .
* @ see org . onepf . oms . SkuManager # mapSku ( String , String , String )
* @ deprecated Use { @ link org . onepf . oms . SkuManager # getSku ( String , String ) } */
@ NotNull public static String... | return SkuManager . getInstance ( ) . getSku ( appStoreName , storeSku ) ; |
public class ProxyMetaClass { /** * Call invokeMethod on adaptee with logic like in MetaClass unless we have an Interceptor .
* With Interceptor the call is nested in its beforeInvoke and afterInvoke methods .
* The method call is suppressed if Interceptor . doInvoke ( ) returns false .
* See Interceptor for deta... | return doCall ( object , methodName , arguments , interceptor , new Callable ( ) { public Object call ( ) { return adaptee . invokeMethod ( object , methodName , arguments ) ; } } ) ; |
public class MappingOptionImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public void eSet ( int featureID , Object newValue ) { } } | switch ( featureID ) { case AfplibPackage . MAPPING_OPTION__MAP_VALUE : setMapValue ( ( Integer ) newValue ) ; return ; } super . eSet ( featureID , newValue ) ; |
public class ProjectApi { /** * Get a list of projects accessible by the authenticated user that match the provided search string .
* < pre > < code > GET / projects ? search = search < / code > < / pre >
* @ param search the project name search criteria
* @ return a list of projects accessible by the authenticat... | return ( getProjects ( search , getDefaultPerPage ( ) ) . all ( ) ) ; |
public class UpdateUserRoutingProfileRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( UpdateUserRoutingProfileRequest updateUserRoutingProfileRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( updateUserRoutingProfileRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( updateUserRoutingProfileRequest . getRoutingProfileId ( ) , ROUTINGPROFILEID_BINDING ) ; protocolMarshaller . marshall ( updateUserRoutingProfileRequest ... |
public class LayoutUtils { /** * Returns the JRDesignGroup for the DJGroup passed
* @ param jd
* @ param layoutManager
* @ param group
* @ return */
public static JRDesignGroup getJRDesignGroup ( DynamicJasperDesign jd , LayoutManager layoutManager , DJGroup group ) { } } | Map references = layoutManager . getReferencesMap ( ) ; for ( Object o : references . keySet ( ) ) { String groupName = ( String ) o ; DJGroup djGroup = ( DJGroup ) references . get ( groupName ) ; if ( group == djGroup ) { return ( JRDesignGroup ) jd . getGroupsMap ( ) . get ( groupName ) ; } } return null ; |
public class Transforms { /** * Floor function
* @ param ndArray
* @ return */
public static INDArray floor ( INDArray ndArray , boolean dup ) { } } | return exec ( dup ? new Floor ( ndArray , ndArray . ulike ( ) ) : new Floor ( ndArray ) ) ; |
public class DefaultImageFormats { /** * Check if the given image format is static WebP ( not animated ) .
* @ param imageFormat the image format to check
* @ return true if static WebP */
public static boolean isStaticWebpFormat ( ImageFormat imageFormat ) { } } | return imageFormat == WEBP_SIMPLE || imageFormat == WEBP_LOSSLESS || imageFormat == WEBP_EXTENDED || imageFormat == WEBP_EXTENDED_WITH_ALPHA ; |
public class Values { /** * Returns a value which is the logical NOT of the supplied value . */
public static Value < Boolean > not ( Value < Boolean > value ) { } } | return value . map ( Functions . NOT ) ; |
public class LogbackLoggingImpl { /** * Creates an { @ link OutputStreamAppender } for the required filter , pattern and logger output .
* @ param context Logger context to associate the appender with .
* @ param filter Event log filter .
* @ param logOutput Logger output information for the destination to write ... | final PatternLayoutEncoder patternLayoutEncoder = createPatternLayoutEncoder ( context , patternProperty ) ; final OutputStreamAppender < ILoggingEvent > appender ; if ( logOutput . isConsole ( ) ) { appender = new OutputStreamAppender < > ( ) ; appender . setContext ( context ) ; appender . setEncoder ( patternLayoutE... |
public class Transaction { /** * This method gets the lowest message priority being used in this transaction
* and as such is the JFAP priority that commit and rollback will be sent as .
* @ return short */
public short getLowestMessagePriority ( ) { } } | if ( tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getLowestMessagePriority" ) ; if ( tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "getLowestMessagePriority" , "" + lowestPriority ) ; return lowestPriority ; |
public class Objects { /** * Resolves type and returns casted object
* @ param obj
* @ param type
* @ return */
public static < T > T cast ( Object obj , String type ) { } } | return ( T ) cast ( obj , resolveType ( type ) ) ; |
public class FailsafeExecutor { /** * Executes the { @ code runnable } asynchronously until successful or until the configured policies are exceeded .
* If a configured circuit breaker is open , the resulting future is completed with { @ link
* CircuitBreakerOpenException } .
* @ throws NullPointerException if th... | return callAsync ( execution -> Functions . promiseOf ( runnable , execution ) , false ) ; |
public class PasswordPolicyService { /** * Returns whether the given user ' s password is expired due to the password
* aging policy .
* @ param user
* The user to check .
* @ return
* true if the user needs to change their password to comply with the
* password aging policy , false otherwise .
* @ throws... | // Retrieve password policy from environment
PasswordPolicy policy = environment . getPasswordPolicy ( ) ; // There is no maximum password age if 0
int maxPasswordAge = policy . getMaximumAge ( ) ; if ( maxPasswordAge == 0 ) return false ; // Determine whether password is expired based on maximum age
return getPassword... |
public class SymbolTable { /** * Gets the symbol for the given constructor or interface . */
public Symbol getSymbolDeclaredBy ( FunctionType fn ) { } } | checkState ( fn . isConstructor ( ) || fn . isInterface ( ) ) ; ObjectType instanceType = fn . getInstanceType ( ) ; return getSymbolForName ( fn . getSource ( ) , instanceType . getReferenceName ( ) ) ; |
public class BurninDestinationSettingsMarshaller { /** * Marshall the given parameter object . */
public void marshall ( BurninDestinationSettings burninDestinationSettings , ProtocolMarshaller protocolMarshaller ) { } } | if ( burninDestinationSettings == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( burninDestinationSettings . getAlignment ( ) , ALIGNMENT_BINDING ) ; protocolMarshaller . marshall ( burninDestinationSettings . getBackgroundColor ( ) , BACKG... |
public class FileMgr { /** * Appends the contents of a byte buffer to the end of the specified file .
* @ param fileName
* the name of the file
* @ param buffer
* the byte buffer
* @ return a block ID refers to the newly - created block . */
BlockId append ( String fileName , IoBuffer buffer ) { } } | try { IoChannel fileChannel = getFileChannel ( fileName ) ; // Rewind the buffer for writing
buffer . rewind ( ) ; // Append the block to the file
long newSize = fileChannel . append ( buffer ) ; // Return the new block id
return new BlockId ( fileName , newSize / BLOCK_SIZE - 1 ) ; } catch ( IOException e ) { e . prin... |
public class TracedParallelBatch { /** * Create a { @ link TracedParallelBatch } for list of { @ link Promise } s ,
* with the specified trace context .
* @ param context the trace context .
* @ param promises vararg containing a list of { @ link Promise } s .
* @ param < T > the type of value produced by each ... | return of ( context , Arrays . asList ( promises ) ) ; |
public class SliceOps { /** * Appends a " slice " operation to the provided LongStream . The slice
* operation may be may be skip - only , limit - only , or skip - and - limit .
* @ param upstream A LongStream
* @ param skip The number of elements to skip . Must be > = 0.
* @ param limit The maximum size of the... | if ( skip < 0 ) throw new IllegalArgumentException ( "Skip must be non-negative: " + skip ) ; return new LongPipeline . StatefulOp < Long > ( upstream , StreamShape . LONG_VALUE , flags ( limit ) ) { Spliterator . OfLong unorderedSkipLimitSpliterator ( Spliterator . OfLong s , long skip , long limit , long sizeIfKnown ... |
public class AmazonWorkspacesClient { /** * Retrieves a list that describes modifications to the configuration of bring your own license ( BYOL ) for the
* specified account .
* @ param describeAccountModificationsRequest
* @ return Result of the DescribeAccountModifications operation returned by the service .
... | request = beforeClientExecution ( request ) ; return executeDescribeAccountModifications ( request ) ; |
public class LdapUtils { /** * Builds a new request .
* @ param baseDn the base dn
* @ param filter the filter
* @ param binaryAttributes the binary attributes
* @ param returnAttributes the return attributes
* @ return the search request */
public static SearchRequest newLdaptiveSearchRequest ( final String ... | val sr = new SearchRequest ( baseDn , filter ) ; sr . setBinaryAttributes ( binaryAttributes ) ; sr . setReturnAttributes ( returnAttributes ) ; sr . setSearchScope ( SearchScope . SUBTREE ) ; return sr ; |
public class CmsSitemapTreeItem { /** * Updates the recursively the site path . < p >
* @ param sitePath the new site path to set */
public void updateSitePath ( String sitePath ) { } } | String newSubTitle = getDisplayedUrl ( sitePath ) ; removeInvalidChildren ( ) ; getListItemWidget ( ) . setSubtitleLabel ( newSubTitle ) ; String name = getName ( sitePath ) ; setId ( name ) ; getListItemWidget ( ) . setAdditionalInfoValue ( 1 , name ) ; if ( getLoadState ( ) == LoadState . LOADED ) { for ( int i = 0 ;... |
public class MergeableManifest2 { /** * Add the set with given bundles to the " Export - Package " main attribute .
* @ param exportedPackages The set of all packages to add . */
public void addExportedPackages ( Set < String > exportedPackages ) { } } | addExportedPackages ( exportedPackages . toArray ( new String [ exportedPackages . size ( ) ] ) ) ; |
public class DurationRangeMarshaller { /** * Marshall the given parameter object . */
public void marshall ( DurationRange durationRange , ProtocolMarshaller protocolMarshaller ) { } } | if ( durationRange == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( durationRange . getMinSeconds ( ) , MINSECONDS_BINDING ) ; protocolMarshaller . marshall ( durationRange . getMaxSeconds ( ) , MAXSECONDS_BINDING ) ; } catch ( Exception e... |
public class JSMarshaller { /** * Turn special characters into escaped characters conforming to JavaScript .
* Handles complete character set defined in HTML 4.01 recommendation . < br >
* Reference : < a href =
* " http : / / developer . mozilla . org / en / docs / Core _ JavaScript _ 1.5 _ Guide : Literals # St... | if ( StringHelper . hasNoText ( sInput ) ) return sInput ; final char [ ] aInput = sInput . toCharArray ( ) ; if ( ! StringHelper . containsAny ( aInput , CHARS_TO_MASK ) ) return sInput ; final char [ ] ret = new char [ aInput . length * 2 ] ; int nIndex = 0 ; char cPrevChar = '\u0000' ; for ( final char cCurrent : aI... |
public class MappingAssistantPanel { /** * GEN - LAST : event _ txtRowCountFocusLost */
private void txtRowCountKeyPressed ( java . awt . event . KeyEvent evt ) { } } | // GEN - FIRST : event _ txtRowCountKeyPressed
int code = evt . getKeyCode ( ) ; if ( code == KeyEvent . VK_ENTER ) { txtRowCount . transferFocus ( ) ; } |
public class Expressions { /** * Create a new Path expression
* @ param type type of expression
* @ param variable variable name
* @ return path expression */
public static < T extends Comparable < ? > > TimePath < T > timePath ( Class < ? extends T > type , String variable ) { } } | return new TimePath < T > ( type , PathMetadataFactory . forVariable ( variable ) ) ; |
public class DatastoreImpl { /** * Creates a copy of this Datastore and all its configuration but with a new database
* @ param database the new database to use for operations
* @ return the new Datastore instance
* @ deprecated use { @ link Morphia # createDatastore ( MongoClient , Mapper , String ) } */
@ Depre... | return new DatastoreImpl ( morphia , mapper , mongoClient , database ) ; |
public class JsonMapper { /** * Object可以是POJO , 也可以是Collection或数组 。 如果对象为Null , 返回 " null " . 如果集合为空集合 , 返回 " [ ] " . */
public String toJson ( Object object ) { } } | try { return mapper . writeValueAsString ( object ) ; } catch ( IOException e ) { logger . warn ( "write to json string error:" + object , e ) ; return null ; } |
public class AmazonPinpointClient { /** * Creates or updates an import job .
* @ param createImportJobRequest
* @ return Result of the CreateImportJob operation returned by the service .
* @ throws BadRequestException
* 400 response
* @ throws InternalServerErrorException
* 500 response
* @ throws Forbidd... | request = beforeClientExecution ( request ) ; return executeCreateImportJob ( request ) ; |
public class ProxyReceiveListener { /** * SIB0115d . comms start */
private void processAsyncSessionStoppedCallback ( CommsByteBuffer buffer , Conversation conversation ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "processAsyncSessionStoppedCallback" , new Object [ ] { buffer , conversation } ) ; final short connectionObjectId = buffer . getShort ( ) ; final short clientSessionId = buffer . getShort ( ) ; if ( TraceComponent . ... |
public class ListOfferingPromotionsResult { /** * Information about the offering promotions .
* @ param offeringPromotions
* Information about the offering promotions . */
public void setOfferingPromotions ( java . util . Collection < OfferingPromotion > offeringPromotions ) { } } | if ( offeringPromotions == null ) { this . offeringPromotions = null ; return ; } this . offeringPromotions = new java . util . ArrayList < OfferingPromotion > ( offeringPromotions ) ; |
public class WeakHashMap { /** * Associates the specified value with the specified key in this map .
* If the map previously contained a mapping for this key , the old
* value is replaced .
* @ param key key with which the specified value is to be associated .
* @ param value value to be associated with the spe... | Object k = maskNull ( key ) ; int h = sun . misc . Hashing . singleWordWangJenkinsHash ( k ) ; Entry < K , V > [ ] tab = getTable ( ) ; int i = indexFor ( h , tab . length ) ; for ( Entry < K , V > e = tab [ i ] ; e != null ; e = e . next ) { if ( h == e . hash && eq ( k , e . get ( ) ) ) { V oldValue = e . value ; if ... |
public class GaussianDistribution { /** * This is the probability density function for the Gaussian
* distribution . */
private double getExpectedProbability ( double x ) { } } | double y = 1 / ( standardDeviation * Math . sqrt ( Math . PI * 2 ) ) ; double z = - ( Math . pow ( x - mean , 2 ) / ( 2 * Math . pow ( standardDeviation , 2 ) ) ) ; return y * Math . exp ( z ) ; |
public class PhysicalConnectionRequirements { /** * The security group ID list used by the connection .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setSecurityGroupIdList ( java . util . Collection ) } or { @ link # withSecurityGroupIdList ( java . util .... | if ( this . securityGroupIdList == null ) { setSecurityGroupIdList ( new java . util . ArrayList < String > ( securityGroupIdList . length ) ) ; } for ( String ele : securityGroupIdList ) { this . securityGroupIdList . add ( ele ) ; } return this ; |
public class GhprbRepository { /** * comments / hashes that have been added since the last time we checked . */
public void check ( ) { } } | if ( ! trigger . isActive ( ) ) { LOGGER . log ( Level . FINE , "Project is not active, not checking github state" ) ; return ; } if ( ! initGhRepository ( ) ) { return ; } GHRepository repo = getGitHubRepo ( ) ; List < GHPullRequest > openPulls ; try { openPulls = repo . getPullRequests ( GHIssueState . OPEN ) ; } cat... |
public class InteractionSpec { /** * Reorders columns of a Frame so that columns that only used to make interactions
* are at the end of the Frame . Only Vecs that will actually be used are kept in the frame .
* @ param f frame to adjust
* @ return reordered frame */
public Frame reorderColumns ( Frame f ) { } } | if ( ( _interactionsOnly == null ) || ( f == null ) ) return f ; Vec [ ] interOnlyVecs = f . vecs ( _interactionsOnly ) ; f . remove ( _interactionsOnly ) ; for ( int i = 0 ; i < _interactionsOnly . length ; i ++ ) { if ( isUsed ( _interactionsOnly [ i ] ) ) { f . add ( _interactionsOnly [ i ] , interOnlyVecs [ i ] ) ;... |
public class Tokenizer { /** * { @ inheritDoc } */
@ Override public boolean readColumns ( final List < String > columns ) throws IOException { } } | if ( columns == null ) { throw new NullPointerException ( "columns should not be null" ) ; } // clear the reusable List and StringBuilders
columns . clear ( ) ; currentColumn . setLength ( 0 ) ; currentRow . setLength ( 0 ) ; // keep reading lines until data is found
String line ; do { line = readLine ( ) ; if ( line =... |
public class RuntimeManagerMain { /** * construct command line help options */
private static Options constructHelpOptions ( ) { } } | Options options = new Options ( ) ; Option help = Option . builder ( "h" ) . desc ( "List all options and their description" ) . longOpt ( "help" ) . build ( ) ; options . addOption ( help ) ; return options ; |
public class ConvertImage { /** * Converts a { @ link InterleavedS8 } into a { @ link GrayS8 } by computing the average value of each pixel
* across all the bands .
* @ param input ( Input ) The ImageInterleaved that is being converted . Not modified .
* @ param output ( Optional ) The single band output image . ... | if ( output == null ) { output = new GrayS8 ( input . width , input . height ) ; } else { output . reshape ( input . width , input . height ) ; } if ( BoofConcurrency . USE_CONCURRENT ) { ConvertInterleavedToSingle_MT . average ( input , output ) ; } else { ConvertInterleavedToSingle . average ( input , output ) ; } re... |
public class EntityMention { /** * setter for mention _ type - sets
* @ generated
* @ param v value to set into the feature */
public void setMention_type ( String v ) { } } | if ( EntityMention_Type . featOkTst && ( ( EntityMention_Type ) jcasType ) . casFeat_mention_type == null ) jcasType . jcas . throwFeatMissing ( "mention_type" , "de.julielab.jules.types.ace.EntityMention" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( EntityMention_Type ) jcasType ) . casFeatCode_mention_type ... |
public class MethodTarget { /** * Construct a MethodTarget for the unique method named { @ literal name } on the given object . Fails with an exception
* in case of overloaded method . */
public static MethodTarget of ( String name , Object bean , Help help , Supplier < Availability > availabilityIndicator ) { } } | Set < Method > found = new HashSet < > ( ) ; ReflectionUtils . doWithMethods ( bean . getClass ( ) , found :: add , m -> m . getName ( ) . equals ( name ) ) ; if ( found . size ( ) != 1 ) { throw new IllegalArgumentException ( String . format ( "Could not find unique method named '%s' on object of class %s. Found %s" ,... |
public class FramesHandler { /** * TODO : almost identical to ModelsHandler ; refactor */
public static Frame getFromDKV ( String param_name , String key_str ) { } } | return getFromDKV ( param_name , Key . make ( key_str ) ) ; |
public class GVRComponent { /** * Attach this component to a scene object .
* @ param owner scene object to become new owner . */
public void setOwnerObject ( GVRSceneObject owner ) { } } | if ( owner != null ) { if ( getNative ( ) != 0 ) { NativeComponent . setOwnerObject ( getNative ( ) , owner . getNative ( ) ) ; } this . owner = owner ; onAttach ( owner ) ; } else { if ( null != this . owner ) { onDetach ( this . owner ) ; if ( getNative ( ) != 0 ) { NativeComponent . setOwnerObject ( getNative ( ) , ... |
public class Configuration { /** * This is a manual implementation of the following regex
* " \ \ $ \ \ { [ ^ \ \ } \ \ $ \ u0020 ] + \ \ } " . It can be 15x more efficient than
* a regex matcher as demonstrated by HADOOP - 11506 . This is noticeable with
* Hadoop apps building on the assumption Configuration # g... | int [ ] result = { - 1 , - 1 } ; int matchStart ; int leftBrace ; // scanning for a brace first because it ' s less frequent than $
// that can occur in nested class names
match_loop : for ( matchStart = 1 , leftBrace = eval . indexOf ( '{' , matchStart ) ; // minimum left brace position ( follows ' $ ' )
leftBrace > 0... |
public class SipServletMessageImpl { /** * Return a mimemultipart from raw Content
* FIXME Doesn ' t support nested multipart in the body content
* @ param contentTypeHeader content type header related to the rawContent
* @ param rawContent body content
* @ return a mimemultipart from raw Content */
private sta... | // Issue 1123 : http : / / code . google . com / p / mobicents / issues / detail ? id = 1123 : Multipart type is supported
String delimiter = contentTypeHeader . getParameter ( MULTIPART_BOUNDARY ) ; String start = contentTypeHeader . getParameter ( MULTIPART_START ) ; MimeMultipart mimeMultipart = new MimeMultipart ( ... |
public class ApplicationResource { /** * ( non - Javadoc )
* @ see net . roboconf . dm . internal . rest . api . IApplicationWs
* # listChildrenInstances ( java . lang . String , java . lang . String , boolean ) */
@ Override public List < Instance > listChildrenInstances ( String applicationName , String instanceP... | List < Instance > result = new ArrayList < > ( ) ; Application app = this . manager . applicationMngr ( ) . findApplicationByName ( applicationName ) ; // Log
if ( instancePath == null ) this . logger . fine ( "Request: list " + ( allChildren ? "all" : "root" ) + " instances for " + applicationName + "." ) ; else this ... |
public class ZooController { /** * 获取ZK 部署情况
* @ param zkDeployForm
* @ return */
@ RequestMapping ( value = "/zkdeploy" , method = RequestMethod . GET ) @ ResponseBody public JsonObjectBase getZkDeployInfo ( @ Valid ZkDeployForm zkDeployForm ) { } } | LOG . info ( zkDeployForm . toString ( ) ) ; ConfigFullModel configFullModel = zkDeployValidator . verify ( zkDeployForm ) ; String data = zkDeployMgr . getDeployInfo ( configFullModel . getApp ( ) . getName ( ) , configFullModel . getEnv ( ) . getName ( ) , zkDeployForm . getVersion ( ) ) ; return buildSuccess ( "host... |
public class RequestParameters { /** * Converts the given < code > value < / code > to the given < code > targetType < / code > .
* @ param < T > is the generic type of < code > targetType < / code > .
* @ param value is the value to convert .
* @ param targetType is the { @ link Class } reflecting the type to co... | if ( value == null ) { return null ; } Object result ; if ( targetType == String . class ) { result = value ; } else if ( targetType . isEnum ( ) ) { for ( T instance : targetType . getEnumConstants ( ) ) { Enum < ? > e = ( Enum < ? > ) instance ; if ( e . name ( ) . equalsIgnoreCase ( value ) ) { return instance ; } }... |
public class MalisisFont { /** * # end Prepare / Clean */
private boolean isCharVisible ( int x , int y , StringWalker walker , ClipArea area ) { } } | if ( area == null || area . noClip ( ) ) return true ; if ( area . fullClip ( ) ) return false ; return area . isInside ( x , y ) || area . isInside ( x + ( int ) Math . ceil ( walker . width ( ) ) , y + ( int ) Math . ceil ( walker . height ( ) ) ) ; |
public class For { /** * # for ( id : expr ) */
private void forIterator ( Env env , Scope scope , Writer writer ) { } } | Ctrl ctrl = scope . getCtrl ( ) ; Object outer = scope . get ( "for" ) ; ctrl . setLocalAssignment ( ) ; ForIteratorStatus forIteratorStatus = new ForIteratorStatus ( outer , forCtrl . getExpr ( ) . eval ( scope ) , location ) ; ctrl . setWisdomAssignment ( ) ; scope . setLocal ( "for" , forIteratorStatus ) ; Iterator ... |
public class CommerceOrderItemUtil { /** * Returns the last commerce order item in the ordered set where commerceOrderId = & # 63 ; .
* @ param commerceOrderId the commerce order ID
* @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > )
* @ return the last matching ... | return getPersistence ( ) . fetchByCommerceOrderId_Last ( commerceOrderId , orderByComparator ) ; |
public class JPAGenericDAORulesBasedImpl { /** * Méthode de validation des contraintes referentielles
* @ param entityEntité à valider
* @ param modeMode DAO
* @ param validationTimeMoment d ' évaluation */
protected void validateEntityReferentialConstraint ( Object entity , DAOMode mode , DAOValidatorEvaluat... | // Obtention de la liste des annotations DAO qui sont sur la classe
List < Annotation > daoAnnotations = DAOValidatorHelper . loadDAOValidatorAnnotations ( entity ) ; // Si la liste est vide
if ( daoAnnotations == null || daoAnnotations . size ( ) == 0 ) return ; // On parcours cette liste
for ( Annotation daoAnnotatio... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.