signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class BinaryUtil { /** * Copy src bytes [ ] into dest bytes [ ]
* @ param dest
* @ param src
* @ param copyToIndex */
public static void memcopy ( byte [ ] dest , byte [ ] src , int copyToIndex ) { } } | System . arraycopy ( src , 0 , dest , copyToIndex , src . length ) ; |
public class GroovyScriptEngine { /** * Get a resource connection as a < code > URLConnection < / code > to retrieve a script
* from the < code > ResourceConnector < / code > .
* @ param resourceName name of the resource to be retrieved
* @ return a URLConnection to the resource
* @ throws ResourceException */
... | // Get the URLConnection
URLConnection groovyScriptConn = null ; ResourceException se = null ; for ( URL root : roots ) { URL scriptURL = null ; try { scriptURL = new URL ( root , resourceName ) ; groovyScriptConn = openConnection ( scriptURL ) ; break ; // Now this is a bit unusual
} catch ( MalformedURLException e ) ... |
public class BigQuerySnippets { /** * [ VARIABLE " SELECT field FROM my _ dataset _ name . my _ table _ name " ] */
public Job createJob ( String query ) { } } | // [ START ]
Job job = null ; JobConfiguration jobConfiguration = QueryJobConfiguration . of ( query ) ; JobInfo jobInfo = JobInfo . of ( jobConfiguration ) ; try { job = bigquery . create ( jobInfo ) ; } catch ( BigQueryException e ) { // the job was not created
} // [ END ]
return job ; |
public class ActiveMqQueueFactory { /** * { @ inheritDoc }
* @ throws Exception */
@ Override protected void initQueue ( T queue , QueueSpec spec ) throws Exception { } } | queue . setUri ( defaultUri ) . setQueueName ( defaultQueueName ) . setUsername ( defaultUsername ) . setPassword ( defaultPassword ) . setConnectionFactory ( defaultConnectionFactory ) ; String uri = spec . getField ( SPEC_FIELD_URI ) ; if ( ! StringUtils . isBlank ( uri ) ) { queue . setUri ( uri ) ; } String queueNa... |
public class InspectionReport { /** * Adds detailed event to log . */
public void logBrokenObjectAndSetInconsistency ( String brokenObject ) throws IOException { } } | setInconsistency ( ) ; // The ThreadLocal has been initialized so we know that we are in multithreaded mode .
if ( reportContext . get ( ) != null ) { reportContext . get ( ) . addBrokenObject ( brokenObject ) ; } else { writeBrokenObject ( brokenObject ) ; } |
public class A_CmsResourceCollector { /** * Shrinks a List to fit a maximum size . < p >
* @ param result a List
* @ param maxSize the maximum size of the List
* @ return the reduced list */
protected List < CmsResource > shrinkToFit ( List < CmsResource > result , int maxSize ) { } } | if ( ( maxSize > 0 ) && ( result . size ( ) > maxSize ) ) { // cut off all items > count
result = result . subList ( 0 , maxSize ) ; } return result ; |
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link CurvePropertyType } { @ code > }
* @ param value
* Java instance representing xml element ' s value .
* @ return
* the new instance of { @ link JAXBElement } { @ code < } { @ link CurvePropertyType } { @ code >... | return new JAXBElement < CurvePropertyType > ( _CurveMember_QNAME , CurvePropertyType . class , null , value ) ; |
public class Disposables { /** * Performs null checks and disposes of assets . Ignores exceptions .
* @ param disposables its values will be disposed of ( if they exist ) . Can be null . */
public static void gracefullyDisposeOf ( final ObjectMap < ? , ? extends Disposable > disposables ) { } } | if ( disposables != null ) { for ( final Disposable disposable : disposables . values ( ) ) { gracefullyDisposeOf ( disposable ) ; } } |
public class QueuedExecutions { /** * Fetch flow for an execution . Returns null , if execution not in queue */
public ExecutableFlow getFlow ( final int executionId ) { } } | if ( hasExecution ( executionId ) ) { return this . queuedFlowMap . get ( executionId ) . getSecond ( ) ; } return null ; |
public class GVRFloatAnimation { /** * Set the time and value of the key at the given index
* @ param keyIndex 0 based index of key
* @ param time key time in seconds
* @ param values key values */
public void setKey ( int keyIndex , float time , final float [ ] values ) { } } | int index = keyIndex * mFloatsPerKey ; Integer valSize = mFloatsPerKey - 1 ; if ( values . length != valSize ) { throw new IllegalArgumentException ( "This key needs " + valSize . toString ( ) + " float per value" ) ; } mKeys [ index ] = time ; System . arraycopy ( values , 0 , mKeys , index + 1 , values . length ) ; |
public class ProfeatProperties { /** * An adaptor method which returns the number of transition between the specified groups for the given attribute with respect to the length of sequence .
* @ param sequence
* a protein sequence consisting of non - ambiguous characters only
* @ param attribute
* one of the sev... | return new ProfeatPropertiesImpl ( ) . getTransition ( sequence , attribute , transition ) ; |
public class XmlRuleDisambiguator { /** * Load disambiguation rules from an XML file . Use { @ link JLanguageTool # addRule } to add
* these rules to the checking process .
* @ return a List of { @ link DisambiguationPatternRule } objects */
protected List < DisambiguationPatternRule > loadPatternRules ( String fil... | DisambiguationRuleLoader ruleLoader = new DisambiguationRuleLoader ( ) ; return ruleLoader . getRules ( JLanguageTool . getDataBroker ( ) . getFromResourceDirAsStream ( filename ) ) ; |
public class SFTrustManager { /** * CertificateID to string
* @ param certificateID CertificateID
* @ return a string representation of CertificateID */
private static String CertificateIDToString ( CertificateID certificateID ) { } } | return String . format ( "CertID. NameHash: %s, KeyHash: %s, Serial Number: %s" , byteToHexString ( certificateID . getIssuerNameHash ( ) ) , byteToHexString ( certificateID . getIssuerKeyHash ( ) ) , MessageFormat . format ( "{0,number,#}" , certificateID . getSerialNumber ( ) ) ) ; |
public class Vector { /** * Copies another vector
* @ param vec The other vector
* @ return the same vector */
public Vector copy ( Vector vec ) { } } | x = vec . x ; y = vec . y ; z = vec . z ; return this ; |
public class YarnContainerManager { /** * Update the driver with my current status . */
private void updateRuntimeStatus ( ) { } } | final RuntimeStatusEventImpl . Builder builder = RuntimeStatusEventImpl . newBuilder ( ) . setName ( RUNTIME_NAME ) . setState ( State . RUNNING ) . setOutstandingContainerRequests ( this . containerRequestCounter . get ( ) ) ; for ( final String allocatedContainerId : this . containers . getContainerIds ( ) ) { builde... |
public class ParaClient { /** * Searches for { @ link com . erudika . para . core . Tag } objects .
* This method might be deprecated in the future .
* @ param < P > type of the object
* @ param keyword the tag keyword to search for
* @ param pager a { @ link com . erudika . para . utils . Pager }
* @ return ... | keyword = ( keyword == null ) ? "*" : keyword . concat ( "*" ) ; return findWildcard ( Utils . type ( Tag . class ) , "tag" , keyword , pager ) ; |
public class JavacParser { /** * QualidentList = [ Annotations ] Qualident { " , " [ Annotations ] Qualident } */
List < JCExpression > qualidentList ( boolean allowAnnos ) { } } | ListBuffer < JCExpression > ts = new ListBuffer < > ( ) ; List < JCAnnotation > typeAnnos = allowAnnos ? typeAnnotationsOpt ( ) : List . nil ( ) ; JCExpression qi = qualident ( allowAnnos ) ; if ( ! typeAnnos . isEmpty ( ) ) { JCExpression at = insertAnnotationsToMostInner ( qi , typeAnnos , false ) ; ts . append ( at ... |
public class FilePath { /** * Reads the URL on the current VM , and streams the data to this file using the Remoting channel .
* < p > This is different from resolving URL remotely .
* If you instead wished to open an HTTP ( S ) URL on the remote side ,
* prefer < a href = " http : / / javadoc . jenkins . io / pl... | try ( InputStream in = url . openStream ( ) ) { copyFrom ( in ) ; } |
public class CollectionHelp { /** * Returns collection items delimited
* @ param delim
* @ param collection
* @ return
* @ deprecated Use java . util . stream . Collectors . joining
* @ see java . util . stream . Collectors # joining ( java . lang . CharSequence ) */
public static final String print ( String ... | return print ( null , delim , null , null , null , collection ) ; |
public class AwsSecurityFindingFilters { /** * The IPv4 addresses associated with the instance .
* @ param resourceAwsEc2InstanceIpV4Addresses
* The IPv4 addresses associated with the instance . */
public void setResourceAwsEc2InstanceIpV4Addresses ( java . util . Collection < IpFilter > resourceAwsEc2InstanceIpV4A... | if ( resourceAwsEc2InstanceIpV4Addresses == null ) { this . resourceAwsEc2InstanceIpV4Addresses = null ; return ; } this . resourceAwsEc2InstanceIpV4Addresses = new java . util . ArrayList < IpFilter > ( resourceAwsEc2InstanceIpV4Addresses ) ; |
public class ValueEnforcer { /** * Check if
* < code > nValue & gt ; nLowerBoundInclusive & amp ; & amp ; nValue & lt ; nUpperBoundInclusive < / code >
* @ param aValue
* Value
* @ param sName
* Name
* @ param aLowerBoundExclusive
* Lower bound
* @ param aUpperBoundExclusive
* Upper bound
* @ return... | if ( isEnabled ( ) ) return isBetweenExclusive ( aValue , ( ) -> sName , aLowerBoundExclusive , aUpperBoundExclusive ) ; return aValue ; |
public class IconicsDrawable { /** * Set rounded corner from res
* @ return The current IconicsDrawable for chaining . */
@ NonNull public IconicsDrawable roundedCornersRyRes ( @ DimenRes int sizeResId ) { } } | return roundedCornersRyPx ( mContext . getResources ( ) . getDimensionPixelSize ( sizeResId ) ) ; |
public class AddCompleteCampaignsUsingBatchJob { /** * Runs the example .
* @ param adWordsServices the services factory .
* @ param session the session .
* @ throws BatchJobException if uploading operations or downloading results failed .
* @ throws ApiException if the API request failed with one or more servi... | // Get the MutateJobService .
BatchJobServiceInterface batchJobService = adWordsServices . get ( session , BatchJobServiceInterface . class ) ; // Create a BatchJob .
BatchJobOperation addOp = new BatchJobOperation ( ) ; addOp . setOperator ( Operator . ADD ) ; addOp . setOperand ( new BatchJob ( ) ) ; BatchJob batchJo... |
public class Rule { /** * Get a nested mixin of this rule .
* @ param name
* the name of the mixin
* @ return the mixin or null */
List < Rule > getMixin ( String name ) { } } | ArrayList < Rule > rules = null ; for ( Rule rule : subrules ) { for ( String sel : rule . selectors ) { if ( name . equals ( sel ) ) { if ( rules == null ) { rules = new ArrayList < > ( ) ; } rules . add ( rule ) ; break ; } } } return rules ; |
public class DictionaryUtils { /** * Return a Dictionary object backed by the original map ( rather
* than copying the elements from the map into a new dictionary ) .
* @ param map
* Map with String keys and Object values
* @ return Dictionary with String keys and Object values where all
* operations are dele... | return new MapWrapper ( map ) ; |
public class ExpandableAdapter { /** * Get the position of the parent item from the adapter position .
* @ param adapterPosition adapter position of item . */
public final int parentItemPosition ( int adapterPosition ) { } } | int itemCount = 0 ; for ( int i = 0 ; i < parentItemCount ( ) ; i ++ ) { itemCount += 1 ; if ( isExpanded ( i ) ) { int childCount = childItemCount ( i ) ; itemCount += childCount ; } if ( adapterPosition < itemCount ) { return i ; } } throw new IllegalStateException ( "The adapter position is not a parent type: " + ad... |
public class PathParser { /** * that might require the full parser to deal with . */
private static boolean looksUnsafeForFastParser ( String s ) { } } | boolean lastWasDot = true ; // start of path is also a " dot "
int len = s . length ( ) ; if ( s . isEmpty ( ) ) return true ; if ( s . charAt ( 0 ) == '.' ) return true ; if ( s . charAt ( len - 1 ) == '.' ) return true ; for ( int i = 0 ; i < len ; ++ i ) { char c = s . charAt ( i ) ; if ( ( c >= 'a' && c <= 'z' ) ||... |
public class AmazonPinpointClient { /** * Returns information about the GCM channel for an app .
* @ param getGcmChannelRequest
* @ return Result of the GetGcmChannel operation returned by the service .
* @ throws BadRequestException
* 400 response
* @ throws InternalServerErrorException
* 500 response
* ... | request = beforeClientExecution ( request ) ; return executeGetGcmChannel ( request ) ; |
public class DefaultDocumentSource { /** * Creates and configures the URL connection .
* @ param url the target URL
* @ return the created connection instance
* @ throws IOException */
protected URLConnection createConnection ( URL url ) throws IOException { } } | URLConnection con = url . openConnection ( ) ; con . setRequestProperty ( "User-Agent" , USER_AGENT ) ; return con ; |
public class MonomerWSLoader { /** * Loads the monomer store using the URL configured in
* { @ code MonomerStoreConfiguration } and the polymerType that was given to
* constructor .
* @ param attachmentDB
* the attachments stored in Toolkit .
* @ return Map containing monomers
* @ throws IOException IO Erro... | Map < String , Monomer > monomers = new TreeMap < String , Monomer > ( String . CASE_INSENSITIVE_ORDER ) ; CloseableHttpClient httpclient = HttpClients . createDefault ( ) ; // There is no need to provide user credentials
// HttpClient will attempt to access current user security context
// through Windows platform spe... |
public class Tile { /** * Defines the Paint object that will be used to draw the border of the gauge .
* @ param PAINT */
public void setBorderColor ( final Color PAINT ) { } } | if ( null == borderColor ) { _borderColor = PAINT ; fireTileEvent ( REDRAW_EVENT ) ; } else { borderColor . set ( PAINT ) ; } |
public class RegisterStreamConsumerRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( RegisterStreamConsumerRequest registerStreamConsumerRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( registerStreamConsumerRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( registerStreamConsumerRequest . getStreamARN ( ) , STREAMARN_BINDING ) ; protocolMarshaller . marshall ( registerStreamConsumerRequest . getConsumerName ( ... |
public class KamDialect { /** * { @ inheritDoc } */
@ Override public KamEdge findEdge ( KamNode sourceNode , RelationshipType relationshipType , KamNode targetNode ) throws InvalidArgument { } } | return wrapEdge ( kam . findEdge ( sourceNode , relationshipType , targetNode ) ) ; |
public class DefaultProcessExecutor { /** * Updates the command list and the buffer .
* @ param commandList
* The command list to update
* @ param buffer
* The input buffer
* @ return The updated buffer */
protected StringBuilder addAllBuffer ( List < String > commandList , StringBuilder buffer ) { } } | commandList . add ( buffer . toString ( ) ) ; buffer . delete ( 0 , buffer . length ( ) ) ; return buffer ; |
public class AuthenticateApi { /** * This method throws an exception if the caller subject is already authenticated and
* WebAlwaysLogin is false . If the caller subject is already authenticated and
* WebAlwaysLogin is true , then it will logout the user .
* @ throws IOException
* @ throws ServletException */
p... | Subject callerSubject = subjectManager . getCallerSubject ( ) ; if ( subjectHelper . isUnauthenticated ( callerSubject ) ) return ; if ( ! config . getWebAlwaysLogin ( ) ) { AuthenticationResult authResult = new AuthenticationResult ( AuthResult . FAILURE , username ) ; authResult . setAuditCredType ( req . getAuthType... |
public class Cells { /** * Returns the Cell ( associated to < i > table < / i > ) whose name is cellName , or null if this Cells object contains no
* cell whose name is cellName .
* @ param cellName the name of the Cell we want to retrieve from this Cells object .
* @ return the Cell whose name is cellName contai... | for ( Cell c : getCellsByTable ( table ) ) { if ( c . getCellName ( ) . equals ( cellName ) ) { return c ; } } return null ; |
public class AbstractCommandSpecProcessor { /** * inherit doc */
@ Override public boolean process ( Set < ? extends TypeElement > annotations , RoundEnvironment roundEnv ) { } } | logger . info ( "Entered process, processingOver=" + roundEnv . processingOver ( ) ) ; IFactory factory = null ; // new NullFactory ( ) ;
Map < Element , CommandSpec > commands = new LinkedHashMap < Element , CommandSpec > ( ) ; Map < TypeMirror , List < CommandSpec > > commandTypes = new LinkedHashMap < TypeMirror , L... |
public class CobolPackedDecimalType { /** * { @ inheritDoc } */
protected FromHostPrimitiveResult < T > fromHostInternal ( Class < T > javaClass , CobolContext cobolContext , byte [ ] hostData , int start ) { } } | int end = start + getBytesLen ( ) ; StringBuffer sb = new StringBuffer ( ) ; int [ ] nibbles = new int [ 2 ] ; for ( int i = start ; i < end ; i ++ ) { setNibbles ( nibbles , hostData [ i ] ) ; char digit0 = getDigit ( nibbles [ 0 ] ) ; if ( digit0 == '\0' ) { return new FromHostPrimitiveResult < T > ( "First nibble is... |
public class CommerceOrderPaymentLocalServiceUtil { /** * Returns a range of all the commerce order payments .
* Useful when paginating results . Returns a maximum of < code > end - start < / code > instances . < code > start < / code > and < code > end < / code > are not primary keys , they are indexes in the result... | return getService ( ) . getCommerceOrderPayments ( start , end ) ; |
public class WriteCampaignRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( WriteCampaignRequest writeCampaignRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( writeCampaignRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( writeCampaignRequest . getAdditionalTreatments ( ) , ADDITIONALTREATMENTS_BINDING ) ; protocolMarshaller . marshall ( writeCampaignRequest . getDescription ( ) , DE... |
public class Assert { /** * < p > Asserts that the given argument is neither < b > { @ code null } nor { @ code empty } < / b > . The null
* check is performed using { @ link # assertNotNull ( Object ) } . If the argument is { @ code empty } a
* { @ link NullPointerException } will be thrown with the message , < i ... | assertNotNull ( arg ) ; boolean isEmpty = ( arg instanceof CharSequence && ( ( CharSequence ) arg ) . length ( ) == 0 ) || ( arg instanceof Collection < ? > && ( ( Collection < ? > ) arg ) . size ( ) == 0 ) || ( arg instanceof Map < ? , ? > && ( ( Map < ? , ? > ) arg ) . size ( ) == 0 ) || ( arg instanceof Object [ ] &... |
public class SocketEventDispatcher { /** * Dispatch conversation message update event .
* @ param event Event to dispatch . */
private void onMessageRead ( MessageReadEvent event ) { } } | handler . post ( ( ) -> listener . onMessageRead ( event ) ) ; log ( "Event published " + event . toString ( ) ) ; |
public class DatabaseTaskStore { /** * { @ inheritDoc } */
@ Override public List < TaskStatus < ? > > findTaskStatus ( String pattern , Character escape , TaskState state , boolean inState , Long minId , Integer maxResults , String owner , boolean includeTrigger , PersistentExecutor executor ) throws Exception { } } | StringBuilder find = new StringBuilder ( 187 ) . append ( "SELECT t.ID,t.LOADER,t.MBITS,t.INAME,t.NEXTEXEC,t.RESLT,t.STATES" ) ; if ( includeTrigger ) find . append ( ",t.TRIG" ) ; find . append ( " FROM Task t" ) ; int i = 0 ; if ( minId != null ) find . append ( ++ i == 1 ? " WHERE" : " AND" ) . append ( " t.ID>=:m" ... |
public class ClientSessionSubmitter { /** * Submits a command to the cluster .
* @ param command The command to submit .
* @ param < T > The command result type .
* @ return A completable future to be completed once the command has been submitted . */
public < T > CompletableFuture < T > submit ( Command < T > co... | CompletableFuture < T > future = new CompletableFuture < > ( ) ; context . executor ( ) . execute ( ( ) -> submitCommand ( command , future ) ) ; return future ; |
public class AbstractCommandLineRunner { /** * Creates JS extern inputs from a list of files . */
@ GwtIncompatible ( "Unnecessary" ) private List < SourceFile > createExternInputs ( List < String > files ) throws IOException { } } | List < FlagEntry < JsSourceType > > externFiles = new ArrayList < > ( ) ; for ( String file : files ) { externFiles . add ( new FlagEntry < JsSourceType > ( JsSourceType . EXTERN , file ) ) ; } try { return createInputs ( externFiles , false , new ArrayList < JsModuleSpec > ( ) ) ; } catch ( FlagUsageException e ) { th... |
public class DefaultCodecIdentifier { /** * / * ( non - Javadoc )
* @ see CodecIdentifier # isEquivalent ( CodecIdentifier ) */
public boolean isEquivalent ( CodecIdentifier other ) { } } | if ( this . codecName . equals ( other . getCodecName ( ) ) ) { return true ; } if ( this . codecAliases != null && this . codecAliases . contains ( other . getCodecName ( ) ) ) { return true ; } if ( other . getCodecAliases ( ) != null && other . getCodecAliases ( ) . contains ( this . codecName ) ) { return true ; } ... |
public class vpnvserver_auditsyslogpolicy_binding { /** * Use this API to fetch vpnvserver _ auditsyslogpolicy _ binding resources of given name . */
public static vpnvserver_auditsyslogpolicy_binding [ ] get ( nitro_service service , String name ) throws Exception { } } | vpnvserver_auditsyslogpolicy_binding obj = new vpnvserver_auditsyslogpolicy_binding ( ) ; obj . set_name ( name ) ; vpnvserver_auditsyslogpolicy_binding response [ ] = ( vpnvserver_auditsyslogpolicy_binding [ ] ) obj . get_resources ( service ) ; return response ; |
public class ApplicationTenancyRepository { /** * region > newTenancy */
@ Programmatic public ApplicationTenancy newTenancy ( final String name , final String path , final ApplicationTenancy parent ) { } } | ApplicationTenancy tenancy = findByPath ( path ) ; if ( tenancy == null ) { tenancy = getApplicationTenancyFactory ( ) . newApplicationTenancy ( ) ; tenancy . setName ( name ) ; tenancy . setPath ( path ) ; tenancy . setParent ( parent ) ; container . persist ( tenancy ) ; } return tenancy ; |
public class NettyServerBuilder { /** * Sets a custom max connection idle time , connection being idle for longer than which will be
* gracefully terminated . Idleness duration is defined since the most recent time the number of
* outstanding RPCs became zero or the connection establishment . An unreasonably small ... | checkArgument ( maxConnectionIdle > 0L , "max connection idle must be positive" ) ; maxConnectionIdleInNanos = timeUnit . toNanos ( maxConnectionIdle ) ; if ( maxConnectionIdleInNanos >= AS_LARGE_AS_INFINITE ) { maxConnectionIdleInNanos = MAX_CONNECTION_IDLE_NANOS_DISABLED ; } if ( maxConnectionIdleInNanos < MIN_MAX_CO... |
public class TextUtil { /** * Split the given string according to brackets .
* The brackets are used to delimit the groups
* of characters .
* < p > Examples :
* < ul >
* < li > < code > splitBrackets ( " { a } { b } { cd } " ) < / code > returns the array
* < code > [ " a " , " b " , " cd " ] < / code > < ... | TextUtil . class } ) public static List < String > splitBracketsAsList ( String str ) { return splitAsList ( '{' , '}' , str ) ; |
public class MpscAtomicArrayQueue { /** * { @ inheritDoc }
* IMPLEMENTATION NOTES : < br >
* Lock free peek using ordered loads . As class name suggests access is limited to a single thread .
* @ see java . util . Queue # poll ( )
* @ see org . jctools _ voltpatches . queues . MessagePassingQueue # poll ( ) */
... | // Copy field to avoid re - reading after volatile load
final AtomicReferenceArray < E > buffer = this . buffer ; final long consumerIndex = lvConsumerIndex ( ) ; // LoadLoad
final int offset = calcElementOffset ( consumerIndex ) ; E e = lvElement ( buffer , offset ) ; if ( null == e ) { /* * NOTE : Queue may not actua... |
public class CloudhopperBuilder { /** * The bind command type ( see { @ link SmppBindType } ) .
* Default value is { @ link SmppBindType # TRANSMITTER } .
* You can specify one or several property keys . For example :
* < pre >
* . bindType ( " $ { custom . property . high - priority } " , " $ { custom . proper... | for ( String b : bindType ) { if ( b != null ) { bindTypes . add ( b ) ; } } return this ; |
public class DefaultFcClient { /** * concate query string parameters ( e . g . name = foo )
* @ param parameters query parameters
* @ return concatenated query string
* @ throws UnsupportedEncodingException exceptions */
public String concatQueryString ( Map < String , String > parameters ) throws UnsupportedEnco... | if ( null == parameters ) { return null ; } StringBuilder urlBuilder = new StringBuilder ( "" ) ; for ( Map . Entry < String , String > entry : parameters . entrySet ( ) ) { String key = entry . getKey ( ) ; String val = entry . getValue ( ) ; urlBuilder . append ( encode ( key ) ) ; if ( val != null ) { urlBuilder . a... |
public class FloatIterator { /** * Returns an infinite { @ code FloatIterator } .
* @ param supplier
* @ return */
public static FloatIterator generate ( final FloatSupplier supplier ) { } } | N . checkArgNotNull ( supplier ) ; return new FloatIterator ( ) { @ Override public boolean hasNext ( ) { return true ; } @ Override public float nextFloat ( ) { return supplier . getAsFloat ( ) ; } } ; |
public class VariableNumMap { /** * Get the variable referenced by a particular variable number .
* Returns { @ code null } if no variable exists with that number .
* @ param variableNum
* @ return */
public final Variable getVariable ( int variableNum ) { } } | int index = getVariableIndex ( variableNum ) ; if ( index >= 0 ) { return vars [ index ] ; } else { return null ; } |
public class OracleDatabaseWithAutoSequence { /** * For the database from vendor Oracle , an eFaps SQL table with
* auto increment is created in this steps :
* < ul >
* < li > SQL table itself with column < code > ID < / code > and unique key on the
* column is created < / li >
* < li > sequence with same nam... | final Statement stmt = _con . createStatement ( ) ; try { final String tableName = getName4DB ( _table , 25 ) ; // create sequence
StringBuilder cmd = new StringBuilder ( ) . append ( "create sequence " ) . append ( tableName ) . append ( "_SEQ" ) . append ( " increment by 1 " ) . append ( " start with 1 " ) . append... |
public class DefaultClusterManager { /** * Handles a queue offer command . */
private void doQueueOffer ( final Message < JsonObject > message ) { } } | final String name = message . body ( ) . getString ( "name" ) ; if ( name == null ) { message . reply ( new JsonObject ( ) . putString ( "status" , "error" ) . putString ( "message" , "No name specified." ) ) ; return ; } final Object value = message . body ( ) . getValue ( "value" ) ; if ( value == null ) { message . ... |
public class CSSCompiler { /** * { @ inheritDoc } */
@ Override protected String getCompiledString ( final Instance _instance ) { } } | String ret = "" ; try { final Checkout checkout = new Checkout ( _instance ) ; final BufferedReader in = new BufferedReader ( new InputStreamReader ( checkout . execute ( ) , "UTF-8" ) ) ; final CssCompressor compressor = new CssCompressor ( in ) ; in . close ( ) ; checkout . close ( ) ; final ByteArrayOutputStream byt... |
public class ResourceContextImpl { /** * ResourceContext . acquire ( ) */
public void acquire ( ) { } } | if ( _hasAcquired ) return ; // Deliver the onAcquire event to registered listeners
for ( ResourceEvents resourceListener : _listeners ) resourceListener . onAcquire ( ) ; // Register this ResourceContext with associated container context
_containerContext . addResourceContext ( this , _bean ) ; // Set the flag to indi... |
public class EphemeralKey { /** * Creates an ephemeral API key for a given resource .
* @ param params request parameters
* @ param options request options . { @ code stripeVersion } is required when creating ephemeral
* keys . it must have non - null { @ link RequestOptions # getStripeVersionOverride ( ) } .
*... | checkNullTypedParams ( classUrl ( EphemeralKey . class ) , params ) ; return create ( params . toMap ( ) , options ) ; |
public class ModelsImpl { /** * Gets information about the application version models .
* @ param appId The application ID .
* @ param versionId The version ID .
* @ param listModelsOptionalParameter the object representing the optional parameters to be set before calling this API
* @ throws IllegalArgumentExce... | return listModelsWithServiceResponseAsync ( appId , versionId , listModelsOptionalParameter ) . map ( new Func1 < ServiceResponse < List < ModelInfoResponse > > , List < ModelInfoResponse > > ( ) { @ Override public List < ModelInfoResponse > call ( ServiceResponse < List < ModelInfoResponse > > response ) { return res... |
public class AbstractTileFactory { /** * Returns the tile that is located at the given tilePoint
* for this zoom . For example , if getMapSize ( ) returns 10x20
* for this zoom , and the tilePoint is ( 3,5 ) , then the
* appropriate tile will be located and returned . */
@ Override public Tile getTile ( int x , i... | return getTile ( x , y , zoom , true ) ; |
public class ConfigLoader { /** * Loads the configuration XML from the given string .
* @ since 1.3 */
public static Configuration loadFromString ( String config ) throws IOException , SAXException { } } | ConfigurationImpl cfg = new ConfigurationImpl ( ) ; XMLReader parser = XMLReaderFactory . createXMLReader ( ) ; parser . setContentHandler ( new ConfigHandler ( cfg , null ) ) ; Reader reader = new StringReader ( config ) ; parser . parse ( new InputSource ( reader ) ) ; return cfg ; |
public class WeibullDistributionTypeImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public void eSet ( int featureID , Object newValue ) { } } | switch ( featureID ) { case BpsimPackage . WEIBULL_DISTRIBUTION_TYPE__SCALE : setScale ( ( Double ) newValue ) ; return ; case BpsimPackage . WEIBULL_DISTRIBUTION_TYPE__SHAPE : setShape ( ( Double ) newValue ) ; return ; } super . eSet ( featureID , newValue ) ; |
public class MtasDataLongBasic { /** * ( non - Javadoc )
* @ see
* mtas . codec . util . collector . MtasDataCollector # validateSegmentBoundary ( java .
* lang . Object ) */
@ Override public boolean validateSegmentBoundary ( Object o ) throws IOException { } } | if ( o instanceof Long ) { return validateWithSegmentBoundary ( ( Long ) o ) ; } else { throw new IOException ( "incorrect type " ) ; } |
public class TableBuilder { /** * Get tr of specified index . If there no tr at the specified index , new tr will be created .
* @ param index 0 = first tr , 1 = second tr
* @ return */
public tr tr ( int index ) { } } | while ( trList . size ( ) <= index ) { trList . add ( new tr ( ) ) ; } return trList . get ( index ) ; |
public class InternalXtextParser { /** * InternalXtext . g : 3330:1 : ruleNegatedToken returns [ EObject current = null ] : ( otherlv _ 0 = ' ! ' ( ( lv _ terminal _ 1_0 = ruleTerminalTokenElement ) ) ) ; */
public final EObject ruleNegatedToken ( ) throws RecognitionException { } } | EObject current = null ; Token otherlv_0 = null ; EObject lv_terminal_1_0 = null ; enterRule ( ) ; try { // InternalXtext . g : 3336:2 : ( ( otherlv _ 0 = ' ! ' ( ( lv _ terminal _ 1_0 = ruleTerminalTokenElement ) ) ) )
// InternalXtext . g : 3337:2 : ( otherlv _ 0 = ' ! ' ( ( lv _ terminal _ 1_0 = ruleTerminalTokenEle... |
public class Timestamp { /** * Returns a timestamp relative to this one by the given number of days .
* @ param amount a number of days . */
public final Timestamp addDay ( int amount ) { } } | long delta = ( long ) amount * 24 * 60 * 60 * 1000 ; return addMillisForPrecision ( delta , Precision . DAY , false ) ; |
public class NodeTraversal { /** * Creates a new scope ( e . g . when entering a function ) .
* @ param quietly Don ' t fire an enterScope callback . */
private void pushScope ( AbstractScope < ? , ? > s , boolean quietly ) { } } | checkNotNull ( curNode ) ; scopes . push ( s ) ; recordScopeRoot ( s . getRootNode ( ) ) ; if ( ! quietly && scopeCallback != null ) { scopeCallback . enterScope ( this ) ; } |
public class AppMarshaller { /** * Marshall the given parameter object . */
public void marshall ( App app , ProtocolMarshaller protocolMarshaller ) { } } | if ( app == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( app . getAppId ( ) , APPID_BINDING ) ; protocolMarshaller . marshall ( app . getStackId ( ) , STACKID_BINDING ) ; protocolMarshaller . marshall ( app . getShortname ( ) , SHORTNAME_... |
public class IPAddressString { /** * Returns whether this is a valid address string format .
* The accepted IP address formats are :
* an IPv4 address , an IPv6 address , a network prefix alone , the address representing all addresses of all types , or an empty string .
* If this method returns false , and you wa... | if ( addressProvider . isUninitialized ( ) ) { try { validate ( ) ; return true ; } catch ( AddressStringException e ) { return false ; } } return ! addressProvider . isInvalid ( ) ; |
public class TransformationDescription { /** * Adds a concat transformation step to the transformation description . The values of the source fields are
* concatenated to the target field with the concat string between the source fields values . All fields need to be
* of the type String . */
public void concatFiel... | TransformationStep step = new TransformationStep ( ) ; step . setTargetField ( targetField ) ; step . setSourceFields ( sourceFields ) ; step . setOperationParameter ( TransformationConstants . CONCAT_PARAM , concatString ) ; step . setOperationName ( "concat" ) ; steps . add ( step ) ; |
public class JobSchedulePatchHeaders { /** * Set the time at which the resource was last modified .
* @ param lastModified the lastModified value to set
* @ return the JobSchedulePatchHeaders object itself . */
public JobSchedulePatchHeaders withLastModified ( DateTime lastModified ) { } } | if ( lastModified == null ) { this . lastModified = null ; } else { this . lastModified = new DateTimeRfc1123 ( lastModified ) ; } return this ; |
public class DataUtils { /** * Return the list of all the module submodules
* @ param module
* @ return List < DbModule > */
public static List < DbModule > getAllSubmodules ( final DbModule module ) { } } | final List < DbModule > submodules = new ArrayList < DbModule > ( ) ; submodules . addAll ( module . getSubmodules ( ) ) ; for ( final DbModule submodule : module . getSubmodules ( ) ) { submodules . addAll ( getAllSubmodules ( submodule ) ) ; } return submodules ; |
public class MiniTemplatorParser { /** * Processes the $ elseIf command . */
private void processElseIfCmd ( String parms , int cmdTPosBegin , int cmdTPosEnd ) throws MiniTemplator . TemplateSyntaxException { } } | excludeTemplateRange ( cmdTPosBegin , cmdTPosEnd ) ; if ( condLevel < 0 ) { throw new MiniTemplator . TemplateSyntaxException ( "$elseIf without matching $if." ) ; } boolean enabled = isCondEnabled ( condLevel - 1 ) && ! condPassed [ condLevel ] && evaluateConditionFlags ( parms ) ; condEnabled [ condLevel ] = enabled ... |
public class ConfigImpl { /** * Initializes and returns the map of packages based on the information in
* the server - side config JavaScript
* @ param cfg
* The parsed config JavaScript as a properties map
* @ return the package map
* @ throws URISyntaxException */
protected Map < String , IPackage > loadPac... | Object obj = cfg . get ( PACKAGES_CONFIGPARAM , cfg ) ; Map < String , IPackage > packages = new HashMap < String , IPackage > ( ) ; if ( obj instanceof Scriptable ) { for ( Object id : ( ( Scriptable ) obj ) . getIds ( ) ) { if ( id instanceof Number ) { Number i = ( Number ) id ; Object pkg = ( ( Scriptable ) obj ) .... |
public class Director { /** * Installs the specified features and fires appropriate progress event notifications
* @ param featureNames collection of feature names to be installed
* @ param toExtension location of a product extension
* @ param acceptLicense if license is accepted
* @ param allowAlreadyInstalled... | fireProgressEvent ( InstallProgressEvent . CHECK , checkProgress , Messages . INSTALL_KERNEL_MESSAGES . getLogMessage ( "STATE_CHECKING" ) ) ; if ( featureNames == null || featureNames . isEmpty ( ) ) { throw ExceptionUtils . createByKey ( "ERROR_FEATURES_LIST_INVALID" ) ; } List < List < RepositoryResource > > install... |
public class CPDefinitionLocalizationPersistenceImpl { /** * Clears the cache for the cp definition localization .
* The { @ link EntityCache } and { @ link FinderCache } are both cleared by this method . */
@ Override public void clearCache ( CPDefinitionLocalization cpDefinitionLocalization ) { } } | entityCache . removeResult ( CPDefinitionLocalizationModelImpl . ENTITY_CACHE_ENABLED , CPDefinitionLocalizationImpl . class , cpDefinitionLocalization . getPrimaryKey ( ) ) ; finderCache . clearCache ( FINDER_CLASS_NAME_LIST_WITH_PAGINATION ) ; finderCache . clearCache ( FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION ) ; c... |
public class CmsContainerConfigurationCacheState { /** * Gets the cache key for a given base path . < p >
* @ param basePath the base path
* @ return the cache key for the base path */
protected String getCacheKey ( String basePath ) { } } | assert ! basePath . endsWith ( INHERITANCE_CONFIG_FILE_NAME ) ; return CmsFileUtil . addTrailingSeparator ( basePath ) ; |
public class EventProcessorHost { /** * Stop processing events and shut down this host instance .
* @ return A CompletableFuture that completes when shutdown is finished . */
public CompletableFuture < Void > unregisterEventProcessor ( ) { } } | TRACE_LOGGER . info ( this . hostContext . withHost ( "Stopping event processing" ) ) ; if ( this . unregistered == null ) { // PartitionManager is created in constructor . If this object exists , then
// this . partitionManager is not null .
this . unregistered = this . partitionManager . stopPartitions ( ) ; // If we... |
public class AppOpticsMeterRegistry { /** * VisibleForTesting */
@ Nullable Optional < String > writeFunctionCounter ( FunctionCounter counter ) { } } | double count = counter . count ( ) ; if ( Double . isFinite ( count ) && count > 0 ) { // can ' t use " count " field because sum is required whenever count is set .
return Optional . of ( write ( counter . getId ( ) , "functionCounter" , Fields . Value . tag ( ) , decimal ( count ) ) ) ; } return Optional . empty ( ) ... |
public class AwsSecurityFindingFilters { /** * A finding ' s title .
* @ param title
* A finding ' s title . */
public void setTitle ( java . util . Collection < StringFilter > title ) { } } | if ( title == null ) { this . title = null ; return ; } this . title = new java . util . ArrayList < StringFilter > ( title ) ; |
public class AmazonEC2Client { /** * Describes the data feed for Spot Instances . For more information , see < a
* href = " https : / / docs . aws . amazon . com / AWSEC2 / latest / UserGuide / spot - data - feeds . html " > Spot Instance Data Feed < / a > in
* the < i > Amazon EC2 User Guide for Linux Instances < ... | request = beforeClientExecution ( request ) ; return executeDescribeSpotDatafeedSubscription ( request ) ; |
public class StandardPacketInputStream { /** * Create Buffer with Text protocol values .
* @ param rowDatas datas
* @ param columnTypes column types
* @ return Buffer */
public static byte [ ] create ( byte [ ] [ ] rowDatas , ColumnType [ ] columnTypes ) { } } | int totalLength = 0 ; for ( byte [ ] rowData : rowDatas ) { if ( rowData == null ) { totalLength ++ ; } else { int length = rowData . length ; if ( length < 251 ) { totalLength += length + 1 ; } else if ( length < 65536 ) { totalLength += length + 3 ; } else if ( length < 16777216 ) { totalLength += length + 4 ; } else... |
public class TagQueueRequest { /** * The list of tags to be added to the specified queue .
* @ param tags
* The list of tags to be added to the specified queue .
* @ return Returns a reference to this object so that method calls can be chained together . */
public TagQueueRequest withTags ( java . util . Map < St... | setTags ( tags ) ; return this ; |
public class Primitives { /** * Converts an array of primitive doubles to objects .
* This method returns { @ code null } for a { @ code null } input array .
* @ param a
* a { @ code double } array
* @ return a { @ code Double } array , { @ code null } if null array input */
@ SafeVarargs public static Double [... | if ( a == null ) { return null ; } return box ( a , 0 , a . length ) ; |
public class XmpSchema { /** * @ see java . util . Properties # setProperty ( java . lang . String , java . lang . String )
* @ param key
* @ param value
* @ return the previous property ( null if there wasn ' t one ) */
public Object setProperty ( String key , XmpArray value ) { } } | return super . setProperty ( key , value . toString ( ) ) ; |
public class ListCertificateAuthoritiesResult { /** * Summary information about each certificate authority you have created .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setCertificateAuthorities ( java . util . Collection ) } or
* { @ link # withCertif... | if ( this . certificateAuthorities == null ) { setCertificateAuthorities ( new java . util . ArrayList < CertificateAuthority > ( certificateAuthorities . length ) ) ; } for ( CertificateAuthority ele : certificateAuthorities ) { this . certificateAuthorities . add ( ele ) ; } return this ; |
public class CmsFocalPointController { /** * Updates the focal point widget . < p > */
private void updatePoint ( ) { } } | clearImagePoint ( ) ; CmsPoint nativePoint ; if ( m_focalPoint == null ) { CmsPoint cropCenter = getCropCenter ( ) ; nativePoint = cropCenter ; } else if ( ! getNativeCropRegion ( ) . contains ( m_focalPoint ) ) { return ; } else { nativePoint = m_focalPoint ; } m_pointWidget = new CmsFocalPoint ( CmsFocalPointControll... |
public class AtlasKnoxSSOAuthenticationFilter { /** * Encapsulate the acquisition of the JWT token from HTTP cookies within the
* request .
* @ param req servlet request to get the JWT token from
* @ return serialized JWT token */
protected String getJWTFromCookie ( HttpServletRequest req ) { } } | String serializedJWT = null ; Cookie [ ] cookies = req . getCookies ( ) ; if ( cookieName != null && cookies != null ) { for ( Cookie cookie : cookies ) { if ( cookieName . equals ( cookie . getName ( ) ) ) { if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( "{} cookie has been found and is being processed" , cookieName ... |
public class ManagerConnectionImpl { /** * This method is called when a { @ link ProtocolIdentifierReceivedEvent } is
* received from the reader . Having received a correct protocol identifier
* is the precondition for logging in .
* @ param identifier the protocol version used by the Asterisk server . */
private... | logger . info ( "Connected via " + identifier ) ; // NOTE : value is AMI _ VERSION , defined in include / asterisk / manager . h
if ( // Asterisk 13
! "Asterisk Call Manager/2.6.0" . equals ( identifier ) // Asterisk 13.2
&& ! "Asterisk Call Manager/2.7.0" . equals ( identifier ) // Asterisk > 13.5
&& ! "Asterisk Call ... |
public class MetricRegistry { /** * Return the { @ link Meter } registered under this name ; or create and register
* a new { @ link Meter } using the provided MetricSupplier if none is registered .
* @ param name the name of the metric
* @ param supplier a MetricSupplier that can be used to manufacture a Meter
... | return getOrAdd ( name , new MetricBuilder < Meter > ( ) { @ Override public Meter newMetric ( ) { return supplier . newMetric ( ) ; } @ Override public boolean isInstance ( Metric metric ) { return Meter . class . isInstance ( metric ) ; } } ) ; |
public class Scope { /** * Searches for or creates a variable with the given name .
* If no variable with the given name is found , a new variable is created in this scope
* @ param name the variable to look for
* @ return a variable with the given name
* @ throws IllegalArgumentException if { @ link # autocrea... | Variable result = find ( name ) ; if ( result != null ) { return result ; } if ( ! autocreateVariables ) { throw new IllegalArgumentException ( ) ; } return create ( name ) ; |
public class VdmPluginImages { /** * / * package */
static ImageRegistry getImageRegistry ( ) { } } | if ( fgImageRegistry == null ) { ImageRegistry registry = new ImageRegistry ( ) ; for ( Iterator < String > iter = fgAvoidSWTErrorMap . keySet ( ) . iterator ( ) ; iter . hasNext ( ) ; ) { String key = iter . next ( ) ; registry . put ( key , fgAvoidSWTErrorMap . get ( key ) ) ; } fgImageRegistry = registry ; fgAvoidSW... |
public class MultiUserChat { /** * Creates the room according to some default configuration , assign the requesting user as the
* room owner , and add the owner to the room but not allow anyone else to enter the room
* ( effectively " locking " the room ) . The requesting user will join the room under the specified... | if ( joined ) { throw new MucAlreadyJoinedException ( ) ; } MucCreateConfigFormHandle mucCreateConfigFormHandle = createOrJoin ( nickname ) ; if ( mucCreateConfigFormHandle != null ) { // We successfully created a new room
return mucCreateConfigFormHandle ; } // We need to leave the room since it seems that the room al... |
public class CollapseProperties { /** * Updates the first initialization ( a . k . a " declaration " ) of a global name that occurs at a VAR
* node . See comment for { @ link # updateGlobalNameDeclaration } .
* @ param n An object representing a global name ( e . g . " a " ) */
private void updateGlobalNameDeclarat... | if ( ! canCollapseChildNames ) { return ; } Ref ref = n . getDeclaration ( ) ; String name = ref . getNode ( ) . getString ( ) ; Node rvalue = ref . getNode ( ) . getFirstChild ( ) ; Node variableNode = ref . getNode ( ) . getParent ( ) ; Node grandparent = variableNode . getParent ( ) ; boolean isObjLit = rvalue . isO... |
public class RegistryEntryImpl { /** * Check the legacy is a parent of < b > this < / b > { @ link RegistryEntryImpl }
* instance
* @ param registryEntry parent to check
* @ return true if the legacy is a parent */
public boolean isParent ( RegistryEntry registryEntry ) { } } | RegistryEntry entry = getParentRegistryEntry ( ) ; while ( entry != null ) { if ( entry . equals ( registryEntry ) ) { return true ; } entry = entry . getParentRegistryEntry ( ) ; } return false ; |
public class DataPipeline { /** * At least one source is active - notify the operator . */
@ Override public void sourceConnected ( VehicleDataSource source ) { } } | if ( mOperator != null ) { mOperator . onPipelineActivated ( ) ; for ( VehicleDataSource s : mSources ) { s . onPipelineActivated ( ) ; } } |
public class BinaryReader { /** * Read binary data from stream .
* @ param out The output buffer to read into .
* @ throws IOException if unable to read from stream . */
@ Override public int read ( byte [ ] out ) throws IOException { } } | int i , off = 0 ; while ( off < out . length && ( i = in . read ( out , off , out . length - off ) ) > 0 ) { off += i ; } return off ; |
public class QuadCurve { /** * Configures the start , control , and end points for this curve to be the same as the supplied
* curve . */
public void setCurve ( IQuadCurve curve ) { } } | setCurve ( curve . x1 ( ) , curve . y1 ( ) , curve . ctrlX ( ) , curve . ctrlY ( ) , curve . x2 ( ) , curve . y2 ( ) ) ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.