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 only be used to retrieve data . Attempting to update data using this parameter may cause data loss .
* @ param returnId Unique identifier of the return whose items you want to get .
* @ return String Resource Url */
public static MozuUrl updatePackageUrl ( String packageId , String responseFields , String returnId ) { } } | 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 ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; |
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 localAddr , int localPort , long timeout ) { } } | 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 FFDC code needed
throw new MessageCreateFailedException ( e ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "createNewTrmMeBridgeReply" ) ; return msg ; |
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 ) { executor . prestartAllCoreThreads ( ) ; } |
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 dataSourceID ) throws SQLException { } } | 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 = true ; } } finally { // Downgrade to read lock for rest of method
lock . readLock ( ) . lock ( ) ; lock . writeLock ( ) . unlock ( ) ; } String className = ( String ) properties . get ( DataSource . class . getName ( ) ) ; if ( className == null ) { String vendorPropertiesPID = props instanceof PropertyService ? ( ( PropertyService ) props ) . getFactoryPID ( ) : PropertyService . FACTORY_PID ; className = JDBCDrivers . getDataSourceClassName ( vendorPropertiesPID ) ; if ( className == null ) { className = JDBCDrivers . getDataSourceClassName ( getClasspath ( sharedLib , true ) ) ; if ( className == null ) { Set < String > packagesSearched = new LinkedHashSet < String > ( ) ; SimpleEntry < Integer , String > dsEntry = JDBCDrivers . inferDataSourceClassFromDriver ( classloader , packagesSearched , JDBCDrivers . DATA_SOURCE ) ; className = dsEntry == null ? null : dsEntry . getValue ( ) ; if ( className == null ) throw classNotFound ( DataSource . class . getName ( ) , packagesSearched , dataSourceID , null ) ; } } } return create ( className , props , dataSourceID ) ; } finally { lock . readLock ( ) . unlock ( ) ; } |
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 ParserConfigurationException
* @ throws SAXException
* @ throws XPathExpressionException
* @ throws IOException */
private Map < String , String > processCommandExecutionResponse ( Map < String , String > receiveResult ) throws ParserConfigurationException , SAXException , XPathExpressionException , IOException { } } | 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_RESULT ) , OutputStream . STDERR ) ) ; scriptResults . put ( Constants . OutputNames . SCRIPT_EXIT_CODE , WSManUtils . getScriptExitCode ( receiveResult . get ( RETURN_RESULT ) ) ) ; return scriptResults ; |
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 .
* @ throws InternalErrorException
* This exception is thrown when Amazon Cognito encounters an internal error .
* @ throws ResourceNotFoundException
* This exception is thrown when the Amazon Cognito service cannot find the requested resource .
* @ sample AWSCognitoIdentityProvider . GetSigningCertificate
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / cognito - idp - 2016-04-18 / GetSigningCertificate "
* target = " _ top " > AWS API Documentation < / a > */
@ Override public GetSigningCertificateResult getSigningCertificate ( GetSigningCertificateRequest request ) { } } | 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 ( " [ PROJECT ] " ) ;
* for ( String element : loggingClient . listLogs ( parent ) . iterateAll ( ) ) {
* / / doThingsWith ( element ) ;
* < / code > < / pre >
* @ param parent Required . The resource name that owns the logs :
* < p > " projects / [ PROJECT _ ID ] " " organizations / [ ORGANIZATION _ ID ] "
* " billingAccounts / [ BILLING _ ACCOUNT _ ID ] " " folders / [ FOLDER _ ID ] "
* @ throws com . google . api . gax . rpc . ApiException if the remote call fails */
public final ListLogsPagedResponse listLogs ( ParentName parent ) { } } | 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 exception ) { } } } return BusLayerDrawerType . OVERLAP ; |
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 # withPendingAggregationRequests ( java . util . Collection ) } if you want to override the existing values .
* @ param pendingAggregationRequests
* Returns a PendingAggregationRequests object .
* @ return Returns a reference to this object so that method calls can be chained together . */
public DescribePendingAggregationRequestsResult withPendingAggregationRequests ( PendingAggregationRequest ... pendingAggregationRequests ) { } } | if ( this . pendingAggregationRequests == null ) { setPendingAggregationRequests ( new com . amazonaws . internal . SdkInternalList < PendingAggregationRequest > ( pendingAggregationRequests . length ) ) ; } for ( PendingAggregationRequest ele : pendingAggregationRequests ) { this . pendingAggregationRequests . add ( ele ) ; } return this ; |
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 relType , final ClassInfo classInfo ) { } } | 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 = = 2 then
* first try command classes of endpoints . If not found the return a
* supported command class on the node itself .
* Returns null if a command class is not found .
* @ param commandClass The command class to resolve .
* @ param endpointId the endpoint / instance to resolve this command class for .
* @ return the command class . */
public ZWaveCommandClass resolveCommandClass ( ZWaveCommandClass . CommandClass commandClass , int endpointId ) { } } | if ( commandClass == null ) return null ; ZWaveMultiInstanceCommandClass multiInstanceCommandClass = ( ZWaveMultiInstanceCommandClass ) supportedCommandClasses . get ( ZWaveCommandClass . CommandClass . MULTI_INSTANCE ) ; if ( multiInstanceCommandClass != null && multiInstanceCommandClass . getVersion ( ) == 2 ) { ZWaveEndpoint endpoint = multiInstanceCommandClass . getEndpoint ( endpointId ) ; if ( endpoint != null ) { ZWaveCommandClass result = endpoint . getCommandClass ( commandClass ) ; if ( result != null ) return result ; } } ZWaveCommandClass result = getCommandClass ( commandClass ) ; if ( result == null ) return result ; if ( multiInstanceCommandClass != null && multiInstanceCommandClass . getVersion ( ) == 1 && result . getInstances ( ) >= endpointId ) return result ; return endpointId == 1 ? result : null ; |
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 document ) throws XpathException { } } | 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 == CHAR ) return BOXED_CHAR ; if ( this == FLOAT ) return BOXED_FLOAT ; if ( this == DOUBLE ) return BOXED_DOUBLE ; throw new AssertionError ( keyword ) ; |
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 matchChomp ( String seq ) { } } | 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 maxHeight ) { } } | 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 identifier have already been removed .
* @ param source string to be compressed
* @ param quotes string containing two single or double quotes .
* @ return String where quotes have been compressed */
public static String compressQuotes ( String source , String quotes ) { } } | 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 ) + result . substring ( index + 2 ) ; index = result . indexOf ( quotes , index + 1 ) ; } return result ; |
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 .
* @ param resourceName The name of the SignalR resource .
* @ param keyType The keyType to regenerate . Must be either ' primary ' or ' secondary ' ( case - insensitive ) . Possible values include : ' Primary ' , ' Secondary '
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ throws CloudException thrown if the request is rejected by server
* @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
* @ return the SignalRKeysInner object if successful . */
public SignalRKeysInner beginRegenerateKey ( String resourceGroupName , String resourceName , KeyType keyType ) { } } | 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 = "" ; if ( inst != instance ) prefix = "ANCESTOR_" + inst . getComponent ( ) . getName ( ) + "_" ; Map < String , String > exports = InstanceHelpers . findAllExportedVariables ( inst ) ; for ( Entry < String , String > entry : exports . entrySet ( ) ) { // FIXME : removing the prefix may result in inconsistencies when a facet
// and a component export variables with the same " local name " .
// And this has nothing to do with ancestors . This is about inheritance .
String vname = prefix + VariableHelpers . parseVariableName ( entry . getKey ( ) ) . getValue ( ) ; vname = vname . replaceAll ( "(-|%s)+" , "_" ) ; exportedVars . put ( vname , entry . getValue ( ) ) ; } } return exportedVars ; |
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 ( ) , COMPARISONVALUE_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
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 createInjector ( Module ... modules ) { } } | 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 ) ) { detachPlot ( oldplot ) ; attachPlot ( newplot ) ; } } } ; latest . set ( detach ) ; um . getUpdateRunnableQueue ( ) . preemptLater ( detach ) ; return ; } } } else { if ( oldplot != null ) { LoggingUtil . warning ( "No update manager, but a previous plot exists. Incorrectly initialized?" ) ; } } detachPlot ( oldplot ) ; attachPlot ( newplot ) ; |
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 not valid */
public int getLineOffset ( int line ) { } } | 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 . values ( ) , ", " ) ) ; return ; } if ( isMergeInProgress ( ) ) { log . trace ( "%s: merge is already running (merge_id=%s)" , gms . local_addr , merge_id ) ; return ; } Address merge_leader = determineMergeLeader ( views ) ; if ( merge_leader == null ) return ; if ( merge_leader . equals ( gms . local_addr ) ) { log . debug ( "%s: I will be the merge leader. Starting the merge task. Views: %s" , gms . local_addr , views ) ; merge_task . start ( views ) ; } else log . trace ( "%s: I'm not the merge leader, waiting for merge leader (%s) to start merge" , gms . local_addr , merge_leader ) ; |
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 .
* @ return */
public IPv6Address toLinkLocalIPv6 ( ) { } } | 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 . getAllFileConfigList ( false , false , false , null ) . isEmpty ( ) ) ; } ) . useForm ( SearchForm . class , setup -> { setup . setup ( form -> { copyBeanToBean ( fileAuthenticationPager , form , op -> op . include ( "id" ) ) ; } ) ; } ) ; |
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 function which is called for each detected
* pattern sequence .
* @ param < R > Type of the resulting elements
* @ param outTypeInfo Explicit specification of output type .
* @ return { @ link DataStream } which contains the resulting elements from the pattern select
* function . */
public < R > SingleOutputStreamOperator < R > select ( final PatternSelectFunction < T , R > patternSelectFunction , final TypeInformation < R > outTypeInfo ) { } } | 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 does not contain the search
* string . If the search string is empty , the input string is returned
* unmodified . */
@ Nullable public static String getFromLastIncl ( @ Nullable final String sStr , @ Nullable final String sSearch ) { } } | 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 arguments .
* @ return list of result elements , possible empty . */
EList evaluateXPathNodeList ( Node contextNode , String expression , Object ... args ) { } } | 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 parameters supplied to the Update operation .
* @ param serviceCallback the async ServiceCallback to handle successful and failed responses .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the { @ link ServiceFuture } object */
public ServiceFuture < DatabaseInner > beginUpdateAsync ( String resourceGroupName , String clusterName , String databaseName , DatabaseUpdate parameters , final ServiceCallback < DatabaseInner > serviceCallback ) { } } | 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 args args
* @ return a formatted string */
public static String format ( String uriTemplate , Object ... args ) { } } | 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_NODE : { if ( xmlMapEntry == null ) { value = new XmlNodeArray ( node . getChildren ( ) ) ; } else { XmlMapFacet valueFacet = xmlMapEntry . getValue ( ) ; switch ( valueFacet . getType ( ) ) { case ELEMENT : value = keyName ; break ; case CONTENT : { List < XmlNode > nodeList = node . getChildren ( ) ; if ( nodeList . size ( ) > 0 ) { value = new XmlNodeArray ( nodeList ) ; } } break ; case ATTRIBUTE : { Map < String , XmlNode > attributes = node . getAttributes ( ) ; XmlNode attribute = attributes . get ( valueFacet . getName ( ) ) ; if ( attribute != null ) { value = attribute . getValue ( ) ; } else { } } break ; default : throw new IllegalStateException ( ) ; } XmlMapFacet keyFacet = xmlMapEntry . getKey ( ) ; switch ( keyFacet . getType ( ) ) { case ELEMENT : // keyName is already set
break ; case CONTENT : { List < XmlNode > nodeList = node . getChildren ( ) ; if ( nodeList . size ( ) > 0 ) { keyName = getStringValue ( ( XmlNode ) nodeList . get ( 0 ) ) ; } else { keyName = null ; } } break ; case ATTRIBUTE : { Map < String , XmlNode > attributes = node . getAttributes ( ) ; XmlNode attribute = attributes . get ( keyFacet . getName ( ) ) ; if ( attribute != null ) { keyName = attribute . getValue ( ) ; } else { keyName = null ; } break ; } default : throw new IllegalStateException ( ) ; } } } } if ( keyName == null ) { return null ; } else { final Object _key = keyName ; final Object _value = value ; return new Map . Entry ( ) { @ Override public Object getKey ( ) { return _key ; } @ Override public Object getValue ( ) { return _value ; } @ Override public Object setValue ( Object object ) { return null ; } } ; } |
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 JedisClientPool ( factory , poolConfig ) ; redisClientPool . init ( ) ; return redisClientPool ; |
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 . Each
* tag is a key - value pair .
* @ return Returns a reference to this object so that method calls can be chained together . */
public StartBackupJobRequest withRecoveryPointTags ( java . util . Map < String , String > recoveryPointTags ) { } } | 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 ) ; Preconditions . checkNotNull ( entry ) ; Preconditions . checkState ( entry . clientCount == 0 ) ; // optimization : instead of cloning and then closing the original reference ,
// we just do a move
clientRef = entry . valueRef ; removed = true ; } } if ( removed ) { maybeNotifyExclusiveEntryRemoval ( oldExclusive ) ; } return clientRef ; |
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 comment for findbug avoidance
// System . out . println ( " buf : " + i + " pos : " + ( buf . position ( ) - 1 ) + " - - > 0x " + Integer . toHexString ( b & 0xff ) ) ;
j ++ ; } buf . position ( oldPos ) ; } } |
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 . eisType : this . eisType ; List < XsdString > newRequiredWorkContexts = MergeUtil . mergeList ( this . requiredWorkContexts , input . requiredWorkContexts ) ; XsdString newModuleName = this . moduleName == null ? input . moduleName : this . moduleName ; List < Icon > newIcons = MergeUtil . mergeList ( this . icon , input . icon ) ; boolean newMetadataComplete = this . metadataComplete || input . metadataComplete ; LicenseType newLicense = this . license == null ? input . license : this . license . merge ( input . license ) ; List < LocalizedXsdString > newDescriptions = MergeUtil . mergeList ( this . description , input . description ) ; List < LocalizedXsdString > newDisplayNames = MergeUtil . mergeList ( this . displayName , input . displayName ) ; XsdString newVendorName = XsdString . isNull ( this . vendorName ) ? input . vendorName : this . vendorName ; ; ResourceAdapter newResourceadapter = this . resourceadapter == null ? ( ResourceAdapter ) input . resourceadapter : ( ( ResourceAdapter ) this . resourceadapter ) . merge ( ( ResourceAdapter ) input . resourceadapter ) ; return new ConnectorImpl ( version , newModuleName , newVendorName , newEisType , newResourceadapterVersion , newLicense , newResourceadapter , newRequiredWorkContexts , newMetadataComplete , newDescriptions , newDisplayNames , newIcons , null ) ; } return this ; |
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 pool once created
* @ return A transport pool for the given host */
private TransportPool getOrCreateTransportPool ( String hostInfo , Settings settings , SecureSettings secureSettings ) { } } | 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 TransportPool for job [" + jobKey + "] for host [" + hostInfo + "]" ) ; } } return pool ; |
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 searched
* @ return a method annotated by the annotation given . The method occurs
* only once in the class and matched the requirements of
* perfidix - reflective - invocation .
* @ throws PerfidixMethodCheckException
* if these integrity checks fail */
public static Method findAndCheckAnyMethodByAnnotation ( final Class < ? > clazz , final Class < ? extends Annotation > anno ) throws PerfidixMethodCheckException { } } | // 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 , throwing
// IllegalAccessException otherwise .
if ( anyMethod == null ) { // Check if method is valid ( no param , no returnval ,
// etc . ) , throwing IllegalAccessException otherwise .
if ( isReflectedExecutable ( meth , anno ) ) { anyMethod = meth ; } else { throw new PerfidixMethodCheckException ( new IllegalAccessException ( anno . toString ( ) + "-annotated method " + meth + " is not executable." ) , meth , anno ) ; } } else { throw new PerfidixMethodCheckException ( new IllegalAccessException ( "Please use only one " + anno . toString ( ) + "-annotation in one class." ) , meth , anno ) ; } } } return anyMethod ; |
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 ( ) ;
* / / Serve both HTTP and HTTPS at port 8080.
* sb . port ( new InetSocketAddress ( 8080 ) ,
* SessionProtocol . HTTP ,
* SessionProtocol . HTTPS ) ;
* / / Enable HTTPS with PROXY protocol support at port 8443.
* sb . port ( new InetSocketAddress ( 8443 ) ,
* SessionProtocol . PROXY ,
* SessionProtocol . HTTPS ) ;
* } < / pre > */
public ServerBuilder port ( InetSocketAddress localAddress , SessionProtocol ... protocols ) { } } | 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 ExecutionInput object based on calling build on that builder */
public ExecutionInput transform ( Consumer < Builder > builderConsumer ) { } } | 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 ) ; return builder . build ( ) ; |
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 , not null */
protected JComponent createSelector ( String fieldName , Constraint filter ) { } } | 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
* subunit clustering parameters
* @ return GLOBAL quaternary structure symmetry results */
public static QuatSymmetryResults calcGlobalSymmetry ( Structure structure , QuatSymmetryParameters symmParams , SubunitClustererParameters 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 > ( defined . size ( ) ) ; for ( String var : defined ) { pairs . add ( var + '=' + ctx . getVariable ( var ) ) ; } Collections . sort ( pairs ) ; for ( String pair : pairs ) { ctx . printLine ( pair ) ; } return ; } for ( String arg : vars ) { arg = ArgumentWithValue . resolveValue ( arg ) ; if ( arg . charAt ( 0 ) == '$' ) { arg = arg . substring ( 1 ) ; if ( arg . isEmpty ( ) ) { throw new CommandFormatException ( "Variable name is missing after '$'" ) ; } } final int equals = arg . indexOf ( '=' ) ; if ( equals < 1 ) { throw new CommandFormatException ( "'=' is missing for variable '" + arg + "'" ) ; } final String name = arg . substring ( 0 , equals ) ; if ( name . isEmpty ( ) ) { throw new CommandFormatException ( "The name is missing in '" + arg + "'" ) ; } if ( equals == arg . length ( ) - 1 ) { ctx . setVariable ( name , null ) ; } else { String value = arg . substring ( equals + 1 ) ; if ( value . length ( ) > 2 && value . charAt ( 0 ) == '`' && value . charAt ( value . length ( ) - 1 ) == '`' ) { value = Util . getResult ( ctx , value . substring ( 1 , value . length ( ) - 1 ) ) ; } ctx . setVariable ( name , value ) ; } } |
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 ) ; root . appendChild ( structure ) ; String id = structure . getAttribute ( "ID" ) ; if ( id != null && ! id . equals ( "" ) ) { structure . setIdAttribute ( "ID" , true ) ; } createLayout ( layoutStructure , doc , structure , ls . getChildId ( ) ) ; structId = ls . getNextId ( ) ; } |
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 ( ) ; } validationHandler . validate ( value , allValues , this , variableScope ) ; } // update variable ( s )
TypedValue modelValue = null ; if ( submittedValue != null ) { if ( type != null ) { modelValue = type . convertToModelValue ( submittedValue ) ; } else { modelValue = submittedValue ; } } else if ( defaultValueExpression != null ) { final TypedValue expressionValue = Variables . untypedValue ( defaultValueExpression . getValue ( variableScope ) ) ; if ( type != null ) { // first , need to convert to model value since the default value may be a String Constant specified in the model xml .
modelValue = type . convertToModelValue ( Variables . untypedValue ( expressionValue ) ) ; } else if ( expressionValue != null ) { modelValue = Variables . stringValue ( expressionValue . getValue ( ) . toString ( ) ) ; } } if ( modelValue != null ) { if ( id != null ) { variableScope . setVariable ( id , modelValue ) ; } } |
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 statistics ) { } } | 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 duration in
* the ISO UTC chronology can be converted .
* < ul >
* < li > One week consists of 7 days .
* < li > One day consists of 24 hours .
* < li > One hour consists of 60 minutes .
* < li > One minute consists of 60 seconds .
* < li > One second consists of 1000 milliseconds .
* < / ul >
* Months and Years are imprecise and periods containing these values cannot be converted .
* @ param period the period to get the number of minutes from , null returns zero
* @ return the period in minutes
* @ throws IllegalArgumentException if the period contains imprecise duration values */
public static Minutes standardMinutesIn ( ReadablePeriod period ) { } } | 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 color = ' red ' style = " font - size : 18px ; color : red " > < i > The number argument is the one to which this function is appended , < / i > < / div >
* < div color = ' red ' style = " font - size : 18px ; color : red " > < i > in accordance to a post - fix notation . < / i > < / div >
* < div color = ' red ' style = " font - size : 18px ; color : red " > < i > e . g . < b > n . numberProperty ( " number " ) . math ( ) . round ( ) < / b > < / i > < / div >
* < br / > */
public JcNumber round ( ) { } } | 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 */
public GeometryExpression < Geometry > convexHull ( ) { } } | 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 thrown if parameters fail the validation
* @ throws APIErrorException thrown if the request is rejected by server
* @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent */
public void delete ( String personGroupId , UUID personId ) { } } | 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 . XMLGregorianCalendar , java . util . Collection ) */
public WasInvalidatedBy newWasInvalidatedBy ( QualifiedName id , QualifiedName entity , QualifiedName activity , XMLGregorianCalendar time , Collection < Attribute > attributes ) { } } | 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 attached to the enclosing method , or the first
constructor in the class , or in the enclosing class symbol or in the field whose
initializer is the lambda . In any event , gather up the annotations that belong to the
lambda and attach it to the implementation method . */
Symbol owner = localContext . owner ; apportionTypeAnnotations ( tree , owner :: getRawTypeAttributes , owner :: setTypeAttributes , sym :: setTypeAttributes ) ; boolean init ; if ( ( init = ( owner . name == names . init ) ) || owner . name == names . clinit ) { owner = owner . owner ; apportionTypeAnnotations ( tree , init ? owner :: getInitTypeAttributes : owner :: getClassInitTypeAttributes , init ? owner :: setInitTypeAttributes : owner :: setClassInitTypeAttributes , sym :: appendUniqueTypeAttributes ) ; } if ( localContext . self != null && localContext . self . getKind ( ) == ElementKind . FIELD ) { owner = localContext . self ; apportionTypeAnnotations ( tree , owner :: getRawTypeAttributes , owner :: setTypeAttributes , sym :: appendUniqueTypeAttributes ) ; } } // create the method declaration hoisting the lambda body
JCMethodDecl lambdaDecl = make . MethodDef ( make . Modifiers ( sym . flags_field ) , sym . name , make . QualIdent ( lambdaType . getReturnType ( ) . tsym ) , List . nil ( ) , localContext . syntheticParams , lambdaType . getThrownTypes ( ) == null ? List . nil ( ) : make . Types ( lambdaType . getThrownTypes ( ) ) , null , null ) ; lambdaDecl . sym = sym ; lambdaDecl . type = lambdaType ; // translate lambda body
// As the lambda body is translated , all references to lambda locals ,
// captured variables , enclosing members are adjusted accordingly
// to refer to the static method parameters ( rather than i . e . acessing to
// captured members directly ) .
lambdaDecl . body = translate ( makeLambdaBody ( tree , lambdaDecl ) ) ; // Add the method to the list of methods to be added to this class .
kInfo . addMethod ( lambdaDecl ) ; // now that we have generated a method for the lambda expression ,
// we can translate the lambda into a method reference pointing to the newly
// created method .
// Note that we need to adjust the method handle so that it will match the
// signature of the SAM descriptor - this means that the method reference
// should be added the following synthetic arguments :
// * the " this " argument if it is an instance method
// * enclosing locals captured by the lambda expression
ListBuffer < JCExpression > syntheticInits = new ListBuffer < > ( ) ; if ( localContext . methodReferenceReceiver != null ) { syntheticInits . append ( localContext . methodReferenceReceiver ) ; } else if ( ! sym . isStatic ( ) ) { syntheticInits . append ( makeThis ( sym . owner . enclClass ( ) . asType ( ) , localContext . owner . enclClass ( ) ) ) ; } // add captured locals
for ( Symbol fv : localContext . getSymbolMap ( CAPTURED_VAR ) . keySet ( ) ) { if ( fv != localContext . self ) { JCTree captured_local = make . Ident ( fv ) . setType ( fv . type ) ; syntheticInits . append ( ( JCExpression ) captured_local ) ; } } // add captured outer this instances ( used only when ` this ' capture itself is illegal )
for ( Symbol fv : localContext . getSymbolMap ( CAPTURED_OUTER_THIS ) . keySet ( ) ) { JCTree captured_local = make . QualThis ( fv . type ) ; syntheticInits . append ( ( JCExpression ) captured_local ) ; } // then , determine the arguments to the indy call
List < JCExpression > indy_args = translate ( syntheticInits . toList ( ) , localContext . prev ) ; // build a sam instance using an indy call to the meta - factory
int refKind = referenceKind ( sym ) ; // convert to an invokedynamic call
result = makeMetafactoryIndyCall ( context , refKind , sym , indy_args ) ; |
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 dimension wrt the ordering of the array */
public static int getLd ( INDArray arr ) { } } | // 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 namespaceURI , final String localName , final String name ) throws org . xml . sax . SAXException { } } | // 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 ElemDesc elemDesc = elemContext . m_elementDesc ; final int elemFlags = elemDesc . getFlags ( ) ; final boolean elemEmpty = ( elemFlags & ElemDesc . EMPTY ) != 0 ; // deal with any indentation issues
if ( m_doIndent ) { final boolean isBlockElement = ( elemFlags & ElemDesc . BLOCK ) != 0 ; boolean shouldIndent = false ; if ( m_ispreserve ) { m_ispreserve = false ; } else if ( m_doIndent && ( ! m_inBlockElem || isBlockElement ) ) { m_startNewLine = true ; shouldIndent = true ; } if ( ! elemContext . m_startTagOpen && shouldIndent ) indent ( elemContext . m_currentElemDepth - 1 ) ; m_inBlockElem = ! isBlockElement ; } final java . io . Writer writer = m_writer ; if ( ! elemContext . m_startTagOpen ) { writer . write ( "</" ) ; writer . write ( name ) ; writer . write ( '>' ) ; } else { // the start - tag open when this method was called ,
// so we need to process it now .
if ( m_tracer != null ) super . fireStartElem ( name ) ; // the starting tag was still open when we received this endElement ( ) call
// so we need to process any gathered attributes NOW , before they go away .
int nAttrs = m_attributes . getLength ( ) ; if ( nAttrs > 0 ) { processAttributes ( m_writer , nAttrs ) ; // clear attributes object for re - use with next element
m_attributes . clear ( ) ; } if ( ! elemEmpty ) { // As per Dave / Paul recommendation 12/06/2000
// if ( shouldIndent )
// writer . write ( ' > ' ) ;
// indent ( m _ currentIndent ) ;
writer . write ( "></" ) ; writer . write ( name ) ; writer . write ( '>' ) ; } else { writer . write ( '>' ) ; } } // clean up because the element has ended
if ( ( elemFlags & ElemDesc . WHITESPACESENSITIVE ) != 0 ) m_ispreserve = true ; m_isprevtext = false ; // fire off the end element event
if ( m_tracer != null ) super . fireEndElem ( name ) ; // OPTIMIZE - EMPTY
if ( elemEmpty ) { // a quick exit if the HTML element had no children .
// This block of code can be removed if the corresponding block of code
// in startElement ( ) also labeled with " OPTIMIZE - EMPTY " is also removed
m_elemContext = elemContext . m_prev ; return ; } // some more clean because the element has ended .
if ( ! elemContext . m_startTagOpen ) { if ( m_doIndent && ! m_preserves . isEmpty ( ) ) m_preserves . pop ( ) ; } m_elemContext = elemContext . m_prev ; // m _ isRawStack . pop ( ) ;
} catch ( IOException e ) { throw new SAXException ( e ) ; } |
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 . getMessage ( ) , 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 the corresponding value contains
* the { @ link PermissionCollection } for the passed user on the entity .
* @ param user
* @ return */
@ SuppressWarnings ( { } } | "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 is hard ( or even impossible in this scenario ) to create a
// restriction that filters for permissions of the given user only .
// using HQL here is no option as the PersistentObject is
// a MappedSuperclass ( without table ) .
// another efficient way would be a SQL query , but then the SQL
// would be written in an explicit SQL dialect . . .
criteria . createAlias ( "userPermissions" , "up" ) ; criteria . setResultTransformer ( Criteria . DISTINCT_ROOT_ENTITY ) ; List < PersistentObject > entitiesWithPermissions = criteria . list ( ) ; Map < PersistentObject , PermissionCollection > userPermissions = new HashMap < PersistentObject , PermissionCollection > ( ) ; // TODO find a better way than iterating over all entities of the system
// that have at least one permission ( for any user ) ( see comment above )
for ( PersistentObject entity : entitiesWithPermissions ) { Map < User , PermissionCollection > entityUserPermissions = entity . getUserPermissions ( ) ; if ( entityUserPermissions . containsKey ( user ) ) { userPermissions . put ( entity , entityUserPermissions . get ( user ) ) ; } } return userPermissions ; |
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 ) . putTask ( UDP . udp . ackack . ordinal ( ) , tnum ) ; |
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 . peerFSM . createState ( AsState . INACTIVE . toString ( ) ) . setOnEnter ( new SEHPeerAsStateEnterInactive ( this ) ) ; this . peerFSM . createState ( AsState . PENDING . toString ( ) ) . setOnTimeOut ( new AsStatePenTimeout ( this , this . peerFSM ) , 2000 ) . setOnEnter ( new SEHPeerAsStateEnterPen ( this , this . peerFSM ) ) ; this . peerFSM . setStart ( AsState . DOWN . toString ( ) ) ; this . peerFSM . setEnd ( AsState . DOWN . toString ( ) ) ; // Define Transitions
// STATE DOWN /
this . peerFSM . createTransition ( TransitionState . AS_STATE_CHANGE_INACTIVE , AsState . DOWN . toString ( ) , AsState . INACTIVE . toString ( ) ) ; this . peerFSM . createTransition ( TransitionState . ASP_DOWN , AsState . DOWN . toString ( ) , AsState . DOWN . toString ( ) ) ; this . peerFSM . createTransition ( TransitionState . AS_STATE_CHANGE_ACTIVE , AsState . DOWN . toString ( ) , AsState . ACTIVE . toString ( ) ) . setHandler ( new THPeerAsInActToAct ( this , this . peerFSM ) ) ; // STATE INACTIVE /
this . peerFSM . createTransition ( TransitionState . AS_STATE_CHANGE_INACTIVE , AsState . INACTIVE . toString ( ) , AsState . INACTIVE . toString ( ) ) ; this . peerFSM . createTransition ( TransitionState . AS_STATE_CHANGE_ACTIVE , AsState . INACTIVE . toString ( ) , AsState . ACTIVE . toString ( ) ) . setHandler ( new THPeerAsInActToAct ( this , this . peerFSM ) ) ; this . peerFSM . createTransition ( TransitionState . ASP_DOWN , AsState . INACTIVE . toString ( ) , AsState . DOWN . toString ( ) ) . setHandler ( new THPeerAsInActToDwn ( this , this . peerFSM ) ) ; // STATE ACTIVE /
this . peerFSM . createTransition ( TransitionState . AS_STATE_CHANGE_ACTIVE , AsState . ACTIVE . toString ( ) , AsState . ACTIVE . toString ( ) ) ; this . peerFSM . createTransition ( TransitionState . OTHER_ALTERNATE_ASP_ACTIVE , AsState . ACTIVE . toString ( ) , AsState . ACTIVE . toString ( ) ) . setHandler ( new THPeerAsActToActNtfyAltAspAct ( this , this . peerFSM ) ) ; this . peerFSM . createTransition ( TransitionState . OTHER_INSUFFICIENT_ASP , AsState . ACTIVE . toString ( ) , AsState . ACTIVE . toString ( ) ) . setHandler ( new THPeerAsActToActNtfyInsAsp ( this , this . peerFSM ) ) ; this . peerFSM . createTransition ( TransitionState . AS_STATE_CHANGE_PENDING , AsState . ACTIVE . toString ( ) , AsState . PENDING . toString ( ) ) ; this . peerFSM . createTransition ( TransitionState . ASP_DOWN , AsState . ACTIVE . toString ( ) , AsState . PENDING . toString ( ) ) . setHandler ( new THPeerAsActToPen ( this , this . peerFSM ) ) ; // STATE PENDING /
// As transitions to DOWN from PENDING when Pending Timer timesout
this . peerFSM . createTransition ( TransitionState . AS_DOWN , AsState . PENDING . toString ( ) , AsState . DOWN . toString ( ) ) ; // As transitions to INACTIVE from PENDING when Pending Timer
// timesout
this . peerFSM . createTransition ( TransitionState . AS_INACTIVE , AsState . PENDING . toString ( ) , AsState . INACTIVE . toString ( ) ) ; // If in PENDING and one of the ASP is ACTIVE again
this . peerFSM . createTransition ( TransitionState . AS_STATE_CHANGE_ACTIVE , AsState . PENDING . toString ( ) , AsState . ACTIVE . toString ( ) ) . setHandler ( new THPeerAsPendToAct ( this , this . peerFSM ) ) ; // If As is PENDING and far end sends INACTIVE we still remain
// PENDING as that message from pending queue can be sent once As
// becomes ACTIVE before T ( r ) expires
this . peerFSM . createTransition ( TransitionState . AS_STATE_CHANGE_INACTIVE , AsState . PENDING . toString ( ) , AsState . INACTIVE . toString ( ) ) . setHandler ( new THNoTrans ( ) ) ; this . peerFSM . createTransition ( TransitionState . ASP_DOWN , AsState . PENDING . toString ( ) , AsState . PENDING . toString ( ) ) . setHandler ( new THNoTrans ( ) ) ; |
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 component lifecycle callbacks
* ( like { @ code onStart } / { @ code onStop } in { @ code Activity } or { @ code onCreate } / { @ code onDestory } in { @ code Service } ) .
* The worker service ( { @ code GoroService } ) normally stops when all { @ code BoundGoro } instances unbind
* and all the pending tasks in { @ code Goro } queues are handled .
* But it can also be stopped by the system server ( due to a user action in Settings app or application update ) .
* In this case { @ code BoundGoro } created with this method will notify the supplied handler about the event .
* @ param context context that will bind to the service
* @ param handler callback to invoke if worker service is unexpectedly stopped by the system server
* @ return Goro implementation that binds to { @ link GoroService } . */
public static BoundGoro bindWith ( final Context context , final BoundGoro . OnUnexpectedDisconnection handler ) { } } | 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.