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 receive data * @ exception NullPointerException if the argument is null * @ see # getData * @ see # getOffset * @ see # getLength * @ since 1.2 */ public synchronized void setData ( byte [ ] buf , int offset , int length ) { } }
/* 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 inc_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 < LBiObjCharPredicate < T1 , T2 > > 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-compliant response body. Timeout in " + bodyCheckTimeout + " ms" ) ; } boolean responseAvailable = false ; try { responseAvailable = conn . isResponseAvailable ( bodyCheckTimeout ) ; } catch ( IOException e ) { LOG . debug ( "An IOException occurred while testing if a response was available," + " we will assume one is not." , e ) ; responseAvailable = false ; } if ( responseAvailable ) { if ( getParams ( ) . isParameterTrue ( HttpMethodParams . REJECT_HEAD_BODY ) ) { throw new ProtocolException ( "Body content may not be sent in response to HTTP HEAD request" ) ; } else { LOG . warn ( "Body content returned in response to HTTP HEAD" ) ; } super . readResponseBody ( state , conn ) ; } }
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 ( String artefactType ) { } }
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 < ? super T , ? extends R > fn , Executor ex ) { } }
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 assignedDistTableItemId ) { } }
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 final void makeOtherEntries ( final Map < String , Object > pAddParam , final PrepaymentFrom pEntity , final IRequestData pRequestData , final boolean pIsNew ) throws Exception { } }
// 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 vertex attribute index to be bound to this variable is specified * by { @ code index } . When { @ code program } is made part of current state , values provided via the generic vertex * attribute index will modify the value of the user - defined attribute variable specified by name . < / p > * < p > { @ link # GL _ INVALID _ VALUE } is generated if index is greater than or equal to { @ link * # GL _ MAX _ VERTEX _ ATTRIBS } . < / p > * < p > { @ link # GL _ INVALID _ OPERATION } is generated if name starts with the reserved prefix " gl _ " . < / p > * < p > { @ link # GL _ INVALID _ VALUE } is generated if program is not a value generated by OpenGL . < / p > * < p > { @ link # GL _ INVALID _ OPERATION } is generated if program is not a program object . < / p > * @ param programID Specifies the handle of the program object in which the association is to be made . * @ param index Specifies the index of the generic vertex attribute to be bound . * @ param name Specifies a string containing the name of the vertex shader attribute variable to which { @ code * index } is to be bound . */ public static void glBindAttribLocation ( int programID , int index , String name ) { } }
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 . isDebugEnabled ( ) ) { hostLog . debug ( "Scoreboard has been enabled." ) ; } return true ;
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 for the file could be appended to the ZIP archive */ protected void exportFile ( CmsFile file ) throws CmsImportExportException , SAXException , IOException { } }
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_NOTE ) ; report . print ( Messages . get ( ) . container ( Messages . RPT_EXPORT_0 ) , I_CmsReport . FORMAT_NOTE ) ; report . print ( org . opencms . report . Messages . get ( ) . container ( org . opencms . report . Messages . RPT_ARGUMENT_1 , getCms ( ) . getSitePath ( file ) ) ) ; report . print ( org . opencms . report . Messages . get ( ) . container ( org . opencms . report . Messages . RPT_DOTS_0 ) ) ; // store content in zip - file // check if the content of this resource was not already exported if ( ! m_exportedResources . contains ( file . getResourceId ( ) ) ) { // write the file using the export writer m_exportWriter . writeFile ( file , source ) ; // add the resource id to the storage to mark that this resource was already exported m_exportedResources . add ( file . getResourceId ( ) ) ; // create the manifest - entries appendResourceToManifest ( file , true ) ; } else { // only create the manifest - entries appendResourceToManifest ( file , false ) ; } if ( LOG . isInfoEnabled ( ) ) { LOG . info ( Messages . get ( ) . getBundle ( ) . key ( Messages . LOG_EXPORTING_OK_2 , String . valueOf ( m_exportCount ) , source ) ) ; } report . println ( org . opencms . report . Messages . get ( ) . container ( org . opencms . report . Messages . RPT_OK_0 ) , I_CmsReport . FORMAT_OK ) ;
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" , e ) ; } finally { if ( locked ) { lock . release ( ) ; } if ( executor != null && ! executor . isTerminated ( ) ) { executor . shutdown ( ) ; } }
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 ++ ; } // if we found resting place of bubble then terminate search if ( compare ( elements [ child ] , element ) <= 0 ) { break ; } setElement ( hole , elements [ child ] ) ; hole = child ; } setElement ( hole , element ) ;
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" , "input VCF file, default stdin" , false ) ; FileArgument outputVcfFile = new FileArgument ( "o" , "output-vcf-file" , "output VCF file, default stdout" , false ) ; ArgumentList arguments = new ArgumentList ( about , help , snpIdFilter , inputVcfFile , outputVcfFile ) ; CommandLine commandLine = new CommandLine ( args ) ; FilterVcf filterVcf = null ; try { CommandLineParser . parse ( commandLine , arguments ) ; if ( about . wasFound ( ) ) { About . about ( System . out ) ; System . exit ( 0 ) ; } if ( help . wasFound ( ) ) { Usage . usage ( USAGE , null , commandLine , arguments , System . out ) ; System . exit ( 0 ) ; } filterVcf = new FilterVcf ( new IdFilter ( snpIdFilter . getValue ( ) ) , inputVcfFile . getValue ( ) , outputVcfFile . getValue ( ) ) ; } catch ( CommandLineParseException e ) { if ( about . wasFound ( ) ) { About . about ( System . out ) ; System . exit ( 0 ) ; } if ( help . wasFound ( ) ) { Usage . usage ( USAGE , null , commandLine , arguments , System . out ) ; System . exit ( 0 ) ; } Usage . usage ( USAGE , e , commandLine , arguments , System . err ) ; System . exit ( - 1 ) ; } catch ( NullPointerException e ) { Usage . usage ( USAGE , e , commandLine , arguments , System . err ) ; System . exit ( - 1 ) ; } try { System . exit ( filterVcf . call ( ) ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; System . exit ( 1 ) ; }
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 ) ) { // a new CK is available try it first . _consumerKey = oldCK ; return true ; } OvhCredential token = requestToken ( null ) ; log . info ( "Generating a new ConsumerKey as appKey: {} for account {} valid for {} sec, validationUrl:{}" , this . config . getApplicationKey ( ) , nic , timeInSec , token . validationUrl ) ; Document doc = Jsoup . connect ( token . validationUrl ) . get ( ) ; String html = doc . toString ( ) ; if ( html . contains ( "Too much requests" ) ) return false ; // < input type = " hidden " name = " sT " id = " sT " value = " XXXXX " > Element st = doc . getElementById ( "sT" ) ; FormElement form = null ; // get Parent Form for ( Element elm : st . parents ( ) ) { // " form " . equalsIgnoreCase ( elm . tagName ( ) ) if ( elm instanceof FormElement ) { form = ( FormElement ) elm ; break ; } } Elements inputs = form . select ( "input" ) ; Connection validForm = Jsoup . connect ( token . validationUrl ) ; validForm . followRedirects ( false ) ; // fill user and password field for ( Element e : inputs ) { String name = e . attr ( "name" ) ; String value = e . attr ( "value" ) ; String type = e . attr ( "type" ) ; if ( "text" . equals ( type ) ) value = nic ; else if ( "password" . equals ( type ) ) value = password ; validForm . data ( name , value ) ; } // set Expiration Date validForm . data ( "duration" , Integer . toString ( timeInSec ) ) ; Document doc2 = validForm . post ( ) ; Elements p = doc2 . select ( "p" ) ; String pText = p . text ( ) ; if ( "The document has moved here." . equals ( pText ) ) { log . info ( "a new consumerKey had been issued for {}" , nic ) ; this . setCK ( nic , token . consumerKey ) ; return true ; } if ( "Your token is now valid, you can use it in your application" . equals ( pText ) ) { log . info ( "a new consumerKey had been issued for {}" , nic ) ; this . setCK ( nic , token . consumerKey ) ; return true ; } String error = doc2 . select ( "div.error" ) . text ( ) ; if ( error != null && error . length ( ) > 0 ) log . error ( "Login {} Error:{}" , nic , error ) ; else { String body = doc2 . toString ( ) ; if ( body . contains ( "Too much requests. Please retry in 3 seconds. " ) ) { log . error ( "Too much requests, block all connexion for 3sec, Retry later to connect {}" , nic ) ; ApiOvhUtils . sleep ( 3000 ) ; } else { log . error ( "Unknown Error connecting to {} in body:{}" , nic , body ) ; } } return false ; }
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 > { @ link CmsProperty } < / code > objects * @ throws CmsException if something goes wrong */ public List < CmsProperty > readHistoryPropertyObjects ( CmsDbContext dbc , I_CmsHistoryResource historyResource ) throws CmsException { } }
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 , thisComparator ) } instead . Otherwise , continue to use this method * for now . After the next release of Guava , use { @ code * Streams . stream ( iterable ) . max ( thisComparator ) . get ( ) } instead . Note that these alternatives do * not guarantee which tied maximum element is returned ) * @ param iterable the iterable whose maximum element is to be determined * @ throws NoSuchElementException if { @ code iterable } is empty * @ throws ClassCastException if the parameters are not < i > mutually * comparable < / i > under this ordering . */ @ CanIgnoreReturnValue // TODO ( kak ) : Consider removing this public < E extends T > E max ( Iterable < E > iterable ) { } }
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 . formactionurl_ffc = resource . formactionurl_ffc ; deleteresource . crosssitescripting = resource . crosssitescripting ; deleteresource . formactionurl_xss = resource . formactionurl_xss ; deleteresource . sqlinjection = resource . sqlinjection ; deleteresource . formactionurl_sql = resource . formactionurl_sql ; deleteresource . fieldformat = resource . fieldformat ; deleteresource . formactionurl_ff = resource . formactionurl_ff ; deleteresource . csrftag = resource . csrftag ; deleteresource . csrfformoriginurl = resource . csrfformoriginurl ; deleteresource . xmldoscheck = resource . xmldoscheck ; deleteresource . xmlwsicheck = resource . xmlwsicheck ; deleteresource . xmlattachmentcheck = resource . xmlattachmentcheck ; deleteresource . totalxmlrequests = resource . totalxmlrequests ; return deleteresource . delete_resource ( client ) ;
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 > signerRoles = getSignerRoles ( ) ; for ( int i = 0 ; i < signerRoles . size ( ) ; i ++ ) { String s = signerRoles . get ( i ) ; fields . put ( "signer_roles[" + i + "][name]" , s ) ; if ( getOrderMatters ( ) ) { fields . put ( "signer_roles[" + i + "][order]" , i ) ; } } List < String > ccRoles = getCCRoles ( ) ; for ( int i = 0 ; i < ccRoles . size ( ) ; i ++ ) { String cc = ccRoles . get ( i ) ; fields . put ( "cc_roles[" + i + "]" , cc ) ; } List < Document > docs = getDocuments ( ) ; for ( int i = 0 ; i < docs . size ( ) ; i ++ ) { Document d = docs . get ( i ) ; fields . put ( "file[" + i + "]" , d . getFile ( ) ) ; } List < String > fileUrls = getFileUrls ( ) ; for ( int i = 0 ; i < fileUrls . size ( ) ; i ++ ) { fields . put ( "file_url[" + i + "]" , fileUrls . get ( i ) ) ; } String mergeFieldStr = TemplateDraft . serializeMergeFields ( getMergeFields ( ) ) ; if ( mergeFieldStr != null ) { fields . put ( "merge_fields" , mergeFieldStr ) ; } if ( hasUsePreexistingFields ( ) ) { fields . put ( REQUEST_USE_PREEXISTING_FIELDS , true ) ; } if ( isTestMode ( ) ) { fields . put ( REQUEST_TEST_MODE , true ) ; } } catch ( Exception ex ) { throw new HelloSignException ( "Could not extract form fields from TemplateDraft." , ex ) ; } return fields ;
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 stepCount how many move steps to include in the scroll . Less steps results in a faster scroll */ public void scrollViewToSide ( View view , Side side , float scrollPosition , int stepCount ) { } }
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 , stepCount ) ; else if ( side == Side . RIGHT ) drag ( x , corners [ 0 ] , y , y , stepCount ) ;
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 > > buildingFunction ) { } }
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 commerceNotificationQueueEntry ) { } }
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 changed , { @ code false } otherwise . * @ since TODO add version */ public boolean setDefaultTokenEnabled ( String name , boolean enabled ) { } }
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 . getName ( ) ) ; } else { defaultTokensEnabled . add ( token . getName ( ) ) ; } token . setEnabled ( enabled ) ; saveDefaultTokens ( ) ; return true ; } return false ;
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 * @ return A JSONP formatted byte array * @ throws IllegalArgumentException if the callback method name was missing * or object was null * @ throws JSONException if the object could not be serialized */ public static final byte [ ] serializeToJSONPBytes ( final String callback , final Object object ) { } }
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 ) { throw new JSONException ( 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 output in a nice indented format , or in a compact format . * @ throws IOException Trhown if an error occurs on write . */ private void writeEmptyObject ( Writer writer , int indentDepth , boolean contentOnly , boolean compact ) throws IOException { } }
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 . write ( "\"" + this . objectName + "\"" ) ; writer . write ( " : \"\"" ) ; } } else { if ( ! compact ) { writeIndention ( writer , indentDepth ) ; writer . write ( "\"\"" ) ; } else { writer . write ( "\"\"" ) ; } } if ( logger . isLoggable ( Level . FINER ) ) logger . exiting ( className , "writeEmptyObject(Writer, int, boolean, boolean)" ) ;
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 one succeeds , or none do . * @ param factory * factory which will have external general and parameter entities enabled * or disabled . * @ param enableExternalEntities * if true external entities will be explicitly enabled , otherwise they * will be explicitly disabled . */ protected static void enableOrDisableExternalEntityParsing ( DocumentBuilderFactory factory , boolean enableExternalEntities ) { } }
// 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.apache.org/xerces-j/features.html#external-general-entities" , // Xerces 2 "http://xerces.apache.org/xerces2-j/features.html#external-general-entities" , } ; boolean success = false ; for ( String feature : externalGeneralEntitiesFeatures ) { try { factory . setFeature ( feature , enableExternalEntities ) ; success = true ; break ; } catch ( ParserConfigurationException e ) { } } if ( ! success && failIfExternalEntityParsingCannotBeConfigured ) { throw new XMLBuilderRuntimeException ( new ParserConfigurationException ( "Failed to set 'external-general-entities' feature to " + enableExternalEntities ) ) ; } /* Enable or disable external parameter entities */ String [ ] externalParameterEntitiesFeatures = { // General "http://xml.org/sax/features/external-parameter-entities" , // Xerces 1 "http://xerces.apache.org/xerces-j/features.html#external-parameter-entities" , // Xerces 2 "http://xerces.apache.org/xerces2-j/features.html#external-parameter-entities" , } ; success = false ; for ( String feature : externalParameterEntitiesFeatures ) { try { factory . setFeature ( feature , enableExternalEntities ) ; success = true ; break ; } catch ( ParserConfigurationException e ) { } } if ( ! success && failIfExternalEntityParsingCannotBeConfigured ) { throw new XMLBuilderRuntimeException ( new ParserConfigurationException ( "Failed to set 'external-parameter-entities' feature to " + enableExternalEntities ) ) ; }
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 . * @ sample AmazonEC2 . DescribeVpcEndpointConnections * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / ec2-2016-11-15 / DescribeVpcEndpointConnections " * target = " _ top " > AWS API Documentation < / a > */ @ Override public DescribeVpcEndpointConnectionsResult describeVpcEndpointConnections ( DescribeVpcEndpointConnectionsRequest request ) { } }
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 void onGlInitialization ( ) { } }
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 maxTextureSize = size [ 0 ] ; if ( maxTextureSize <= 0 ) { throw Exceptions . RuntimeAssertion ( "Invalid max texture size %d" , maxTextureSize ) ; } glMaxTextureSize = maxTextureSize ; Log . d ( TAG , "Actual GL_MAX_TEXTURE_SIZE = %d" , glMaxTextureSize ) ; glUninitialized = false ; }
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 ( 300 ) ; last = e ; } catch ( Throwable e ) { throw new ServerWarpExecutionException ( "failed to retrieve a response payloade: " + e . getMessage ( ) , e ) ; } } throw last ;
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 * @ throws IOException */ public void encodeListNullToNull ( Writer writer , List < ? extends T > list ) throws IOException { } }
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 ( writer ) ; writer . flush ( ) ;
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 parseAttributesSheet ( Repository < Entity > attributesRepo , IntermediateParseResults intermediateResults ) { } }
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 , attributesMap , rowIndex ) ; // 2nd pass : set all properties on attribute stubs except for attribute relations rowIndex = 1 ; // Header for ( Entity emxAttrEntity : attributesRepo ) { rowIndex ++ ; parseSingleAttribute ( intermediateResults , attributesMap , rowIndex , emxAttrEntity ) ; } // 3rd pass Map < String , Set < String > > rootAttributes = validateAndCreateAttributeRelationships ( attributesRepo , attributesMap ) ; // store attributes with entities storeAttributes ( intermediateResults , attributesMap , rootAttributes ) ;
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 . addAsManifestResource ( getWebFragmentAsset ( ) , "web-fragment.xml" ) ; archive . addClasses ( REQUIRED_WARP_INNER_CLASSES ) ; // register remote extension archive . addClass ( WarpRemoteExtension . class ) ; archive . addAsServiceProvider ( RemoteLoadableExtension . class . getName ( ) , WarpRemoteExtension . class . getName ( ) , "!org.jboss.arquillian.protocol.servlet.runner.ServletRemoteExtension" ) ; archive . addAsServiceProvider ( LifecycleManagerStore . class , LifecycleManagerStoreImpl . class ) ; // register RequestProcessingDelegationService archive . addAsServiceProvider ( RequestDelegationService . class , CommandBusOnServer . class ) ; return 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 . flush ( ) as needed . OutputStream interceptor = new FilterOutputStream ( pgOutput ) { public void flush ( ) throws IOException { } public void close ( ) throws IOException { super . flush ( ) ; } } ; encodingWriter = encoding . getEncodingWriter ( interceptor ) ;
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 ResourceManagerStartHandler . * @ param runtimeStart An event that signals start of the Driver runtime . * Contains a timestamp and can be pretty printed . */ @ Override public synchronized void onNext ( final RuntimeStart runtimeStart ) { } }
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 ( ReefServiceProtos . RuntimeErrorProto . class , this . evaluatorResourceManagerErrorHandler ) ; this . resourceManagerStatus . setRunning ( ) ; this . driverStatusManager . onRunning ( ) ; // Forward start event to the runtime - specific handler ( e . g . YARN , Local , etc . ) this . resourceManagerStartHandler . onNext ( runtimeStart ) ; LOG . log ( Level . FINEST , "DriverRuntimeStartHandler complete." ) ;
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 occurred: " + e . getMessage ( ) ) ; } } return null ;
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 successfully deleted , otherwise false . */ public boolean deleteTranslation ( final String id , final LocaleId locale ) { } }
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 . fromStatusCode ( response . getStatus ( ) ) ; if ( status == Response . Status . OK ) { final String entity = response . getEntity ( ) ; if ( entity . trim ( ) . length ( ) != 0 ) log . info ( entity ) ; return true ; } else { log . error ( "REST call to deleteResource() did not complete successfully. HTTP response code was " + status . getStatusCode ( ) + ". Reason was " + status . getReasonPhrase ( ) ) ; } } catch ( final Exception ex ) { log . error ( "Failed to delete the Zanata Translation" , ex ) ; } finally { /* * If you are using RESTEasy client framework , and returning a Response from your service method , you will * explicitly need to release the connection . */ if ( response != null ) response . releaseConnection ( ) ; } return false ;
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 ( ) ) ; } return modelRegistry . loadModel ( description ) ; } catch ( Exception ex ) { e = ex ; } } else { try { return this . getClass ( ) . getClassLoader ( ) . loadClass ( className ) ; } catch ( Exception ex ) { e = ex ; } } String message = "The class %s can't be found. The instantiate operation will be ignored." ; message = String . format ( message , className ) ; getLogger ( ) . error ( message ) ; throw new TransformationOperationException ( message , e ) ;
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 ForgeVM . Builder ( ) ) ; f . add ( new StayAwayVM . BuilderReady ( ) ) ; f . add ( new StayAwayVM . BuilderSleeping ( ) ) ; f . add ( new StayAwayVM . BuilderInit ( ) ) ; f . add ( new BootableNode . Builder ( ) ) ; f . add ( new ShutdownableNode . Builder ( ) ) ; return f ;
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 ) { ImmutableFunctionalTerm f = ( ImmutableFunctionalTerm ) term2 ; getNestedConcats ( stb , f . getTerms ( ) . get ( 0 ) , f . getTerms ( ) . get ( 1 ) ) ; } else { stb . append ( appendTerms ( term2 ) ) ; }
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 NullPointerException if the { @ code value } or any of its elements were { @ code null } */ public static < T > T [ ] checkArrayElementsNotNull ( final T [ ] value , final String valueName ) { } }
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 , boolean checkedState ) { } }
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 email_pro_service_account_duration_POST ( String service , String duration , Long number ) throws IOException { } }
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 , OvhOrder . class ) ;
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 . attributesyntaxvalue < i > string _ cellAlignChar < / i > * @ netui : attribute required = " false " rtexprvalue = " true " description = " The cell ' s horizontal alignment character " */ public void setCellChar ( String alignChar ) { } }
_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, retries, data, key1, key2, batchId)" + " values($nextTaskId, '$sys', ?, ?, null, '$status', $now, $nextts, 0, ?, ?, ?, ?)" + " returning taskId" ; sql = sql . replace ( "$nextTaskId" , dbType . sql . sequenceSql ( "SEQ_TEDTASK_ID" ) ) ; sql = sql . replace ( "$now" , dbType . sql . now ( ) ) ; sql = sql . replace ( "$sys" , thisSystem ) ; sql = sql . replace ( "$nextts" , nextts ) ; sql = sql . replace ( "$status" , status . toString ( ) ) ; List < TaskIdRes > resList = selectData ( sqlLogId , sql , TaskIdRes . class , asList ( sqlParam ( name , JetJdbcParamType . STRING ) , sqlParam ( channel , JetJdbcParamType . STRING ) , sqlParam ( data , JetJdbcParamType . STRING ) , sqlParam ( key1 , JetJdbcParamType . STRING ) , sqlParam ( key2 , JetJdbcParamType . STRING ) , sqlParam ( batchId , JetJdbcParamType . LONG ) ) ) ; Long taskId = resList . get ( 0 ) . taskid ; logger . trace ( "Task {} {} created successfully. " , name , taskId ) ; return taskId ;
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 ; try ( CallableStatement callableStatement = getCallableStatement ( sqlContext ) ) { // パラメータ設定 sqlContext . bindParams ( callableStatement ) ; if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( "Execute stored procedure." ) ; watch = new StopWatch ( ) ; watch . start ( ) ; } beforeProcedure ( sqlContext ) ; // デフォルト最大リトライ回数を取得し 、 個別指定 ( SqlContextの値 ) があれば上書き int maxRetryCount = getMaxRetryCount ( ) ; if ( sqlContext . getMaxRetryCount ( ) > 0 ) { maxRetryCount = sqlContext . getMaxRetryCount ( ) ; } // デフォルトリトライ待機時間を取得し 、 個別指定 ( SqlContextの値 ) があれば上書き int retryWaitTime = getRetryWaitTime ( ) ; if ( sqlContext . getRetryWaitTime ( ) > 0 ) { retryWaitTime = sqlContext . getRetryWaitTime ( ) ; } int loopCount = 0 ; do { try { if ( maxRetryCount > 0 && getSqlConfig ( ) . getDialect ( ) . isRollbackToSavepointBeforeRetry ( ) ) { setSavepoint ( RETRY_SAVEPOINT_NAME ) ; } getSqlFilterManager ( ) . doProcedure ( sqlContext , callableStatement , callableStatement . execute ( ) ) ; break ; } catch ( SQLException ex ) { if ( maxRetryCount > 0 && getSqlConfig ( ) . getDialect ( ) . isRollbackToSavepointBeforeRetry ( ) ) { rollback ( RETRY_SAVEPOINT_NAME ) ; } if ( maxRetryCount > loopCount ) { String errorCode = String . valueOf ( ex . getErrorCode ( ) ) ; String sqlState = ex . getSQLState ( ) ; if ( getSqlRetryCodes ( ) . contains ( errorCode ) || getSqlRetryCodes ( ) . contains ( sqlState ) ) { if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( String . format ( "Caught the error code to be retried.(%d times). Retry after %,3d ms." , loopCount + 1 , retryWaitTime ) ) ; } if ( retryWaitTime > 0 ) { try { Thread . sleep ( retryWaitTime ) ; } catch ( InterruptedException ie ) { // do nothing } } } else { throw ex ; } } else { throw ex ; } } finally { if ( maxRetryCount > 0 && getSqlConfig ( ) . getDialect ( ) . isRollbackToSavepointBeforeRetry ( ) ) { releaseSavepoint ( RETRY_SAVEPOINT_NAME ) ; } sqlContext . contextAttrs ( ) . put ( CTX_ATTR_KEY_RETRY_COUNT , loopCount ) ; } } while ( maxRetryCount > loopCount ++ ) ; // 結果取得 return sqlContext . getOutParams ( callableStatement ) ; } catch ( SQLException ex ) { handleException ( sqlContext , ex ) ; } finally { afterProcedure ( sqlContext ) ; if ( LOG . isDebugEnabled ( ) && watch != null ) { watch . stop ( ) ; LOG . debug ( "Stored procedure execution time [{}] : [{}]" , sqlContext . getSqlName ( ) , watch . toString ( ) ) ; } MDC . remove ( SUPPRESS_PARAMETER_LOG_OUTPUT ) ; } return 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 service . * @ throws InvalidParameterValueException * One or more of the specified parameters are invalid . Verify that your parameters are valid and try again . * @ throws InvalidResultTokenException * The specified < code > ResultToken < / code > is invalid . * @ throws NoSuchConfigRuleException * One or more AWS Config rules in the request are invalid . Verify that the rule names are correct and try * again . * @ sample AmazonConfig . PutEvaluations * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / config - 2014-11-12 / PutEvaluations " target = " _ top " > AWS API * Documentation < / a > */ @ Override public PutEvaluationsResult putEvaluations ( PutEvaluationsRequest request ) { } }
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 order . * @ return A method transformer where each method ' s modifiers are adapted to the given modifiers . */ public static Transformer < MethodDescription > withModifiers ( List < ? extends ModifierContributor . ForMethod > modifierContributors ) { } }
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 HTML for all defined widgets of the named dialog ( page ) */ @ Override protected String createDialogHtml ( String 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 ( "<script type=\"text/javascript\">\n" ) ; result . append ( "function download(){\n" ) ; result . append ( "\twindow.open(\"" ) . append ( getJsp ( ) . link ( CmsRequestUtil . appendParameter ( getDownloadPath ( ) , A_CmsOrgUnitDialog . PARAM_OUFQN , getParamOufqn ( ) ) ) ) . append ( "\", \"usecvs\");\n" ) ; result . append ( "}\n" ) ; result . append ( "window.setTimeout(\"download()\",500);\n" ) ; result . append ( "</script>\n" ) ; result . append ( dialogBlockStart ( key ( Messages . GUI_USERDATA_EXPORT_LABEL_HINT_BLOCK_0 ) ) ) ; result . append ( key ( Messages . GUI_USERDATA_DOWNLOAD_LABEL_HINT_TEXT_0 ) ) ; result . append ( " <a href='javascript:download()'>" ) ; result . append ( key ( Messages . GUI_USERDATA_DOWNLOAD_LABEL_HINT_CLICK_0 ) ) ; result . append ( "</a>." ) ; result . append ( dialogBlockEnd ( ) ) ; } result . append ( createWidgetTableEnd ( ) ) ; return result . toString ( ) ;
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_END_VALUE , 0 ) ; if ( highWatermark == 0 ) { highWatermark = Long . parseLong ( Utils . dateTimeToString ( getCurrentTime ( timeZone ) , WATERMARKTIMEFORMAT , timeZone ) ) ; } else { // User specifies SOURCE _ QUERYBASED _ END _ VALUE hasUserSpecifiedHighWatermark = true ; } LOG . info ( "Overriding high water mark with the given end value:" + highWatermark ) ; } else { if ( isSnapshot ( extractType ) ) { highWatermark = this . getSnapshotHighWatermark ( watermarkType ) ; } else { highWatermark = this . getAppendHighWatermark ( extractType ) ; } } return ( highWatermark == 0 ? ConfigurationKeys . DEFAULT_WATERMARK_VALUE : highWatermark ) ;
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 scroll / zoom was missing mMissedMapZoomScrollUpdates ++ ; }
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 * location may not cause an exception . * @ param location a location * @ param packageName a package name * @ param kinds return objects only of these kinds * @ param recurse if true include " subpackages " * @ return an Iterable of file objects matching the given criteria * @ throws IOException if an I / O error occurred , or if { @ link * # close } has been called and this file manager cannot be * reopened * @ throws IllegalStateException if { @ link # close } has been called * and this file manager cannot be reopened */ @ Override public Iterable < JavaFileObject > list ( JavaFileManager . Location location , String packageName , Set < JavaFileObject . Kind > kinds , boolean recurse ) throws IOException { } }
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 Iterator < JavaFileObject > ( ) { boolean stdDone = false ; Iterator < ? extends JavaFileObject > it ; @ Override public boolean hasNext ( ) { if ( it == null ) { it = stdList . iterator ( ) ; } if ( it . hasNext ( ) ) { return true ; } if ( stdDone ) { return false ; } else { stdDone = true ; it = generatedClasses ( ) . iterator ( ) ; return it . hasNext ( ) ; } } @ Override public JavaFileObject next ( ) { if ( ! hasNext ( ) ) { throw new NoSuchElementException ( ) ; } return it . next ( ) ; } } ; } else { return stdList ; }
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 calculate the arc hyperbolic sine for * @ param mathContext the { @ link MathContext } used for the result * @ return the calculated arc hyperbolic sine { @ link BigDecimal } with the precision specified in the < code > mathContext < / code > * @ throws UnsupportedOperationException if the { @ link MathContext } has unlimited precision */ public static BigDecimal asinh ( BigDecimal x , MathContext mathContext ) { } }
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 thrown if the request is rejected by server * @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent */ public void enable ( String jobScheduleId , JobScheduleEnableOptions jobScheduleEnableOptions ) { } }
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 ( UnsupportedEncodingException e ) { furl = url . getPath ( ) ; } file = new File ( furl ) ; try { f = url . openStream ( ) ; } catch ( IOException ignor ) { // Swallow the exception } } } else { try { f = new java . io . FileInputStream ( file ) ; } catch ( FileNotFoundException e ) { // ignore } } if ( f == null ) { fileFound = false ; } else { fileFound = true ; } } finally { try { if ( f != null ) { f . close ( ) ; } } catch ( IOException ioe ) { logger . warn ( "Error closing jobs file " + fileName , ioe ) ; } } if ( ! fileFound ) { if ( failOnFileNotFound ) { throw new SchedulerException ( "File named '" + fileName + "' does not exist." ) ; } else { logger . warn ( "File named '" + fileName + "' does not exist. This is OK if you don't want to use an XML job config file." ) ; } } else { processFile ( fileName ) ; }
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 " ) * " 12345654321" * > > > generate _ demlo _ number ( " 1111 " ) * " 1234321" * > > > generate _ demlo _ number ( " 13333122222 " ) * " 123456789101110987654321" */ public static String generateDemloNumber ( String inputString ) { } }
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 for the tag * @ param body content for the tag * @ return an HtmlTree object for the tag */ public static HtmlTree HEADING ( HtmlTag headingTag , boolean printTitle , HtmlStyle styleClass , Content body ) { } }
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 [ options . size ( ) ] ; for ( int i = 0 ; i < options . size ( ) ; i ++ ) { stringOptions [ i ] = options . get ( i ) . getText ( ) ; } return stringOptions ;
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 ( start , count ) ) ; } @ Override public DataObject object ( ) { return STRUCT . fromMapsAndCollections ( f . map ( ) ) ; } @ Override public DataObject object ( int start , int count ) { return STRUCT . fromMapsAndCollections ( f . map ( start , count ) ) ; } } ;
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 the { @ link BroadcastReceiver } will be * created from * @ param intentFilter the filter for the particular intent * @ param orderedBroadcastAbortStrategy the strategy to use for Ordered Broadcasts * @ return { @ link Observable } of { @ link Intent } that matches the filter */ public static Observable < Intent > fromBroadcast ( Context context , IntentFilter intentFilter , OrderedBroadcastAbortStrategy orderedBroadcastAbortStrategy ) { } }
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 < Void > task : tasks ) { task . get ( ) ; } } catch ( InterruptedException e ) { setErrorStatus ( "Interrupted exception" , e ) ; } catch ( ExecutionException e ) { setErrorStatus ( "Execution exception" , e ) ; } finally { // close the executor sendExecutor . shutdownNow ( ) ; }
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 origin ( inclusive ) of each random value * @ param randomNumberBound the bound ( exclusive ) if each random value * @ return a stream of pseudorandom { @ code long } values , * each with the given origin ( inclusive ) and bound ( exclusive ) * @ throws IllegalArgumentException if { @ code streamSize } is * less than zero , or { @ code randomNumberOrigin } is * greater than or equal to { @ code randomNumberBound } */ @ NotNull public LongStream longs ( long streamSize , final long randomNumberOrigin , final long randomNumberBound ) { } }
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 the type of the returned value * @ return the linked downstream subchannel created for the * given component and ( upstream ) subchannel if it exists */ public static < T extends LinkedIOSubchannel > Optional < T > downstreamChannel ( Manager hub , IOSubchannel upstreamChannel , Class < T > 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 line " + ( propertyIndex + 1 ) , beanParser . getFile ( ) , propertyIndex + 1 ) ;
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 ( ) ; return true ; } }
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 self a Process * @ param output an OutputStream to capture the process stdout * @ return the Thread * @ since 1.5.2 */ public static Thread consumeProcessOutputStream ( Process self , OutputStream output ) { } }
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 comparison * @ throws JSONException JSON parsing error */ public static JSONCompareResult compareJSON ( JSONArray expected , JSONArray actual , JSONComparator comparator ) throws JSONException { } }
return comparator . compareJSON ( expected , actual ) ;