signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class BoxRetentionPolicy { /** * Assigns this retention policy to a metadata template , optionally with certain field values .
* @ param templateID the ID of the metadata template to apply to .
* @ param fieldFilters optional field value filters .
* @ return info about the created assignment . */
public BoxRetentionPolicyAssignment . Info assignToMetadataTemplate ( String templateID , MetadataFieldFilter ... fieldFilters ) { } } | return BoxRetentionPolicyAssignment . createAssignmentToMetadata ( this . getAPI ( ) , this . getID ( ) , templateID , fieldFilters ) ; |
public class Stubs { /** * TODO : as long as the context has no type I need this helper */
public static Syntax loadSyntax ( Object mork , String fileName ) throws GenericException , IllegalLiteral , IOException { } } | return ( ( Mork ) mork ) . loadSyntax ( fileName ) ; |
public class SQLiteQueryBuilder { /** * Verifies that a SQL SELECT statement is valid by compiling it .
* If the SQL statement is not valid , this method will throw a { @ link SQLiteException } . */
private void validateQuerySql ( SQLiteDatabase db , String sql , CancellationSignal cancellationSignal ) { } } | db . getThreadSession ( ) . prepare ( sql , db . getThreadDefaultConnectionFlags ( true /* readOnly */
) , cancellationSignal , null ) ; |
public class LoggerCreator { /** * Create a logger with the given name for the platform .
* < p > The platform logger has the level { @ link Level # ALL } . It override the
* output handlers with handlers for the standard output and standard error .
* The platform logger is a root logger .
* @ return the logger . */
public static Logger createPlatformLogger ( ) { } } | final Logger logger = Logger . getAnonymousLogger ( ) ; for ( final Handler handler : logger . getHandlers ( ) ) { logger . removeHandler ( handler ) ; } final Handler stderr = new StandardErrorOutputConsoleHandler ( ) ; stderr . setLevel ( Level . ALL ) ; final Handler stdout = new StandardOutputConsoleHandler ( ) ; stdout . setLevel ( Level . ALL ) ; logger . addHandler ( stderr ) ; logger . addHandler ( stdout ) ; logger . setUseParentHandlers ( false ) ; logger . setLevel ( Level . ALL ) ; return logger ; |
public class Bag { /** * Retrieve a mapped element and return it as an Integer .
* @ param key A string value used to index the element .
* @ param notFound A function to create a new Integer if the requested key was not found
* @ return The element as an Integer , or notFound if the element is not found . */
public Integer getInteger ( String key , Supplier < Integer > notFound ) { } } | return getParsed ( key , Integer :: new , notFound ) ; |
public class KillbillEventHandler { /** * Killbill server event handler */
@ AllowConcurrentEvents @ Subscribe public void handleSubscriptionEvents ( final BusInternalEvent event ) { } } | final List < CompletionUserRequestNotifier > runningWaiters = new ArrayList < CompletionUserRequestNotifier > ( ) ; synchronized ( activeWaiters ) { runningWaiters . addAll ( activeWaiters ) ; } if ( runningWaiters . size ( ) == 0 ) { return ; } for ( final CompletionUserRequestNotifier cur : runningWaiters ) { cur . onBusEvent ( event ) ; } |
public class UserProfile { /** * Getter for the unique Identifier of the user . If this represents a Full User Profile ( Management API ) the ' id ' field will be returned .
* If the value is not present , it will be considered a User Information and the id will be obtained from the ' sub ' claim .
* @ return the unique identifier of the user . */
public String getId ( ) { } } | if ( id != null ) { return id ; } return getExtraInfo ( ) . containsKey ( "sub" ) ? ( String ) getExtraInfo ( ) . get ( "sub" ) : null ; |
public class Selection { /** * Sort the list in descending order using this algorithm . The run time of this algorithm depends on the
* implementation of the list since it has elements added and removed from it .
* @ param < E > the type of elements in this list .
* @ param list the list that we want to sort */
public static < E extends Comparable < E > > void sortDescending ( List < E > list ) { } } | int index = 0 ; E value = null ; for ( int i = 1 ; i < list . size ( ) ; i ++ ) { index = i ; value = list . remove ( index ) ; while ( index > 0 && value . compareTo ( list . get ( index - 1 ) ) > 0 ) { list . add ( index , list . get ( index - 1 ) ) ; index -- ; } list . add ( index , value ) ; } |
public class ACE { /** * A GUID ( 16 bytes ) that identifies a property set , property , extended right , or type of child object . The purpose
* of this GUID depends on the user rights specified in the Mask field . This field is valid only if the ACE
* _ OBJECT _ TYPE _ PRESENT bit is set in the Flags field . Otherwise , the ObjectType field is ignored . For information
* on access rights and for a mapping of the control access rights to the corresponding GUID value that identifies
* each right , see [ MS - ADTS ] sections 5.1.3.2 and 5.1.3.2.1.
* ACCESS _ MASK bits are not mutually exclusive . Therefore , the ObjectType field can be set in an ACE with any
* ACCESS _ MASK . If the AccessCheck algorithm calls this ACE and does not find an appropriate GUID , then that ACE
* will be ignored . For more information on access checks and object access , see [ MS - ADTS ] section 5.1.3.3.3.
* @ return ObjectType ; null if not available . */
public byte [ ] getObjectType ( ) { } } | return this . objectType == null || this . objectType . length == 0 ? null : Arrays . copyOf ( this . objectType , this . objectType . length ) ; |
public class CmsModuleConfiguration { /** * Will be called when configuration of this object is finished . < p > */
public void initializeFinished ( ) { } } | // create the module manager with the configured modules
m_moduleManager = new CmsModuleManager ( m_modules ) ; if ( CmsLog . INIT . isInfoEnabled ( ) ) { CmsLog . INIT . info ( Messages . get ( ) . getBundle ( ) . key ( Messages . INIT_MODULE_CONFIG_FINISHED_0 ) ) ; } |
public class S3RecoverableFsDataOutputStream { @ Override public RecoverableWriter . ResumeRecoverable persist ( ) throws IOException { } } | lock ( ) ; try { fileStream . flush ( ) ; openNewPartIfNecessary ( userDefinedMinPartSize ) ; // We do not stop writing to the current file , we merely limit the upload to the
// first n bytes of the current file
return upload . snapshotAndGetRecoverable ( fileStream ) ; } finally { unlock ( ) ; } |
public class ContextVector { /** * Normalizes all < code > assocRates < / code > so that their sum is 1 */
public void normalize ( ) { } } | double sum = 0 ; for ( Entry e : entries . values ( ) ) sum += e . getAssocRate ( ) ; if ( sum != 0 ) { for ( Entry e : entries . values ( ) ) e . setAssocRate ( e . getAssocRate ( ) / sum ) ; } setDirty ( ) ; |
public class FeatureTileLinkDao { /** * { @ inheritDoc }
* Update using the complex key */
@ Override public int update ( FeatureTileLink data ) throws SQLException { } } | UpdateBuilder < FeatureTileLink , FeatureTileLinkKey > ub = updateBuilder ( ) ; // Currently there are no non primary values to update
ub . where ( ) . eq ( FeatureTileLink . COLUMN_FEATURE_TABLE_NAME , data . getFeatureTableName ( ) ) . and ( ) . eq ( FeatureTileLink . COLUMN_TILE_TABLE_NAME , data . getTileTableName ( ) ) ; PreparedUpdate < FeatureTileLink > update = ub . prepare ( ) ; int updated = update ( update ) ; return updated ; |
public class KbServerSideException { /** * Converts a Throwable to a KbServerSideException . If the Throwable is a
* KbServerSideException , it will be passed through unmodified ; otherwise , it will be wrapped
* in a new KbServerSideException .
* @ param cause the Throwable to convert
* @ return a KbServerSideException */
public static KbServerSideException fromThrowable ( Throwable cause ) { } } | return ( cause instanceof KbServerSideException ) ? ( KbServerSideException ) cause : new KbServerSideException ( cause ) ; |
public class CancelStepsResult { /** * A list of < a > CancelStepsInfo < / a > , which shows the status of specified cancel requests for each
* < code > StepID < / code > specified .
* @ param cancelStepsInfoList
* A list of < a > CancelStepsInfo < / a > , which shows the status of specified cancel requests for each
* < code > StepID < / code > specified . */
public void setCancelStepsInfoList ( java . util . Collection < CancelStepsInfo > cancelStepsInfoList ) { } } | if ( cancelStepsInfoList == null ) { this . cancelStepsInfoList = null ; return ; } this . cancelStepsInfoList = new com . amazonaws . internal . SdkInternalList < CancelStepsInfo > ( cancelStepsInfoList ) ; |
public class Scenario { /** * Creates a scenario with a single steps class .
* Only creates a single steps instance for all three step types ,
* so no { @ link com . tngtech . jgiven . annotation . ScenarioState } annotations are needed
* to share state between the different steps instances .
* @ param stepsClass the class to use for given , when and then steps
* @ return the new scenario */
public static < STEPS > Scenario < STEPS , STEPS , STEPS > create ( Class < STEPS > stepsClass ) { } } | return new Scenario < STEPS , STEPS , STEPS > ( stepsClass ) ; |
public class MainControl { /** * Get the table name . */
public String getTableNames ( boolean bAddQuotes ) { } } | return ( m_tableName == null ) ? Record . formatTableNames ( MAIN_CONTROL_FILE , bAddQuotes ) : super . getTableNames ( bAddQuotes ) ; |
public class MvtReader { /** * Convenience method for loading MVT from file .
* See { @ link # loadMvt ( InputStream , GeometryFactory , ITagConverter , RingClassifier ) } .
* @ param file path to the MVT
* @ param geomFactory allows for JTS geometry creation
* @ param tagConverter converts MVT feature tags to JTS user data object
* @ param ringClassifier determines how rings are parsed into Polygons and MultiPolygons
* @ return JTS MVT with geometry in MVT coordinates
* @ throws IOException failure reading MVT from path
* @ see # loadMvt ( InputStream , GeometryFactory , ITagConverter , RingClassifier )
* @ see Geometry
* @ see Geometry # getUserData ( )
* @ see RingClassifier */
public static JtsMvt loadMvt ( File file , GeometryFactory geomFactory , ITagConverter tagConverter , RingClassifier ringClassifier ) throws IOException { } } | final JtsMvt jtsMvt ; try ( final InputStream is = new FileInputStream ( file ) ) { jtsMvt = loadMvt ( is , geomFactory , tagConverter , ringClassifier ) ; } return jtsMvt ; |
public class PrototypeObjectFactory { /** * Configures the object with an available Configuration if the object implements Configurable .
* @ param < T > the Class type of the created object .
* @ param object the object / bean to configure .
* @ return the object after configuration .
* @ see # getConfiguration ( )
* @ see # isConfigurationAvailable ( )
* @ see org . cp . elements . lang . Configurable # configure ( Object ) */
@ SuppressWarnings ( "unchecked" ) protected < T > T configure ( final T object ) { } } | if ( object instanceof Configurable && isConfigurationAvailable ( ) ) { ( ( Configurable ) object ) . configure ( getConfiguration ( ) ) ; } return object ; |
public class KinesisDataFetcher { /** * Update the shard to last processed sequence number state .
* This method is called by { @ link ShardConsumer } s .
* @ param shardStateIndex index of the shard to update in subscribedShardsState ;
* this index should be the returned value from
* { @ link KinesisDataFetcher # registerNewSubscribedShardState ( KinesisStreamShardState ) } , called
* when the shard state was registered .
* @ param lastSequenceNumber the last sequence number value to update */
protected final void updateState ( int shardStateIndex , SequenceNumber lastSequenceNumber ) { } } | synchronized ( checkpointLock ) { subscribedShardsState . get ( shardStateIndex ) . setLastProcessedSequenceNum ( lastSequenceNumber ) ; // if a shard ' s state is updated to be SENTINEL _ SHARD _ ENDING _ SEQUENCE _ NUM by its consumer thread ,
// we ' ve finished reading the shard and should determine it to be non - active
if ( lastSequenceNumber . equals ( SentinelSequenceNumber . SENTINEL_SHARD_ENDING_SEQUENCE_NUM . get ( ) ) ) { LOG . info ( "Subtask {} has reached the end of subscribed shard: {}" , indexOfThisConsumerSubtask , subscribedShardsState . get ( shardStateIndex ) . getStreamShardHandle ( ) ) ; // check if we need to mark the source as idle ;
// note that on resharding , if registerNewSubscribedShardState was invoked for newly discovered shards
// AFTER the old shards had reached the end , the subtask ' s status will be automatically toggled back to
// be active immediately afterwards as soon as we collect records from the new shards
if ( this . numberOfActiveShards . decrementAndGet ( ) == 0 ) { LOG . info ( "Subtask {} has reached the end of all currently subscribed shards; marking the subtask as temporarily idle ..." , indexOfThisConsumerSubtask ) ; sourceContext . markAsTemporarilyIdle ( ) ; } } } |
public class FeatureCoreStyleExtension { /** * Delete the style and icon table and row relationships for all feature
* tables */
public void deleteRelationships ( ) { } } | List < String > tables = getTables ( ) ; for ( String table : tables ) { deleteRelationships ( table ) ; } |
public class Introspector { /** * Returns descriptors for all properties of the bean . May return { @ code null } if the information should be obtained
* by automatic analysis .
* @ param beanClass the class to introspect
* @ return an array of { @ code PropertyDescriptor } s describing all properties supported by the bean or { @ code null } */
private static PropertyDescriptor [ ] getPropertyDescriptors ( Class < ? > beanClass ) throws IntrospectionException { } } | BeanInfo beanInfo = java . beans . Introspector . getBeanInfo ( beanClass ) ; return beanInfo . getPropertyDescriptors ( ) ; |
public class RoleGraphLayout { /** * Sets the order of the vertices in the layout according to the ordering
* specified by { @ code comparator } . */
public void setVertexOrder ( Comparator < String > comparator ) { } } | if ( vertex_ordered_list == null ) vertex_ordered_list = new ArrayList < String > ( getGraph ( ) . getVertices ( ) ) ; Collections . sort ( vertex_ordered_list , comparator ) ; |
public class ExecutorInstrumentationBenchmark { /** * This benchmark attempts to measure the performance without any context propagation .
* @ param blackhole a { @ link Blackhole } object supplied by JMH */
@ Benchmark @ BenchmarkMode ( Mode . AverageTime ) @ OutputTimeUnit ( TimeUnit . NANOSECONDS ) @ Fork public void none ( final Blackhole blackhole ) { } } | MoreExecutors . directExecutor ( ) . execute ( new MyRunnable ( blackhole ) ) ; |
public class Force { /** * Update the force if still not reached on horizontal axis .
* @ param extrp The extrapolation value . */
private void updateNotArrivedH ( double extrp ) { } } | if ( fh < fhDest ) { fh += velocity * extrp ; if ( fh > fhDest - sensibility ) { fh = fhDest ; arrivedH = true ; } } else if ( fh > fhDest ) { fh -= velocity * extrp ; if ( fh < fhDest + sensibility ) { fh = fhDest ; arrivedH = true ; } } |
public class NumberExpression { /** * Create a { @ code this * right } expression
* < p > Get the result of the operation this * right < / p >
* @ param right
* @ return this * right */
public < N extends Number & Comparable < N > > NumberExpression < T > multiply ( N right ) { } } | return Expressions . numberOperation ( getType ( ) , Ops . MULT , mixin , ConstantImpl . create ( right ) ) ; |
public class CopyHelpInfo { /** * This is a special method that runs some code when this screen is opened as a task . */
public void copyClassHelp ( ) { } } | Record recClassInfo = this . getMainRecord ( ) ; Record recClassInfo2 = new ClassInfo ( this ) ; recClassInfo2 . setKeyArea ( ClassInfo . CLASS_NAME_KEY ) ; try { recClassInfo . setKeyArea ( ClassInfo . ID_KEY ) ; recClassInfo . close ( ) ; while ( recClassInfo . hasNext ( ) ) { recClassInfo . next ( ) ; String strClassReference = recClassInfo . getField ( ClassInfo . COPY_DESC_FROM ) . toString ( ) ; if ( ( strClassReference != null ) && ( strClassReference . length ( ) > 0 ) ) { recClassInfo2 . getField ( ClassInfo . CLASS_NAME ) . setString ( strClassReference ) ; if ( recClassInfo2 . seek ( null ) ) { recClassInfo . edit ( ) ; if ( ! recClassInfo2 . getField ( ClassInfo . CLASS_DESC ) . isNull ( ) ) recClassInfo . getField ( ClassInfo . CLASS_DESC ) . moveFieldToThis ( recClassInfo2 . getField ( ClassInfo . CLASS_DESC ) ) ; recClassInfo . getField ( ClassInfo . CLASS_EXPLAIN ) . moveFieldToThis ( recClassInfo2 . getField ( ClassInfo . CLASS_EXPLAIN ) ) ; recClassInfo . getField ( ClassInfo . CLASS_HELP ) . moveFieldToThis ( recClassInfo2 . getField ( ClassInfo . CLASS_HELP ) ) ; recClassInfo . set ( ) ; } } } } catch ( DBException ex ) { ex . printStackTrace ( ) ; } finally { recClassInfo2 . free ( ) ; } |
public class AnalyzeSpark { /** * Get the minimum value for the specified column
* @ param allData All data
* @ param columnName Name of the column to get the minimum value for
* @ param schema Schema of the data
* @ return Minimum value for the column */
public static Writable min ( JavaRDD < List < Writable > > allData , String columnName , Schema schema ) { } } | int columnIdx = schema . getIndexOfColumn ( columnName ) ; JavaRDD < Writable > col = allData . map ( new SelectColumnFunction ( columnIdx ) ) ; return col . min ( Comparators . forType ( schema . getType ( columnName ) . getWritableType ( ) ) ) ; |
public class DrizzleConnection { /** * Creates a < code > Statement < / code > object that will generate < code > ResultSet < / code > objects with the given type ,
* concurrency , and holdability . This method is the same as the < code > createStatement < / code > method above , but it
* allows the default result set type , concurrency , and holdability to be overridden .
* @ param resultSetType one of the following < code > ResultSet < / code > constants : < code > ResultSet . TYPE _ FORWARD _ ONLY < / code > ,
* < code > ResultSet . TYPE _ SCROLL _ INSENSITIVE < / code > , or < code > ResultSet . TYPE _ SCROLL _ SENSITIVE < / code >
* @ param resultSetConcurrency one of the following < code > ResultSet < / code > constants : < code > ResultSet . CONCUR _ READ _ ONLY < / code >
* or < code > ResultSet . CONCUR _ UPDATABLE < / code >
* @ param resultSetHoldability one of the following < code > ResultSet < / code > constants : < code > ResultSet . HOLD _ CURSORS _ OVER _ COMMIT < / code >
* or < code > ResultSet . CLOSE _ CURSORS _ AT _ COMMIT < / code >
* @ return a new < code > Statement < / code > object that will generate < code > ResultSet < / code > objects with the given
* type , concurrency , and holdability
* @ throws java . sql . SQLException if a database access error occurs , this method is called on a closed connection or
* the given parameters are not < code > ResultSet < / code > constants indicating type ,
* concurrency , and holdability
* @ throws java . sql . SQLFeatureNotSupportedException
* if the JDBC driver does not support this method or this method is not supported for
* the specified result set type , result set holdability and result set concurrency .
* @ see java . sql . ResultSet
* @ since 1.4 */
public Statement createStatement ( final int resultSetType , final int resultSetConcurrency , final int resultSetHoldability ) throws SQLException { } } | if ( resultSetConcurrency != ResultSet . CONCUR_READ_ONLY ) { throw SQLExceptionMapper . getFeatureNotSupportedException ( "Only read-only result sets allowed" ) ; } if ( resultSetHoldability != ResultSet . HOLD_CURSORS_OVER_COMMIT ) { throw SQLExceptionMapper . getFeatureNotSupportedException ( "Cursors are always kept when sending commit (they are only client-side)" ) ; } return createStatement ( ) ; |
public class AvlTreeIndex { /** * Finds the smallest item in a subtree .
* @ param node The root node of the subtree . */
private V findSmallest ( Node node ) { } } | if ( node == null ) { return null ; } while ( node . left != null ) { node = node . left ; } return node . item ; |
public class AbstractMongoRepository { /** * Returns a query that is selecting documents by ID .
* @ param key the document ' s key
* @ return query Document */
protected Document byId ( final K key ) { } } | if ( key != null ) { return new Document ( ID , key . toString ( ) ) ; } else { throw new NullPointerException ( "Key must not be null" ) ; } |
public class EvernoteClientFactory { /** * Use this method , if you want to download a business note as HTML .
* @ return An async wrapper to load a business note as HTML from the Evernote service . */
public synchronized EvernoteHtmlHelper getHtmlHelperBusiness ( ) throws TException , EDAMUserException , EDAMSystemException { } } | if ( mHtmlHelperBusiness == null ) { authenticateToBusiness ( ) ; mHtmlHelperBusiness = createHtmlHelper ( mBusinessAuthenticationResult . getAuthenticationToken ( ) ) ; } return mHtmlHelperBusiness ; |
public class WorkQueue { /** * Executes the tasks using a thread pool and returns once all tasks have
* finished .
* @ throws IllegalStateException if interrupted while waiting for the tasks
* to finish */
public void run ( Collection < Runnable > tasks ) { } } | // Create a semphore that the wrapped runnables will execute
int numTasks = tasks . size ( ) ; CountDownLatch latch = new CountDownLatch ( numTasks ) ; for ( Runnable r : tasks ) { if ( r == null ) throw new NullPointerException ( "Cannot run null tasks" ) ; workQueue . offer ( new CountingRunnable ( r , latch ) ) ; } try { // Wait until all the tasks have finished
latch . await ( ) ; } catch ( InterruptedException ie ) { throw new IllegalStateException ( "Not all tasks finished" , ie ) ; } |
public class UtilsGraphMath { /** * Calculate circle end ( center point ) for given line ( AB ) with vector algebra : < br >
* - - - - - > < br >
* circle points : < br >
* A - - - - - COB < br >
* Usage code :
* < pre >
* < / pre >
* @ param x1 line start A X
* @ param y1 line start A Y
* @ param x2 line end B X
* @ param y2 line end B Y
* @ param radius of circle
* @ return arrays of calculated circle points :
* < ul >
* < li > line - circle joint point [ C x , C y ] < / li >
* < li >
* circle center point :
* [ O x , O y ] < / li >
* < / ul > */
public static double [ ] [ ] circleEndForLineVectorAlgebra ( double x1 , double y1 , double x2 , double y2 , double radius ) { } } | double [ ] [ ] result = new double [ 2 ] [ ] ; result [ 0 ] = new double [ 2 ] ; result [ 1 ] = new double [ 2 ] ; double [ ] baseVector = { x2 - x1 , y2 - y1 } ; double baseVectorLenght = Math . sqrt ( baseVector [ 0 ] * baseVector [ 0 ] + baseVector [ 1 ] * baseVector [ 1 ] ) ; double [ ] baseUnitVector = { baseVector [ 0 ] / baseVectorLenght , baseVector [ 1 ] / baseVectorLenght } ; // point C :
result [ 0 ] [ 0 ] = x2 - baseUnitVector [ 0 ] * radius * 2 ; result [ 0 ] [ 1 ] = y2 - baseUnitVector [ 1 ] * radius * 2 ; // Point O :
result [ 1 ] [ 0 ] = x2 - baseUnitVector [ 0 ] * radius ; result [ 1 ] [ 1 ] = y2 - baseUnitVector [ 1 ] * radius ; return result ; |
public class URLUtils { /** * Convert URI or chimera references to file paths .
* @ param filename file reference
* @ return file path , { @ code null } if input was { @ code null } */
public static File toFile ( final String filename ) { } } | if ( filename == null ) { return null ; } String f ; try { f = URLDecoder . decode ( filename , UTF8 ) ; } catch ( final UnsupportedEncodingException e ) { throw new RuntimeException ( e ) ; } f = f . replace ( WINDOWS_SEPARATOR , File . separator ) . replace ( UNIX_SEPARATOR , File . separator ) ; return new File ( f ) ; |
public class Transformation2D { /** * Scales the transformation .
* @ param x
* The scale factor in X direction .
* @ param y
* The scale factor in Y direction . */
public void scale ( double x , double y ) { } } | xx *= x ; xy *= x ; xd *= x ; yx *= y ; yy *= y ; yd *= y ; |
public class ArcPath { /** * documentation inherited */
public void paint ( Graphics2D gfx ) { } } | int x = ( int ) ( _center . x - _xradius ) , y = ( int ) ( _center . y - _yradius ) ; int width = ( int ) ( 2 * _xradius ) , height = ( int ) ( 2 * _yradius ) ; int sangle = ( int ) ( Math . round ( 180 * _sangle / Math . PI ) ) , delta = ( int ) ( Math . round ( 180 * _delta / Math . PI ) ) ; gfx . setColor ( Color . blue ) ; gfx . drawRect ( x , y , width - 1 , height - 1 ) ; gfx . setColor ( Color . yellow ) ; gfx . drawArc ( x , y , width - 1 , height - 1 , 0 , 360 ) ; gfx . setColor ( Color . red ) ; gfx . drawArc ( x , y , width - 1 , height - 1 , 360 - sangle , - delta ) ; |
public class AbstractParser { /** * Check to make sure the JSONObject has the specified key and if so return
* the value as a string . If no key is found " " is returned .
* @ param key name of the field to fetch from the json object
* @ param jsonObject object from which to fetch the value
* @ return string value corresponding to the key or null if key not found */
protected String getString ( final String key , final JSONObject jsonObject ) { } } | String value = null ; if ( hasKey ( key , jsonObject ) ) { try { value = jsonObject . getString ( key ) ; } catch ( JSONException e ) { LOGGER . error ( "Could not get String from JSONObject for key: " + key , e ) ; } } return value ; |
public class SpriteParallaxedImpl { /** * SpriteParallaxed */
@ Override public void load ( boolean alpha ) { } } | ImageBuffer surface = Graphics . getImageBuffer ( media ) ; if ( 0 != Double . compare ( factorH , 1.0 ) || 0 != Double . compare ( factorV , 1.0 ) ) { final int x = ( int ) ( surface . getWidth ( ) * factorH ) ; final int y = ( int ) ( surface . getHeight ( ) * factorV ) ; surface = Graphics . resize ( surface , x , y ) ; } lineWidth = ( int ) Math . floor ( surface . getWidth ( ) * sx / 100.0 ) ; lineHeight = ( int ) Math . floor ( surface . getHeight ( ) / ( double ) linesNumber * sy / 100.0 ) ; lines = Graphics . splitImage ( surface , 1 , linesNumber ) ; final double factH = sx / 100.0 / AMPLITUDE_FACTOR ; for ( int i = 0 ; i < linesNumber ; i ++ ) { final int width = ( int ) Math . ceil ( lines [ i ] . getWidth ( ) * ( sx + i * 2 * factH ) / 100 ) ; final int height = lines [ i ] . getHeight ( ) * sy / 100 ; lines [ i ] = Graphics . resize ( lines [ i ] , width , height ) ; } |
public class LineItemSummary { /** * Gets the valueCostPerUnit value for this LineItemSummary .
* @ return valueCostPerUnit * An amount to help the adserver rank inventory . { @ link
* LineItem # valueCostPerUnit } artificially raises the
* value of
* inventory over the { @ link LineItem # costPerUnit } but
* avoids raising
* the actual { @ link LineItem # costPerUnit } . This attribute
* is optional
* and defaults to a { @ link Money } object in the local
* currency with { @ link Money # microAmount } 0. */
public com . google . api . ads . admanager . axis . v201808 . Money getValueCostPerUnit ( ) { } } | return valueCostPerUnit ; |
public class RequestContext { /** * createContext called for every request in the filter */
public static RequestContext get ( ) { } } | if ( CURRENT_CONTEXT . get ( ) == null ) { synchronized ( RequestContext . class ) { if ( CURRENT_CONTEXT . get ( ) == null ) { createContext ( ) ; } } } // ensure that RequestContextV1 is also initialized for this request
RequestContextV1 . get ( ) ; return CURRENT_CONTEXT . get ( ) ; |
public class WCOutputStream31 { /** * @ see javax . servlet . ServletOutputStream # println ( float ) */
public void println ( float f ) throws IOException { } } | if ( this . _listener != null && ! checkIfCalledFromWLonError ( ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "non blocking println float , WriteListener enabled: " + this . _listener ) ; this . println_NonBlocking ( Float . toString ( f ) ) ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "println float" ) ; super . println ( f ) ; } |
public class MainFrame { /** * GEN - LAST : event _ settingsLoadMenuItemActionPerformed */
private void settingsSaveMenuItemActionPerformed ( java . awt . event . ActionEvent evt ) { } } | // GEN - FIRST : event _ settingsSaveMenuItemActionPerformed
if ( settingsFile == null ) { settingsSaveAsMenuItemActionPerformed ( evt ) ; } else { if ( settingsFile . exists ( ) ) { int response = JOptionPane . showConfirmDialog ( this , "Overwrite existing file \"" + settingsFile + "\"?" , "Confirm Overwrite" , JOptionPane . OK_CANCEL_OPTION , JOptionPane . QUESTION_MESSAGE ) ; if ( response == JOptionPane . CANCEL_OPTION ) { settingsSaveAsMenuItemActionPerformed ( evt ) ; return ; } } try { saveSettings ( settingsFile ) ; } catch ( IOException ex ) { Logger . getLogger ( MainFrame . class . getName ( ) ) . log ( Level . SEVERE , "Could not save settings to \"" + settingsFile + "\"" , ex ) ; } } |
public class JBBPTextWriter { /** * Print byte array defined as string .
* @ param value string which codes should be printed as byte array .
* @ return the context
* @ throws IOException it will be thrown for transport error */
public JBBPTextWriter Byte ( final String value ) throws IOException { } } | for ( int i = 0 ; i < value . length ( ) ; i ++ ) { this . Byte ( value . charAt ( i ) ) ; } return this ; |
public class AbstractRedG { /** * Finds a single entity in the list of entities to insert into the database . If multiple entities match the { @ link Predicate } , the entity that was added
* first will be returned .
* @ param type The class of the entity
* @ param filter A predicate that gets called for every entity that has the requested type . Should return { @ code true } only for the entity that should be
* found
* @ param < T > The entity type
* @ return The found entity . If no entity is found an { @ link IllegalArgumentException } gets thrown . */
public < T extends RedGEntity > T findSingleEntity ( final Class < T > type , final Predicate < T > filter ) { } } | return this . entities . stream ( ) . filter ( obj -> Objects . equals ( type , obj . getClass ( ) ) ) . map ( type :: cast ) . filter ( filter ) . findFirst ( ) . orElseThrow ( ( ) -> new IllegalArgumentException ( "Could not find an entity that satisfies the filter!" ) ) ; |
public class OpenBitSet { /** * Returns the popcount or cardinality of the union of the two sets .
* Neither set is modified . */
public static long unionCount ( OpenBitSet a , OpenBitSet b ) { } } | long tot = BitUtil . pop_union ( a . bits , b . bits , 0 , Math . min ( a . wlen , b . wlen ) ) ; if ( a . wlen < b . wlen ) { tot += BitUtil . pop_array ( b . bits , a . wlen , b . wlen - a . wlen ) ; } else if ( a . wlen > b . wlen ) { tot += BitUtil . pop_array ( a . bits , b . wlen , a . wlen - b . wlen ) ; } return tot ; |
public class CodepointHelper { /** * Insert a codepoint into the buffer , automatically dealing with surrogate
* pairs
* @ param aSeq
* source sequence
* @ param nIndex
* index
* @ param nCodepoint
* codepoint to be inserted */
public static void insert ( @ Nonnull final CharSequence aSeq , final int nIndex , final int nCodepoint ) { } } | if ( ! ( aSeq instanceof StringBuilder ) ) { insert ( new StringBuilder ( aSeq ) , nIndex , nCodepoint ) ; } else { int nI = nIndex ; if ( nI > 0 && nI < aSeq . length ( ) ) { final char ch = aSeq . charAt ( nI ) ; final boolean low = Character . isLowSurrogate ( ch ) ; if ( low && Character . isHighSurrogate ( aSeq . charAt ( nI - 1 ) ) ) { nI -- ; } } ( ( StringBuilder ) aSeq ) . insert ( nI , Character . toChars ( nCodepoint ) ) ; } |
public class RuntimeManagerMain { /** * Before continuing to the action logic , verify :
* - the topology is running
* - the information in execution state matches the request
* There is an edge case that the topology data could be only partially available ,
* which could be caused by not fully successful SUBMIT or KILL command . In this
* case , we need to skip the validation and allow KILL command to go through .
* In case execution state data is available , environment check will be done anyway .
* @ return true if the topology execution data is found , false otherwise . */
protected boolean validateRuntimeManage ( SchedulerStateManagerAdaptor adaptor , String topologyName ) throws TopologyRuntimeManagementException { } } | // Check whether the topology has already been running
Boolean isTopologyRunning = adaptor . isTopologyRunning ( topologyName ) ; boolean hasExecutionData = isTopologyRunning != null && isTopologyRunning . equals ( Boolean . TRUE ) ; if ( ! hasExecutionData ) { if ( command == Command . KILL ) { LOG . warning ( String . format ( "Topology '%s' is not found or not running" , topologyName ) ) ; } else { throw new TopologyRuntimeManagementException ( String . format ( "Topology '%s' does not exist" , topologyName ) ) ; } } // Check whether cluster / role / environ matched if execution state data is available .
ExecutionEnvironment . ExecutionState executionState = adaptor . getExecutionState ( topologyName ) ; if ( executionState == null ) { if ( command == Command . KILL ) { LOG . warning ( String . format ( "Topology execution state for '%s' is not found" , topologyName ) ) ; } else { throw new TopologyRuntimeManagementException ( String . format ( "Failed to get execution state for topology %s" , topologyName ) ) ; } } else { // Execution state is available , validate configurations .
validateExecutionState ( topologyName , executionState ) ; } return hasExecutionData ; |
public class PositionManager { /** * This method locates the position set element in the child list of the passed in plfParent or
* if not found it will create one automatically and return it if the passed in create flag is
* true . */
private static Element getPositionSet ( Element plfParent , IPerson person , boolean create ) throws PortalException { } } | Node child = plfParent . getFirstChild ( ) ; while ( child != null ) { if ( child . getNodeName ( ) . equals ( Constants . ELM_POSITION_SET ) ) return ( Element ) child ; child = child . getNextSibling ( ) ; } if ( create == false ) return null ; String ID = null ; try { ID = getDLS ( ) . getNextStructDirectiveId ( person ) ; } catch ( Exception e ) { throw new PortalException ( "Exception encountered while " + "generating new position set node " + "Id for userId=" + person . getID ( ) , e ) ; } Document plf = plfParent . getOwnerDocument ( ) ; Element positions = plf . createElement ( Constants . ELM_POSITION_SET ) ; positions . setAttribute ( Constants . ATT_TYPE , Constants . ELM_POSITION_SET ) ; positions . setAttribute ( Constants . ATT_ID , ID ) ; plfParent . appendChild ( positions ) ; return positions ; |
public class KeyValueDatabase { /** * Tokenizes lookup fields and returns all matching buckets in the
* index . */
private List < Bucket > lookup ( Record record ) { } } | List < Bucket > buckets = new ArrayList ( ) ; for ( Property p : config . getLookupProperties ( ) ) { String propname = p . getName ( ) ; Collection < String > values = record . getValues ( propname ) ; if ( values == null ) continue ; for ( String value : values ) { String [ ] tokens = StringUtils . split ( value ) ; for ( int ix = 0 ; ix < tokens . length ; ix ++ ) { Bucket b = store . lookupToken ( propname , tokens [ ix ] ) ; if ( b == null || b . records == null ) continue ; long [ ] ids = b . records ; if ( DEBUG ) System . out . println ( propname + ", " + tokens [ ix ] + ": " + b . nextfree + " (" + b . getScore ( ) + ")" ) ; buckets . add ( b ) ; } } } return buckets ; |
public class HBaseClientTemplate { /** * Execute a Get on HBase , creating the Get from the key ' s toByteArray method .
* The returned Result of the Get will be mapped to an entity with the
* entityMapper , and that entity will be returned .
* Any GetModifers registered with registerGetModifier will be invoked before
* the Get is executed .
* @ param key
* The StorageKey to create a Get from .
* @ param entityMapper
* The EntityMapper to use to map the Result to an entity to return .
* @ return The entity created by the entityMapper . */
public < E > E get ( PartitionKey key , EntityMapper < E > entityMapper ) { } } | return get ( key , null , entityMapper ) ; |
public class CompiledFEELSemanticMappings { /** * Implements a negated exists .
* Returns < strong > false < / strong > when at least one of the elements of the list
* < strong > matches < / strong > the target .
* The list may contain both objects ( equals ) and UnaryTests ( apply ) */
public static Boolean notExists ( EvaluationContext ctx , List tests , Object target ) { } } | for ( Object test : tests ) { Boolean r = applyUnaryTest ( ctx , test , target ) ; if ( r == null || r ) { return false ; } } return true ; |
public class AbstractAccessControlProvider { /** * Recursive implementation of { @ link # collectAccessControls ( String , Set ) } for { @ link AccessControlGroup } s .
* @ param group is the { @ link AccessControlGroup } to traverse .
* @ param permissions is the { @ link Set } used to collect . */
public void collectPermissionNodes ( AccessControlGroup group , Set < AccessControl > permissions ) { } } | boolean added = permissions . add ( group ) ; if ( ! added ) { // we have already visited this node , stop recursion . . .
return ; } for ( AccessControlPermission permission : group . getPermissions ( ) ) { permissions . add ( permission ) ; } for ( AccessControlGroup inheritedGroup : group . getInherits ( ) ) { collectPermissionNodes ( inheritedGroup , permissions ) ; } |
public class CmsClientSitemapEntry { /** * Updates all the children positions starting from the given position . < p >
* @ param position the position to start with */
private void updatePositions ( int position ) { } } | for ( int i = position ; i < m_subEntries . size ( ) ; i ++ ) { m_subEntries . get ( i ) . setPosition ( i ) ; } |
public class GwtMockito { /** * Specifies that the given provider should be used to GWT . create instances of
* the given type and its subclasses . If multiple providers could produce a
* given class ( for example , if a provide is registered for a type and its
* supertype ) , the provider for the more specific type is chosen . An exception
* is thrown if this type is ambiguous . Note that if you just want to return a
* Mockito mock from GWT . create , it ' s probably easier to use { @ link GwtMock }
* instead . */
public static void useProviderForType ( Class < ? > type , FakeProvider < ? > provider ) { } } | if ( bridge == null ) { throw new IllegalStateException ( "Must call initMocks() before calling useProviderForType()" ) ; } if ( bridge . registeredMocks . containsKey ( type ) ) { throw new IllegalArgumentException ( "Can't use a provider for a type that already has a @GwtMock declared" ) ; } bridge . registeredProviders . put ( type , provider ) ; |
public class ConfigurationProviderBuilder { /** * Build a { @ link ConfigurationProvider } using this builder ' s configuration .
* @ return new { @ link ConfigurationProvider } */
public ConfigurationProvider build ( ) { } } | LOG . info ( "Initializing ConfigurationProvider with " + configurationSource . getClass ( ) . getCanonicalName ( ) + " source, " + reloadStrategy . getClass ( ) . getCanonicalName ( ) + " reload strategy and " + environment . getClass ( ) . getCanonicalName ( ) + " environment" ) ; final CachedConfigurationSource cachedConfigurationSource = new CachedConfigurationSource ( configurationSource ) ; if ( metricRegistry != null ) { configurationSource = new MeteredConfigurationSource ( metricRegistry , prefix , cachedConfigurationSource ) ; } cachedConfigurationSource . init ( ) ; Reloadable reloadable = ( ) -> cachedConfigurationSource . reload ( environment ) ; if ( metricRegistry != null ) { reloadable = new MeteredReloadable ( metricRegistry , prefix , reloadable ) ; } reloadable . reload ( ) ; reloadStrategy . register ( reloadable ) ; SimpleConfigurationProvider configurationProvider = new SimpleConfigurationProvider ( cachedConfigurationSource , environment ) ; if ( metricRegistry != null ) { return new MeteredConfigurationProvider ( metricRegistry , prefix , configurationProvider ) ; } return configurationProvider ; |
public class Cache { /** * 返回有序集 key 中 , score 值在 min 和 max 之间 ( 默认包括 score 值等于 min 或 max ) 的成员的数量 。
* 关于参数 min 和 max 的详细使用方法 , 请参考 ZRANGEBYSCORE 命令 。 */
public Long zcount ( Object key , double min , double max ) { } } | Jedis jedis = getJedis ( ) ; try { return jedis . zcount ( keyToBytes ( key ) , min , max ) ; } finally { close ( jedis ) ; } |
public class ReqUtil { /** * Remove a named session attribute .
* @ param attrName Name of the attribute */
public void removeSessionAttr ( final String attrName ) { } } | final HttpSession sess = request . getSession ( false ) ; if ( sess == null ) { return ; } sess . removeAttribute ( attrName ) ; |
public class CmsSetNextRule { /** * Process the end of this element . < p >
* @ param namespace the namespace URI of the matching element , or an empty string if the parser is not namespace
* aware or the element has no namespace
* @ param name the local name if the parser is namespace aware , or just the element name otherwise
* @ throws Exception if something goes wrong */
@ Override public void end ( String namespace , String name ) throws Exception { } } | // Determine the target object for the method call : the parent object
Object parent = getDigester ( ) . peek ( 1 ) ; Object child = getDigester ( ) . peek ( 0 ) ; // Retrieve or construct the parameter values array
Object [ ] parameters = null ; if ( m_paramCount > 0 ) { parameters = getDigester ( ) . popParams ( ) ; if ( LOG . isTraceEnabled ( ) ) { for ( int i = 0 , size = parameters . length ; i < size ; i ++ ) { LOG . trace ( "[SetNextRuleWithParams](" + i + ")" + parameters [ i ] ) ; } } // In the case where the target method takes a single parameter
// and that parameter does not exist ( the CallParamRule never
// executed or the CallParamRule was intended to set the parameter
// from an attribute but the attribute wasn ' t present etc ) then
// skip the method call .
// This is useful when a class has a " default " value that should
// only be overridden if data is present in the XML . I don ' t
// know why this should only apply to methods taking * one *
// parameter , but it always has been so we can ' t change it now .
if ( ( m_paramCount == 1 ) && ( parameters [ 0 ] == null ) ) { return ; } } else if ( m_paramTypes . length != 0 ) { // Having paramCount = = 0 and paramTypes . length = = 1 indicates
// that we have the special case where the target method has one
// parameter being the body text of the current element .
// There is no body text included in the source XML file ,
// so skip the method call
if ( m_bodyText == null ) { return ; } parameters = new Object [ 1 ] ; parameters [ 0 ] = m_bodyText ; if ( m_paramTypes . length == 0 ) { m_paramTypes = new Class [ 1 ] ; m_paramTypes [ 0 ] = String . class ; } } else { // When paramCount is zero and paramTypes . length is zero it
// means that we truly are calling a method with no parameters .
// Nothing special needs to be done here .
parameters = new Object [ 0 ] ; } // Construct the parameter values array we will need
// We only do the conversion if the param value is a String and
// the specified paramType is not String .
Object [ ] paramValues = new Object [ m_paramTypes . length ] ; Class < ? > propertyClass = child . getClass ( ) ; for ( int i = 0 ; i < m_paramTypes . length ; i ++ ) { if ( m_paramTypes [ i ] == propertyClass ) { // implant the original child to set if Class matches :
paramValues [ i ] = child ; } else if ( ( parameters [ i ] == null ) || ( ( parameters [ i ] instanceof String ) && ! String . class . isAssignableFrom ( m_paramTypes [ i ] ) ) ) { // convert nulls and convert stringy parameters
// for non - stringy param types
if ( parameters [ i ] == null ) { paramValues [ i ] = null ; } else { paramValues [ i ] = ConvertUtils . convert ( ( String ) parameters [ i ] , m_paramTypes [ i ] ) ; } } else { paramValues [ i ] = parameters [ i ] ; } } if ( parent == null ) { StringBuffer sb = new StringBuffer ( ) ; sb . append ( "[SetNextRuleWithParams]{" ) ; sb . append ( getDigester ( ) . getMatch ( ) ) ; sb . append ( "} Call target is null (" ) ; sb . append ( "targetOffset=" ) ; sb . append ( m_targetOffset ) ; sb . append ( ",stackdepth=" ) ; sb . append ( getDigester ( ) . getCount ( ) ) ; sb . append ( ")" ) ; throw new org . xml . sax . SAXException ( sb . toString ( ) ) ; } // Invoke the required method on the top object
if ( LOG . isDebugEnabled ( ) ) { StringBuffer sb = new StringBuffer ( "[SetNextRuleWithParams]{" ) ; sb . append ( getDigester ( ) . getMatch ( ) ) ; sb . append ( "} Call " ) ; sb . append ( parent . getClass ( ) . getName ( ) ) ; sb . append ( "." ) ; sb . append ( m_methodName ) ; sb . append ( "(" ) ; for ( int i = 0 ; i < paramValues . length ; i ++ ) { if ( i > 0 ) { sb . append ( "," ) ; } if ( paramValues [ i ] == null ) { sb . append ( "null" ) ; } else { sb . append ( paramValues [ i ] . toString ( ) ) ; } sb . append ( "/" ) ; if ( m_paramTypes [ i ] == null ) { sb . append ( "null" ) ; } else { sb . append ( m_paramTypes [ i ] . getName ( ) ) ; } } sb . append ( ")" ) ; LOG . debug ( sb . toString ( ) ) ; } Object result = null ; if ( m_useExactMatch ) { // invoke using exact match
result = MethodUtils . invokeExactMethod ( parent , m_methodName , paramValues , m_paramTypes ) ; } else { // invoke using fuzzier match
result = MethodUtils . invokeMethod ( parent , m_methodName , paramValues , m_paramTypes ) ; } processMethodCallResult ( result ) ; |
public class SerializationUtils { /** * Deserialize a JSON string , with custom class loader .
* @ param jsonString
* @ param clazz
* @ return */
public static < T > T fromJsonString ( String jsonString , Class < T > clazz , ClassLoader classLoader ) { } } | if ( jsonString == null ) { return null ; } ClassLoader oldClassLoader = Thread . currentThread ( ) . getContextClassLoader ( ) ; if ( classLoader != null ) { Thread . currentThread ( ) . setContextClassLoader ( classLoader ) ; } try { ObjectMapper mapper = poolMapper . borrowObject ( ) ; if ( mapper != null ) { try { return mapper . readValue ( jsonString , clazz ) ; } finally { poolMapper . returnObject ( mapper ) ; } } throw new DeserializationException ( "No ObjectMapper instance avaialble!" ) ; } catch ( Exception e ) { throw e instanceof DeserializationException ? ( DeserializationException ) e : new DeserializationException ( e ) ; } finally { Thread . currentThread ( ) . setContextClassLoader ( oldClassLoader ) ; } |
public class IsoRecurrence { /** * / * [ deutsch ]
* < p > Erzeugt einen geordneten { @ code Stream } von wiederkehrenden Intervallen . < / p >
* @ return Stream
* @ since 4.18
* @ see Spliterator # DISTINCT
* @ see Spliterator # IMMUTABLE
* @ see Spliterator # NONNULL
* @ see Spliterator # ORDERED
* @ see Spliterator # SIZED
* @ see Spliterator # SUBSIZED */
public Stream < I > intervalStream ( ) { } } | long size = ( this . isInfinite ( ) ? Long . MAX_VALUE : this . getCount ( ) ) ; int characteristics = DISTINCT | IMMUTABLE | NONNULL | ORDERED | SIZED | SUBSIZED ; Spliterator < I > spliterator = Spliterators . spliterator ( this . iterator ( ) , size , characteristics ) ; return StreamSupport . stream ( spliterator , false ) ; |
public class AccessOrderDeque { /** * A fast - path containment check */
boolean contains ( AccessOrder < ? > e ) { } } | return ( e . getPreviousInAccessOrder ( ) != null ) || ( e . getNextInAccessOrder ( ) != null ) || ( e == first ) ; |
public class AnnualCalendar { /** * Redefine the list of days excluded . The ArrayList should contain
* < code > Calendar < / code > objects . */
public void setDaysExcluded ( final ArrayList < Calendar > days ) { } } | if ( days == null ) { m_aExcludeDays = new ArrayList < > ( ) ; } else { m_aExcludeDays = days ; } m_bDataSorted = false ; |
public class TableModel { /** * Start add a foreign key definition in DDL , detail usage see demo */
public FKeyModel fkey ( ) { } } | checkReadOnly ( ) ; FKeyModel fkey = new FKeyModel ( ) ; fkey . setTableName ( this . tableName ) ; fkey . setTableModel ( this ) ; getFkeyConstraints ( ) . add ( fkey ) ; return fkey ; |
public class PriorityBlockingQueue { /** * Inserts item x at position k , maintaining heap invariant by
* promoting x up the tree until it is greater than or equal to
* its parent , or is the root .
* To simplify and speed up coercions and comparisons . the
* Comparable and Comparator versions are separated into different
* methods that are otherwise identical . ( Similarly for siftDown . )
* These methods are static , with heap state as arguments , to
* simplify use in light of possible comparator exceptions .
* @ param k the position to fill
* @ param x the item to insert
* @ param array the heap array */
private static < T > void siftUpComparable ( int k , T x , Object [ ] array ) { } } | Comparable < ? super T > key = ( Comparable < ? super T > ) x ; while ( k > 0 ) { int parent = ( k - 1 ) >>> 1 ; Object e = array [ parent ] ; if ( key . compareTo ( ( T ) e ) >= 0 ) break ; array [ k ] = e ; k = parent ; } array [ k ] = key ; |
public class Messenger { /** * MUST be called on conversation open
* @ param peer conversation ' s peer */
@ ObjectiveCName ( "onConversationOpenWithPeer:" ) public void onConversationOpen ( @ NotNull Peer peer ) { } } | modules . getEvents ( ) . post ( new PeerChatOpened ( peer ) ) ; |
public class AbstractRestClient { /** * Add HTTP Basic Auth header
* @ param headersthe headers , it must not be a read - only one , if it is , use { @ link # copy ( HttpHeaders ) } to make a writable copy first
* @ param keythe API key */
protected void addBasicAuthHeader ( HttpHeaders headers , String key ) { } } | headers . add ( HEADER_AUTHORIZATION , buildBasicAuthValue ( key ) ) ; |
public class CmsWorkplaceEditorManager { /** * Checks if there is an editor which can process the given resource . < p >
* @ param res the resource
* @ return true if the given resource can be edited with one of the configured editors */
public boolean isEditorAvailableForResource ( CmsResource res ) { } } | I_CmsResourceType type = OpenCms . getResourceManager ( ) . getResourceType ( res ) ; String typeName = type . getTypeName ( ) ; for ( CmsWorkplaceEditorConfiguration editorConfig : m_editorConfigurations ) { if ( editorConfig . matchesResourceType ( typeName ) ) { return true ; } } return false ; |
public class OptionResolver { /** * Resolves an " options " configuration section from component configuration
* parameters .
* @ param config configuration parameters
* @ param configAsDefault ( optional ) When set true the method returns the entire
* parameter set when " options " section is not found .
* Default : false
* @ return configuration parameters from " options " section */
public static ConfigParams resolve ( ConfigParams config , boolean configAsDefault ) { } } | ConfigParams options = config . getSection ( "options" ) ; if ( options . size ( ) == 0 && configAsDefault ) options = config ; return options ; |
public class CharsetEncoder { /** * Tells whether or not the given byte array is a legal replacement value
* for this encoder .
* < p > A replacement is legal if , and only if , it is a legal sequence of
* bytes in this encoder ' s charset ; that is , it must be possible to decode
* the replacement into one or more sixteen - bit Unicode characters .
* < p > The default implementation of this method is not very efficient ; it
* should generally be overridden to improve performance . < / p >
* @ param repl The byte array to be tested
* @ return < tt > true < / tt > if , and only if , the given byte array
* is a legal replacement value for this encoder */
public boolean isLegalReplacement ( byte [ ] repl ) { } } | /* J2ObjC : Removed use of WeakReference .
WeakReference < CharsetDecoder > wr = cachedDecoder ;
CharsetDecoder dec = null ;
if ( ( wr = = null ) | | ( ( dec = wr . get ( ) ) = = null ) ) { */
CharsetDecoder dec = cachedDecoder ; if ( dec == null ) { dec = charset ( ) . newDecoder ( ) ; dec . onMalformedInput ( CodingErrorAction . REPORT ) ; dec . onUnmappableCharacter ( CodingErrorAction . REPORT ) ; // cachedDecoder = new WeakReference < CharsetDecoder > ( dec ) ;
cachedDecoder = dec ; } else { dec . reset ( ) ; } ByteBuffer bb = ByteBuffer . wrap ( repl ) ; CharBuffer cb = CharBuffer . allocate ( ( int ) ( bb . remaining ( ) * dec . maxCharsPerByte ( ) ) ) ; CoderResult cr = dec . decode ( bb , cb , true ) ; return ! cr . isError ( ) ; |
public class AbstractGraphCanvas { /** * Updates the upper value on the x - axis . */
private void updateUpperXValue ( ) { } } | double upper = 1.0 ; if ( this . measures != null ) { upper = max_x_value * ( 1 + ( 0.1 / x_resolution ) ) ; } this . axesPanel . setUpperXValue ( upper ) ; this . plotPanel . setUpperXValue ( upper ) ; |
public class SimpleLock { /** * Execute the provided runnable in a read lock .
* @ param aRunnable
* Runnable to be executed . May not be < code > null < / code > .
* @ throws EXTYPE
* If the callable throws the exception
* @ param < EXTYPE >
* Exception type to be thrown */
public < EXTYPE extends Exception > void lockedThrowing ( @ Nonnull final IThrowingRunnable < EXTYPE > aRunnable ) throws EXTYPE { } } | ValueEnforcer . notNull ( aRunnable , "Runnable" ) ; lock ( ) ; try { aRunnable . run ( ) ; } finally { unlock ( ) ; } |
public class ValidationError { /** * A description of the validation error .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setErrors ( java . util . Collection ) } or { @ link # withErrors ( java . util . Collection ) } if you want to override the
* existing values .
* @ param errors
* A description of the validation error .
* @ return Returns a reference to this object so that method calls can be chained together . */
public ValidationError withErrors ( String ... errors ) { } } | if ( this . errors == null ) { setErrors ( new com . amazonaws . internal . SdkInternalList < String > ( errors . length ) ) ; } for ( String ele : errors ) { this . errors . add ( ele ) ; } return this ; |
public class JAXBCommandLine { /** * Overrides getValue so that also config file values are returned .
* @ param name
* @ return */
@ Override public Object getValue ( String name ) { } } | Object value = super . getValue ( name ) ; if ( value != null ) { return value ; } else { return configMap . get ( name ) ; } |
public class OffHeapBufferStorageEngine { /** * Future design ideas :
* We might want to look in to supporting shrinking of the data areas , in case
* our storage demands change ( e . g . due to a change in key distribution , or
* change in value types ) . */
public static < K , V > Factory < OffHeapBufferStorageEngine < K , V > > createFactory ( final PointerSize width , final PageSource source , final int pageSize , final Portability < ? super K > keyPortability , final Portability < ? super V > valuePortability , final boolean thief , final boolean victim ) { } } | return ( ) -> new OffHeapBufferStorageEngine < > ( width , source , pageSize , keyPortability , valuePortability , thief , victim ) ; |
public class RingBufferBundler { /** * Iterate through the following messages and find messages to the same destination ( dest ) and write them to output */
protected int marshalMessagesToSameDestination ( Address dest , Message [ ] buf , int start_index , final int end_index , int max_bundle_size ) throws Exception { } } | int num_msgs = 0 , bytes = 0 ; for ( ; ; ) { Message msg = buf [ start_index ] ; if ( msg != null && Objects . equals ( dest , msg . dest ( ) ) ) { long size = msg . size ( ) ; if ( bytes + size > max_bundle_size ) break ; bytes += size ; num_msgs ++ ; buf [ start_index ] = null ; msg . writeToNoAddrs ( msg . src ( ) , output , transport . getId ( ) ) ; } if ( start_index == end_index ) break ; start_index = advance ( start_index ) ; } return num_msgs ; |
public class AbstractCommandLineRunner { /** * Creates a file containing the current module graph in JSON serialization . */
@ GwtIncompatible ( "Unnecessary" ) private void outputModuleGraphJson ( ) throws IOException { } } | if ( config . outputModuleDependencies != null && config . outputModuleDependencies . length ( ) != 0 ) { try ( Writer out = fileNameToOutputWriter2 ( config . outputModuleDependencies ) ) { printModuleGraphJsonTo ( out ) ; } } |
public class ApiOvhDbaaslogs { /** * Returns the member metadata
* REST : GET / dbaas / logs / { serviceName } / role / { roleId } / member / { username }
* @ param serviceName [ required ] Service name
* @ param roleId [ required ] Role ID
* @ param username [ required ] Username */
public OvhMember serviceName_role_roleId_member_username_GET ( String serviceName , String roleId , String username ) throws IOException { } } | String qPath = "/dbaas/logs/{serviceName}/role/{roleId}/member/{username}" ; StringBuilder sb = path ( qPath , serviceName , roleId , username ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , OvhMember . class ) ; |
public class Validator { /** * Validate a given jPDL process definition against the applicable definition language ' s schema .
* @ param def
* The process definition , in { @ link Document } format .
* @ param language
* The process definition language for which the given definition is to be validated .
* @ return Whether the validation was successful . */
static boolean validateDefinition ( final Document def , final ProcessLanguage language ) { } } | return XmlUtils . validate ( new DOMSource ( def ) , language . getSchemaSources ( ) ) ; |
public class TableSession { /** * A record with this datasource handle changed , notify any behaviors that are checking .
* NOTE : Be very careful as this code is running in an independent thread
* ( synchronize to the task before calling record calls ) .
* NOTE : For now , you are only notified of the main record changes . */
public int handleMessage ( BaseMessage message ) { } } | Record record = this . getMainRecord ( ) ; // Record changed
if ( ( record . getTable ( ) instanceof GridTable ) // Always except HTML
&& ( message . getMessageHeader ( ) != null ) && ( message . getMessageHeader ( ) instanceof RecordMessageHeader ) ) { int iIndex = - 1 ; synchronized ( this . getTask ( ) ) { iIndex = ( ( GridTable ) record . getTable ( ) ) . updateGridToMessage ( message , true , true ) ; } if ( iIndex != - 1 ) { // This screen has changed , add this clue so a remote thin table will know where the change was .
message . put ( ModelMessageHandler . START_INDEX_PARAM , Integer . toString ( iIndex ) ) ; } } return super . handleMessage ( message ) ; |
public class Segment { /** * Moves { @ code byteCount } bytes from this segment to { @ code sink } . */
public void writeTo ( Segment sink , int byteCount ) { } } | if ( ! sink . owner ) throw new IllegalArgumentException ( ) ; if ( sink . limit + byteCount > SIZE ) { // We can ' t fit byteCount bytes at the sink ' s current position . Shift sink first .
if ( sink . shared ) throw new IllegalArgumentException ( ) ; if ( sink . limit + byteCount - sink . pos > SIZE ) throw new IllegalArgumentException ( ) ; System . arraycopy ( sink . data , sink . pos , sink . data , 0 , sink . limit - sink . pos ) ; sink . limit -= sink . pos ; sink . pos = 0 ; } System . arraycopy ( data , pos , sink . data , sink . limit , byteCount ) ; sink . limit += byteCount ; pos += byteCount ; |
public class Application { /** * Return the project stage for the currently running application instance . The default value is < code >
* { @ link ProjectStage # Production } < / code >
* The implementation of this method must perform the following algorithm or an equivalent with the same end result
* to determine the value to return .
* < ul >
* < li > If the value has already been determined by a previous call to this method , simply return that value . < / li >
* < li > Look for a < code > JNDI < / code > environment entry under the key given by the value of
* < code > { @ link ProjectStage # PROJECT _ STAGE _ JNDI _ NAME } < / code > ( return type of java . lang . String ) . If found , continue
* with the algorithm below , otherwise , look for an entry in the < code > initParamMap < / code > of the
* < code > ExternalContext < / code > from the current < code > FacesContext < / code > with the key
* < code > { @ link ProjectStage # PROJECT _ STAGE _ PARAM _ NAME } < / code > < / li >
* < li > If a value is found found , see if an enum constant can be obtained by calling
* < code > ProjectStage . valueOf ( ) < / code > , passing the value from the < code > initParamMap < / code > . If this succeeds
* without exception , save the value and return it . < / li >
* < li > If not found , or any of the previous attempts to discover the enum constant value have failed , log a
* descriptive error message , assign the value as < code > ProjectStage . Production < / code > and return it . < / li >
* < / ul >
* @ since 2.0 */
public ProjectStage getProjectStage ( ) { } } | Application application = getMyfacesApplicationInstance ( ) ; if ( application != null ) { return application . getProjectStage ( ) ; } throw new UnsupportedOperationException ( ) ; |
public class GeoHash { /** * Returns a String of lines of hashes to represent the relative positions
* of hashes on a map . The grid is of height and width 2 * size centred around
* the given hash . Highlighted hashes are displayed in upper case . For
* example , gridToString ( " dr " , 1 , Collections . & lt ; String & gt ; emptySet ( ) ) returns :
* < pre >
* f0 f2 f8
* dp dr dx
* dn dq dw
* < / pre >
* @ param hash central hash
* @ param size size of square grid in hashes
* @ param highlightThese hashes to highlight
* @ return String representation of grid */
public static String gridAsString ( String hash , int size , Set < String > highlightThese ) { } } | return gridAsString ( hash , - size , - size , size , size , highlightThese ) ; |
public class CdnManager { /** * 获取CDN域名访问日志的下载链接 , 具体下载操作请自行根据链接下载
* 参考文档 : < a href = " http : / / developer . qiniu . com / fusion / api / download - the - log " > 日志下载 < / a >
* @ param domains 待获取日志下载信息的域名列表
* @ param logDate 待获取日志的具体日期 , 格式为 : 2017-02-18
* @ return 获取日志下载链接的回复 */
public CdnResult . LogListResult getCdnLogList ( String [ ] domains , String logDate ) throws QiniuException { } } | HashMap < String , String > req = new HashMap < > ( ) ; req . put ( "domains" , StringUtils . join ( domains , ";" ) ) ; req . put ( "day" , logDate ) ; byte [ ] body = Json . encode ( req ) . getBytes ( Constants . UTF_8 ) ; String url = server + "/v2/tune/log/list" ; StringMap headers = auth . authorizationV2 ( url , "POST" , body , Client . JsonMime ) ; Response response = client . post ( url , body , headers , Client . JsonMime ) ; return response . jsonToObject ( CdnResult . LogListResult . class ) ; |
public class ByteBuf { /** * Wraps provided byte array into { @ code ByteBuf } with { @ link # tail } equal to length of provided array .
* @ param bytes byte array to be wrapped into { @ code ByteBuf }
* @ return { @ code ByteBuf } over underlying byte array that is ready for reading */
@ NotNull @ Contract ( "_ -> new" ) public static ByteBuf wrapForReading ( @ NotNull byte [ ] bytes ) { } } | return wrap ( bytes , 0 , bytes . length ) ; |
public class BigtableTableAdminGrpcClient { /** * { @ inheritDoc }
* @ return */
@ Override public ListenableFuture < Empty > deleteTableAsync ( DeleteTableRequest request ) { } } | return createUnaryListener ( request , deleteTableRpc , request . getName ( ) ) . getAsyncResult ( ) ; |
public class SrvDate { /** * < p > Parse date from ISO8601 full string ,
* e . g . from 2001-07-04T12:08:56.235-07:00 . < / p >
* @ param pDateStr date in ISO8601 format
* @ param pAddParam additional params
* @ return String representation
* @ throws Exception - an exception */
@ Override public final Date fromIso8601Full ( final String pDateStr , final Map < String , Object > pAddParam ) throws Exception { } } | return this . dateTimeFullFormatIso8601 . parse ( pDateStr ) ; |
public class RayHandler { /** * Sets ambient light color .
* Specifies how shadows colored and their brightness .
* < p > Default = Color ( 0 , 0 , 0 , 0)
* @ param r
* shadows color red component
* @ param g
* shadows color green component
* @ param b
* shadows color blue component
* @ param a
* shadows brightness component
* @ see # setAmbientLight ( float )
* @ see # setAmbientLight ( Color ) */
public void setAmbientLight ( float r , float g , float b , float a ) { } } | this . ambientLight . set ( r , g , b , a ) ; |
public class CreateInputRequest { /** * A list of security groups referenced by IDs to attach to the input .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setInputSecurityGroups ( java . util . Collection ) } or { @ link # withInputSecurityGroups ( java . util . Collection ) }
* if you want to override the existing values .
* @ param inputSecurityGroups
* A list of security groups referenced by IDs to attach to the input .
* @ return Returns a reference to this object so that method calls can be chained together . */
public CreateInputRequest withInputSecurityGroups ( String ... inputSecurityGroups ) { } } | if ( this . inputSecurityGroups == null ) { setInputSecurityGroups ( new java . util . ArrayList < String > ( inputSecurityGroups . length ) ) ; } for ( String ele : inputSecurityGroups ) { this . inputSecurityGroups . add ( ele ) ; } return this ; |
public class AbstractOperatingSystemWrapper { /** * Replies the first line that contains the given selector .
* @ param selector is the string to search for .
* @ param text is the text to search in .
* @ return the found line or < code > null < / code > . */
protected static String grep ( String selector , String text ) { } } | if ( text == null || text . isEmpty ( ) ) { return null ; } final StringBuilder line = new StringBuilder ( ) ; final int textLength = text . length ( ) ; char c ; String string ; for ( int i = 0 ; i < textLength ; ++ i ) { c = text . charAt ( i ) ; if ( c == '\n' || c == '\r' ) { string = line . toString ( ) ; if ( string . contains ( selector ) ) { return string ; } line . setLength ( 0 ) ; } else { line . append ( c ) ; } } if ( line . length ( ) > 0 ) { string = line . toString ( ) ; if ( string . contains ( selector ) ) { return string ; } } return null ; |
public class ServiceApiWrapper { /** * Returns observable to create a conversation .
* @ param token Comapi access token .
* @ param conversationId ID of a conversation to delete .
* @ param eTag Tag to specify local data version . Can be null .
* @ return Observable to to create a conversation . */
Observable < ComapiResult < Void > > doDeleteConversation ( @ NonNull final String token , @ NonNull final String conversationId , final String eTag ) { } } | return wrapObservable ( ! TextUtils . isEmpty ( eTag ) ? service . deleteConversation ( AuthManager . addAuthPrefix ( token ) , eTag , apiSpaceId , conversationId ) . map ( mapToComapiResult ( ) ) : service . deleteConversation ( AuthManager . addAuthPrefix ( token ) , apiSpaceId , conversationId ) . map ( mapToComapiResult ( ) ) , log , "Deleting conversation " + conversationId ) ; |
public class CsvFileExtensions { /** * Reads from a csv - file the field from the given position and puts them to the List .
* @ param input
* The input - file .
* @ param position
* The position from the field .
* @ param putFirstLine
* Flag that tells if the first line will be put in the list .
* @ param splitChar
* the split char
* @ param encoding
* the encoding
* @ return The list with the data .
* @ throws IOException
* When a io - problem occurs . */
public static List < String > readDataFromCVSFileToList ( final File input , final int position , final boolean putFirstLine , final String splitChar , final String encoding ) throws IOException { } } | final List < String > output = new ArrayList < > ( ) ; try ( BufferedReader reader = ( BufferedReader ) StreamExtensions . getReader ( input , encoding , false ) ) { // the line .
String line = null ; // read all lines from the file
do { line = reader . readLine ( ) ; // if null break the loop
if ( line == null ) { break ; } // Split the line
final String [ ] splittedData = line . split ( splitChar ) ; // get the data with the index
if ( position <= splittedData . length - 1 ) { final String s = StringExtensions . removeQuotationMarks ( splittedData [ position ] ) ; output . add ( s ) ; } } while ( true ) ; } catch ( final IOException e ) { throw e ; } // return the list with all lines from the file .
if ( ! putFirstLine ) { output . remove ( 0 ) ; } return output ; |
public class TableManager { /** * Pre - split the Tedge and TedgeText tables .
* @ param tablename name of the accumulo table
* @ param splits set of splits to add */
public void addSplits ( final String tablename , final SortedSet < Text > splits ) { } } | try { tableOperations . addSplits ( tablename , splits ) ; } catch ( TableNotFoundException e ) { throw new D4MException ( String . format ( "Unable to find table [%s]" , tablename ) , e ) ; } catch ( AccumuloException | AccumuloSecurityException e ) { throw new D4MException ( String . format ( "Unable to add splits to table [%s]" , tablename ) , e ) ; } |
public class QueryBuilder { /** * Perform a right outer join between the already defined source with the " _ _ ALL _ NODES " table using the supplied alias .
* @ param alias the alias for the " _ _ ALL _ NODES " table ; may not be null
* @ return the component that must be used to complete the join specification ; never null */
public JoinClause rightOuterJoinAllNodesAs ( String alias ) { } } | // Expect there to be a source already . . .
return new JoinClause ( namedSelector ( AllNodes . ALL_NODES_NAME + " AS " + alias ) , JoinType . RIGHT_OUTER ) ; |
public class AbstractStatementExecutor { /** * Clear data .
* @ throws SQLException sql exception */
public void clear ( ) throws SQLException { } } | clearStatements ( ) ; statements . clear ( ) ; parameterSets . clear ( ) ; connections . clear ( ) ; resultSets . clear ( ) ; executeGroups . clear ( ) ; |
public class Reflections { /** * merges saved Reflections resources from the given file , using the serializer configured in this instance ' s Configuration
* < p > useful if you know the serialized resource location and prefer not to look it up the classpath */
public Reflections collect ( final File file ) { } } | FileInputStream inputStream = null ; try { inputStream = new FileInputStream ( file ) ; return collect ( inputStream ) ; } catch ( FileNotFoundException e ) { throw new ReflectionsException ( "could not obtain input stream from file " + file , e ) ; } finally { Utils . close ( inputStream ) ; } |
public class RecommendationsInner { /** * Reset all recommendation opt - out settings for an app .
* Reset all recommendation opt - out settings for an app .
* @ param resourceGroupName Name of the resource group to which the resource belongs .
* @ param siteName Name of the app .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the { @ link ServiceResponse } object if successful . */
public Observable < Void > resetAllFiltersForWebAppAsync ( String resourceGroupName , String siteName ) { } } | return resetAllFiltersForWebAppWithServiceResponseAsync ( resourceGroupName , siteName ) . map ( new Func1 < ServiceResponse < Void > , Void > ( ) { @ Override public Void call ( ServiceResponse < Void > response ) { return response . body ( ) ; } } ) ; |
public class InternalSARLLexer { /** * $ ANTLR start " RULE _ STRING " */
public final void mRULE_STRING ( ) throws RecognitionException { } } | try { int _type = RULE_STRING ; int _channel = DEFAULT_TOKEN_CHANNEL ; // InternalSARL . g : 48795:13 : ( ( ' \ " ' ( ' \ \ \ \ ' . | ~ ( ( ' \ \ \ \ ' | ' \ " ' ) ) ) * ( ' \ " ' ) ? | ' \ \ ' ' ( ' \ \ \ \ ' . | ~ ( ( ' \ \ \ \ ' | ' \ \ ' ' ) ) ) * ( ' \ \ ' ' ) ? ) )
// InternalSARL . g : 48795:15 : ( ' \ " ' ( ' \ \ \ \ ' . | ~ ( ( ' \ \ \ \ ' | ' \ " ' ) ) ) * ( ' \ " ' ) ? | ' \ \ ' ' ( ' \ \ \ \ ' . | ~ ( ( ' \ \ \ \ ' | ' \ \ ' ' ) ) ) * ( ' \ \ ' ' ) ? )
{ // InternalSARL . g : 48795:15 : ( ' \ " ' ( ' \ \ \ \ ' . | ~ ( ( ' \ \ \ \ ' | ' \ " ' ) ) ) * ( ' \ " ' ) ? | ' \ \ ' ' ( ' \ \ \ \ ' . | ~ ( ( ' \ \ \ \ ' | ' \ \ ' ' ) ) ) * ( ' \ \ ' ' ) ? )
int alt48 = 2 ; int LA48_0 = input . LA ( 1 ) ; if ( ( LA48_0 == '\"' ) ) { alt48 = 1 ; } else if ( ( LA48_0 == '\'' ) ) { alt48 = 2 ; } else { NoViableAltException nvae = new NoViableAltException ( "" , 48 , 0 , input ) ; throw nvae ; } switch ( alt48 ) { case 1 : // InternalSARL . g : 48795:16 : ' \ " ' ( ' \ \ \ \ ' . | ~ ( ( ' \ \ \ \ ' | ' \ " ' ) ) ) * ( ' \ " ' ) ?
{ match ( '\"' ) ; // InternalSARL . g : 48795:20 : ( ' \ \ \ \ ' . | ~ ( ( ' \ \ \ \ ' | ' \ " ' ) ) ) *
loop44 : do { int alt44 = 3 ; int LA44_0 = input . LA ( 1 ) ; if ( ( LA44_0 == '\\' ) ) { alt44 = 1 ; } else if ( ( ( LA44_0 >= '\u0000' && LA44_0 <= '!' ) || ( LA44_0 >= '#' && LA44_0 <= '[' ) || ( LA44_0 >= ']' && LA44_0 <= '\uFFFF' ) ) ) { alt44 = 2 ; } switch ( alt44 ) { case 1 : // InternalSARL . g : 48795:21 : ' \ \ \ \ ' .
{ match ( '\\' ) ; matchAny ( ) ; } break ; case 2 : // InternalSARL . g : 48795:28 : ~ ( ( ' \ \ \ \ ' | ' \ " ' ) )
{ if ( ( input . LA ( 1 ) >= '\u0000' && input . LA ( 1 ) <= '!' ) || ( input . LA ( 1 ) >= '#' && input . LA ( 1 ) <= '[' ) || ( input . LA ( 1 ) >= ']' && input . LA ( 1 ) <= '\uFFFF' ) ) { input . consume ( ) ; } else { MismatchedSetException mse = new MismatchedSetException ( null , input ) ; recover ( mse ) ; throw mse ; } } break ; default : break loop44 ; } } while ( true ) ; // InternalSARL . g : 48795:44 : ( ' \ " ' ) ?
int alt45 = 2 ; int LA45_0 = input . LA ( 1 ) ; if ( ( LA45_0 == '\"' ) ) { alt45 = 1 ; } switch ( alt45 ) { case 1 : // InternalSARL . g : 48795:44 : ' \ " '
{ match ( '\"' ) ; } break ; } } break ; case 2 : // InternalSARL . g : 48795:49 : ' \ \ ' ' ( ' \ \ \ \ ' . | ~ ( ( ' \ \ \ \ ' | ' \ \ ' ' ) ) ) * ( ' \ \ ' ' ) ?
{ match ( '\'' ) ; // InternalSARL . g : 48795:54 : ( ' \ \ \ \ ' . | ~ ( ( ' \ \ \ \ ' | ' \ \ ' ' ) ) ) *
loop46 : do { int alt46 = 3 ; int LA46_0 = input . LA ( 1 ) ; if ( ( LA46_0 == '\\' ) ) { alt46 = 1 ; } else if ( ( ( LA46_0 >= '\u0000' && LA46_0 <= '&' ) || ( LA46_0 >= '(' && LA46_0 <= '[' ) || ( LA46_0 >= ']' && LA46_0 <= '\uFFFF' ) ) ) { alt46 = 2 ; } switch ( alt46 ) { case 1 : // InternalSARL . g : 48795:55 : ' \ \ \ \ ' .
{ match ( '\\' ) ; matchAny ( ) ; } break ; case 2 : // InternalSARL . g : 48795:62 : ~ ( ( ' \ \ \ \ ' | ' \ \ ' ' ) )
{ if ( ( input . LA ( 1 ) >= '\u0000' && input . LA ( 1 ) <= '&' ) || ( input . LA ( 1 ) >= '(' && input . LA ( 1 ) <= '[' ) || ( input . LA ( 1 ) >= ']' && input . LA ( 1 ) <= '\uFFFF' ) ) { input . consume ( ) ; } else { MismatchedSetException mse = new MismatchedSetException ( null , input ) ; recover ( mse ) ; throw mse ; } } break ; default : break loop46 ; } } while ( true ) ; // InternalSARL . g : 48795:79 : ( ' \ \ ' ' ) ?
int alt47 = 2 ; int LA47_0 = input . LA ( 1 ) ; if ( ( LA47_0 == '\'' ) ) { alt47 = 1 ; } switch ( alt47 ) { case 1 : // InternalSARL . g : 48795:79 : ' \ \ ' '
{ match ( '\'' ) ; } break ; } } break ; } } state . type = _type ; state . channel = _channel ; } finally { } |
public class MultiFormatReader { /** * Decode an image using the hints provided . Does not honor existing state .
* @ param image The pixel data to decode
* @ param hints The hints to use , clearing the previous state .
* @ return The contents of the image
* @ throws NotFoundException Any errors which occurred */
@ Override public Result decode ( BinaryBitmap image , Map < DecodeHintType , ? > hints ) throws NotFoundException { } } | setHints ( hints ) ; return decodeInternal ( image ) ; |
public class Bus { /** * Broadcasts an event on the bus to all registered observers .
* @ param message
* the message to be broadcast .
* @ param args
* a set of optional untyped parameters . */
public Bus < M > broadcast ( M message , Object ... args ) { } } | return broadcast ( null , message , args ) ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.