signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class Http2ConnectionHandler { /** * Handler for a connection error . Sends a GO _ AWAY frame to the remote endpoint . Once all * streams are closed , the connection is shut down . * @ param ctx the channel context * @ param outbound { @ code true } if the error was caused by an outbound operation . * @ ...
if ( http2Ex == null ) { http2Ex = new Http2Exception ( INTERNAL_ERROR , cause . getMessage ( ) , cause ) ; } ChannelPromise promise = ctx . newPromise ( ) ; ChannelFuture future = goAway ( ctx , http2Ex , ctx . newPromise ( ) ) ; if ( http2Ex . shutdownHint ( ) == Http2Exception . ShutdownHint . GRACEFUL_SHUTDOWN ) { ...
public class HCJSNodeDetector { /** * Check if the passed node is a JS node after unwrapping . * @ param aNode * The node to be checked - may be < code > null < / code > . * @ return < code > true < / code > if the node implements { @ link IHCScript } . */ public static boolean isJSNode ( @ Nullable final IHCNode...
final IHCNode aUnwrappedNode = HCHelper . getUnwrappedNode ( aNode ) ; return isDirectJSNode ( aUnwrappedNode ) ;
public class NormalisedOntology { /** * Indicates if cn is a child of cn2. * @ param cn * @ param cn2 * @ return */ private boolean isChild ( Node cn , Node cn2 ) { } }
if ( cn == cn2 ) return false ; Queue < Node > toProcess = new LinkedList < Node > ( ) ; toProcess . addAll ( cn . getParents ( ) ) ; while ( ! toProcess . isEmpty ( ) ) { Node tcn = toProcess . poll ( ) ; if ( tcn . equals ( cn2 ) ) return true ; Set < Node > parents = tcn . getParents ( ) ; if ( parents != null && ! ...
public class TagLibTag { /** * Setzt die implementierende Klassendefinition des Evaluator . Diese Methode wird durch die Klasse * TagLibFactory verwendet . * @ param tteClass Klassendefinition der Evaluator - Implementation . */ public void setTTTClassDefinition ( String tttClass , Identification id , Attributes at...
this . tttCD = ClassDefinitionImpl . toClassDefinition ( tttClass , id , attr ) ; this . tttConstructor = null ;
public class Scanners { /** * A scanner that scans the input for an occurrence of a string pattern . * @ param pattern the pattern object . * @ param name the name of what ' s expected logically . Is used in error message . * @ return the Parser object . * @ deprecated Use { @ code pattern . toScanner ( name ) ...
return new Parser < Void > ( ) { @ Override boolean apply ( final ParseContext ctxt ) { int at = ctxt . at ; CharSequence src = ctxt . characters ( ) ; int matchLength = pattern . match ( src , at , src . length ( ) ) ; if ( matchLength < 0 ) { ctxt . missing ( name ) ; return false ; } ctxt . next ( matchLength ) ; ct...
public class EJSContainer { /** * d507967 */ public Object invoke ( EJSDeployedSupport s , Object [ ] parameters ) throws Exception { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "WS-EJBinvoke(" + s . methodId + ":" + s . methodInfo . getMethodName ( ) + ")" ) ; // Get SessionBeanO stored in EJSDeployedSupport during preInvoke // processing and use it to get a InvocationContext needed for // invoking th...
public class KafkaHelper { /** * Creates a new { @ link KafkaConsumer } instance , with default * configurations . * @ param bootstrapServers * @ param consumerGroupId * @ param consumeFromBeginning * @ param autoCommitOffsets * @ return */ public static KafkaConsumer < String , byte [ ] > createKafkaConsum...
return createKafkaConsumer ( bootstrapServers , consumerGroupId , consumeFromBeginning , autoCommitOffsets , null ) ;
public class AfplibFactoryImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public String convertCPCCPIRGLenToString ( EDataType eDataType , Object instanceValue ) { } }
return instanceValue == null ? null : instanceValue . toString ( ) ;
public class Sync { /** * Performs a blocking sync operation . Returns true if the sync completed normally , false if it timed out or * was interrupted . */ public static boolean synchronousSync ( CuratorFramework curator , Duration timeout ) { } }
try { // Curator sync ( ) is always a background operation . Use a latch to block until it finishes . final CountDownLatch latch = new CountDownLatch ( 1 ) ; curator . sync ( ) . inBackground ( new BackgroundCallback ( ) { @ Override public void processResult ( CuratorFramework curator , CuratorEvent event ) throws Exc...
public class JerseyTags { /** * Creates a { @ code uri } tag based on the URI of the given { @ code event } . Uses the * { @ link ExtendedUriInfo # getMatchedTemplates ( ) } if * available . { @ code REDIRECTION } for 3xx responses , { @ code NOT _ FOUND } for 404 responses . * @ param event the request event *...
ContainerResponse response = event . getContainerResponse ( ) ; if ( response != null ) { int status = response . getStatus ( ) ; if ( isRedirection ( status ) ) { return URI_REDIRECTION ; } if ( status == 404 ) { return URI_NOT_FOUND ; } } String matchingPattern = getMatchingPattern ( event ) ; if ( matchingPattern . ...
public class JsonSerializer { /** * Append a primitive value to json struct . * @ param writer The JSON writer . * @ param primitive The primitive instance . */ private void appendPrimitive ( JsonWriter writer , Object primitive ) throws SerializerException { } }
if ( primitive instanceof PEnumValue ) { if ( IdType . ID . equals ( enumValueType ) ) { writer . value ( ( ( PEnumValue < ? > ) primitive ) . asInteger ( ) ) ; } else { writer . valueUnescaped ( primitive . toString ( ) ) ; } } else if ( primitive instanceof Boolean ) { writer . value ( ( ( Boolean ) primitive ) ) ; }...
public class FormLoginAuthenticator { /** * TODO : java doc */ private String getFormLoginURL ( HttpServletRequest req , WebRequest webRequest , WebAppSecurityConfig webAppSecConfig ) { } }
FormLoginConfiguration formLoginConfig = webRequest . getFormLoginConfiguration ( ) ; String inURL = null ; String contextPath = null ; // if the global login is set as CERT and the fallback is allowed to FORM , // use global form login . String authMech = webAppSecConfig . getOverrideHttpAuthMethod ( ) ; if ( authMech...
public class UDPChannel { /** * @ see com . ibm . wsspi . channelfw . Channel # init ( ) */ public void init ( ) throws ChannelException { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( this , tc , "UDP Channel: " + getConfig ( ) . getExternalName ( ) + " listening port: " + String . valueOf ( getConfig ( ) . getPort ( ) ) ) ; }
public class GraphHandler { /** * Iterate through the class path and look for the Gnuplot helper script . * @ return The path to the wrapper script . */ private static String findGnuplotHelperScript ( ) { } }
if ( ! GnuplotInstaller . FOUND_GP ) { LOG . warn ( "Skipping Gnuplot Shell Script Install since Gnuplot executable was not found" ) ; return null ; } if ( ! GnuplotInstaller . GP_FILE . exists ( ) ) { GnuplotInstaller . installMyGnuPlot ( ) ; } if ( GnuplotInstaller . GP_FILE . exists ( ) && GnuplotInstaller . GP_FILE...
public class PresetSettings { /** * Caption settings for this preset . There can be multiple caption settings in a single output . * @ param captionDescriptions * Caption settings for this preset . There can be multiple caption settings in a single output . */ public void setCaptionDescriptions ( java . util . Coll...
if ( captionDescriptions == null ) { this . captionDescriptions = null ; return ; } this . captionDescriptions = new java . util . ArrayList < CaptionDescriptionPreset > ( captionDescriptions ) ;
public class PeriodCounterFactory { /** * compteur d ' un jour donné */ private Counter getDayCounterAtDate ( Date day ) { } }
final Counter dayCounter = createDayCounterAtDate ( day ) ; try { dayCounter . readFromFile ( ) ; } catch ( final IOException e ) { // lecture échouée , tant pis // ( on n ' interrompt pas tout un rapport juste pour un des fichiers illisible ) LOG . info ( "read of a counter file failed: " + dayCounter . getName ( ) ...
public class AbstractXServlet { /** * Avoid overloading in sub classes */ @ Override public final void service ( @ Nonnull final ServletRequest req , @ Nonnull final ServletResponse res ) throws ServletException , IOException { } }
super . service ( req , res ) ;
public class NettyConnection { /** * Handles the channel being closed . */ void handleClosed ( ) { } }
if ( ! closed ) { closed = true ; for ( ContextualFuture < ? > responseFuture : responseFutures . values ( ) ) { responseFuture . context . executor ( ) . execute ( ( ) -> responseFuture . completeExceptionally ( new ConnectException ( "connection closed" ) ) ) ; } responseFutures . clear ( ) ; for ( Listener < Connect...
public class NetworkAddressUtils { /** * Provides an externally resolvable hostname for client to communicate with the service . If the * hostname is not explicitly specified , Alluxio will try to use the bind host . If the bind host * is wildcard , Alluxio will automatically determine an appropriate hostname from ...
if ( conf . isSet ( service . mHostNameKey ) ) { String connectHost = conf . get ( service . mHostNameKey ) ; if ( ! connectHost . isEmpty ( ) && ! connectHost . equals ( WILDCARD_ADDRESS ) ) { return connectHost ; } } if ( conf . isSet ( service . mBindHostKey ) ) { String bindHost = conf . get ( service . mBindHostKe...
public class JsonReader { /** * Consumes the next token from the JSON stream and asserts that it is the * beginning of a new array . */ public void beginArray ( ) throws IOException { } }
int p = peeked ; if ( p == PEEKED_NONE ) { p = doPeek ( ) ; } if ( p == PEEKED_BEGIN_ARRAY ) { push ( JsonScope . EMPTY_ARRAY ) ; pathIndices [ stackSize - 1 ] = 0 ; peeked = PEEKED_NONE ; } else { throw new IllegalStateException ( "Expected BEGIN_ARRAY but was " + peek ( ) + " at line " + getLineNumber ( ) + " column ...
public class UnsignedNumberUtil { /** * Returns dividend % divisor , where the dividend and divisor are treated as unsigned 64 - bit quantities . * @ param dividend * the dividend ( numerator ) * @ param divisor * the divisor ( denominator ) * @ throws ArithmeticException * if divisor is 0 * @ since 11.0 ...
if ( divisor < 0 ) { // i . e . , divisor > = 2 ^ 63: if ( compareUnsigned ( dividend , divisor ) < 0 ) { return dividend ; // dividend < divisor } else { return dividend - divisor ; // dividend > = divisor } } // Optimization - use signed modulus if dividend < 2 ^ 63 if ( dividend >= 0 ) { return dividend % divisor ; ...
public class ValueAggregatorJob { /** * create and run an Aggregate based map / reduce job . * @ param args the arguments used for job creation * @ throws IOException */ public static void main ( String args [ ] ) throws IOException { } }
JobConf job = ValueAggregatorJob . createValueAggregatorJob ( args ) ; JobClient . runJob ( job ) ;
public class F2 { /** * Applies this partial function to the given argument when it is contained in the function domain . * Applies fallback function where this partial function is not defined . * @ param p1 * the first param with type P1 * @ param p2 * the second param with type P2 * @ param fallback * t...
try { return apply ( p1 , p2 ) ; } catch ( RuntimeException e ) { return fallback . apply ( p1 , p2 ) ; }
public class BeanDefinitionDtoConverterServiceImpl { /** * Convert from an internal Spring bean definition to a DTO . * @ param beanDefinition The internal Spring bean definition . * @ return Returns a DTO representation . */ public BeanDefinitionInfo toDto ( BeanDefinition beanDefinition ) { } }
if ( beanDefinition instanceof GenericBeanDefinition ) { GenericBeanDefinitionInfo info = new GenericBeanDefinitionInfo ( ) ; info . setClassName ( beanDefinition . getBeanClassName ( ) ) ; if ( beanDefinition . getPropertyValues ( ) != null ) { Map < String , BeanMetadataElementInfo > propertyValues = new HashMap < St...
public class AjaxSlider { /** * Sets the call - back for the AJAX stop event . * @ param ajaxStopEvent * The ISliderAjaxEvent . */ public void setAjaxStopEvent ( ISliderAjaxEvent ajaxStopEvent ) { } }
this . ajaxEvents . put ( SliderAjaxEvent . ajaxStopEvent , ajaxStopEvent ) ; setStopEvent ( new SliderAjaxJsScopeUiEvent ( this , SliderAjaxEvent . ajaxStopEvent ) ) ;
public class FirstFitDecreasingPacking { /** * Get a new packing plan given an existing packing plan and component - level changes . * @ return new packing plan */ public PackingPlan repack ( PackingPlan currentPackingPlan , Map < String , Integer > componentChanges ) { } }
PackingPlanBuilder planBuilder = newPackingPlanBuilder ( currentPackingPlan ) ; // Get the instances using FFD allocation try { planBuilder = getFFDAllocation ( planBuilder , currentPackingPlan , componentChanges ) ; } catch ( ConstraintViolationException e ) { throw new PackingException ( "Could not repack instances i...
public class AbstractBcX509CertificateGenerator { /** * Build the TBS Certificate . * @ param subjectName the identifier of the public key owner . * @ param subject the public key to certify . * @ param parameters the subject parameters for this certificate . * @ return the TBS certificate . * @ throws IOExce...
PrincipalIndentifier issuerName ; CertifiedPublicKey issuer = null ; if ( this . signer instanceof CertifyingSigner ) { issuer = ( ( CertifyingSigner ) this . signer ) . getCertifier ( ) ; issuerName = issuer . getSubject ( ) ; } else { issuerName = subjectName ; } BcX509TBSCertificateBuilder builder = getTBSCertificat...
public class ApiOvhTelephony { /** * Get all available fax offer compatible * REST : GET / telephony / fax / offers * @ param country [ required ] The country */ public ArrayList < OvhLineOffer > fax_offers_GET ( OvhNumberCountryEnum country ) throws IOException { } }
String qPath = "/telephony/fax/offers" ; StringBuilder sb = path ( qPath ) ; query ( sb , "country" , country ) ; String resp = execN ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , t15 ) ;
public class SafeCloseSmtpServer { /** * Stops the server . Server is shutdown after processing of the current request is complete . */ public synchronized void stop ( ) { } }
// Mark us closed stopped = true ; try { // Kick the server accept loop serverSocket . close ( ) ; // acquire all semaphores so that we wait for all connections to finish before we report back as closed semaphore . acquireUninterruptibly ( MAXIMUM_CONCURRENT_READERS ) ; } catch ( IOException e ) { log . log ( Level . S...
public class ProgressBar { /** * Wraps an { @ link Iterable } so that when iterated , a progress bar is shown to track the traversal progress . * For this function the progress bar can be fully customized by using a { @ link ProgressBarBuilder } . * @ param ts Underlying iterable * @ param pbb An instance of a { ...
long size = ts . spliterator ( ) . getExactSizeIfKnown ( ) ; if ( size != - 1 ) pbb . setInitialMax ( size ) ; return new ProgressBarWrappedIterable < > ( ts , pbb ) ;
public class Predicate { /** * Returns a type - safe reference to the shared instance of a predicate that always returns * < code > true < / code > . */ public static < T > Predicate < T > trueInstance ( ) { } }
@ SuppressWarnings ( "unchecked" ) Predicate < T > pred = ( Predicate < T > ) TRUE_INSTANCE ; return pred ;
public class I18n { /** * Using the base name and locale to get the Res object , which is used to get i18n message value from the resource file . * @ param baseName the base name to load Resource bundle * @ param locale the locale string like this : " zh _ CN " " en _ US " * @ return the Res object to get i18n me...
String resKey = baseName + locale ; Res res = resMap . get ( resKey ) ; if ( res == null ) { res = new Res ( baseName , locale ) ; resMap . put ( resKey , res ) ; } return res ;
public class ArmeriaMessageDeframer { /** * Processes the body of the gRPC compression frame . A single compression frame may contain * several gRPC messages within it . */ private void readBody ( ) { } }
final ByteBuf buf = readBytes ( requiredLength ) ; final ByteBufOrStream msg = compressedFlag ? getCompressedBody ( buf ) : getUncompressedBody ( buf ) ; listener . messageRead ( msg ) ; // Done with this frame , begin processing the next header . state = State . HEADER ; requiredLength = HEADER_LENGTH ;
public class CndImporter { /** * Parse the node type definition that is next on the token stream . * @ param tokens the tokens containing the node type definition ; never null * @ throws ParsingException if there is a problem parsing the content */ protected void parseNodeTypeDefinition ( TokenStream tokens ) { } }
// Parse the name , and create the path and a property for the name . . . Name name = parseNodeTypeName ( tokens ) ; JcrNodeTypeTemplate nodeType = new JcrNodeTypeTemplate ( context ) ; try { nodeType . setName ( string ( name ) ) ; } catch ( ConstraintViolationException e ) { assert false : "Names should always be syn...
public class ProactiveDetectionConfigurationsInner { /** * Update the ProactiveDetection configuration for this configuration id . * @ param resourceGroupName The name of the resource group . * @ param resourceName The name of the Application Insights component resource . * @ param configurationId The ProactiveDe...
return updateWithServiceResponseAsync ( resourceGroupName , resourceName , configurationId , proactiveDetectionProperties ) . map ( new Func1 < ServiceResponse < ApplicationInsightsComponentProactiveDetectionConfigurationInner > , ApplicationInsightsComponentProactiveDetectionConfigurationInner > ( ) { @ Override publi...
public class SoyProtoType { /** * Returns this proto ' s type name for the given backend . */ public String getNameForBackend ( SoyBackendKind backend ) { } }
switch ( backend ) { case JS_SRC : // The ' proto ' prefix is JSPB - specific . If we ever support some other // JavaScript proto implementation , we ' ll need some way to determine which // proto implementation the user wants to use at this point . return ProtoUtils . calculateQualifiedJsName ( typeDescriptor ) ; case...
public class Where { /** * Add a ' & lt ; ' clause so the column must be less - than the value . */ public Where < T , ID > lt ( String columnName , Object value ) throws SQLException { } }
addClause ( new SimpleComparison ( columnName , findColumnFieldType ( columnName ) , value , SimpleComparison . LESS_THAN_OPERATION ) ) ; return this ;
public class AmazonCodeDeployClient { /** * Creates a deployment group to which application revisions are deployed . * @ param createDeploymentGroupRequest * Represents the input of a CreateDeploymentGroup operation . * @ return Result of the CreateDeploymentGroup operation returned by the service . * @ throws ...
request = beforeClientExecution ( request ) ; return executeCreateDeploymentGroup ( request ) ;
public class GoroService { /** * Get a task instance packed into an { @ code Intent } with * { @ link # taskIntent ( android . content . Context , java . util . concurrent . Callable ) } . */ public static Callable < ? > getTaskFromExtras ( final Intent intent ) { } }
if ( ! intent . hasExtra ( EXTRA_TASK ) && ! intent . hasExtra ( EXTRA_TASK_BUNDLE ) ) { return null ; } Parcelable taskArg = intent . getParcelableExtra ( EXTRA_TASK ) ; if ( taskArg == null ) { Bundle bundle = intent . getBundleExtra ( EXTRA_TASK_BUNDLE ) ; if ( bundle != null ) { taskArg = bundle . getParcelable ( E...
public class EventDispatcher { protected int subscribe_att_config_event ( String attr_name , String [ ] filters , boolean stateless ) throws DevFailed { } }
return event_supplier . subscribe_event ( attr_name , ATT_CONF_EVENT , this , filters , stateless ) ;
public class EVCacheLatchImpl { /** * ( non - Javadoc ) * @ see * com . netflix . evcache . operation . EVCacheLatchI # onComplete ( net . spy . memcached . internal . OperationFuture ) */ @ Override public void onComplete ( OperationFuture < ? > future ) throws Exception { } }
if ( log . isDebugEnabled ( ) ) log . debug ( "BEGIN : onComplete - Calling Countdown. Completed Future = " + future + "; App : " + appName ) ; countDown ( ) ; completeCount ++ ; if ( getCompletedCount ( ) >= getExpectedSuccessCount ( ) ) { final String cachePrefix = null ; EVCacheMetricsFactory . getStatsTimer ( getAp...
public class MPPTimephasedBaselineCostNormaliser { /** * This method splits the first day off of a time span . * @ param calendar current calendar * @ param assignment timephased assignment span * @ return first day and remainder assignments */ private TimephasedCost [ ] splitFirstDay ( ProjectCalendar calendar ,...
TimephasedCost [ ] result = new TimephasedCost [ 2 ] ; // Retrieve data used to calculate the pro - rata work split Date assignmentStart = assignment . getStart ( ) ; Date assignmentFinish = assignment . getFinish ( ) ; Duration calendarWork = calendar . getWork ( assignmentStart , assignmentFinish , TimeUnit . MINUTES...
public class TurboProjectReader { /** * Read exceptions for a calendar . * @ param table calendar exception data * @ param calendar calendar * @ param exceptionID first exception ID */ private void addCalendarExceptions ( Table table , ProjectCalendar calendar , Integer exceptionID ) { } }
Integer currentExceptionID = exceptionID ; while ( true ) { MapRow row = table . find ( currentExceptionID ) ; if ( row == null ) { break ; } Date date = row . getDate ( "DATE" ) ; ProjectCalendarException exception = calendar . addCalendarException ( date , date ) ; if ( row . getBoolean ( "WORKING" ) ) { exception . ...
public class ExternalShuffleClient { /** * Registers this executor with an external shuffle server . This registration is required to * inform the shuffle server about where and how we store our shuffle files . * @ param host Host of shuffle server . * @ param port Port of shuffle server . * @ param execId This...
checkInit ( ) ; try ( TransportClient client = clientFactory . createUnmanagedClient ( host , port ) ) { ByteBuffer registerMessage = new RegisterExecutor ( appId , execId , executorInfo ) . toByteBuffer ( ) ; client . sendRpcSync ( registerMessage , registrationTimeoutMs ) ; }
public class AdminEvaluator { /** * Determines if the passed - in authorization principal represents a user that is a member of the * administrator group or any of its sub groups . */ public static boolean isAdmin ( IAuthorizationPrincipal ap ) { } }
IGroupMember member = AuthorizationServiceFacade . instance ( ) . getGroupMember ( ap ) ; return isAdmin ( member ) ;
public class CollectionKit { /** * New Set and add values * @ param values set values * @ param < T > set type * @ return return HashSet */ @ SafeVarargs public static < T > Set < T > newSets ( T ... values ) { } }
if ( null == values || values . length == 0 ) { Assert . notNull ( values , "values not is null." ) ; } return new HashSet < > ( Arrays . asList ( values ) ) ;
public class BridgeHandler { /** * Translates a { @ code java . util . logging } level into a tinylog severity level . * @ param level * Logging level from { @ code java . util . logging } * @ return Severity level for tinylog */ private static org . tinylog . Level translateLevel ( final Level level ) { } }
if ( level . intValue ( ) <= Level . FINEST . intValue ( ) ) { return org . tinylog . Level . TRACE ; } else if ( level . intValue ( ) <= Level . FINE . intValue ( ) ) { return org . tinylog . Level . DEBUG ; } else if ( level . intValue ( ) <= Level . INFO . intValue ( ) ) { return org . tinylog . Level . INFO ; } els...
public class AsyncLookupInBuilder { /** * Helper method to actually perform the subdoc exists operation . */ private Observable < DocumentFragment < Lookup > > existsIn ( final String id , final LookupSpec spec , final long timeout , final TimeUnit timeUnit ) { } }
return Observable . defer ( new Func0 < Observable < DocumentFragment < Lookup > > > ( ) { @ Override public Observable < DocumentFragment < Lookup > > call ( ) { final SubExistRequest request = new SubExistRequest ( id , spec . path ( ) , bucketName ) ; request . xattr ( spec . xattr ( ) ) ; request . accessDeleted ( ...
public class IntervalCollection { /** * / * [ deutsch ] * < p > Ermittelt die Differenz , die alle Zeitpunkte entweder in dieser oder in der anderen enth & auml ; lt . < / p > * @ param other another interval collection * @ return new interval collection with disjunct blocks containing all time points which are i...
if ( this . isEmpty ( ) ) { return other ; } else if ( other . isEmpty ( ) ) { return this ; } T min1 = this . getMinimum ( ) ; T max1 = this . getMaximum ( ) ; T min2 = other . getMinimum ( ) ; T max2 = other . getMaximum ( ) ; T min ; T max ; if ( ( min1 == null ) || ( min2 == null ) ) { min = null ; } else { min = (...
public class SimplePluginRegistry { /** * ( non - Javadoc ) * @ see org . springframework . plugin . core . PluginRegistry # getRequiredPluginFor ( java . lang . Object ) */ @ Override public T getRequiredPluginFor ( S delimiter ) { } }
Assert . notNull ( delimiter , "Delimiter must not be null!" ) ; return getRequiredPluginFor ( delimiter , ( ) -> String . format ( "No plugin found for delimiter %s! Registered plugins: %s." , delimiter , getPlugins ( ) ) ) ;
public class GeoPackageTextOutput { /** * Text output from a SRS * @ param srs * spatial reference system * @ return text */ public String textOutput ( SpatialReferenceSystem srs ) { } }
StringBuilder output = new StringBuilder ( ) ; output . append ( "\tSRS " + SpatialReferenceSystem . COLUMN_ORGANIZATION + ": " + srs . getOrganization ( ) ) ; output . append ( "\n\tSRS " + SpatialReferenceSystem . COLUMN_ORGANIZATION_COORDSYS_ID + ": " + srs . getOrganizationCoordsysId ( ) ) ; output . append ( "\n\t...
public class InterfaceEndpointsInner { /** * Gets all interface endpoints in a resource group . * @ param nextPageLink The NextLink from the previous successful call to List operation . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the PagedList & lt ; I...
return listByResourceGroupNextWithServiceResponseAsync ( nextPageLink ) . map ( new Func1 < ServiceResponse < Page < InterfaceEndpointInner > > , Page < InterfaceEndpointInner > > ( ) { @ Override public Page < InterfaceEndpointInner > call ( ServiceResponse < Page < InterfaceEndpointInner > > response ) { return respo...
public class CmsCoreProvider { /** * Returns the resource type name for a given filename . < p > * @ param file the file info * @ return the resource type name */ public String getResourceTypeIcon ( CmsFileInfo file ) { } }
String typeName = null ; typeName = getIconMapping ( ) . get ( file . getFileSuffix ( ) . toLowerCase ( ) ) ; if ( typeName == null ) { typeName = getIconMapping ( ) . get ( "" ) ; } return typeName ;
public class KeyboardUtil { /** * Recommend invoked by { @ link Activity # onCreate ( Bundle ) } * For align the height of the keyboard to { @ code target } as much as possible . * For save the refresh the keyboard height to shared - preferences . * @ param activity contain the view * @ param target whose heigh...
final ViewGroup contentView = activity . findViewById ( android . R . id . content ) ; final boolean isFullScreen = ViewUtil . isFullScreen ( activity ) ; final boolean isTranslucentStatus = ViewUtil . isTranslucentStatus ( activity ) ; final boolean isFitSystemWindows = ViewUtil . isFitsSystemWindows ( activity ) ; //...
public class AWSServerMigrationClient { /** * Deletes all servers from your server catalog . * @ param deleteServerCatalogRequest * @ return Result of the DeleteServerCatalog operation returned by the service . * @ throws UnauthorizedOperationException * You lack permissions needed to perform this operation . C...
request = beforeClientExecution ( request ) ; return executeDeleteServerCatalog ( request ) ;
public class Money { /** * Returns a copy of this monetary value divided by the specified value . * This takes this amount and divides it by the specified value , rounding * the result is rounded as specified . * This instance is immutable and unaffected by this method . * @ param valueToDivideBy the scalar val...
return with ( money . dividedBy ( valueToDivideBy , roundingMode ) ) ;
public class BaseUTF8Encoding { /** * utf8 _ left _ adjust _ char _ head */ @ Override public int leftAdjustCharHead ( byte [ ] bytes , int p , int s , int end ) { } }
if ( s <= p ) return s ; int p_ = s ; while ( ! utf8IsLead ( bytes [ p_ ] & 0xff ) && p_ > p ) p_ -- ; return p_ ;
public class WPartialDateField { /** * Returns the year value . * @ return the year , or null if unspecified . */ public Integer getYear ( ) { } }
String dateValue = getValue ( ) ; if ( dateValue != null && dateValue . length ( ) >= YEAR_END ) { return parseDateComponent ( dateValue . substring ( YEAR_START , YEAR_END ) , getPaddingChar ( ) ) ; } else { return null ; }
public class RemotingClientDelegate { /** * 同步调用 */ public RemotingCommand invokeSync ( RemotingCommand request ) throws JobTrackerNotFoundException { } }
Node jobTracker = getJobTrackerNode ( ) ; try { RemotingCommand response = remotingClient . invokeSync ( jobTracker . getAddress ( ) , request , appContext . getConfig ( ) . getInvokeTimeoutMillis ( ) ) ; this . serverEnable = true ; return response ; } catch ( Exception e ) { // 将这个JobTracker移除 jobTrackers . remove ( ...
public class ExtensionListView { /** * Creates a seriously hacked up { @ link CopyOnWriteList } that acts as a view to the current { @ link ExtensionList } . */ public static < T > CopyOnWriteList < T > createCopyOnWriteList ( final Class < T > type ) { } }
return new CopyOnWriteList < T > ( ) { private ExtensionList < T > storage ( ) { return Jenkins . getInstance ( ) . getExtensionList ( type ) ; } @ Override public void add ( T t ) { storage ( ) . add ( t ) ; } @ Override public boolean remove ( T t ) { return storage ( ) . remove ( t ) ; } @ Override public Iterator <...
public class AsciiString { /** * Either copy or share a subset of underlying sub - sequence of bytes . * @ param start the offset of the first character ( inclusive ) . * @ param end The index to stop at ( exclusive ) . * @ param copy If { @ code true } then a copy of the underlying storage will be made . * If ...
if ( isOutOfBounds ( start , end - start , length ( ) ) ) { throw new IndexOutOfBoundsException ( "expected: 0 <= start(" + start + ") <= end (" + end + ") <= length(" + length ( ) + ')' ) ; } if ( start == 0 && end == length ( ) ) { return this ; } if ( end == start ) { return EMPTY_STRING ; } return new AsciiString (...
public class NatsConnection { /** * Should only be called from closeSocket or close */ void closeSocketImpl ( ) { } }
this . currentServerURI = null ; // Signal the reader and writer this . reader . stop ( ) ; this . writer . stop ( ) ; // Close the current socket and cancel anyone waiting for it this . dataPortFuture . cancel ( true ) ; try { if ( this . dataPort != null ) { this . dataPort . close ( ) ; } } catch ( IOException ex ) ...
public class FedoraClient { /** * Get tuples from the remote resource index . The map contains * < em > String < / em > values for parameters that should be passed to the * service . Two parameters are required : 1 ) lang 2 ) query Two parameters to * the risearch service are implied : 1 ) type = tuples 2 ) forma...
params . put ( "type" , "tuples" ) ; params . put ( "format" , RDFFormat . SPARQL . getName ( ) ) ; try { String url = getRIQueryURL ( params ) ; return TupleIterator . fromStream ( get ( url , true , true ) , RDFFormat . SPARQL ) ; } catch ( TrippiException e ) { throw new IOException ( "Error getting tuple iterator: ...
public class AbstractLRParser { /** * This method is called for reduce actions . * @ param grammarRuleId * is the rule id which is to be applied for reduction . * @ throws ParserException * is thrown if the rule can not successfully be applied . */ private final void reduce ( ParserAction action ) throws Parser...
try { Production production = getGrammar ( ) . getProduction ( action . getParameter ( ) ) ; for ( int i = 0 ; i < production . getConstructions ( ) . size ( ) ; i ++ ) { /* * The for loop is run as many times as the production contains constructions * which are added up for an AST node . */ stateStack . pop ( ) ; } ...
public class PathMappingResult { /** * Creates a new instance with the specified { @ code path } , { @ code query } and the extracted path parameters . */ public static PathMappingResult of ( String path , @ Nullable String query , Map < String , String > rawPathParams ) { } }
return of ( path , query , rawPathParams , LOWEST_SCORE ) ;
public class URLConnection { /** * Skips through the specified number of bytes from the stream * until either EOF is reached , or the specified * number of bytes have been skipped */ static private long skipForward ( InputStream is , long toSkip ) throws IOException { } }
long eachSkip = 0 ; long skipped = 0 ; while ( skipped != toSkip ) { eachSkip = is . skip ( toSkip - skipped ) ; // check if EOF is reached if ( eachSkip <= 0 ) { if ( is . read ( ) == - 1 ) { return skipped ; } else { skipped ++ ; } } skipped += eachSkip ; } return skipped ;
public class OperationImpl { /** * { @ inheritDoc } */ @ Override public Operation addCallback ( String key , Callback value ) { } }
if ( value == null ) { return this ; } if ( this . callbacks == null ) { this . callbacks = new HashMap < > ( ) ; } callbacks . put ( key , value ) ; return this ;
public class JDBCRestClientUtil { /** * 并行批处理导入 * @ param indexName * @ param indexType * @ param batchsize * @ param refreshOption * @ return */ private String parallelBatchExecute ( String indexName , String indexType , int batchsize , String refreshOption ) { } }
int count = 0 ; StringBuilder builder = new StringBuilder ( ) ; BBossStringWriter writer = new BBossStringWriter ( builder ) ; String ret = null ; ExecutorService service = jdbcResultSet . buildThreadPool ( ) ; List < Future > tasks = new ArrayList < Future > ( ) ; int taskNo = 0 ; ImportCount totalCount = new ImportCo...
public class Normalizer2Impl { private boolean isDecompYesAndZeroCC ( int norm16 ) { } }
return norm16 < minYesNo || norm16 == JAMO_VT || ( minMaybeYes <= norm16 && norm16 <= MIN_NORMAL_MAYBE_YES ) ;
public class MessageProcessorControl { /** * / * ( non - Javadoc ) * @ see com . ibm . ws . sib . processor . runtime . MessageProcessorControllable # getForeignBusIterator ( ) */ public SIMPIterator getForeignBusIterator ( ) { } }
ForeignBusTypeFilter filter = new ForeignBusTypeFilter ( ) ; SIMPIterator foreignBusItr = destinationManager . getForeignBusIndex ( ) . iterator ( filter ) ; return new ControllableIterator ( foreignBusItr ) ;
public class AnnotationUtils { /** * Searches for a class annotation . All inheritance tree is analysed . * @ since 3.1 */ public static < A extends Annotation > A getAnnotation ( Object objectOrClass , Class < A > annotationClass ) { } }
Class < ? > initialClass = objectOrClass instanceof Class < ? > ? ( Class < ? > ) objectOrClass : objectOrClass . getClass ( ) ; for ( Class < ? > aClass = initialClass ; aClass != null ; aClass = aClass . getSuperclass ( ) ) { A result = aClass . getAnnotation ( annotationClass ) ; if ( result != null ) { return resul...
public class AbstractJsonGetter { /** * Converts a JsonValue object to its corresponding Java object . * Type mappings are as shown below * < ul > * < li > { @ link com . hazelcast . internal . json . JsonString } to { @ link String } < / li > * < li > { @ link com . hazelcast . internal . json . Json . NULL } ...
if ( value == null ) { return null ; } else if ( value . isNumber ( ) ) { if ( value . toString ( ) . contains ( "." ) ) { return value . asDouble ( ) ; } else { return value . asLong ( ) ; } } else if ( value . isBoolean ( ) ) { return value . asBoolean ( ) ; } else if ( value . isNull ( ) ) { return null ; } else if ...
public class InstanceMarshaller { /** * Marshall the given parameter object . */ public void marshall ( Instance instance , ProtocolMarshaller protocolMarshaller ) { } }
if ( instance == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( instance . getId ( ) , ID_BINDING ) ; protocolMarshaller . marshall ( instance . getCreatorRequestId ( ) , CREATORREQUESTID_BINDING ) ; protocolMarshaller . marshall ( instance...
public class ThriftRangeUtils { /** * Returns the specified token as a { @ link java . lang . String } . * @ param tokenAsComparable a token represented as a { @ link java . lang . Comparable } . * @ return the specified token as a { @ link java . lang . String } . */ @ SuppressWarnings ( "unchecked" ) public Strin...
ByteBuffer bb = tokenType . decompose ( tokenAsComparable ) ; Token token = tokenFactory . fromByteArray ( bb ) ; return tokenFactory . toString ( token ) ;
public class ScalarFieldUpdater { /** * where ~ is the MV value separator . */ private boolean updateMVScalar ( String currentValue ) { } }
boolean bUpdated = false ; Set < String > currentValues = Utils . split ( currentValue , CommonDefs . MV_SCALAR_SEP_CHAR ) ; Set < String > newValueSet = mergeMVFieldValues ( currentValues , m_dbObj . getRemoveValues ( m_fieldName ) , m_dbObj . getFieldValues ( m_fieldName ) ) ; String newValue = Utils . concatenate ( ...
public class Kernel { /** * Change the Janus context of the kernel . * @ param janusContext the new janus kernel . It must be never < code > null < / code > . */ @ Inject void setJanusContext ( @ io . janusproject . kernel . annotations . Kernel AgentContext janusContext ) { } }
assert janusContext != null ; this . janusContext = janusContext ;
public class SchedulerService { /** * Binds all Classes and methods Annotated with @ Scheduled into a Guice Binder . * @ param binder * @ param reflections */ public static void bindScheduled ( Binder binder , Reflections reflections ) { } }
Set < Class < ? > > classes = reflections . getTypesAnnotatedWith ( Scheduled . class , true ) ; Set < Method > methods = reflections . getMethodsAnnotatedWith ( Scheduled . class ) ; Set < SchedulerTask > tasks = new HashSet < SchedulerTask > ( ) ; for ( Class < ? > clazz : classes ) { if ( Runnable . class . isAssign...
public class JobContext { /** * Initialize current thread ' s JobContext using specified copy * @ param origin the original job context */ static void loadFromOrigin ( JobContext origin ) { } }
if ( origin . bag_ . isEmpty ( ) ) { return ; } ActContext < ? > actContext = ActContext . Base . currentContext ( ) ; if ( null != actContext ) { Locale locale = ( Locale ) origin . bag_ . get ( "locale" ) ; if ( null != locale ) { actContext . locale ( locale ) ; } H . Session session = ( H . Session ) origin . bag_ ...
public class CreateCsvClassifierRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( CreateCsvClassifierRequest createCsvClassifierRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( createCsvClassifierRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( createCsvClassifierRequest . getName ( ) , NAME_BINDING ) ; protocolMarshaller . marshall ( createCsvClassifierRequest . getDelimiter ( ) , DELIMITER_BINDING ...
public class AbstractCDIArchive { /** * Load classes from a bean deployment archive ( BDA ) * Classes in the internalClassNames set will only be loaded if they are loaded directly by the BDA ' s classloader . * Classes in the additionalClassNames will be loaded unconditionally , as long as the BDA can access them ....
ClassNotFoundException . class , LinkageError . class } ) public Map < String , Class < ? > > loadBdaClasses ( Set < String > internalClassNames , Set < String > additionalClassNames ) throws CDIException { Map < String , Class < ? > > classes = new HashMap < String , Class < ? > > ( ) ; ClassLoader classLoader = getCl...
public class SettingsInMemory { /** * Get a Settings property as an c object . * @ param aClass the class the property is related to * @ param key the Settings name * @ param defaultValue the default value to return if the property does not exist * @ return the Settings character */ public Character getCharacte...
String results = getText ( aClass , key , "" ) ; if ( results . length ( ) == 0 ) return Character . valueOf ( defaultValue ) ; else return Character . valueOf ( results . charAt ( 0 ) ) ; // return first character
public class VoltDDLElementTracker { /** * Track an exported table * @ param tableName a table name * @ param targetName * @ throws VoltCompilerException when the given table is already exported */ void addExportedTable ( String tableName , String targetName , boolean isStream ) { } }
assert tableName != null && ! tableName . trim ( ) . isEmpty ( ) ; assert targetName != null && ! targetName . trim ( ) . isEmpty ( ) ; // store uppercase in the catalog as typename targetName = targetName . toUpperCase ( ) ; if ( isStream ) { // insert the table ' s name into the export group NavigableSet < String > t...
public class Matrix4f { /** * Apply a " lookat " transformation to this matrix for a right - handed coordinate system , * that aligns < code > - z < / code > with < code > center - eye < / code > and store the result in < code > dest < / code > . * This method assumes < code > this < / code > to be a perspective tr...
// Compute direction from position to lookAt float dirX , dirY , dirZ ; dirX = eyeX - centerX ; dirY = eyeY - centerY ; dirZ = eyeZ - centerZ ; // Normalize direction float invDirLength = 1.0f / ( float ) Math . sqrt ( dirX * dirX + dirY * dirY + dirZ * dirZ ) ; dirX *= invDirLength ; dirY *= invDirLength ; dirZ *= inv...
public class Block { /** * < p > Finds a value of nonce that makes the blocks hash lower than the difficulty target . This is called mining , but * solve ( ) is far too slow to do real mining with . It exists only for unit testing purposes . * < p > This can loop forever if a solution cannot be found solely by incr...
while ( true ) { try { // Is our proof of work valid yet ? if ( checkProofOfWork ( false ) ) return ; // No , so increment the nonce and try again . setNonce ( getNonce ( ) + 1 ) ; } catch ( VerificationException e ) { throw new RuntimeException ( e ) ; // Cannot happen . } }
public class CommerceVirtualOrderItemUtil { /** * Returns the last commerce virtual order item in the ordered set where uuid = & # 63 ; . * @ param uuid the uuid * @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > ) * @ return the last matching commerce virtual ord...
return getPersistence ( ) . fetchByUuid_Last ( uuid , orderByComparator ) ;
public class MvpProcessor { /** * < p > 1 ) Generates tag for identification MvpPresenter < / p > * < p > 2 ) Checks if presenter with tag is already exist in { @ link com . arellomobile . mvp . PresenterStore } , and returns it < / p > * < p > 3 ) If { @ link com . arellomobile . mvp . PresenterStore } doesn ' t c...
Class < ? extends MvpPresenter < ? > > presenterClass = presenterField . getPresenterClass ( ) ; PresenterStore presenterStore = MvpFacade . getInstance ( ) . getPresenterStore ( ) ; PresenterType type = presenterField . getPresenterType ( ) ; String tag ; if ( type == PresenterType . LOCAL ) { tag = delegateTag + "$" ...
public class DescribeThingResult { /** * The thing attributes . * @ param attributes * The thing attributes . * @ return Returns a reference to this object so that method calls can be chained together . */ public DescribeThingResult withAttributes ( java . util . Map < String , String > attributes ) { } }
setAttributes ( attributes ) ; return this ;
public class MessageType { /** * Create a message instance of the given type */ public static AbstractMessage createInstance ( byte type ) { } }
switch ( type ) { case EMPTY : return new EmptyMessageImpl ( ) ; case BYTES : return new BytesMessageImpl ( ) ; case MAP : return new MapMessageImpl ( ) ; case OBJECT : return new ObjectMessageImpl ( ) ; case STREAM : return new StreamMessageImpl ( ) ; case TEXT : return new TextMessageImpl ( ) ; default : throw new Il...
public class ParserBase { /** * - - for testing purpose */ public static void p ( int i , Regex r ) { } }
if ( 0 == i ) { System . out . println ( i + ": " + r . stringMatched ( ) ) ; } else { System . out . println ( i + ": " + r . stringMatched ( i ) ) ; }
public class ListUtil { /** * Clears out the first element that is functionally equal to the * supplied element ( < code > element . equals ( list [ idx ] ) < / code > ) . * @ return the object that was cleared from the array or null if no * matching object was found . */ public static Object clear ( Object [ ] l...
return clear ( EQUALS_COMP , list , element ) ;
public class Cell { /** * Sets the minWidth , prefWidth , and maxWidth to the specified value . */ public Cell < C , T > width ( float width ) { } }
width ( new FixedValue < C , T > ( layout . toolkit , width ) ) ; return this ;
public class StencilEngine { /** * Renders template loaded from path and returns rendered text . * @ param path Path to load template from * @ param extraGlobalScopes Any extra global scopes to make available * @ return Rendered text * @ throws IOException * @ throws ParseException */ public String render ( S...
return render ( load ( path ) , extraGlobalScopes ) ;
public class SignatureSpi { /** * Verifies the passed - in signature in the specified array * of bytes , starting at the specified offset . * < p > Note : Subclasses should overwrite the default implementation . * @ param sigBytes the signature bytes to be verified . * @ param offset the offset to start from in...
byte [ ] sigBytesCopy = new byte [ length ] ; System . arraycopy ( sigBytes , offset , sigBytesCopy , 0 , length ) ; return engineVerify ( sigBytesCopy ) ;
public class Executor { /** * / * protected */ void start ( WorkUnit task ) { } }
lock . writeLock ( ) . lock ( ) ; try { this . workUnit = task ; super . start ( ) ; started = true ; } finally { lock . writeLock ( ) . unlock ( ) ; }
public class UpdateS3ResourcesResult { /** * The S3 resources whose classification types can ' t be updated . An error code and an error message are provided for * each failed item . * @ param failedS3Resources * The S3 resources whose classification types can ' t be updated . An error code and an error message a...
if ( failedS3Resources == null ) { this . failedS3Resources = null ; return ; } this . failedS3Resources = new java . util . ArrayList < FailedS3Resource > ( failedS3Resources ) ;
public class Log { /** * If called with " a . b . c . d " , it will test for a . b . c . d , a . b . c , a . b , a */ private static Integer getLogLevel ( String tag ) { } }
Integer result = logLevels . get ( tag ) ; if ( tag != null && result == null ) { int index = tag . lastIndexOf ( "." ) ; while ( result == null && index > - 1 ) { result = logLevels . get ( tag . substring ( 0 , index ) ) ; index = tag . lastIndexOf ( "." , index - 1 ) ; } } return result ;
public class FingerprinterTool { /** * Checks whether all the positive bits in BitSet bs2 occur in BitSet bs1 . If * so , the molecular structure from which bs2 was generated is a possible * substructure of bs1 . < p > * Example : < pre > * Molecule mol = MoleculeFactory . makeIndole ( ) ; * BitSet bs = Finge...
BitSet clone = ( BitSet ) bs1 . clone ( ) ; clone . and ( bs2 ) ; if ( clone . equals ( bs2 ) ) { return true ; } return false ;
public class AbstractIoBufferEx { /** * This method forwards the call to { @ link # expand ( int ) } only when * < tt > autoExpand < / tt > property is < tt > true < / tt > . */ private AbstractIoBufferEx autoExpand ( int pos , int expectedRemaining ) { } }
if ( isAutoExpand ( ) ) { expand ( pos , expectedRemaining , true , autoExpander ) ; } return this ;
public class JadexMessenger { /** * This method works as the one above , adding some properties to the message * @ param agent _ name * The id of the agents that receive the message * @ param msgtype * @ param message _ content * The content of the message * @ param properties * to be added to the message...
HashMap < String , Object > hm = new HashMap < String , Object > ( ) ; hm . put ( "performative" , msgtype ) ; hm . put ( SFipa . CONTENT , message_content ) ; for ( Object property : properties ) { // Logger logger = Logger . getLogger ( " JadexMessenger " ) ; // logger . info ( " Sending message with extra property :...
public class Iterators { /** * Returns an iterator that combines the iterators * that are returned by the given iterator . * @ param < S > The iterator type * @ param < T > The element type * @ param iteratorsIterator The iterator iterator . May not provide * < code > null < / code > iterators . * @ return ...
Objects . requireNonNull ( iteratorsIterator , "The iteratorsIterator is null" ) ; return new CombiningIterator < T > ( iteratorsIterator ) ;