signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class ConnectionCache { /** * The main loop of the cache , which checks for expirations . * @ return true if the thread should be stopped . * @ throws InterruptedException if the thread was interrupted while blocking . */ private boolean mainLoop ( ) throws InterruptedException { } }
long now = System . currentTimeMillis ( ) ; Iterator list = m_hardStore . values ( ) . iterator ( ) ; while ( list . hasNext ( ) ) { Entry entry = ( Entry ) list . next ( ) ; if ( entry . m_collectTime < now ) { m_weakStore . put ( entry . m_connection , DUMMY ) ; list . remove ( ) ; } } if ( m_hardStore . size ( ) == ...
public class VaultsInner { /** * The List operation gets information about the vaults associated with the subscription . * @ param top Maximum number of results to return . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the PagedList & lt ; Resource & gt ...
return listWithServiceResponseAsync ( top ) . map ( new Func1 < ServiceResponse < Page < Resource > > , Page < Resource > > ( ) { @ Override public Page < Resource > call ( ServiceResponse < Page < Resource > > response ) { return response . body ( ) ; } } ) ;
public class Widgets { /** * Converts from { @ link com . google . gwt . dom . client . Element } & rarr ; { @ link HTMLElement } . */ public static HTMLElement element ( com . google . gwt . dom . client . Element element ) { } }
return Js . cast ( element ) ;
public class TrustedIdProvidersInner { /** * Gets the specified Data Lake Store trusted identity provider . * @ param resourceGroupName The name of the Azure resource group . * @ param accountName The name of the Data Lake Store account . * @ param trustedIdProviderName The name of the trusted identity provider t...
return ServiceFuture . fromResponse ( getWithServiceResponseAsync ( resourceGroupName , accountName , trustedIdProviderName ) , serviceCallback ) ;
public class Matchers { /** * Returns a Matcher that returns true only if all of the provided * matchers match . */ public static Matcher allOf ( final Matcher ... matchers ) { } }
return new Matcher ( ) { @ Override public boolean matches ( Node node , NodeMetadata metadata ) { for ( Matcher m : matchers ) { if ( ! m . matches ( node , metadata ) ) { return false ; } } return true ; } } ;
public class Beans { /** * Invokes a bean method by choosing the best method that matches the given name and the list of arguments . * @ param bean the invocation target * @ param name the name of the method to invoke * @ param args the arguments to pass to the method * @ return the return value from the method...
Class < ? > [ ] argumentTypes = new Class < ? > [ args . length ] ; for ( int i = 0 ; i < args . length ; i ++ ) { argumentTypes [ i ] = args [ i ] . getClass ( ) ; } return choose ( bean . getClass ( ) . getMethods ( ) , new MethodParameterExtractor ( ) , name , argumentTypes ) . invoke ( bean , args ) ;
public class MasterJournalContext { /** * Waits for the flush counter to be flushed to the journal . If the counter is * { @ link # INVALID _ FLUSH _ COUNTER } , this is a noop . */ private void waitForJournalFlush ( ) throws UnavailableException { } }
if ( mFlushCounter == INVALID_FLUSH_COUNTER ) { // Check this before the precondition . return ; } RetryPolicy retry = new TimeoutRetry ( FLUSH_RETRY_TIMEOUT_MS , FLUSH_RETRY_INTERVAL_MS ) ; while ( retry . attempt ( ) ) { try { mAsyncJournalWriter . flush ( mFlushCounter ) ; return ; } catch ( IOException e ) { LOG . ...
public class ApiOvhXdsl { /** * Alter this object properties * REST : PUT / xdsl / templateModem / { name } * @ param body [ required ] New object properties * @ param name [ required ] Name of the Modem Template */ public void templateModem_name_PUT ( String name , OvhTemplateModem body ) throws IOException { } ...
String qPath = "/xdsl/templateModem/{name}" ; StringBuilder sb = path ( qPath , name ) ; exec ( qPath , "PUT" , sb . toString ( ) , body ) ;
public class ServerInterceptors { /** * Create a new { @ code ServerServiceDefinition } whose { @ link ServerCallHandler } s will call * { @ code interceptors } before calling the pre - existing { @ code ServerCallHandler } . The last * interceptor will have its { @ link ServerInterceptor # interceptCall } called f...
return intercept ( serviceDef , Arrays . asList ( interceptors ) ) ;
public class AbstractJaxb { /** * delete element that has specified attribute within descendant element * of oneself . you can ' t delete oneself . * @ param target * @ return if success to delete , return true . if no hit , return false . */ public < T extends AbstractJaxb > boolean remove ( T target ) { } }
String id = target . getId ( ) ; if ( id == null ) { for ( int i = 0 ; i < 256 ; i ++ ) { id = UUID . randomUUID ( ) . toString ( ) ; if ( this . getById ( id ) == null ) { target . setId ( id ) ; break ; } } } return RemoveByIdUtil . removeById ( id , this ) ;
public class JsonAssert { /** * Asserts that given node is present and is not null . * @ return */ @ Override public JsonAssert isNotNull ( ) { } }
isPresent ( "not null" ) ; Node node = getNode ( actual , "" ) ; if ( node . getNodeType ( ) == NULL ) { failOnType ( node , "not null" ) ; } return this ;
public class TagletWriterImpl { /** * { @ inheritDoc } */ protected Content codeTagOutput ( Element element , DocTree tag ) { } }
CommentHelper ch = utils . getCommentHelper ( element ) ; StringContent content = new StringContent ( utils . normalizeNewlines ( ch . getText ( tag ) ) ) ; Content result = HtmlTree . CODE ( content ) ; return result ;
public class Deadline { /** * Determines the amount of time left ( in a custom unit ) until the deadline ; if the deadline has been reached or passed this * method returns 0 * @ param unit * a unit of time * @ return the amount of time left before this deadline expires , converted ( using < code > TimeUnit . co...
final long left = unit . convert ( getTimeLeft ( ) , TimeUnit . MILLISECONDS ) ; if ( left > 0 ) return left ; else return 0 ;
public class GroupDefImpl { /** * / * ( non - Javadoc ) * @ see org . jboss . arquillian . impl . configuration . api . GroupDef # getGroupContainers ( ) */ @ Override public List < ContainerDef > getGroupContainers ( ) { } }
List < ContainerDef > containers = new ArrayList < ContainerDef > ( ) ; for ( Node container : group . get ( "container" ) ) { containers . add ( new GroupContainerDefImpl ( getDescriptorName ( ) , getRootNode ( ) , group , container ) ) ; } return containers ;
public class DirContextPooledObjectFactory { /** * @ see BaseKeyedPooledObjectFactory # validateObject ( Object , PooledObject ) */ @ Override public boolean validateObject ( Object key , PooledObject < Object > pooledObject ) { } }
Assert . notNull ( this . dirContextValidator , "DirContextValidator may not be null" ) ; Assert . isTrue ( key instanceof DirContextType , "key must be a DirContextType" ) ; Assert . notNull ( pooledObject , "The Object to validate must not be null" ) ; Assert . isTrue ( pooledObject . getObject ( ) instanceof DirCont...
public class ValidationExecutorSetRegistry { /** * Find the validation executor set with the specified ID . * @ param aID * The ID to search . May be < code > null < / code > . * @ return < code > null < / code > if no such validation executor set is registered . */ @ Nullable public IValidationExecutorSet getOfI...
if ( aID == null ) return null ; return m_aRWLock . readLocked ( ( ) -> m_aMap . get ( aID ) ) ;
public class MetaBucket { /** * Putting an entry to the map . * @ param pKey * to be stored . * @ param pVal * to be stored . * @ return if entry already existing , return that one . * @ see ConcurrentHashMap # put ( Object , Object ) */ public IMetaEntry put ( final IMetaEntry pKey , final IMetaEntry pVal ...
return mMetaMap . put ( pKey , pVal ) ;
public class ElementFilter { /** * Returns a list of { @ code requires } directives in { @ code directives } . * @ return a list of { @ code requires } directives in { @ code directives } * @ param directives the directives to filter * @ since 9 * @ spec JPMS */ public static List < RequiresDirective > requires...
return listFilter ( directives , DirectiveKind . REQUIRES , RequiresDirective . class ) ;
public class NuCharsetEncoder { /** * Implementation of { @ link NuProcessHandler # onStdinReady ( ByteBuffer ) } which * calls { @ link handler } with a string buffer then encodes it to bytes and * feeds it to the process ' s stdin . * @ param buffer The { @ link ByteBuffer } passed to * { @ link NuProcessHand...
// TODO : Should we avoid invoking onStdinReady ( ) when it returned false previously ? boolean endOfInput = ! this . handler . onStdinReady ( charBuffer ) ; CoderResult encoderResult = encoder . encode ( charBuffer , buffer , endOfInput ) ; buffer . flip ( ) ; charBuffer . compact ( ) ; if ( encoderResult . isError ( ...
public class DeviceProxy { protected void check_asynch_reply ( Request request , int id , String idl_cmd ) throws DevFailed , AsynReplyNotArrived { } }
deviceProxyDAO . check_asynch_reply ( this , request , id , idl_cmd ) ;
public class DocumentUrl { /** * Get Resource Url for DeleteDocument * @ param documentId Unique identifier for a document , used by content and document calls . Document IDs are associated with document types , document type lists , sites , and tenants . * @ param documentListName Name of content documentListName ...
UrlFormatter formatter = new UrlFormatter ( "/api/content/documentlists/{documentListName}/documents/{documentId}" ) ; formatter . formatUrl ( "documentId" , documentId ) ; formatter . formatUrl ( "documentListName" , documentListName ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TEN...
public class CoreUtils { /** * Create a bounded thread pool executor . The work queue is synchronous and can cause * RejectedExecutionException if there is no available thread to take a new task . * @ param maxPoolSize : the maximum number of threads to allow in the pool . * @ param keepAliveTime : when the numbe...
return new ThreadPoolExecutor ( 0 , maxPoolSize , keepAliveTime , unit , new SynchronousQueue < Runnable > ( ) , tFactory ) ;
public class CnvTfsLong { /** * < p > Convert from string . < / p > * @ param pAddParam additional params , e . g . IRequestData * to fill owner itsVersion . * @ param pStrVal string representation * @ return Long value * @ throws Exception - an exception */ @ Override public final Long fromString ( final Map...
if ( pStrVal == null || "" . equals ( pStrVal ) ) { return null ; } if ( pAddParam != null ) { String dgsep = ( String ) pAddParam . get ( "decGrSepv" ) ; if ( dgsep != null ) { String strVal = pStrVal . replace ( dgsep , "" ) ; return Long . valueOf ( strVal ) ; } } return Long . valueOf ( pStrVal ) ;
public class PortalPreAuthenticatedProcessingFilter { /** * Get the values represented by each token from the request and load them into a HashMap that * is returned . * @ param tokens * @ param request * @ return HashMap of properties */ private HashMap < String , String > getPropertyFromRequest ( HashMap < St...
// Iterate through all of the other property keys looking for the first property // named like propname that has a value in the request HashMap < String , String > retHash = new HashMap < > ( ) ; for ( Map . Entry < String , String > entry : tokens . entrySet ( ) ) { String contextName = entry . getKey ( ) ; String par...
public class HarFileSystem { /** * Fix offset and length of block locations . * Note that this method modifies the original array . * @ param locations block locations of har part file * @ param start the start of the desired range in the contained file * @ param len the length of the desired range * @ param ...
// offset 1 past last byte of desired range long end = start + len ; for ( BlockLocation location : locations ) { // offset of part block relative to beginning of desired file // ( may be negative if file starts in this part block ) long harBlockStart = location . getOffset ( ) - fileOffsetInHar ; // offset 1 past last...
public class Dom { /** * TODO : replace by iterator ? */ public static List < Element > getAllChildElements ( Element parent ) { } }
List < Element > result ; NodeList nodes ; int i ; int max ; Node node ; result = new ArrayList < > ( ) ; nodes = parent . getChildNodes ( ) ; max = nodes . getLength ( ) ; for ( i = 0 ; i < max ; i ++ ) { node = nodes . item ( i ) ; if ( node instanceof Element ) { result . add ( ( Element ) node ) ; } } return result...
public class BlockDrawingHelper { /** * Draw a filled cuboid of Minecraft blocks of a single type . * @ param c Contains information about the cuboid to be drawn . * @ param w The world in which to draw . * @ throws Exception Throws an exception if the block type is not recognised . */ private void DrawPrimitive ...
XMLBlockState blockType = new XMLBlockState ( c . getType ( ) , c . getColour ( ) , c . getFace ( ) , c . getVariant ( ) ) ; if ( ! blockType . isValid ( ) ) throw new Exception ( "Unrecogised item type: " + c . getType ( ) . value ( ) ) ; int x1 = Math . min ( c . getX1 ( ) , c . getX2 ( ) ) ; int x2 = Math . max ( c ...
public class PhotosApi { /** * Get information about a photo . The calling user must have permission to view the photo . * < br > * This method does not require authentication . * @ param photoId Required . The id of the photo to get information for . * @ param secret Optional . The secret for the photo . If th...
JinxUtils . validateParams ( photoId ) ; Map < String , String > params = new TreeMap < > ( ) ; params . put ( "method" , "flickr.photos.getInfo" ) ; params . put ( "photo_id" , photoId ) ; if ( ! JinxUtils . isNullOrEmpty ( secret ) ) { params . put ( "secret" , secret ) ; } return jinx . flickrGet ( params , PhotoInf...
public class RemoteFieldTable { /** * Does this list have a next record ? * @ return true if there is a next record to read . */ public boolean hasNext ( ) throws DBException { } }
if ( m_iCurrentRecord >= m_iRecordsAccessed ) return true ; Object record = this . next ( ) ; if ( record == null ) return false ; else { m_iRecordsAccessed -- ; // Offically this record has not been accessed return true ; }
public class AOStreamIterator { /** * / * ( non - Javadoc ) * @ see java . util . Iterator # next ( ) */ public Object next ( ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "next" ) ; } Object result ; if ( msgIterator . hasNext ( ) ) { Long valueStamp = ( Long ) msgIterator . next ( ) ; result = new TransmitMessageRequest ( valueStamp . longValue ( ) , aoStream . itemStream , aoStream , mess...
public class ClasspathOrder { /** * Add a system classpath entry . * @ param pathEntry * the system classpath entry - - the path string should already have been run through * FastPathResolver . resolve ( FileUtils . CURR _ DIR _ PATH , path * @ param classLoader * the classloader * @ return true , if added ...
if ( classpathEntryUniqueResolvedPaths . add ( pathEntry ) ) { order . add ( new SimpleEntry < > ( pathEntry , classLoader ) ) ; return true ; } return false ;
public class ProgressBarDrawable { /** * Gets the progress bar padding . */ @ Override public boolean getPadding ( Rect padding ) { } }
padding . set ( mPadding , mPadding , mPadding , mPadding ) ; return mPadding != 0 ;
public class Command { /** * Executes the command . Before execution is validates Parameters args using the * defined schema . The command execution intercepts ApplicationException raised * by the called function and throws them . * @ param correlationId optional transaction id to trace calls across * component...
if ( _schema != null ) _schema . validateAndThrowException ( correlationId , args ) ; try { return _function . execute ( correlationId , args ) ; } catch ( Throwable ex ) { throw new InvocationException ( correlationId , "EXEC_FAILED" , "Execution " + _name + " failed: " + ex ) . withDetails ( "command" , _name ) . wra...
public class Widgets { /** * Creates an image with the supplied resource and style . */ public static Image newImage ( ImageResource image , String ... styles ) { } }
return setStyleNames ( new Image ( image ) , styles ) ;
public class CmsFlexBucketConfiguration { /** * Computes the bucket set for a set of paths based on this configuration . < p > * The resulting bucket set contains all buckets for which one of the given paths is below the * configured roots of that bucket . * @ param paths a list of root paths * @ return the buc...
Set < String > bucketNames = Sets . newHashSet ( ) ; for ( String path : paths ) { bucketNames . addAll ( getBucketsForPath ( path ) ) ; } if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( "Determined bucket set " + bucketNames . toString ( ) + " for path set " + paths ) ; } return new BucketSet ( bucketNames ) ;
public class InstanceStateChangeReasonMarshaller { /** * Marshall the given parameter object . */ public void marshall ( InstanceStateChangeReason instanceStateChangeReason , ProtocolMarshaller protocolMarshaller ) { } }
if ( instanceStateChangeReason == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( instanceStateChangeReason . getCode ( ) , CODE_BINDING ) ; protocolMarshaller . marshall ( instanceStateChangeReason . getMessage ( ) , MESSAGE_BINDING ) ; } c...
public class JsonDiff { /** * Computes the difference of two JSON strings , and returns the differences */ public List < JsonDelta > computeDiff ( String node1 , String node2 ) throws IOException { } }
ObjectMapper mapper = new ObjectMapper ( ) ; return computeDiff ( mapper . readTree ( node1 ) , mapper . readTree ( node2 ) ) ;
public class CmsAliasList { /** * Creates the button used for adding new aliases . < p > * @ return the new button */ protected PushButton createAddButton ( ) { } }
PushButton button = createIconButton ( I_CmsButton . ADD_SMALL ) ; button . setTitle ( aliasMessages . addAlias ( ) ) ; return button ;
public class MtasDataDoubleBasic { /** * ( non - Javadoc ) * @ see mtas . codec . util . DataCollector . MtasDataCollector # add ( double , long ) */ @ Override public MtasDataCollector < ? , ? > add ( double valueSum , long valueN ) throws IOException { } }
MtasDataCollector < ? , ? > dataCollector = add ( false ) ; setValue ( newCurrentPosition , valueSum , valueN , newCurrentExisting ) ; return dataCollector ;
public class ReposFragment { /** * Get items to load per page onScroll . * @ param context { @ link Context } * @ return int of num of items that can be loaded onto the screen with scroll enabled */ private int getPerPage ( Context context ) { } }
// fixed item size in recyclerview . Adding 3 enables recyclerview scrolling . return ( context . getResources ( ) . getDisplayMetrics ( ) . heightPixels / context . getResources ( ) . getDimensionPixelSize ( R . dimen . repo_item_height ) ) + 3 ;
public class EstimateSceneCalibrated { /** * An edge has been declared as defining a good stereo pair . All associated feature will now be * triangulated . It is assumed that there is no global coordinate system at this point . */ void triangulateStereoEdges ( Motion edge ) { } }
View viewA = edge . viewSrc ; View viewB = edge . viewDst ; triangulationError . configure ( viewA . camera . pinhole , viewB . camera . pinhole ) ; for ( int i = 0 ; i < edge . associated . size ( ) ; i ++ ) { AssociatedIndex f = edge . associated . get ( i ) ; Point2D_F64 normA = viewA . observationNorm . get ( f . s...
public class FeatureMate { /** * Check for cover . * @ param geometry the geometry to check against . * @ param usePrepared use prepared geometry . * @ return true if the current geometries covers the supplied one . */ public boolean covers ( Geometry geometry , boolean usePrepared ) { } }
if ( ! getEnvelope ( ) . covers ( geometry . getEnvelopeInternal ( ) ) ) { return false ; } if ( usePrepared ) { if ( preparedGeometry == null ) { preparedGeometry = PreparedGeometryFactory . prepare ( getGeometry ( ) ) ; } return preparedGeometry . covers ( geometry ) ; } else { return getGeometry ( ) . covers ( geome...
public class Applications { /** * Gets the list of secure < em > instances < / em > associated to a virtual host * name . * @ param secureVirtualHostName * the virtual hostname for which the secure instances need to be * returned . * @ return list of < em > instances < / em > . */ public List < InstanceInfo >...
return Optional . ofNullable ( this . secureVirtualHostNameAppMap . get ( secureVirtualHostName . toUpperCase ( Locale . ROOT ) ) ) . map ( VipIndexSupport :: getVipList ) . map ( AtomicReference :: get ) . orElseGet ( Collections :: emptyList ) ;
public class SARLQuickfixProvider { /** * Quick fix for " Duplicate field " . * @ param issue the issue . * @ param acceptor the quick fix acceptor . */ @ Fix ( IssueCodes . DUPLICATE_FIELD ) public void fixDuplicateAttribute ( Issue issue , IssueResolutionAcceptor acceptor ) { } }
MemberRemoveModification . accept ( this , issue , acceptor ) ;
public class Single { /** * Concatenates a Publisher sequence of SingleSources eagerly into a single stream of values . * < img width = " 640 " height = " 307 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / Single . concatEager . p . png " alt = " " > * Eager concate...
return Flowable . fromPublisher ( sources ) . concatMapEager ( SingleInternalHelper . < T > toFlowable ( ) ) ;
public class ComponentCollision { /** * Check elements in group . * @ param current The elements in group . */ private void checkGroup ( Entry < Point , Set < Collidable > > current ) { } }
final Set < Collidable > elements = current . getValue ( ) ; for ( final Collidable objectA : elements ) { checkOthers ( objectA , current ) ; }
public class GraphEditorWindow { /** * Indicate that the first property should be displayed */ public void setFirstProperty ( ) { } }
if ( properties . getItemCount ( ) > 0 ) { properties . setSelectedIndex ( 0 ) ; LinearInterpolator currentValue = ( LinearInterpolator ) values . get ( properties . getSelectedItem ( ) ) ; panel . setInterpolator ( currentValue ) ; }
public class CmsSendPopupGroupsDialog { /** * Returns a list of all members of the selected groups . < p > * @ return a list of user objects */ private List < CmsUser > getUsers ( ) { } }
if ( m_users == null ) { m_users = new ArrayList < CmsUser > ( ) ; List < CmsUser > manageableUsers = new ArrayList < CmsUser > ( ) ; try { manageableUsers = OpenCms . getRoleManager ( ) . getManageableUsers ( getCms ( ) , "" , true ) ; } catch ( CmsException e ) { if ( LOG . isErrorEnabled ( ) ) { LOG . error ( e . ge...
public class HFCAAffiliation { /** * The identities affected during request * @ param name Name of the child affiliation * @ return The requested child affiliation * @ throws InvalidArgumentException * @ throws AffiliationException */ public HFCAAffiliation createDecendent ( String name ) throws InvalidArgument...
if ( this . deleted ) { throw new AffiliationException ( "Affiliation has been deleted" ) ; } validateAffiliationNames ( name ) ; return new HFCAAffiliation ( this . name + "." + name , this . client ) ;
public class UpdateSite { /** * Let sub - classes of UpdateSite provide their own signature validator . * @ param name , the name for the JSON signature Validator object . * if name is null , then the default name will be used , * which is " update site " followed by the update site id * @ return the signature ...
if ( name == null ) { name = signatureValidatorPrefix + " '" + id + "'" ; } return new JSONSignatureValidator ( name ) ;
public class BinaryGrailsPlugin { /** * Resolves a static resource contained within this binary plugin * @ param path The relative path to the static resource * @ return The resource or null if it doesn ' t exist */ public Resource getResource ( String path ) { } }
final Resource descriptorResource = descriptor . getResource ( ) ; try { Resource resource = descriptorResource . createRelative ( "static" + path ) ; if ( resource . exists ( ) ) { return resource ; } } catch ( IOException e ) { return null ; } return null ;
public class Resources { /** * Constructs a resource from a string representation . Defaults to a file based resource if no schema is present . * @ param resource The string representation of the resource * @ return A resource representing the string representation */ public static Resource from ( String resource )...
if ( StringUtils . isNullOrBlank ( resource ) ) { return new StringResource ( ) ; } Matcher matcher = protocolPattern . matcher ( resource ) ; if ( matcher . find ( ) ) { String schema = matcher . group ( "PROTOCOL" ) ; String options = matcher . group ( "OPTIONS" ) ; String path = matcher . group ( "PATH" ) ; if ( Str...
public class AbstractSubscriptionPublisher { /** * Adds multiple broadcast filters to the provider . * @ param filters the filters to add . * @ see AbstractSubscriptionPublisher # addBroadcastFilter ( BroadcastFilterImpl filter ) */ @ Override public void addBroadcastFilter ( BroadcastFilterImpl ... filters ) { } }
List < BroadcastFilterImpl > filtersList = Arrays . asList ( filters ) ; for ( BroadcastFilterImpl filter : filtersList ) { addBroadcastFilter ( filter ) ; }
public class Interval { /** * Test if an interval is between two others . * @ param that interval * @ param other interval * @ return true if this interval is after that and before the other * @ see # before ( org . nmdp . ngs . fca . Interval ) * @ see # after ( org . nmdp . ngs . fca . Interval ) */ public ...
checkNotNull ( this . range , that . range ) ; checkNotNull ( other . range ) ; return this . after ( that ) && this . before ( other ) ;
public class TransactionHelper { /** * Begin . * @ throws HandlerException oops */ public void begin ( ) throws HandlerException { } }
if ( _enabled ) { try { _userTx = TransactionManagerLocator . INSTANCE . getUserTransaction ( ) ; if ( _userTx . getStatus ( ) == Status . STATUS_NO_TRANSACTION ) { _userTx . begin ( ) ; _isInitiator = true ; } } catch ( SystemException se ) { throw CommonKnowledgeMessages . MESSAGES . userTransactionBeginFailedSystem ...
public class FilterAdapterContext { /** * < p > beginFilterList . < / p > * @ param lst a { @ link org . apache . hadoop . hbase . filter . FilterList } object . * @ return a { @ link com . google . cloud . bigtable . hbase . adapters . filters . FilterAdapterContext . ContextCloseable } object . */ public ContextC...
Preconditions . checkNotNull ( lst ) ; filterListStack . push ( lst ) ; return new ContextCloseable ( ) { @ Override public void close ( ) { Preconditions . checkState ( filterListStack . peek ( ) . equals ( lst ) ) ; filterListStack . pop ( ) ; } } ;
public class GedAppender { /** * { @ inheritDoc } */ @ Override public void appendString ( final String appendage ) { } }
owner . setString ( owner . getString ( ) . concat ( appendage ) ) ;
public class PrimaveraConvert { /** * Process a single project . * @ param reader Primavera reader * @ param projectID required project ID * @ param outputFile output file name */ private void processProject ( PrimaveraDatabaseReader reader , int projectID , String outputFile ) throws Exception { } }
long start = System . currentTimeMillis ( ) ; reader . setProjectID ( projectID ) ; ProjectFile projectFile = reader . read ( ) ; long elapsed = System . currentTimeMillis ( ) - start ; System . out . println ( "Reading database completed in " + elapsed + "ms." ) ; System . out . println ( "Writing output file started....
public class JobFlowInstancesConfig { /** * Applies to clusters that use the instance fleet configuration . When multiple EC2 subnet IDs are specified , Amazon * EMR evaluates them and launches instances in the optimal subnet . * < note > * The instance fleet configuration is available only in Amazon EMR versions...
if ( this . ec2SubnetIds == null ) { setEc2SubnetIds ( new com . amazonaws . internal . SdkInternalList < String > ( ec2SubnetIds . length ) ) ; } for ( String ele : ec2SubnetIds ) { this . ec2SubnetIds . add ( ele ) ; } return this ;
public class TreeNode { /** * Finds a child TreeNode based on its path . * Searches the child nodes for the first element , then that * node ' s children for the second element , etc . * @ throws IllegalArgumentException if no such node exists */ @ SuppressWarnings ( "unchecked" ) public TreeNode < T > findByPath...
return findByPath ( Arrays . asList ( path ) ) ;
public class Translation { /** * Calculates the transformation . * @ param transformable the transformable * @ param comp the comp */ @ Override protected void doTransform ( ITransformable . Translate transformable , float comp ) { } }
float fromX = reversed ? this . toX : this . fromX ; float toX = reversed ? this . fromX : this . toX ; float fromY = reversed ? this . toY : this . fromY ; float toY = reversed ? this . fromY : this . toY ; float fromZ = reversed ? this . toZ : this . fromZ ; float toZ = reversed ? this . fromZ : this . toZ ; transfor...
public class ASTIsTRUE { /** * to make sure fcn get bound at each new context */ @ Override void apply ( Env env , int argcnt , ASTApply apply ) { } }
double res = env . isDbl ( ) && env . popDbl ( ) == 1.0 ? 1 : 0 ; env . pop ( ) ; env . poppush ( res ) ;
public class NoClientBindProtocolSocketFactory { /** * Attempts to get a new socket connection to the given host within the given time limit . * This method employs several techniques to circumvent the limitations of older JREs that * do not support connect timeout . When running in JRE 1.4 or above reflection is u...
if ( params == null ) { throw new IllegalArgumentException ( "Parameters may not be null" ) ; } int timeout = params . getConnectionTimeout ( ) ; if ( timeout == 0 ) { // ignore the local address / port for binding return createSocket ( host , port ) ; } else { Socket s = new Socket ( ) ; s . connect ( new InetSocketAd...
public class ChannelFrameworkImpl { /** * @ see * com . ibm . wsspi . channelfw . ChannelFramework # registerFactory ( java . lang . String , * java . lang . Class ) */ @ Override public void registerFactory ( String name , Class < ? extends ChannelFactory > factory ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "registerFactory: " + name + "; " + factory ) ; } synchronized ( this . factories ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Class < ? extends ChannelFactory > prevFactory = this . factor...
public class KafkaHelper { /** * Create a producer that can write to this broker * @ param keySerializer Key serializer class * @ param valueSerializer Valuer serializer class * @ param overrideConfig Producer config to override . Pass null if there aren ' t any . * @ param < K > Type of Key * @ param < V > T...
return broker . createProducer ( keySerializer , valueSerializer , overrideConfig ) ;
public class AmazonApiGatewayClient { /** * Gets the < a > RequestValidators < / a > collection of a given < a > RestApi < / a > . * @ param getRequestValidatorsRequest * Gets the < a > RequestValidators < / a > collection of a given < a > RestApi < / a > . * @ return Result of the GetRequestValidators operation ...
request = beforeClientExecution ( request ) ; return executeGetRequestValidators ( request ) ;
public class DemoThreeViewStereoApp { /** * Select two views which are the closest to an idea stereo pair . Little rotation and little translation along * z - axis */ private int [ ] selectBestPair ( SceneStructureMetric structure ) { } }
Se3_F64 w_to_0 = structure . views [ 0 ] . worldToView ; Se3_F64 w_to_1 = structure . views [ 1 ] . worldToView ; Se3_F64 w_to_2 = structure . views [ 2 ] . worldToView ; Se3_F64 view0_to_1 = w_to_0 . invert ( null ) . concat ( w_to_1 , null ) ; Se3_F64 view0_to_2 = w_to_0 . invert ( null ) . concat ( w_to_2 , null ) ;...
public class SpiderTransaction { /** * Add the following row deletion . */ private void deleteRow ( String storeName , String rowKey ) { } }
List < String > rowKeys = m_rowDeletes . get ( storeName ) ; if ( rowKeys == null ) { rowKeys = new ArrayList < > ( ) ; m_rowDeletes . put ( storeName , rowKeys ) ; } rowKeys . add ( rowKey ) ; m_totalUpdates ++ ;
public class StringConcatenation { /** * Return a list of segments where each segment is either the content of a line in the given text or a line - break * according to the configured delimiter . Existing line - breaks in the text will be replaced by this ' s * instances delimiter . * @ param text * the to - be...
if ( text == null ) return Collections . emptyList ( ) ; int idx = initialSegmentSize ( text ) ; if ( idx == text . length ( ) ) { return Collections . singletonList ( text ) ; } return continueSplitting ( text , idx ) ;
public class JvmPauseMonitor { /** * Stops jvm monitor . */ public void stop ( ) { } }
Preconditions . checkState ( mJvmMonitorThread != null , "JVM monitor thread does not start" ) ; mJvmMonitorThread . interrupt ( ) ; try { mJvmMonitorThread . join ( ) ; } catch ( InterruptedException e ) { Thread . currentThread ( ) . interrupt ( ) ; } reset ( ) ;
public class MisoUtil { /** * Convert the given full coordinates to screen - based pixel * coordinates . Converted coordinates are placed in the given * point object . * @ param x the x - position full coordinate . * @ param y the y - position full coordinate . * @ param spos the point object to place coordin...
// get the tile screen position int tx = fullToTile ( x ) , ty = fullToTile ( y ) ; Point tspos = tileToScreen ( metrics , tx , ty , new Point ( ) ) ; // get the pixel position of the fine coords within the tile Point ppos = new Point ( ) ; int fx = x - ( tx * FULL_TILE_FACTOR ) , fy = y - ( ty * FULL_TILE_FACTOR ) ; f...
public class InternalXtextParser { /** * InternalXtext . g : 270:1 : entryRuleParameter : ruleParameter EOF ; */ public final void entryRuleParameter ( ) throws RecognitionException { } }
try { // InternalXtext . g : 271:1 : ( ruleParameter EOF ) // InternalXtext . g : 272:1 : ruleParameter EOF { before ( grammarAccess . getParameterRule ( ) ) ; pushFollow ( FollowSets000 . FOLLOW_1 ) ; ruleParameter ( ) ; state . _fsp -- ; after ( grammarAccess . getParameterRule ( ) ) ; match ( input , EOF , FollowSet...
public class UpgradeInputByteBufferUtil { /** * This method will call the synchronous or asynchronous method depending on how everything is set up * @ return If we have read any data or not * @ throws IOException */ private boolean doRead ( int amountToRead ) throws IOException { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "doRead, Current buffer, " + _buffer + ", reading from the TCP Channel, readLine : " + _isReadLine ) ; } try { if ( _tcpChannelCallback != null && ! _isReadLine ) { // async read logic return immediateRead ( amountToRead ) ; ...
public class RepositoryConfiguration { /** * Resolve the supplied URL to a JSON document , read the contents , and parse into a { @ link RepositoryConfiguration } . * @ param url the URL ; may not be null * @ return the parsed repository configuration ; never null * @ throws ParsingException if the content could ...
CheckArg . isNotNull ( url , "url" ) ; Document doc = Json . read ( url ) ; return new RepositoryConfiguration ( doc , withoutExtension ( url . getFile ( ) ) ) ;
public class Matrix4d { /** * Set this matrix to a rotation transformation to make < code > - z < / code > * point along < code > dir < / code > . * This is equivalent to calling * { @ link # setLookAt ( Vector3dc , Vector3dc , Vector3dc ) setLookAt ( ) } * with < code > eye = ( 0 , 0 , 0 ) < / code > and < cod...
return setLookAlong ( dir . x ( ) , dir . y ( ) , dir . z ( ) , up . x ( ) , up . y ( ) , up . z ( ) ) ;
public class ChecksumPhrase { /** * Public API . */ public Formula getFormula ( ) { } }
Reagent [ ] reagents = new Reagent [ ] { ResourceHelper . CONTEXT_SOURCE , ResourceHelper . LOCATION_PHRASE } ; return new SimpleFormula ( getClass ( ) , reagents ) ;
public class MergeRequestApi { /** * Get Stream of participants of merge request . * < pre > < code > GitLab Endpoint : GET / projects / : id / merge _ requests / : merge _ request _ iid / participants < / code > < / pre > * @ param projectIdOrPath the project in the form of an Integer ( ID ) , String ( path ) , or...
return ( getParticipants ( projectIdOrPath , mergeRequestIid , getDefaultPerPage ( ) ) . stream ( ) ) ;
public class XMLUtil { /** * Write the given node tree into a XML file . * @ param fragment is the object that contains the node tree * @ param writer is the target stream * @ throws IOException if the stream cannot be read . */ public static void writeXML ( DocumentFragment fragment , Writer writer ) throws IOEx...
assert fragment != null : AssertMessages . notNullParameter ( 0 ) ; assert writer != null : AssertMessages . notNullParameter ( 1 ) ; writeNode ( fragment , writer ) ;
public class WSRdbOnePhaseXaResourceImpl { /** * Method to translate the XAResource stuff , including the error code . */ public static final XAException traceXAException ( XAException xae , Class < ? > callerClass ) { } }
Tr . warning ( tc , "THROW_XAEXCEPTION" , new Object [ ] { AdapterUtil . getXAExceptionCodeString ( xae . errorCode ) , xae . getMessage ( ) } ) ; return xae ;
public class PasswordPolicyService { /** * Records the password that was associated with the given user at the time * the user was queried , such that future attempts to set that same password * for that user will be denied . The number of passwords remembered for each * user is limited by the password policy . ...
// Retrieve password policy from environment PasswordPolicy policy = environment . getPasswordPolicy ( ) ; // Nothing to do if history is not being recorded int historySize = policy . getHistorySize ( ) ; if ( historySize <= 0 ) return ; // Store previous password in history passwordRecordMapper . insert ( user . getPa...
public class FbBotMillBean { /** * Retrieves the sender from an envelope . It never returns null . * @ param envelope * the message envelope . * @ return a { @ link User } containing the sender if found , empty otherwise . * It never returns null . */ protected User safeGetSender ( MessageEnvelope envelope ) { ...
if ( envelope != null && envelope . getSender ( ) != null && envelope . getSender ( ) . getId ( ) != null ) { return envelope . getSender ( ) ; } return new User ( ) ;
public class StatementParameter { /** * 设置Long类型参数 . * @ param value */ public void setLong ( Long value ) { } }
this . checkNull ( value ) ; list . add ( value ) ; type . add ( Long . class ) ;
public class JarTemplateSource { private ITemplateSourceEntry addJarEntry ( Map < String , ITemplateSourceEntry > entries , JarEntry jarEntry ) { } }
String name = jarEntry . getName ( ) . substring ( basePathLength ) ; if ( name . isEmpty ( ) ) { name = "/" ; } ITemplateSourceEntry entry = new JarTemplateSourceEntry ( name , jarEntry ) ; entries . put ( name , entry ) ; return entry ;
public class BundleScriptEngineResolver { /** * Takes the input stream and ignores lines starting with a # and everything after a # */ private String removeCommentsFromInput ( BufferedReader in ) throws IOException { } }
String l = in . readLine ( ) ; // remove lines that start with a comment while ( l . startsWith ( "#" ) ) { l = in . readLine ( ) ; } if ( l . contains ( "#" ) ) { l = l . substring ( 0 , l . indexOf ( "#" ) ) ; } return l . trim ( ) ;
public class ExecutorServiceImpl { /** * This is private , so handling both interceptors and wrapping in this method for simplicity */ private < T > Collection < ? extends Callable < T > > wrap ( Collection < ? extends Callable < T > > tasks ) { } }
List < Callable < T > > wrappedTasks = new ArrayList < Callable < T > > ( ) ; Iterator < ? extends Callable < T > > i = tasks . iterator ( ) ; while ( i . hasNext ( ) ) { Callable < T > c = wrap ( i . next ( ) ) ; if ( serverStopping ) wrappedTasks . add ( c ) ; else wrappedTasks . add ( new CallableWrapper < T > ( c )...
public class DefaultEndpoint { /** * Reset the writer state . Queued commands will be canceled and the internal state will be reset . This is useful when the * internal state machine gets out of sync with the connection . */ @ Override public void reset ( ) { } }
if ( debugEnabled ) { logger . debug ( "{} reset()" , logPrefix ( ) ) ; } if ( channel != null ) { channel . pipeline ( ) . fireUserEventTriggered ( new ConnectionEvents . Reset ( ) ) ; } cancelBufferedCommands ( "Reset" ) ;
public class Publishers { /** * Is the given type a Publisher or convertible to a publisher . * @ param type The type to check * @ return True if it is */ public static boolean isConvertibleToPublisher ( Class < ? > type ) { } }
if ( Publisher . class . isAssignableFrom ( type ) ) { return true ; } else { for ( Class < ? > reactiveType : REACTIVE_TYPES ) { if ( reactiveType . isAssignableFrom ( type ) ) { return true ; } } return false ; }
public class AccountsInner { /** * Gets the SAS token associated with the specified Data Lake Analytics and Azure Storage account and container combination . * ServiceResponse < PageImpl < SasTokenInfoInner > > * @ param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics acco...
if ( resourceGroupName == null ) { throw new IllegalArgumentException ( "Parameter resourceGroupName is required and cannot be null." ) ; } if ( accountName == null ) { throw new IllegalArgumentException ( "Parameter accountName is required and cannot be null." ) ; } if ( storageAccountName == null ) { throw new Illega...
public class SnapshotsInner { /** * Revokes access to a snapshot . * @ param resourceGroupName The name of the resource group . * @ param snapshotName The name of the snapshot that is being created . The name can ' t be changed after the snapshot is created . Supported characters for the name are a - z , A - Z , 0-...
return ServiceFuture . fromResponse ( beginRevokeAccessWithServiceResponseAsync ( resourceGroupName , snapshotName ) , serviceCallback ) ;
public class ObjectsApi { /** * Get DNs or agent groups . * Get DNs ( directory numbers ) or agent groups from Configuration Server with the specified filters . * @ param objectType The type of object . Possible values are dns , skills , dn - groups or agent - groups . ( required ) * @ param dnType If the object ...
ApiResponse < GetObjectsSuccessResponse > resp = getObjectWithHttpInfo ( objectType , dnType , dnGroups , groupType , limit , offset , searchTerm , searchKey , matchMethod , sortKey , sortAscending , sortMethod , dbids , inUse ) ; return resp . getData ( ) ;
public class JingleSession { /** * Validate the state changes . */ public void setSessionState ( JingleSessionState stateIs ) { } }
LOGGER . fine ( "Session state change: " + sessionState + "->" + stateIs ) ; stateIs . enter ( ) ; sessionState = stateIs ;
public class InternalXtextParser { /** * InternalXtext . g : 495:1 : entryRuleAbstractTerminal : ruleAbstractTerminal EOF ; */ public final void entryRuleAbstractTerminal ( ) throws RecognitionException { } }
try { // InternalXtext . g : 496:1 : ( ruleAbstractTerminal EOF ) // InternalXtext . g : 497:1 : ruleAbstractTerminal EOF { before ( grammarAccess . getAbstractTerminalRule ( ) ) ; pushFollow ( FollowSets000 . FOLLOW_1 ) ; ruleAbstractTerminal ( ) ; state . _fsp -- ; after ( grammarAccess . getAbstractTerminalRule ( ) ...
public class BsonParser { /** * Reads a string that consists of a integer denoting the number of bytes , * the bytes ( including a terminating 0 byte ) * @ return the string * @ throws IOException if the string could not be read */ protected String readString ( ) throws IOException { } }
// read number of bytes int bytes = _in . readInt ( ) ; if ( bytes <= 0 ) { throw new IOException ( "Invalid number of string bytes" ) ; } String s ; if ( bytes > 1 ) { s = _in . readUTF ( bytes - 1 ) ; } else { s = "" ; } // read terminating zero _in . readByte ( ) ; return s ;
public class HtmlWriter { /** * Writes the representation of a < CODE > Font < / CODE > . * @ param font a < CODE > Font < / CODE > * @ param styleAttributes the style of the font * @ throws IOException */ protected void write ( Font font , Properties styleAttributes ) throws IOException { } }
if ( font == null || ! isOtherFont ( font ) /* | | styleAttributes = = null */ ) return ; write ( " " ) ; write ( HtmlTags . STYLE ) ; write ( "=\"" ) ; if ( styleAttributes != null ) { String key ; for ( Enumeration e = styleAttributes . propertyNames ( ) ; e . hasMoreElements ( ) ; ) { key = ( String ) e . nextElemen...
public class Ginv { /** * Swap components in the two rows . * @ param matrix * the matrix to modify * @ param row1 * the first row * @ param row2 * the second row */ public static void swapRows ( Matrix matrix , long row1 , long row2 ) { } }
double temp = 0 ; long cols = matrix . getColumnCount ( ) ; for ( long col = 0 ; col < cols ; col ++ ) { temp = matrix . getAsDouble ( row1 , col ) ; matrix . setAsDouble ( matrix . getAsDouble ( row2 , col ) , row1 , col ) ; matrix . setAsDouble ( temp , row2 , col ) ; }
public class NameSpace { /** * Gets the imported method . * @ param name the name * @ param sig the sig * @ return the imported method * @ throws UtilEvalError the util eval error */ protected BshMethod getImportedMethod ( final String name , final Class < ? > [ ] sig ) throws UtilEvalError { } }
// Try object imports for ( final Object object : this . importedObjects ) { final Invocable method = Reflect . resolveJavaMethod ( object . getClass ( ) , name , sig , false /* onlyStatic */ ) ; if ( method != null ) return new BshMethod ( method , object ) ; } // Try static imports for ( final Class < ? > stat : this...
public class ServerAttribute { /** * Do the applyChange with enforced creation of commands that are sent to the client */ protected void verbosely ( final Runnable applyChange ) { } }
boolean temp = notifyClient ; notifyClient = true ; try { applyChange . run ( ) ; } finally { notifyClient = temp ; }
public class JsGeometrySplitService { /** * Register a { @ link GeometrySplitStartHandler } to listen to events that signal the splitting process has started . * @ param handler * The { @ link GeometrySplitStartHandler } to add as listener . * @ return The registration of the handler . */ public JsHandlerRegistra...
org . geomajas . plugin . editing . client . split . event . GeometrySplitStartHandler h ; h = new org . geomajas . plugin . editing . client . split . event . GeometrySplitStartHandler ( ) { public void onGeometrySplitStart ( GeometrySplitStartEvent event ) { Geometry geometry = event . getGeometry ( ) ; org . geomaja...
public class LazyArray { /** * protected LazyArray ( LazyNode root , char [ ] source ) { * super ( root , source , null ) ; */ protected String serializeElementToString ( ) { } }
StringBuilder buf = new StringBuilder ( ) ; buf . append ( "[" ) ; LazyNode pointer = root . child ; boolean first = true ; while ( pointer != null ) { if ( first ) { first = false ; } else { buf . append ( "," ) ; } if ( pointer . type == LazyNode . OBJECT ) { buf . append ( new LazyObject ( pointer ) . toString ( ) )...
public class clusterinstance { /** * Use this API to add clusterinstance . */ public static base_response add ( nitro_service client , clusterinstance resource ) throws Exception { } }
clusterinstance addresource = new clusterinstance ( ) ; addresource . clid = resource . clid ; addresource . deadinterval = resource . deadinterval ; addresource . hellointerval = resource . hellointerval ; addresource . preemption = resource . preemption ; return addresource . add_resource ( client ) ;