signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class SchemaProperty { /** * - - - - - public static methods - - - - - */ public static List < GraphQLArgument > getGraphQLArgumentsForType ( final Type type ) { } }
final List < GraphQLArgument > arguments = new LinkedList < > ( ) ; switch ( type ) { case String : arguments . add ( GraphQLArgument . newArgument ( ) . name ( "_equals" ) . type ( Scalars . GraphQLString ) . build ( ) ) ; arguments . add ( GraphQLArgument . newArgument ( ) . name ( "_contains" ) . type ( Scalars . Gr...
public class SingularityExecutorShellCommandUpdater { /** * TODO thread ? */ public void sendUpdate ( UpdateType updateType , Optional < String > message , Optional < String > outputFilename ) { } }
SingularityTaskShellCommandUpdate update = new SingularityTaskShellCommandUpdate ( shellRequest . getId ( ) , System . currentTimeMillis ( ) , message , outputFilename , updateType ) ; try { byte [ ] data = objectMapper . writeValueAsBytes ( update ) ; task . getLog ( ) . info ( "Sending update {} ({}) for shell comman...
public class TVRageApi { /** * Get the episode information for all episodes for a show * @ param showID * @ return * @ throws com . omertron . tvrageapi . TVRageException */ public EpisodeList getEpisodeList ( String showID ) throws TVRageException { } }
if ( ! isValidString ( showID ) ) { return new EpisodeList ( ) ; } String tvrageURL = buildURL ( API_EPISODE_LIST , showID ) . toString ( ) ; return TVRageParser . getEpisodeList ( tvrageURL ) ;
public class AttachedRemoteSubscriberControl { /** * Return the remote engine uuid */ public String getRemoteEngineUuid ( ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getRemoteEngineUuid" ) ; String engineUUID = _anycastInputHandler . getLocalisationUuid ( ) . toString ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "getRemoteEngineUui...
public class KamImpl { /** * { @ inheritDoc } */ @ Override public Set < KamNode > getAdjacentNodes ( KamNode kamNode , EdgeDirectionType edgeDirection ) { } }
return getAdjacentNodes ( kamNode , edgeDirection , null , null ) ;
public class TableReader { /** * Read the table from the file and populate the supplied Table instance . * @ param file database file * @ param table Table instance */ public void read ( File file , Table table ) throws IOException { } }
// System . out . println ( " Reading " + file . getName ( ) ) ; InputStream is = null ; try { is = new FileInputStream ( file ) ; read ( is , table ) ; } finally { StreamHelper . closeQuietly ( is ) ; }
public class SparseHashIntegerVector { /** * { @ inheritDoc } */ public int add ( int index , int delta ) { } }
int val = map . get ( index ) ; int newVal = val + delta ; if ( newVal == 0 ) map . remove ( index ) ; else map . put ( index , newVal ) ; magnitude = - 1 ; return newVal ;
public class SimpleJob { /** * Job { @ link Filter } class setting . * @ param clazz { @ link Filter } class * @ return this */ public SimpleJob setFilter ( Class < ? extends Mapper < Key , Value , Key , Value > > clazz ) { } }
super . setMapperClass ( clazz ) ; mapper = true ; return this ;
public class PrintedContent { /** * When anonymization is enabled , we create an { @ link com . cloudbees . jenkins . support . filter . FilteredWriter } directly from * the underlying { @ link FilteredOutputStream } that prevents us from encoding and * then immediately decoding characters written to the returned {...
if ( os instanceof WrapperOutputStream ) { OutputStream out = ( ( WrapperOutputStream ) os ) . unwrapRecursively ( ) ; if ( out instanceof FilteredOutputStream ) { FilteredOutputStream filteredStream = ( FilteredOutputStream ) out ; return new PrintWriter ( new IgnoreCloseWriter ( filteredStream . asWriter ( ) ) ) ; } ...
public class FlowControlHandler { /** * Releases all messages and destroys the { @ link Queue } . */ private void destroy ( ) { } }
if ( queue != null ) { if ( ! queue . isEmpty ( ) ) { logger . trace ( "Non-empty queue: {}" , queue ) ; if ( releaseMessages ) { Object msg ; while ( ( msg = queue . poll ( ) ) != null ) { ReferenceCountUtil . safeRelease ( msg ) ; } } } queue . recycle ( ) ; queue = null ; }
public class Sql { /** * Performs the given SQL query calling the given Closure with each row of the result set . * The row will be a < code > GroovyResultSet < / code > which is a < code > ResultSet < / code > * that supports accessing the fields using property style notation and ordinal index values . * In addi...
eachRow ( sql , params , metaClosure , 0 , 0 , rowClosure ) ;
public class ClassInfo { /** * Add method info . * @ param methodInfoList * the method info list * @ param classNameToClassInfo * the map from class name to class info */ void addMethodInfo ( final MethodInfoList methodInfoList , final Map < String , ClassInfo > classNameToClassInfo ) { } }
for ( final MethodInfo mi : methodInfoList ) { // Index method annotations addFieldOrMethodAnnotationInfo ( mi . annotationInfo , /* isField = */ false , classNameToClassInfo ) ; // Index method parameter annotations if ( mi . parameterAnnotationInfo != null ) { for ( int i = 0 ; i < mi . parameterAnnotationInfo . leng...
public class AmazonSQSClient { /** * Returns the URL of an existing Amazon SQS queue . * To access a queue that belongs to another AWS account , use the < code > QueueOwnerAWSAccountId < / code > parameter to * specify the account ID of the queue ' s owner . The queue ' s owner must grant you permission to access t...
request = beforeClientExecution ( request ) ; return executeGetQueueUrl ( request ) ;
public class MessageAdapter { /** * Gets all child MessageOrBuilder descriptors for the type . * @ author protobufel @ gmail . com David Tesler */ protected static List < FieldDescriptor > getChildFieldDescriptors ( final Descriptor type ) { } }
final List < FieldDescriptor > fields = new ArrayList < FieldDescriptor > ( ) ; for ( final FieldDescriptor field : type . getFields ( ) ) { if ( field . getJavaType ( ) == JavaType . MESSAGE ) { fields . add ( field ) ; } } for ( final FieldDescriptor field : type . getExtensions ( ) ) { if ( field . getJavaType ( ) =...
public class RecvTensorRequest { /** * < pre > * A key that identifies the tensor to be received . * < / pre > * < code > optional string rendezvous _ key = 2 ; < / code > */ public java . lang . String getRendezvousKey ( ) { } }
java . lang . Object ref = rendezvousKey_ ; if ( ref instanceof java . lang . String ) { return ( java . lang . String ) ref ; } else { com . google . protobuf . ByteString bs = ( com . google . protobuf . ByteString ) ref ; java . lang . String s = bs . toStringUtf8 ( ) ; rendezvousKey_ = s ; return s ; }
public class AmazonEC2Waiters { /** * Builds a CustomerGatewayAvailable waiter by using custom parameters waiterParameters and other parameters defined * in the waiters specification , and then polls until it determines whether the resource entered the desired state * or not , where polling criteria is bound by eit...
return new WaiterBuilder < DescribeCustomerGatewaysRequest , DescribeCustomerGatewaysResult > ( ) . withSdkFunction ( new DescribeCustomerGatewaysFunction ( client ) ) . withAcceptors ( new CustomerGatewayAvailable . IsAvailableMatcher ( ) , new CustomerGatewayAvailable . IsDeletedMatcher ( ) , new CustomerGatewayAvail...
public class DefaultGroovyMethods { /** * Compare two Characters . The ordinal values of the Characters * are compared ( the ordinal value is the unicode * value which for simple character sets is the ASCII value ) . * @ param left a Character * @ param right a Character * @ return the result of the compariso...
return compareTo ( Integer . valueOf ( left ) , right ) ;
public class TileDaoUtils { /** * Get the zoom level for the provided width and height in the default units * @ param widths * sorted widths * @ param heights * sorted heights * @ param tileMatrices * tile matrices * @ param width * in default units * @ param height * in default units * @ return t...
return getZoomLevel ( widths , heights , tileMatrices , width , height , true ) ;
public class LayerTree { /** * Updates the icons and the state of the buttons in the toolbar based upon the currently selected layer * @ param toolStripMembers * data for the toolbar */ private void updateButtonIconsAndStates ( Canvas [ ] toolStripMembers ) { } }
for ( Canvas toolStripMember : toolStripMembers ) { if ( toolStripMember instanceof LayerTreeModalButton ) { ( ( LayerTreeModalButton ) toolStripMember ) . update ( ) ; } else if ( toolStripMember instanceof LayerTreeButton ) { ( ( LayerTreeButton ) toolStripMember ) . update ( ) ; } }
public class DeleteRepositoryPolicyRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DeleteRepositoryPolicyRequest deleteRepositoryPolicyRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( deleteRepositoryPolicyRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( deleteRepositoryPolicyRequest . getRegistryId ( ) , REGISTRYID_BINDING ) ; protocolMarshaller . marshall ( deleteRepositoryPolicyRequest . getRepositoryNam...
public class DatabaseProperties { /** * Returns a map of the meta data from the database properties . This * primarily contains timestamps of when the NVD CVE information was last * updated . * @ return a map of the database meta data */ public synchronized Map < String , String > getMetaData ( ) { } }
final Map < String , String > map = new TreeMap < > ( ) ; for ( Entry < Object , Object > entry : properties . entrySet ( ) ) { final String key = ( String ) entry . getKey ( ) ; if ( ! "version" . equals ( key ) ) { if ( key . startsWith ( "NVD CVE " ) ) { try { final long epoch = Long . parseLong ( ( String ) entry ....
public class LockCache { /** * Returns whether the cache contains a particular key . * @ param key the key to look up in the cache * @ return true if the key is contained in the cache */ @ VisibleForTesting public boolean containsKey ( K key ) { } }
Preconditions . checkNotNull ( key , "key can not be null" ) ; return mCache . containsKey ( key ) ;
public class DatasetTriggerMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DatasetTrigger datasetTrigger , ProtocolMarshaller protocolMarshaller ) { } }
if ( datasetTrigger == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( datasetTrigger . getSchedule ( ) , SCHEDULE_BINDING ) ; protocolMarshaller . marshall ( datasetTrigger . getDataset ( ) , DATASET_BINDING ) ; } catch ( Exception e ) { th...
public class HeaderTemplate { /** * Append values to a Header Template . * @ param headerTemplate to append to . * @ param values to append . * @ return a new Header Template with the values added . */ public static HeaderTemplate append ( HeaderTemplate headerTemplate , Iterable < String > values ) { } }
Set < String > headerValues = new LinkedHashSet < > ( headerTemplate . getValues ( ) ) ; headerValues . addAll ( StreamSupport . stream ( values . spliterator ( ) , false ) . filter ( Util :: isNotBlank ) . collect ( Collectors . toSet ( ) ) ) ; return create ( headerTemplate . getName ( ) , headerValues ) ;
public class XMLReaderManager { /** * Retrieves a cached XMLReader for this thread , or creates a new * XMLReader , if the existing reader is in use . When the caller no * longer needs the reader , it must release it with a call to * { @ link # releaseXMLReader } . */ public synchronized XMLReader getXMLReader ( ...
XMLReader reader ; boolean readerInUse ; if ( m_readers == null ) { // When the m _ readers . get ( ) method is called for the first time // on a thread , a new XMLReader will automatically be created . m_readers = new ThreadLocal ( ) ; } if ( m_inUse == null ) { m_inUse = new Hashtable ( ) ; } // If the cached reader ...
public class SyncPageLoader { /** * Display the target html in the pane . */ public void run ( ) { } }
if ( ( m_url == null ) && ( m_strHtmlText == null ) ) { // restore the original cursor if ( m_bChangeCursor ) { if ( m_applet != null ) m_applet . setStatus ( 0 , m_editorPane , m_oldCursor ) ; else { Component component = m_editorPane ; while ( component . getParent ( ) != null ) { component = component . getParent ( ...
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EEnum getIfcElementAssemblyTypeEnum ( ) { } }
if ( ifcElementAssemblyTypeEnumEEnum == null ) { ifcElementAssemblyTypeEnumEEnum = ( EEnum ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 980 ) ; } return ifcElementAssemblyTypeEnumEEnum ;
public class Converter { /** * / / / / MergeQuery */ static MergeQuery convert ( com . linecorp . centraldogma . common . MergeQuery < ? > mergeQuery ) { } }
return MergeQueryConverter . TO_DATA . convert ( mergeQuery ) ;
public class TurfMeta { /** * Get all coordinates from a { @ link MultiPolygon } object , returning a { @ code List } of Point * objects . If you have a geometry collection , you need to break it down to individual geometry * objects before using { @ link # coordAll } . * @ param multiPolygon any { @ link MultiPo...
return coordAll ( new ArrayList < Point > ( ) , multiPolygon , excludeWrapCoord ) ;
public class PrefixedProperties { /** * Gets the prefixed key and parse it to an double [ ] < br > * Each comma - separated list can be used . * @ param key * the key * @ return double [ ] or null if the key couldn ' t get found . */ public double [ ] getDoubleArray ( final String key ) { } }
final String [ ] value = getArray ( key ) ; if ( value != null ) { final double [ ] result = new double [ value . length ] ; for ( int i = 0 ; i < value . length ; i ++ ) { result [ i ] = Double . parseDouble ( value [ i ] ) ; } return result ; } return null ;
public class Basic2DMatrix { /** * Creates a block { @ link Basic2DMatrix } of the given blocks { @ code a } , * { @ code b } , { @ code c } and { @ code d } . */ public static Basic2DMatrix block ( Matrix a , Matrix b , Matrix c , Matrix d ) { } }
if ( ( a . rows ( ) != b . rows ( ) ) || ( a . columns ( ) != c . columns ( ) ) || ( c . rows ( ) != d . rows ( ) ) || ( b . columns ( ) != d . columns ( ) ) ) { throw new IllegalArgumentException ( "Sides of blocks are incompatible!" ) ; } int rows = a . rows ( ) + c . rows ( ) ; int columns = a . columns ( ) + b . co...
public class CommerceDiscountUtil { /** * Returns all the commerce discounts where displayDate & lt ; & # 63 ; and status = & # 63 ; . * @ param displayDate the display date * @ param status the status * @ return the matching commerce discounts */ public static List < CommerceDiscount > findByLtD_S ( Date display...
return getPersistence ( ) . findByLtD_S ( displayDate , status ) ;
public class AwsSecurityFindingFilters { /** * The timestamp of when the note was updated . * @ param noteUpdatedAt * The timestamp of when the note was updated . */ public void setNoteUpdatedAt ( java . util . Collection < DateFilter > noteUpdatedAt ) { } }
if ( noteUpdatedAt == null ) { this . noteUpdatedAt = null ; return ; } this . noteUpdatedAt = new java . util . ArrayList < DateFilter > ( noteUpdatedAt ) ;
public class CmsSetupBean { /** * Returns a map of dependencies . < p > * The component dependencies are get from the setup and module components . properties files found . < p > * @ return a Map of component ids as keys and a list of dependency names as values */ public Map < String , List < String > > buildDepsFo...
Map < String , List < String > > ret = new HashMap < String , List < String > > ( ) ; Iterator < CmsSetupComponent > itComponents = CmsCollectionsGenericWrapper . < CmsSetupComponent > list ( m_components . elementList ( ) ) . iterator ( ) ; while ( itComponents . hasNext ( ) ) { CmsSetupComponent component = itCompone...
public class XsdAsmUtils { /** * Obtains the { @ link XsdAttribute } objects which are specific to the given { @ link XsdElement } . * @ param element The { @ link XsdElement } object containing the attributes . * @ return A { @ link Stream } of { @ link XsdAttribute } that are exclusive to the received { @ link Xs...
XsdComplexType complexType = element . getXsdComplexType ( ) ; if ( complexType != null ) { Stream < XsdAttribute > extensionAttributes = null ; Stream < XsdAttribute > complexTypeAttributes ; XsdComplexContent complexContent = complexType . getComplexContent ( ) ; if ( complexContent != null ) { XsdExtension extension...
public class AbstractConsumerKey { /** * Decrement the active message count * @ param messages */ public void removeActiveMessages ( int messages ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "removeActiveMessages" , new Object [ ] { Integer . valueOf ( messages ) } ) ; // If we ' re a member of a ConsumerSet , inform them of the remove if ( classifyingMessages ) consumerSet . removeActiveMessages ( messag...
public class FaunusPipeline { /** * Have the elements for the named step previous project an edge to the current vertex with provided label . * @ param step the name of the step where the source vertices were * @ param label the label of the edge to project * @ return the extended FaunusPipeline */ public FaunusP...
return this . link ( IN , label , step , null ) ;
public class UIViewRoot { /** * < p class = " changed _ added _ 2_0 " > < span * class = " changed _ deleted _ 2_0 _ rev _ a " > The < / span > default * implementation must call { @ link * UIComponentBase # processRestoreState } from within a * < code > try < / code > block . The < code > try < / code > block ...
// hack to work around older state managers that may not set the // view root early enough if ( context . getViewRoot ( ) == null ) { context . setViewRoot ( this ) ; } super . processRestoreState ( context , state ) ;
public class ProxyImpl { /** * ( non - Javadoc ) * @ see javax . servlet . sip . Proxy # setOutboundInterface ( java . net . InetAddress ) */ public void setOutboundInterface ( InetAddress inetAddress ) { } }
if ( inetAddress == null ) { throw new NullPointerException ( "outbound Interface param shouldn't be null" ) ; } String address = inetAddress . getHostAddress ( ) ; List < SipURI > list = this . sipFactoryImpl . getSipNetworkInterfaceManager ( ) . getOutboundInterfaces ( ) ; SipURI networkInterface = null ; for ( SipUR...
public class ProcessContext { /** * Adds a data attribute for all given activities together with its * usage . < br > * The given activities / attributes have to be known by the context , i . e . * be contained in the activity / attribute list . * @ param activities Activities for which the attribute usage is s...
Validate . notNull ( activities ) ; Validate . notEmpty ( activities ) ; for ( String activity : activities ) { addDataUsageFor ( activity , attribute , dataUsage ) ; }
public class SparseDataset { /** * Set a nonzero entry into the matrix . If the index exceeds the current * matrix size , the matrix will resize itself . * @ param i the row index of entry . * @ param j the column index of entry . * @ param x the value of entry . */ public void set ( int i , int j , double x ) ...
if ( i < 0 || j < 0 ) { throw new IllegalArgumentException ( "Invalid index: i = " + i + " j = " + j ) ; } int nrows = size ( ) ; if ( i >= nrows ) { for ( int k = nrows ; k <= i ; k ++ ) { data . add ( new Datum < > ( new SparseArray ( ) ) ) ; } } if ( j >= ncols ( ) ) { numColumns = j + 1 ; if ( numColumns > colSize ...
public class SearchUtils { /** * Find methods within a class where the parameter list contains a certain list of type . * @ param methodNodes method nodes to search through * @ param expectedParamType parameter type to search for * @ return list of methods * @ throws NullPointerException if any argument is { @ ...
Validate . notNull ( methodNodes ) ; Validate . notNull ( expectedParamType ) ; Validate . noNullElements ( methodNodes ) ; Validate . isTrue ( expectedParamType . getSort ( ) != Type . METHOD && expectedParamType . getSort ( ) != Type . VOID ) ; List < MethodNode > ret = new ArrayList < > ( ) ; for ( MethodNode method...
public class DictionaryImpl { /** * Parses the < typedefn / > attributes from a Dictionary XML Document * @ param doc the DOM object representing the XML Document with the Dictionary definitions */ protected void parseTypeDefs ( Document doc ) { } }
// Parse type definitions . Handy to match against defined AVP types // and to fill AVPs with generic function . // Format : < typedefn type - name = " Integer32 " / > // < typedefn type - name = " Enumerated " type - parent = " Integer32 " / > NodeList typedefNodes = doc . getElementsByTagName ( "typedefn" ) ; for ( i...
public class TreeBuilder { /** * Build the tree * @ return the tree */ public Tree < T > build ( ) { } }
Tree < T > result = base ; if ( null == base && treeStack . size ( ) == 1 ) { result = treeStack . get ( 0 ) ; } else if ( treeStack . size ( ) > 0 ) { result = new TreeStack < T > ( treeStack , base ) ; } else if ( null == base ) { throw new IllegalArgumentException ( "base tree was not set" ) ; } return result ;
public class InternationalizationServiceSingleton { /** * Gets all the messages defined in the given locales AND default locale ( for messages not defined in the given * any locale ) . The message are added to the map only if they are not provided in the previous locale , * meaning that the order is important . The...
Map < String , String > messages = new HashMap < > ( ) ; List < I18nExtension > extensionForLocale ; for ( Locale locale : locales ) { extensionForLocale = getExtension ( locale ) ; for ( I18nExtension extension : extensionForLocale ) { merge ( messages , extension . map ( ) ) ; } } // Now add the messages for the defa...
public class CommerceWishListLocalServiceBaseImpl { /** * Updates the commerce wish list in the database or adds it if it does not yet exist . Also notifies the appropriate model listeners . * @ param commerceWishList the commerce wish list * @ return the commerce wish list that was updated */ @ Indexable ( type = ...
return commerceWishListPersistence . update ( commerceWishList ) ;
public class ApprovalStoreUserApprovalHandler { /** * Requires the authorization request to be explicitly approved , including all individual scopes , and the user to be * authenticated . A scope that was requested in the authorization request can be approved by sending a request * parameter < code > scope . & lt ;...
// Get the approved scopes Set < String > requestedScopes = authorizationRequest . getScope ( ) ; Set < String > approvedScopes = new HashSet < String > ( ) ; Set < Approval > approvals = new HashSet < Approval > ( ) ; Date expiry = computeExpiry ( ) ; // Store the scopes that have been approved / denied Map < String ,...
public class CmsSecurityManager { /** * Returns the uuid id for the given id , * remove this method as soon as possible . < p > * @ param context the current cms context * @ param id the old project id * @ return the new uuid for the given id * @ throws CmsException if something goes wrong */ public CmsUUID g...
CmsDbContext dbc = m_dbContextFactory . getDbContext ( context ) ; CmsUUID result = null ; try { result = m_driverManager . getProjectId ( dbc , id ) ; } catch ( CmsException e ) { dbc . report ( null , e . getMessageContainer ( ) , e ) ; } finally { dbc . clear ( ) ; } return result ;
public class Reductions { /** * Yields true if EVERY predicate application on the given array yields * true . * @ param < E > the array element type parameter * @ param array the array where elements are fetched from * @ param predicate the predicate applied to every element fetched from the * array * @ ret...
return new Every < E > ( predicate ) . test ( new ArrayIterator < E > ( array ) ) ;
public class Filtering { /** * Creates an iterator yielding last n elements from the source array . * Consuming the resulting iterator yields an IllegalArgumentException if * not enough elements can be fetched . E . g : * < code > takeLast ( 2 , [ 1 , 2 , 3 ] ) - > [ 2 , 3 ] < / code > * @ param < E > the array...
return takeLast ( howMany , new ArrayIterator < E > ( from ) ) ;
public class base_resource { /** * Use this method to perform a add operation on netscaler resource . * @ param service nitro _ service object . * @ param option options class object . * @ return status of the operation performed . * @ throws Exception */ protected base_response add_resource ( nitro_service ser...
if ( ! service . isLogin ( ) && ! this . get_object_type ( ) . equals ( "login" ) ) service . login ( ) ; String sessionid = service . get_sessionid ( ) ; String request = resource_to_string ( service , sessionid , option ) ; return post_data ( service , request ) ;
public class ServerBuilder { /** * Returns a list of { @ link ServerPort } s which consists of distinct port numbers except for the port * { @ code 0 } . If there are the same port numbers with different { @ link SessionProtocol } s , * their { @ link SessionProtocol } s will be merged into a single { @ link Server...
final List < ServerPort > distinctPorts = new ArrayList < > ( ) ; for ( final ServerPort p : ports ) { boolean found = false ; // Do not check the port number 0 because a user may want his or her server to be bound // on multiple arbitrary ports . if ( p . localAddress ( ) . getPort ( ) > 0 ) { for ( int i = 0 ; i < di...
public class MCP4641 { /** * A MCP4641 is expected to be connected to I2C - bus 1 of Raspberry Pi . * All address - pins are assumed to be low ( means address 0x28 ) . * Both channels of the are initialized at mid - value ( the same value * as hardware - preset ) . A is brought to max - value and B to min - value...
// initialize bus final I2CBus bus = I2CFactory . getInstance ( I2CBus . BUS_1 ) ; try { final MicrochipPotentiometer a = new MCP4641 ( bus , false , false , false , MicrochipPotentiometerChannel . A , MicrochipPotentiometerNonVolatileMode . VOLATILE_ONLY ) ; final MicrochipPotentiometer b = new MCP4641 ( bus , false ,...
public class JStringUtils { /** * Returns true if the provided string is null or empty . * @ param string * @ return isNullOrEmpty boolean */ public static boolean isNullOrEmpty ( @ Nullable String string ) { } }
if ( string == null || string . isEmpty ( ) ) { return true ; } return false ;
public class PrintWriter { /** * Writes a formatted string to this writer using the specified format * string and arguments . If automatic flushing is enabled , calls to this * method will flush the output buffer . * @ param l * The { @ linkplain java . util . Locale locale } to apply during * formatting . If...
try { synchronized ( lock ) { ensureOpen ( ) ; if ( ( formatter == null ) || ( formatter . locale ( ) != l ) ) formatter = new Formatter ( WeakProxy . forObject ( this ) , l ) ; formatter . format ( l , format , args ) ; if ( autoFlush ) out . flush ( ) ; } } catch ( InterruptedIOException x ) { Thread . currentThread ...
public class ConfigController { /** * Applies the configuration file . * The input settings will be ignored if a default configuration was used . */ private void applyConfig ( ) { } }
this . components . applyConfig ( config ) ; switch ( config . getConfigType ( ) ) { case DEFAULT : break ; case IMPORT : this . archives . applyConfiguration ( config ) ; } repaint ( ) ;
public class DataLayout { /** * Set the policy used to determine the visibility of each child component view . */ public final void setVisibilityPolicy ( @ NonNull VisibilityPolicy visibilityPolicy ) { } }
checkNotNull ( visibilityPolicy , "visibilityPolicy" ) ; if ( visibilityPolicy != mVisibilityPolicy ) { mVisibilityPolicy = visibilityPolicy ; updateViews ( ) ; }
public class LengthCheckInputStream { /** * { @ inheritDoc } * @ throws SdkClientException * if { @ link # includeSkipped } is true and the data length * skipped has exceeded the expected total . */ @ Override public long skip ( long n ) throws IOException { } }
final long skipped = super . skip ( n ) ; if ( includeSkipped && skipped > 0 ) { dataLength += skipped ; checkLength ( false ) ; } return skipped ;
public class Layout { /** * Write a layout to be read by { @ link LayoutFactory # readLayoutFrom } . * @ since 1.2.2 */ public void writeTo ( OutputStream out ) throws IOException , RepositoryException { } }
mStoredLayout . writeTo ( out ) ; Cursor < StoredLayoutProperty > cursor = mLayoutFactory . mPropertyStorage . query ( "layoutID = ?" ) . with ( mStoredLayout . getLayoutID ( ) ) . fetch ( ) ; try { while ( cursor . hasNext ( ) ) { StoredLayoutProperty prop = cursor . next ( ) ; // Write 1 to indicate that this was not...
public class SharedTreeNode { /** * Calculate whether the NA value for a particular colId can reach this node . * @ param colIdToFind Column id to find * @ return true if NA of colId reaches this node , false otherwise */ private boolean findInclusiveNa ( int colIdToFind ) { } }
if ( parent == null ) { return true ; } else if ( parent . getColId ( ) == colIdToFind ) { return inclusiveNa ; } return parent . findInclusiveNa ( colIdToFind ) ;
public class UniqueKeyRangeManager { /** * Request an asynchronous update of the persistent state * @ param generator to be updated */ public void scheduleUpdate ( UniqueKeyGenerator generator ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "scheduleUpdate" , "GeneratorName=" + generator . getName ( ) ) ; synchronized ( _asyncQ ) { _asyncQ . add ( generator ) ; _asyncQ . notify ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) S...
public class StripeRawJsonObjectDeserializer { /** * Deserializes a JSON payload into a { @ link StripeRawJsonObject } object . */ @ Override public StripeRawJsonObject deserialize ( JsonElement json , Type typeOfT , JsonDeserializationContext context ) throws JsonParseException { } }
StripeRawJsonObject object = new StripeRawJsonObject ( ) ; object . json = json . getAsJsonObject ( ) ; return object ;
public class AuthorityKeyIdentifierExtension { /** * Encode only the extension value */ private void encodeThis ( ) throws IOException { } }
if ( id == null && names == null && serialNum == null ) { this . extensionValue = null ; return ; } DerOutputStream seq = new DerOutputStream ( ) ; DerOutputStream tmp = new DerOutputStream ( ) ; if ( id != null ) { DerOutputStream tmp1 = new DerOutputStream ( ) ; id . encode ( tmp1 ) ; tmp . writeImplicit ( DerValue ....
public class JavaClassService { /** * Indicates that we have found a . class or . java file for the given qualified name . This will either create a new { @ link JavaClassModel } or * convert an existing { @ link PhantomJavaClassModel } if one exists . */ public synchronized JavaClassModel create ( String qualifiedNa...
// if a phantom exists , just convert it PhantomJavaClassModel phantom = new GraphService < > ( getGraphContext ( ) , PhantomJavaClassModel . class ) . getUniqueByProperty ( JavaClassModel . QUALIFIED_NAME , qualifiedName ) ; if ( phantom != null ) { GraphService . removeTypeFromModel ( getGraphContext ( ) , phantom , ...
public class Browser { /** * Determines the text type for the current node using the mimeType ( if present ) and the extension . */ public String getTextType ( ) { } }
if ( textType == null ) { String mimeType = getMimeType ( ) ; String extension = getNameExtension ( ) ; textType = getTextType ( mimeType , extension ) ; } return textType ;
public class XMLUtils { /** * Construct a new ( empty ) DOM Document and return it . * @ return an empty DOM Document */ public static Document createDOMDocument ( ) { } }
try { return DocumentBuilderFactory . newInstance ( ) . newDocumentBuilder ( ) . newDocument ( ) ; } catch ( ParserConfigurationException ex ) { LOGGER . error ( "Cannot create DOM Documents" , ex ) ; return null ; }
public class ComparableExpression { /** * Create a { @ code this > = right } expression * @ param right rhs of the comparison * @ return this & gt ; = right * @ see java . lang . Comparable # compareTo ( Object ) */ public BooleanExpression goe ( Expression < T > right ) { } }
return Expressions . booleanOperation ( Ops . GOE , mixin , right ) ;
public class AnnotationTypeOptionalMemberWriterImpl { /** * { @ inheritDoc } */ public String [ ] getSummaryTableHeader ( ProgramElementDoc member ) { } }
String [ ] header = new String [ ] { writer . getModifierTypeHeader ( ) , configuration . getText ( "doclet.0_and_1" , configuration . getText ( "doclet.Annotation_Type_Optional_Member" ) , configuration . getText ( "doclet.Description" ) ) } ; return header ;
public class ExpressionSpecBuilder { /** * Builds and returns the projection expression to be used in a dynamodb * GetItem request ; or null if there is none . */ String buildProjectionExpression ( SubstitutionContext context ) { } }
if ( projections . size ( ) == 0 ) return null ; StringBuilder sb = new StringBuilder ( ) ; for ( PathOperand projection : projections ) { if ( sb . length ( ) > 0 ) sb . append ( ", " ) ; sb . append ( projection . asSubstituted ( context ) ) ; } return sb . toString ( ) ;
public class Pipes { /** * Close the Adapter identified by the provided Key if it exists * @ param key : Adapter identifier */ public void close ( final String key ) { } }
Optional . ofNullable ( registered . get ( key ) ) . ifPresent ( a -> a . close ( ) ) ;
public class UnicodeSet { /** * Get the Regex equivalent for this UnicodeSet * @ return regex pattern equivalent to this UnicodeSet * @ deprecated This API is ICU internal only . * @ hide original deprecated declaration * @ hide draft / provisional / internal are hidden on Android */ @ Deprecated public String ...
if ( strings . size ( ) == 0 ) { return toString ( ) ; } StringBuilder result = new StringBuilder ( "(?:" ) ; appendNewPattern ( result , true , false ) ; for ( String s : strings ) { result . append ( '|' ) ; _appendToPat ( result , s , true ) ; } return result . append ( ")" ) . toString ( ) ;
public class ApiOvhCloud { /** * cloud archives tasks for account * REST : GET / cloud / { serviceName } / pca / { pcaServiceName } / tasks * @ param todoDate _ to [ required ] Filter the value of todoDate property ( < = ) * @ param function [ required ] Filter the value of function property ( = ) * @ param tod...
String qPath = "/cloud/{serviceName}/pca/{pcaServiceName}/tasks" ; StringBuilder sb = path ( qPath , serviceName , pcaServiceName ) ; query ( sb , "function" , function ) ; query ( sb , "status" , status ) ; query ( sb , "todoDate.from" , todoDate_from ) ; query ( sb , "todoDate.to" , todoDate_to ) ; String resp = exec...
public class HierarchicalClustering { /** * Cuts a tree into several groups by specifying the cut height . * @ param h the cut height . * @ return the cluster label of each sample . */ public int [ ] partition ( double h ) { } }
for ( int i = 0 ; i < height . length - 1 ; i ++ ) { if ( height [ i ] > height [ i + 1 ] ) { throw new IllegalStateException ( "Non-monotonic cluster tree -- the linkage is probably not appropriate!" ) ; } } int n = merge . length + 1 ; int k = 2 ; for ( ; k <= n ; k ++ ) { if ( height [ n - k ] < h ) { break ; } } if...
public class CassQuery { /** * ( non - Javadoc ) . * @ param m * the m * @ param client * the client * @ return the list * @ see com . impetus . kundera . query . QueryImpl # recursivelyPopulateEntities ( com . impetus * . kundera . metadata . model . EntityMetadata , com . impetus . kundera . client . Cl...
List < EnhanceEntity > ls = null ; ApplicationMetadata appMetadata = kunderaMetadata . getApplicationMetadata ( ) ; externalProperties = ( ( CassandraClientBase ) client ) . getExternalProperties ( ) ; MetamodelImpl metaModel = ( MetamodelImpl ) kunderaMetadata . getApplicationMetadata ( ) . getMetamodel ( m . getPersi...
public class Vector2f { /** * Add a vector to this vector * @ param v The vector to add * @ return This vector - useful for chaning operations */ public Vector2f add ( Vector2f v ) { } }
x += v . getX ( ) ; y += v . getY ( ) ; return this ;
public class BigramCollocationFinder { /** * Finds bigram collocations in the given corpus whose p - value is less than * the given threshold . * @ param p the p - value threshold * @ return the array of significant bigram collocations in descending order * of likelihood ratio . */ public BigramCollocation [ ] ...
if ( p <= 0.0 || p >= 1.0 ) { throw new IllegalArgumentException ( "Invalid p = " + p ) ; } double cutoff = chisq . quantile ( p ) ; ArrayList < BigramCollocation > bigrams = new ArrayList < > ( ) ; Iterator < Bigram > iterator = corpus . getBigrams ( ) ; while ( iterator . hasNext ( ) ) { Bigram bigram = iterator . ne...
public class UpworkRestClient { /** * Get JSON response for GET * @ param request Request object for GET * @ param method HTTP Method * @ throws JSONException * @ return { @ link JSONObject } */ public static JSONObject getJSONObject ( HttpGet request , Integer method ) throws JSONException { } }
return UpworkRestClient . getJSONObject ( request , method , new HashMap < String , String > ( ) ) ;
public class KernelWriter { /** * These three convert functions are here to perform * any type conversion that may be required between * Java and OpenCL . * @ param _ typeDesc * String in the Java JNI notation , [ I , etc * @ return Suitably converted string , " char * " , etc */ @ Override public String conv...
if ( _typeDesc . equals ( "Z" ) || _typeDesc . equals ( "boolean" ) ) { return ( cvtBooleanToChar ) ; } else if ( _typeDesc . equals ( "[Z" ) || _typeDesc . equals ( "boolean[]" ) ) { return isLocal ? ( cvtBooleanArrayToChar ) : ( cvtBooleanArrayToCharStar ) ; } else if ( _typeDesc . equals ( "B" ) || _typeDesc . equal...
public class RemotingStore { /** * - - - - - endpoint configuration */ @ Process ( actionType = ModifyEndpointConfiguration . class ) public void modifyEndpointConfiguration ( final ModifyEndpointConfiguration action , final Dispatcher . Channel channel ) { } }
operationDelegate . onSaveResource ( ENDPOINT_CONFIGURATION_ADDRESS , null , action . getChangedValues ( ) , new CrudOperationDelegate . Callback ( ) { @ Override public void onSuccess ( final AddressTemplate addressTemplate , final String name ) { final ModelNode op = readEndpointConfiguration ( ) ; dispatcher . execu...
public class Boot { /** * Called by prunsrv ( Windows ) or jsvc ( UNIX ) before start ( ) . * @ param context * @ throws Exception */ @ Override public void init ( DaemonContext context ) throws Exception { } }
log . debug ( "Fathom Daemon initialized" ) ; settings . applyArgs ( context . getArguments ( ) ) ;
public class CopyConditions { /** * Set modified condition , copy object modified since given time . * @ throws InvalidArgumentException * When date is null */ public void setModified ( DateTime date ) throws InvalidArgumentException { } }
if ( date == null ) { throw new InvalidArgumentException ( "Date cannot be empty" ) ; } copyConditions . put ( "x-amz-copy-source-if-modified-since" , date . toString ( DateFormat . HTTP_HEADER_DATE_FORMAT ) ) ;
public class TaskExecutor { @ Override public void disconnectJobManager ( JobID jobId , Exception cause ) { } }
closeJobManagerConnection ( jobId , cause ) ; jobLeaderService . reconnect ( jobId ) ;
public class ReservoirLongsUnion { /** * should be called ONLY by twoWayMergeInternal */ private void twoWayMergeInternalStandard ( final ReservoirLongsSketch source ) { } }
assert ( source . getN ( ) <= source . getK ( ) ) ; final int numInputSamples = source . getNumSamples ( ) ; for ( int i = 0 ; i < numInputSamples ; ++ i ) { gadget_ . update ( source . getValueAtPosition ( i ) ) ; }
public class ConvertImage { /** * Converts a { @ link InterleavedS32 } into the equivalent { @ link Planar } * @ param input ( Input ) ImageInterleaved that is being converted . Not modified . * @ param output ( Optional ) The output image . If null a new image is created . Modified . * @ return Converted image ....
if ( output == null ) { output = new Planar < > ( GrayS32 . class , input . width , input . height , input . numBands ) ; } else { output . reshape ( input . width , input . height , input . numBands ) ; } if ( BoofConcurrency . USE_CONCURRENT ) { ImplConvertImage_MT . convert ( input , output ) ; } else { ImplConvertI...
public class ElementMatchers { /** * Matches generic type descriptions of the given sort . * @ param sort The generic type sort to match . * @ param < T > The type of the matched object . * @ return A matcher that matches generic types of the given sort . */ public static < T extends TypeDefinition > ElementMatch...
return ofSort ( is ( sort ) ) ;
public class JGitEnvironmentRepository { /** * Clones the remote repository and then opens a connection to it . * @ throws GitAPIException when cloning fails * @ throws IOException when repo opening fails */ private void initClonedRepository ( ) throws GitAPIException , IOException { } }
if ( ! getUri ( ) . startsWith ( FILE_URI_PREFIX ) ) { deleteBaseDirIfExists ( ) ; Git git = cloneToBasedir ( ) ; if ( git != null ) { git . close ( ) ; } git = openGitRepository ( ) ; if ( git != null ) { git . close ( ) ; } }
public class StreamCutImpl { /** * Obtains the a StreamCut object from its compact Base64 representation obtained via { @ link StreamCutImpl # asText ( ) } . * @ param base64String Compact Base64 representation of StreamCut . * @ return The StreamCut object . */ public static StreamCutInternal from ( String base64S...
Exceptions . checkNotNullOrEmpty ( base64String , "base64String" ) ; String [ ] split = decompressFromBase64 ( base64String ) . split ( ":" , 5 ) ; Preconditions . checkArgument ( split . length == 5 , "Invalid string representation of StreamCut" ) ; final Stream stream = Stream . of ( split [ 1 ] ) ; List < Integer > ...
public class AsciiArtUtils { /** * Print ascii art info . * @ param out the out * @ param asciiArt the ascii art * @ param additional the additional */ @ SneakyThrows public static void printAsciiArtInfo ( final Logger out , final String asciiArt , final String additional ) { } }
out . info ( ANSI_CYAN ) ; out . info ( "\n\n" . concat ( FigletFont . convertOneLine ( asciiArt ) ) . concat ( additional ) ) ; out . info ( ANSI_RESET ) ;
public class Version { /** * Method copied from http : / / www . jboss . com / index . html ? module = bb & op = viewtopic & t = 77231 */ public static String print ( short version ) { } }
int major = ( version & MAJOR_MASK ) >> MAJOR_SHIFT ; int minor = ( version & MINOR_MASK ) >> MINOR_SHIFT ; int micro = ( version & MICRO_MASK ) ; return major + "." + minor + "." + micro ;
public class JUnit4 { /** * Validate arguments . */ private void validateArguments ( ) throws BuildException { } }
Path tempDir = getTempDir ( ) ; if ( tempDir == null ) { throw new BuildException ( "Temporary directory cannot be null." ) ; } if ( Files . exists ( tempDir ) ) { if ( ! Files . isDirectory ( tempDir ) ) { throw new BuildException ( "Temporary directory is not a folder: " + tempDir . toAbsolutePath ( ) ) ; } } else { ...
public class ByteList { /** * This is equivalent to : * < pre > * < code > * if ( isEmpty ( ) ) { * return identity ; * byte result = identity ; * for ( int i = 0 ; i < size ; i + + ) { * result = accumulator . applyAsByte ( result , elementData [ i ] ) ; * return result ; * < / code > * < / pre > ...
if ( isEmpty ( ) ) { return identity ; } byte result = identity ; for ( int i = 0 ; i < size ; i ++ ) { result = accumulator . applyAsByte ( result , elementData [ i ] ) ; } return result ;
public class FFMPEGExecutor { /** * If there ' s a ffmpeg execution in progress , it kills it . */ public void destroy ( ) { } }
if ( inputStream != null ) { try { inputStream . close ( ) ; } catch ( Throwable t ) { LOG . warn ( "Error closing input stream" , t ) ; } inputStream = null ; } if ( outputStream != null ) { try { outputStream . close ( ) ; } catch ( Throwable t ) { LOG . warn ( "Error closing output stream" , t ) ; } outputStream = n...
public class IssueIndexer { /** * Commits the DB transaction and adds the issues to Elasticsearch index . * If indexing fails , then the recovery daemon will retry later and this * method successfully returns . Meanwhile these issues will be " eventually * consistent " when requesting the index . */ public void c...
ListMultimap < String , EsQueueDto > itemsByIssueKey = ArrayListMultimap . create ( ) ; issues . stream ( ) . map ( issue -> createQueueDto ( issue . getKey ( ) , ID_TYPE_ISSUE_KEY , issue . getProjectUuid ( ) ) ) // a mutable ListMultimap is needed for doIndexIssueItems , so MoreCollectors . index ( ) is // not used ....
public class CommerceShipmentItemPersistenceImpl { /** * Creates a new commerce shipment item with the primary key . Does not add the commerce shipment item to the database . * @ param commerceShipmentItemId the primary key for the new commerce shipment item * @ return the new commerce shipment item */ @ Override p...
CommerceShipmentItem commerceShipmentItem = new CommerceShipmentItemImpl ( ) ; commerceShipmentItem . setNew ( true ) ; commerceShipmentItem . setPrimaryKey ( commerceShipmentItemId ) ; commerceShipmentItem . setCompanyId ( companyProvider . getCompanyId ( ) ) ; return commerceShipmentItem ;
public class Persistables { /** * Returns an array containing a { @ link ByteBuffer } ' s { @ link ByteBuffer # remaining ( ) remaining } contents . < br > Upon returning * from this method , the buffer ' s { @ link ByteBuffer # position ( ) position } will remain unchanged . * @ param buffer The buffer to write in...
if ( buffer . hasArray ( ) && buffer . arrayOffset ( ) == 0 && buffer . position ( ) == 0 && buffer . limit ( ) == buffer . capacity ( ) && buffer . array ( ) . length == buffer . capacity ( ) ) { final byte [ ] array = buffer . array ( ) ; return array ; } final int p = buffer . position ( ) ; final byte [ ] array = n...
public class IntIntMap { /** * Increments the value associated with the specified key by the * specified amount . If the key has no previously assigned value , it * will be set to the amount specified ( as if incrementing from zero ) . * @ return the incremented value now stored for the key */ public int incremen...
Record rec = locateRecord ( key ) ; if ( rec == null ) { put ( key , amount ) ; return amount ; } else { return ( rec . value += amount ) ; }
public class BasicScope { /** * { @ inheritDoc } */ public boolean isConnectionAllowed ( IConnection conn ) { } }
if ( log . isDebugEnabled ( ) ) { log . debug ( "isConnectionAllowed: {}" , conn ) ; } if ( securityHandlers != null ) { if ( log . isDebugEnabled ( ) ) { log . debug ( "securityHandlers: {}" , securityHandlers ) ; } // loop through the handlers for ( IScopeSecurityHandler handler : securityHandlers ) { // if allowed c...
public class CmsLocaleManager { /** * Sets the configured locale handler . < p > * @ param localeHandler the locale handler to set */ public void setLocaleHandler ( I_CmsLocaleHandler localeHandler ) { } }
if ( localeHandler != null ) { m_localeHandler = localeHandler ; } if ( CmsLog . INIT . isInfoEnabled ( ) ) { CmsLog . INIT . info ( Messages . get ( ) . getBundle ( ) . key ( Messages . INIT_I18N_CONFIG_LOC_HANDLER_1 , m_localeHandler . getClass ( ) . getName ( ) ) ) ; }
public class Messenger { /** * Bind File View Model * @ param fileReference reference to file * @ param isAutoStart automatically start download * @ param callback View Model file state callback * @ return File View Model */ @ NotNull @ ObjectiveCName ( "bindFileWithReference:autoStart:withCallback:" ) public F...
return new FileVM ( fileReference , isAutoStart , modules , callback ) ;
public class GBSTree { /** * Add some number of free nodes to the node pool for testing . * @ param x The number of nodes to add . */ public void prePopulate ( int x ) { } }
for ( int i = 0 ; i < x ; i ++ ) { GBSNode p = new GBSNode ( this ) ; releaseNode ( p ) ; }