signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class DatagramPacket { /** * Set the data buffer for this packet . This sets the
* data , length and offset of the packet .
* @ param buf the buffer to set for this packet
* @ param offset the offset into the data
* @ param length the length of the data
* and / or the length of the buffer used to recei... | /* this will check to see if buf is null */
if ( length < 0 || offset < 0 || ( length + offset ) < 0 || ( ( length + offset ) > buf . length ) ) { throw new IllegalArgumentException ( "illegal length or offset" ) ; } this . buf = buf ; this . length = length ; this . bufLength = length ; this . offset = offset ; |
public class BlackBox { public synchronized void insert_cmd ( String cmd , String host ) { } } | // Insert elt in the box
box [ insert_elt ] . req_type = Req_Operation ; box [ insert_elt ] . attr_type = Attr_Unknown ; box [ insert_elt ] . op_type = Op_Command_inout ; box [ insert_elt ] . cmd_name = cmd ; box [ insert_elt ] . host = host ; box [ insert_elt ] . when = new Date ( ) ; // manage insert and read indexes... |
public class LBiObjCharPredicateBuilder { /** * One of ways of creating builder . This might be the only way ( considering all _ functional _ builders ) that might be utilize to specify generic params only once . */
@ Nonnull public static < T1 , T2 > LBiObjCharPredicateBuilder < T1 , T2 > biObjCharPredicate ( Consumer... | return new LBiObjCharPredicateBuilder ( consumer ) ; |
public class CompressUtil { /** * extract a zip file to a directory
* @ param format
* @ param source
* @ param target
* @ throws IOException */
public static void extract ( int format , Resource source , Resource target ) throws IOException { } } | if ( format == FORMAT_ZIP ) extractZip ( source , target ) ; else if ( format == FORMAT_TAR ) extractTar ( source , target ) ; else if ( format == FORMAT_GZIP ) extractGZip ( source , target ) ; else if ( format == FORMAT_TGZ ) extractTGZ ( source , target ) ; else throw new IOException ( "can't extract in given format... |
public class ZapHeadMethod { /** * Implementation copied from HeadMethod . */
@ Override protected void readResponseBody ( HttpState state , HttpConnection conn ) throws HttpException , IOException { } } | LOG . trace ( "enter HeadMethod.readResponseBody(HttpState, HttpConnection)" ) ; int bodyCheckTimeout = getParams ( ) . getIntParameter ( HttpMethodParams . HEAD_BODY_CHECK_TIMEOUT , - 1 ) ; if ( bodyCheckTimeout < 0 ) { responseBodyConsumed ( ) ; } else { if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( "Check for non-... |
public class DefaultGrailsApplication { /** * Retrieves the number of artefacts registered for the given artefactType as defined by the ArtefactHandler .
* @ param artefactType The type of the artefact as defined by the ArtefactHandler
* @ return The number of registered artefacts */
protected int getArtefactCount ... | ArtefactInfo info = getArtefactInfo ( artefactType ) ; return info == null ? 0 : info . getClasses ( ) . length ; |
public class Future { /** * Asyncrhonous transform operation
* @ see CompletableFuture # thenApplyAsync ( Function , Executor )
* @ param fn Transformation function
* @ param ex Executor to execute the transformation asynchronously
* @ return Mapped Future */
public < R > Future < R > map ( final Function < ? s... | return new Future < R > ( future . thenApplyAsync ( fn , ex ) ) ; |
public class DistributionTable { /** * Added by Saumya Target pin listener .
* @ param installedDistItemId
* Item ids of installed distribution set
* @ param assignedDistTableItemId
* Item ids of assigned distribution set */
public void styleDistributionSetTable ( final Long installedDistItemId , final Long ass... | setCellStyleGenerator ( ( source , itemId , propertyId ) -> getPinnedDistributionStyle ( installedDistItemId , assignedDistTableItemId , itemId ) ) ; |
public class PdfGState { /** * Sets the flag whether to apply overprint for stroking .
* @ param ov */
public void setOverPrintStroking ( boolean ov ) { } } | put ( PdfName . OP , ov ? PdfBoolean . PDFTRUE : PdfBoolean . PDFFALSE ) ; |
public class PrcPrepaymentFromSave { /** * < p > Make other entries include reversing if it ' s need when save . < / p >
* @ param pAddParam additional param
* @ param pEntity entity
* @ param pRequestData Request Data
* @ param pIsNew if entity was new
* @ throws Exception - an exception */
@ Override public... | // nothing |
public class WebGL10 { /** * < p > { @ code glBindAttribLocation } is used to associate a user - defined attribute variable in the program object
* specified by { @ code programID } with a generic vertex attribute index . The name of the user - defined attribute
* variable is string in { @ code name } . The generic... | checkContextCompatibility ( ) ; nglBindAttribLocation ( WebGLObjectMap . get ( ) . toProgram ( programID ) , index , name ) ; |
public class TransactionTaskQueue { /** * After all sites has been fully initialized and ready for snapshot , we should enable the scoreboard . */
boolean enableScoreboard ( ) { } } | assert ( s_barrier != null ) ; try { s_barrier . await ( 3L , TimeUnit . MINUTES ) ; } catch ( InterruptedException | BrokenBarrierException | TimeoutException e ) { hostLog . error ( "Cannot re-enable the scoreboard." ) ; s_barrier . reset ( ) ; return false ; } m_scoreboardEnabled = true ; if ( hostLog . isDebugEnabl... |
public class CmsExport { /** * Exports one single file with all its data and content . < p >
* @ param file the file to be exported
* @ throws CmsImportExportException if something goes wrong
* @ throws SAXException if something goes wrong processing the manifest . xml
* @ throws IOException if the ZIP entry fo... | String source = trimResourceName ( getCms ( ) . getSitePath ( file ) ) ; I_CmsReport report = getReport ( ) ; m_exportCount ++ ; report . print ( org . opencms . report . Messages . get ( ) . container ( org . opencms . report . Messages . RPT_SUCCESSION_1 , String . valueOf ( m_exportCount ) ) , I_CmsReport . FORMAT_N... |
public class FLVWriter { /** * Ends the writing process , then merges the data file with the flv file header and metadata . */
@ Override public void close ( ) { } } | log . debug ( "close" ) ; // spawn a thread to finish up our flv writer work
boolean locked = false ; try { // try to get a lock within x time
locked = lock . tryAcquire ( 500L , TimeUnit . MILLISECONDS ) ; if ( locked ) { finalizeFlv ( ) ; } } catch ( InterruptedException e ) { log . warn ( "Exception acquiring lock" ... |
public class BinaryHeapQueue { /** * Percolates element down heap from the position given by the index .
* Assumes it is a maximum heap .
* @ param index the index of the element */
protected void percolateDownMaxHeap ( final int index ) { } } | final Activation element = elements [ index ] ; int hole = index ; while ( ( hole * 2 ) <= size ) { int child = hole * 2 ; // if we have a right child and that child can not be percolated
// up then move onto other child
if ( child != size && compare ( elements [ child + 1 ] , elements [ child ] ) > 0 ) { child ++ ; } ... |
public class FilterVcf { /** * Main .
* @ param args command line args */
public static void main ( final String [ ] args ) { } } | Switch about = new Switch ( "a" , "about" , "display about message" ) ; Switch help = new Switch ( "h" , "help" , "display help message" ) ; StringListArgument snpIdFilter = new StringListArgument ( "s" , "snp-ids" , "filter by snp id" , true ) ; FileArgument inputVcfFile = new FileArgument ( "i" , "input-vcf-file" , "... |
public class AbstractTrainer { /** * Generates a name for the KnowledgeBase .
* @ param storageName
* @ param separator
* @ return */
protected final String createKnowledgeBaseName ( String storageName , String separator ) { } } | return storageName + separator + getClass ( ) . getSimpleName ( ) ; |
public class IdentityPatchContext { /** * Get a patch entry for either a layer or add - on .
* @ param name the layer name
* @ param addOn whether the target is an add - on
* @ return the patch entry , { @ code null } if it there is no such layer */
PatchEntry getEntry ( final String name , boolean addOn ) { } } | return addOn ? addOns . get ( name ) : layers . get ( name ) ; |
public class KryoTranscoderFactory { /** * { @ inheritDoc } */
@ Override @ edu . umd . cs . findbugs . annotations . SuppressWarnings ( "EI_EXPOSE_REP2" ) public void setCustomConverterClassNames ( final String [ ] customConverterClassNames ) { } } | _customConverterClassNames = customConverterClassNames ; |
public class DynamicValidationContext { /** * Replies the temprary root folders for resources .
* < p > The temporary resources are forgiven as soon as this function is called .
* @ return the root folders . */
public List < String > getTempResourceRoots ( ) { } } | final List < String > tmp = this . tmpResources == null ? Collections . emptyList ( ) : this . tmpResources ; this . tmpResources = null ; return tmp ; |
public class LocalExecutor { /** * Returns a JSON dump of the optimized plan .
* @ param plan
* The program ' s plan .
* @ return JSON dump of the optimized plan .
* @ throws Exception */
public static String optimizerPlanAsJSON ( Plan plan ) throws Exception { } } | LocalExecutor exec = new LocalExecutor ( ) ; try { exec . start ( ) ; PactCompiler pc = new PactCompiler ( new DataStatistics ( ) ) ; OptimizedPlan op = pc . compile ( plan ) ; PlanJSONDumpGenerator gen = new PlanJSONDumpGenerator ( ) ; return gen . getOptimizerPlanAsJSON ( op ) ; } finally { exec . stop ( ) ; } |
public class TSDB { /** * Processes the TSMeta through all of the trees if configured to do so
* @ param meta The meta data to process
* @ since 2.0 */
public Deferred < Boolean > processTSMetaThroughTrees ( final TSMeta meta ) { } } | if ( config . enable_tree_processing ( ) ) { return TreeBuilder . processAllTrees ( this , meta ) ; } return Deferred . fromResult ( false ) ; |
public class FactoryPointsToPolyline { /** * Generic function for create polyline algorithms based on configuration type */
public static PointsToPolyline create ( @ Nonnull ConfigPolyline config ) { } } | if ( config instanceof ConfigSplitMergeLineFit ) { return splitMerge ( ( ConfigSplitMergeLineFit ) config ) ; } else if ( config instanceof ConfigPolylineSplitMerge ) { return splitMerge ( ( ConfigPolylineSplitMerge ) config ) ; } else { throw new RuntimeException ( "Unknown" ) ; } |
public class ApiOvhCore { /** * Try to create a new CK from a nic / password
* @ param nic
* @ param password
* @ param timeInSec
* @ return
* @ throws IOException */
private boolean loginInternal ( String nic , String password , int timeInSec ) throws IOException { } } | // Due to per IP login rate limiting , we synchronize this part of the code .
// if multiple IP available , it can be sync on public IP based token
synchronized ( ApiOvhCore . class ) { String oldCK = config . getConsumerKey ( nic ) ; if ( oldCK != null && _consumerKey != null && ! oldCK . equals ( _consumerKey ) ) { /... |
public class CmsDriverManager { /** * Reads the list of all < code > { @ link CmsProperty } < / code > objects that belongs to the given historical resource . < p >
* @ param dbc the current database context
* @ param historyResource the historical resource to read the properties for
* @ return the list of < code... | return getHistoryDriver ( dbc ) . readProperties ( dbc , historyResource ) ; |
public class Ordering { /** * Returns the greatest of the specified values according to this ordering . If
* there are multiple greatest values , the first of those is returned .
* < p > < b > Java 8 users : < / b > If { @ code iterable } is a { @ link Collection } , use { @ code
* Collections . max ( collection ... | return max ( iterable . iterator ( ) ) ; |
public class appfwlearningdata { /** * Use this API to delete appfwlearningdata . */
public static base_response delete ( nitro_service client , appfwlearningdata resource ) throws Exception { } } | appfwlearningdata deleteresource = new appfwlearningdata ( ) ; deleteresource . profilename = resource . profilename ; deleteresource . starturl = resource . starturl ; deleteresource . cookieconsistency = resource . cookieconsistency ; deleteresource . fieldconsistency = resource . fieldconsistency ; deleteresource . ... |
public class SubscribeForm { /** * Sets the time at which the leased subscription will expire , or has expired .
* @ param expire The expiry date */
public void setExpiry ( Date expire ) { } } | addField ( SubscribeOptionFields . expire , FormField . Type . text_single ) ; setAnswer ( SubscribeOptionFields . expire . getFieldName ( ) , XmppDateTime . formatXEP0082Date ( expire ) ) ; |
public class TemplateDraft { /** * Internal method used to retrieve the necessary POST fields .
* @ return Map
* @ throws HelloSignException thrown if there is a problem serializing the
* POST fields . */
public Map < String , Serializable > getPostFields ( ) throws HelloSignException { } } | Map < String , Serializable > fields = super . getPostFields ( ) ; try { if ( hasTitle ( ) ) { fields . put ( REQUEST_TITLE , getTitle ( ) ) ; } if ( hasSubject ( ) ) { fields . put ( REQUEST_SUBJECT , getSubject ( ) ) ; } if ( hasMessage ( ) ) { fields . put ( REQUEST_MESSAGE , getMessage ( ) ) ; } List < String > sig... |
public class Scroller { /** * Scrolls view horizontally .
* @ param view the view to scroll
* @ param side the side to which to scroll ; { @ link Side # RIGHT } or { @ link Side # LEFT }
* @ param scrollPosition the position to scroll to , from 0 to 1 where 1 is all the way . Example is : 0.55.
* @ param stepCo... | int [ ] corners = new int [ 2 ] ; view . getLocationOnScreen ( corners ) ; int viewHeight = view . getHeight ( ) ; int viewWidth = view . getWidth ( ) ; float x = corners [ 0 ] + viewWidth * scrollPosition ; float y = corners [ 1 ] + viewHeight / 2.0f ; if ( side == Side . LEFT ) drag ( corners [ 0 ] , x , y , y , step... |
public class snmp_alarm_config { /** * Use this API to fetch filtered set of snmp _ alarm _ config resources .
* filter string should be in JSON format . eg : " vm _ state : DOWN , name : [ a - z ] + " */
public static snmp_alarm_config [ ] get_filtered ( nitro_service service , String filter ) throws Exception { } } | snmp_alarm_config obj = new snmp_alarm_config ( ) ; options option = new options ( ) ; option . set_filter ( filter ) ; snmp_alarm_config [ ] response = ( snmp_alarm_config [ ] ) obj . getfiltered ( service , option ) ; return response ; |
public class RelatedWaveListener { /** * { @ inheritDoc } */
@ Override public void waveFailed ( final Wave wave ) { } } | if ( wave . relatedWave ( ) != null ) { // Return wave has failed , so the triggered wave must be marked as failed too
LOGGER . log ( RELATED_WAVE_HAS_FAILED , wave . componentClass ( ) . getSimpleName ( ) , wave . relatedWave ( ) . toString ( ) ) ; wave . relatedWave ( ) . status ( Status . Failed ) ; } |
public class LTieConsumerBuilder { /** * One of ways of creating builder . This is possibly the least verbose way where compiler should be able to guess the generic parameters . */
@ Nonnull public static < T1 , T2 > LTieConsumer < T1 , T2 > tieConsumerFrom ( Consumer < LTieConsumerBuilder < T1 , T2 > > buildingFunctio... | LTieConsumerBuilder builder = new LTieConsumerBuilder ( ) ; buildingFunction . accept ( builder ) ; return builder . build ( ) ; |
public class RegistryQuery { /** * execute a String query on command line
* @ param query String to execute
* @ return
* @ throws IOException
* @ throws InterruptedException */
public static String executeQuery ( String [ ] cmd ) throws IOException , InterruptedException { } } | return Command . execute ( cmd ) . getOutput ( ) ; |
public class CommerceNotificationQueueEntryPersistenceImpl { /** * Caches the commerce notification queue entry in the entity cache if it is enabled .
* @ param commerceNotificationQueueEntry the commerce notification queue entry */
@ Override public void cacheResult ( CommerceNotificationQueueEntry commerceNotificat... | entityCache . putResult ( CommerceNotificationQueueEntryModelImpl . ENTITY_CACHE_ENABLED , CommerceNotificationQueueEntryImpl . class , commerceNotificationQueueEntry . getPrimaryKey ( ) , commerceNotificationQueueEntry ) ; commerceNotificationQueueEntry . resetOriginalValues ( ) ; |
public class Symbol { /** * The closest enclosing class of this symbol ' s declaration . */
public ClassSymbol enclClass ( ) { } } | Symbol c = this ; while ( c != null && ( ( c . kind & TYP ) == 0 || ! c . type . hasTag ( CLASS ) ) ) { c = c . owner ; } return ( ClassSymbol ) c ; |
public class HttpSessionsParam { /** * Sets whether or not the default session token with the given name is enabled .
* @ param name the name of the session token .
* @ param enabled { @ code true } if should be enabled , { @ code false } otherwise .
* @ return { @ code true } if the token ' s enabled state chang... | Optional < HttpSessionToken > maybeToken = getDefaultToken ( getNormalisedSessionTokenName ( name ) ) ; if ( maybeToken . isPresent ( ) ) { HttpSessionToken token = maybeToken . get ( ) ; if ( token . isEnabled ( ) == enabled ) { return true ; } if ( token . isEnabled ( ) ) { defaultTokensEnabled . remove ( token . get... |
public class BasicSourceMapConsumer { /** * Return true if we have the source content for every source in the source map , false otherwise . */
@ Override public boolean hasContentsOfAllSources ( ) { } } | if ( sourcesContent == null ) { return false ; } return this . sourcesContent . size ( ) >= this . _sources . size ( ) && ! this . sourcesContent . stream ( ) . anyMatch ( sc -> sc == null ) ; |
public class JSON { /** * Serializes the given object and wraps it in a callback function
* i . e . & lt ; callback & gt ; ( & lt ; json & gt ; )
* Note : This will not append a trailing semicolon
* @ param callback The name of the Javascript callback to prepend
* @ param object The object to serialize
* @ re... | if ( callback == null || callback . isEmpty ( ) ) throw new IllegalArgumentException ( "Missing callback name" ) ; if ( object == null ) throw new IllegalArgumentException ( "Object was null" ) ; try { return jsonMapper . writeValueAsBytes ( new JSONPObject ( callback , object ) ) ; } catch ( JsonProcessingException e ... |
public class DefaultTrackerClient { /** * 列出组 */
@ Override public List < GroupState > listGroups ( ) { } } | TrackerListGroupsCommand command = new TrackerListGroupsCommand ( ) ; return trackerConnectionManager . executeFdfsTrackerCmd ( command ) ; |
public class JSONObject { /** * Method to write an ' empty ' XML tag , like < F / >
* @ param writer The writer object to render the XML to .
* @ param indentDepth How far to indent .
* @ param contentOnly Whether or not to write the object name as part of the output
* @ param compact Flag to denote whether to ... | if ( logger . isLoggable ( Level . FINER ) ) logger . entering ( className , "writeEmptyObject(Writer, int, boolean, boolean)" ) ; if ( ! contentOnly ) { if ( ! compact ) { writeIndention ( writer , indentDepth ) ; writer . write ( "\"" + this . objectName + "\"" ) ; writer . write ( " : \"\"" ) ; } else { writer . wri... |
public class FastQ { /** * Trim the sequence ' s tail , if it is longer than a determined size
* @ param maxSize - Maximum size allowed */
public void trimSequenceTail ( int maxSize ) { } } | // Trim sequence and quality strings
this . setSeq ( this . sequence . substring ( 0 , maxSize ) ) ; this . setQuality ( this . quality . substring ( 0 , maxSize ) ) ; |
public class NodeOptInfo { /** * / * boundary */
public void setBoundNode ( MinMaxLen mmd ) { } } | exb . mmd . copy ( mmd ) ; expr . mmd . copy ( mmd ) ; map . mmd . copy ( mmd ) ; |
public class BaseXMLBuilder { /** * Explicitly enable or disable the ' external - general - entities ' and
* ' external - parameter - entities ' features of the underlying
* DocumentBuilderFactory .
* TODO This is a naive approach that simply tries to apply all known
* feature name / URL values in turn until on... | // Feature list drawn from :
// https : / / www . owasp . org / index . php / XML _ External _ Entity _ ( XXE ) _ Processing
/* Enable or disable external general entities */
String [ ] externalGeneralEntitiesFeatures = { // General
"http://xml.org/sax/features/external-general-entities" , // Xerces 1
"http://xerces.ap... |
public class AmazonEC2Client { /** * Describes the VPC endpoint connections to your VPC endpoint services , including any endpoints that are pending
* your acceptance .
* @ param describeVpcEndpointConnectionsRequest
* @ return Result of the DescribeVpcEndpointConnections operation returned by the service .
* @... | request = beforeClientExecution ( request ) ; return executeDescribeVpcEndpointConnections ( request ) ; |
public class AsyncBitmapTexture { /** * This method must be called , on the GL thread , at least once after
* initialization : it is safe to call it more than once .
* Not calling this method leaves { @ link # glMaxTextureSize } set to a default
* value , which may be smaller than necessary . */
private static vo... | if ( glUninitialized ) { glGetError ( ) ; // reset any previous error
int [ ] size = new int [ ] { - 1 } ; glGetIntegerv ( GL_MAX_TEXTURE_SIZE , size , 0 ) ; int errorCode = glGetError ( ) ; if ( errorCode != GL_NO_ERROR ) { throw Exceptions . RuntimeAssertion ( "Error %d getting max texture size" , errorCode ) ; } int... |
public class DefaultResponseDeenrichmentService { /** * Contacts server and tries to retrieve response payload via serialId .
* Repeats the retrieval until the payload is found or number of allowed iterations is reached . */
private ResponsePayload retrieveResponsePayload ( long serialId ) throws InterruptedException... | ResponsePayloadWasNeverRegistered last = null ; for ( int i = 0 ; i <= 10 ; i ++ ) { try { RetrievePayloadFromServer result = remoteOperationService ( ) . execute ( new RetrievePayloadFromServer ( serialId ) ) ; return result . getResponsePayload ( ) ; } catch ( ResponsePayloadWasNeverRegistered e ) { Thread . sleep ( ... |
public class RxStore { /** * Create a new { @ link ListStore } that is capable of persisting many objects to disk . */
public static < T > ListStore < T > list ( @ NonNull File file , @ NonNull Converter converter , @ NonNull Type type ) { } } | return new RealListStore < T > ( file , converter , type ) ; |
public class JsonModelCoder { /** * Encodes the given { @ link List } of values into the JSON format , and writes it using the given writer . < br >
* Writes " null " if null is given .
* @ param writer { @ link Writer } to be used for writing value
* @ param list { @ link List } of values to be encoded
* @ thr... | if ( list == null ) { writer . write ( "null" ) ; writer . flush ( ) ; return ; } JsonUtil . startArray ( writer ) ; int size = list . size ( ) ; for ( int i = 0 ; i < size ; i ++ ) { encodeNullToNull ( writer , list . get ( i ) ) ; if ( i + 1 < size ) { JsonUtil . addSeparator ( writer ) ; } } JsonUtil . endArray ( wr... |
public class ASTClassFactory { /** * Builds the parameters for a given method
* @ param method
* @ return AST parameters */
public ImmutableList < ASTParameter > getParameters ( Method method ) { } } | return getParameters ( method . getParameterTypes ( ) , method . getGenericParameterTypes ( ) , method . getParameterAnnotations ( ) ) ; |
public class TempFileHelper { /** * Creates a temporary directory in the given directory , or in in the
* temporary directory if dir is { @ code null } . */
public static File createTempDirectory ( String prefix , Path dir ) throws IOException { } } | if ( prefix == null ) { prefix = "" ; } final File file = generatePath ( prefix , dir ) . toFile ( ) ; if ( ! file . mkdirs ( ) ) { throw new IOException ( "Can't create dir " + file . getAbsolutePath ( ) ) ; } return file ; |
public class EmxMetadataParser { /** * Load all attributes from the source repository and add it to the { @ link
* IntermediateParseResults } .
* @ param attributesRepo Repository for the attributes
* @ param intermediateResults { @ link IntermediateParseResults } with the tags already parsed */
private void pars... | for ( Attribute attr : attributesRepo . getEntityType ( ) . getAtomicAttributes ( ) ) { checkAttrSheetHeaders ( attr ) ; } Map < String , Map < String , EmxAttribute > > attributesMap = newLinkedHashMap ( ) ; // 1st pass : create attribute stubs
int rowIndex = 1 ; // Header
createAttributeStubs ( attributesRepo , attri... |
public class DeploymentEnricher { /** * creates a { @ link JavaArchive } as composition of resources required by Warp runtime in a container */
JavaArchive createWarpArchive ( ) { } } | JavaArchive archive = ShrinkWrap . create ( JavaArchive . class , "arquillian-warp.jar" ) ; // API
archive . addClass ( Inspection . class ) ; archive . addClasses ( BeforeServlet . class , AfterServlet . class ) ; for ( String packageName : REQUIRED_WARP_PACKAGES ) { archive . addPackage ( packageName ) ; } archive . ... |
public class AddMultiAssetResponsiveDisplayAd { /** * Creates an { @ link AssetLink } containing a { @ link ImageAsset } with the specified asset ID .
* @ param assetId ID of the image asset .
* @ return a new { @ link AssetLink } */
private static AssetLink createAssetLinkForImageAsset ( long assetId ) { } } | AssetLink assetLink = new AssetLink ( ) ; ImageAsset imageAsset = new ImageAsset ( ) ; imageAsset . setAssetId ( assetId ) ; assetLink . setAsset ( imageAsset ) ; return assetLink ; |
public class PGStream { /** * Change the encoding used by this connection .
* @ param encoding the new encoding to use
* @ throws IOException if something goes wrong */
public void setEncoding ( Encoding encoding ) throws IOException { } } | if ( this . encoding != null && this . encoding . name ( ) . equals ( encoding . name ( ) ) ) { return ; } // Close down any old writer .
if ( encodingWriter != null ) { encodingWriter . close ( ) ; } this . encoding = encoding ; // Intercept flush ( ) downcalls from the writer ; our caller
// will call PGStream . flus... |
public class EPFImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public void setPFName ( String newPFName ) { } } | String oldPFName = pfName ; pfName = newPFName ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , AfplibPackage . EPF__PF_NAME , oldPFName , pfName ) ) ; |
public class DriverRuntimeStartHandler { /** * This method is called on start of the REEF Driver runtime event loop .
* It contains startup logic for REEF Driver that is independent from a
* runtime framework ( e . g . Mesos , YARN , Local , etc ) .
* Platform - specific logic is then handled in ResourceManagerSt... | LOG . log ( Level . FINEST , "RuntimeStart: {0}" , runtimeStart ) ; // Register for heartbeats and error messages from the Evaluators .
this . remoteManager . registerHandler ( EvaluatorRuntimeProtocol . EvaluatorHeartbeatProto . class , this . evaluatorHeartbeatHandler ) ; this . remoteManager . registerHandler ( Reef... |
public class JcrURLConnection { /** * ( non - Javadoc )
* @ see java . net . URLConnection # getContentType ( ) */
@ Override public String getContentType ( ) { } } | try { if ( ! connected ) { connect ( ) ; } return nodeRepresentation . getMediaType ( ) ; } catch ( IOException e ) { if ( LOG . isTraceEnabled ( ) ) { LOG . trace ( "An exception occurred: " + e . getMessage ( ) ) ; } } catch ( RepositoryException e ) { if ( LOG . isTraceEnabled ( ) ) { LOG . trace ( "An exception occ... |
public class ZanataInterface { /** * Delete the translations for a Document from Zanata .
* Note : This method should be used with extreme care .
* @ param id The ID of the document in Zanata to be deleted .
* @ param locale The locale of the translation to be deleted .
* @ return True if the document was succe... | performZanataRESTCallWaiting ( ) ; ClientResponse < String > response = null ; try { final ITranslatedDocResource client = proxyFactory . getTranslatedDocResource ( details . getProject ( ) , details . getVersion ( ) ) ; response = client . deleteTranslations ( id , locale ) ; final Status status = Response . Status . ... |
public class InstantiateOperation { /** * Tries to load the class with the given name . Throws a TransformationOperationException if this is not possible . */
private Class < ? > loadClassByName ( String className ) throws TransformationOperationException { } } | Exception e ; if ( className . contains ( ";" ) ) { try { String [ ] parts = className . split ( ";" ) ; ModelDescription description = new ModelDescription ( ) ; description . setModelClassName ( parts [ 0 ] ) ; if ( parts . length > 1 ) { description . setVersionString ( new Version ( parts [ 1 ] ) . toString ( ) ) ;... |
public class TransitionFactory { /** * a new factory that embeds the default builders .
* @ return a viable factory */
public static TransitionFactory newBundle ( ) { } } | TransitionFactory f = new TransitionFactory ( ) ; f . add ( new BootVM . Builder ( ) ) ; f . add ( new ShutdownVM . Builder ( ) ) ; f . add ( new SuspendVM . Builder ( ) ) ; f . add ( new ResumeVM . Builder ( ) ) ; f . add ( new KillVM . Builder ( ) ) ; f . add ( new RelocatableVM . Builder ( ) ) ; f . add ( new ForgeV... |
public class TargetQueryRenderer { /** * Appends nested concats */
public static void getNestedConcats ( StringBuilder stb , ImmutableTerm term1 , ImmutableTerm term2 ) { } } | if ( term1 instanceof ImmutableFunctionalTerm ) { ImmutableFunctionalTerm f = ( ImmutableFunctionalTerm ) term1 ; getNestedConcats ( stb , f . getTerms ( ) . get ( 0 ) , f . getTerms ( ) . get ( 1 ) ) ; } else { stb . append ( appendTerms ( term1 ) ) ; } if ( term2 instanceof ImmutableFunctionalTerm ) { ImmutableFuncti... |
public class JFapChannelFactory { /** * begin D196658 */
public Class getApplicationInterface ( ) { } } | if ( tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getApplicationInterface" ) ; if ( tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "getApplicationInterface" ) ; return JFapChannelFactory . class ; // 196678.10 |
public class EvernotePreconditions { /** * Ensures that the array is not { @ code null } , and none of its elements are { @ code null } .
* @ param value an array of boxed objects
* @ param valueName the name of the argument to use if the check fails
* @ return the validated array
* @ throws NullPointerExceptio... | if ( value == null ) { throw new NullPointerException ( valueName + " must not be null" ) ; } for ( int i = 0 ; i < value . length ; ++ i ) { if ( value [ i ] == null ) { throw new NullPointerException ( String . format ( "%s[%d] must not be null" , valueName , i ) ) ; } } return value ; |
public class TaskForm { /** * @ deprecated use { @ link startProcessInstanceByKeyForm ( ) } instead
* @ param processDefinitionKey
* @ param callbackUrl */
@ Deprecated public void startProcessInstanceByKeyForm ( String processDefinitionKey , String callbackUrl ) { } } | this . url = callbackUrl ; this . processDefinitionKey = processDefinitionKey ; beginConversation ( ) ; |
public class CheckBoxList { /** * Adds an item to the checkbox list with an explicit checked status
* @ param object Object to add to the list
* @ param checkedState If < code > true < / code > , the new item will be initially checked
* @ return Itself */
public synchronized CheckBoxList < V > addItem ( V object ... | itemStatus . add ( checkedState ) ; return super . addItem ( object ) ; |
public class ApiOvhOrder { /** * Create order
* REST : POST / order / email / pro / { service } / account / { duration }
* @ param number [ required ] Number of Accounts to order
* @ param service [ required ] The internal name of your pro organization
* @ param duration [ required ] Duration */
public OvhOrder... | String qPath = "/order/email/pro/{service}/account/{duration}" ; StringBuilder sb = path ( qPath , service , duration ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "number" , number ) ; String resp = exec ( qPath , "POST" , sb . toString ( ) , o ) ; return convertTo ( resp , Ov... |
public class AbstractHtmlTableCell { /** * Sets the value of the horizontal alignment character attribute for the HTML table cell .
* @ param alignChar the horizontal alignment character
* @ jsptagref . attributedescription The horizontal alignment character for the HTML table cell
* @ jsptagref . attributesyntax... | _cellState . registerAttribute ( AbstractHtmlState . ATTR_GENERAL , HtmlConstants . CHAR , alignChar ) ; |
public class TedDaoPostgres { /** * use 1 call for postgres , instead of 2 ( sequence and insert ) */
protected long createTaskInternal ( String name , String channel , String data , String key1 , String key2 , Long batchId , int postponeSec , TedStatus status ) { } } | String sqlLogId = "create_task" ; if ( status == null ) status = TedStatus . NEW ; String nextts = ( status == TedStatus . NEW ? dbType . sql . now ( ) + " + " + dbType . sql . intervalSeconds ( postponeSec ) : "null" ) ; String sql = " insert into tedtask (taskId, system, name, channel, bno, status, createTs, nextTs, ... |
public class StorageProviderUtil { /** * Creates a list of all of the items in an iteration .
* Be wary of using this for Iterations of very long lists .
* @ param iterator
* @ return */
public static List < String > getList ( Iterator < String > iterator ) { } } | List < String > contents = new ArrayList < String > ( ) ; while ( iterator . hasNext ( ) ) { contents . add ( iterator . next ( ) ) ; } return contents ; |
public class SqlAgentImpl { /** * { @ inheritDoc }
* @ see jp . co . future . uroborosql . SqlAgent # procedure ( jp . co . future . uroborosql . context . SqlContext ) */
@ Override public Map < String , Object > procedure ( final SqlContext sqlContext ) throws SQLException { } } | // パラメータログを出力する
MDC . put ( SUPPRESS_PARAMETER_LOG_OUTPUT , Boolean . FALSE . toString ( ) ) ; // procedureやfunctionの場合 、 SQL文法エラーになるためバインドパラメータコメントを出力しない
sqlContext . contextAttrs ( ) . put ( CTX_ATTR_KEY_OUTPUT_BIND_COMMENT , false ) ; // コンテキスト変換
transformContext ( sqlContext , false ) ; StopWatch watch = null ... |
public class LibraryCacheManager { /** * Decrements the reference counter for the library manager entry with the given job ID .
* @ param jobID
* the job ID identifying the library manager entry
* @ return the decremented reference counter */
private int decrementReferenceCounter ( final JobID jobID ) { } } | final AtomicInteger ai = this . libraryReferenceCounter . get ( jobID ) ; if ( ai == null ) { throw new IllegalStateException ( "Cannot find reference counter entry for job " + jobID ) ; } int retVal = ai . decrementAndGet ( ) ; if ( retVal == 0 ) { this . libraryReferenceCounter . remove ( jobID ) ; } return retVal ; |
public class GroupImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public boolean eIsSet ( int featureID ) { } } | switch ( featureID ) { case XtextPackage . GROUP__GUARD_CONDITION : return guardCondition != null ; } return super . eIsSet ( featureID ) ; |
public class LoggingConfiguration { /** * ( non - Javadoc )
* @ see
* com . netflix . config . PropertyListener # configSourceLoaded ( java . lang . Object ) */
public void configSourceLoaded ( Object source ) { } } | Properties props = ConfigurationConverter . getProperties ( ConfigurationManager . getConfigInstance ( ) ) ; reconfigure ( props ) ; |
public class AmazonConfigClient { /** * Used by an AWS Lambda function to deliver evaluation results to AWS Config . This action is required in every AWS
* Lambda function that is invoked by an AWS Config rule .
* @ param putEvaluationsRequest
* @ return Result of the PutEvaluations operation returned by the serv... | request = beforeClientExecution ( request ) ; return executePutEvaluations ( request ) ; |
public class BCD { /** * ASCII转BCD
* @ param ascii ASCII byte数组
* @ param ascLength 长度
* @ return BCD */
public static byte [ ] ascToBcd ( byte [ ] ascii , int ascLength ) { } } | byte [ ] bcd = new byte [ ascLength / 2 ] ; int j = 0 ; for ( int i = 0 ; i < ( ascLength + 1 ) / 2 ; i ++ ) { bcd [ i ] = ascToBcd ( ascii [ j ++ ] ) ; bcd [ i ] = ( byte ) ( ( ( j >= ascLength ) ? 0x00 : ascToBcd ( ascii [ j ++ ] ) ) + ( bcd [ i ] << 4 ) ) ; } return bcd ; |
public class ForMethod { /** * Creates a transformer that enforces the supplied modifier contributors . All ranges of each contributor is first cleared and then overridden
* by the specified modifiers in the order they are supplied .
* @ param modifierContributors The modifier contributors in their application orde... | return new ForMethod ( new MethodModifierTransformer ( ModifierContributor . Resolver . of ( modifierContributors ) ) ) ; |
public class CmsUsersCsvDownloadDialog { /** * Creates the dialog HTML for all defined widgets of the named dialog ( page ) . < p >
* This overwrites the method from the super class to create a layout variation for the widgets . < p >
* @ param dialog the dialog ( page ) to get the HTML for
* @ return the dialog ... | StringBuffer result = new StringBuffer ( 1024 ) ; result . append ( createWidgetTableStart ( ) ) ; // show error header once if there were validation errors
result . append ( createWidgetErrorHeader ( ) ) ; if ( dialog . equals ( PAGES [ 0 ] ) ) { // create the widgets for the first dialog page
result . append ( "<scri... |
public class BitsUtil { /** * Test whether two Bitsets intersect .
* @ param x First bitset
* @ param y Second bitset
* @ return { @ code true } when the bitsets intersect . */
public static boolean intersect ( long [ ] x , long [ ] y ) { } } | final int min = ( x . length < y . length ) ? x . length : y . length ; for ( int i = 0 ; i < min ; i ++ ) { if ( ( x [ i ] & y [ i ] ) != 0L ) { return true ; } } return false ; |
public class Partitioner { /** * Get high water mark
* @ param extractType Extract type
* @ param watermarkType Watermark type
* @ return high water mark in { @ link Partitioner # WATERMARKTIMEFORMAT } */
@ VisibleForTesting protected long getHighWatermark ( ExtractType extractType , WatermarkType watermarkType )... | LOG . debug ( "Getting high watermark" ) ; String timeZone = this . state . getProp ( ConfigurationKeys . SOURCE_TIMEZONE ) ; long highWatermark = ConfigurationKeys . DEFAULT_WATERMARK_VALUE ; if ( this . isWatermarkOverride ( ) ) { highWatermark = this . state . getPropAsLong ( ConfigurationKeys . SOURCE_QUERYBASED_EN... |
public class AsyncTaskDemoFragment { /** * called by { @ link org . osmdroid . views . MapView } if zoom or scroll has changed to
* reload marker for new visible region in the { @ link org . osmdroid . views . MapView } */
private void reloadMarker ( ) { } } | // initialized
if ( mCurrentBackgroundMarkerLoaderTask == null ) { // start background load
double zoom = this . mMapView . getZoomLevelDouble ( ) ; BoundingBox world = this . mMapView . getBoundingBox ( ) ; reloadMarker ( world , zoom ) ; } else { // background load is already active . Remember that at least one scrol... |
public class MemoryFileManager { /** * Lists all file objects matching the given criteria in the given
* location . List file objects in " subpackages " if recurse is
* true .
* < p > Note : even if the given location is unknown to this file
* manager , it may not return { @ code null } . Also , an unknown
* ... | Iterable < JavaFileObject > stdList = stdFileManager . list ( location , packageName , kinds , recurse ) ; if ( location == CLASS_PATH && packageName . equals ( "REPL" ) ) { // if the desired list is for our JShell package , lazily iterate over
// first the standard list then any generated classes .
return ( ) -> new I... |
public class ValidatedInputView { /** * Updates the view knowing if the input is valid or not . */
@ CallSuper protected void updateBorder ( ) { } } | boolean isFocused = input . hasFocus ( ) && ! input . isInTouchMode ( ) ; ViewUtils . setBackground ( outline , hasValidInput ? ( isFocused ? focusedOutlineBackground : normalOutlineBackground ) : errorOutlineBackground ) ; errorDescription . setVisibility ( hasValidInput ? GONE : VISIBLE ) ; requestLayout ( ) ; |
public class BigDecimalMath { /** * Calculates the arc hyperbolic sine ( inverse hyperbolic sine ) of { @ link BigDecimal } x .
* < p > See : < a href = " https : / / en . wikipedia . org / wiki / Hyperbolic _ function " > Wikipedia : Hyperbolic function < / a > < / p >
* @ param x the { @ link BigDecimal } to calc... | checkMathContext ( mathContext ) ; MathContext mc = new MathContext ( mathContext . getPrecision ( ) + 10 , mathContext . getRoundingMode ( ) ) ; BigDecimal result = log ( x . add ( sqrt ( x . multiply ( x , mc ) . add ( ONE , mc ) , mc ) , mc ) , mc ) ; return round ( result , mathContext ) ; |
public class JobSchedulesImpl { /** * Enables a job schedule .
* @ param jobScheduleId The ID of the job schedule to enable .
* @ param jobScheduleEnableOptions Additional parameters for the operation
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ throws BatchErrorException thr... | enableWithServiceResponseAsync ( jobScheduleId , jobScheduleEnableOptions ) . toBlocking ( ) . single ( ) . body ( ) ; |
public class XMLSchedulingDataProcessor { /** * Process the xml file in the given location , and schedule all of the jobs defined within it .
* @ param fileName meta data file name . */
public void processFile ( String fileName , boolean failOnFileNotFound ) throws Exception { } } | boolean fileFound = false ; InputStream f = null ; try { String furl = null ; File file = new File ( fileName ) ; // files in filesystem
if ( ! file . exists ( ) ) { URL url = classLoadHelper . getResource ( fileName ) ; if ( url != null ) { try { furl = URLDecoder . decode ( url . getPath ( ) , "UTF-8" ) ; } catch ( U... |
class GenerateDemloNumber { /** * Create a unique Demlo number of a specific pattern given a certain number .
* @ param inputString A string representation of the number used to generate the Demlo number .
* @ return The generated Demlo number .
* Examples :
* > > > generate _ demlo _ number ( " 11111 " )
* "... | int length = inputString . length ( ) ; StringBuilder result = new StringBuilder ( ) ; for ( int i = 1 ; i <= length ; i ++ ) { result . append ( i ) ; } for ( int i = length - 1 ; i > 0 ; i -- ) { result . append ( i ) ; } return result . toString ( ) ; |
public class HtmlTree { /** * Generates a heading tag ( h1 to h6 ) with the title and style class attributes . It also encloses
* a content .
* @ param headingTag the heading tag to be generated
* @ param printTitle true if title for the tag needs to be printed else false
* @ param styleClass stylesheet class f... | HtmlTree htmltree = new HtmlTree ( headingTag , nullCheck ( body ) ) ; if ( printTitle ) htmltree . setTitle ( body ) ; if ( styleClass != null ) htmltree . addStyle ( styleClass ) ; return htmltree ; |
public class Get { /** * Retrieves the select options in the element . If the element isn ' t present
* or a select , a null value will be returned .
* @ return String [ ] : the options from the select element */
@ SuppressWarnings ( "squid:S1168" ) public String [ ] selectOptions ( ) { } } | if ( isNotPresentSelect ( ) ) { return null ; // returning an empty array could be confused with no options available
} WebElement webElement = element . getWebElement ( ) ; Select dropdown = new Select ( webElement ) ; List < WebElement > options = dropdown . getOptions ( ) ; String [ ] stringOptions = new String [ op... |
public class JsonFilesScanner { /** * / * filter */
public JsonFilesFilterResult jfilter ( File [ ] files , FileFilter filter ) { } } | final FilesFilterResult < Object > f = filter ( files , filter ) ; return new JsonFilesFilterResult ( ) { @ Override public DataArray array ( ) { return STRUCT . fromMapsAndCollections ( f . list ( ) ) ; } @ Override public DataArray array ( int start , int count ) { return STRUCT . fromMapsAndCollections ( f . list ( ... |
public class CmsUrlNameMappingFilter { /** * Creates a new filter from the current filter which also must not match a given structure id . < p >
* @ param id the structure id to not match
* @ return a new filter */
public CmsUrlNameMappingFilter filterRejectStructureId ( CmsUUID id ) { } } | if ( id == null ) { throw new IllegalArgumentException ( ) ; } if ( m_structureId != null ) { throw new IllegalStateException ( ) ; } CmsUrlNameMappingFilter result = new CmsUrlNameMappingFilter ( this ) ; result . m_rejectStructureId = id ; return result ; |
public class RxBroadcast { /** * Create { @ link Observable } that wraps { @ link BroadcastReceiver } and emits received intents .
* < em > This is only useful in conjunction with Ordered Broadcasts , e . g . ,
* { @ link Context # sendOrderedBroadcast ( Intent , String ) } < / em >
* @ param context the context ... | BroadcastRegistrar broadcastRegistrar = new BroadcastRegistrar ( context , intentFilter ) ; return createBroadcastObservable ( broadcastRegistrar , orderedBroadcastAbortStrategy ) ; |
public class HttpImageUploadChannel { /** * Close the upload */
public void close ( ) { } } | if ( this . isDisabled || this . closed ) { // parent stream needs to check for success explicitly
return ; } closed = true ; try { // send close request
tasks . add ( sendExecutor . submit ( new SendWorker ( new ByteArrayOutputStream ( 0 ) , segmentId ++ , true ) ) ) ; // wait for all tasks to complete
for ( Future < ... |
public class RandomCompat { /** * Returns a stream producing the given { @ code streamSize } number
* of pseudorandom { @ code long } values , each conforming
* to the given origin ( inclusive ) and bound ( exclusive ) .
* @ param streamSize the number of values to generate
* @ param randomNumberOrigin the orig... | if ( streamSize < 0L ) throw new IllegalArgumentException ( ) ; if ( streamSize == 0L ) { return LongStream . empty ( ) ; } return longs ( randomNumberOrigin , randomNumberBound ) . limit ( streamSize ) ; |
public class LinkedIOSubchannel { /** * Like { @ link # downstreamChannel ( Manager , IOSubchannel ) } , but
* with the return value of the specified type .
* @ param < T > the generic type
* @ param hub the component that manages this channel
* @ param upstreamChannel the ( upstream ) channel
* @ param clazz... | return upstreamChannel . associated ( new KeyWrapper ( hub ) , clazz ) ; |
public class PropertyParser { private String parseFieldName ( List < String > content ) { } } | String line = parseFieldDefinition ( content ) ; String [ ] parts = line . split ( " " ) ; String last = parts [ parts . length - 1 ] ; if ( last . endsWith ( ";" ) && last . length ( ) > 1 ) { return last . substring ( 0 , last . length ( ) - 1 ) ; } throw new BeanCodeGenException ( "Unable to locate field name at lin... |
public class SEPExecutor { /** * that a proceeding call to tasks . poll ( ) will return some work */
boolean takeTaskPermit ( ) { } } | while ( true ) { long current = permits . get ( ) ; int taskPermits = taskPermits ( current ) ; if ( taskPermits == 0 ) return false ; if ( permits . compareAndSet ( current , updateTaskPermits ( current , taskPermits - 1 ) ) ) { if ( taskPermits == maxTasksQueued && hasRoom . hasWaiters ( ) ) hasRoom . signalAll ( ) ;... |
public class ProcessGroovyMethods { /** * Gets the output stream from a process and reads it
* to keep the process from blocking due to a full output buffer .
* The processed stream data is appended to the supplied OutputStream .
* A new Thread is started , so this method will return immediately .
* @ param sel... | Thread thread = new Thread ( new ByteDumper ( self . getInputStream ( ) , output ) ) ; thread . start ( ) ; return thread ; |
public class AtlasBaseClient { /** * Modify URL to include the path params */
private WebResource getResource ( WebResource service , APIInfo api , String ... pathParams ) { } } | WebResource resource = service . path ( api . getPath ( ) ) ; resource = appendPathParams ( resource , pathParams ) ; return resource ; |
public class JSONCompare { /** * Compares JSON object provided to the expected JSON object using provided comparator , and returns the results of
* the comparison .
* @ param expected expected json array
* @ param actual actual json array
* @ param comparator comparator to use
* @ return result of the compari... | return comparator . compareJSON ( expected , actual ) ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.