signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class PackageUrl { /** * Get Resource Url for UpdatePackage
* @ param packageId Unique identifier of the package for which to retrieve the label .
* @ param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object . This parameter should... | UrlFormatter formatter = new UrlFormatter ( "/api/commerce/returns/{returnId}/packages/{packageId}?responseFields={responseFields}" ) ; formatter . formatUrl ( "packageId" , packageId ) ; formatter . formatUrl ( "responseFields" , responseFields ) ; formatter . formatUrl ( "returnId" , returnId ) ; return new MozuUrl (... |
public class MultiPooledSocketFactory { /** * Create socket factories for newly resolved addresses . Default
* implementation returns a LazySocketFactory wrapping a
* PooledSocketFactory wrapping a PlainSocketFactory . */
protected SocketFactory createSocketFactory ( InetAddress address , int port , InetAddress loc... | SocketFactory factory ; factory = new PlainSocketFactory ( address , port , localAddr , localPort , timeout ) ; factory = new PooledSocketFactory ( factory ) ; factory = new LazySocketFactory ( factory ) ; return factory ; |
public class AbstractViewQuery { /** * Sets the right - hand compound drawable of the TextView to the specified icon and sets an error message
* @ param error
* @ return */
public T error ( CharSequence error ) { } } | if ( view != null && view instanceof TextView ) { ( ( TextView ) view ) . setError ( error ) ; } return self ( ) ; |
public class TransposeDataCollection { /** * Adds a particular key - value into the internal map . It returns the previous
* value which was associated with that key .
* @ param key
* @ param value
* @ return */
public final FlatDataCollection put ( Object key , FlatDataCollection value ) { } } | return internalData . put ( key , value ) ; |
public class TrmMessageFactoryImpl { /** * Create a new , empty TrmMeBridgeReply message
* @ return The new TrmMeBridgeReply .
* @ exception MessageCreateFailedException Thrown if such a message can not be created */
public TrmMeBridgeReply createNewTrmMeBridgeReply ( ) throws MessageCreateFailedException { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "createNewTrmMeBridgeReply" ) ; TrmMeBridgeReply msg = null ; try { msg = new TrmMeBridgeReplyImpl ( ) ; } catch ( MessageDecodeFailedException e ) { /* No need to FFDC this as JsMsgObject will already have done so */
// No ... |
public class UserThreadPool { /** * 初始化线程池 */
public void init ( ) { } } | executor = new ThreadPoolExecutor ( corePoolSize , maximumPoolSize , keepAliveTime , TimeUnit . MILLISECONDS , ThreadPoolUtils . buildQueue ( queueSize ) , new NamedThreadFactory ( threadPoolName ) ) ; if ( allowCoreThreadTimeOut ) { executor . allowCoreThreadTimeOut ( true ) ; } if ( prestartAllCoreThreads ) { executo... |
public class JDBCDriverService { /** * Create a DataSource
* @ param props typed data source properties
* @ param dataSourceID identifier for the data source config
* @ return the data source
* @ throws SQLException if an error occurs */
public DataSource createDataSource ( Properties props , String dataSourceI... | lock . readLock ( ) . lock ( ) ; try { if ( ! isInitialized ) try { // Switch to write lock for lazy initialization
lock . readLock ( ) . unlock ( ) ; lock . writeLock ( ) . lock ( ) ; if ( ! isInitialized ) { if ( ! loadFromApp ( ) ) classloader = AdapterUtil . getClassLoaderWithPriv ( sharedLib ) ; isInitialized = tr... |
public class Key { /** * Checks if the key has outdated translations and then update the outdated status of the key . */
public void checkOutdatedStatus ( ) { } } | boolean newStatus = false ; for ( Translation translation : translations . values ( ) ) { if ( translation . isOutdated ( ) ) { newStatus = true ; break ; } } outdated = newStatus ; |
public class WSManRemoteShellService { /** * This method separates the stdout and stderr response streams from the received execution response .
* @ param receiveResult A map containing the response from the service .
* @ return a map containing the stdout , stderr streams and the script exit code .
* @ throws Pa... | Map < String , String > scriptResults = new HashMap < > ( ) ; scriptResults . put ( RETURN_RESULT , buildResultFromResponseStreams ( receiveResult . get ( RETURN_RESULT ) , OutputStream . STDOUT ) ) ; scriptResults . put ( Constants . OutputNames . STDERR , buildResultFromResponseStreams ( receiveResult . get ( RETURN_... |
public class AWSCognitoIdentityProviderClient { /** * This method takes a user pool ID , and returns the signing certificate .
* @ param getSigningCertificateRequest
* Request to get a signing certificate from Cognito .
* @ return Result of the GetSigningCertificate operation returned by the service .
* @ throw... | request = beforeClientExecution ( request ) ; return executeGetSigningCertificate ( request ) ; |
public class ImageBoundingPolyAnnotation { /** * < code > . google . cloud . datalabeling . v1beta1 . BoundingPoly bounding _ poly = 2 ; < / code > */
public com . google . cloud . datalabeling . v1beta1 . BoundingPolyOrBuilder getBoundingPolyOrBuilder ( ) { } } | if ( boundedAreaCase_ == 2 ) { return ( com . google . cloud . datalabeling . v1beta1 . BoundingPoly ) boundedArea_ ; } return com . google . cloud . datalabeling . v1beta1 . BoundingPoly . getDefaultInstance ( ) ; |
public class MessageDigestUtilImpl { /** * 获取数据摘要
* @ param data 数据
* @ return 对应的摘要 ( 转为了16进制字符串 ) */
public String digest ( String data ) { } } | return new String ( Hex . encodeHex ( digest ( data . getBytes ( ) ) , true ) ) ; |
public class LoggingClient { /** * Lists the logs in projects , organizations , folders , or billing accounts . Only logs that have
* entries are listed .
* < p > Sample code :
* < pre > < code >
* try ( LoggingClient loggingClient = LoggingClient . create ( ) ) {
* ParentName parent = ProjectName . of ( " [ ... | ListLogsRequest request = ListLogsRequest . newBuilder ( ) . setParent ( parent == null ? null : parent . toString ( ) ) . build ( ) ; return listLogs ( request ) ; |
public class BusLayerConstants { /** * Replies if the bus network should be drawn with the
* algorithm .
* @ return < code > true < / code > if the algorithm may be used ,
* otherwise < code > false < / code > */
@ Pure public static BusLayerDrawerType getPreferredLineDrawAlgorithm ( ) { } } | final Preferences prefs = Preferences . userNodeForPackage ( BusLayerConstants . class ) ; if ( prefs != null ) { final String algo = prefs . get ( "DRAWING_ALGORITHM" , null ) ; // $ NON - NLS - 1 $
if ( algo != null && algo . length ( ) > 0 ) { try { return BusLayerDrawerType . valueOf ( algo ) ; } catch ( Throwable ... |
public class DescribePendingAggregationRequestsResult { /** * Returns a PendingAggregationRequests object .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setPendingAggregationRequests ( java . util . Collection ) } or
* { @ link # withPendingAggregationRe... | if ( this . pendingAggregationRequests == null ) { setPendingAggregationRequests ( new com . amazonaws . internal . SdkInternalList < PendingAggregationRequest > ( pendingAggregationRequests . length ) ) ; } for ( PendingAggregationRequest ele : pendingAggregationRequests ) { this . pendingAggregationRequests . add ( e... |
public class CodeBuilderFragment2 { /** * Create the IDEA bindings for the builders .
* @ return the bindings . */
protected BindingFactory createIdeaBindings ( ) { } } | final BindingFactory factory = new BindingFactory ( getClass ( ) . getName ( ) ) ; for ( final AbstractSubCodeBuilderFragment subFragment : this . subFragments ) { subFragment . generateIdeaBindings ( factory ) ; } return factory ; |
public class ClassInfo { /** * Add a class with a given relationship type . Return whether the collection changed as a result of the call .
* @ param relType
* the { @ link RelType }
* @ param classInfo
* the { @ link ClassInfo }
* @ return true , if successful */
boolean addRelatedClass ( final RelType relTy... | Set < ClassInfo > classInfoSet = relatedClasses . get ( relType ) ; if ( classInfoSet == null ) { relatedClasses . put ( relType , classInfoSet = new LinkedHashSet < > ( 4 ) ) ; } return classInfoSet . add ( classInfo ) ; |
public class ZWaveNode { /** * Resolves a command class for this node . First endpoint is checked .
* If endpoint = = 1 or ( endpoint ! = 1 and version of the multi instance
* command = = 1 ) then return a supported command class on the node itself .
* If endpoint ! = 1 and version of the multi instance command =... | if ( commandClass == null ) return null ; ZWaveMultiInstanceCommandClass multiInstanceCommandClass = ( ZWaveMultiInstanceCommandClass ) supportedCommandClasses . get ( ZWaveCommandClass . CommandClass . MULTI_INSTANCE ) ; if ( multiInstanceCommandClass != null && multiInstanceCommandClass . getVersion ( ) == 2 ) { ZWav... |
public class Jaxp13XpathEngine { /** * Evaluate the result of executing the specified xpath syntax
* < code > select < / code > expression on the specified document
* @ param select
* @ param document
* @ return evaluated result
* @ throws XpathException */
public String evaluate ( String select , Document do... | try { return engine . evaluate ( select , new DOMSource ( document ) ) ; } catch ( XMLUnitException ex ) { throw new XpathException ( ex . getCause ( ) ) ; } |
public class TypeName { /** * Returns a boxed type if this is a primitive type ( like { @ code Integer } for { @ code int } ) or
* { @ code void } . Returns this type if boxing doesn ' t apply . */
public TypeName box ( ) { } } | if ( keyword == null ) return this ; // Doesn ' t need boxing .
if ( this == VOID ) return BOXED_VOID ; if ( this == BOOLEAN ) return BOXED_BOOLEAN ; if ( this == BYTE ) return BOXED_BYTE ; if ( this == SHORT ) return BOXED_SHORT ; if ( this == INT ) return BOXED_INT ; if ( this == LONG ) return BOXED_LONG ; if ( this ... |
public class TokenQueue { /** * Tests if the queue matches the sequence ( as with match ) , and if they do , removes the matched string from the
* queue .
* @ param seq String to search for , and if found , remove from queue .
* @ return true if found and removed , false if not found . */
public boolean matchChom... | if ( matches ( seq ) ) { pos += seq . length ( ) ; return true ; } else { return false ; } |
public class ResourceLocator { /** * { @ inheritDoc } */
@ Override public ISource locate ( String path ) { } } | if ( path == null || path . isEmpty ( ) ) { return new UnfoundSource ( ) ; } // get resource
ResourceSource reSource = new ResourceSource ( path ) ; if ( ! reSource . available ( ) ) { return new UnfoundSource ( path ) ; } return reSource ; |
public class DialogRootView { /** * Sets the maximum height of the view .
* @ param maxHeight
* The maximum height , which should be set , in pixels as an { @ link Integer } value . The
* maximum height must be at least 1 or - 1 , if no maximum height should be set */
public final void setMaxHeight ( final int ma... | if ( maxHeight != - 1 ) { Condition . INSTANCE . ensureAtLeast ( maxHeight , 1 , "The maximum height must be at least 1" ) ; } this . maxHeight = maxHeight ; requestLayout ( ) ; |
public class IntArraySerializer { /** * # # # # # Serialization # # # # # */
@ Override public int [ ] read ( ScanBuffer buffer ) { } } | int length = getLength ( buffer ) ; if ( length < 0 ) return null ; return buffer . getInts ( length ) ; |
public class OutgoingCallerIdReader { /** * Make the request to the Twilio API to perform the read .
* @ param client TwilioRestClient with which to make the request
* @ return OutgoingCallerId ResourceSet */
@ Override public ResourceSet < OutgoingCallerId > read ( final TwilioRestClient client ) { } } | return new ResourceSet < > ( this , client , firstPage ( client ) ) ; |
public class StringUtil { /** * Compress 2 adjacent ( single or double ) quotes into a single ( s or d )
* quote when found in the middle of a String .
* NOTE : " " " " or ' ' ' ' will be compressed into " " or ' ' .
* This function assumes that the leading and trailing quote from a
* string or delimited identi... | String result = source ; int index ; /* Find the first occurrence of adjacent quotes . */
index = result . indexOf ( quotes ) ; /* Replace each occurrence with a single quote and begin the
* search for the next occurrence from where we left off . */
while ( index != - 1 ) { result = result . substring ( 0 , index + 1... |
public class SignalRsInner { /** * Regenerate SignalR service access key . PrimaryKey and SecondaryKey cannot be regenerated at the same time .
* @ 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 .
* @ pa... | return beginRegenerateKeyWithServiceResponseAsync ( resourceGroupName , resourceName , keyType ) . toBlocking ( ) . single ( ) . body ( ) ; |
public class ScriptUtils { /** * Formats imported variables to be used in a script as environment variables .
* @ param instance the instance whose exported variables must be formatted
* @ return a non - null map */
public static Map < String , String > formatExportedVars ( Instance instance ) { } } | // The map we will return
Map < String , String > exportedVars = new HashMap < > ( ) ; // Iterate over the instance and its ancestors .
// There is no loop in parent relations , so no risk of conflict in variable names .
for ( Instance inst = instance ; inst != null ; inst = inst . getParent ( ) ) { String prefix = "" ... |
public class StreamNameConditionMarshaller { /** * Marshall the given parameter object . */
public void marshall ( StreamNameCondition streamNameCondition , ProtocolMarshaller protocolMarshaller ) { } } | if ( streamNameCondition == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( streamNameCondition . getComparisonOperator ( ) , COMPARISONOPERATOR_BINDING ) ; protocolMarshaller . marshall ( streamNameCondition . getComparisonValue ( ) , COMPA... |
public class SARLStandaloneSetup { /** * Create the injectors based on the given set of modules .
* @ param modules the injection modules that are overriding the standard SARL module .
* @ return the injector .
* @ since 0.8
* @ see SARLRuntimeModule */
@ SuppressWarnings ( "static-method" ) public Injector cre... | return Guice . createInjector ( Modules . override ( new SARLRuntimeModule ( ) ) . with ( modules ) ) ; |
public class JSVGSynchronizedCanvas { /** * Schedule a detach .
* @ param oldplot Plot to detach from . */
private void scheduleSetPlot ( final SVGPlot oldplot , final SVGPlot newplot ) { } } | UpdateManager um = this . getUpdateManager ( ) ; if ( um != null ) { synchronized ( um ) { if ( um . isRunning ( ) ) { // LoggingUtil . warning ( " Scheduling detach : " + this + " " + oldplot ) ;
final Runnable detach = new Runnable ( ) { @ Override public void run ( ) { if ( latest . compareAndSet ( this , null ) ) {... |
public class RegularExpression { /** * Create a regular expression without tokenization support .
* @ param expressions
* @ return */
public static < E > RegularExpression < E > compile ( List < Expression < E > > expressions ) { } } | return new RegularExpression < E > ( expressions ) ; |
public class appqoepolicy { /** * Use this API to fetch filtered set of appqoepolicy resources .
* set the filter parameter values in filtervalue object . */
public static appqoepolicy [ ] get_filtered ( nitro_service service , filtervalue [ ] filter ) throws Exception { } } | appqoepolicy obj = new appqoepolicy ( ) ; options option = new options ( ) ; option . set_filter ( filter ) ; appqoepolicy [ ] response = ( appqoepolicy [ ] ) obj . getfiltered ( service , option ) ; return response ; |
public class CallableProcedureStatement { /** * Set in / out parameters value . */
public void setParametersVariables ( ) { } } | hasInOutParameters = false ; for ( CallParameter param : params ) { if ( param != null && param . isOutput ( ) && param . isInput ( ) ) { hasInOutParameters = true ; break ; } } |
public class WPartialDateField { /** * Parses a component of a partial date .
* @ param component the date component .
* @ param padding the padding character .
* @ return the parsed value , may be null . */
private Integer parseDateComponent ( final String component , final char padding ) { } } | if ( component != null && component . indexOf ( padding ) == - 1 ) { try { return Integer . valueOf ( component ) ; } catch ( NumberFormatException e ) { return null ; } } return null ; |
public class SourceFile { /** * Get the byte offset in the data for a source line . Note that lines are
* considered to be zero - index , so the first line in the file is numbered
* zero .
* @ param line
* the line number
* @ return the byte offset in the file ' s data for the line , or - 1 if the
* line is... | try { loadFileData ( ) ; } catch ( IOException e ) { System . err . println ( "SourceFile.getLineOffset: " + e . getMessage ( ) ) ; return - 1 ; } if ( line < 0 || line >= numLines ) { return - 1 ; } return lineNumberMap [ line ] ; |
public class Merger { /** * Invoked upon receiving a MERGE event from the MERGE layer . Starts the merge protocol .
* See description of protocol in DESIGN .
* @ param views A List of < em > different < / em > views detected by the merge protocol , keyed by sender */
public void merge ( Map < Address , View > views... | if ( views == null || views . isEmpty ( ) ) { log . warn ( "the views passed with the MERGE event were empty (or null); ignoring MERGE event" ) ; return ; } if ( View . sameViews ( views . values ( ) ) ) { log . debug ( "MERGE event is ignored because of identical views: %s" , Util . printListWithDelimiter ( views . va... |
public class MACAddress { /** * Converts to a link - local Ipv6 address . Any MAC prefix length is ignored . Other elements of this address section are incorporated into the conversion .
* This will provide the latter 4 segments of an IPv6 address , to be paired with the link - local IPv6 prefix of 4 segments .
* @... | IPv6AddressNetwork network = getIPv6Network ( ) ; IPv6AddressSection linkLocalPrefix = network . getLinkLocalPrefix ( ) ; IPv6AddressCreator creator = network . getAddressCreator ( ) ; return creator . createAddress ( linkLocalPrefix . append ( toEUI64IPv6 ( ) ) ) ; |
public class GaloisField { /** * Compute the division of two fields
* @ param x input field
* @ param y input field
* @ return x / y */
public int divide ( int x , int y ) { } } | assert ( x >= 0 && x < getFieldSize ( ) && y > 0 && y < getFieldSize ( ) ) ; return divTable [ x ] [ y ] ; |
public class AdminFileauthAction { private HtmlResponse asListHtml ( ) { } } | return asHtml ( path_AdminFileauth_AdminFileauthJsp ) . renderWith ( data -> { RenderDataUtil . register ( data , "fileAuthenticationItems" , fileAuthenticationService . getFileAuthenticationList ( fileAuthenticationPager ) ) ; // page navi
RenderDataUtil . register ( data , "displayCreateLink" , ! crawlingConfigHelper... |
public class cachepolicylabel { /** * Use this API to fetch filtered set of cachepolicylabel resources .
* filter string should be in JSON format . eg : " port : 80 , servicetype : HTTP " . */
public static cachepolicylabel [ ] get_filtered ( nitro_service service , String filter ) throws Exception { } } | cachepolicylabel obj = new cachepolicylabel ( ) ; options option = new options ( ) ; option . set_filter ( filter ) ; cachepolicylabel [ ] response = ( cachepolicylabel [ ] ) obj . getfiltered ( service , option ) ; return response ; |
public class AbstractPacketOutputStream { /** * Reset mark flag and send bytes after mark flag .
* @ return bytes after mark flag */
public byte [ ] resetMark ( ) { } } | mark = - 1 ; if ( bufferContainDataAfterMark ) { byte [ ] data = Arrays . copyOfRange ( buf , initialPacketPos ( ) , pos ) ; startPacket ( 0 ) ; bufferContainDataAfterMark = false ; return data ; } return null ; |
public class PatternStream { /** * Applies a select function to the detected pattern sequence . For each pattern sequence the
* provided { @ link PatternSelectFunction } is called . The pattern select function can produce
* exactly one resulting element .
* @ param patternSelectFunction The pattern select functio... | final PatternProcessFunction < T , R > processFunction = fromSelect ( builder . clean ( patternSelectFunction ) ) . build ( ) ; return process ( processFunction , outTypeInfo ) ; |
public class StorePackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public EClass getServiceType ( ) { } } | if ( serviceTypeEClass == null ) { serviceTypeEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( StorePackage . eNS_URI ) . getEClassifiers ( ) . get ( 64 ) ; } return serviceTypeEClass ; |
public class DNSSECVerifier { /** * Adds the specified key to the set of trusted keys */
public synchronized void addTrustedKey ( DNSKEYRecord key ) { } } | Name name = key . getName ( ) ; List list = ( List ) trustedKeys . get ( name ) ; if ( list == null ) trustedKeys . put ( name , list = new LinkedList ( ) ) ; list . add ( key ) ; |
public class StringHelper { /** * Get everything from the string from and including the passed string .
* @ param sStr
* The source string . May be < code > null < / code > .
* @ param sSearch
* The string to search . May be < code > null < / code > .
* @ return < code > null < / code > if the passed string d... | return _getFromLast ( sStr , sSearch , true ) ; |
public class PascalTemplate { /** * Sets template values .
* @ param fieldName ( i . e . workshopname , workshopdate ) */
public void setValue ( String fieldName , String value ) { } } | int index = getFieldIndex ( fieldName ) ; assert ( index != - 1 ) ; values [ index ] = value ; |
public class SpecializedOps_DDRM { /** * Computes the product of the diagonal elements . For a diagonal or triangular
* matrix this is the determinant .
* @ param T A matrix .
* @ return product of the diagonal elements . */
public static double diagProd ( DMatrix1Row T ) { } } | double prod = 1.0 ; int N = Math . min ( T . numRows , T . numCols ) ; for ( int i = 0 ; i < N ; i ++ ) { prod *= T . unsafe_get ( i , i ) ; } return prod ; |
public class FunctionLibFunction { /** * Fuegt der Funktion ein Argument hinzu .
* @ param arg Argument zur Funktion . */
public void addArg ( FunctionLibFunctionArg arg ) { } } | arg . setFunction ( this ) ; argument . add ( arg ) ; if ( arg . getDefaultValue ( ) != null ) hasDefaultValues = true ; |
public class DocumentImpl { /** * Evaluate XPath expression expected to return nodes list . Evaluate expression and return result nodes as elements list .
* @ param contextNode evaluation context node ,
* @ param expression XPath expression , formatting tags supported ,
* @ param args optional formatting argument... | return evaluateXPathNodeListNS ( contextNode , null , expression , args ) ; |
public class DatabasesInner { /** * Updates a database .
* @ param resourceGroupName The name of the resource group containing the Kusto cluster .
* @ param clusterName The name of the Kusto cluster .
* @ param databaseName The name of the database in the Kusto cluster .
* @ param parameters The database parame... | return ServiceFuture . fromResponse ( beginUpdateWithServiceResponseAsync ( resourceGroupName , clusterName , databaseName , parameters ) , serviceCallback ) ; |
public class WebMvcTags { /** * Creates a { @ code method } tag based on the status of the given { @ code response } .
* @ param response the HTTP response
* @ return the status tag derived from the status of the response */
public static Tag status ( @ Nullable HttpServletResponse response ) { } } | return response == null ? STATUS_UNKNOWN : Tag . of ( "status" , Integer . toString ( response . getStatus ( ) ) ) ; |
public class URITemplates { /** * This method instantiates the input uri template by arguments
* Example :
* { @ code URITemplates . format ( " http : / / example . org / { } / { } " , " A " , 1 ) } results { @ code " http : / / example . org / A / 1 " }
* @ param uriTemplate String with placeholder
* @ param a... | return format ( uriTemplate , Arrays . asList ( args ) ) ; |
public class Ifc2x3tc1FactoryImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public IfcProfileTypeEnum createIfcProfileTypeEnumFromString ( EDataType eDataType , String initialValue ) { } } | IfcProfileTypeEnum result = IfcProfileTypeEnum . get ( initialValue ) ; if ( result == null ) throw new IllegalArgumentException ( "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType . getName ( ) + "'" ) ; return result ; |
public class AbstractXmlProcessor { /** * The given node returns a map entry or null
* @ param node
* the node
* @ return a map entry for the given node or null */
@ SuppressWarnings ( { } } | "rawtypes" } ) private Map . Entry getMapEntry ( XmlNode node ) { String keyName = node . getName ( ) ; Object value = null ; XmlMapEntry xmlMapEntry = this . mapSpecification . get ( keyName ) ; switch ( node . getType ( ) ) { case XmlNode . ATTRIBUTE_NODE : value = node . getValue ( ) ; break ; case XmlNode . ELEMENT... |
public class TextBox { /** * Computes the final width of a string while considering word - spacing
* @ param fm the font metrics used for calculation
* @ param text the string to be measured
* @ return the resulting width in pixels */
private int stringWidth ( FontMetrics fm , String text ) { } } | int w = fm . stringWidth ( text ) ; if ( wordSpacing != null ) { // count spaces and add
float add = 0.0f ; for ( int i = 0 ; i < text . length ( ) ; i ++ ) { if ( text . charAt ( i ) == ' ' ) add += wordSpacing ; } w = Math . round ( w + add ) ; } return w ; |
public class JedisClientFactory { /** * { @ inheritDoc } */
@ Override protected JedisClientPool createRedisClientPool ( String host , int port , String username , String password , PoolConfig poolConfig ) { } } | if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( "Building a Redis client pool {host:" + host + ";port:" + port + ";username:" + username + "}..." ) ; } JedisClientPoolableObjectFactory factory = new JedisClientPoolableObjectFactory ( host , port , username , password ) ; JedisClientPool redisClientPool = new Jedi... |
public class StartBackupJobRequest { /** * To help organize your resources , you can assign your own metadata to the resources that you create . Each tag is a
* key - value pair .
* @ param recoveryPointTags
* To help organize your resources , you can assign your own metadata to the resources that you create . Ea... | setRecoveryPointTags ( recoveryPointTags ) ; return this ; |
public class CountingMemoryCache { /** * Gets the value with the given key to be reused , or null if there is no such value .
* < p > The item can be reused only if it is exclusively owned by the cache . */
@ Nullable public CloseableReference < V > reuse ( K key ) { } } | Preconditions . checkNotNull ( key ) ; CloseableReference < V > clientRef = null ; boolean removed = false ; Entry < K , V > oldExclusive = null ; synchronized ( this ) { oldExclusive = mExclusiveEntries . remove ( key ) ; if ( oldExclusive != null ) { Entry < K , V > entry = mCachedEntries . remove ( key ) ; Precondit... |
public class AggregatedBdbEnvironmentStats { /** * Calls the provided metric getter on all the tracked environments and
* obtains their values
* @ param metricGetterName
* @ return */
private List < Long > collectLongMetric ( String metricGetterName ) { } } | List < Long > vals = new ArrayList < Long > ( ) ; for ( BdbEnvironmentStats envStats : environmentStatsTracked ) { vals . add ( ( Long ) ReflectUtils . callMethod ( envStats , BdbEnvironmentStats . class , metricGetterName , new Class < ? > [ 0 ] , new Object [ 0 ] ) ) ; } return vals ; |
public class SeekTable { /** * Write out the metadata block .
* @ param os The output stream
* @ param isLast True if this is the last metadata block
* @ throws IOException Thrown if error writing data */
public void write ( BitOutputStream os , boolean isLast ) throws IOException { } } | os . writeRawUInt ( isLast , STREAM_METADATA_IS_LAST_LEN ) ; os . writeRawUInt ( METADATA_TYPE_SEEKTABLE , STREAM_METADATA_TYPE_LEN ) ; os . writeRawUInt ( calcLength ( ) , STREAM_METADATA_LENGTH_LEN ) ; for ( int i = 0 ; i < points . length ; i ++ ) { points [ i ] . write ( os ) ; } os . flushByteAligned ( ) ; |
public class Utils { public static void printOutBuffers ( WsByteBuffer [ ] bufs ) { } } | int j = 0 ; int maxToPrint = 20 ; for ( int i = 0 ; i < bufs . length ; i ++ ) { if ( j >= maxToPrint ) break ; WsByteBuffer buf = bufs [ i ] ; if ( buf != null ) { int oldPos = buf . position ( ) ; while ( ( buf . position ( ) < buf . limit ( ) ) && ( j < maxToPrint ) ) { byte b = buf . get ( ) ; // Special Debug and ... |
public class Grapher { /** * Writes the " Dot " graph to a new temp file .
* @ return the name of the newly created file */
public String toFile ( ) throws Exception { } } | File file = File . createTempFile ( "GuiceDependencies_" , ".dot" ) ; toFile ( file ) ; return file . getCanonicalPath ( ) ; |
public class DirtyableDBObjectSet { @ Override public Object removeField ( String s ) { } } | Object o = super . removeField ( s ) ; if ( o != null ) { delegate . remove ( o ) ; } return o ; |
public class Parser { /** * * * * * * HELPERS * * * * * */
public Rule NOrMore ( char c , int n ) { } } | return Sequence ( repeat ( c , n ) , ZeroOrMore ( c ) ) ; |
public class ConnectorImpl { /** * { @ inheritDoc } */
public Connector merge ( MergeableMetadata < ? > inputMd ) throws Exception { } } | if ( inputMd instanceof ConnectorImpl ) { ConnectorImpl input = ( ConnectorImpl ) inputMd ; XsdString newResourceadapterVersion = XsdString . isNull ( this . resourceadapterVersion ) ? input . resourceadapterVersion : this . resourceadapterVersion ; XsdString newEisType = XsdString . isNull ( this . eisType ) ? input .... |
public class PooledHttpTransportFactory { /** * Gets the transport pool for the given host info , or creates one if it is absent .
* @ param hostInfo To get a pool for
* @ param settings For creating the pool if it does not exist
* @ param secureSettings For providing secure settings to the connections within the... | TransportPool pool ; pool = hostPools . get ( hostInfo ) ; // Check again in case it was added while waiting for the lock
if ( pool == null ) { pool = new TransportPool ( jobKey , hostInfo , settings , secureSettings ) ; hostPools . put ( hostInfo , pool ) ; if ( log . isDebugEnabled ( ) ) { log . debug ( "Creating new... |
public class BenchmarkMethod { /** * This class finds any method with a given annotation . The method is
* allowed to occur only once in the class and should match the requirements
* for Perfidix for an execution by reflection .
* @ param anno
* of the method to be found
* @ param clazz
* class to be search... | // needed variables , one for check for duplicates
Method anyMethod = null ; // Scanning all methods
final Method [ ] possAnnoMethods = clazz . getDeclaredMethods ( ) ; for ( final Method meth : possAnnoMethods ) { if ( meth . getAnnotation ( anno ) != null ) { // Check if there are multiple annotated methods , throwin... |
public class BatchGetPartitionRequest { /** * A list of partition values identifying the partitions to retrieve .
* @ param partitionsToGet
* A list of partition values identifying the partitions to retrieve . */
public void setPartitionsToGet ( java . util . Collection < PartitionValueList > partitionsToGet ) { } ... | if ( partitionsToGet == null ) { this . partitionsToGet = null ; return ; } this . partitionsToGet = new java . util . ArrayList < PartitionValueList > ( partitionsToGet ) ; |
public class ServerBuilder { /** * Adds a new { @ link ServerPort } that listens to the specified { @ code localAddress } using the specified
* { @ link SessionProtocol } s . Specify multiple protocols to serve more than one protocol on the same port :
* < pre > { @ code
* ServerBuilder sb = new ServerBuilder ( )... | return port ( new ServerPort ( localAddress , protocols ) ) ; |
public class ExecutionInput { /** * This helps you transform the current ExecutionInput object into another one by starting a builder with all
* the current values and allows you to transform it how you want .
* @ param builderConsumer the consumer code that will be given a builder to transform
* @ return a new E... | Builder builder = new Builder ( ) . query ( this . query ) . operationName ( this . operationName ) . context ( this . context ) . root ( this . root ) . dataLoaderRegistry ( this . dataLoaderRegistry ) . cacheControl ( this . cacheControl ) . variables ( this . variables ) ; builderConsumer . accept ( builder ) ; retu... |
public class AbstractFormBuilder { /** * Creates a component which is used as a selector in the form . This
* implementation creates a { @ link JComboBox }
* @ param fieldName the name of the field for the selector
* @ param filter an optional filter constraint
* @ return the component to use for a selector , n... | Map context = new HashMap ( ) ; context . put ( ComboBoxBinder . FILTER_KEY , filter ) ; return getBindingFactory ( ) . createBinding ( JComboBox . class , fieldName ) . getControl ( ) ; |
public class QuatSymmetryDetector { /** * Calculate GLOBAL symmetry results . This means that all { @ link Subunit }
* are included in the symmetry .
* @ param structure
* protein chains will be extracted as { @ link Subunit }
* @ param symmParams
* quaternary symmetry parameters
* @ param clusterParams
*... | Stoichiometry composition = SubunitClusterer . cluster ( structure , clusterParams ) ; return calcGlobalSymmetry ( composition , symmParams ) ; |
public class SetVariableHandler { /** * / * ( non - Javadoc )
* @ see org . jboss . as . cli . handlers . CommandHandlerWithHelp # doHandle ( org . jboss . as . cli . CommandContext ) */
@ Override protected void doHandle ( CommandContext ctx ) throws CommandLineException { } } | ParsedCommandLine parsedArgs = ctx . getParsedCommandLine ( ) ; final List < String > vars = parsedArgs . getOtherProperties ( ) ; if ( vars . isEmpty ( ) ) { final Collection < String > defined = ctx . getVariables ( ) ; if ( defined . isEmpty ( ) ) { return ; } final List < String > pairs = new ArrayList < String > (... |
public class RDBMUserLayoutStore { /** * Create a layout */
private void createLayout ( HashMap layoutStructure , Document doc , Element root , int structId ) { } } | while ( structId != 0 ) { LayoutStructure ls = ( LayoutStructure ) layoutStructure . get ( structId ) ; // replaced with call to method in containing class to allow overriding
// by subclasses of RDBMUserLayoutStore .
// Element structure = ls . getStructureDocument ( doc ) ;
Element structure = getStructure ( doc , ls... |
public class FormFieldHandler { /** * submit / / / / / */
public void handleSubmit ( VariableScope variableScope , VariableMap values , VariableMap allValues ) { } } | TypedValue submittedValue = ( TypedValue ) values . getValueTyped ( id ) ; values . remove ( id ) ; // perform validation
for ( FormFieldValidationConstraintHandler validationHandler : validationHandlers ) { Object value = null ; if ( submittedValue != null ) { value = submittedValue . getValue ( ) ; } validationHandle... |
public class LongSummary { /** * Return a new value object of the statistical summary , currently
* represented by the { @ code statistics } object .
* @ param statistics the creating ( mutable ) statistics class
* @ return the statistical moments */
public static LongSummary of ( final LongSummaryStatistics stat... | return new LongSummary ( statistics . getCount ( ) , statistics . getMin ( ) , statistics . getMax ( ) , statistics . getSum ( ) , statistics . getAverage ( ) ) ; |
public class CharSeq { /** * Expands the characters between { @ code a } and { @ code b } .
* @ param a the start character .
* @ param b the stop character .
* @ return the expanded characters . */
public static String expand ( final char a , final char b ) { } } | final StringBuilder out = new StringBuilder ( ) ; if ( a < b ) { char c = a ; while ( c <= b ) { out . append ( c ) ; c = ( char ) ( c + 1 ) ; } } else if ( a > b ) { char c = a ; while ( c >= b ) { out . append ( c ) ; c = ( char ) ( c - 1 ) ; } } return out . toString ( ) ; |
public class Minutes { /** * Creates a new < code > Minutes < / code > representing the number of complete
* standard length minutes in the specified period .
* This factory method converts all fields from the period to minutes using standardised
* durations for each field . Only those fields which have a precise... | int amount = BaseSingleFieldPeriod . standardPeriodIn ( period , DateTimeConstants . MILLIS_PER_MINUTE ) ; return Minutes . minutes ( amount ) ; |
public class MathFunctions { /** * < div color = ' red ' style = " font - size : 24px ; color : red " > < b > < i > < u > JCYPHER < / u > < / i > < / b > < / div >
* < div color = ' red ' style = " font - size : 18px ; color : red " > < i > return a number rounded to the nearest integer . < / i > < / div >
* < div ... | JcNumber ret = new JcNumber ( null , this . argument , new FunctionInstance ( FUNCTION . Math . ROUND , 1 ) ) ; QueryRecorder . recordInvocationConditional ( this , "round" , ret ) ; return ret ; |
public class JsonArray { /** * Returns true if this array has no value at { @ code index } , or if its value
* is the { @ code null } reference . */
public boolean isNull ( int index ) { } } | Object value = opt ( index ) ; return value == null || value . equals ( JSON_NULL ) ; |
public class sslpolicy_sslpolicylabel_binding { /** * Use this API to fetch sslpolicy _ sslpolicylabel _ binding resources of given name . */
public static sslpolicy_sslpolicylabel_binding [ ] get ( nitro_service service , String name ) throws Exception { } } | sslpolicy_sslpolicylabel_binding obj = new sslpolicy_sslpolicylabel_binding ( ) ; obj . set_name ( name ) ; sslpolicy_sslpolicylabel_binding response [ ] = ( sslpolicy_sslpolicylabel_binding [ ] ) obj . get_resources ( service ) ; return response ; |
public class ProcyonDecompiler { /** * The metadata cache can become huge over time . This simply flushes it periodically . */
private void refreshMetadataCache ( final Queue < WindupMetadataSystem > metadataSystemCache , final DecompilerSettings settings ) { } } | metadataSystemCache . clear ( ) ; for ( int i = 0 ; i < this . getNumberOfThreads ( ) ; i ++ ) { metadataSystemCache . add ( new NoRetryMetadataSystem ( settings . getTypeLoader ( ) ) ) ; } |
public class GeometryExpression { /** * Returns a geometric object that represents the convex hull of this geometric object .
* Convex hulls , being dependent on straight lines , can be accurately represented in linear
* interpolations for any geometry restricted to linear interpolations .
* @ return convex hull ... | if ( convexHull == null ) { convexHull = GeometryExpressions . geometryOperation ( SpatialOps . CONVEXHULL , mixin ) ; } return convexHull ; |
public class PersonGroupPersonsImpl { /** * Delete an existing person from a person group . Persisted face images of the person will also be deleted .
* @ param personGroupId Id referencing a particular person group .
* @ param personId Id referencing a particular person .
* @ throws IllegalArgumentException thro... | deleteWithServiceResponseAsync ( personGroupId , personId ) . toBlocking ( ) . single ( ) . body ( ) ; |
public class DescribeVpnGatewaysResult { /** * Information about one or more virtual private gateways .
* @ param vpnGateways
* Information about one or more virtual private gateways . */
public void setVpnGateways ( java . util . Collection < VpnGateway > vpnGateways ) { } } | if ( vpnGateways == null ) { this . vpnGateways = null ; return ; } this . vpnGateways = new com . amazonaws . internal . SdkInternalList < VpnGateway > ( vpnGateways ) ; |
public class ProvFactory { /** * / * ( non - Javadoc )
* @ see org . openprovenance . prov . model . ModelConstructor # newWasInvalidatedBy ( org . openprovenance . model . QualifiedName , org . openprovenance . model . QualifiedName , org . openprovenance . model . QualifiedName , javax . xml . datatype . XMLGregori... | WasInvalidatedBy res = newWasInvalidatedBy ( id , entity , activity ) ; res . setTime ( time ) ; setAttributes ( res , attributes ) ; return res ; |
public class IPRangeCollection { /** * performs a linear scan for unsorted lists
* @ param addr
* @ return */
public IPRangeNode findAddr ( InetAddress addr ) { } } | for ( IPRangeNode c : this . list ) { IPRangeNode result = c . findAddr ( addr ) ; if ( result != null ) return result ; } return null ; |
public class SQLExpressions { /** * Get a group _ concat ( expr ) expression
* @ param expr expression to be aggregated
* @ return group _ concat ( expr ) */
public static StringExpression groupConcat ( Expression < String > expr ) { } } | return Expressions . stringOperation ( SQLOps . GROUP_CONCAT , expr ) ; |
public class LambdaToMethod { /** * Translate a lambda into a method to be inserted into the class .
* Then replace the lambda site with an invokedynamic call of to lambda
* meta - factory , which will use the lambda method .
* @ param tree */
@ Override public void visitLambda ( JCLambda tree ) { } } | LambdaTranslationContext localContext = ( LambdaTranslationContext ) context ; MethodSymbol sym = localContext . translatedSym ; MethodType lambdaType = ( MethodType ) sym . type ; { /* Type annotation management : Based on where the lambda features , type annotations that
are interior to it , may at this point be at... |
public class BlasBufferUtil { /** * Get the leading dimension
* for a blas invocation .
* The lead dimension is usually
* arr . size ( 0 ) ( this is only for fortran ordering though ) .
* It can be size ( 1 ) ( assuming matrix ) for C ordering though .
* @ param arr the array to
* @ return the leading dimen... | // ignore ordering for vectors
if ( arr . isVector ( ) ) { return ( int ) arr . length ( ) ; } return arr . ordering ( ) == NDArrayFactory . C ? ( int ) arr . size ( 1 ) : ( int ) arr . size ( 0 ) ; |
public class CmsImportVersion7 { /** * Sets the user Flags . < p >
* @ param userFlags the flags to set */
public void setUserFlags ( String userFlags ) { } } | try { m_userFlags = Integer . parseInt ( userFlags ) ; } catch ( Throwable e ) { setThrowable ( e ) ; } |
public class ToHTMLStream { /** * Receive notification of the end of an element .
* @ param namespaceURI
* @ param localName
* @ param name The element type name
* @ throws org . xml . sax . SAXException Any SAX exception , possibly
* wrapping another exception . */
public final void endElement ( final String... | // deal with any pending issues
if ( m_cdataTagOpen ) closeCDATA ( ) ; // if the element has a namespace , treat it like XML , not HTML
if ( null != namespaceURI && namespaceURI . length ( ) > 0 ) { super . endElement ( namespaceURI , localName , name ) ; return ; } try { ElemContext elemContext = m_elemContext ; final... |
public class DescribeSecretRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( DescribeSecretRequest describeSecretRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( describeSecretRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( describeSecretRequest . getSecretId ( ) , SECRETID_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e ... |
public class GenericHibernateDao { /** * This method returns a { @ link Map } that maps { @ link PersistentObject } s
* to PermissionCollections for the passed { @ link User } . I . e . the keySet
* of the map is the collection of all { @ link PersistentObject } s where the
* user has at least one permission and ... | "unchecked" } ) public Map < PersistentObject , PermissionCollection > findAllUserPermissionsOfUser ( User user ) { Criteria criteria = getSession ( ) . createCriteria ( PersistentObject . class ) ; // by only setting the alias , we will only get those entities where
// there is at least one permission set . . .
// it ... |
public class JSONWriter { /** * object end .
* @ return this .
* @ throws IOException . */
public JSONWriter objectEnd ( ) throws IOException { } } | writer . write ( JSON . RBRACE ) ; state = stack . pop ( ) ; return this ; |
public class UDPAck { /** * Received an ACK for a remote Task . Ping the task . */
AutoBuffer call ( AutoBuffer ab ) { } } | int tnum = ab . getTask ( ) ; RPC < ? > t = ab . _h2o . taskGet ( tnum ) ; assert t == null || t . _tasknum == tnum ; if ( t != null ) t . response ( ab ) ; // Do the 2nd half of this task , includes ACKACK
else ab . close ( ) ; // Else forgotten task , but still must ACKACK
return new AutoBuffer ( ab . _h2o ) . putTas... |
public class AsImpl { /** * Initialize FSM for AS side */
private void initPeerFSM ( ) { } } | this . peerFSM = new FSM ( this . name + "_PEER" ) ; // Define states
this . peerFSM . createState ( AsState . DOWN . toString ( ) ) . setOnEnter ( new SEHPeerAsStateEnterDown ( this ) ) ; this . peerFSM . createState ( AsState . ACTIVE . toString ( ) ) . setOnEnter ( new SEHPeerAsStateEnterActive ( this ) ) ; this . p... |
public class U { /** * Documented , # without */
@ SuppressWarnings ( "unchecked" ) public static < E > List < E > without ( final List < E > list , E ... values ) { } } | final List < E > valuesList = Arrays . asList ( values ) ; return filter ( list , new Predicate < E > ( ) { @ Override public boolean test ( E elem ) { return ! contains ( valuesList , elem ) ; } } ) ; |
public class Goro { /** * Creates a Goro implementation that binds to { @ link GoroService }
* in order to run scheduled tasks in service context .
* { @ code BoundGoro } exposes { @ code bind ( ) } and { @ code unbind ( ) } methods that you can use to connect to
* and disconnect from the worker service in other ... | if ( context == null ) { throw new IllegalArgumentException ( "Context cannot be null" ) ; } if ( handler == null ) { throw new IllegalArgumentException ( "Disconnection handler cannot be null" ) ; } return new BoundGoroImpl ( context , handler ) ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.