signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class ListRuleGroupsResult { /** * An array of < a > RuleGroup < / a > objects .
* @ param ruleGroups
* An array of < a > RuleGroup < / a > objects . */
public void setRuleGroups ( java . util . Collection < RuleGroupSummary > ruleGroups ) { } } | if ( ruleGroups == null ) { this . ruleGroups = null ; return ; } this . ruleGroups = new java . util . ArrayList < RuleGroupSummary > ( ruleGroups ) ; |
public class UniqueIDUtils { /** * The UUID for this incarnation of ME is generated
* using the hashcode of this object and the least
* significant four bytes of the current time in
* milliseconds .
* @ param caller The calling object used in the generation of the incarnation UUID
* @ return The generated inc... | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "generateIncUuid" , "Caller=" + caller ) ; java . util . Date time = new java . util . Date ( ) ; int hash = caller . hashCode ( ) ; long millis = time . getTime ( ) ; byte [ ] data = new byte [ ] { ( byte ) ( hash >> 24 ) ,... |
public class VAnnotationGrid { /** * Called whenever an update is received from the server */
@ Override public void updateFromUIDL ( UIDL uidl , ApplicationConnection client ) { } } | // This call should be made first .
// It handles sizes , captions , tooltips , etc . automatically .
if ( client . updateComponent ( this , uidl , true ) ) { // If client . updateComponent returns true there has been no changes and we
// do not need to update anything .
return ; } // Save reference to server connectio... |
public class AABBd { /** * Set the maximum corner coordinates .
* @ param max
* the maximum coordinates
* @ return this */
public AABBd setMax ( Vector3dc max ) { } } | return this . setMax ( max . x ( ) , max . y ( ) , max . z ( ) ) ; |
public class Model { /** * Sets attribute value as < code > Long < / code > .
* If there is a { @ link Converter } registered for the attribute that converts from Class < code > S < / code > to Class
* < code > java . lang . Long < / code > , given the value is an instance of < code > S < / code > , then it will be... | Converter < Object , Long > converter = modelRegistryLocal . converterForValue ( attributeName , value , Long . class ) ; return setRaw ( attributeName , converter != null ? converter . convert ( value ) : Convert . toLong ( value ) ) ; |
public class MinioClient { /** * Returns string map for given { @ link PostPolicy } to upload object with various post policy conditions .
* < / p > < b > Example : < / b > < br >
* < pre > { @ code / / Create new PostPolicy object for ' my - bucketname ' , ' my - objectname ' and 7 days expire time from now .
* ... | return policy . formData ( this . accessKey , this . secretKey , getRegion ( policy . bucketName ( ) ) ) ; |
public class RegExp { /** * Builds a regular expression equivalent to the concatenation of
* several ( possibly more than 2 ) terms . In the normal case ,
* this method applies the binary < code > Concat < / code > constructor
* repeatedly . If the list of terms contains a single term , the
* method returns tha... | if ( concatTerms . isEmpty ( ) ) return new EmptyStr < A > ( ) ; Iterator < RegExp < A > > it = concatTerms . iterator ( ) ; RegExp < A > re = it . next ( ) ; while ( it . hasNext ( ) ) { re = new Concat < A > ( re , it . next ( ) ) ; } return re ; |
public class WaveformPreviewComponent { /** * Converts a time in milliseconds to the appropriate x coordinate for drawing something at that time .
* Can only be called when we have { @ link TrackMetadata } .
* @ param milliseconds the time at which something should be drawn
* @ return the component x coordinate a... | if ( duration . get ( ) < 1 ) { // Don ' t crash if we are missing duration information .
return 0 ; } long result = milliseconds * waveformWidth ( ) / ( duration . get ( ) * 1000 ) ; return WAVEFORM_MARGIN + Math . max ( 0 , Math . min ( waveformWidth ( ) , ( int ) result ) ) ; |
public class ScopInstallation { /** * / * ( non - Javadoc )
* @ see org . biojava . nbio . structure . scop . ScopDatabase # getDomainsForPDB ( java . lang . String ) */
@ Override public List < ScopDomain > getDomainsForPDB ( String pdbId ) { } } | try { ensureClaInstalled ( ) ; } catch ( IOException e ) { throw new ScopIOException ( e ) ; } List < ScopDomain > doms = domainMap . get ( pdbId . toLowerCase ( ) ) ; List < ScopDomain > retdoms = new ArrayList < ScopDomain > ( ) ; if ( doms == null ) return retdoms ; for ( ScopDomain d : doms ) { try { ScopDomain n =... |
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link LinkType }
* { @ code > } */
@ XmlElementDecl ( namespace = "http://www.w3.org/2005/Atom" , name = "link" , scope = SourceType . class ) public JAXBElement < LinkType > createSourceTypeLink ( LinkType value ) { } } | return new JAXBElement < LinkType > ( ENTRY_TYPE_LINK_QNAME , LinkType . class , SourceType . class , value ) ; |
public class LuceneIndex { /** * Commits all changes to the index , waits for pending merges to complete , and closes all associated resources . */
public void close ( ) { } } | Log . info ( "Closing index" ) ; try { Log . info ( "Closing" ) ; searcherReopener . interrupt ( ) ; searcherManager . close ( ) ; indexWriter . close ( ) ; directory . close ( ) ; } catch ( IOException e ) { Log . error ( e , "Error while closing index" ) ; throw new RuntimeException ( e ) ; } |
public class ResolvedTypes { /** * / * @ Nullable */
protected JvmTypeReference getDeclaredType ( JvmIdentifiableElement identifiable ) { } } | if ( identifiable instanceof JvmOperation ) { return ( ( JvmOperation ) identifiable ) . getReturnType ( ) ; } if ( identifiable instanceof JvmField ) { return ( ( JvmField ) identifiable ) . getType ( ) ; } if ( identifiable instanceof JvmConstructor ) { return shared . resolver . getServices ( ) . getTypeReferences (... |
public class TypeUtility { /** * Checks if is enum .
* @ param className
* the class name
* @ return true , if is enum */
public static boolean isEnum ( String className ) { } } | try { // is it an enum ?
TypeElement element = BindTypeSubProcessor . elementUtils . getTypeElement ( className ) ; if ( element instanceof TypeElement ) { TypeElement typeElement = element ; TypeMirror superclass = typeElement . getSuperclass ( ) ; if ( superclass instanceof DeclaredType ) { DeclaredType superclassDec... |
public class HCalendarParser { /** * { @ inheritDoc } */
public void parse ( InputStream in , ContentHandler handler ) throws IOException , ParserException { } } | parse ( new InputSource ( in ) , handler ) ; |
public class Retryer { /** * Runs until the retry duration is reached
* @ throws Exception if an error occurs */
public void run ( ) throws Exception { } } | // Send the initial command :
client . sendRequest ( cmd ) ; long endTime = System . currentTimeMillis ( ) + spec . getMaxDuration ( ) ; // Wait until the ' after ' time
Thread . sleep ( spec . getAfter ( ) ) ; int numAttempts = 0 ; long now = System . currentTimeMillis ( ) ; while ( now < endTime ) { client . sendRequ... |
public class ZipFileSliceReader { /** * Copy from an offset within the file into a byte [ ] array ( possibly spanning the boundary between two 2GB
* chunks ) .
* @ param off
* the offset
* @ param buf
* the buffer to copy into
* @ param bufStart
* the start index within the buffer
* @ param numBytesToRe... | if ( off < 0 || bufStart < 0 || bufStart + numBytesToRead > buf . length ) { throw new IndexOutOfBoundsException ( ) ; } int currBufStart = bufStart ; int remainingBytesToRead = numBytesToRead ; int totBytesRead = 0 ; for ( long currOff = off ; remainingBytesToRead > 0 ; ) { // Find the ByteBuffer chunk to read from
fi... |
public class DeleteLagResult { /** * The connections bundled by the LAG .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setConnections ( java . util . Collection ) } or { @ link # withConnections ( java . util . Collection ) } if you want to
* override th... | if ( this . connections == null ) { setConnections ( new com . amazonaws . internal . SdkInternalList < Connection > ( connections . length ) ) ; } for ( Connection ele : connections ) { this . connections . add ( ele ) ; } return this ; |
public class State { /** * 添加一个匹配到的模式串 ( 这个状态对应着这个模式串 )
* @ param keyword */
public void addEmit ( int keyword ) { } } | if ( this . emits == null ) { this . emits = new TreeSet < Integer > ( Collections . reverseOrder ( ) ) ; } this . emits . add ( keyword ) ; |
public class StructuredQueryBuilder { /** * Matches an element , element pair , element attribute , pair , or path
* specifying a geospatial point that appears within one of the criteria regions .
* @ param index the container for the coordinates of the geospatial point
* @ param scope whether the query matches t... | checkRegions ( regions ) ; return new GeospatialPointQuery ( index , scope , regions , options ) ; |
public class IfcStructuralLoadConfigurationImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ SuppressWarnings ( "unchecked" ) @ Override public EList < IfcStructuralLoadOrResult > getValues ( ) { } } | return ( EList < IfcStructuralLoadOrResult > ) eGet ( Ifc4Package . Literals . IFC_STRUCTURAL_LOAD_CONFIGURATION__VALUES , true ) ; |
public class RepositoryMockAgent { /** * Modifies the belief referenced by bName parameter .
* @ param bName
* - the name of the belief to update .
* @ param value
* - the new value for the belief */
private void setBelief ( String bName , Object value ) { } } | introspector . setBeliefValue ( this . getLocalName ( ) , bName , value , null ) ; |
public class CmsTinyMceToolbarHelper { /** * Helper method to generate a TinyMCE - specific toolbar configuration string from a list of generic toolbar button names . < p >
* @ param barItems the generic toolbar items
* @ return the TinyMCE toolbar configuration string */
public static String createTinyMceToolbarSt... | List < List < String > > blocks = new ArrayList < List < String > > ( ) ; blocks . add ( new ArrayList < String > ( ) ) ; String lastItem = null ; List < String > processedItems = new ArrayList < String > ( ) ; // translate buttons and eliminate adjacent separators
for ( String barItem : barItems ) { String translated ... |
public class CheckedDatastoreReaderWriter { /** * Prefer this method over { @ link # get ( Iterable ) } to avoid gathering large results in a list .
* @ see DatastoreReaderWriter # get ( Key . . . )
* @ throws IOException if the underlying client throws { @ link DatastoreException }
* or if { @ code f } throws { ... | run ( ( ) -> rw . get ( toArray ( keys , Key . class ) ) . forEachRemaining ( IOConsumer . unchecked ( f ) ) ) ; |
public class GuiUtils { /** * A useful helper for development purposes . Used as a switch for loading files from local disk , allowing live
* editing whilst the app runs without rebuilds . */
public static URL getResource ( String name ) { } } | if ( false ) return unchecked ( ( ) -> new URL ( "file:///your/path/here/src/main/wallettemplate/" + name ) ) ; else return MainController . class . getResource ( name ) ; |
public class DBStripeStore { /** * Only used for testing */
public void dropTable ( ) throws IOException { } } | DBUtils . runInsert ( connectionFactory , DROP_TABLE_SQL , DBUtils . EMPTY_SQL_PARAMS , sqlNumRetries ) ; LOG . info ( "Drop table " + tblName ) ; |
public class SparkClientFactory { /** * ( non - Javadoc )
* @ see
* com . impetus . kundera . loader . GenericClientFactory # initialize ( java . util . Map ) */
@ Override public void initialize ( Map < String , Object > puProperties ) { } } | reader = new SparkEntityReader ( kunderaMetadata ) ; setExternalProperties ( puProperties ) ; initializePropertyReader ( ) ; PersistenceUnitMetadata pum = kunderaMetadata . getApplicationMetadata ( ) . getPersistenceUnitMetadata ( getPersistenceUnit ( ) ) ; sparkconf = new SparkConf ( true ) ; configureClientProperties... |
public class ItemDeletion { /** * Register the supplied { @ link Item } for deletion .
* @ param item the { @ link Item } that is to be deleted .
* @ return { @ code true } if and only if the { @ link Item } was registered and the caller is now responsible to call
* { @ link # deregister ( Item ) } . */
public st... | ItemDeletion instance = instance ( ) ; if ( instance == null ) { return false ; } instance . lock . writeLock ( ) . lock ( ) ; try { return instance . registrations . add ( item ) ; } finally { instance . lock . writeLock ( ) . unlock ( ) ; } |
public class Node { /** * Add or override a named attribute . < br / >
* < br / >
* value will be converted to String using String . valueOf ( value ) ;
* @ param name
* The attribute name
* @ param value
* The given value
* @ return This { @ link Node }
* @ see # attribute ( String , String ) */
public... | return attribute ( name , String . valueOf ( value ) ) ; |
public class ConfigurationContext { /** * Register commands resolved with classpath scan .
* @ param commands installed commands
* @ see ru . vyarus . dropwizard . guice . GuiceBundle . Builder # searchCommands ( ) */
public void registerCommands ( final List < Class < Command > > commands ) { } } | setScope ( ConfigScope . ClasspathScan . getType ( ) ) ; for ( Class < Command > cmd : commands ) { register ( ConfigItem . Command , cmd ) ; } closeScope ( ) ; |
public class EndpointBuilder { /** * Builds an XML - PRC server that can be exposed via { @ link NanoServer } .
* Methods declared by < code > clazz < / code > should be annotated by
* { @ link XRMethod } .
* @ param server
* Java object implementing service
* @ param clazz
* declaring XML - RPC methods
*... | "rawtypes" , "unchecked" } ) public < Z > EndpointBuilder < HTTPServerEndpoint > server ( Z server , Class < Z > clazz ) { return new EndpointBuilder ( server , clazz ) ; |
public class DULogEntry { /** * Sets the data usage for a given attribute .
* @ param attribute The attribute ( data element ) for which the usage is
* specified .
* @ param dataUsage The usage of the data element specified by the given
* attribute .
* @ return < code > true < / code > if the data usage for t... | Validate . notNull ( attribute ) ; Validate . notNull ( dataUsage ) ; Validate . notEmpty ( dataUsage ) ; if ( isFieldLocked ( EntryField . DATA ) ) { if ( ! ( this . dataUsage . containsKey ( attribute ) && this . dataUsage . get ( attribute ) . equals ( dataUsage ) ) ) { throw new LockingException ( EntryField . DATA... |
public class CmsConfigurationReader { /** * Gets the string value of an XML content location . < p >
* @ param cms the CMS context to use
* @ param location an XML content location
* @ return the string value of that XML content location */
public static String getString ( CmsObject cms , I_CmsXmlContentValueLoca... | if ( location == null ) { return null ; } return location . asString ( cms ) ; |
public class RegularCyclicVertexSearch { /** * Build an indexed lookup of vertex color . The vertex color indicates which
* cycle a given vertex belongs . If a vertex belongs to more then one cycle
* it is colored ' 0 ' . If a vertex belongs to no cycle it is colored ' - 1 ' .
* @ return vertex colors */
private ... | int [ ] color = new int [ g . length ] ; int n = 1 ; Arrays . fill ( color , - 1 ) ; for ( long cycle : cycles ) { for ( int i = 0 ; i < g . length ; i ++ ) { if ( ( cycle & 0x1 ) == 0x1 ) color [ i ] = color [ i ] < 0 ? n : 0 ; cycle >>= 1 ; } n ++ ; } return color ; |
public class IOCImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public Object eGet ( int featureID , boolean resolve , boolean coreType ) { } } | switch ( featureID ) { case AfplibPackage . IOC__XOA_OSET : return getXoaOset ( ) ; case AfplibPackage . IOC__YOA_OSET : return getYoaOset ( ) ; case AfplibPackage . IOC__XOA_ORENT : return getXoaOrent ( ) ; case AfplibPackage . IOC__YOA_ORENT : return getYoaOrent ( ) ; case AfplibPackage . IOC__CON_DATA1 : return getC... |
public class PcmWavConverter { /** * This method appends the passed in { @ link com . github . republicofgavin . pauseresumeaudiorecorder . conversion . PcmWavConverter . WaveHeader } to the beginning of the passed in
* . wav file . NOTE : To prevent data from being overwritten by this method , it is advisable to wri... | if ( waveHeader == null ) { throw new IllegalArgumentException ( "waveHeader cannot be null" ) ; } if ( wavFilePath == null || wavFilePath . trim ( ) . isEmpty ( ) ) { throw new IllegalArgumentException ( "wavFilePath cannot be null, empty, blank" ) ; } RandomAccessFile randomAccessFile = new RandomAccessFile ( new Fil... |
public class RTreeIndexExtension { /** * { @ inheritDoc } */
@ Override public void createMaxXFunction ( ) { } } | createFunction ( MAX_X_FUNCTION , new GeometryFunction ( ) { @ Override public Object execute ( GeoPackageGeometryData data ) { Object value = null ; GeometryEnvelope envelope = getEnvelope ( data ) ; if ( envelope != null ) { value = envelope . getMaxX ( ) ; } return value ; } } ) ; |
public class AssertKripton { /** * When a pojo has a valid constructor
* @ param expression
* @ param entity */
public static void assertTrueOfInvalidConstructor ( boolean expression , ModelClass < ? > entity ) { } } | if ( ! expression ) { String msg = String . format ( "Class '%s' has no constructor without parameters (to be a mutable class) or with all parameters (to be an immutable class)." , entity . getElement ( ) . getQualifiedName ( ) ) ; throw ( new InvalidDefinition ( msg ) ) ; } |
public class InternalPureXbaseParser { /** * $ ANTLR start synpred17 _ InternalPureXbase */
public final void synpred17_InternalPureXbase_fragment ( ) throws RecognitionException { } } | // InternalPureXbase . g : 1714:6 : ( ( ' < ' ' < ' ) )
// InternalPureXbase . g : 1714:7 : ( ' < ' ' < ' )
{ // InternalPureXbase . g : 1714:7 : ( ' < ' ' < ' )
// InternalPureXbase . g : 1715:7 : ' < ' ' < '
{ match ( input , 28 , FOLLOW_17 ) ; if ( state . failed ) return ; match ( input , 28 , FOLLOW_2 ) ; if ( sta... |
public class XMLUtil { /** * Replies the boolean value that corresponds to the specified attribute ' s path .
* < p > The path is an ordered list of tag ' s names and ended by the name of
* the attribute .
* @ param document is the XML document to explore .
* @ param caseSensitive indicates of the { @ code path... | assert document != null : AssertMessages . notNullParameter ( 0 ) ; final String v = getAttributeValue ( document , caseSensitive , 0 , path ) ; if ( v == null || v . isEmpty ( ) ) { return defaultValue ; } return CONSTANT_TRUE . equalsIgnoreCase ( v ) || CONSTANT_YES . equalsIgnoreCase ( v ) || CONSTANT_ON . equalsIgn... |
public class ArrayUtil { /** * concat 2 array to a new array .
* @ param first first array , can not be null
* @ param second second array , can not be null
* @ return the result array .
* @ deprecated This method can not cocat null object and only supports concating of 2 arrays . Use { @ link # concatV2 ( Clas... | T [ ] result = Arrays . copyOf ( first , first . length + second . length ) ; System . arraycopy ( second , 0 , result , first . length , second . length ) ; return result ; |
public class ThreadLocalSecureRandomUuidFactory { /** * / * package private */
static long toLong ( final byte [ ] buffer , final int offset ) { } } | final long value1 = toInt ( buffer , offset ) ; final long value2 = toInt ( buffer , offset + 4 ) ; return ( value1 << 32 ) + ( ( value2 << 32 ) >>> 32 ) ; |
public class SraReader { /** * Read a study from the specified URL .
* @ param url URL , must not be null
* @ return a study read from the specified URL
* @ throws IOException if an I / O error occurs */
public static Study readStudy ( final URL url ) throws IOException { } } | checkNotNull ( url ) ; try ( BufferedReader reader = Resources . asCharSource ( url , Charsets . UTF_8 ) . openBufferedStream ( ) ) { return readStudy ( reader ) ; } |
public class UIComponentTag { /** * Determine whether this component renders itself . A component is " suppressed " when it is either not rendered , or
* when it is rendered by its parent component at a time of the parent ' s choosing . */
protected boolean isSuppressed ( ) { } } | if ( _suppressed == null ) { // we haven ' t called this method before , so determine the suppressed
// value and cache it for later calls to this method .
if ( isFacet ( ) ) { // facets are always rendered by their parents - - > suppressed
_suppressed = Boolean . TRUE ; return true ; } UIComponent component = getCompo... |
public class URBridge { /** * Set the mapping of RDN properties for each entity type . A map is created
* with the key as the entity type and the value as the RDN property to be used .
* This information is taken from the configuration .
* @ param configProps map containing the configuration information .
* @ t... | List < String > entityTypes = getSupportedEntityTypes ( ) ; String rdnProp ; String type = null ; entityConfigMap = new HashMap < String , String > ( ) ; for ( int i = 0 ; i < entityTypes . size ( ) ; i ++ ) { type = entityTypes . get ( i ) ; rdnProp = ( getRDNProperties ( type ) == null ) ? null : getRDNProperties ( t... |
public class HMModel { /** * Utility method to concatenate conditions with or .
* This can be useful for readability ( in case of negation ) .
* @ param statements a list of statements .
* @ return the final boolean from the or concatenation . */
protected boolean concatOr ( boolean ... statements ) { } } | boolean isTrue = statements [ 0 ] ; for ( int i = 1 ; i < statements . length ; i ++ ) { isTrue = isTrue || statements [ i ] ; } return isTrue ; |
public class CmsSitemapView { /** * Returns the disabled state of the given model page entry . < p >
* @ param id the entry id
* @ return the disabled state */
public boolean isDisabledModelPageEntry ( CmsUUID id ) { } } | boolean result = false ; if ( m_modelPageTreeItems . containsKey ( id ) ) { result = m_modelPageTreeItems . get ( id ) . isDisabled ( ) ; } else if ( m_parentModelPageTreeItems . containsKey ( id ) ) { result = m_parentModelPageTreeItems . get ( id ) . isDisabled ( ) ; } return result ; |
public class Util { /** * / * Utility function to override system default font with an font ttf file from asset . The override
* will be applied to the entire application . The ideal place to call this method is from the onCreate ( )
* of the Application .
* Usage : Util . replaceDefaultFont ( this , " Tinos - Re... | final Typeface newTypeface = Typeface . createFromAsset ( context . getAssets ( ) , fontFilePath ) ; TypedValue tv = new TypedValue ( ) ; String staticTypefaceFieldName = null ; Map < String , Typeface > newMap = null ; Resources . Theme apptentiveTheme = context . getResources ( ) . newTheme ( ) ; ApptentiveInternal .... |
public class Caster { /** * cast a Object to a Component
* @ param o Object to cast
* @ return casted Component
* @ throws PageException */
public static Component toComponent ( Object o ) throws PageException { } } | if ( o instanceof Component ) return ( Component ) o ; else if ( o instanceof ObjectWrap ) { return toComponent ( ( ( ObjectWrap ) o ) . getEmbededObject ( ) ) ; } throw new CasterException ( o , "Component" ) ; |
public class QueryServiceImpl { /** * Fetches the raw text from the text . tab file .
* @ param top the name of the top level corpus .
* @ param docname the name of the document .
* @ return Can be empty , if the corpus only contains media data or
* segmentations . */
@ GET @ Path ( "rawtext/{top}/{docname}" ) ... | Subject user = SecurityUtils . getSubject ( ) ; user . checkPermission ( "query:raw_text:" + top ) ; RawTextWrapper result = new RawTextWrapper ( ) ; result . setTexts ( queryDao . getRawText ( top , docname ) ) ; return result ; |
public class X500Name { /** * Return an immutable List of all RDNs in this X500Name . */
public List < RDN > rdns ( ) { } } | List < RDN > list = rdnList ; if ( list == null ) { list = Collections . unmodifiableList ( Arrays . asList ( names ) ) ; rdnList = list ; } return list ; |
public class NativeDate { /** * / * the javascript constructor */
private static Object jsConstructor ( Object [ ] args ) { } } | NativeDate obj = new NativeDate ( ) ; // if called as a constructor with no args ,
// return a new Date with the current time .
if ( args . length == 0 ) { obj . date = now ( ) ; return obj ; } // if called with just one arg -
if ( args . length == 1 ) { Object arg0 = args [ 0 ] ; if ( arg0 instanceof NativeDate ) { ob... |
public class BulkSubmissionPublisher { /** * Submit int .
* @ param dataArray the data array
* @ return the int */
public int submit ( T [ ] dataArray ) { } } | return submitBulk ( Optional . ofNullable ( dataArray ) . map ( Arrays :: asList ) . orElseGet ( Collections :: emptyList ) ) ; |
public class MaterialNavigationDrawer { /** * private methods */
private MaterialAccount findAccountNumber ( int number ) { } } | for ( MaterialAccount account : accountManager ) if ( account . getAccountNumber ( ) == number ) return account ; return null ; |
public class Timex3Interval { /** * setter for beginTimex - sets
* @ generated
* @ param v value to set into the feature */
public void setBeginTimex ( String v ) { } } | if ( Timex3Interval_Type . featOkTst && ( ( Timex3Interval_Type ) jcasType ) . casFeat_beginTimex == null ) jcasType . jcas . throwFeatMissing ( "beginTimex" , "de.unihd.dbs.uima.types.heideltime.Timex3Interval" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( Timex3Interval_Type ) jcasType ) . casFeatCode_beginT... |
public class TasksInner { /** * Returns a task with extended information that includes all secrets .
* @ param resourceGroupName The name of the resource group to which the container registry belongs .
* @ param registryName The name of the container registry .
* @ param taskName The name of the container registr... | return getDetailsWithServiceResponseAsync ( resourceGroupName , registryName , taskName ) . toBlocking ( ) . single ( ) . body ( ) ; |
public class CmsWorkplace { /** * Returns all initialized parameters of the current workplace class
* that are not in the given exclusion list as hidden field tags that can be inserted in a form . < p >
* @ param excludes the parameters to exclude
* @ return all initialized parameters of the current workplace cla... | StringBuffer result = new StringBuffer ( 512 ) ; Map < String , Object > params = paramValues ( ) ; Iterator < Entry < String , Object > > i = params . entrySet ( ) . iterator ( ) ; while ( i . hasNext ( ) ) { Entry < String , Object > entry = i . next ( ) ; String param = entry . getKey ( ) ; if ( ( excludes == null )... |
public class Metric { /** * To return an identifier string , the format is & lt ; namespace & gt ; : & lt ; scope & gt ; : & lt ; name & gt ; { & lt ; tags & gt ; }
* @ return Returns a metric identifier for the metric . Will never return null . */
@ JsonIgnore public String getIdentifier ( ) { } } | String tags = "" ; Map < String , String > sortedTags = new TreeMap < > ( ) ; sortedTags . putAll ( getTags ( ) ) ; if ( ! sortedTags . isEmpty ( ) ) { StringBuilder tagListBuffer = new StringBuilder ( "{" ) ; for ( String tagKey : sortedTags . keySet ( ) ) { tagListBuffer . append ( tagKey ) . append ( '=' ) . append ... |
public class DateTimePerformance { private void checkJodaSetGetHour ( ) { } } | int COUNT = COUNT_VERY_FAST ; // Is it fair to use only MutableDateTime here ? You decide .
MutableDateTime dt = new MutableDateTime ( GJChronology . getInstance ( ) ) ; for ( int i = 0 ; i < AVERAGE ; i ++ ) { start ( "Joda" , "setGetHour" ) ; for ( int j = 0 ; j < COUNT ; j ++ ) { dt . setHourOfDay ( 13 ) ; int val =... |
public class DynamicClassGenerator { /** * Shortcut for { @ link # generate ( Class , Class , Class ) } method to create classes with provided scope
* ( and without extra anchor ) .
* Method is thread safe .
* @ param type interface or abstract class
* @ param scope scope annotation to apply on generated class ... | return generate ( type , scope , null ) ; |
public class AbstractDocumentQuery { /** * Gets the fields for projection
* @ return list of projected fields */
@ Override public List < String > getProjectionFields ( ) { } } | return fieldsToFetchToken != null && fieldsToFetchToken . projections != null ? Arrays . asList ( fieldsToFetchToken . projections ) : Collections . emptyList ( ) ; |
public class DOMProcessing { /** * Creates a DOM { @ link Element } for a { @ link QualifiedName } and content given by value
* @ param elementName a { @ link QualifiedName } to denote the element name
* @ param value for the created { @ link Element }
* @ return a new { @ link Element } */
final static public El... | org . w3c . dom . Document doc = builder . newDocument ( ) ; Element el = doc . createElementNS ( elementName . getNamespaceURI ( ) , qualifiedNameToString ( elementName . toQName ( ) ) ) ; // 1 . we add an xsi : type = " xsd : QName " attribute
// making sure xsi and xsd prefixes are appropriately declared .
el . setA... |
public class ListUtil { /** * cast a Object Array to a String Array
* @ param array
* @ return String Array */
public static String [ ] toStringArrayEL ( Array array ) { } } | String [ ] arr = new String [ array . size ( ) ] ; for ( int i = 0 ; i < arr . length ; i ++ ) { arr [ i ] = Caster . toString ( array . get ( i + 1 , null ) , null ) ; } return arr ; |
public class AnnivMaster { /** * Add this field in the Record ' s field sequence . */
public BaseField setupField ( int iFieldSeq ) { } } | BaseField field = null ; // if ( iFieldSeq = = 0)
// field = new CounterField ( this , ID , Constants . DEFAULT _ FIELD _ LENGTH , null , null ) ;
// field . setHidden ( true ) ;
// if ( iFieldSeq = = 1)
// field = new RecordChangedField ( this , LAST _ CHANGED , Constants . DEFAULT _ FIELD _ LENGTH , null , null ) ;
/... |
public class TrieData { /** * one entry per line . word first , then tab , then data */
public void toIdFile ( OutputStream os ) throws IOException { } } | BufferedWriter writer = new BufferedWriter ( new OutputStreamWriter ( os ) ) ; for ( TrieNodeData < T > child : root . children . values ( ) ) { child . writeIds ( writer , new char [ 0 ] ) ; // recursive
} writer . close ( ) ; |
import java . util . * ; class Main { /** * This function transforms the provided array into a set .
* Examples :
* convertArrayIntoSet ( new String [ ] { " x " , " y " , " z " } ) - > { " x " , " y " , " z " }
* convertArrayIntoSet ( new String [ ] { " a " , " b " , " c " } ) - > { " a " , " b " , " c " }
* co... | Set < String > outputSet = new HashSet < String > ( Arrays . asList ( inputArray ) ) ; return outputSet ; |
public class CustomerConfirmation { /** * region > downloadCustomerConfirmation ( action ) */
@ Action ( semantics = SemanticsOf . SAFE ) @ ActionLayout ( contributed = Contributed . AS_ACTION ) @ MemberOrder ( sequence = "10" ) public Blob downloadCustomerConfirmation ( final Order order ) throws IOException , JDOMExc... | final org . w3c . dom . Document w3cDocument = asInputW3cDocument ( order ) ; final ByteArrayOutputStream docxTarget = new ByteArrayOutputStream ( ) ; docxService . merge ( w3cDocument , wordprocessingMLPackage , docxTarget , DocxService . MatchingPolicy . LAX ) ; final String blobName = "customerConfirmation-" + order... |
public class EscapeTransliterator { /** * Registers standard variants with the system . Called by
* Transliterator during initialization . */
static void register ( ) { } } | // Unicode : " U + 10FFFF " hex , min = 4 , max = 6
Transliterator . registerFactory ( "Any-Hex/Unicode" , new Transliterator . Factory ( ) { @ Override public Transliterator getInstance ( String ID ) { return new EscapeTransliterator ( "Any-Hex/Unicode" , "U+" , "" , 16 , 4 , true , null ) ; } } ) ; // Java : " \ \ uF... |
public class GPARCImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public Object eGet ( int featureID , boolean resolve , boolean coreType ) { } } | switch ( featureID ) { case AfplibPackage . GPARC__XPOS : return getXPOS ( ) ; case AfplibPackage . GPARC__YPOS : return getYPOS ( ) ; case AfplibPackage . GPARC__XCENT : return getXCENT ( ) ; case AfplibPackage . GPARC__YCENT : return getYCENT ( ) ; case AfplibPackage . GPARC__MH : return getMH ( ) ; case AfplibPackag... |
public class DisconfCenterStore { /** * 存储 一个配置文件 */
public void storeOneFile ( DisconfCenterBaseModel disconfCenterBaseModel ) { } } | DisconfCenterFile disconfCenterFile = ( DisconfCenterFile ) disconfCenterBaseModel ; String fileName = disconfCenterFile . getFileName ( ) ; if ( confFileMap . containsKey ( fileName ) ) { LOGGER . warn ( "There are two same fileName key!!!! " + fileName ) ; DisconfCenterFile existCenterFile = confFileMap . get ( fileN... |
public class YamlReader { /** * Returns a new object of the requested type . */
protected Object createObject ( Class type ) throws InvocationTargetException { } } | // Use deferred construction if a non - zero - arg constructor is available .
DeferredConstruction deferredConstruction = Beans . getDeferredConstruction ( type , config ) ; if ( deferredConstruction != null ) return deferredConstruction ; return Beans . createObject ( type , config . privateConstructors ) ; |
public class ClassloaderManager { /** * Returns all the URL that should be inside the classpath . This includes the jar itself if any .
* @ throws JqmPayloadException */
private URL [ ] getClasspath ( JobInstance ji , JobRunnerCallback cb ) throws JqmPayloadException { } } | switch ( ji . getJD ( ) . getPathType ( ) ) { case MAVEN : return mavenResolver . resolve ( ji ) ; case MEMORY : return new URL [ 0 ] ; case FS : default : return fsResolver . getLibraries ( ji . getNode ( ) , ji . getJD ( ) ) ; } |
public class FastThreadLocal { /** * Sets the value to uninitialized for the specified thread local map ;
* a proceeding call to get ( ) will trigger a call to initialValue ( ) .
* The specified thread local map must be for the current thread . */
@ SuppressWarnings ( "unchecked" ) public final void remove ( Intern... | if ( threadLocalMap == null ) { return ; } Object v = threadLocalMap . removeIndexedVariable ( index ) ; removeFromVariablesToRemove ( threadLocalMap , this ) ; if ( v != InternalThreadLocalMap . UNSET ) { try { onRemoval ( ( V ) v ) ; } catch ( Exception e ) { PlatformDependent . throwException ( e ) ; } } |
public class InitializeClusterRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( InitializeClusterRequest initializeClusterRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( initializeClusterRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( initializeClusterRequest . getClusterId ( ) , CLUSTERID_BINDING ) ; protocolMarshaller . marshall ( initializeClusterRequest . getSignedCert ( ) , SIGNEDCERT_BI... |
public class CamelRouteAdapter { /** * Returns the latest version whose attributes match the custom attribute
* criteria specified via " CustomAttributes " .
* Override to apply additional or non - standard conditions .
* @ param version */
protected RoutesDefinition getRoutesDefinition ( String name , String ver... | String modifier = "" ; Map < String , String > params = getHandlerParameters ( ) ; if ( params != null ) { for ( String paramName : params . keySet ( ) ) { if ( modifier . length ( ) == 0 ) modifier += "?" ; else modifier += "&" ; modifier += paramName + "=" + params . get ( paramName ) ; } } Map < String , String ... |
public class PoolUtil { /** * Returns sql statement used in this prepared statement together with the parameters .
* @ param sql base sql statement
* @ param logParams parameters to print out
* @ return returns printable statement */
public static String fillLogParams ( String sql , Map < Object , Object > logPar... | StringBuilder result = new StringBuilder ( ) ; Map < Object , Object > tmpLogParam = ( logParams == null ? new HashMap < Object , Object > ( ) : logParams ) ; Iterator < Object > it = tmpLogParam . values ( ) . iterator ( ) ; boolean inQuote = false ; boolean inQuote2 = false ; char [ ] sqlChar = sql != null ? sql . to... |
public class SnappyLoader { /** * Extract the specified library file to the target folder
* @ param libFolderForCurrentOS
* @ param libraryFileName
* @ param targetFolder
* @ return */
private static File extractLibraryFile ( String libFolderForCurrentOS , String libraryFileName , String targetFolder ) { } } | String nativeLibraryFilePath = libFolderForCurrentOS + "/" + libraryFileName ; // Attach UUID to the native library file to ensure multiple class loaders can read the libsnappy - java multiple times .
String uuid = UUID . randomUUID ( ) . toString ( ) ; String extractedLibFileName = String . format ( "snappy-%s-%s-%s" ... |
public class MavenProjectScannerPlugin { /** * Resolves a maven project .
* @ param project
* The project
* @ param expectedType
* The expected descriptor type .
* @ param scannerContext
* The scanner context .
* @ param < T >
* The expected descriptor type .
* @ return The maven project descriptor . ... | Store store = scannerContext . getStore ( ) ; String id = project . getGroupId ( ) + ":" + project . getArtifactId ( ) + ":" + project . getVersion ( ) ; MavenProjectDescriptor projectDescriptor = store . find ( MavenProjectDescriptor . class , id ) ; if ( projectDescriptor == null ) { projectDescriptor = store . creat... |
public class DenseVectorSupportMethods { /** * WARNING : only returns the right answer for vectors of length < MAX _ SMALL _ DOT _ PRODUCT _ LENGTH
* @ param a
* @ param b
* @ param length
* @ return */
public static double smallDotProduct_Double ( double [ ] a , double [ ] b , int length ) { } } | double sumA = 0.0 ; double sumB = 0.0 ; switch ( length ) { case 7 : sumA = a [ 6 ] * b [ 6 ] ; case 6 : sumB = a [ 5 ] * b [ 5 ] ; case 5 : sumA += a [ 4 ] * b [ 4 ] ; case 4 : sumB += a [ 3 ] * b [ 3 ] ; case 3 : sumA += a [ 2 ] * b [ 2 ] ; case 2 : sumB += a [ 1 ] * b [ 1 ] ; case 1 : sumA += a [ 0 ] * b [ 0 ] ; cas... |
public class Workbook { /** * Returns the current offset for the given date allowing for daylight savings .
* @ param dt The date to be checked
* @ return The current offset for the given date allowing for daylight savings */
protected int getOffset ( long dt ) { } } | int ret = 0 ; TimeZone tz = DateUtilities . getCurrentTimeZone ( ) ; if ( tz != null ) ret = tz . getOffset ( dt ) ; return ret ; |
public class IndexExpression { /** * Deserializes an < code > IndexExpression < / code > instance from the specified input .
* @ param input the input to read from
* @ return the < code > IndexExpression < / code > instance deserialized
* @ throws IOException if a problem occurs while deserializing the < code > I... | return new IndexExpression ( ByteBufferUtil . readWithShortLength ( input ) , Operator . readFrom ( input ) , ByteBufferUtil . readWithShortLength ( input ) ) ; |
public class ProcessUtil { /** * Runs the given set of command line arguments as a system process and returns the exit value of the spawned
* process . Outputs of the process ( both normal and error ) are passed to the { @ code consumer } .
* @ param commandLine
* the list of command line arguments to run
* @ p... | return invokeProcess ( commandLine , null , new DelegatingConsumer ( consumer ) ) ; |
public class LegacyJavaRuntime { /** * Gets { @ link Throwable # getStackTraceElement ( int ) } as accessible method .
* @ return Instance if available , { @ code null } if not */
private static Method getStackTraceElementGetter ( ) { } } | try { Method method = Throwable . class . getDeclaredMethod ( "getStackTraceElement" , int . class ) ; method . setAccessible ( true ) ; StackTraceElement stackTraceElement = ( StackTraceElement ) method . invoke ( new Throwable ( ) , 0 ) ; if ( LegacyJavaRuntime . class . getName ( ) . equals ( stackTraceElement . get... |
public class UTF8String { /** * TODO : Need to use ` Code Point ` here instead of Char in case the character longer than 2 bytes */
public UTF8String translate ( Map < Character , Character > dict ) { } } | String srcStr = this . toString ( ) ; StringBuilder sb = new StringBuilder ( ) ; for ( int k = 0 ; k < srcStr . length ( ) ; k ++ ) { if ( null == dict . get ( srcStr . charAt ( k ) ) ) { sb . append ( srcStr . charAt ( k ) ) ; } else if ( '\0' != dict . get ( srcStr . charAt ( k ) ) ) { sb . append ( dict . get ( srcS... |
public class MarketEquilibrium { /** * Calculates the portfolio variance using the input instrument weights . */
public Scalar < ? > calculatePortfolioVariance ( final PrimitiveMatrix assetWeights ) { } } | PrimitiveMatrix tmpLeft ; PrimitiveMatrix tmpRight ; if ( assetWeights . countColumns ( ) == 1L ) { tmpLeft = assetWeights . transpose ( ) ; tmpRight = assetWeights ; } else { tmpLeft = assetWeights ; tmpRight = assetWeights . transpose ( ) ; } return tmpLeft . multiply ( myCovariances . multiply ( tmpRight ) ) . toSca... |
public class ProcessTweaks { /** * Passes the compiler default value overrides to the JS by replacing calls
* to goog . tweak . getCompilerOverrids _ with a map of tweak ID - > default value ; */
private void replaceGetCompilerOverridesCalls ( List < TweakFunctionCall > calls ) { } } | for ( TweakFunctionCall call : calls ) { Node callNode = call . callNode ; Node objNode = createCompilerDefaultValueOverridesVarNode ( callNode ) ; callNode . replaceWith ( objNode ) ; compiler . reportChangeToEnclosingScope ( objNode ) ; } |
public class SConverterGeneratorWrapper { public void generate ( Set < EPackage > ePackages ) { } } | try { FileUtils . forceMkdir ( packageFolder ) ; } catch ( IOException e ) { LOGGER . error ( "" , e ) ; } SConverterGenerator converterGenerator = new SConverterGenerator ( ) ; Object [ ] arguments = new Object [ ] { metaDataManager , ePackages } ; String generated = converterGenerator . generate ( arguments ) ; File ... |
public class RaftAgent { /** * Create an instance of { @ code RaftAgent } from a configuration file .
* @ param configFile location of the JSON configuration file . The
* configuration in this file will be validated .
* See the project README . md for more on the configuration file
* @ param raftListener instan... | RaftConfiguration configuration = RaftConfigurationLoader . loadFromFile ( configFile ) ; return fromConfigurationObject ( configuration , raftListener ) ; |
public class GeneralFft_to_DiscreteFourierTransform_F32 { /** * Declare the algorithm if the image size has changed */
private void checkDeclareAlg ( GrayF32 image ) { } } | if ( prevWidth != image . width || prevHeight != image . height ) { prevWidth = image . width ; prevHeight = image . height ; alg = new GeneralPurposeFFT_F32_2D ( image . height , image . width ) ; } |
public class ExcelTemplateWriter { /** * write . */
public void write ( ) { } } | try { org . jxls . common . Context ctx = new org . jxls . common . Context ( ) ; for ( Map . Entry < String , Object > entry : context . getDatas ( ) . entrySet ( ) ) { ctx . putVar ( entry . getKey ( ) , entry . getValue ( ) ) ; } JxlsHelper . getInstance ( ) . processTemplate ( template . openStream ( ) , outputStre... |
public class EmulatedFields { /** * Finds and returns the short value of a given field named { @ code name } in
* the receiver . If the field has not been assigned any value yet , the
* default value { @ code defaultValue } is returned instead .
* @ param name
* the name of the field to find .
* @ param defau... | ObjectSlot slot = findMandatorySlot ( name , short . class ) ; return slot . defaulted ? defaultValue : ( ( Short ) slot . fieldValue ) . shortValue ( ) ; |
public class SoapAttachment { /** * Get the content file resource path .
* @ return the content resource path */
public String getContentResourcePath ( ) { } } | if ( contentResourcePath != null && context != null ) { return context . replaceDynamicContentInString ( contentResourcePath ) ; } else { return contentResourcePath ; } |
public class ContentSecurityPolicyFilter { /** * Returns the value of the initParam .
* @ param filterConfig a FilterConfig instance
* @ param initParam the name of the init parameter
* @ param variable the variable to use if the init param was not defined
* @ return a String */
private String getValue ( Filter... | final String value = filterConfig . getInitParameter ( initParam ) ; if ( StringUtils . isNotBlank ( value ) ) { return value ; } else { return variable ; } |
public class SentimentAlchemyEntity { /** * Set sentiment polarity : " positive " , " negative " , or " neutral " .
* @ param type sentiment polarity
* @ see # setType ( SentimentAlchemyEntity . TYPE ) */
public void setType ( String type ) { } } | if ( StringUtils . isBlank ( type ) ) { setType ( TYPE . UNSET ) ; } else { if ( TYPE . NEGATIVE . toString ( ) . equalsIgnoreCase ( type . trim ( ) ) ) { setType ( TYPE . NEGATIVE ) ; } if ( TYPE . NEUTRAL . toString ( ) . equalsIgnoreCase ( type . trim ( ) ) ) { setType ( TYPE . NEUTRAL ) ; } if ( TYPE . POSITIVE . t... |
public class DefaultOptionParser { /** * Tells if the token looks like a short option .
* @ param token the command line token to handle
* @ return true if the token like a short option */
private boolean isShortOption ( String token ) { } } | // short options ( - S , - SV , - S = V , - SV1 = V2 , - S1S2)
if ( ! token . startsWith ( "-" ) || token . length ( ) == 1 ) { return false ; } // remove leading " - " and " = value "
int pos = token . indexOf ( "=" ) ; String name = ( pos == - 1 ? token . substring ( 1 ) : token . substring ( 1 , pos ) ) ; if ( optio... |
public class Item { /** * Sets this item to an integer item .
* @ param intVal
* the value of this item . */
void set ( final int intVal ) { } } | this . type = ClassWriter . INT ; this . intVal = intVal ; this . hashCode = 0x7FFFFFFF & ( type + intVal ) ; |
public class ChatDirector { /** * Display the specified system message as if it had come from the server . */
protected void displaySystem ( String bundle , String message , byte attLevel , String localtype ) { } } | // nothing should be untranslated , so pass the default bundle if need be .
if ( bundle == null ) { bundle = _bundle ; } SystemMessage msg = new SystemMessage ( message , bundle , attLevel ) ; dispatchMessage ( msg , localtype ) ; |
public class JsonService { /** * Get a double value from a { @ link JSONObject } .
* @ param jsonObject The object to get the key value from .
* @ param key The name of the key to search the value for .
* @ return Returns the value for the key in the object .
* @ throws JSONException Thrown in case the key coul... | checkArguments ( jsonObject , key ) ; JSONValue value = jsonObject . get ( key ) ; if ( value != null && value . isNumber ( ) != null ) { double number = ( ( JSONNumber ) value ) . doubleValue ( ) ; return number ; } return null ; |
public class ZooKeeperClient { /** * Reads data from a node as a JSON object .
* @ param path
* @ return
* @ since 0.3.1
* @ throws ZooKeeperException */
public Object getDataJson ( String path ) throws ZooKeeperException { } } | try { Object data = getFromCache ( cacheNameJson , path ) ; if ( data == null ) { data = _readJson ( path ) ; putToCache ( cacheNameJson , path , data ) ; } return data ; } catch ( ZooKeeperException . NodeNotFoundException e ) { return null ; } catch ( Exception e ) { if ( e instanceof ZooKeeperException ) { throw ( Z... |
public class Href { /** * Create an encoded href for an attribute meta */
public static String concatMetaAttributeHref ( String baseUri , String entityParentName , String attributeName ) { } } | return String . format ( "%s/%s/meta/%s" , baseUri , encodePathSegment ( entityParentName ) , encodePathSegment ( attributeName ) ) ; |
public class CommerceAccountOrganizationRelPersistenceImpl { /** * Returns all the commerce account organization rels where organizationId = & # 63 ; .
* @ param organizationId the organization ID
* @ return the matching commerce account organization rels */
@ Override public List < CommerceAccountOrganizationRel >... | return findByOrganizationId ( organizationId , QueryUtil . ALL_POS , QueryUtil . ALL_POS , null ) ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.