signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class JcrManagedConnection { /** * Adds a connection event listener to the ManagedConnection instance . * @ param listener A new ConnectionEventListener to be registered */ @ Override public void addConnectionEventListener ( ConnectionEventListener listener ) { } }
if ( listener == null ) { throw new IllegalArgumentException ( "Listener is null" ) ; } listeners . add ( listener ) ;
public class ImageFormatList { /** * This method moves the given image format < code > format < / code > * in the first position of the vector . * @ param v the vector if image format * @ param format the index of the format to be moved in first position */ private void moveToFirstIfNative ( List < ImageFormat > ...
for ( ImageFormat i : v ) if ( ( i . getIndex ( ) == format ) && ( formats . contains ( i ) ) ) { v . remove ( i ) ; v . add ( 0 , i ) ; break ; }
public class LdapAdapter { /** * Update the Group member * @ param oldDN * @ param newDN * @ throws WIMException */ private void updateGroupMember ( String oldDN , String newDN ) throws WIMException { } }
if ( ! iLdapConfigMgr . updateGroupMembership ( ) ) { return ; } String filter = iLdapConfigMgr . getGroupMemberFilter ( oldDN ) ; String [ ] mbrAttrs = iLdapConfigMgr . getMemberAttributes ( ) ; Map < String , ModificationItem [ ] > mbrAttrMap = new HashMap < String , ModificationItem [ ] > ( mbrAttrs . length ) ; for...
public class SoundGroup { /** * Disposes this sound group , freeing up the OpenAL sources with which it is associated . All * sounds obtained from this group will no longer be usable and should be discarded . */ public void dispose ( ) { } }
reclaimAll ( ) ; for ( PooledSource pooled : _sources ) { pooled . source . delete ( ) ; } _sources . clear ( ) ; // remove from the manager _manager . removeGroup ( this ) ;
public class MatchSpaceImpl { /** * Initialise a newly created MatchSpace * @ param rootId * @ param enableCache */ public void initialise ( Identifier rootId , boolean enableCache ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) tc . entry ( cclass , "initialise" , new Object [ ] { rootId , new Boolean ( enableCache ) } ) ; switch ( rootId . getType ( ) ) { case Selector . UNKNOWN : case Selector . OBJECT : matchTree = new EqualityMatcher ( rootId ) ; break ; case Selec...
public class ContextTrampoline { /** * Sets the concrete strategy for accessing and manipulating the context . * < p > NB : The agent is responsible for setting the context strategy once before any other method * of this class is called . * @ param contextStrategy the concrete strategy for accessing and manipulat...
if ( ContextTrampoline . contextStrategy != null ) { throw new IllegalStateException ( "contextStrategy was already set" ) ; } if ( contextStrategy == null ) { throw new NullPointerException ( "contextStrategy" ) ; } ContextTrampoline . contextStrategy = contextStrategy ;
public class GeoPackageJavaProperties { /** * Get a color by key * @ param key * key * @ param required * required flag * @ return property value */ public static Color getColorProperty ( String key , boolean required ) { } }
Color value = null ; String redProperty = key + JavaPropertyConstants . PROPERTY_DIVIDER + JavaPropertyConstants . COLOR_RED ; String greenProperty = key + JavaPropertyConstants . PROPERTY_DIVIDER + JavaPropertyConstants . COLOR_GREEN ; String blueProperty = key + JavaPropertyConstants . PROPERTY_DIVIDER + JavaProperty...
public class ReloadingPropertyPlaceholderConfigurer { /** * 对于被标记为动态的 , 进行 构造 property dependency * 非动态的 , 则由原来的spring进行处理 * @ param strVal * @ param props * @ param visitedPlaceholders * @ return * @ throws BeanDefinitionStoreException */ protected String parseStringValue ( String strVal , Properties props...
DynamicProperty dynamic = null ; // replace reloading prefix and suffix by " normal " prefix and suffix . // remember all the " dynamic " placeholders encountered . StringBuffer buf = new StringBuffer ( strVal ) ; int startIndex = strVal . indexOf ( this . placeholderPrefix ) ; while ( startIndex != - 1 ) { int endInde...
public class DRL5Lexer { /** * $ ANTLR start " AMPER " */ public final void mAMPER ( ) throws RecognitionException { } }
try { int _type = AMPER ; int _channel = DEFAULT_TOKEN_CHANNEL ; // src / main / resources / org / drools / compiler / lang / DRL5Lexer . g : 295:5 : ( ' & ' ) // src / main / resources / org / drools / compiler / lang / DRL5Lexer . g : 295:7 : ' & ' { match ( '&' ) ; if ( state . failed ) return ; } state . type = _ty...
public class DescribeImagesRequest { /** * Scopes the images by users with explicit launch permissions . Specify an AWS account ID , < code > self < / code > ( the * sender of the request ) , or < code > all < / code > ( public AMIs ) . * < b > NOTE : < / b > This method appends the values to the existing list ( if...
if ( this . executableUsers == null ) { setExecutableUsers ( new com . amazonaws . internal . SdkInternalList < String > ( executableUsers . length ) ) ; } for ( String ele : executableUsers ) { this . executableUsers . add ( ele ) ; } return this ;
public class GlobalServiceElector { /** * Add a service to be notified if this node becomes the global leader */ synchronized void registerService ( Promotable service ) { } }
m_services . add ( service ) ; if ( m_isLeader ) { try { service . acceptPromotion ( ) ; } catch ( Exception e ) { VoltDB . crashLocalVoltDB ( "Unable to promote global service." , true , e ) ; } }
public class SdkThreadLocalsRegistry { /** * Registers { @ link ThreadLocal } objects in use by the AWS SDK so that their values can * be removed via the { @ link # remove ( ) } method . * < p > To avoid memory leaks and reduce contention this method should only be called when * setting static final locations ( f...
threadLocals . add ( threadLocal ) ; return threadLocal ;
public class XmlRequestMatcher { /** * Whitespace will be kept by DOM parser . */ private void trimNode ( final Node node ) { } }
NodeList children = node . getChildNodes ( ) ; for ( int i = children . getLength ( ) - 1 ; i >= 0 ; i -- ) { trimChild ( node , children . item ( i ) ) ; }
public class Schema { /** * TODO : detect and complain about malformed JSON */ private static String [ ] splitArgs ( String argStr ) { } }
StringBuilder sb = new StringBuilder ( argStr ) ; StringBuilder arg = new StringBuilder ( ) ; List < String > splitArgList = new ArrayList < String > ( ) ; boolean inDoubleQuotes = false ; boolean inSquareBrackets = false ; // for arrays of arrays for ( int i = 0 ; i < sb . length ( ) ; i ++ ) { if ( sb . charAt ( i ) ...
public class SessionBeanImpl { /** * Check that the scope type is allowed by the stereotypes on the bean and * the bean type */ protected void checkScopeAllowed ( ) { } }
if ( ejbDescriptor . isStateless ( ) && ! isDependent ( ) ) { throw BeanLogger . LOG . scopeNotAllowedOnStatelessSessionBean ( getScope ( ) , getType ( ) ) ; } if ( ejbDescriptor . isSingleton ( ) && ! ( isDependent ( ) || getScope ( ) . equals ( ApplicationScoped . class ) ) ) { throw BeanLogger . LOG . scopeNotAllowe...
public class Singles { /** * Block until a Quorum of results have returned as determined by the provided Predicate * < pre > * { @ code * Single < ListX < Integer > > strings = Singles . quorum ( status - > status . getCompleted ( ) > 0 , Single . deferred ( ( ) - > 1 ) , Single . empty ( ) , Single . empty ( ) )...
return Single . fromPublisher ( Futures . quorum ( breakout , futures ( fts ) ) ) ;
public class PathHelper { /** * Walks a file tree . * This method walks a file tree rooted at a given starting file . The file * tree traversal is < em > depth - first < / em > with the given { @ link FileVisitor } * invoked for each file encountered . File tree traversal completes when all * accessible files i...
try { return Files . walkFileTree ( aStart , aOptions , nMaxDepth , aVisitor ) ; } catch ( final IOException ex ) { throw new UncheckedIOException ( ex ) ; }
public class HornSchunck { /** * Computes average flow using an 8 - connect neighborhood for the image border */ protected static void borderAverageFlow ( ImageFlow flow , ImageFlow averageFlow ) { } }
for ( int y = 0 ; y < flow . height ; y ++ ) { computeBorder ( flow , averageFlow , 0 , y ) ; computeBorder ( flow , averageFlow , flow . width - 1 , y ) ; } for ( int x = 1 ; x < flow . width - 1 ; x ++ ) { computeBorder ( flow , averageFlow , x , 0 ) ; computeBorder ( flow , averageFlow , x , flow . height - 1 ) ; }
public class WWindow { /** * Set the WComponent that will handle the content for this pop up window . * @ param content the window content . */ public void setContent ( final WComponent content ) { } }
WindowModel model = getOrCreateComponentModel ( ) ; // If the previous content had been wrapped , then remove it from the wrapping WApplication . if ( model . wrappedContent != null && model . wrappedContent != model . content ) { model . wrappedContent . removeAll ( ) ; } model . content = content ; // Wrap content in...
public class Common { /** * Generate acker ' s input Map < GlobalStreamId , Grouping > * for spout < GlobalStreamId ( spoutId , ACKER _ INIT _ STREAM _ ID ) , . . . > for * bolt < GlobalStreamId ( boltId , ACKER _ ACK _ STREAM _ ID ) , . . . > < GlobalStreamId ( boltId , * ACKER _ FAIL _ STREAM _ ID ) , . . . > *...
Map < GlobalStreamId , Grouping > spout_inputs = new HashMap < > ( ) ; Map < String , SpoutSpec > spout_ids = topology . get_spouts ( ) ; for ( Entry < String , SpoutSpec > spout : spout_ids . entrySet ( ) ) { String id = spout . getKey ( ) ; GlobalStreamId stream = new GlobalStreamId ( id , ACKER_INIT_STREAM_ID ) ; Gr...
public class PlanetaryInteractionApi { /** * Get colony layout ( asynchronously ) Returns full details on the layout of * a single planetary colony , including links , pins and routes . Note : * Planetary information is only recalculated when the colony is viewed * through the client . Information will not update...
com . squareup . okhttp . Call call = getCharactersCharacterIdPlanetsPlanetIdValidateBeforeCall ( characterId , planetId , datasource , ifNoneMatch , token , callback ) ; Type localVarReturnType = new TypeToken < CharacterPlanetResponse > ( ) { } . getType ( ) ; apiClient . executeAsync ( call , localVarReturnType , ca...
public class Unchecked { /** * Wrap a { @ link CheckedLongToDoubleFunction } in a { @ link LongToDoubleFunction } with a custom handler for checked exceptions . * Example : * < code > < pre > * LongStream . of ( 1L , 2L , 3L ) . mapToInt ( Unchecked . longToDoubleFunction ( * if ( l & lt ; 0L ) * throw new Ex...
return t -> { try { return function . applyAsDouble ( t ) ; } catch ( Throwable e ) { handler . accept ( e ) ; throw new IllegalStateException ( "Exception handler must throw a RuntimeException" , e ) ; } } ;
public class NodeUtil { /** * Given the function , this returns the nth * argument or null if no such parameter exists . */ static Node getArgumentForFunction ( Node function , int index ) { } }
checkState ( function . isFunction ( ) ) ; return getNthSibling ( function . getSecondChild ( ) . getFirstChild ( ) , index ) ;
public class XExtensionParser { /** * Parses an extension from a definition file . * @ param file The definition file containing the extension . * @ return The extension object , as defined in the provided file . */ public XExtension parse ( File file ) throws IOException , ParserConfigurationException , SAXExcepti...
BufferedInputStream is = new BufferedInputStream ( new FileInputStream ( file ) ) ; // set up a specialized SAX2 handler to fill the container XExtensionHandler handler = new XExtensionHandler ( ) ; // set up SAX parser and parse provided log file into the container SAXParserFactory parserFactory = SAXParserFactory . n...
public class BaseBuffer { /** * { @ inheritDoc } */ @ Override public final Buffer readUntilSingleCRLF ( ) throws IOException { } }
final int start = getReaderIndex ( ) ; int found = 0 ; while ( found < 2 && hasReadableBytes ( ) ) { final byte b = readByte ( ) ; if ( found == 0 && b == CR ) { ++ found ; } else if ( found == 1 && b == LF ) { ++ found ; } else { found = 0 ; } } if ( found == 2 ) { return slice ( start , getReaderIndex ( ) - 2 ) ; } e...
public class CrawlToFile { /** * Get the options . * @ return the specific CrawlToCsv options */ @ Override protected Options getOptions ( ) { } }
final Options options = super . getOptions ( ) ; final Option filenameOption = new Option ( "f" , "the name of the output file, default name is " + DEFAULT_FILENAME + " [optional]" ) ; filenameOption . setArgName ( "FILENAME" ) ; filenameOption . setLongOpt ( "filename" ) ; filenameOption . setRequired ( false ) ; file...
public class ParameterizedJobMixIn { /** * Standard implementation of { @ link ParameterizedJob # doBuildWithParameters } . */ @ SuppressWarnings ( "deprecation" ) public final void doBuildWithParameters ( StaplerRequest req , StaplerResponse rsp , @ QueryParameter TimeDuration delay ) throws IOException , ServletExcep...
hudson . model . BuildAuthorizationToken . checkPermission ( asJob ( ) , asJob ( ) . getAuthToken ( ) , req , rsp ) ; ParametersDefinitionProperty pp = asJob ( ) . getProperty ( ParametersDefinitionProperty . class ) ; if ( ! asJob ( ) . isBuildable ( ) ) { throw HttpResponses . error ( SC_CONFLICT , new IOException ( ...
public class SerializingCopier { /** * Returns a copy of the passed in instance by serializing and deserializing it . */ @ Override public T copy ( final T obj ) { } }
try { return serializer . read ( serializer . serialize ( obj ) ) ; } catch ( ClassNotFoundException e ) { throw new SerializerException ( "Copying failed." , e ) ; }
public class EIIImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public Object eGet ( int featureID , boolean resolve , boolean coreType ) { } }
switch ( featureID ) { case AfplibPackage . EII__IMO_NAME : return getImoName ( ) ; } return super . eGet ( featureID , resolve , coreType ) ;
public class EventUtilities { /** * Marshall AttDataReady * @ param dataReady the DataReady object to marshall * @ return result of the marshall action * @ throws DevFailed */ static byte [ ] marshall ( final AttDataReady dataReady ) throws DevFailed { } }
XLOGGER . entry ( ) ; final CDROutputStream os = new CDROutputStream ( ) ; try { AttDataReadyHelper . write ( os , dataReady ) ; XLOGGER . exit ( ) ; return cppAlignment ( os . getBufferCopy ( ) ) ; } finally { os . close ( ) ; }
public class ApiOvhIpLoadbalancing { /** * Add a new TCP Farm on your IP Load Balancing * REST : POST / ipLoadbalancing / { serviceName } / tcp / farm * @ param balance [ required ] Load balancing algorithm . ' roundrobin ' if null * @ param zone [ required ] Zone of your farm * @ param stickiness [ required ] ...
String qPath = "/ipLoadbalancing/{serviceName}/tcp/farm" ; StringBuilder sb = path ( qPath , serviceName ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "balance" , balance ) ; addBody ( o , "displayName" , displayName ) ; addBody ( o , "port" , port ) ; addBody ( o , "probe" , p...
public class InspectionReport { /** * Adds description to log . */ public void logDescription ( String description ) throws IOException { } }
// The ThreadLocal has been initialized so we know that we are in multithreaded mode . if ( reportContext . get ( ) != null ) { reportContext . get ( ) . addComment ( description ) ; } else { writeMessage ( description ) ; }
public class BackupUploadServlet { /** * Gets uploaded file as stream . * @ param items * @ return the stream * @ throws IOException */ private InputStream getStream ( List < FileItem > items ) throws IOException { } }
for ( FileItem i : items ) { if ( ! i . isFormField ( ) && i . getFieldName ( ) . equals ( CONTENT_PARAMETER ) ) { return i . getInputStream ( ) ; } } return null ;
public class TokenCompleteTextView { /** * Remove an object from the token list . Will remove duplicates if present or do nothing if no * object is present in the view . Uses { @ link Object # equals ( Object ) } to find objects . May only * be called from the main thread * @ param object object to remove , may b...
// To make sure all the appropriate callbacks happen , we just want to piggyback on the // existing code that handles deleting spans when the text changes ArrayList < Editable > texts = new ArrayList < > ( ) ; // If there is hidden content , it ' s important that we update it first if ( hiddenContent != null ) { texts ...
public class Base64EncodedSignerImpl { /** * Signs a message . * @ param message the message to sign * @ return a base64 encoded version of the signature */ public String sign ( String message ) { } }
try { final byte [ ] signature = signer . sign ( message . getBytes ( charsetName ) ) ; return new String ( Base64 . encodeBase64 ( signature , false ) ) ; } catch ( UnsupportedEncodingException e ) { throw new SignatureException ( "unsupported encoding: charsetName=" + charsetName , e ) ; }
public class DeleteThingGroupRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DeleteThingGroupRequest deleteThingGroupRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( deleteThingGroupRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( deleteThingGroupRequest . getThingGroupName ( ) , THINGGROUPNAME_BINDING ) ; protocolMarshaller . marshall ( deleteThingGroupRequest . getExpectedVersion ( ) , E...
public class ViewRequestBuilder { /** * Create a new builder for a paginated request on the view . * Defaults to 20 rows per page if not specified by * { @ link PaginatedRequestBuilder # rowsPerPage ( int ) } * @ param keyType { @ link com . cloudant . client . api . views . Key . Type } of the key emitted by the...
return new PaginatedRequestBuilderImpl < K , V > ( newViewRequestParameters ( keyType . getType ( ) , valueType ) ) ;
public class ToStream { /** * A private helper method to output the * @ throws SAXException * @ throws IOException */ private void DTDprolog ( ) throws SAXException , IOException { } }
final java . io . Writer writer = m_writer ; if ( m_needToOutputDocTypeDecl ) { outputDocTypeDecl ( m_elemContext . m_elementName , false ) ; m_needToOutputDocTypeDecl = false ; } if ( m_inDoctype ) { writer . write ( " [" ) ; writer . write ( m_lineSep , 0 , m_lineSepLen ) ; m_inDoctype = false ; }
public class ConfigResourcesLoader { /** * Make sure the URL is correct and exists . used to support different * locations for a resources ( E . g . under WEB - INF or not etc . ) * @ param externalResource the resource to check it ' s validity . * @ return true if exists , false if not . */ private boolean valid...
boolean isValid = true ; try { URL url = externalResource . getURL ( ) ; if ( url . getPath ( ) != null && url . getPath ( ) . contains ( ".jar" ) && ! url . getPath ( ) . contains ( "dummyConfig" ) ) { throw new IllegalArgumentException ( "The customer config file: \"config.properties\" was found in a jar file. This i...
public class Equation { /** * Infer the type of and create a new output variable using the results from the right side of the equation . * If the type is already known just return that . */ private Variable createVariableInferred ( TokenList . Token t0 , Variable variableRight ) { } }
Variable result ; if ( t0 . getType ( ) == Type . WORD ) { switch ( variableRight . getType ( ) ) { case MATRIX : alias ( new DMatrixRMaj ( 1 , 1 ) , t0 . getWord ( ) ) ; break ; case SCALAR : if ( variableRight instanceof VariableInteger ) { alias ( 0 , t0 . getWord ( ) ) ; } else { alias ( 1.0 , t0 . getWord ( ) ) ; ...
public class CmsImportVersion2 { /** * Gets the encoding from the & lt ; ? XML . . . & gt ; tag if present . < p > * @ param content the file content * @ return String the found encoding */ protected String getEncoding ( String content ) { } }
String encoding = content ; int index = encoding . toLowerCase ( ) . indexOf ( "encoding=\"" ) ; // encoding attribute found , get the value if ( index != - 1 ) { encoding = encoding . substring ( index + 10 ) ; index = encoding . indexOf ( "\"" ) ; if ( index != - 1 ) { encoding = encoding . substring ( 0 , index ) ; ...
public class LongMomentStatistics { /** * Compares the state of two { @ code LongMomentStatistics } objects . This is * a replacement for the { @ link # equals ( Object ) } which is not advisable to * implement for this mutable object . If two object have the same state , it * has still the same state when update...
return this == other || _min == other . _min && _max == other . _max && _sum == other . _sum && super . sameState ( other ) ;
public class OnlineLDAsvi { /** * Returns the topic vector for a given topic . The vector should not be * altered , and is scaled so that the sum of all term weights sums to one . * @ param k the topic to get the vector for * @ return the raw topic vector for the requested topic . */ public Vec getTopicVec ( int ...
return new ScaledVector ( 1.0 / lambda . get ( k ) . sum ( ) , lambda . get ( k ) ) ;
public class InstanceAccessDetails { /** * Describes the public SSH host keys or the RDP certificate . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setHostKeys ( java . util . Collection ) } or { @ link # withHostKeys ( java . util . Collection ) } if you ...
if ( this . hostKeys == null ) { setHostKeys ( new java . util . ArrayList < HostKeyAttributes > ( hostKeys . length ) ) ; } for ( HostKeyAttributes ele : hostKeys ) { this . hostKeys . add ( ele ) ; } return this ;
public class ConnectionProperties { /** * Returns the end point previously assigned . This is only valid * when in hostname / port mode of operation - otherwise an illegal * argument exception will be thrown . * @ return EndPoint The end point . */ public ProviderEndPoint getEndPoint ( ) { } }
if ( mode != PropertiesType . HOST_PORT ) { throw new SIErrorException ( nls . getFormattedMessage ( "INVALID_METHOD_FOR_OBJECT_TYPE_SICO0006" , null , "INVALID_METHOD_FOR_OBJECT_TYPE_SICO0006" ) // D270373 ) ; } return endPoint ;
public class JpaBitLogStore { /** * / * ( non - Javadoc ) * @ see org . duracloud . mill . bitlog . BitLogStore # addReport ( java . lang . String , java . lang . String , java . lang . String , * java . lang . String , java . lang . String , org . duracloud . mill . bitlog . BitIntegrityResult , java . util . Date...
BitIntegrityReport report = new BitIntegrityReport ( ) ; report . setModified ( new Date ( ) ) ; report . setAccount ( account ) ; report . setStoreId ( storeId ) ; report . setSpaceId ( spaceId ) ; report . setReportSpaceId ( reportSpaceId ) ; report . setReportContentId ( reportContentId ) ; report . setCompletionDat...
public class FileInstrumentationData { /** * Store a node to be instrumented later for branch coverage . * @ param lineNumber 1 - based line number * @ param branchNumber 1 - based branch number * @ param block the node of the conditional block . */ void putBranchNode ( int lineNumber , int branchNumber , Node bl...
Preconditions . checkArgument ( lineNumber > 0 , "Expected non-zero positive integer as line number: %s" , lineNumber ) ; Preconditions . checkArgument ( branchNumber > 0 , "Expected non-zero positive integer as branch number: %s" , branchNumber ) ; branchNodes . put ( BranchIndexPair . of ( lineNumber - 1 , branchNumb...
public class PagePositionInformationImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public boolean eIsSet ( int featureID ) { } }
switch ( featureID ) { case AfplibPackage . PAGE_POSITION_INFORMATION__PGPRG : return PGPRG_EDEFAULT == null ? pgprg != null : ! PGPRG_EDEFAULT . equals ( pgprg ) ; } return super . eIsSet ( featureID ) ;
public class JmsRunnableFactory { /** * Creates a new { @ link QueueConsumer } . For every text message received , the callback * is invoked with the contents of the text message as string . */ public QueueConsumer createQueueTextMessageListener ( final String topic , final ConsumerCallback < String > messageCallback...
Preconditions . checkState ( connectionFactory != null , "connection factory was never injected!" ) ; return new QueueConsumer ( connectionFactory , jmsConfig , topic , new TextMessageConsumerCallback ( messageCallback ) ) ;
public class TimerView { /** * Start the timer running from the specified percentage complete , * to expire at the specified time . * @ param startPercent a value in [ 0f , 1f ) indicating how much * hourglass time has already elapsed when the timer starts . * @ param duration The time interval over which the t...
// Sanity check input arguments if ( startPercent < 0.0f || startPercent >= 1.0f ) { throw new IllegalArgumentException ( "Invalid starting percent " + startPercent ) ; } if ( duration < 0 ) { throw new IllegalArgumentException ( "Invalid duration " + duration ) ; } // Stop any current processing stop ( ) ; // Record t...
public class ChainingAWSCredentialsProvider { /** * Gets instance . * @ param credentialAccessKey the credential access key * @ param credentialSecretKey the credential secret key * @ param credentialPropertiesFile the credential properties file * @ return the instance */ public static AWSCredentialsProvider ge...
return getInstance ( credentialAccessKey , credentialSecretKey , credentialPropertiesFile , null , null ) ;
public class PairSet { /** * { @ inheritDoc } */ @ Override public PairSet < T , I > intersection ( Collection < ? extends Pair < T , I > > c ) { } }
return c == null ? empty ( ) : createFromIndices ( matrix . intersection ( convert ( c ) . matrix ) ) ;
public class LastaPrepareFilter { protected void hookCurtainFinally ( FwAssistantDirector assistantDirector ) { } }
final FwCoreDirection coreDirection = assistantDirector . assistCoreDirection ( ) ; final CurtainFinallyHook hook = coreDirection . assistCurtainFinallyHook ( ) ; if ( hook != null ) { hook . hook ( assistantDirector ) ; }
public class Hessian2Output { /** * Writes the list header to the stream . List writers will call * < code > writeListBegin < / code > followed by the list contents and then * call < code > writeListEnd < / code > . * < code > < pre > * list : : = V type value * Z * : : = v type int value * * < / pre > < / ...
flushIfFull ( ) ; if ( length < 0 ) { if ( type != null ) { _buffer [ _offset ++ ] = ( byte ) BC_LIST_VARIABLE ; writeType ( type ) ; } else _buffer [ _offset ++ ] = ( byte ) BC_LIST_VARIABLE_UNTYPED ; return true ; } else if ( length <= LIST_DIRECT_MAX ) { if ( type != null ) { _buffer [ _offset ++ ] = ( byte ) ( BC_L...
public class PackageManagerUtils { /** * Checks if the device has a accelerometer sensor . * @ param context the context . * @ return { @ code true } if the device has a accelerometer sensor . */ @ TargetApi ( Build . VERSION_CODES . FROYO ) public static boolean hasAccelerometerSensorFeature ( Context context ) { ...
return hasAccelerometerSensorFeature ( context . getPackageManager ( ) ) ;
public class ASTPrinter { /** * Prints a primitive type as " boolean " | " char " | " short " | " int " | " long " | " float " | " double " * @ param type PrimitiveType to be printed * @ return pretty string */ public static String print ( PrimitiveType type ) { } }
return type . match ( new PrimitiveType . MatchBlock < String > ( ) { @ Override public String _case ( BooleanType x ) { return "boolean" ; } @ Override public String _case ( ByteType x ) { return "byte" ; } @ Override public String _case ( CharType x ) { return "char" ; } @ Override public String _case ( DoubleType x ...
public class DataModelConverter { /** * Converts an iCalendar { @ link VTimezone } component into the appropriate * vCalendar properties . * @ param timezone the TIMEZONE component * @ param dates the date values in the vCalendar object that are effected by * the timezone . * @ return the vCalendar properties...
List < Daylight > daylights = new ArrayList < Daylight > ( ) ; Timezone tz = null ; if ( dates . isEmpty ( ) ) { return new VCalTimezoneProperties ( daylights , tz ) ; } ICalTimeZone icalTz = new ICalTimeZone ( timezone ) ; Collections . sort ( dates ) ; Set < DateTimeValue > daylightStartDates = new HashSet < DateTime...
public class HttpMockServer { /** * Starts mock server and keeps reference to it . * @ param configReader wrapper for platform specific bits * @ param simulatedNetworkType delay time before response is sent . */ public static HttpMockServer startMockApiServer ( @ Nonnull ConfigReader configReader , @ Nonnull Networ...
try { String configJson = new String ( readInitialData ( configReader . getMainConfigFile ( ) ) ) ; JSONObject jsonObj = configJson . isEmpty ( ) ? new JSONObject ( ) : new JSONObject ( configJson ) ; sMockServer = new HttpMockServer ( jsonObj , configReader , simulatedNetworkType ) ; return sMockServer ; } catch ( IOE...
public class SipSubsystemParser { /** * { @ inheritDoc } */ @ Override public void readElement ( XMLExtendedStreamReader reader , List < ModelNode > list ) throws XMLStreamException { } }
PathAddress address = PathAddress . pathAddress ( PathElement . pathElement ( SUBSYSTEM , SipExtension . SUBSYSTEM_NAME ) ) ; final ModelNode subsystem = new ModelNode ( ) ; subsystem . get ( OP ) . set ( ADD ) ; subsystem . get ( OP_ADDR ) . set ( address . toModelNode ( ) ) ; final int count = reader . getAttributeCo...
public class SparkDl4jMultiLayer { /** * Perform distributed evaluation of any type of { @ link IEvaluation } - or multiple IEvaluation instances . * Distributed equivalent of { @ link MultiLayerNetwork # doEvaluation ( DataSetIterator , IEvaluation [ ] ) } * @ param data Data to evaluate on * @ param emptyEvalua...
return doEvaluation ( data , getDefaultEvaluationWorkers ( ) , evalBatchSize , emptyEvaluations ) ;
public class CountMap { /** * Add the specified amount to the count for the specified key , return the new count . * Adding 0 will ensure that a Map . Entry is created for the specified key . */ public int add ( K key , int amount ) { } }
CountEntry < K > entry = _backing . get ( key ) ; if ( entry == null ) { _backing . put ( key , new CountEntry < K > ( key , amount ) ) ; return amount ; } return ( entry . count += amount ) ;
public class CmsWebdavRange { /** * Validate range . < p > * @ return true if the actual range is valid otherwise false */ public boolean validate ( ) { } }
if ( m_end >= m_length ) { m_end = m_length - 1 ; } return ( ( m_start >= 0 ) && ( m_end >= 0 ) && ( m_start <= m_end ) && ( m_length > 0 ) ) ;
public class DescribeIdentityPoolRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DescribeIdentityPoolRequest describeIdentityPoolRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( describeIdentityPoolRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( describeIdentityPoolRequest . getIdentityPoolId ( ) , IDENTITYPOOLID_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall...
public class OutputUpdateMarshaller { /** * Marshall the given parameter object . */ public void marshall ( OutputUpdate outputUpdate , ProtocolMarshaller protocolMarshaller ) { } }
if ( outputUpdate == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( outputUpdate . getOutputId ( ) , OUTPUTID_BINDING ) ; protocolMarshaller . marshall ( outputUpdate . getNameUpdate ( ) , NAMEUPDATE_BINDING ) ; protocolMarshaller . marshal...
public class MetadataFinder { /** * Discards any tracks from the hot cache that were loaded from a now - unmounted media slot , because they are no * longer valid . */ private void flushHotCacheSlot ( SlotReference slot ) { } }
// Iterate over a copy to avoid concurrent modification issues for ( Map . Entry < DeckReference , TrackMetadata > entry : new HashMap < DeckReference , TrackMetadata > ( hotCache ) . entrySet ( ) ) { if ( slot == SlotReference . getSlotReference ( entry . getValue ( ) . trackReference ) ) { logger . debug ( "Evicting ...
public class DeweyNumber { /** * Creates a dewey number from a string representation . The input string must be a dot separated * string of integers . * @ param deweyNumberString Dot separated string of integers * @ return Dewey number generated from the given input string */ public static DeweyNumber fromString ...
String [ ] splits = deweyNumberString . split ( "\\." ) ; if ( splits . length == 0 ) { return new DeweyNumber ( Integer . parseInt ( deweyNumberString ) ) ; } else { int [ ] deweyNumber = new int [ splits . length ] ; for ( int i = 0 ; i < splits . length ; i ++ ) { deweyNumber [ i ] = Integer . parseInt ( splits [ i ...
public class HamcrestValidationMatcher { /** * Checks for numeric matcher presence in expression . * @ param matcherExpression * @ return */ private boolean containsNumericMatcher ( String matcherExpression ) { } }
for ( String numericMatcher : numericMatchers ) { if ( matcherExpression . contains ( numericMatcher ) ) { return true ; } } return false ;
public class LocatedBlocks { /** * If file is under construction , set block size of the last block . It updates * file length in the same time . */ public synchronized void setLastBlockSize ( long blockId , long blockSize ) { } }
assert blocks . size ( ) > 0 ; LocatedBlock last = blocks . get ( blocks . size ( ) - 1 ) ; if ( underConstruction && blockSize > last . getBlockSize ( ) ) { assert blockId == last . getBlock ( ) . getBlockId ( ) ; this . setFileLength ( this . getFileLength ( ) + blockSize - last . getBlockSize ( ) ) ; last . setBlock...
public class KMeans { public static void main ( String [ ] args ) throws Exception { } }
if ( ! parseParameters ( args ) ) { return ; } // set up execution environment ExecutionEnvironment env = ExecutionEnvironment . getExecutionEnvironment ( ) ; // get input data DataSet < Point > points = getPointDataSet ( env ) ; DataSet < Centroid > centroids = getCentroidDataSet ( env ) ; // set number of bulk iterat...
public class PrivateVoltTableFactory { /** * End users should not call this method . * Obtain a reference to the table ' s underlying buffer . * The returned reference ' s position and mark are independent of * the table ' s buffer position and mark . The returned buffer has * no mark and is at position 0. */ p...
ByteBuffer buf = vt . m_buffer . duplicate ( ) ; buf . rewind ( ) ; return buf ;
public class AlphaIndex { /** * Parses a one - based alpha - index . * An empty string will be parsed as zero . * @ see # fromAlpha ( java . lang . String ) */ public static long fromAlpha1 ( String s ) { } }
s = s . trim ( ) ; if ( s . isEmpty ( ) ) return 0 ; return fromAlpha ( s ) + 1 ;
public class JmsSessionImpl { /** * This method exists for the sole purpose of querying whether an application * onMessage called recover under an auto _ ack session . It returns the current * value of the commit count , and then zeros the value . */ int getAndResetCommitCount ( ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getAndResetCommitCount" ) ; int currentUncommittedReceiveCount = uncommittedReceiveCount ; uncommittedReceiveCount = 0 ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this ...
public class JacksonTypeOracle { /** * < p > replaceType < / p > * @ param logger a { @ link com . google . gwt . core . ext . TreeLogger } object . * @ param type a { @ link com . google . gwt . core . ext . typeinfo . JType } object . * @ param deserializeAs a { @ link java . lang . annotation . Annotation } ob...
JClassType classType = type . isClassOrInterface ( ) ; if ( null == classType ) { return type ; } Optional < JClassType > typeAs = getClassFromJsonDeserializeAnnotation ( logger , deserializeAs , "as" ) ; Optional < JClassType > keyAs = getClassFromJsonDeserializeAnnotation ( logger , deserializeAs , "keyAs" ) ; Option...
public class WhitelistingApi { /** * Get whitelist certificate of device type . * Get whitelist certificate of device type . * @ param dtid Device Type ID . ( required ) * @ return CertificateEnvelope * @ throws ApiException If fail to call the API , e . g . server error or cannot deserialize the response body ...
ApiResponse < CertificateEnvelope > resp = getWhitelistCertificateWithHttpInfo ( dtid ) ; return resp . getData ( ) ;
public class ClassSourceFileRecorder { /** * { @ inheritDoc } * @ see org . modeshape . sequencer . javafile . SourceFileRecorder # record ( org . modeshape . jcr . api . sequencer . Sequencer . Context , java . io . InputStream , long , java . lang . String , javax . jcr . Node ) */ @ Override public void record ( f...
JavaMetadata javaMetadata = JavaMetadata . instance ( inputStream , length , encoding ) ; record ( context , outputNode , javaMetadata ) ;
public class AbstractBaseController { /** * Return an { @ link EventHandler } . * @ param eventType the event type of the handler we want to return * @ return the right event handler * @ param < E > the Event type to manage * @ throws CoreException an exception if the current class doesn ' t implement the right...
EventType < ? > temp = eventType ; EventHandler < E > handler = null ; while ( temp != null && handler == null ) { handler = ( EventHandler < E > ) this . eventHandlerMap . get ( temp ) ; temp = temp . getSuperType ( ) ; } // / / Check supertype ( ANY ) // if ( handler = = null ) { // handler = ( EventHandler < E > ) t...
public class GroovyServlet { /** * Handle web requests to the GroovyServlet */ public void service ( HttpServletRequest request , HttpServletResponse response ) throws IOException { } }
// Get the script path from the request - include aware ( GROOVY - 815) final String scriptUri = getScriptUri ( request ) ; // Set it to HTML by default response . setContentType ( "text/html; charset=" + encoding ) ; // Set up the script context final ServletBinding binding = new ServletBinding ( request , response , ...
public class BatchWorker { /** * This method start send object metadata to server . * @ param context Object worker context . * @ param meta Object metadata . * @ return Return future with result . For same objects can return same future . */ @ NotNull protected CompletableFuture < R > enqueue ( @ NotNull final M...
State < T , R > state = objectQueue . get ( meta . getOid ( ) ) ; if ( state != null ) { if ( state . future . isCancelled ( ) ) { objectQueue . remove ( meta . getOid ( ) , state ) ; state = null ; } } if ( state == null ) { final State < T , R > newState = new State < > ( meta , context ) ; state = objectQueue . putI...
public class Padding { /** * Allows to set Cell ' s spacing with the Padding object , which has be done externally , as it ' s not part of * the standard libGDX API . Padding holds 4 floats for each direction , so it ' s compatible with both * padding and spacing settings without any additional changes . * @ para...
return cell . space ( spacing . getTop ( ) , spacing . getLeft ( ) , spacing . getBottom ( ) , spacing . getRight ( ) ) ;
public class CacheUnitImpl { /** * This implements the method in the CacheUnit interface . * It applies the updates to the local internal caches and * the external caches . * It validates timestamps to prevent race conditions . * @ param invalidateIdEvents A HashMap of invalidate by id . * @ param invalidateT...
if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "batchUpdate():" + cacheName ) ; invalidationAuditDaemon . registerInvalidations ( cacheName , invalidateIdEvents . values ( ) . iterator ( ) ) ; invalidationAuditDaemon . registerInvalidations ( cacheName , invalidateTemplateEvents . values ( ) . iterator ( ) ) ; pushEn...
public class AbstractConsoleEditor { /** * Moves cursor to the end of the current line . */ public void moveToEndOfLine ( ) { } }
String currentLine = getContent ( getLine ( ) ) ; LinkedList < String > toDisplayLines = toDisplayLines ( currentLine ) ; int remainingLines = getColumn ( ) / terminal . getWidth ( ) + 1 ; for ( int r = 0 ; r < remainingLines ; r ++ ) { toDisplayLines . removeFirst ( ) ; } frameColumn = currentLine . length ( ) ; deleg...
public class UpdateRunner { /** * Add a new update to run at any appropriate time . * @ param r New runnable to perform the update */ public void invokeLater ( Runnable r ) { } }
queue . add ( r ) ; synchronized ( this ) { if ( synchronizer == null ) { runQueue ( ) ; } else { synchronizer . activate ( ) ; } }
public class MathUtils { /** * The # toArray methods of collections cannot be used with primitive arrays . This loops over and array list of * Integers and outputs and array of int . * @ param result The array of Integers to convert . * @ return An array of int . */ private static int [ ] intListToPrimitiveArray ...
int [ ] resultArray = new int [ result . size ( ) ] ; int index = 0 ; for ( int r : result ) { resultArray [ index ] = result . get ( index ) ; index ++ ; } return resultArray ;
public class CmsThreadStore { /** * Adds a Thread to this Thread store . < p > * @ param thread the Thread to add */ public void addThread ( A_CmsReportThread thread ) { } }
m_threads . put ( thread . getUUID ( ) , thread ) ; if ( LOG . isDebugEnabled ( ) ) { dumpThreads ( ) ; }
public class RouteProcessor { /** * Verify the route meta * @ param meta raw meta */ private boolean routeVerify ( RouteMeta meta ) { } }
String path = meta . getPath ( ) ; if ( StringUtils . isEmpty ( path ) || ! path . startsWith ( "/" ) ) { // The path must be start with ' / ' and not empty ! return false ; } if ( StringUtils . isEmpty ( meta . getGroup ( ) ) ) { // Use default group ( the first word in path ) try { String defaultGroup = path . substr...
public class HtmlStreamRenderer { /** * Canonicalizes the element name and possibly substitutes an alternative * that has more consistent semantics . */ static String safeName ( String unsafeElementName ) { } }
String elementName = HtmlLexer . canonicalName ( unsafeElementName ) ; // Substitute a reliably non - raw - text element for raw - text and // plain - text elements . switch ( elementName . length ( ) ) { case 3 : if ( "xmp" . equals ( elementName ) ) { return "pre" ; } break ; case 7 : if ( "listing" . equals ( elemen...
public class CommerceAccountOrganizationRelUtil { /** * Returns the last commerce account organization rel in the ordered set where commerceAccountId = & # 63 ; . * @ param commerceAccountId the commerce account ID * @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > ...
return getPersistence ( ) . fetchByCommerceAccountId_Last ( commerceAccountId , orderByComparator ) ;
public class FileRandomAccessStream { /** * Reads a block starting from the current file pointer . */ public int read ( byte [ ] buffer , int offset , int length ) throws IOException { } }
return _file . read ( buffer , offset , length ) ;
public class MembershipTypeHandlerImpl { /** * Moves memberships in cache from old key to new one . */ private void moveMembershipsInCache ( String oldType , String newType ) { } }
cache . move ( CacheHandler . MEMBERSHIPTYPE_PREFIX + oldType , CacheHandler . MEMBERSHIPTYPE_PREFIX + newType , CacheType . MEMBERSHIP ) ;
public class StorageAccountsInner { /** * Asynchronously creates a new storage account with the specified parameters . If an account is already created and a subsequent create request is issued with different properties , the account properties will be updated . If an account is already created and a subsequent create ...
return ServiceFuture . fromResponse ( beginCreateWithServiceResponseAsync ( resourceGroupName , accountName , parameters ) , serviceCallback ) ;
public class AbstractManagedType { /** * ( non - Javadoc ) * @ see * javax . persistence . metamodel . ManagedType # getDeclaredSingularAttributes ( ) */ @ Override public Set < SingularAttribute < X , ? > > getDeclaredSingularAttributes ( ) { } }
Set < SingularAttribute < X , ? > > declaredAttribSet = null ; if ( declaredSingluarAttribs != null ) { declaredAttribSet = new HashSet < SingularAttribute < X , ? > > ( ) ; declaredAttribSet . addAll ( declaredSingluarAttribs . values ( ) ) ; } return declaredAttribSet ;
public class Setting { /** * 获取分组对应的值 , 如果分组不存在或者值不存在则返回null * @ param group 分组 * @ param key 键 * @ return 值 , 如果分组不存在或者值不存在则返回null */ public String get ( String group , String key ) { } }
return this . groupedMap . get ( group , key ) ;
public class CmsContentEditor { /** * Calls the editor change handlers . < p > * @ param changedScopes the changed content value scopes */ void callEditorChangeHandlers ( final Set < String > changedScopes ) { } }
m_changedScopes . addAll ( changedScopes ) ; if ( ! m_callingChangeHandlers && ( m_changedScopes . size ( ) > 0 ) ) { m_callingChangeHandlers = true ; final Set < String > scopesToSend = new HashSet < String > ( m_changedScopes ) ; m_changedScopes . clear ( ) ; final CmsEntity entity = m_entityBackend . getEntity ( m_e...
public class IOCImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public void setConData2 ( byte [ ] newConData2 ) { } }
byte [ ] oldConData2 = conData2 ; conData2 = newConData2 ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , AfplibPackage . IOC__CON_DATA2 , oldConData2 , conData2 ) ) ;
public class InternalConfig { /** * Builds and returns a signer configuration map . * @ param signerIndexes * signer configuration entries loaded from JSON * @ param theme * used for message logging . eg region , service , region + service */ private Map < String , SignerConfig > buildSignerMap ( JsonIndex < Si...
Map < String , SignerConfig > map = new HashMap < String , SignerConfig > ( ) ; if ( signerIndexes != null ) { for ( JsonIndex < SignerConfigJsonHelper , SignerConfig > index : signerIndexes ) { String region = index . getKey ( ) ; SignerConfig prev = map . put ( region , index . newReadOnlyConfig ( ) ) ; if ( prev != ...
public class IntrospectionLevelMember { /** * Introspect the object via reflection */ private void introspectViaReflection ( ) { } }
{ Class < ? > memberClass = _member . getClass ( ) ; if ( memberClass . isArray ( ) ) { int length = Array . getLength ( _member ) ; Class < ? > componentType = memberClass . getComponentType ( ) ; if ( componentType . isPrimitive ( ) ) { addNewChild ( componentType + "[0.." + ( length - 1 ) + "]" , _member ) ; } else ...
public class Data { /** * Returns the single instance of the magic object that represents the " null " value for the given * Java class ( including array or enum ) . * @ param objClass class of the object needed * @ return magic object instance that represents the " null " value ( not Java { @ code null } ) * @...
Object result = NULL_CACHE . get ( objClass ) ; if ( result == null ) { synchronized ( NULL_CACHE ) { result = NULL_CACHE . get ( objClass ) ; if ( result == null ) { if ( objClass . isArray ( ) ) { // arrays are special because we need to compute both the dimension and component type int dims = 0 ; Class < ? > compone...
public class JCommander { /** * Main method that parses the values and initializes the fields accordingly . */ private void parseValues ( String [ ] args , boolean validate ) { } }
// This boolean becomes true if we encounter a command , which indicates we need // to stop parsing ( the parsing of the command will be done in a sub JCommander // object ) boolean commandParsed = false ; int i = 0 ; boolean isDashDash = false ; // once we encounter - - , everything goes into the main parameter while ...
public class NotifyRegion { /** * * * * * * Initialization * * * * * */ private void initGraphics ( ) { } }
if ( Double . compare ( getPrefWidth ( ) , 0.0 ) <= 0 || Double . compare ( getPrefHeight ( ) , 0.0 ) <= 0 || Double . compare ( getWidth ( ) , 0.0 ) <= 0 || Double . compare ( getHeight ( ) , 0.0 ) <= 0 ) { if ( getPrefWidth ( ) > 0 && getPrefHeight ( ) > 0 ) { setPrefSize ( getPrefWidth ( ) , getPrefHeight ( ) ) ; } ...
public class TableFactoryService { /** * Prepares the properties of a context to be used for match operations . */ private static Map < String , String > normalizeContext ( TableFactory factory ) { } }
Map < String , String > requiredContext = factory . requiredContext ( ) ; if ( requiredContext == null ) { throw new TableException ( String . format ( "Required context of factory '%s' must not be null." , factory . getClass ( ) . getName ( ) ) ) ; } return requiredContext . keySet ( ) . stream ( ) . collect ( Collect...