signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class LocationCriterion { /** * Gets the location value for this LocationCriterion . * @ return location * Location criterion . */ public com . google . api . ads . adwords . axis . v201809 . cm . Location getLocation ( ) { } }
return location ;
public class LObjCharFunctionBuilder { /** * 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 < T , R > LObjCharFunction < T , R > objCharFunctionFrom ( Consumer < LObjCharFunctionBuilder < T , R > > buildingFunction ) { } }
LObjCharFunctionBuilder builder = new LObjCharFunctionBuilder ( ) ; buildingFunction . accept ( builder ) ; return builder . build ( ) ;
public class SmsBuilder { /** * Registers and configures sender through a dedicated builder . * For example : * < pre > * . sender ( CloudhopperBuilder . class ) * . host ( " localhost " ) ; * < / pre > * If your custom builder is annotated by one or several of : * < ul > * < li > { @ link RequiredClass } < / li > * < li > { @ link RequiredProperty } < / li > * < li > { @ link RequiredClasses } < / li > * < li > { @ link RequiredProperties } < / li > * < / ul > * Then if condition evaluation returns true , your built implementation will * be used . If you provide several annotations , your built implementation * will be used only if all conditions are met ( and operator ) . * If your custom builder implements { @ link ActivableAtRuntime } , and the * provided condition evaluation returns true , then your built * implementation will be used . * See { @ link MessageConditions } to build your condition . * If neither annotations nor implementation of { @ link ActivableAtRuntime } * is used , then your built implementation will be always used . All other * implementations ( even standard ones ) will never be used . * In order to be able to keep chaining , you builder instance may provide a * constructor with one argument with the type of the parent builder * ( { @ link SmsBuilder } ) . If you don ' t care about chaining , just provide a * default constructor . * Your builder may return { @ code null } when calling * { @ link Builder # build ( ) } . In this case it means that your implementation * can ' t be used due to current environment . Your implementation is then not * registered . * @ param builderClass * the builder class to instantiate * @ param < T > * the type of the builder * @ return the builder to configure the implementation */ public < T extends Builder < ? extends MessageSender > > T sender ( Class < T > builderClass ) { } }
return senderBuilderHelper . register ( builderClass ) ;
public class Phaser { /** * Awaits the phase of this phaser to advance from the given phase * value , throwing { @ code InterruptedException } if interrupted * while waiting , or returning immediately if the current phase is * not equal to the given phase value or this phaser is * terminated . * @ param phase an arrival phase number , or negative value if * terminated ; this argument is normally the value returned by a * previous call to { @ code arrive } or { @ code arriveAndDeregister } . * @ return the next arrival phase number , or the argument if it is * negative , or the ( negative ) { @ linkplain # getPhase ( ) current phase } * if terminated * @ throws InterruptedException if thread interrupted while waiting */ public int awaitAdvanceInterruptibly ( int phase ) throws InterruptedException { } }
final Phaser root = this . root ; long s = ( root == this ) ? state : reconcileState ( ) ; int p = ( int ) ( s >>> PHASE_SHIFT ) ; if ( phase < 0 ) return phase ; if ( p == phase ) { QNode node = new QNode ( this , phase , true , false , 0L ) ; p = root . internalAwaitAdvance ( phase , node ) ; if ( node . wasInterrupted ) throw new InterruptedException ( ) ; } return p ;
public class PlayEngine { /** * Send clear ping . Lets client know that stream has no more data to send . */ private void sendClearPing ( ) { } }
Ping eof = new Ping ( ) ; eof . setEventType ( Ping . STREAM_PLAYBUFFER_CLEAR ) ; eof . setValue2 ( streamId ) ; // eos RTMPMessage eofMsg = RTMPMessage . build ( eof ) ; doPushMessage ( eofMsg ) ;
public class AbstractInjectionEngine { /** * F49213.1 */ @ Override public void inject ( Object objectToInject , InjectionTarget target , InjectionTargetContext targetContext ) throws InjectionException { } }
final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "inject " + "(" + Util . identity ( objectToInject ) + ", " + target + ", " + targetContext + ")" ) ; target . inject ( objectToInject , targetContext ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "inject" ) ;
public class MonetaryOperators { /** * Rounding the { @ link MonetaryAmount } using { @ link CurrencyUnit # getDefaultFractionDigits ( ) } * and { @ link RoundingMode } . * For example , ' EUR 2.3523 ' will return ' EUR 2.35 ' , * and ' BHD - 1.34534432 ' will return ' BHD - 1.345 ' . * < pre > * { @ code * MonetaryAmount money = Money . parse ( " EUR 2.355432 " ) ; * MonetaryAmount result = ConversionOperators . rounding ( RoundingMode . HALF _ EVEN , 3 ) . apply ( money ) ; / / EUR 2.352 * < / pre > * @ param roundingMode rounding to be used * @ param scale to be used * @ return the major part as { @ link MonetaryOperator } */ public static MonetaryOperator rounding ( RoundingMode roundingMode , int scale ) { } }
return new RoudingMonetaryAmountOperator ( Objects . requireNonNull ( roundingMode ) , scale ) ;
public class Node { /** * Returns an iterator over the child nodes of this Node . * @ return an iterator over the child nodes of this Node */ public Iterator childNodes ( ) { } }
return new Iterator ( ) { private final Iterator iter = Node . this . children . iterator ( ) ; private Object nextElementNodes = getNextElementNodes ( ) ; public boolean hasNext ( ) { return this . nextElementNodes != null ; } public Object next ( ) { try { return this . nextElementNodes ; } finally { this . nextElementNodes = getNextElementNodes ( ) ; } } public void remove ( ) { throw new UnsupportedOperationException ( ) ; } private Object getNextElementNodes ( ) { while ( iter . hasNext ( ) ) { final Object node = iter . next ( ) ; if ( node instanceof Node ) { return node ; } } return null ; } } ;
public class ClustersInner { /** * Create or update a Kusto cluster . * @ param resourceGroupName The name of the resource group containing the Kusto cluster . * @ param clusterName The name of the Kusto cluster . * @ param parameters The Kusto cluster parameters supplied to the CreateOrUpdate operation . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ throws CloudException thrown if the request is rejected by server * @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @ return the ClusterInner object if successful . */ public ClusterInner beginCreateOrUpdate ( String resourceGroupName , String clusterName , ClusterInner parameters ) { } }
return beginCreateOrUpdateWithServiceResponseAsync ( resourceGroupName , clusterName , parameters ) . toBlocking ( ) . single ( ) . body ( ) ;
public class ObjectStreamClass { /** * Resolves the class properties , if they weren ' t already */ private void resolveProperties ( ) { } }
if ( arePropertiesResolved ) { return ; } Class < ? > cl = forClass ( ) ; isProxy = Proxy . isProxyClass ( cl ) ; isEnum = Enum . class . isAssignableFrom ( cl ) ; isSerializable = isSerializable ( cl ) ; isExternalizable = isExternalizable ( cl ) ; arePropertiesResolved = true ;
public class ExecutionManager { /** * reply will terminal the actor and return the results . * @ param state * the state * @ param t * the exception */ @ SuppressWarnings ( "deprecation" ) private void reply ( ParallelTaskState state , Exception t ) { } }
task . setState ( state ) ; logger . info ( "task.state : " + task . getState ( ) . toString ( ) ) ; logger . info ( "task.totalJobNumActual : " + task . getRequestNumActual ( ) + " InitCount: " + task . getRequestNum ( ) ) ; logger . info ( "task.response received Num {} " , task . getResponsedNum ( ) ) ; if ( state == ParallelTaskState . COMPLETED_WITH_ERROR ) { task . getTaskErrorMetas ( ) . add ( new TaskErrorMeta ( TaskErrorType . COMMAND_MANAGER_ERROR , t == null ? "NA" : t . getLocalizedMessage ( ) ) ) ; String curTimeStr = PcDateUtils . getNowDateTimeStrStandard ( ) ; logger . info ( "COMPLETED_WITH_ERROR. " + this . requestCount + " at time: " + curTimeStr ) ; // TODO // #47 if ( t instanceof ExecutionManagerExecutionException && ( ( ExecutionManagerExecutionException ) t ) . getType ( ) == ManagerExceptionType . TIMEOUT ) { for ( Entry < String , NodeReqResponse > entry : task . getParallelTaskResult ( ) . entrySet ( ) ) { // no response yet if ( entry . getValue ( ) != null && entry . getValue ( ) . getSingleTaskResponse ( ) == null ) { ResponseOnSingleTask response = new ResponseOnSingleTask ( ) ; response . setReceiveTimeInManager ( curTimeStr ) ; response . setError ( true ) ; response . setErrorMessage ( t . getLocalizedMessage ( ) + " Response was not received" ) ; response . setReceiveTime ( curTimeStr ) ; entry . getValue ( ) . setSingleTaskResponse ( response ) ; logger . info ( "Found empty response for {}" , entry . getKey ( ) ) ; } } } // end if } else { logger . info ( "SUCCESSFUL GOT ON ALL RESPONSES: Received all the expected messages. Count matches: " + this . requestCount + " at time: " + PcDateUtils . getNowDateTimeStrStandard ( ) ) ; } ResponseFromManager batchResponseFromManager = new ResponseFromManager ( responseMap . size ( ) ) ; responseMap . clear ( ) ; director . tell ( batchResponseFromManager , getSelf ( ) ) ; // Send message to the future with the result endTime = System . currentTimeMillis ( ) ; task . setExecutionEndTime ( endTime ) ; double durationSec = ( endTime - startTime ) / 1000.0 ; task . setDurationSec ( durationSec ) ; logger . info ( "\nTime taken to get all responses back : " + durationSec + " secs" ) ; task . setExecutionEndTime ( endTime ) ; for ( ActorRef worker : workers . values ( ) ) { getContext ( ) . stop ( worker ) ; } workers . clear ( ) ; if ( batchSenderAsstManager != null && ! batchSenderAsstManager . isTerminated ( ) ) { getContext ( ) . stop ( batchSenderAsstManager ) ; } if ( timeoutMessageCancellable != null ) { timeoutMessageCancellable . cancel ( ) ; } if ( getSelf ( ) != null && ! getSelf ( ) . isTerminated ( ) ) { getContext ( ) . stop ( getSelf ( ) ) ; }
public class StringUtils { /** * < p > Checks if the CharSequence contains only Unicode letters . * < p > { @ code null } will return { @ code false } . * An empty CharSequence ( length ( ) = 0 ) will return { @ code false } . * < pre > * StringUtils . isAlpha ( null ) = false * StringUtils . isAlpha ( " " ) = false * StringUtils . isAlpha ( " " ) = false * StringUtils . isAlpha ( " abc " ) = true * StringUtils . isAlpha ( " ab2c " ) = false * StringUtils . isAlpha ( " ab - c " ) = false * < / pre > * @ param cs the CharSequence to check , may be null * @ return { @ code true } if only contains letters , and is non - null * @ since 3.0 Changed signature from isAlpha ( String ) to isAlpha ( CharSequence ) * @ since 3.0 Changed " " to return false and not true */ public static boolean isAlpha ( final String cs ) { } }
if ( Strings . isNullOrEmpty ( cs ) ) { return false ; } final int sz = cs . length ( ) ; for ( int i = 0 ; i < sz ; i ++ ) { if ( ! Character . isLetter ( cs . charAt ( i ) ) ) { return false ; } } return true ;
public class SshConnector { /** * See { @ link connect ( SshTransport , String ) } for full details . This method * optionally allows you to specify the buffered state of the connection . * When the connection is buffered a background thread is started to act as * a message pump ; this has the benefit of routing data as soon as it * arrives and helps in circumstances where you require a channel to fill up * with data without calling its InputStream ' s read method . This also will * enable the InputStreams available method to work as expected . * @ param transport * SshTransport * @ param username * String * @ param buffered * boolean * @ return SshClient * @ throws SshException */ public SshClient connect ( SshTransport transport , String username , boolean buffered ) throws SshException { } }
return connect ( transport , username , buffered , null ) ;
public class CreateCloudFormationChangeSetRequest { /** * A list of values that you must specify before you can deploy certain applications . Some applications might * include resources that can affect permissions in your AWS account , for example , by creating new AWS Identity and * Access Management ( IAM ) users . For those applications , you must explicitly acknowledge their capabilities by * specifying this parameter . * The only valid values are CAPABILITY _ IAM , CAPABILITY _ NAMED _ IAM , CAPABILITY _ RESOURCE _ POLICY , and * CAPABILITY _ AUTO _ EXPAND . * The following resources require you to specify CAPABILITY _ IAM or CAPABILITY _ NAMED _ IAM : < a * href = " https : / / docs . aws . amazon . com / AWSCloudFormation / latest / UserGuide / aws - properties - iam - group . html " * > AWS : : IAM : : Group < / a > , < a * href = " https : / / docs . aws . amazon . com / AWSCloudFormation / latest / UserGuide / aws - resource - iam - instanceprofile . html " * > AWS : : IAM : : InstanceProfile < / a > , < a * href = " https : / / docs . aws . amazon . com / AWSCloudFormation / latest / UserGuide / aws - resource - iam - policy . html " * > AWS : : IAM : : Policy < / a > , and < a * href = " https : / / docs . aws . amazon . com / AWSCloudFormation / latest / UserGuide / aws - resource - iam - role . html " * > AWS : : IAM : : Role < / a > . If the application contains IAM resources , you can specify either CAPABILITY _ IAM or * CAPABILITY _ NAMED _ IAM . If the application contains IAM resources with custom names , you must specify * CAPABILITY _ NAMED _ IAM . * The following resources require you to specify CAPABILITY _ RESOURCE _ POLICY : < a * href = " https : / / docs . aws . amazon . com / AWSCloudFormation / latest / UserGuide / aws - resource - lambda - permission . html " * > AWS : : Lambda : : Permission < / a > , < a * href = " https : / / docs . aws . amazon . com / AWSCloudFormation / latest / UserGuide / aws - resource - iam - policy . html " * > AWS : : IAM : Policy < / a > , < a href = * " https : / / docs . aws . amazon . com / AWSCloudFormation / latest / UserGuide / aws - resource - applicationautoscaling - scalingpolicy . html " * > AWS : : ApplicationAutoScaling : : ScalingPolicy < / a > , < a * href = " https : / / docs . aws . amazon . com / AWSCloudFormation / latest / UserGuide / aws - properties - s3 - policy . html " * > AWS : : S3 : : BucketPolicy < / a > , < a * href = " https : / / docs . aws . amazon . com / AWSCloudFormation / latest / UserGuide / aws - properties - sqs - policy . html " * > AWS : : SQS : : QueuePolicy < / a > , and < a * href = " https : / / docs . aws . amazon . com / AWSCloudFormation / latest / UserGuide / aws - properties - sns - policy . html " * > AWS : : SNS : TopicPolicy < / a > . * Applications that contain one or more nested applications require you to specify CAPABILITY _ AUTO _ EXPAND . * If your application template contains any of the above resources , we recommend that you review all permissions * associated with the application before deploying . If you don ' t specify this parameter for an application that * requires capabilities , the call will fail . * @ param capabilities * A list of values that you must specify before you can deploy certain applications . Some applications might * include resources that can affect permissions in your AWS account , for example , by creating new AWS * Identity and Access Management ( IAM ) users . For those applications , you must explicitly acknowledge their * capabilities by specifying this parameter . < / p > * The only valid values are CAPABILITY _ IAM , CAPABILITY _ NAMED _ IAM , CAPABILITY _ RESOURCE _ POLICY , and * CAPABILITY _ AUTO _ EXPAND . * The following resources require you to specify CAPABILITY _ IAM or CAPABILITY _ NAMED _ IAM : < a * href = " https : / / docs . aws . amazon . com / AWSCloudFormation / latest / UserGuide / aws - properties - iam - group . html " * > AWS : : IAM : : Group < / a > , < a * href = " https : / / docs . aws . amazon . com / AWSCloudFormation / latest / UserGuide / aws - resource - iam - instanceprofile . html " * > AWS : : IAM : : InstanceProfile < / a > , < a * href = " https : / / docs . aws . amazon . com / AWSCloudFormation / latest / UserGuide / aws - resource - iam - policy . html " * > AWS : : IAM : : Policy < / a > , and < a * href = " https : / / docs . aws . amazon . com / AWSCloudFormation / latest / UserGuide / aws - resource - iam - role . html " * > AWS : : IAM : : Role < / a > . If the application contains IAM resources , you can specify either CAPABILITY _ IAM or * CAPABILITY _ NAMED _ IAM . If the application contains IAM resources with custom names , you must specify * CAPABILITY _ NAMED _ IAM . * The following resources require you to specify CAPABILITY _ RESOURCE _ POLICY : < a * href = " https : / / docs . aws . amazon . com / AWSCloudFormation / latest / UserGuide / aws - resource - lambda - permission . html " * > AWS : : Lambda : : Permission < / a > , < a * href = " https : / / docs . aws . amazon . com / AWSCloudFormation / latest / UserGuide / aws - resource - iam - policy . html " * > AWS : : IAM : Policy < / a > , < a href = * " https : / / docs . aws . amazon . com / AWSCloudFormation / latest / UserGuide / aws - resource - applicationautoscaling - scalingpolicy . html " * > AWS : : ApplicationAutoScaling : : ScalingPolicy < / a > , < a * href = " https : / / docs . aws . amazon . com / AWSCloudFormation / latest / UserGuide / aws - properties - s3 - policy . html " * > AWS : : S3 : : BucketPolicy < / a > , < a * href = " https : / / docs . aws . amazon . com / AWSCloudFormation / latest / UserGuide / aws - properties - sqs - policy . html " * > AWS : : SQS : : QueuePolicy < / a > , and < a * href = " https : / / docs . aws . amazon . com / AWSCloudFormation / latest / UserGuide / aws - properties - sns - policy . html " * > AWS : : SNS : TopicPolicy < / a > . * Applications that contain one or more nested applications require you to specify CAPABILITY _ AUTO _ EXPAND . * If your application template contains any of the above resources , we recommend that you review all * permissions associated with the application before deploying . If you don ' t specify this parameter for an * application that requires capabilities , the call will fail . */ public void setCapabilities ( java . util . Collection < String > capabilities ) { } }
if ( capabilities == null ) { this . capabilities = null ; return ; } this . capabilities = new java . util . ArrayList < String > ( capabilities ) ;
public class DataUtil { /** * big - endian or motorola format . */ public static long readUnsignedIntegerBigEndian ( InputStream io ) throws IOException { } }
long value = io . read ( ) ; if ( value < 0 ) throw new EOFException ( ) ; value <<= 24 ; int i = io . read ( ) ; if ( i < 0 ) throw new EOFException ( ) ; value |= i << 16 ; i = io . read ( ) ; if ( i < 0 ) throw new EOFException ( ) ; value |= i << 8 ; i = io . read ( ) ; if ( i < 0 ) throw new EOFException ( ) ; value |= i ; return value ;
public class AbstractTableScaffolding { /** * Apply the scaffolding together . * @ param container the base container for the scaffolding . */ @ Override public void apply ( HasWidgets container ) { } }
container . clear ( ) ; container . add ( topPanel ) ; container . add ( tableBody ) ; container . add ( xScrollPanel ) ; topPanel . add ( infoPanel ) ; topPanel . add ( toolPanel ) ; tableBody . add ( wrapInnerScroll ( table ) ) ; table . addHead ( new MaterialWidget ( DOM . createElement ( "thead" ) ) ) ; table . addBody ( new MaterialWidget ( DOM . createElement ( "tbody" ) ) ) ;
public class TableIndexDao { /** * Delete the TableIndex , cascading * @ param tableIndex * table index * @ return rows deleted * @ throws SQLException * upon deletion error */ public int deleteCascade ( TableIndex tableIndex ) throws SQLException { } }
int count = 0 ; if ( tableIndex != null ) { // Delete Geometry Indices GeometryIndexDao geometryIndexDao = getGeometryIndexDao ( ) ; if ( geometryIndexDao . isTableExists ( ) ) { DeleteBuilder < GeometryIndex , GeometryIndexKey > db = geometryIndexDao . deleteBuilder ( ) ; db . where ( ) . eq ( GeometryIndex . COLUMN_TABLE_NAME , tableIndex . getTableName ( ) ) ; PreparedDelete < GeometryIndex > deleteQuery = db . prepare ( ) ; geometryIndexDao . delete ( deleteQuery ) ; } count = delete ( tableIndex ) ; } return count ;
public class IOUtils { /** * Returns the contents of a buffered reader as a list of strings * @ param br BufferedReader to read from ; < strong > will be closed < / strong > * @ return List of Strings * @ throws ParserException Can throw this if we cannot parse the given reader */ public static List < String > getList ( BufferedReader br ) throws ParserException { } }
final List < String > list = new ArrayList < String > ( ) ; processReader ( br , new ReaderProcessor ( ) { @ Override public void process ( String line ) { list . add ( line ) ; } } ) ; return list ;
public class ArrayDrawable { /** * Sets a new drawable at the specified index , and return the previous drawable , if any . */ @ Nullable public Drawable setDrawable ( int index , @ Nullable Drawable drawable ) { } }
Preconditions . checkArgument ( index >= 0 ) ; Preconditions . checkArgument ( index < mLayers . length ) ; final Drawable oldDrawable = mLayers [ index ] ; if ( drawable != oldDrawable ) { if ( drawable != null && mIsMutated ) { drawable . mutate ( ) ; } DrawableUtils . setCallbacks ( mLayers [ index ] , null , null ) ; DrawableUtils . setCallbacks ( drawable , null , null ) ; DrawableUtils . setDrawableProperties ( drawable , mDrawableProperties ) ; DrawableUtils . copyProperties ( drawable , this ) ; DrawableUtils . setCallbacks ( drawable , this , this ) ; mIsStatefulCalculated = false ; mLayers [ index ] = drawable ; invalidateSelf ( ) ; } return oldDrawable ;
public class MultiChangeBuilder { /** * Inserts the given rich - text content at the position returned from * { @ code getAbsolutePosition ( paragraphIndex , columnPosition ) } . * < p > < b > Caution : < / b > see { @ link StyledDocument # getAbsolutePosition ( int , int ) } to know how the column index argument * can affect the returned position . < / p > * @ param document The rich - text content to insert . */ public MultiChangeBuilder < PS , SEG , S > insertAbsolutely ( int paragraphIndex , int columnPosition , StyledDocument < PS , SEG , S > document ) { } }
int pos = area . getAbsolutePosition ( paragraphIndex , columnPosition ) ; return replaceAbsolutely ( pos , pos , document ) ;
public class Multimaps { /** * Returns a view of a multimap whose values are derived from the original * multimap ' s entries . In contrast to { @ link # transformValues } , this method ' s * entry - transformation logic may depend on the key as well as the value . * < p > All other properties of the transformed multimap , such as iteration * order , are left intact . For example , the code : < pre > { @ code * SetMultimap < String , Integer > multimap = * ImmutableSetMultimap . of ( " a " , 1 , " a " , 4 , " b " , - 6 ) ; * EntryTransformer < String , Integer , String > transformer = * new EntryTransformer < String , Integer , String > ( ) { * public String transformEntry ( String key , Integer value ) { * return ( value > = 0 ) ? key : " no " + key ; * Multimap < String , String > transformed = * Multimaps . transformEntries ( multimap , transformer ) ; * System . out . println ( transformed ) ; } < / pre > * . . . prints { @ code { a = [ a , a ] , b = [ nob ] } } . * < p > Changes in the underlying multimap are reflected in this view . * Conversely , this view supports removal operations , and these are reflected * in the underlying multimap . * < p > It ' s acceptable for the underlying multimap to contain null keys and * null values provided that the transformer is capable of accepting null * inputs . The transformed multimap might contain null values if the * transformer sometimes gives a null result . * < p > The returned multimap is not thread - safe or serializable , even if the * underlying multimap is . The { @ code equals } and { @ code hashCode } methods * of the returned multimap are meaningless , since there is not a definition * of { @ code equals } or { @ code hashCode } for general collections , and * { @ code get ( ) } will return a general { @ code Collection } as opposed to a * { @ code List } or a { @ code Set } . * < p > The transformer is applied lazily , invoked when needed . This is * necessary for the returned multimap to be a view , but it means that the * transformer will be applied many times for bulk operations like { @ link * Multimap # containsValue } and { @ link Object # toString } . For this to perform * well , { @ code transformer } should be fast . To avoid lazy evaluation when the * returned multimap doesn ' t need to be a view , copy the returned multimap * into a new multimap of your choosing . * < p > < b > Warning : < / b > This method assumes that for any instance { @ code k } of * { @ code EntryTransformer } key type { @ code K } , { @ code k . equals ( k2 ) } implies * that { @ code k2 } is also of type { @ code K } . Using an { @ code * EntryTransformer } key type for which this may not hold , such as { @ code * ArrayList } , may risk a { @ code ClassCastException } when calling methods on * the transformed multimap . * @ since 7.0 */ public static < K , V1 , V2 > Multimap < K , V2 > transformEntries ( Multimap < K , V1 > fromMap , EntryTransformer < ? super K , ? super V1 , V2 > transformer ) { } }
return new TransformedEntriesMultimap < K , V1 , V2 > ( fromMap , transformer ) ;
public class JavacNode { /** * Generates a compiler warning focused on the AST node represented by this node object . */ public void addWarning ( String message , DiagnosticPosition pos ) { } }
ast . printMessage ( Diagnostic . Kind . WARNING , message , null , pos , false ) ;
public class AppServiceEnvironmentsInner { /** * Get available SKUs for scaling a multi - role pool . * Get available SKUs for scaling a multi - role pool . * @ param resourceGroupName Name of the resource group to which the resource belongs . * @ param name Name of the App Service Environment . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ throws CloudException thrown if the request is rejected by server * @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @ return the PagedList & lt ; SkuInfoInner & gt ; object if successful . */ public PagedList < SkuInfoInner > listMultiRolePoolSkus ( final String resourceGroupName , final String name ) { } }
ServiceResponse < Page < SkuInfoInner > > response = listMultiRolePoolSkusSinglePageAsync ( resourceGroupName , name ) . toBlocking ( ) . single ( ) ; return new PagedList < SkuInfoInner > ( response . body ( ) ) { @ Override public Page < SkuInfoInner > nextPage ( String nextPageLink ) { return listMultiRolePoolSkusNextSinglePageAsync ( nextPageLink ) . toBlocking ( ) . single ( ) . body ( ) ; } } ;
public class ReturnMappedAttributeReleasePolicy { /** * Authorize release of allowed attributes map . * @ param principal the principal * @ param attrs the attributes * @ param registeredService the registered service * @ param selectedService the selected service * @ return the map */ protected Map < String , List < Object > > authorizeReleaseOfAllowedAttributes ( final Principal principal , final Map < String , List < Object > > attrs , final RegisteredService registeredService , final Service selectedService ) { } }
val resolvedAttributes = new TreeMap < String , List < Object > > ( String . CASE_INSENSITIVE_ORDER ) ; resolvedAttributes . putAll ( attrs ) ; val attributesToRelease = new HashMap < String , List < Object > > ( ) ; /* * Map each entry in the allowed list into an array first * by the original key , value and the original entry itself . * Then process the array to populate the map for allowed attributes */ getAllowedAttributes ( ) . forEach ( ( attributeName , value ) -> { val mappedAttributes = CollectionUtils . wrap ( value ) ; LOGGER . trace ( "Attempting to map allowed attribute name [{}]" , attributeName ) ; val attributeValue = resolvedAttributes . get ( attributeName ) ; mappedAttributes . forEach ( mapped -> { val mappedAttributeName = mapped . toString ( ) ; LOGGER . debug ( "Mapping attribute [{}] to [{}] with value [{}]" , attributeName , mappedAttributeName , attributeValue ) ; mapSingleAttributeDefinition ( attributeName , mappedAttributeName , attributeValue , resolvedAttributes , attributesToRelease ) ; } ) ; } ) ; return attributesToRelease ;
public class JDK14Logger { /** * from interface Logger . Factory */ public void init ( ) { } }
try { if ( ! Boolean . getBoolean ( "com.samskivert.util.JDK14Logger.noFormatter" ) ) { OneLineLogFormatter . configureDefaultHandler ( ) ; } boolean reportedUTF8Missing = false ; for ( Handler handler : java . util . logging . Logger . getLogger ( "" ) . getHandlers ( ) ) { try { handler . setEncoding ( "UTF-8" ) ; } catch ( UnsupportedEncodingException e ) { // JVMs are required to support UTF - 8 so this shouldn ' t happen , but if it does , // tell somebody that things are really fucked if ( ! reportedUTF8Missing ) { reportedUTF8Missing = true ; System . err . println ( "Unable to find UTF-8 encoding. " + "This JVM ain't right: " + e . getMessage ( ) ) ; } } } } catch ( SecurityException se ) { // running in sandbox ; no custom logging ; no problem ! }
public class TypeScriptCompilerMojo { /** * A file is created - process it . * @ param file the file * @ return { @ literal true } as the pipeline should continue * @ throws WatchingException if the processing failed */ @ Override public boolean fileCreated ( File file ) throws WatchingException { } }
if ( WatcherUtils . isInDirectory ( file , internalSources ) ) { processDirectory ( internalSources , destinationForInternals ) ; } else if ( WatcherUtils . isInDirectory ( file , externalSources ) ) { processDirectory ( externalSources , destinationForExternals ) ; } return true ;
public class MediaPlayerUtils { /** * 播放文件中的部分音频 * @ param fileName * @ param offset * @ param length - 1 means play all . * @ param sync 是否同步播放 , 如果同步播放则会等到播放结束时再返回 , 反之则调用之后就直接返回 */ public static void playSound ( String fileName , long offset , long length , boolean sync ) { } }
FileInputStream fis = null ; try { if ( player == null ) { player = new MediaPlayer ( ) ; } player . reset ( ) ; fis = new FileInputStream ( fileName ) ; int available = fis . available ( ) ; if ( available < offset ) return ; if ( length == - 1 || length + offset > available ) { length = available - offset ; } player . setDataSource ( fis . getFD ( ) , offset , length ) ; player . prepare ( ) ; player . start ( ) ; if ( sync ) { while ( player . isPlaying ( ) ) { Thread . sleep ( 30 ) ; } } } catch ( Exception e ) { Log . e ( TAG , "" , e ) ; } finally { if ( fis != null ) { try { fis . close ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } }
public class ValidationSession { /** * Locate the metadata for the given object * The object is cleaned first and then a wrapper for the metadata is returned * @ param object * @ return the metadata for the object */ public ObjectMetadata getMetadata ( final ValidationObject object ) { } }
if ( m_enabled ) { m_validationEngine . clean ( object ) ; } return object . getMetadata ( ) ;
public class CommerceSubscriptionEntryLocalServiceBaseImpl { /** * Returns all the commerce subscription entries matching the UUID and company . * @ param uuid the UUID of the commerce subscription entries * @ param companyId the primary key of the company * @ return the matching commerce subscription entries , or an empty list if no matches were found */ @ Override public List < CommerceSubscriptionEntry > getCommerceSubscriptionEntriesByUuidAndCompanyId ( String uuid , long companyId ) { } }
return commerceSubscriptionEntryPersistence . findByUuid_C ( uuid , companyId ) ;
public class SSLEngineImpl { /** * Controls which particular cipher suites are enabled for use on * this connection . The cipher suites must have been listed by * getCipherSuites ( ) as being supported . Even if a suite has been * enabled , it might never be used if no peer supports it or the * requisite certificates ( and private keys ) are not available . * @ param suites Names of all the cipher suites to enable . */ synchronized public void setEnabledCipherSuites ( String [ ] suites ) { } }
enabledCipherSuites = new CipherSuiteList ( suites ) ; if ( ( handshaker != null ) && ! handshaker . activated ( ) ) { handshaker . setEnabledCipherSuites ( enabledCipherSuites ) ; }
public class BaseCalendar { /** * Check if date / time represented by timeStamp is included . If included return * true . The implementation of BaseCalendar simply calls the base calendars * isTimeIncluded ( ) method if base calendar is set . * @ see com . helger . quartz . ICalendar # isTimeIncluded ( long ) */ public boolean isTimeIncluded ( final long timeStamp ) { } }
if ( timeStamp <= 0 ) { throw new IllegalArgumentException ( "timeStamp must be greater 0" ) ; } if ( m_aBaseCalendar != null ) { if ( m_aBaseCalendar . isTimeIncluded ( timeStamp ) == false ) { return false ; } } return true ;
public class AnimatorSet { /** * Sets the length of each of the current child animations of this AnimatorSet . By default , * each child animation will use its own duration . If the duration is set on the AnimatorSet , * then each child animation inherits this duration . * @ param duration The length of the animation , in milliseconds , of each of the child * animations of this AnimatorSet . */ @ Override public AnimatorSet setDuration ( long duration ) { } }
if ( duration < 0 ) { throw new IllegalArgumentException ( "duration must be a value of zero or greater" ) ; } for ( Node node : mNodes ) { // TODO : don ' t set the duration of the timing - only nodes created by AnimatorSet to // insert " play - after " delays node . animation . setDuration ( duration ) ; } mDuration = duration ; return this ;
public class ConsumerMonitoring { /** * Method addConsumerForKnownTopicExpr * A monitored consumer is being added for a known expression . * This method uses the monitoring information stored in an existing consumer * in order to update the information in the new consumer and in order to * add appropriate references into the consumer monitors table . * @ param consumerList list of existing consumers for this topic expression * @ param mc the consumer being added . */ private void addConsumerForKnownTopicExpr ( String topic , boolean selector , boolean isWildcarded , MonitoredConsumer mc , boolean matchedOnSelector ) { } }
if ( tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "addConsumerForKnownTopicExpr" , new Object [ ] { topic , new Boolean ( selector ) , new Boolean ( isWildcarded ) , mc , new Boolean ( matchedOnSelector ) } ) ; ArrayList consumerList = null ; if ( matchedOnSelector ) { consumerList = _subscriptionRegistrar . getConsumerListForExpression ( topic , selector , isWildcarded ) ; } else { consumerList = _subscriptionRegistrar . getConsumerListForExpression ( topic , ! selector , isWildcarded ) ; } // This topic expression has already been categorised if ( tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Found existing entry with list: " + consumerList + ", of size: " + consumerList . size ( ) ) ; // Retrieve the list of matching registered consumer monitors from // an existing consumer MonitoredConsumer existingmc = ( MonitoredConsumer ) consumerList . get ( 0 ) ; // And add to the new consumer ArrayList exactMonitorList = ( ArrayList ) existingmc . getMatchingExactMonitorList ( ) ; mc . setMatchingExactMonitorList ( exactMonitorList ) ; ArrayList wildcardMonitorList = ( ArrayList ) existingmc . getMatchingWildcardMonitorList ( ) ; mc . setMatchingWildcardMonitorList ( wildcardMonitorList ) ; // Add the new consumer to the list in the row from the table of subscriptions if ( matchedOnSelector ) { consumerList . add ( mc ) ; } // Finally , add this consumer to the appropriate places in the registered // consumer monitors tables _consumerMonitorRegistrar . addConsumerToRegisteredMonitors ( mc , exactMonitorList , wildcardMonitorList ) ; if ( tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "addConsumerForKnownTopicExpr" ) ;
public class JSONParser { /** * read digits right of decimal point */ private int readFrac ( CharArr arr , int lim ) throws IOException { } }
nstate = HAS_FRACTION ; // deliberate set instead of ' | ' while ( -- lim >= 0 ) { int ch = getChar ( ) ; if ( ch >= '0' && ch <= '9' ) { arr . write ( ch ) ; } else if ( ch == 'e' || ch == 'E' ) { arr . write ( ch ) ; return readExp ( arr , lim ) ; } else { if ( ch != - 1 ) start -- ; // back up return NUMBER ; } } return BIGNUMBER ;
public class CmsPreferences { /** * Sets the " start folder " setting . < p > * @ param value the start folder to show in the explorer view */ public void setParamTabWpFolder ( String value ) { } }
// perform self - healing if ( ! getCms ( ) . existsResource ( value , CmsResourceFilter . IGNORE_EXPIRATION ) ) { value = "/" ; } m_userSettings . setStartFolder ( value ) ;
public class HBaseGridTableScreen { /** * Move the HTML input to the screen record fields . * @ param strSuffix value to add to the end of the field name before retrieving the param . * @ exception DBException File exception . * @ return bParamsFound True if params were found and moved . */ public int moveControlInput ( String strSuffix ) throws DBException { } }
int iDefaultParamsFound = DBConstants . NO_PARAMS_FOUND ; if ( ( ( ( GridScreen ) this . getScreenField ( ) ) . getEditing ( ) ) && ( this . getTask ( ) instanceof ServletTask ) ) { // First , go through all the params and find out which rows have been submitted . Record record = this . getMainRecord ( ) ; Record recCurrent = null ; ServletTask task = ( ServletTask ) this . getTask ( ) ; Map < String , Object > ht = task . getRequestProperties ( task . getServletRequest ( ) , false ) ; for ( String strParamName : ht . keySet ( ) ) { try { strParamName = URLDecoder . decode ( strParamName , DBConstants . URL_ENCODING ) ; } catch ( java . io . UnsupportedEncodingException ex ) { ex . printStackTrace ( ) ; } int iAtPosition = strParamName . indexOf ( '@' ) ; if ( iAtPosition != - 1 ) { // String strFieldName = strParamName . substring ( 0 , iAtPosition ) ; String strObjectID = strParamName . substring ( iAtPosition + 1 ) ; if ( ht . get ( strObjectID ) == null ) ht . put ( strObjectID , strObjectID ) ; // Add this unique row } } // Now go through each record ; read the record , update the fields , and update the record ( if changed ) . for ( String strObjectID : ht . keySet ( ) ) { int iRawDBType = ( record . getDatabaseType ( ) & DBConstants . TABLE_TYPE_MASK ) ; if ( ( iRawDBType == DBConstants . LOCAL ) || ( iRawDBType == DBConstants . REMOTE ) || ( iRawDBType == DBConstants . TABLE ) ) recCurrent = record . setHandle ( strObjectID , DBConstants . OBJECT_ID_HANDLE ) ; else { recCurrent = record . setHandle ( strObjectID , DBConstants . BOOKMARK_HANDLE ) ; // Non - persistent } if ( recCurrent != null ) if ( recCurrent . getEditMode ( ) == DBConstants . EDIT_CURRENT ) { recCurrent . edit ( ) ; // HACK - Change to lock on mod iDefaultParamsFound = super . moveControlInput ( '@' + strObjectID ) ; if ( recCurrent . isModified ( ) ) { recCurrent . set ( ) ; } } } } int iParamsFound = super . moveControlInput ( strSuffix ) ; if ( iParamsFound == DBConstants . NORMAL_RETURN ) iDefaultParamsFound = DBConstants . NORMAL_RETURN ; return iDefaultParamsFound ;
public class AWTResultListener { /** * documentation inherited from interface */ public void requestFailed ( final Exception cause ) { } }
EventQueue . invokeLater ( new Runnable ( ) { public void run ( ) { _target . requestFailed ( cause ) ; } } ) ;
public class Functions { /** * A { @ code Function } that always ignores its argument and throws an { @ link * IllegalArgumentException } . * @ return a { @ code Function } that always ignores its argument and throws an { @ link * IllegalArgumentException } . * @ since 0.5 */ public static < T > Function < Object , T > throwIllegalArgumentException ( ) { } }
// It is safe to cast this function to have any return type , since it never returns a result . @ SuppressWarnings ( "unchecked" ) Function < Object , T > function = ( Function < Object , T > ) THROW_ILLEGAL_ARGUMENT_EXCEPTION ; return function ;
public class UtilLepetitEPnP { /** * Linear constraint matrix used in case 4 in the general case * @ param L Constraint matrix * @ param y Vector containing distance between world control points * @ param controlWorldPts List of world control points * @ param nullPts Null points */ public static void constraintMatrix6x10 ( DMatrixRMaj L , DMatrixRMaj y , FastQueue < Point3D_F64 > controlWorldPts , List < Point3D_F64 > nullPts [ ] ) { } }
int row = 0 ; for ( int i = 0 ; i < 4 ; i ++ ) { Point3D_F64 ci = controlWorldPts . get ( i ) ; Point3D_F64 vai = nullPts [ 0 ] . get ( i ) ; Point3D_F64 vbi = nullPts [ 1 ] . get ( i ) ; Point3D_F64 vci = nullPts [ 2 ] . get ( i ) ; Point3D_F64 vdi = nullPts [ 3 ] . get ( i ) ; for ( int j = i + 1 ; j < 4 ; j ++ , row ++ ) { Point3D_F64 cj = controlWorldPts . get ( j ) ; Point3D_F64 vaj = nullPts [ 0 ] . get ( j ) ; Point3D_F64 vbj = nullPts [ 1 ] . get ( j ) ; Point3D_F64 vcj = nullPts [ 2 ] . get ( j ) ; Point3D_F64 vdj = nullPts [ 3 ] . get ( j ) ; y . set ( row , 0 , ci . distance2 ( cj ) ) ; double xa = vai . x - vaj . x ; double ya = vai . y - vaj . y ; double za = vai . z - vaj . z ; double xb = vbi . x - vbj . x ; double yb = vbi . y - vbj . y ; double zb = vbi . z - vbj . z ; double xc = vci . x - vcj . x ; double yc = vci . y - vcj . y ; double zc = vci . z - vcj . z ; double xd = vdi . x - vdj . x ; double yd = vdi . y - vdj . y ; double zd = vdi . z - vdj . z ; double da = xa * xa + ya * ya + za * za ; double db = xb * xb + yb * yb + zb * zb ; double dc = xc * xc + yc * yc + zc * zc ; double dd = xd * xd + yd * yd + zd * zd ; double dab = xa * xb + ya * yb + za * zb ; double dac = xa * xc + ya * yc + za * zc ; double dad = xa * xd + ya * yd + za * zd ; double dbc = xb * xc + yb * yc + zb * zc ; double dbd = xb * xd + yb * yd + zb * zd ; double dcd = xc * xd + yc * yd + zc * zd ; L . set ( row , 0 , da ) ; L . set ( row , 1 , 2 * dab ) ; L . set ( row , 2 , 2 * dac ) ; L . set ( row , 3 , 2 * dad ) ; L . set ( row , 4 , db ) ; L . set ( row , 5 , 2 * dbc ) ; L . set ( row , 6 , 2 * dbd ) ; L . set ( row , 7 , dc ) ; L . set ( row , 8 , 2 * dcd ) ; L . set ( row , 9 , dd ) ; } }
public class BeanBox { /** * Inject a pure value to Field */ public BeanBox injectValue ( String fieldName , Object constValue ) { } }
checkOrCreateFieldInjects ( ) ; Field f = ReflectionUtils . findField ( beanClass , fieldName ) ; BeanBox inject = new BeanBox ( ) ; inject . setTarget ( constValue ) ; inject . setType ( f . getType ( ) ) ; inject . setPureValue ( true ) ; ReflectionUtils . makeAccessible ( f ) ; this . getFieldInjects ( ) . put ( f , inject ) ; return this ;
public class RequestSigning { /** * Signs a set of request parameters . * Generates additional parameters to represent the timestamp and generated signature . * Uses the supplied pre - shared secret key to generate the signature . * @ param params List of NameValuePair instances containing the query parameters for the request that is to be signed * @ param secretKey the pre - shared secret key held by the client */ public static void constructSignatureForRequestParameters ( List < NameValuePair > params , String secretKey ) { } }
constructSignatureForRequestParameters ( params , secretKey , System . currentTimeMillis ( ) / 1000 ) ;
public class ReadOnlyRecordHandler { /** * Constructor . * @ param record My owner ( usually passed as null , and set on addListener in setOwner ( ) ) . * @ param iMainFilesField The sequence of the date changed field in this record . * @ param field The date changed field in this record . * @ param bNewOnChange If true , create a new record on change . */ public void init ( Record record , BaseField field , boolean bNewOnChange ) { } }
super . init ( record ) ; m_field = field ; m_bNewOnChange = bNewOnChange ;
public class ImageFailureMarshaller { /** * Marshall the given parameter object . */ public void marshall ( ImageFailure imageFailure , ProtocolMarshaller protocolMarshaller ) { } }
if ( imageFailure == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( imageFailure . getImageId ( ) , IMAGEID_BINDING ) ; protocolMarshaller . marshall ( imageFailure . getFailureCode ( ) , FAILURECODE_BINDING ) ; protocolMarshaller . marshall ( imageFailure . getFailureReason ( ) , FAILUREREASON_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class MPGRGImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public void eUnset ( int featureID ) { } }
switch ( featureID ) { case AfplibPackage . MPGRG__RG_LENGTH : setRGLength ( RG_LENGTH_EDEFAULT ) ; return ; case AfplibPackage . MPGRG__TRIPLETS : getTriplets ( ) . clear ( ) ; return ; } super . eUnset ( featureID ) ;
public class AbstractIoBuffer { /** * { @ inheritDoc } */ @ Override public IoBuffer putObject ( Object o ) { } }
int oldPos = position ( ) ; skip ( 4 ) ; // Make a room for the length field . try { ObjectOutputStream out = new ObjectOutputStream ( asOutputStream ( ) ) { @ Override protected void writeClassDescriptor ( ObjectStreamClass desc ) throws IOException { if ( desc . forClass ( ) . isPrimitive ( ) ) { write ( 0 ) ; super . writeClassDescriptor ( desc ) ; } else { write ( 1 ) ; writeUTF ( desc . getName ( ) ) ; } } } ; out . writeObject ( o ) ; out . flush ( ) ; } catch ( IOException e ) { throw new BufferDataException ( e ) ; } // Fill the length field int newPos = position ( ) ; position ( oldPos ) ; putInt ( newPos - oldPos - 4 ) ; position ( newPos ) ; return this ;
public class LocalPublisherManagerImpl { /** * Injects the cache - unfortunately this cannot be in start . Tests will rewire certain components which will in * turn reinject the cache , but they won ' t call the start method ! If the latter is fixed we can add this to start * method and add @ Inject to the variable . */ @ Inject public void inject ( @ ComponentName ( ASYNC_OPERATIONS_EXECUTOR ) ExecutorService asyncOperationsExecutor ) { } }
this . asyncScheduler = Schedulers . from ( asyncOperationsExecutor ) ;
public class DownloadRequestQueue { /** * Returns the current download state for a download request . * @ param downloadId * @ return */ int query ( int downloadId ) { } }
synchronized ( mCurrentRequests ) { for ( DownloadRequest request : mCurrentRequests ) { if ( request . getDownloadId ( ) == downloadId ) { return request . getDownloadState ( ) ; } } } return DownloadManager . STATUS_NOT_FOUND ;
public class StreamsUtils { /** * < p > Generates a stream of < code > Map . Entry & lt ; E , E & gt ; < / code > elements with all the cartesian product of the * elements of the provided stream with itself , in which the entries are such that the key is * strictly lesser than the value , using the natural order of < code > E < / code > . < / p > * < p > For a stream < code > { a , b , c } < / code > , a stream with the following elements is created : * < code > { ( a , b ) , ( a , c ) , ( b , c ) } < / code > , where * < code > ( a , b ) < / code > is the < code > Map . Entry < / code > with key < code > a < / code > and value < code > b < / code > . < / p > * < p > A < code > NullPointerException < / code > will be thrown if the provided stream is null . < / p > * @ param stream the processed stream * @ param < E > the type of the provided stream * @ return a stream of the cartesian product */ public static < E extends Comparable < ? super E > > Stream < Map . Entry < E , E > > crossProductNaturallyOrdered ( Stream < E > stream ) { } }
Objects . requireNonNull ( stream ) ; CrossProductOrderedSpliterator < E > spliterator = CrossProductOrderedSpliterator . ordered ( stream . spliterator ( ) , Comparator . naturalOrder ( ) ) ; return StreamSupport . stream ( spliterator , stream . isParallel ( ) ) . onClose ( stream :: close ) ;
public class SimpleJsonEncoder { /** * Append field with quotes and escape characters added , if required . * @ return this */ SimpleJsonEncoder appendToJSON ( final String key , final Object value ) { } }
if ( closed ) { throw new IllegalStateException ( "Encoder already closed" ) ; } if ( value != null ) { appendKey ( key ) ; if ( value instanceof Number ) { sb . append ( value . toString ( ) ) ; } else { sb . append ( QUOTE ) . append ( escapeString ( value . toString ( ) ) ) . append ( QUOTE ) ; } } return this ;
public class JIT_Tie { /** * dtkb */ private static void addDelegateMethod ( ClassWriter cw , String tieClassName , Set < String > classConstantFieldNames , String servantClassName , String servantDescriptor , Method method , String idlName , boolean isRmiRemote , int rmicCompatible ) throws EJBConfigurationException { } }
GeneratorAdapter mg ; Class < ? > [ ] methodParameters = method . getParameterTypes ( ) ; Type [ ] argTypes = getTypes ( methodParameters ) ; final int numArgs = argTypes . length ; Class < ? > returnClass = method . getReturnType ( ) ; Type returnType = Type . getType ( returnClass ) ; String methodDescriptor = Type . getMethodDescriptor ( returnType , argTypes ) ; Class < ? > [ ] checkedExceptions = DeploymentUtil . getCheckedExceptions ( method , isRmiRemote , DeploymentUtil . DeploymentTarget . TIE ) ; // d660332 Type [ ] checkedTypes = getTypes ( checkedExceptions ) ; int numChecked = checkedExceptions . length ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , INDENT + "adding method : " + idlName + " (Lorg/omg/CORBA_2_3/portable/InputStream;" + "Lorg/omg/CORBA/portable/ResponseHandler;)" + "Lorg/omg/CORBA/portable/OutputStream;" ) ; // private OutputStream < idl name > ( InputStream in , ResponseHandler reply ) // throws Throwable Type delegateReturnType = TYPE_CORBA_OutputStream ; Type [ ] delegateArgTypes = { TYPE_CORBA_2_3_InputStream , TYPE_CORBA_ResponseHandler } ; Type [ ] delegateExceptionTypes = { TYPE_Throwable } ; org . objectweb . asm . commons . Method m = new org . objectweb . asm . commons . Method ( idlName , delegateReturnType , delegateArgTypes ) ; // Create an ASM GeneratorAdapter object for the ASM Method , which // makes generating dynamic code much easier . . . as it keeps track // of the position of the arguements and local variables , etc . mg = new GeneratorAdapter ( ACC_PRIVATE , m , null , delegateExceptionTypes , cw ) ; // Begin Method Code . . . mg . visitCode ( ) ; /* * mg . visitFieldInsn ( GETSTATIC , " java / lang / System " , " out " , " Ljava / io / PrintStream ; " ) ; * mg . visitTypeInsn ( NEW , " java / lang / StringBuilder " ) ; * mg . visitInsn ( DUP ) ; * mg . visitMethodInsn ( INVOKESPECIAL , " java / lang / StringBuilder " , " < init > " , " ( ) V " ) ; * mg . visitLdcInsn ( idlName + " called ! ! " ) ; * mg . visitMethodInsn ( INVOKEVIRTUAL , " java / lang / StringBuilder " , " append " , " ( Ljava / lang / String ; ) Ljava / lang / StringBuilder ; " ) ; * mg . visitMethodInsn ( INVOKEVIRTUAL , " java / lang / StringBuilder " , " toString " , " ( ) Ljava / lang / String ; " ) ; * mg . visitMethodInsn ( INVOKEVIRTUAL , " java / io / PrintStream " , " println " , * " ( Ljava / lang / String ; ) V " ) ; */ // < arg type > argX = in . read _ < primitive > ( ) ; // or // < arg type > argX = ( < arg type > ) in . read _ value ( < arg class > ) ; // or // < arg type > argX = ( < arg type > ) in . read _ Object ( < arg class > ) ; / / CORBA . Object int [ ] argValues = new int [ numArgs ] ; for ( int i = 0 ; i < numArgs ; i ++ ) { JITUtils . setLineNumber ( mg , JITUtils . LINE_NUMBER_ARG_BEGIN + i ) ; // d726162 argValues [ i ] = mg . newLocal ( argTypes [ i ] ) ; mg . loadArg ( 0 ) ; read_value ( mg , tieClassName , classConstantFieldNames , // RTC111522 method , methodParameters [ i ] , argTypes [ i ] , rmicCompatible ) ; // d450525 mg . storeLocal ( argValues [ i ] ) ; } JITUtils . setLineNumber ( mg , JITUtils . LINE_NUMBER_DEFAULT ) ; // d726162 // / / The try / catch block is only needed if there are // / / checked exceptions other than RemoteException . // try Label try_begin = null ; if ( numChecked > 0 ) { try_begin = new Label ( ) ; mg . visitLabel ( try_begin ) ; } // target . < servant method > ( argX , argX , . . . ) ; // or // < return type > result = target . < servant method > ( argX , argX , . . . ) ; mg . loadThis ( ) ; mg . visitFieldInsn ( GETFIELD , tieClassName , "target" , servantDescriptor ) ; for ( int arg : argValues ) { mg . loadLocal ( arg ) ; } mg . visitMethodInsn ( INVOKEVIRTUAL , servantClassName , method . getName ( ) , methodDescriptor ) ; int result = - 1 ; if ( returnType != Type . VOID_TYPE ) { result = mg . newLocal ( returnType ) ; mg . storeLocal ( result ) ; } // } / / end of try - only when checked exceptions Label try_end = null ; Label try_catch_exit = null ; if ( numChecked > 0 ) { try_end = new Label ( ) ; mg . visitLabel ( try_end ) ; try_catch_exit = new Label ( ) ; mg . visitJumpInsn ( GOTO , try_catch_exit ) ; // jump past catch blocks } // / / For every checked exception ( that is NOT a RemoteException ) . // / / Note that the exceptions have been sorted in order , so that the // / / subclasses are first . . . to avoid ' unreachable ' code . // catch ( < exception type > ex ) // String id = < idl exception name > ; / / " IDL : xxx / XxxEx : 1.0" // 2_3 . OutputStream out = ( 2_3 . OutputStream ) reply . createExceptionReply ( ) ; // out . write _ string ( id ) ; // out . write _ value ( ex , < exception type > . class ) ; // return out ; Label [ ] catch_checked_labels = null ; if ( numChecked > 0 ) { catch_checked_labels = new Label [ numChecked ] ; for ( int i = 0 ; i < numChecked ; ++ i ) { JITUtils . setLineNumber ( mg , JITUtils . LINE_NUMBER_CATCH_BEGIN + i ) ; // d726162 // catch ( < exception type > ex ) Label catch_label = new Label ( ) ; catch_checked_labels [ i ] = catch_label ; mg . visitLabel ( catch_label ) ; int ex = mg . newLocal ( checkedTypes [ i ] ) ; mg . storeLocal ( ex ) ; // String id = < idl exception name > ; / / " IDL : xxx / XxxEx : 1.0" int id = mg . newLocal ( TYPE_String ) ; boolean mangleComponents = com . ibm . wsspi . ejbcontainer . JITDeploy . isRMICCompatibleExceptions ( rmicCompatible ) ; // PM94096 String exIdlName = getIdlExceptionName ( checkedExceptions [ i ] . getName ( ) , mangleComponents ) ; mg . visitLdcInsn ( exIdlName ) ; mg . storeLocal ( id ) ; // 2_3 . OutputStream out = ( 2_3 . OutputStream ) reply . createExceptionReply ( ) ; int out = mg . newLocal ( TYPE_CORBA_2_3_OutputStream ) ; mg . loadArg ( 1 ) ; mg . visitMethodInsn ( INVOKEINTERFACE , "org/omg/CORBA/portable/ResponseHandler" , "createExceptionReply" , "()Lorg/omg/CORBA/portable/OutputStream;" ) ; mg . checkCast ( TYPE_CORBA_2_3_OutputStream ) ; mg . storeLocal ( out ) ; // out . write _ string ( id ) ; mg . loadLocal ( out ) ; mg . loadLocal ( id ) ; mg . visitMethodInsn ( INVOKEVIRTUAL , "org/omg/CORBA/portable/OutputStream" , "write_string" , "(Ljava/lang/String;)V" ) ; // out . write _ value ( ex , < exception type > . class ) ; mg . loadLocal ( out ) ; mg . loadLocal ( ex ) ; JITUtils . loadClassConstant ( mg , tieClassName , classConstantFieldNames , checkedExceptions [ i ] ) ; // RTC111522 mg . visitMethodInsn ( INVOKEVIRTUAL , "org/omg/CORBA_2_3/portable/OutputStream" , "write_value" , "(Ljava/io/Serializable;Ljava/lang/Class;)V" ) ; // return out ; mg . loadLocal ( out ) ; mg . returnValue ( ) ; } mg . visitLabel ( try_catch_exit ) ; } JITUtils . setLineNumber ( mg , JITUtils . LINE_NUMBER_RETURN ) ; // d726162 // OutputStream out = reply . createReply ( ) ; // or // CORBA _ 2_3 . OutputStream out = ( CORBA _ 2_3 . OutputStream ) reply . createReply ( ) ; Type outType = CORBA_Utils . getRequiredOutputStreamType ( returnClass , rmicCompatible ) ; // PM46698 int out = mg . newLocal ( TYPE_CORBA_OutputStream ) ; mg . loadArg ( 1 ) ; mg . visitMethodInsn ( INVOKEINTERFACE , "org/omg/CORBA/portable/ResponseHandler" , "createReply" , "()Lorg/omg/CORBA/portable/OutputStream;" ) ; if ( outType != TYPE_CORBA_OutputStream ) { mg . checkCast ( outType ) ; } mg . storeLocal ( out ) ; // out . write _ < primitive > ( result ) ; // or // out . write _ value ( result , < class > ) ; // or // Util . writeAny ( out , result ) ; // or // Util . writeRemoteObject ( out , result ) ; if ( returnType != Type . VOID_TYPE ) { mg . loadLocal ( out ) ; mg . loadLocal ( result ) ; write_value ( mg , tieClassName , classConstantFieldNames , // RTC111522 method , returnClass , rmicCompatible ) ; // d450525 , PM46698 } // return out ; mg . loadLocal ( out ) ; mg . returnValue ( ) ; // All Try - Catch - Finally definitions for above for ( int i = 0 ; i < numChecked ; ++ i ) { String exName = convertClassName ( checkedExceptions [ i ] . getName ( ) ) ; mg . visitTryCatchBlock ( try_begin , try_end , catch_checked_labels [ i ] , exName ) ; } // End Method Code . . . mg . endMethod ( ) ; // GeneratorAdapter accounts for visitMaxs ( x , y ) mg . visitEnd ( ) ;
public class ResponseImpl { /** * Get the first header value for the given header name , if it exists . * @ param name the name of the header to get * @ return the first value of the given header name */ public String getFirstHeader ( String name ) { } }
List < String > headerValues = getHeader ( name ) ; if ( headerValues == null || headerValues . size ( ) == 0 ) { return null ; } return headerValues . get ( 0 ) ;
public class FileUtil { /** * 计算文件校验码 * @ param file 文件 , 不能为目录 * @ param checksum { @ link Checksum } * @ return Checksum * @ throws IORuntimeException IO异常 * @ since 4.0.6 */ public static Checksum checksum ( File file , Checksum checksum ) throws IORuntimeException { } }
Assert . notNull ( file , "File is null !" ) ; if ( file . isDirectory ( ) ) { throw new IllegalArgumentException ( "Checksums can't be computed on directories" ) ; } try { return IoUtil . checksum ( new FileInputStream ( file ) , checksum ) ; } catch ( FileNotFoundException e ) { throw new IORuntimeException ( e ) ; }
public class OAIResponder { /** * Appends an XML - appropriate encoding of the given character to the given * StringBuffer . * @ param in * The character . * @ param out * The StringBuffer to write to . */ private static void enc ( char in , StringBuilder out ) { } }
if ( in == '&' ) { out . append ( "&amp;" ) ; } else if ( in == '<' ) { out . append ( "&lt;" ) ; } else if ( in == '>' ) { out . append ( "&gt;" ) ; } else if ( in == '\"' ) { out . append ( "&quot;" ) ; } else if ( in == '\'' ) { out . append ( "&apos;" ) ; } else { out . append ( in ) ; }
public class Distributions { /** * Updates as new distribution that contains value added to an existing one . * @ param value the sample value * @ param distribution a { @ code Distribution } * @ return the updated distribution */ public static Distribution addSample ( double value , Distribution distribution ) { } }
Builder builder = distribution . toBuilder ( ) ; switch ( distribution . getBucketOptionCase ( ) ) { case EXPLICIT_BUCKETS : updateStatistics ( value , builder ) ; updateExplicitBuckets ( value , builder ) ; return builder . build ( ) ; case EXPONENTIAL_BUCKETS : updateStatistics ( value , builder ) ; updateExponentialBuckets ( value , builder ) ; return builder . build ( ) ; case LINEAR_BUCKETS : updateStatistics ( value , builder ) ; updateLinearBuckets ( value , builder ) ; return builder . build ( ) ; default : throw new IllegalArgumentException ( MSG_UNKNOWN_BUCKET_OPTION_TYPE ) ; }
public class AmqpRunnableFactory { /** * Creates a new { @ link ExchangePublisher } . The callback is called to convert an object that is sent into the ExchangePublisher * into an AMQP byte array . . */ public < T > ExchangePublisher < T > createExchangePublisher ( final String name , final PublisherCallback < T > messageCallback ) { } }
Preconditions . checkState ( connectionFactory != null , "connection factory was never injected!" ) ; return new ExchangePublisher < T > ( connectionFactory , amqpConfig , name , messageCallback ) ;
public class MethodParameters { /** * Returns the { @ link MethodParameter } with the given name or { @ literal null } if none found . * @ param name must not be { @ literal null } or empty . * @ return */ public Optional < MethodParameter > getParameter ( String name ) { } }
Assert . hasText ( name , "Parameter name must not be null!" ) ; return getParameters ( ) . stream ( ) . filter ( it -> name . equals ( it . getParameterName ( ) ) ) . findFirst ( ) ;
public class ConvexHull { /** * Adds a geometry to the current bounding geometry using an incremental algorithm for dynamic insertion . * @ param geometry The geometry to add to the bounding geometry . */ void addGeometry ( Geometry geometry ) { } }
if ( geometry . isEmpty ( ) ) return ; int type = geometry . getType ( ) . value ( ) ; if ( MultiVertexGeometry . isMultiVertex ( type ) ) addMultiVertexGeometry_ ( ( MultiVertexGeometry ) geometry ) ; else if ( MultiPath . isSegment ( type ) ) addSegment_ ( ( Segment ) geometry ) ; else if ( type == Geometry . GeometryType . Envelope ) addEnvelope_ ( ( Envelope ) geometry ) ; else if ( type == Geometry . GeometryType . Point ) addPoint_ ( ( Point ) geometry ) ; else throw new IllegalArgumentException ( "invalid shape type" ) ;
public class RamDisk { /** * Reads a GZIP compressed disk image from the specified input stream and * returns a { @ code RamDisk } holding the decompressed image . * @ param in the stream to read the disk image from * @ return the decompressed { @ code RamDisk } * @ throws IOException on read or decompression error */ public static RamDisk readGzipped ( InputStream in ) throws IOException { } }
final GZIPInputStream zis = new GZIPInputStream ( in ) ; ByteArrayOutputStream bos = new ByteArrayOutputStream ( ) ; final byte [ ] buffer = new byte [ 4096 ] ; int read = zis . read ( buffer ) ; int total = 0 ; while ( read >= 0 ) { total += read ; bos . write ( buffer , 0 , read ) ; read = zis . read ( buffer ) ; } if ( total < DEFAULT_SECTOR_SIZE ) throw new IOException ( "read only " + total + " bytes" ) ; // NOI18N final ByteBuffer bb = ByteBuffer . wrap ( bos . toByteArray ( ) , 0 , total ) ; return new RamDisk ( bb , DEFAULT_SECTOR_SIZE ) ;
public class CompilerConfiguration { /** * Sets the target directory . */ public void setTargetDirectory ( String directory ) { } }
if ( directory != null && directory . length ( ) > 0 ) { this . targetDirectory = new File ( directory ) ; } else { this . targetDirectory = null ; }
public class Crypto { /** * Encrypt a text using public key * @ param text The plain text * @ param key The public key * @ return Encrypted text * @ throws MangooEncryptionException if encryption fails */ public byte [ ] encrypt ( byte [ ] text , PublicKey key ) throws MangooEncryptionException { } }
Objects . requireNonNull ( text , Required . PLAIN_TEXT . toString ( ) ) ; Objects . requireNonNull ( text , Required . PUBLIC_KEY . toString ( ) ) ; byte [ ] encrypt = null ; try { Cipher cipher = Cipher . getInstance ( ENCRYPTION ) ; cipher . init ( Cipher . ENCRYPT_MODE , key ) ; encrypt = cipher . doFinal ( text ) ; } catch ( NoSuchAlgorithmException | NoSuchPaddingException | IllegalBlockSizeException | BadPaddingException | InvalidKeyException e ) { throw new MangooEncryptionException ( "Failed to encrypt clear text with public key" , e ) ; } return encrypt ;
public class SheetResourcesImpl { /** * < p > Get a sheet . < / p > * < p > It mirrors to the following Smartsheet REST API method : GET / sheet / { id } < / p > * @ param id the id of the sheet * @ param includes used to specify the optional objects to include . * @ param columnIds the column ids * @ param excludes the exclude parameters * @ param page the page number * @ param pageSize the page size * @ param rowIds the row ids * @ param rowNumbers the row numbers * @ param ifVersionAfter only fetch Sheet if more recent version available * @ param level compatibility level * @ return the sheet resource ( note that if there is no such resource , this method will throw * ResourceNotFoundException rather than returning null ) . * @ throws IllegalArgumentException if any argument is null or empty string * @ throws InvalidRequestException if there is any problem with the REST API request * @ throws AuthorizationException if there is any problem with the REST API authorization ( access token ) * @ throws ResourceNotFoundException if the resource cannot be found * @ throws ServiceUnavailableException if the REST API service is not available ( possibly due to rate limiting ) * @ throws SmartsheetException if there is any other error during the operation */ public Sheet getSheet ( long id , EnumSet < SheetInclusion > includes , EnumSet < ObjectExclusion > excludes , Set < Long > rowIds , Set < Integer > rowNumbers , Set < Long > columnIds , Integer pageSize , Integer page , Integer ifVersionAfter , Integer level ) throws SmartsheetException { } }
String path = "sheets/" + id ; // Add the parameters to a map and build the query string at the end HashMap < String , Object > parameters = new HashMap < String , Object > ( ) ; parameters . put ( "include" , QueryUtil . generateCommaSeparatedList ( includes ) ) ; parameters . put ( "exclude" , QueryUtil . generateCommaSeparatedList ( excludes ) ) ; parameters . put ( "rowIds" , QueryUtil . generateCommaSeparatedList ( rowIds ) ) ; parameters . put ( "rowNumbers" , QueryUtil . generateCommaSeparatedList ( rowNumbers ) ) ; parameters . put ( "columnIds" , QueryUtil . generateCommaSeparatedList ( columnIds ) ) ; parameters . put ( "pageSize" , pageSize ) ; parameters . put ( "page" , page ) ; parameters . put ( "ifVersionAfter" , ifVersionAfter ) ; parameters . put ( "level" , level ) ; // Iterate through the map of parameters and generate the query string path += QueryUtil . generateUrl ( null , parameters ) ; return this . getResource ( path , Sheet . class ) ;
public class Transpose { /** * Transpose a graph . Note that the original graph is not modified ; the new * graph and its vertices and edges are new objects . * @ param orig * the graph to transpose * @ param toolkit * a GraphToolkit to be used to create the transposed Graph * @ return the transposed Graph */ public GraphType transpose ( GraphType orig , GraphToolkit < GraphType , EdgeType , VertexType > toolkit ) { } }
GraphType trans = toolkit . createGraph ( ) ; // For each vertex in original graph , create an equivalent // vertex in the transposed graph , // ensuring that vertex labels in the transposed graph // match vertex labels in the original graph for ( Iterator < VertexType > i = orig . vertexIterator ( ) ; i . hasNext ( ) ; ) { VertexType v = i . next ( ) ; // Make a duplicate of original vertex // ( Ensuring that transposed graph has same labeling as original ) VertexType dupVertex = toolkit . duplicateVertex ( v ) ; dupVertex . setLabel ( v . getLabel ( ) ) ; trans . addVertex ( v ) ; // Keep track of correspondence between equivalent vertices m_origToTransposeMap . put ( v , dupVertex ) ; m_transposeToOrigMap . put ( dupVertex , v ) ; } trans . setNumVertexLabels ( orig . getNumVertexLabels ( ) ) ; // For each edge in the original graph , create a reversed edge // in the transposed graph for ( Iterator < EdgeType > i = orig . edgeIterator ( ) ; i . hasNext ( ) ; ) { EdgeType e = i . next ( ) ; VertexType transSource = m_origToTransposeMap . get ( e . getTarget ( ) ) ; VertexType transTarget = m_origToTransposeMap . get ( e . getSource ( ) ) ; EdgeType dupEdge = trans . createEdge ( transSource , transTarget ) ; dupEdge . setLabel ( e . getLabel ( ) ) ; // Copy auxiliary information for edge toolkit . copyEdge ( e , dupEdge ) ; } trans . setNumEdgeLabels ( orig . getNumEdgeLabels ( ) ) ; return trans ;
public class AbstractRule { /** * Send property change notification to attached listeners . * @ param propertyName property name . * @ param oldVal old value . * @ param newVal new value . */ protected void firePropertyChange ( final String propertyName , final Object oldVal , final Object newVal ) { } }
propertySupport . firePropertyChange ( propertyName , oldVal , newVal ) ;
public class JcrNodeType { /** * { @ inheritDoc } * @ return the array of names of supertypes declared for this node ; possibly empty , never null */ @ Override public String [ ] getDeclaredSupertypeNames ( ) { } }
List < String > supertypeNames = new ArrayList < String > ( declaredSupertypes . size ( ) ) ; for ( JcrNodeType declaredSupertype : declaredSupertypes ) { supertypeNames . add ( declaredSupertype . getName ( ) ) ; } // Always have to make a copy to prevent changes . . . return supertypeNames . toArray ( new String [ supertypeNames . size ( ) ] ) ;
public class XMLElement { /** * Get the names of the attributes specified on this element * @ return The names of the elements specified */ public String [ ] getAttributeNames ( ) { } }
NamedNodeMap map = dom . getAttributes ( ) ; String [ ] names = new String [ map . getLength ( ) ] ; for ( int i = 0 ; i < names . length ; i ++ ) { names [ i ] = map . item ( i ) . getNodeName ( ) ; } return names ;
public class BindTableGenerator { /** * A generated element can have only a primary key and two FK . * @ param entity * the entity * @ param unique * the unique * @ param counter * the counter * @ return the pair */ public static Triple < String , String , String > buildIndexes ( final GeneratedTypeElement entity , boolean unique , int counter ) { } }
Triple < String , String , String > result = new Triple < > ( ) ; result . value0 = "" ; result . value1 = "" ; result . value2 = "" ; List < String > indexes = entity . index ; String uniqueString ; uniqueString = "UNIQUE " ; if ( indexes == null || indexes . size ( ) == 0 ) return result ; List < String > listCreateIndex = new ArrayList < > ( ) ; List < String > listDropIndex = new ArrayList < > ( ) ; for ( String index : indexes ) { String createIndex = String . format ( " CREATE %sINDEX idx_%s_%s on %s (%s)" , uniqueString , entity . getTableName ( ) , counter ++ , entity . getTableName ( ) , index ) ; String dropIndex = String . format ( " DROP INDEX IF EXISTS idx_%s_%s" , entity . getTableName ( ) , counter ) ; listCreateIndex . add ( createIndex ) ; listDropIndex . add ( dropIndex ) ; } result . value0 = StringUtils . join ( listCreateIndex , ";" ) ; result . value1 = StringUtils . join ( listDropIndex , ";" ) ; return result ;
public class NfsFileBase { /** * ( non - Javadoc ) * @ see com . emc . ecs . nfsclient . nfs . NfsFile # symlink ( java . lang . String , * com . emc . ecs . nfsclient . nfs . NfsSetAttributes ) */ public NfsSymlinkResponse symlink ( String symbolicLinkData , NfsSetAttributes attributes ) throws IOException { } }
NfsSymlinkResponse response = getNfs ( ) . wrapped_sendSymlink ( makeSymlinkRequest ( symbolicLinkData , attributes ) ) ; setFileHandle ( response . getFileHandle ( ) ) ; return response ;
public class RocMetric { /** * Sum in - place to avoid new object alloc */ public RocMetric addIn ( RocMetric other ) { } }
// Sum tpr , fpr for each threshold int i = 0 ; // start from 1 , 0 - index is for threshold value int j = 1 ; while ( i < this . pred . length ) { if ( this . pred [ i ] != null ) { if ( other . pred [ i ] != null ) { j = 1 ; // P = P + P // N = N + N while ( j < this . pred [ i ] . length ) { this . pred [ i ] [ j ] = this . pred [ i ] [ j ] + other . pred [ i ] [ j ] ; j ++ ; } } } else { if ( other . pred [ i ] != null ) { j = 0 ; // P = P + P // N = N + N // this . pred [ i ] is currently null so need to cretae new instance this . pred [ i ] = new double [ 3 ] ; while ( j < other . pred [ i ] . length ) { this . pred [ i ] [ j ] = other . pred [ i ] [ j ] ; j = j + 1 ; } } } i = i + 1 ; } return ( this ) ;
public class SerializationUtils { /** * Wrapper around { @ link # serialize ( Object ) } which throws a runtime exception with the given * message on failure . * @ param obj the object the serialize * @ param errorMessage the message to show if serialization fails * @ return the serialized bytes */ public static byte [ ] serialize ( Object obj , String errorMessage ) { } }
try { return serialize ( obj ) ; } catch ( IOException e ) { throw new RuntimeException ( errorMessage , e ) ; }
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EEnum getIfcAnalysisModelTypeEnum ( ) { } }
if ( ifcAnalysisModelTypeEnumEEnum == null ) { ifcAnalysisModelTypeEnumEEnum = ( EEnum ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 779 ) ; } return ifcAnalysisModelTypeEnumEEnum ;
public class RegistriesInner { /** * Schedules a new run based on the request parameters and add it to the run queue . * @ param resourceGroupName The name of the resource group to which the container registry belongs . * @ param registryName The name of the container registry . * @ param runRequest The parameters of a run that needs to scheduled . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ throws CloudException thrown if the request is rejected by server * @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @ return the RunInner object if successful . */ public RunInner scheduleRun ( String resourceGroupName , String registryName , RunRequest runRequest ) { } }
return scheduleRunWithServiceResponseAsync ( resourceGroupName , registryName , runRequest ) . toBlocking ( ) . last ( ) . body ( ) ;
public class FieldInjectionPoint { /** * Creates an injection point without firing the { @ link ProcessInjectionPoint } event . */ public static < T , X > FieldInjectionPoint < T , X > silent ( FieldInjectionPointAttributes < T , X > attributes ) { } }
return new FieldInjectionPoint < T , X > ( attributes ) ;
public class HierarchyWrapper { /** * Traverses the initial xml element wrapper and builds hierarchy */ void createWrappedStructure ( final WrapperFactory factory ) { } }
HierarchyWrapper currentWrapper = null ; for ( Content child : castToContentList ( elementContent ) ) { Wrapper < ? > wrapper = factory . create ( child ) ; if ( wrapper instanceof SingleNewlineInTextWrapper ) { continue ; } if ( currentWrapper == null ) { currentWrapper = new HierarchyWrapper ( wrapper ) ; children . add ( currentWrapper ) ; } else { currentWrapper . addContent ( wrapper ) ; } if ( currentWrapper . containsElement ( ) ) { currentWrapper . createWrappedStructure ( factory ) ; currentWrapper = null ; } }
public class IdentityPoolShortDescriptionMarshaller { /** * Marshall the given parameter object . */ public void marshall ( IdentityPoolShortDescription identityPoolShortDescription , ProtocolMarshaller protocolMarshaller ) { } }
if ( identityPoolShortDescription == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( identityPoolShortDescription . getIdentityPoolId ( ) , IDENTITYPOOLID_BINDING ) ; protocolMarshaller . marshall ( identityPoolShortDescription . getIdentityPoolName ( ) , IDENTITYPOOLNAME_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class ClientBehaviorBase { /** * { @ inheritDoc } */ public String getScript ( ClientBehaviorContext behaviorContext ) { } }
if ( behaviorContext == null ) { throw new NullPointerException ( "behaviorContext" ) ; } ClientBehaviorRenderer renderer = getRenderer ( behaviorContext . getFacesContext ( ) ) ; if ( renderer != null ) { // If a BehaviorRenderer is available for the specified behavior renderer type , this method delegates // to the BehaviorRenderer . getScript method . try { setCachedFacesContext ( behaviorContext . getFacesContext ( ) ) ; return renderer . getScript ( behaviorContext , this ) ; } finally { setCachedFacesContext ( null ) ; } } // Otherwise , this method returns null . return null ;
public class BaseDateTimeType { /** * Sets the nanoseconds within the current second * Note that this method sets the * same value as { @ link # setMillis ( int ) } but with more precision . */ public BaseDateTimeType setNanos ( long theNanos ) { } }
validateValueInRange ( theNanos , 0 , NANOS_PER_SECOND - 1 ) ; String fractionalSeconds = StringUtils . leftPad ( Long . toString ( theNanos ) , 9 , '0' ) ; // Strip trailing 0s for ( int i = fractionalSeconds . length ( ) ; i > 0 ; i -- ) { if ( fractionalSeconds . charAt ( i - 1 ) != '0' ) { fractionalSeconds = fractionalSeconds . substring ( 0 , i ) ; break ; } } int millis = ( int ) ( theNanos / NANOS_PER_MILLIS ) ; setFieldValue ( Calendar . MILLISECOND , millis , fractionalSeconds , 0 , 999 ) ; return this ;
public class Money { /** * Creates a new instance of { @ link Money } , using the default * { @ link MonetaryContext } . * @ param currency The target currency , not null . * @ param number The numeric part , not null . * @ return A new instance of { @ link Money } . * @ throws ArithmeticException If the number exceeds the capabilities of the default * { @ link MonetaryContext } used . */ public static Money of ( Number number , CurrencyUnit currency ) { } }
return new Money ( MoneyUtils . getBigDecimal ( number ) , currency ) ;
public class JMElasticsearchClient { /** * Is exists boolean . * @ param index the index * @ return the boolean */ public boolean isExists ( String index ) { } }
IndicesExistsRequestBuilder indicesExistsRequestBuilder = admin ( ) . indices ( ) . prepareExists ( index ) ; return JMElasticsearchUtil . logRequestQueryAndReturn ( "isExists" , indicesExistsRequestBuilder , indicesExistsRequestBuilder . execute ( ) ) . isExists ( ) ;
public class SdpComparator { /** * Negotiates the audio formats to be used in the call . * @ param sdp The session description * @ param formats The available formats * @ return The supported formats . If no formats are supported the returned list will be empty . */ public RTPFormats negotiateAudio ( SessionDescription sdp , RTPFormats formats ) { } }
this . audio . clean ( ) ; MediaDescriptorField descriptor = sdp . getAudioDescriptor ( ) ; descriptor . getFormats ( ) . intersection ( formats , this . audio ) ; return this . audio ;
public class WTree { /** * { @ inheritDoc } */ @ Override protected boolean beforeHandleRequest ( final Request request ) { } }
// Clear open request ( if set ) setOpenRequestItemId ( null ) ; // Check if is targeted request ( ie item image ) String targetParam = request . getParameter ( Environment . TARGET_ID ) ; boolean targetted = ( targetParam != null && targetParam . equals ( getTargetId ( ) ) ) ; if ( targetted ) { handleItemImageRequest ( request ) ; return false ; } // Check if open item request if ( isOpenItemRequest ( request ) ) { // Set the expanded rows handleExpandedState ( request ) ; // Handle open request handleOpenItemRequest ( request ) ; return false ; } // Check if shuffle items if ( isShuffle ( ) && isShuffleRequest ( request ) ) { handleShuffleState ( request ) ; return false ; } return true ;
public class HtmlBuilder { /** * End an element . * @ param element Tag name */ public T end ( String element ) throws IOException { } }
writer . write ( "</" ) ; writer . write ( element ) ; writer . write ( '>' ) ; return ( T ) this ;
public class CreateTrainingJobRequest { /** * Algorithm - specific parameters that influence the quality of the model . You set hyperparameters before you start * the learning process . For a list of hyperparameters for each training algorithm provided by Amazon SageMaker , see * < a href = " https : / / docs . aws . amazon . com / sagemaker / latest / dg / algos . html " > Algorithms < / a > . * You can specify a maximum of 100 hyperparameters . Each hyperparameter is a key - value pair . Each key and value is * limited to 256 characters , as specified by the < code > Length Constraint < / code > . * @ param hyperParameters * Algorithm - specific parameters that influence the quality of the model . You set hyperparameters before you * start the learning process . For a list of hyperparameters for each training algorithm provided by Amazon * SageMaker , see < a href = " https : / / docs . aws . amazon . com / sagemaker / latest / dg / algos . html " > Algorithms < / a > . < / p > * You can specify a maximum of 100 hyperparameters . Each hyperparameter is a key - value pair . Each key and * value is limited to 256 characters , as specified by the < code > Length Constraint < / code > . * @ return Returns a reference to this object so that method calls can be chained together . */ public CreateTrainingJobRequest withHyperParameters ( java . util . Map < String , String > hyperParameters ) { } }
setHyperParameters ( hyperParameters ) ; return this ;
public class PortletPreferencesJsonDaoImpl { /** * Read the specified portlet preference and parse it as a JSON string into a { @ link JsonNode } * If the preference is null returns a { @ link JSONObject } . * @ param prefs Preferences to read from * @ param key Preference key to read from */ @ Override public JsonNode getJsonNode ( PortletPreferences prefs , String key ) throws IOException { } }
final String prefValue = StringUtils . trimToNull ( prefs . getValue ( key , null ) ) ; if ( prefValue == null ) { // Default to an empty object return mapper . createObjectNode ( ) ; } return mapper . readTree ( prefValue ) ;
public class Timestamp { /** * Returns a new Timestamp that represents the point in time , precision * and local offset defined in Ion format by the { @ link CharSequence } . * @ param ionFormattedTimestamp * a sequence of characters that is the Ion representation of a * Timestamp * @ throws IllegalArgumentException * if the { @ code CharSequence } is an invalid Ion representation * of a Timestamp ; * or if the { @ code CharSequence } has excess characters which * are not one of the following valid thirteen numeric - stop * characters ( escaped accordingly for readability ) : * < code > { } [ ] ( ) , \ " \ ' \ \ t \ n \ r } < / code > * @ return * { @ code null } if the { @ code CharSequence } is " null . timestamp " * @ see < a href = " http : / / amzn . github . io / ion - docs / docs / spec . html # timestamp " > Ion Timestamp Page < / a > * @ see < a href = " http : / / www . w3 . org / TR / NOTE - datetime " > W3C Note on Date and Time Formats < / a > */ public static Timestamp valueOf ( CharSequence ionFormattedTimestamp ) { } }
final CharSequence in = ionFormattedTimestamp ; int pos ; final int length = in . length ( ) ; if ( length == 0 ) { throw fail ( in ) ; } // check for ' null . timestamp ' if ( in . charAt ( 0 ) == 'n' ) { if ( length >= LEN_OF_NULL_IMAGE && NULL_TIMESTAMP_IMAGE . contentEquals ( in . subSequence ( 0 , LEN_OF_NULL_IMAGE ) ) ) { if ( length > LEN_OF_NULL_IMAGE ) { if ( ! isValidFollowChar ( in . charAt ( LEN_OF_NULL_IMAGE ) ) ) { throw fail ( in ) ; } } return null ; } throw fail ( in ) ; } int year = 1 ; int month = 1 ; int day = 1 ; int hour = 0 ; int minute = 0 ; int seconds = 0 ; BigDecimal fraction = null ; Precision precision ; // fake label to turn goto ' s into a break so Java is happy : ) enjoy do { // otherwise we expect yyyy - mm - ddThh : mm : ss . ssss + hh : mm if ( length < END_OF_YEAR + 1 ) { // + 1 for the " T " throw fail ( in , "year is too short (must be at least yyyyT)" ) ; } pos = END_OF_YEAR ; precision = Precision . YEAR ; year = read_digits ( in , 0 , 4 , - 1 , "year" ) ; char c = in . charAt ( END_OF_YEAR ) ; if ( c == 'T' ) break ; if ( c != '-' ) { throw fail ( in , "expected \"-\" between year and month, found " + printCodePointAsString ( c ) ) ; } if ( length < END_OF_MONTH + 1 ) { // + 1 for the " T " throw fail ( in , "month is too short (must be yyyy-mmT)" ) ; } pos = END_OF_MONTH ; precision = Precision . MONTH ; month = read_digits ( in , END_OF_YEAR + 1 , 2 , - 1 , "month" ) ; c = in . charAt ( END_OF_MONTH ) ; if ( c == 'T' ) break ; if ( c != '-' ) { throw fail ( in , "expected \"-\" between month and day, found " + printCodePointAsString ( c ) ) ; } if ( length < END_OF_DAY ) { throw fail ( in , "too short for yyyy-mm-dd" ) ; } pos = END_OF_DAY ; precision = Precision . DAY ; day = read_digits ( in , END_OF_MONTH + 1 , 2 , - 1 , "day" ) ; if ( length == END_OF_DAY ) break ; c = in . charAt ( END_OF_DAY ) ; if ( c != 'T' ) { throw fail ( in , "expected \"T\" after day, found " + printCodePointAsString ( c ) ) ; } if ( length == END_OF_DAY + 1 ) break ; // now lets see if we have a time value if ( length < END_OF_MINUTES ) { throw fail ( in , "too short for yyyy-mm-ddThh:mm" ) ; } hour = read_digits ( in , 11 , 2 , ':' , "hour" ) ; minute = read_digits ( in , 14 , 2 , - 1 , "minutes" ) ; pos = END_OF_MINUTES ; precision = Precision . MINUTE ; // we may have seconds if ( length <= END_OF_MINUTES || in . charAt ( END_OF_MINUTES ) != ':' ) { break ; } if ( length < END_OF_SECONDS ) { throw fail ( in , "too short for yyyy-mm-ddThh:mm:ss" ) ; } seconds = read_digits ( in , 17 , 2 , - 1 , "seconds" ) ; pos = END_OF_SECONDS ; precision = Precision . SECOND ; if ( length <= END_OF_SECONDS || in . charAt ( END_OF_SECONDS ) != '.' ) { break ; } pos = END_OF_SECONDS + 1 ; while ( length > pos && Character . isDigit ( in . charAt ( pos ) ) ) { pos ++ ; } if ( pos <= END_OF_SECONDS + 1 ) { throw fail ( in , "must have at least one digit after decimal point" ) ; } fraction = new BigDecimal ( in . subSequence ( 19 , pos ) . toString ( ) ) ; } while ( false ) ; Integer offset ; // now see if they included a timezone offset char timezone_start = pos < length ? in . charAt ( pos ) : '\n' ; if ( timezone_start == 'Z' ) { offset = 0 ; pos ++ ; } else if ( timezone_start == '+' || timezone_start == '-' ) { if ( length < pos + 5 ) { throw fail ( in , "local offset too short" ) ; } // + / - hh : mm pos ++ ; int tzdHours = read_digits ( in , pos , 2 , ':' , "local offset hours" ) ; if ( tzdHours < 0 || tzdHours > 23 ) { throw fail ( in , "local offset hours must be between 0 and 23 inclusive" ) ; } pos += 3 ; int tzdMinutes = read_digits ( in , pos , 2 , - 1 , "local offset minutes" ) ; if ( tzdMinutes > 59 ) { throw fail ( in , "local offset minutes must be between 0 and 59 inclusive" ) ; } pos += 2 ; int temp = tzdHours * 60 + tzdMinutes ; if ( timezone_start == '-' ) { temp = - temp ; } if ( temp == 0 && timezone_start == '-' ) { // int doesn ' t do negative zero very elegantly offset = null ; } else { offset = temp ; } } else { switch ( precision ) { case YEAR : case MONTH : case DAY : break ; default : throw fail ( in , "missing local offset" ) ; } offset = null ; } if ( length > ( pos + 1 ) && ! isValidFollowChar ( in . charAt ( pos + 1 ) ) ) { throw fail ( in , "invalid excess characters" ) ; } Timestamp ts = new Timestamp ( precision , year , month , day , hour , minute , seconds , fraction , offset , APPLY_OFFSET_YES ) ; return ts ;
public class ResourceAction { /** * Copy resource input stream to HTTP response output stream using * a 64kib buffer */ private void copyStream ( InputStream inputStream ) throws IOException { } }
OutputStream outputStream = null ; try { outputStream = getContext ( ) . getOutputStream ( ) ; byte [ ] buffer = new byte [ 65535 ] ; int bufferLen ; int totalLen = 0 ; while ( ( bufferLen = inputStream . read ( buffer ) ) > 0 ) { outputStream . write ( buffer , 0 , bufferLen ) ; totalLen += bufferLen ; } getContext ( ) . getResponse ( ) . setContentLength ( totalLen ) ; } finally { if ( outputStream != null ) { outputStream . flush ( ) ; } }
public class SolarTime { /** * / * [ deutsch ] * < p > Ermittelt die mittlere Ortszeit zur angegebenen lokalen Zeitzonendifferenz . < / p > * @ param offset the time zone offset which might depend on the geographical longitude * @ return function for getting the mean solar time * @ see ZonalOffset # atLongitude ( OffsetSign , int , int , double ) */ public static ChronoFunction < Moment , PlainTimestamp > onAverage ( ZonalOffset offset ) { } }
return context -> onAverage ( context , offset ) ;
public class JvmIntAnnotationValueImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public boolean eIsSet ( int featureID ) { } }
switch ( featureID ) { case TypesPackage . JVM_INT_ANNOTATION_VALUE__VALUES : return values != null && ! values . isEmpty ( ) ; } return super . eIsSet ( featureID ) ;
public class GeometryType { /** * Returns the value geometry type parameter . * @ return the geometry type or < code > null < / code > if not present . */ public String getGeometryType ( ) { } }
String geometryType = null ; if ( getParameters ( ) . length > 0 && getParameters ( ) [ 0 ] != null ) { geometryType = getParameters ( ) [ 0 ] . toString ( ) ; } return geometryType ;
public class CompleteIntrospector { /** * Test program . */ public static void main ( String [ ] args ) throws Exception { } }
Map map = getAllProperties ( Class . forName ( args [ 0 ] ) ) ; Iterator keys = map . keySet ( ) . iterator ( ) ; while ( keys . hasNext ( ) ) { String key = ( String ) keys . next ( ) ; PropertyDescriptor desc = ( PropertyDescriptor ) map . get ( key ) ; System . out . println ( key + " = " + desc ) ; }
public class Boss { /** * Manage a number of default worker threads * @ param workersCount the worker count */ public void manage ( int workersCount ) { } }
this . workers . clear ( ) ; WorkerThread worker = null ; for ( int i = 0 ; i < workersCount ; i ++ ) { worker = new WorkerThread ( this ) ; // TODO expensive use thread pool this . manage ( worker ) ; }
public class InternalSimpleExpressionsParser { /** * InternalSimpleExpressions . g : 720:1 : entryRuleArgument returns [ String current = null ] : iv _ ruleArgument = ruleArgument EOF ; */ public final String entryRuleArgument ( ) throws RecognitionException { } }
String current = null ; AntlrDatatypeRuleToken iv_ruleArgument = null ; try { // InternalSimpleExpressions . g : 721:2 : ( iv _ ruleArgument = ruleArgument EOF ) // InternalSimpleExpressions . g : 722:2 : iv _ ruleArgument = ruleArgument EOF { newCompositeNode ( grammarAccess . getArgumentRule ( ) ) ; pushFollow ( FOLLOW_1 ) ; iv_ruleArgument = ruleArgument ( ) ; state . _fsp -- ; current = iv_ruleArgument . getText ( ) ; match ( input , EOF , FOLLOW_2 ) ; } } catch ( RecognitionException re ) { recover ( input , re ) ; appendSkippedTokens ( ) ; } finally { } return current ;
public class PGInterval { /** * Returns the stored interval information as a string . * @ return String represented interval */ public String getValue ( ) { } }
return years + " years " + months + " mons " + days + " days " + hours + " hours " + minutes + " mins " + secondsFormat . format ( seconds ) + " secs" ;
public class UndertowSslConnection { /** * { @ inheritDoc } */ @ Override public < T > T getOption ( final Option < T > option ) throws IOException { } }
if ( option == Options . SSL_CLIENT_AUTH_MODE ) { return option . cast ( engine . getNeedClientAuth ( ) ? SslClientAuthMode . REQUIRED : engine . getWantClientAuth ( ) ? SslClientAuthMode . REQUESTED : SslClientAuthMode . NOT_REQUESTED ) ; } else { return option == Options . SECURE ? ( T ) Boolean . TRUE : delegate . getOption ( option ) ; }
public class SpectatorContext { /** * Set the registry to use . By default it will use the NoopRegistry . */ public static void setRegistry ( Registry registry ) { } }
SpectatorContext . registry = registry ; if ( registry instanceof NoopRegistry ) { initStacktrace = null ; } else { Exception cause = initStacktrace ; Exception e = new IllegalStateException ( "called SpectatorContext.setRegistry(" + registry . getClass ( ) . getName ( ) + ")" , cause ) ; e . fillInStackTrace ( ) ; initStacktrace = e ; if ( cause != null ) { LOGGER . warn ( "Registry used with Servo's SpectatorContext has been overwritten. This could " + "result in missing metrics." , e ) ; } }
public class GetPatchBaselineForPatchGroupRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( GetPatchBaselineForPatchGroupRequest getPatchBaselineForPatchGroupRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( getPatchBaselineForPatchGroupRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( getPatchBaselineForPatchGroupRequest . getPatchGroup ( ) , PATCHGROUP_BINDING ) ; protocolMarshaller . marshall ( getPatchBaselineForPatchGroupRequest . getOperatingSystem ( ) , OPERATINGSYSTEM_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class ProtoUtil { /** * Loads the proto from an { @ link InputStream } . */ public static void loadFrom ( InputStream in , Proto target ) throws Exception { } }
loadFrom ( new ANTLRInputStream ( in ) , target ) ;
public class Widget { /** * Set ViewPort visibility of the object . * @ see ViewPortVisibility * @ param viewportVisibility * The ViewPort visibility of the object . * @ return { @ code true } if the ViewPort visibility was changed , { @ code false } if it * wasn ' t . */ public boolean setViewPortVisibility ( final ViewPortVisibility viewportVisibility ) { } }
boolean visibilityIsChanged = viewportVisibility != mIsVisibleInViewPort ; if ( visibilityIsChanged ) { Visibility visibility = mVisibility ; switch ( viewportVisibility ) { case FULLY_VISIBLE : case PARTIALLY_VISIBLE : break ; case INVISIBLE : visibility = Visibility . HIDDEN ; break ; } mIsVisibleInViewPort = viewportVisibility ; updateVisibility ( visibility ) ; } return visibilityIsChanged ;
public class ReportService { /** * Returns a unique file name * @ param baseFileName the requested base name for the file * @ param extension the requested extension for the file * @ param cleanBaseFileName specify if the < code > baseFileName < / code > has to be cleaned before being used ( i . e . ' jboss - web ' should not be cleaned to avoid ' - ' to become ' _ ' ) * @ param ancestorFolders specify the ancestor folders for the file ( if there ' s no ancestor folder , just pass ' null ' value ) * @ return a String representing the unique file generated */ public String getUniqueFilename ( String baseFileName , String extension , boolean cleanBaseFileName , String ... ancestorFolders ) { } }
if ( cleanBaseFileName ) { baseFileName = PathUtil . cleanFileName ( baseFileName ) ; } if ( ancestorFolders != null ) { Path pathToFile = Paths . get ( "" , Stream . of ( ancestorFolders ) . map ( ancestor -> PathUtil . cleanFileName ( ancestor ) ) . toArray ( String [ ] :: new ) ) . resolve ( baseFileName ) ; baseFileName = pathToFile . toString ( ) ; } String filename = baseFileName + "." + extension ; // FIXME this looks nasty while ( usedFilenames . contains ( filename ) ) { filename = baseFileName + "." + index . getAndIncrement ( ) + "." + extension ; } usedFilenames . add ( filename ) ; return filename ;
public class PathUtil { /** * Obtains the 1st component of a path < p > * Eg , for / wibble / fish will return wibble < br > * for / we / like / pie will return we < br > * for / fish will return fish < br > * for sheep will return sheep < br > * for / will return " " < br > * @ param path path to parse * @ return 1st path component . */ public static String getFirstPathComponent ( String path ) { } }
File localf = new File ( path ) ; File last = localf ; while ( localf . getParentFile ( ) != null ) { last = localf ; localf = localf . getParentFile ( ) ; } return last . getName ( ) ;
public class FastStringBuffer { /** * Sends the specified range of characters as sax Comment . * Note that , unlike sendSAXcharacters , this has to be done as a single * call to LexicalHandler # comment . * @ param ch SAX LexicalHandler object to receive the event . * @ param start Offset of first character in the range . * @ param length Number of characters to send . * @ exception org . xml . sax . SAXException may be thrown by handler ' s * characters ( ) method . */ public void sendSAXComment ( org . xml . sax . ext . LexicalHandler ch , int start , int length ) throws org . xml . sax . SAXException { } }
// % OPT % Do it this way for now . . . String comment = getString ( start , length ) ; ch . comment ( comment . toCharArray ( ) , 0 , length ) ;