signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class DebugUtil { /** * Prints javadoc - like , the top wrapped class fields and methods of a { @ code java . lang . Object } to { @ code System . out } . * @ param pObject the { @ code java . lang . Object } to be analysed . * @ param pObjectName the name of the object instance , for identification purposes . * @ see < a href = " http : / / java . sun . com / products / jdk / 1.3 / docs / api / java / lang / Class . html " > { @ code java . lang . Class } < / a > * @ see < a href = " http : / / java . sun . com / products / jdk / 1.3 / docs / api / java / lang / reflect / Modifier . html " > { @ code java . lang . reflect . Modifier } < / a > * @ see < a href = " http : / / java . sun . com / products / jdk / 1.3 / docs / api / java / lang / reflect / Field . html " > { @ code java . lang . reflect . Field } < / a > * @ see < a href = " http : / / java . sun . com / products / jdk / 1.3 / docs / api / java / lang / reflect / Constructor . html " > { @ code java . lang . reflect . Constructor } < / a > * @ see < a href = " http : / / java . sun . com / products / jdk / 1.3 / docs / api / java / lang / reflect / Method . html " > { @ code java . lang . reflect . Method } < / a > */ public static void printClassDetails ( final Object pObject , final String pObjectName ) { } }
printClassDetails ( pObject , pObjectName , System . out ) ;
public class Locks { /** * Returns a new lock implementation depending on the platform support . */ public static OptimisticLock newOptimistic ( ) { } }
if ( optimisticLockImplementation == null ) { initializeOptimisticLock ( ) ; } try { return optimisticLockImplementation . newInstance ( ) ; } catch ( Exception ex ) { throw new Error ( ex ) ; }
public class DefaultGroovyMethods { /** * Returns the longest prefix of this array where each element * passed to the given closure evaluates to true . * < pre class = " groovyTestCase " > * def nums = [ 1 , 3 , 2 ] as Integer [ ] * assert nums . takeWhile { it { @ code < } 1 } = = [ ] as Integer [ ] * assert nums . takeWhile { it { @ code < } 3 } = = [ 1 ] as Integer [ ] * assert nums . takeWhile { it { @ code < } 4 } = = [ 1 , 3 , 2 ] as Integer [ ] * < / pre > * @ param self the original array * @ param condition the closure that must evaluate to true to * continue taking elements * @ return a prefix of the given array where each element passed to * the given closure evaluates to true * @ since 1.8.7 */ public static < T > T [ ] takeWhile ( T [ ] self , @ ClosureParams ( FirstParam . Component . class ) Closure condition ) { } }
int num = 0 ; BooleanClosureWrapper bcw = new BooleanClosureWrapper ( condition ) ; while ( num < self . length ) { T value = self [ num ] ; if ( bcw . call ( value ) ) { num += 1 ; } else { break ; } } return take ( self , num ) ;
public class AdminCreateUserRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( AdminCreateUserRequest adminCreateUserRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( adminCreateUserRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( adminCreateUserRequest . getUserPoolId ( ) , USERPOOLID_BINDING ) ; protocolMarshaller . marshall ( adminCreateUserRequest . getUsername ( ) , USERNAME_BINDING ) ; protocolMarshaller . marshall ( adminCreateUserRequest . getUserAttributes ( ) , USERATTRIBUTES_BINDING ) ; protocolMarshaller . marshall ( adminCreateUserRequest . getValidationData ( ) , VALIDATIONDATA_BINDING ) ; protocolMarshaller . marshall ( adminCreateUserRequest . getTemporaryPassword ( ) , TEMPORARYPASSWORD_BINDING ) ; protocolMarshaller . marshall ( adminCreateUserRequest . getForceAliasCreation ( ) , FORCEALIASCREATION_BINDING ) ; protocolMarshaller . marshall ( adminCreateUserRequest . getMessageAction ( ) , MESSAGEACTION_BINDING ) ; protocolMarshaller . marshall ( adminCreateUserRequest . getDesiredDeliveryMediums ( ) , DESIREDDELIVERYMEDIUMS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class PageParams { /** * 获取分页参数 * @ param parameterObject * @ param rowBounds * @ return */ public Page getPage ( Object parameterObject , RowBounds rowBounds ) { } }
Page page = PageHelper . getLocalPage ( ) ; if ( page == null ) { if ( rowBounds != RowBounds . DEFAULT ) { if ( offsetAsPageNum ) { page = new Page ( rowBounds . getOffset ( ) , rowBounds . getLimit ( ) , rowBoundsWithCount ) ; } else { page = new Page ( new int [ ] { rowBounds . getOffset ( ) , rowBounds . getLimit ( ) } , rowBoundsWithCount ) ; // offsetAsPageNum = false的时候 , 由于PageNum问题 , 不能使用reasonable , 这里会强制为false page . setReasonable ( false ) ; } if ( rowBounds instanceof PageRowBounds ) { PageRowBounds pageRowBounds = ( PageRowBounds ) rowBounds ; page . setCount ( pageRowBounds . getCount ( ) == null || pageRowBounds . getCount ( ) ) ; } } else if ( parameterObject instanceof IPage || supportMethodsArguments ) { try { page = PageObjectUtil . getPageFromObject ( parameterObject , false ) ; } catch ( Exception e ) { return null ; } } if ( page == null ) { return null ; } PageHelper . setLocalPage ( page ) ; } // 分页合理化 if ( page . getReasonable ( ) == null ) { page . setReasonable ( reasonable ) ; } // 当设置为true的时候 , 如果pagesize设置为0 ( 或RowBounds的limit = 0 ) , 就不执行分页 , 返回全部结果 if ( page . getPageSizeZero ( ) == null ) { page . setPageSizeZero ( pageSizeZero ) ; } return page ;
public class BigMoney { /** * Obtains an instance of { @ code BigMoney } from a { @ code double } using a well - defined conversion . * This allows you to create an instance with a specific currency and amount . * The amount is converted via { @ link BigDecimal # valueOf ( double ) } which yields * the most expected answer for most programming scenarios . * Any { @ code double } literal in code will be converted to * exactly the same BigDecimal with the same scale . * For example , the literal ' 1.425d ' will be converted to ' 1.425 ' . * The scale of the money will be that of the BigDecimal produced , with trailing zeroes stripped , * and with a minimum scale of zero . * @ param currency the currency , not null * @ param amount the amount of money , not null * @ return the new instance , never null */ public static BigMoney of ( CurrencyUnit currency , double amount ) { } }
MoneyUtils . checkNotNull ( currency , "Currency must not be null" ) ; return BigMoney . of ( currency , BigDecimal . valueOf ( amount ) . stripTrailingZeros ( ) ) ;
public class Model { /** * Loads a reference to the SharedPreferences for a given . . . * namespace . * @ param namespace The namespace to be used . * @ return The sharedPreferences object . * @ throws com . mauriciogiordano . easydb . exception . NoContextFoundException in case of null context . */ protected SharedPreferences loadSharedPreferences ( String namespace ) { } }
if ( context == null ) { throw new NoContextFoundException ( ) ; } return context . getSharedPreferences ( clazz . getPackage ( ) . getName ( ) + "." + clazz . getName ( ) + "." + namespace , Context . MODE_PRIVATE ) ;
public class ESFilterBuilder { /** * Gets the filter . * @ param clause * the clause * @ param metadata * the metadata * @ param entityType * the entity type * @ return the filter */ private QueryBuilder getFilter ( FilterClause clause , final EntityMetadata metadata ) { } }
String condition = clause . getCondition ( ) ; Object value = condition . equals ( Expression . IN ) ? clause . getValue ( ) : clause . getValue ( ) . get ( 0 ) ; String name = ( ( AbstractAttribute ) ( ( MetamodelImpl ) kunderaMetadata . getApplicationMetadata ( ) . getMetamodel ( metadata . getPersistenceUnit ( ) ) ) . entity ( metadata . getEntityClazz ( ) ) . getAttribute ( clause . getProperty ( ) ) ) . getJPAColumnName ( ) ; QueryBuilder filterBuilder = null ; if ( condition . equals ( Expression . EQUAL ) ) { filterBuilder = new TermQueryBuilder ( name , value ) ; } else if ( condition . equals ( Expression . GREATER_THAN ) ) { filterBuilder = new RangeQueryBuilder ( name ) . gt ( value ) ; } else if ( condition . equals ( Expression . LOWER_THAN ) ) { filterBuilder = new RangeQueryBuilder ( name ) . lt ( value ) ; } else if ( condition . equals ( Expression . GREATER_THAN_OR_EQUAL ) ) { filterBuilder = new RangeQueryBuilder ( name ) . gte ( value ) ; } else if ( condition . equals ( Expression . LOWER_THAN_OR_EQUAL ) ) { filterBuilder = new RangeQueryBuilder ( name ) . lte ( value ) ; } else if ( condition . equals ( Expression . DIFFERENT ) ) { filterBuilder = new NotQueryBuilder ( new TermQueryBuilder ( name , value ) ) ; } else if ( condition . equals ( Expression . IN ) ) { filterBuilder = new TermsQueryBuilder ( name , clause . getValue ( ) ) ; } return filterBuilder ;
public class ConfigurationHelper { /** * Creates a list of configuration infos from the single location and if they are * optional . * @ param < T > the type of location . Only { @ code String } and { @ code URL } are * supported . */ public static < T > List < ConfigurationInfo < T > > newList ( boolean isOptional , T location ) { } }
if ( location == null ) { throw new IllegalArgumentException ( "location cannot be null" ) ; } return newList ( Collections . < T > singletonList ( location ) , isOptional ) ;
public class OIdentifiableIterator { /** * Tell to the iterator to use the same record for browsing . The record will be reset before every use . This improve the * performance and reduce memory utilization since it does not create a new one for each operation , but pay attention to copy the * data of the record once read otherwise they will be reset to the next operation . * @ param reuseSameRecord * @ return @ see # isReuseSameRecord ( ) */ public OIdentifiableIterator < REC > setReuseSameRecord ( final boolean reuseSameRecord ) { } }
reusedRecord = ( ORecordInternal < ? > ) ( reuseSameRecord ? database . newInstance ( ) : null ) ; return this ;
public class StagePathUtils { /** * 返回对应的remedy root path */ public static String getRemedyRoot ( Long pipelineId ) { } }
// 根据channelId , pipelineId构造path return MessageFormat . format ( ArbitrateConstants . NODE_REMEDY_ROOT , getChannelId ( pipelineId ) , String . valueOf ( pipelineId ) ) ;
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EClass getIfcCommunicationsAppliance ( ) { } }
if ( ifcCommunicationsApplianceEClass == null ) { ifcCommunicationsApplianceEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 107 ) ; } return ifcCommunicationsApplianceEClass ;
public class CPDefinitionOptionValueRelPersistenceImpl { /** * Returns the first cp definition option value rel in the ordered set where uuid = & # 63 ; and companyId = & # 63 ; . * @ param uuid the uuid * @ param companyId the company ID * @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > ) * @ return the first matching cp definition option value rel , or < code > null < / code > if a matching cp definition option value rel could not be found */ @ Override public CPDefinitionOptionValueRel fetchByUuid_C_First ( String uuid , long companyId , OrderByComparator < CPDefinitionOptionValueRel > orderByComparator ) { } }
List < CPDefinitionOptionValueRel > list = findByUuid_C ( uuid , companyId , 0 , 1 , orderByComparator ) ; if ( ! list . isEmpty ( ) ) { return list . get ( 0 ) ; } return null ;
public class Activator { /** * Track resources . * @ param bundleContext the BundleContext associated with this bundle */ private void trackResources ( final BundleContext bundleContext ) { } }
ServiceTracker < Object , ResourceWebElement > resourceTracker = ResourceTracker . createTracker ( extenderContext , bundleContext ) ; resourceTracker . open ( ) ; trackers . add ( 0 , resourceTracker ) ; final ServiceTracker < ResourceMapping , ResourceMappingWebElement > resourceMappingTracker = ResourceMappingTracker . createTracker ( extenderContext , bundleContext ) ; resourceMappingTracker . open ( ) ; trackers . add ( 0 , resourceMappingTracker ) ;
public class ResultExporter { /** * because there was no support for row span */ protected Set < CellElement > getIgnoredCellElementsForColSpan ( Band band ) { } }
Set < CellElement > result = new HashSet < CellElement > ( ) ; int rows = band . getRowCount ( ) ; int cols = band . getColumnCount ( ) ; for ( int i = 0 ; i < rows ; i ++ ) { for ( int j = 0 ; j < cols ; j ++ ) { BandElement element = band . getElementAt ( i , j ) ; if ( element == null ) { continue ; } // int rowSpan = element . getRowSpan ( ) ; int colSpan = element . getColSpan ( ) ; if ( colSpan > 1 ) { for ( int k = 1 ; k < colSpan ; k ++ ) { result . add ( new CellElement ( i , j + k ) ) ; } } } } return result ;
public class PoissonDistribution { /** * Computes the cumulative probability function and checks for { @ code NaN } * values returned . Throws { @ code MathInternalError } if the value is * { @ code NaN } . Rethrows any exception encountered evaluating the cumulative * probability function . Throws { @ code MathInternalError } if the cumulative * probability function returns { @ code NaN } . * @ param argument input value * @ return the cumulative probability * @ throws AssertionError if the cumulative probability is { @ code NaN } */ private static double checkedCumulativeProbability ( double mean , long argument ) { } }
double result = cumulativeProbability ( mean , argument ) ; if ( Double . isNaN ( result ) ) { throw new AssertionError ( "Discrete cumulative probability function returned NaN " + "for argument " + argument ) ; } return result ;
public class ConnectionMap { /** * Returns whether there is a connection between a and b . Unknown objects do * never have a connection . * @ param paramOrigin * origin object * @ param paramDestination * destination object * @ return true , iff there is a connection from a to b */ public boolean get ( final T paramOrigin , final T paramDestination ) { } }
assert paramOrigin != null ; assert paramDestination != null ; if ( ! mMap . containsKey ( paramOrigin ) ) { return false ; } final Boolean bool = mMap . get ( paramOrigin ) . get ( paramDestination ) ; return bool != null && bool ;
public class MethodWriterImpl { /** * { @ inheritDoc } */ protected static void addOverridden ( HtmlDocletWriter writer , TypeMirror overriddenType , ExecutableElement method , Content dl ) { } }
if ( writer . configuration . nocomment ) { return ; } Utils utils = writer . utils ; Contents contents = writer . contents ; TypeElement holder = utils . getEnclosingTypeElement ( method ) ; if ( ! ( utils . isPublic ( holder ) || utils . isLinkable ( holder ) ) ) { // This is an implementation detail that should not be documented . return ; } if ( utils . isIncluded ( holder ) && ! utils . isIncluded ( method ) ) { // The class is included but the method is not . That means that it // is not visible so don ' t document this . return ; } Content label = contents . overridesLabel ; LinkInfoImpl . Kind context = LinkInfoImpl . Kind . METHOD_OVERRIDES ; if ( method != null ) { if ( utils . isAbstract ( holder ) && utils . isAbstract ( method ) ) { // Abstract method is implemented from abstract class , // not overridden label = contents . specifiedByLabel ; context = LinkInfoImpl . Kind . METHOD_SPECIFIED_BY ; } Content dt = HtmlTree . DT ( HtmlTree . SPAN ( HtmlStyle . overrideSpecifyLabel , label ) ) ; dl . addContent ( dt ) ; Content overriddenTypeLink = writer . getLink ( new LinkInfoImpl ( writer . configuration , context , overriddenType ) ) ; Content codeOverridenTypeLink = HtmlTree . CODE ( overriddenTypeLink ) ; Content methlink = writer . getLink ( new LinkInfoImpl ( writer . configuration , LinkInfoImpl . Kind . MEMBER , holder ) . where ( writer . getName ( writer . getAnchor ( method ) ) ) . label ( method . getSimpleName ( ) ) ) ; Content codeMethLink = HtmlTree . CODE ( methlink ) ; Content dd = HtmlTree . DD ( codeMethLink ) ; dd . addContent ( Contents . SPACE ) ; dd . addContent ( writer . contents . inClass ) ; dd . addContent ( Contents . SPACE ) ; dd . addContent ( codeOverridenTypeLink ) ; dl . addContent ( dd ) ; }
public class OsUtil { /** * @ param src * @ param dest * @ return void * @ Description : 具有重试机制的 ATOM 转移文件 , 并且会校验文件是否一致 才替换 * @ author liaoqiqi * @ date 2013-6-20 */ public static void transferFileAtom ( File src , File dest , boolean isDeleteSource ) throws Exception { } }
// 文件锁所在文件 File lockFile = new File ( dest + ".lock" ) ; FileOutputStream outStream = null ; FileLock lock = null ; try { outStream = new FileOutputStream ( lockFile ) ; FileChannel channel = outStream . getChannel ( ) ; try { int tryTime = 0 ; while ( tryTime < 3 ) { lock = channel . tryLock ( ) ; if ( lock != null ) { if ( dest . exists ( ) ) { // 判断内容是否一样 if ( FileUtils . isFileEqual ( src , dest ) ) { // 删除 if ( isDeleteSource ) { src . delete ( ) ; } break ; } } logger . debug ( "start to replace " + src . getAbsolutePath ( ) + " to " + dest . getAbsolutePath ( ) ) ; // 转移 transferFile ( src , dest ) ; // 删除 if ( isDeleteSource ) { src . delete ( ) ; } break ; } logger . warn ( "try lock failed. sleep and try " + tryTime ) ; tryTime ++ ; try { Thread . sleep ( 1000 * tryTime ) ; } catch ( Exception e ) { } } } catch ( IOException e ) { logger . warn ( e . toString ( ) ) ; } } catch ( FileNotFoundException e ) { logger . warn ( e . toString ( ) ) ; } finally { if ( null != lock ) { try { lock . release ( ) ; } catch ( IOException e ) { logger . warn ( e . toString ( ) ) ; } } if ( outStream != null ) { try { outStream . close ( ) ; } catch ( IOException e ) { logger . warn ( e . toString ( ) ) ; } } }
public class JKDefaultTableModel { /** * Replaces the current < code > dataVector < / code > instance variable with the new * < code > Vector < / code > of rows , < code > dataVector < / code > . Each row is represented * in < code > dataVector < / code > as a < code > Vector < / code > of < code > Object < / code > * values . < code > columnIdentifiers < / code > are the names of the new columns . The * first name in < code > columnIdentifiers < / code > is mapped to column 0 in * < code > dataVector < / code > . Each row in < code > dataVector < / code > is adjusted to * match the number of columns in < code > columnIdentifiers < / code > either by * truncating the < code > Vector < / code > if it is too long , or adding * < code > null < / code > values if it is too short . * Note that passing in a < code > null < / code > value for < code > dataVector < / code > * results in unspecified behavior , an possibly an exception . * @ param dataVector the new data vector * @ param columnIdentifiers the names of the columns * @ see # getDataVector */ public void setDataVector ( final Vector dataVector , final Vector columnIdentifiers ) { } }
this . dataVector = nonNullVector ( dataVector ) ; this . columnIdentifiers = nonNullVector ( columnIdentifiers ) ; justifyRows ( 0 , getRowCount ( ) ) ; fireTableStructureChanged ( ) ;
public class ComponentsInner { /** * Updates an existing component ' s tags . To update other fields use the CreateOrUpdate method . * @ param resourceGroupName The name of the resource group . * @ param resourceName The name of the Application Insights component resource . * @ param tags Resource tags * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the ApplicationInsightsComponentInner object */ public Observable < ApplicationInsightsComponentInner > updateTagsAsync ( String resourceGroupName , String resourceName , Map < String , String > tags ) { } }
return updateTagsWithServiceResponseAsync ( resourceGroupName , resourceName , tags ) . map ( new Func1 < ServiceResponse < ApplicationInsightsComponentInner > , ApplicationInsightsComponentInner > ( ) { @ Override public ApplicationInsightsComponentInner call ( ServiceResponse < ApplicationInsightsComponentInner > response ) { return response . body ( ) ; } } ) ;
public class LoadableExtensionLoader { /** * Some environments need to handle their own ExtensionLoading and can ' t rely on Java ' s META - INF / services approach . * @ return configured ExtensionLoader if found or defaults to JavaSPIServiceLoader */ private ExtensionLoader locateExtensionLoader ( ) { } }
Collection < ExtensionLoader > loaders = Collections . emptyList ( ) ; if ( SecurityActions . getThreadContextClassLoader ( ) != null ) { loaders = serviceLoader . all ( SecurityActions . getThreadContextClassLoader ( ) , ExtensionLoader . class ) ; } if ( loaders . size ( ) == 0 ) { loaders = serviceLoader . all ( LoadableExtensionLoader . class . getClassLoader ( ) , ExtensionLoader . class ) ; } if ( loaders . size ( ) > 1 ) { throw new RuntimeException ( "Multiple ExtensionLoader's found on classpath: " + toString ( loaders ) ) ; } if ( loaders . size ( ) == 1 ) { return loaders . iterator ( ) . next ( ) ; } return serviceLoader ;
public class FessMessages { /** * Add the created action message for the key ' errors . front _ prefix ' with parameters . * < pre > * message : & lt ; div class = " alert alert - warning " & gt ; * < / pre > * @ param property The property name for the message . ( NotNull ) * @ return this . ( NotNull ) */ public FessMessages addErrorsFrontPrefix ( String property ) { } }
assertPropertyNotNull ( property ) ; add ( property , new UserMessage ( ERRORS_front_prefix ) ) ; return this ;
public class ColumnSerializer { /** * For counter columns , we must know when we deserialize them if what we * deserialize comes from a remote host . If it does , then we must clear * the delta . */ public Cell deserialize ( DataInput in , ColumnSerializer . Flag flag ) throws IOException { } }
return deserialize ( in , flag , Integer . MIN_VALUE ) ;
public class DescribeComputeEnvironmentsResult { /** * The list of compute environments . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setComputeEnvironments ( java . util . Collection ) } or { @ link # withComputeEnvironments ( java . util . Collection ) } * if you want to override the existing values . * @ param computeEnvironments * The list of compute environments . * @ return Returns a reference to this object so that method calls can be chained together . */ public DescribeComputeEnvironmentsResult withComputeEnvironments ( ComputeEnvironmentDetail ... computeEnvironments ) { } }
if ( this . computeEnvironments == null ) { setComputeEnvironments ( new java . util . ArrayList < ComputeEnvironmentDetail > ( computeEnvironments . length ) ) ; } for ( ComputeEnvironmentDetail ele : computeEnvironments ) { this . computeEnvironments . add ( ele ) ; } return this ;
public class Group { /** * Equivalent to calling { @ code join ( null , onLoseMembership ) } . */ public final Membership join ( @ Nullable final Runnable onLoseMembership ) throws JoinException , InterruptedException { } }
return join ( NO_MEMBER_DATA , onLoseMembership ) ;
public class GetAllRoles { /** * Runs the example . * @ param adManagerServices the services factory . * @ param session the session . * @ throws ApiException if the API request failed with one or more service errors . * @ throws RemoteException if the API request failed due to other errors . */ public static void runExample ( AdManagerServices adManagerServices , AdManagerSession session ) throws RemoteException { } }
// Get the UserService . UserServiceInterface userService = adManagerServices . get ( session , UserServiceInterface . class ) ; // Get all roles . Role [ ] roles = userService . getAllRoles ( ) ; int i = 0 ; for ( Role role : roles ) { System . out . printf ( "%d) Role with ID %d and name '%s' was found.%n" , i ++ , role . getId ( ) , role . getName ( ) ) ; } System . out . printf ( "Number of results found: %d%n" , roles . length ) ;
public class StandardExpressions { /** * Obtain the conversion service ( implementation of { @ link IStandardConversionService } ) registered by * the Standard Dialect that is being currently used . * @ param configuration the configuration object for the current template execution environment . * @ return the conversion service object . */ public static IStandardConversionService getConversionService ( final IEngineConfiguration configuration ) { } }
final Object conversionService = configuration . getExecutionAttributes ( ) . get ( STANDARD_CONVERSION_SERVICE_ATTRIBUTE_NAME ) ; if ( conversionService == null || ( ! ( conversionService instanceof IStandardConversionService ) ) ) { throw new TemplateProcessingException ( "No Standard Conversion Service has been registered as an execution argument. " + "This is a requirement for using Standard Expressions, and might happen " + "if neither the Standard or the SpringStandard dialects have " + "been added to the Template Engine and none of the specified dialects registers an " + "attribute of type " + IStandardConversionService . class . getName ( ) + " with name " + "\"" + STANDARD_CONVERSION_SERVICE_ATTRIBUTE_NAME + "\"" ) ; } return ( IStandardConversionService ) conversionService ;
public class AmazonEC2Client { /** * Deletes a VPC peering connection . Either the owner of the requester VPC or the owner of the accepter VPC can * delete the VPC peering connection if it ' s in the < code > active < / code > state . The owner of the requester VPC can * delete a VPC peering connection in the < code > pending - acceptance < / code > state . You cannot delete a VPC peering * connection that ' s in the < code > failed < / code > state . * @ param deleteVpcPeeringConnectionRequest * @ return Result of the DeleteVpcPeeringConnection operation returned by the service . * @ sample AmazonEC2 . DeleteVpcPeeringConnection * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / ec2-2016-11-15 / DeleteVpcPeeringConnection " target = " _ top " > AWS * API Documentation < / a > */ @ Override public DeleteVpcPeeringConnectionResult deleteVpcPeeringConnection ( DeleteVpcPeeringConnectionRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeDeleteVpcPeeringConnection ( request ) ;
public class ReflectionInvoker { /** * { @ inheritDoc } */ @ Override public void invoke ( final Saga saga , final Object message ) throws InvocationTargetException , IllegalAccessException { } }
if ( saga instanceof DescribesHandlers ) { ( ( DescribesHandlers ) saga ) . describeHandlers ( ) . handler ( ) . accept ( message ) ; } else { invokeUsingReflection ( saga , message ) ; }
public class BalanceBooks { /** * Validates the current state of the data stored at the end of the test . Each update by a client consists of two * parts : a withdrawal of a random amount from a randomly select other account , and a corresponding to deposit to * the client ' s own account . So , if all the updates were performed consistently ( no partial updates or partial * rollbacks ) , then the total sum of all balances at the end should be 0. */ public boolean verify ( ) { } }
boolean success = false ; try { TransactionAwareHTable table = new TransactionAwareHTable ( conn . getTable ( TABLE ) ) ; TransactionContext context = new TransactionContext ( txClient , table ) ; LOG . info ( "VERIFYING BALANCES" ) ; context . start ( ) ; long totalBalance = 0 ; ResultScanner scanner = table . getScanner ( new Scan ( ) ) ; try { for ( Result r : scanner ) { if ( ! r . isEmpty ( ) ) { int rowId = Bytes . toInt ( r . getRow ( ) ) ; long balance = Bytes . toLong ( r . getValue ( FAMILY , COL ) ) ; totalBalance += balance ; LOG . info ( "Client #{}: balance = ${}" , rowId , balance ) ; } } } finally { if ( scanner != null ) { Closeables . closeQuietly ( scanner ) ; } } if ( totalBalance == 0 ) { LOG . info ( "PASSED!" ) ; success = true ; } else { LOG . info ( "FAILED! Total balance should be 0 but was {}" , totalBalance ) ; } context . finish ( ) ; } catch ( Exception e ) { LOG . error ( "Failed verification check" , e ) ; } return success ;
public class Functions { /** * Runs create CData section function with arguments . * @ return */ public static String createCDataSection ( String content , TestContext context ) { } }
return new CreateCDataSectionFunction ( ) . execute ( Collections . singletonList ( content ) , context ) ;
public class SsmlBreak { /** * Attributes to set on the generated XML element * @ return A Map of attribute keys to values */ protected Map < String , String > getElementAttributes ( ) { } }
// Preserve order of attributes Map < String , String > attrs = new HashMap < > ( ) ; if ( this . getStrength ( ) != null ) { attrs . put ( "strength" , this . getStrength ( ) . toString ( ) ) ; } if ( this . getTime ( ) != null ) { attrs . put ( "time" , this . getTime ( ) ) ; } return attrs ;
public class Token { /** * Make the token and any ManagedObject it refers to invalid . * Used at shutdown to prevent accidental use of a ManagedObject in the ObjectManager that * instantiated it or any other Object Manager . */ void invalidate ( ) { } }
if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , "invalidate" ) ; // Prevent any attempt to load the object . objectStore = null ; // If the ManagedObject is already in memory access it , otherwise there is nothing // we need to do to it . if ( managedObjectReference != null ) { ManagedObject managedObject = ( ManagedObject ) managedObjectReference . get ( ) ; if ( managedObject != null ) managedObject . state = ManagedObject . stateError ; } // if ( managedObjectReference ! = null ) . if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , "invalidate" ) ;
public class CPAttachmentFileEntryLocalServiceBaseImpl { /** * Returns all the cp attachment file entries matching the UUID and company . * @ param uuid the UUID of the cp attachment file entries * @ param companyId the primary key of the company * @ return the matching cp attachment file entries , or an empty list if no matches were found */ @ Override public List < CPAttachmentFileEntry > getCPAttachmentFileEntriesByUuidAndCompanyId ( String uuid , long companyId ) { } }
return cpAttachmentFileEntryPersistence . findByUuid_C ( uuid , companyId ) ;
public class AbstractModelConverter { /** * TODO : download custom licenses content */ private ExtensionLicense getExtensionLicense ( License license ) { } }
if ( license . getName ( ) == null ) { return new ExtensionLicense ( "noname" , null ) ; } return createLicenseByName ( license . getName ( ) ) ;
public class FontResolutionImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public Object eGet ( int featureID , boolean resolve , boolean coreType ) { } }
switch ( featureID ) { case AfplibPackage . FONT_RESOLUTION__MET_TECH : return getMetTech ( ) ; case AfplibPackage . FONT_RESOLUTION__RPU_BASE : return getRPuBase ( ) ; case AfplibPackage . FONT_RESOLUTION__RP_UNITS : return getRPUnits ( ) ; } return super . eGet ( featureID , resolve , coreType ) ;
public class BinarySet { /** * { @ inheritDoc } * @ param e * @ return */ @ Override public E ceiling ( E e ) { } }
int idx = indexOf ( e ) ; if ( idx >= 1 ) { return list . get ( idx ) ; } else { int ip = insertPoint ( idx ) ; if ( ip < list . size ( ) ) { return list . get ( ip ) ; } else { return null ; } }
import java . util . * ; class Main { /** * Function to eliminate the nested tuple from a given list . * Examples : * > > > eliminate _ nested ( Arrays . asList ( 1 , 5 , 7 , Arrays . asList ( 4 , 6 ) , 10 ) ) * [ 1 , 5 , 7 , 10] * > > > eliminate _ nested ( Arrays . asList ( 2 , 6 , 8 , Arrays . asList ( 5 , 7 ) , 11 ) ) * [ 2 , 6 , 8 , 11] * > > > eliminate _ nested ( Arrays . asList ( 3 , 7 , 9 , Arrays . asList ( 6 , 8 ) , 12 ) ) * [ 3 , 7 , 9 , 12] * Args : * input _ list : List can contain nested list . * Returns : * List : The input list with the nested list removed . */ public static List eliminateNested ( List inputList ) { } }
List result = new ArrayList ( ) ; for ( Object item : inputList ) { if ( item instanceof List ) { continue ; } result . add ( item ) ; } return result ;
public class GVRIndexBuffer { /** * Updates the indices in the index buffer from a Java int array . * All of the entries of the input int array are copied into * the storage for the index buffer . The new indices must be the * same size as the old indices - the index buffer size cannot be changed . * @ param data char array containing the new values * @ throws IllegalArgumentException if int array is wrong size */ public void setIntVec ( int [ ] data ) { } }
if ( data == null ) { throw new IllegalArgumentException ( "Input data for indices cannot be null" ) ; } if ( getIndexSize ( ) != 4 ) { throw new UnsupportedOperationException ( "Cannot update short indices with int array" ) ; } if ( ! NativeIndexBuffer . setIntArray ( getNative ( ) , data ) ) { throw new UnsupportedOperationException ( "Input array is wrong size" ) ; }
public class FontDialogSwing { /** * Create and display FontDialogSwing Dialog . */ public static void creatFontDialog ( DatabaseManagerSwing owner ) { } }
if ( isRunning ) { frame . setVisible ( true ) ; } else { CommonSwing . setSwingLAF ( frame , CommonSwing . Native ) ; fOwner = owner ; frame . setIconImage ( CommonSwing . getIcon ( "Frame" ) ) ; isRunning = true ; frame . setSize ( 600 , 100 ) ; CommonSwing . setFramePositon ( frame ) ; ckbitalic = new JCheckBox ( new ImageIcon ( CommonSwing . getIcon ( "ItalicFont" ) ) ) ; ckbitalic . putClientProperty ( "is3DEnabled" , Boolean . TRUE ) ; ckbitalic . addActionListener ( new ActionListener ( ) { public void actionPerformed ( ActionEvent e ) { setStyle ( ) ; } } ) ; ckbbold = new JCheckBox ( new ImageIcon ( CommonSwing . getIcon ( "BoldFont" ) ) ) ; ckbbold . putClientProperty ( "is3DEnabled" , Boolean . TRUE ) ; ckbbold . addActionListener ( new ActionListener ( ) { public void actionPerformed ( ActionEvent e ) { setStyle ( ) ; } } ) ; fgColorButton = new JButton ( "Foreground" , new ImageIcon ( CommonSwing . getIcon ( "ColorSelection" ) ) ) ; fgColorButton . putClientProperty ( "is3DEnabled" , Boolean . TRUE ) ; fgColorButton . addActionListener ( new ActionListener ( ) { public void actionPerformed ( ActionEvent e ) { setColor ( FOREGROUND ) ; } } ) ; bgColorButton = new JButton ( "Background" , new ImageIcon ( CommonSwing . getIcon ( "ColorSelection" ) ) ) ; bgColorButton . putClientProperty ( "is3DEnabled" , Boolean . TRUE ) ; bgColorButton . addActionListener ( new ActionListener ( ) { public void actionPerformed ( ActionEvent e ) { setColor ( BACKGROUND ) ; } } ) ; closeButton = new JButton ( "Close" , new ImageIcon ( CommonSwing . getIcon ( "Close" ) ) ) ; closeButton . putClientProperty ( "is3DEnabled" , Boolean . TRUE ) ; closeButton . addActionListener ( new ActionListener ( ) { public void actionPerformed ( ActionEvent e ) { frame . setVisible ( false ) ; } } ) ; GraphicsEnvironment ge = GraphicsEnvironment . getLocalGraphicsEnvironment ( ) ; String [ ] fontNames = ge . getAvailableFontFamilyNames ( ) ; Dimension fontsComboBoxDimension = new Dimension ( 160 , 25 ) ; fontsComboBox = new JComboBox ( fontNames ) ; fontsComboBox . putClientProperty ( "is3DEnabled" , Boolean . TRUE ) ; fontsComboBox . setMaximumSize ( fontsComboBoxDimension ) ; fontsComboBox . setPreferredSize ( fontsComboBoxDimension ) ; fontsComboBox . setMaximumSize ( fontsComboBoxDimension ) ; fontsComboBox . setEditable ( false ) ; fontsComboBox . setSelectedItem ( defaultFont ) ; fontsComboBox . addActionListener ( new ActionListener ( ) { public void actionPerformed ( ActionEvent e ) { setFont ( ) ; } } ) ; // weconsultants @ users 20050215 - Added for Compatbilty fix for JDK 1.3 fontSizesComboBox = new JComboBox ( fontSizes ) ; Dimension spinnerDimension = new Dimension ( 45 , 25 ) ; fontSizesComboBox . putClientProperty ( "is3DEnabled" , Boolean . TRUE ) ; fontSizesComboBox . setMinimumSize ( spinnerDimension ) ; fontSizesComboBox . setPreferredSize ( spinnerDimension ) ; fontSizesComboBox . setMaximumSize ( spinnerDimension ) ; fontSizesComboBox . addItemListener ( new ItemListener ( ) { public void itemStateChanged ( ItemEvent evt ) { if ( evt . getStateChange ( ) == ItemEvent . SELECTED ) { setFontSize ( ( String ) evt . getItem ( ) ) ; } } } ) ; // weconsultants @ users 20050215 - Commented out for Compatbilty fix for JDK 1.3 // Dimension spinnerDimension = new Dimension ( 50 , 25 ) ; // spinnerFontSizes = new JSpinner ( ) ; // spinnerFontSizes . putClientProperty ( " is3DEnabled " , Boolean . TRUE ) ; // spinnerFontSizes . setMinimumSize ( spinnerDimension ) ; // spinnerFontSizes . setPreferredSize ( spinnerDimension ) ; // spinnerFontSizes . setMaximumSize ( spinnerDimension ) ; // spinnerModelSizes = new SpinnerNumberModel ( 12 , 8 , 72 , 1 ) ; // spinnerFontSizes . setModel ( spinnerModelSizes ) ; // spinnerFontSizes . addChangeListener ( new ChangeListener ( ) { // public void stateChanged ( ChangeEvent e ) { // setFontSize ( ) ; Container contentPane = frame . getContentPane ( ) ; contentPane . setLayout ( new FlowLayout ( ) ) ; contentPane . add ( fontsComboBox ) ; // weconsultants @ users 20050215 - Commented out for Compatbilty fix for 1.3 // contentPane . add ( spinnerFontSizes ) ; // weconsultants @ users 20050215 - Added for Compatbilty fix for 1.3 contentPane . add ( fontSizesComboBox ) ; contentPane . add ( ckbbold ) ; contentPane . add ( ckbitalic ) ; contentPane . add ( fgColorButton ) ; contentPane . add ( bgColorButton ) ; contentPane . add ( closeButton ) ; frame . pack ( ) ; frame . setVisible ( false ) ; }
public class ClientBuilder { /** * Sets the * < a href = " https : / / console . bluemix . net / docs / services / Cloudant / guides / iam . html # ibm - cloud - identity - and - access - management " * target = " _ blank " > IAM < / a > API key for the client connection . Also allows a client ID and secret * to be specified for use when authenticating with the IAM token server . * Example creating a { @ link CloudantClient } using IAM authentication : * < pre > * { @ code * CloudantClient client = ClientBuilder . account ( " yourCloudantAccount " ) * . iamApiKey ( " yourIamApiKey " , " yourClientId " , " yourClientSecret " ) * . build ( ) ; * < / pre > * @ param iamApiKey the IAM API key for the session * @ param iamServerClientId Client ID used to authenticate with IAM token server * @ param iamServerClientSecret Client secret used to authenticate with IAM token server * @ return this ClientBuilder object for setting additional options */ public ClientBuilder iamApiKey ( String iamApiKey , String iamServerClientId , String iamServerClientSecret ) { } }
this . iamApiKey = iamApiKey ; this . iamServerClientId = iamServerClientId ; this . iamServerClientSecret = iamServerClientSecret ; return this ;
public class AbstractWComponent { /** * Retrieves a short - lived map which can be used to cache data during request processing . This map will be * guaranteed to be cleared at the end of processing a request , but may also be cleared during request processing . * Do not rely on the contents of this map to exist at any time . * This method will return < code > null < / code > if called outside of request processing . * @ return a map which can be used to temporarily cache data , or null */ protected Map getScratchMap ( ) { } }
UIContext uic = UIContextHolder . getCurrent ( ) ; return uic == null ? null : uic . getScratchMap ( this ) ;
public class ResourceRelocationContext { /** * Loads and watches the respective resource and applies the relocation change . * Clients may usually rather call { @ link # addModification } to register their * side - effects . * @ param change the change to execute */ protected Resource loadAndWatchResource ( final ResourceRelocationChange change ) { } }
try { Resource _switchResult = null ; final ResourceRelocationContext . ChangeType changeType = this . changeType ; if ( changeType != null ) { switch ( changeType ) { case MOVE : case RENAME : Resource _xblockexpression = null ; { final Resource original = this . resourceSet . getResource ( change . getFromURI ( ) , true ) ; final IChangeSerializer . IModification < Resource > _function = ( Resource it ) -> { original . setURI ( change . getToURI ( ) ) ; } ; this . changeSerializer . < Resource > addModification ( original , _function ) ; _xblockexpression = original ; } _switchResult = _xblockexpression ; break ; case COPY : Resource _xblockexpression_1 = null ; { final Resource copy = this . resourceSet . createResource ( change . getFromURI ( ) ) ; copy . load ( this . resourceSet . getURIConverter ( ) . createInputStream ( change . getFromURI ( ) ) , null ) ; copy . setURI ( change . getToURI ( ) ) ; _xblockexpression_1 = copy ; } _switchResult = _xblockexpression_1 ; break ; default : break ; } } final Resource resource = _switchResult ; return resource ; } catch ( Throwable _e ) { throw Exceptions . sneakyThrow ( _e ) ; }
public class XLog { /** * Log a message and a throwable with level { @ link LogLevel # ERROR } . * @ param msg the message to log * @ param tr the throwable to be log */ public static void e ( String msg , Throwable tr ) { } }
assertInitialization ( ) ; sLogger . e ( msg , tr ) ;
public class RunbookDraftsInner { /** * Replaces the runbook draft content . * @ param resourceGroupName Name of an Azure Resource group . * @ param automationAccountName The name of the automation account . * @ param runbookName The runbook name . * @ param runbookContent The runbook draft content . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the String object */ public Observable < ServiceResponseWithHeaders < String , RunbookDraftReplaceContentHeaders > > beginReplaceContentWithServiceResponseAsync ( String resourceGroupName , String automationAccountName , String runbookName , String runbookContent ) { } }
if ( this . client . subscriptionId ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.subscriptionId() is required and cannot be null." ) ; } if ( resourceGroupName == null ) { throw new IllegalArgumentException ( "Parameter resourceGroupName is required and cannot be null." ) ; } if ( automationAccountName == null ) { throw new IllegalArgumentException ( "Parameter automationAccountName is required and cannot be null." ) ; } if ( runbookName == null ) { throw new IllegalArgumentException ( "Parameter runbookName is required and cannot be null." ) ; } if ( runbookContent == null ) { throw new IllegalArgumentException ( "Parameter runbookContent is required and cannot be null." ) ; } final String apiVersion = "2015-10-31" ; return service . beginReplaceContent ( this . client . subscriptionId ( ) , resourceGroupName , automationAccountName , runbookName , runbookContent , apiVersion , this . client . acceptLanguage ( ) , this . client . userAgent ( ) ) . flatMap ( new Func1 < Response < ResponseBody > , Observable < ServiceResponseWithHeaders < String , RunbookDraftReplaceContentHeaders > > > ( ) { @ Override public Observable < ServiceResponseWithHeaders < String , RunbookDraftReplaceContentHeaders > > call ( Response < ResponseBody > response ) { try { ServiceResponseWithHeaders < String , RunbookDraftReplaceContentHeaders > clientResponse = beginReplaceContentDelegate ( response ) ; return Observable . just ( clientResponse ) ; } catch ( Throwable t ) { return Observable . error ( t ) ; } } } ) ;
public class InvocationManager { /** * Constructs a list of all bootstrap services registered in any of the supplied groups . */ public List < InvocationMarshaller < ? > > getBootstrapServices ( String [ ] bootGroups ) { } }
List < InvocationMarshaller < ? > > services = Lists . newArrayList ( ) ; for ( String group : bootGroups ) { services . addAll ( _bootlists . get ( group ) ) ; } return services ;
public class JMElasticsearchBulk { /** * Build update bulk request builder bulk request builder . * @ param updateRequestBuilderList the update request builder list * @ return the bulk request builder */ public BulkRequestBuilder buildUpdateBulkRequestBuilder ( List < UpdateRequestBuilder > updateRequestBuilderList ) { } }
BulkRequestBuilder bulkRequestBuilder = jmESClient . prepareBulk ( ) ; for ( UpdateRequestBuilder updateRequestBuilder : updateRequestBuilderList ) bulkRequestBuilder . add ( updateRequestBuilder ) ; return bulkRequestBuilder ;
public class AfplibPackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EClass getFinishingFidelity ( ) { } }
if ( finishingFidelityEClass == null ) { finishingFidelityEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( AfplibPackage . eNS_URI ) . getEClassifiers ( ) . get ( 507 ) ; } return finishingFidelityEClass ;
public class RecurlyClient { /** * Get Account Balance * Retrieves the remaining balance on the account * @ param accountCode recurly account id * @ return the updated AccountBalance if success , null otherwise */ public AccountBalance getAccountBalance ( final String accountCode ) { } }
return doGET ( Account . ACCOUNT_RESOURCE + "/" + accountCode + AccountBalance . ACCOUNT_BALANCE_RESOURCE , AccountBalance . class ) ;
public class BaseDependencyCheckMojo { /** * Checks if the current artifact is actually in the reactor projects . If * true a virtual dependency is created based on the evidence in the * project . * @ param engine a reference to the engine being used to scan * @ param artifact the artifact being analyzed in the mojo * @ param infoLogTemplate the template for the infoLog entry written when a * virtual dependency is added . Needs a single % s placeholder for the * location of the displayName in the message * @ return < code > true < / code > if the artifact is in the reactor ; otherwise * < code > false < / code > */ private boolean addVirtualDependencyFromReactor ( Engine engine , Artifact artifact , String infoLogTemplate ) { } }
getLog ( ) . debug ( String . format ( "Checking the reactor projects (%d) for %s:%s:%s" , reactorProjects . size ( ) , artifact . getGroupId ( ) , artifact . getArtifactId ( ) , artifact . getVersion ( ) ) ) ; for ( MavenProject prj : reactorProjects ) { getLog ( ) . debug ( String . format ( "Comparing %s:%s:%s to %s:%s:%s" , artifact . getGroupId ( ) , artifact . getArtifactId ( ) , artifact . getVersion ( ) , prj . getGroupId ( ) , prj . getArtifactId ( ) , prj . getVersion ( ) ) ) ; if ( prj . getArtifactId ( ) . equals ( artifact . getArtifactId ( ) ) && prj . getGroupId ( ) . equals ( artifact . getGroupId ( ) ) && prj . getVersion ( ) . equals ( artifact . getVersion ( ) ) ) { final String displayName = String . format ( "%s:%s:%s" , prj . getGroupId ( ) , prj . getArtifactId ( ) , prj . getVersion ( ) ) ; getLog ( ) . info ( String . format ( infoLogTemplate , displayName ) ) ; final File pom = new File ( prj . getBasedir ( ) , "pom.xml" ) ; final Dependency d ; if ( pom . isFile ( ) ) { getLog ( ) . debug ( "Adding virtual dependency from pom.xml" ) ; d = new Dependency ( pom , true ) ; } else { d = new Dependency ( true ) ; } final String key = String . format ( "%s:%s:%s" , artifact . getGroupId ( ) , artifact . getArtifactId ( ) , artifact . getVersion ( ) ) ; d . setSha1sum ( Checksum . getSHA1Checksum ( key ) ) ; d . setSha256sum ( Checksum . getSHA256Checksum ( key ) ) ; d . setMd5sum ( Checksum . getMD5Checksum ( key ) ) ; d . setEcosystem ( JarAnalyzer . DEPENDENCY_ECOSYSTEM ) ; d . setDisplayFileName ( displayName ) ; d . addEvidence ( EvidenceType . PRODUCT , "project" , "artifactid" , prj . getArtifactId ( ) , Confidence . HIGHEST ) ; d . addEvidence ( EvidenceType . VENDOR , "project" , "artifactid" , prj . getArtifactId ( ) , Confidence . LOW ) ; d . addEvidence ( EvidenceType . VENDOR , "project" , "groupid" , prj . getGroupId ( ) , Confidence . HIGHEST ) ; d . addEvidence ( EvidenceType . PRODUCT , "project" , "groupid" , prj . getGroupId ( ) , Confidence . LOW ) ; d . setEcosystem ( JarAnalyzer . DEPENDENCY_ECOSYSTEM ) ; Identifier id ; try { id = new PurlIdentifier ( StandardTypes . MAVEN , artifact . getGroupId ( ) , artifact . getArtifactId ( ) , artifact . getVersion ( ) , Confidence . HIGHEST ) ; } catch ( MalformedPackageURLException ex ) { getLog ( ) . debug ( "Unable to create PackageURL object:" + key ) ; id = new GenericIdentifier ( "maven:" + key , Confidence . HIGHEST ) ; } d . addSoftwareIdentifier ( id ) ; // TODO unify the setName / version and package path - they are equivelent ideas submitted by two seperate committers d . setName ( String . format ( "%s:%s" , prj . getGroupId ( ) , prj . getArtifactId ( ) ) ) ; d . setVersion ( prj . getVersion ( ) ) ; d . setPackagePath ( displayName ) ; if ( prj . getDescription ( ) != null ) { JarAnalyzer . addDescription ( d , prj . getDescription ( ) , "project" , "description" ) ; } for ( License l : prj . getLicenses ( ) ) { final StringBuilder license = new StringBuilder ( ) ; if ( l . getName ( ) != null ) { license . append ( l . getName ( ) ) ; } if ( l . getUrl ( ) != null ) { license . append ( " " ) . append ( l . getUrl ( ) ) ; } if ( d . getLicense ( ) == null ) { d . setLicense ( license . toString ( ) ) ; } else if ( ! d . getLicense ( ) . contains ( license ) ) { d . setLicense ( String . format ( "%s%n%s" , d . getLicense ( ) , license . toString ( ) ) ) ; } } engine . addDependency ( d ) ; return true ; } } return false ;
public class UsersBase { /** * Returns the user records for all users in the specified workspace or * organization . * @ param workspace The workspace in which to get users . * @ return Request object */ public CollectionRequest < User > findByWorkspace ( String workspace ) { } }
String path = String . format ( "/workspaces/%s/users" , workspace ) ; return new CollectionRequest < User > ( this , User . class , path , "GET" ) ;
public class WebApp { /** * Specific ) */ public void initialize ( WebAppConfiguration config , DeployedModule moduleConfig , // BEGIN : List extensionFactories ) throws ServletException , Throwable { } }
if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) logger . entering ( CLASS_NAME , "Initialize WebApp -> [ " + this + " ]" ) ; this . loader = moduleConfig . getClassLoader ( ) ; // NEVER INVOKED BY // WEBSPHERE APPLICATION // SERVER ( Common Component // Specific ) this . applicationName = config . getApplicationName ( ) ; // NEVER INVOKED BY // WEBSPHERE APPLICATION // SERVER ( Common // Component Specific ) if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) logger . logp ( Level . FINE , CLASS_NAME , "initialize" , "Initializing application " + this . applicationName ) ; // PK63920 End serverInfo = getServerInfo ( ) ; // NEVER INVOKED BY WEBSPHERE APPLICATION // SERVER ( Common Component Specific ) // Initialize the Logger for IDGeneratorImpl before setting Thread context ClassLoader // in order to avoid using the application ClassLoader to load the Logger ' s resource bundle . IDGeneratorImpl . init ( ) ; ClassLoader origClassLoader = null ; // NEVER INVOKED BY WEBSPHERE // APPLICATION SERVER ( Common // Component Specific ) try { origClassLoader = ThreadContextHelper . getContextClassLoader ( ) ; // NEVER // INVOKED // BY // WEBSPHERE // APPLICATION // SERVER // ( Common // Component // Specific ) final ClassLoader warClassLoader = getClassLoader ( ) ; // NEVER // INVOKED BY // WEBSPHERE // APPLICATION // SERVER // ( Common // Component // Specific ) if ( warClassLoader != origClassLoader ) // NEVER INVOKED BY WEBSPHERE // APPLICATION SERVER ( Common // Component Specific ) { ThreadContextHelper . setClassLoader ( warClassLoader ) ; // NEVER // INVOKED // BY // WEBSPHERE // APPLICATION // SERVER // ( Common // Component // Specific ) } else { origClassLoader = null ; // NEVER INVOKED BY WEBSPHERE // APPLICATION SERVER ( Common Component // Specific ) } commonInitializationStart ( config , moduleConfig ) ; // NEVER INVOKED BY // WEBSPHERE // APPLICATION // SERVER ( Common // Component // Specific ) callWebAppInitializationCollaborators ( InitializationCollaborCommand . STARTING ) ; // No longer in use ; post - construct and pre - destroy are located on demand . // Find annotations like PostConstruct and PreDestroy on objects in this web app // setupWebAppAnnotations ( ) ; webAppNameSpaceCollab . preInvoke ( config . getMetaData ( ) . getCollaboratorComponentMetaData ( ) ) ; // added 661473 commonInitializationFinish ( extensionFactories ) ; // NEVER INVOKED BY this . initializeServletContainerInitializers ( moduleConfig ) ; loadLifecycleListeners ( ) ; // added 661473 // WEBSPHERE // APPLICATION // SERVER ( Common // Component // Specific ) try { // moved out of commonInitializationFinish notifyServletContextCreated ( ) ; } catch ( Throwable th ) { // pk435011 logger . logp ( Level . SEVERE , CLASS_NAME , "initialize" , "error.notifying.listeners.of.WebApp.start" , new Object [ ] { th } ) ; if ( WCCustomProperties . STOP_APP_STARTUP_ON_LISTENER_EXCEPTION ) { // PI58875 if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) logger . logp ( Level . FINE , CLASS_NAME , "initialize" , "rethrowing exception due to stopAppStartupOnListenerException" ) ; throw th ; } } commonInitializationFinally ( extensionFactories ) ; // NEVER INVOKED BY webAppNameSpaceCollab . postInvoke ( ) ; // added 661473 // WEBSPHERE // APPLICATION // SERVER ( Common // Component // Specific ) // Fix for 96420 , in which if the first call to AnnotationHelperManager happens in destroy ( ) , we can get // errors because the bundle associated with the thread context classloader may have been uninstalled , // resulting in us being unable to load a resource bundle for AnnotationHelperManager . AnnotationHelperManager . verifyClassIsLoaded ( ) ; } finally { if ( origClassLoader != null ) // NEVER INVOKED BY WEBSPHERE // APPLICATION SERVER ( Common Component // Specific ) { final ClassLoader fOrigClassLoader = origClassLoader ; // NEVER // INVOKED // BY // WEBSPHERE // APPLICATION // SERVER // ( Common // Component // Specific ) ThreadContextHelper . setClassLoader ( fOrigClassLoader ) ; // NEVER // INVOKED // BY // WEBSPHERE // APPLICATION // SERVER // ( Common // Component // Specific ) } if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) logger . exiting ( CLASS_NAME , "initializeTargetMappings" ) ; } // PK63920 Start if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) logger . exiting ( CLASS_NAME , "Initialize WebApp -> [ " + this + " ] ApplicationName -> [ " + config . getApplicationName ( ) + " ]" ) ; // PK63920 End
public class WindowsRegistry { /** * Read value ( s ) and value name ( s ) form given key * @ param hk the HKEY * @ param key the key * @ param charsetName which charset to use * @ return the value name ( s ) plus the value ( s ) * @ throws RegistryException when something is not right */ public Map < String , String > readStringValues ( HKey hk , String key , String charsetName ) throws RegistryException { } }
try { return ReflectedMethods . readStringValues ( hk . root ( ) , hk . hex ( ) , key , charsetName ) ; } catch ( Exception e ) { throw new RegistryException ( "Cannot read values from key " + key , e ) ; }
public class AbstractArchivingMojo { /** * Hack to close input streams ( cleanUp ( ) method is protected ) */ protected void cleanUpArchiver ( AbstractArchiver archiver ) { } }
try { Method cleanUpMethod = AbstractArchiver . class . getDeclaredMethod ( "cleanUp" ) ; cleanUpMethod . setAccessible ( true ) ; cleanUpMethod . invoke ( archiver ) ; } catch ( Exception e ) { getLog ( ) . warn ( "\"" + e . getMessage ( ) + "\" exception while invoking AbstractArchiver.cleanUp() using reflection. Ignoring." ) ; }
public class LongsSketch { /** * Returns a sketch instance of this class from the given String , * which must be a String representation of this sketch class . * @ param string a String representation of a sketch of this class . * @ return a sketch instance of this class . */ public static LongsSketch getInstance ( final String string ) { } }
final String [ ] tokens = string . split ( "," ) ; if ( tokens . length < ( STR_PREAMBLE_TOKENS + 2 ) ) { throw new SketchesArgumentException ( "String not long enough: " + tokens . length ) ; } final int serVer = Integer . parseInt ( tokens [ 0 ] ) ; final int famID = Integer . parseInt ( tokens [ 1 ] ) ; final int lgMax = Integer . parseInt ( tokens [ 2 ] ) ; final int flags = Integer . parseInt ( tokens [ 3 ] ) ; final long streamWt = Long . parseLong ( tokens [ 4 ] ) ; final long offset = Long . parseLong ( tokens [ 5 ] ) ; // error offset // should always get at least the next 2 from the map final int numActive = Integer . parseInt ( tokens [ 6 ] ) ; final int lgCur = Integer . numberOfTrailingZeros ( Integer . parseInt ( tokens [ 7 ] ) ) ; // checks if ( serVer != SER_VER ) { throw new SketchesArgumentException ( "Possible Corruption: Bad SerVer: " + serVer ) ; } Family . FREQUENCY . checkFamilyID ( famID ) ; final boolean empty = flags > 0 ; if ( ! empty && ( numActive == 0 ) ) { throw new SketchesArgumentException ( "Possible Corruption: !Empty && NumActive=0; strLen: " + numActive ) ; } final int numTokens = tokens . length ; if ( ( 2 * numActive ) != ( numTokens - STR_PREAMBLE_TOKENS - 2 ) ) { throw new SketchesArgumentException ( "Possible Corruption: Incorrect # of tokens: " + numTokens + ", numActive: " + numActive ) ; } final LongsSketch sketch = new LongsSketch ( lgMax , lgCur ) ; sketch . streamWeight = streamWt ; sketch . offset = offset ; sketch . hashMap = deserializeFromStringArray ( tokens ) ; return sketch ;
public class ItemsSketch { /** * Updates this sketch with the given double data item * @ param dataItem an item from a stream of items . NaNs are ignored . */ public void update ( final T dataItem ) { } }
// this method only uses the base buffer part of the combined buffer if ( dataItem == null ) { return ; } if ( ( maxValue_ == null ) || ( comparator_ . compare ( dataItem , maxValue_ ) > 0 ) ) { maxValue_ = dataItem ; } if ( ( minValue_ == null ) || ( comparator_ . compare ( dataItem , minValue_ ) < 0 ) ) { minValue_ = dataItem ; } if ( ( baseBufferCount_ + 1 ) > combinedBufferItemCapacity_ ) { ItemsSketch . growBaseBuffer ( this ) ; } combinedBuffer_ [ baseBufferCount_ ++ ] = dataItem ; n_ ++ ; if ( baseBufferCount_ == ( 2 * k_ ) ) { ItemsUtil . processFullBaseBuffer ( this ) ; }
public class TouchActionBuilder { /** * Pause for a given period of time ( in milliseconds ) . * If used in a MultiTouchAction all actions will pause for the longest pause in a given tick . * @ param ms Pause Time ( in ms ) * @ return this */ public TouchActionBuilder pause ( int ms ) { } }
Map < String , Object > params = Maps . newHashMap ( ) ; params . put ( "ms" , ms ) ; addAction ( TouchActionName . PAUSE , params ) ; return this ;
public class FeatureTypeStyleWrapper { /** * Add a { @ link RuleWrapper } to the list . * @ param addRule the { @ link Rule } to add . */ public void addRule ( RuleWrapper addRule ) { } }
Rule rule = addRule . getRule ( ) ; featureTypeStyle . rules ( ) . add ( rule ) ; rulesWrapperList . add ( addRule ) ;
public class JSONAssert { /** * Asserts that the json string provided does not match the expected string . If it is it throws an * { @ link AssertionError } . * @ param expectedStr Expected JSON string * @ param actualStr String to compare * @ param comparator Comparator * @ throws JSONException JSON parsing error */ public static void assertNotEquals ( String expectedStr , String actualStr , JSONComparator comparator ) throws JSONException { } }
assertNotEquals ( "" , expectedStr , actualStr , comparator ) ;
public class MoreValidate { /** * 校验为正数则返回该数字 , 否则抛出异常 . */ public static double positive ( @ Nullable String role , double x ) { } }
if ( ! ( x > 0 ) ) { // not x < 0 , to work with NaN . throw new IllegalArgumentException ( role + " (" + x + ") must be >= 0" ) ; } return x ;
public class InternalUtils { /** * Set the current { @ link ActionResolver } ( or { @ link PageFlowController } ) in the user session . * @ param resolver the { @ link ActionResolver } to set as the current one in the user session . * @ deprecated Will be removed in the next version . */ public static void setCurrentActionResolver ( ActionResolver resolver , HttpServletRequest request , ServletContext servletContext ) { } }
StorageHandler sh = Handlers . get ( servletContext ) . getStorageHandler ( ) ; HttpServletRequest unwrappedRequest = PageFlowUtils . unwrapMultipart ( request ) ; RequestContext rc = new RequestContext ( unwrappedRequest , null ) ; String currentJpfAttrName = ScopedServletUtils . getScopedSessionAttrName ( CURRENT_JPF_ATTR , unwrappedRequest ) ; String currentLongLivedJpfAttrName = ScopedServletUtils . getScopedSessionAttrName ( CURRENT_LONGLIVED_ATTR , unwrappedRequest ) ; // This case occurs when the previous page flow is no longer active and there is no new page flow if ( resolver == null ) { sh . removeAttribute ( rc , currentJpfAttrName ) ; sh . removeAttribute ( rc , currentLongLivedJpfAttrName ) ; return ; } // If this is a long - lived page flow , also store the instance in an attribute that never goes away . if ( resolver . isPageFlow ( ) && isLongLived ( ( ( PageFlowController ) resolver ) . theModuleConfig ( ) ) ) { String longLivedAttrName = getLongLivedFlowAttr ( resolver . getModulePath ( ) ) ; longLivedAttrName = ScopedServletUtils . getScopedSessionAttrName ( longLivedAttrName , unwrappedRequest ) ; // Only set this attribute if it ' s not already there . We want to avoid our onDestroy ( ) callback that ' s // invoked when the page flow ' s session attribute is unbound . if ( sh . getAttribute ( rc , longLivedAttrName ) != resolver ) { sh . setAttribute ( rc , longLivedAttrName , resolver ) ; } sh . setAttribute ( rc , currentLongLivedJpfAttrName , resolver . getModulePath ( ) ) ; sh . removeAttribute ( rc , currentJpfAttrName ) ; } // Default case for removing a previous page flow in the presence of a new page flow . else { sh . setAttribute ( rc , currentJpfAttrName , resolver ) ; sh . removeAttribute ( rc , currentLongLivedJpfAttrName ) ; }
public class ReportingApi { /** * Get statistics * Get the statistics for the specified subscription IDs . * @ param ids The IDs of the subscriptions . ( required ) * @ return ApiResponse & lt ; InlineResponse2001 & gt ; * @ throws ApiException If fail to call the API , e . g . server error or cannot deserialize the response body */ public ApiResponse < InlineResponse2001 > peekMultipleWithHttpInfo ( String ids ) throws ApiException { } }
com . squareup . okhttp . Call call = peekMultipleValidateBeforeCall ( ids , null , null ) ; Type localVarReturnType = new TypeToken < InlineResponse2001 > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnType ) ;
public class EnumMap { /** * Reconstitute the < tt > EnumMap < / tt > instance from a stream ( i . e . , * deserialize it ) . */ @ SuppressWarnings ( "unchecked" ) private void readObject ( java . io . ObjectInputStream s ) throws java . io . IOException , ClassNotFoundException { } }
// Read in the key type and any hidden stuff s . defaultReadObject ( ) ; keyUniverse = getKeyUniverse ( keyType ) ; vals = new Object [ keyUniverse . length ] ; // Read in size ( number of Mappings ) int size = s . readInt ( ) ; // Read the keys and values , and put the mappings in the HashMap for ( int i = 0 ; i < size ; i ++ ) { K key = ( K ) s . readObject ( ) ; V value = ( V ) s . readObject ( ) ; put ( key , value ) ; }
public class StrSubstitutor { /** * Internal method that resolves the value of a variable . * Most users of this class do not need to call this method . This method is * called automatically by the substitution process . * Writers of subclasses can override this method if they need to alter * how each substitution occurs . The method is passed the variable ' s name * and must return the corresponding value . This implementation uses the * { @ link # getVariableResolver ( ) } with the variable ' s name as the key . * @ param variableName the name of the variable , not null * @ param buf the buffer where the substitution is occurring , not null * @ param startPos the start position of the variable including the prefix , valid * @ param endPos the end position of the variable including the suffix , valid * @ return the variable ' s value or < b > null < / b > if the variable is unknown */ protected String resolveVariable ( final String variableName , final StrBuilder buf , final int startPos , final int endPos ) { } }
final StrLookup < ? > resolver = getVariableResolver ( ) ; if ( resolver == null ) { return null ; } return resolver . lookup ( variableName ) ;
public class Yank { /** * Handles exceptions and logs them * @ param e the SQLException */ private static void handleSQLException ( SQLException e , String poolName , String sql ) { } }
YankSQLException yankSQLException = new YankSQLException ( e , poolName , sql ) ; if ( throwWrappedExceptions ) { throw yankSQLException ; } else { logger . error ( yankSQLException . getMessage ( ) , yankSQLException ) ; }
public class NatsConnectionReader { /** * given to the message object */ void gatherMessageData ( int maxPos ) throws IOException { } }
try { while ( this . bufferPosition < maxPos ) { int possible = maxPos - this . bufferPosition ; int want = msgData . length - msgDataPosition ; // Grab all we can , until we get to the CR / LF if ( want > 0 && want <= possible ) { System . arraycopy ( this . buffer , this . bufferPosition , this . msgData , this . msgDataPosition , want ) ; msgDataPosition += want ; this . bufferPosition += want ; continue ; } else if ( want > 0 ) { System . arraycopy ( this . buffer , this . bufferPosition , this . msgData , this . msgDataPosition , possible ) ; msgDataPosition += possible ; this . bufferPosition += possible ; continue ; } byte b = this . buffer [ this . bufferPosition ] ; this . bufferPosition ++ ; if ( gotCR ) { if ( b == NatsConnection . LF ) { incoming . setData ( msgData ) ; this . connection . deliverMessage ( incoming ) ; msgData = null ; msgDataPosition = 0 ; incoming = null ; gotCR = false ; this . op = UNKNOWN_OP ; this . mode = Mode . GATHER_OP ; break ; } else { throw new IllegalStateException ( "Bad socket data, no LF after CR" ) ; } } else if ( b == NatsConnection . CR ) { gotCR = true ; } else { throw new IllegalStateException ( "Bad socket data, no CRLF after data" ) ; } } } catch ( IllegalStateException | NullPointerException ex ) { this . encounteredProtocolError ( ex ) ; }
public class ConsistentColor { /** * Apply correction for color vision deficiencies to an angle in the CbCr plane . * @ see < a href = " https : / / xmpp . org / extensions / xep - 0392 . html # algorithm - cvd " > § 5.2 : Corrections for Color Vision Deficiencies < / a > * @ param angle angle in CbCr plane * @ param deficiency type of vision deficiency * @ return corrected angle in CbCr plane */ private static double applyColorDeficiencyCorrection ( double angle , Deficiency deficiency ) { } }
switch ( deficiency ) { case none : break ; case redGreenBlindness : angle %= Math . PI ; break ; case blueBlindness : angle -= Math . PI / 2 ; angle %= Math . PI ; angle += Math . PI / 2 ; break ; } return angle ;
public class InstanceGroupManagerClient { /** * Resizes the managed instance group . If you increase the size , the group creates new instances * using the current instance template . If you decrease the size , the group deletes instances . The * resize operation is marked DONE when the resize actions are scheduled even if the group has not * yet added or deleted any instances . You must separately verify the status of the creating or * deleting actions with the listmanagedinstances method . * < p > When resizing down , the instance group arbitrarily chooses the order in which VMs are * deleted . The group takes into account some VM attributes when making the selection including : * < p > + The status of the VM instance . + The health of the VM instance . + The instance template * version the VM is based on . + For regional managed instance groups , the location of the VM * instance . * < p > This list is subject to change . * < p > If the group is part of a backend service that has enabled connection draining , it can take * up to 60 seconds after the connection draining duration has elapsed before the VM instance is * removed or deleted . * < p > Sample code : * < pre > < code > * try ( InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient . create ( ) ) { * Integer size = 0; * ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName . of ( " [ PROJECT ] " , " [ ZONE ] " , " [ INSTANCE _ GROUP _ MANAGER ] " ) ; * Operation response = instanceGroupManagerClient . resizeInstanceGroupManager ( size , instanceGroupManager . toString ( ) ) ; * < / code > < / pre > * @ param size The number of running instances that the managed instance group should maintain at * any given time . The group automatically adds or removes instances to maintain the number of * instances specified by this parameter . * @ param instanceGroupManager The name of the managed instance group . * @ throws com . google . api . gax . rpc . ApiException if the remote call fails */ @ BetaApi public final Operation resizeInstanceGroupManager ( Integer size , String instanceGroupManager ) { } }
ResizeInstanceGroupManagerHttpRequest request = ResizeInstanceGroupManagerHttpRequest . newBuilder ( ) . setSize ( size ) . setInstanceGroupManager ( instanceGroupManager ) . build ( ) ; return resizeInstanceGroupManager ( request ) ;
public class DefaultCumulatives { /** * Symmetry breaking for VMs that stay running , on the same node . * @ return { @ code true } iff the symmetry breaking does not lead to a problem without solutions */ private boolean symmetryBreakingForStayingVMs ( ReconfigurationProblem rp ) { } }
for ( VM vm : rp . getFutureRunningVMs ( ) ) { VMTransition a = rp . getVMAction ( vm ) ; Slice dSlice = a . getDSlice ( ) ; Slice cSlice = a . getCSlice ( ) ; if ( dSlice != null && cSlice != null ) { BoolVar stay = ( ( KeepRunningVM ) a ) . isStaying ( ) ; Boolean ret = strictlyDecreasingOrUnchanged ( vm ) ; if ( Boolean . TRUE . equals ( ret ) && ! zeroDuration ( rp , stay , cSlice ) ) { return false ; // Else , the resource usage is decreasing , so // we set the cSlice duration to 0 to directly reduces the resource allocation } else if ( Boolean . FALSE . equals ( ret ) && ! zeroDuration ( rp , stay , dSlice ) ) { // If the resource usage will be increasing // Then the duration of the dSlice can be set to 0 // ( the allocation will be performed at the end of the reconfiguration process ) return false ; } } } return true ;
public class Job { /** * Invoke this method from within the { @ code run } method of a < b > generator * job < / b > in order to specify a job node in the generated child job graph . * This version of the method is for child jobs that take four arguments . * @ param < T > The return type of the child job being specified * @ param < T1 > The type of the first input to the child job * @ param < T2 > The type of the second input to the child job * @ param < T3 > The type of the third input to the child job * @ param < T4 > The type of the fourth input to the child job * @ param jobInstance A user - written job object * @ param v1 the first input to the child job * @ param v2 the second input to the child job * @ param v3 the third input to the child job * @ param v4 the fourth input to the child job * @ param settings Optional one or more { @ code JobSetting } * @ return a { @ code FutureValue } representing an empty value slot that will be * filled by the output of { @ code jobInstance } when it finalizes . This * may be passed in to further invocations of { @ code futureCall ( ) } in * order to specify a data dependency . */ public < T , T1 , T2 , T3 , T4 > FutureValue < T > futureCall ( Job4 < T , T1 , T2 , T3 , T4 > jobInstance , Value < ? extends T1 > v1 , Value < ? extends T2 > v2 , Value < ? extends T3 > v3 , Value < ? extends T4 > v4 , JobSetting ... settings ) { } }
return futureCallUnchecked ( settings , jobInstance , v1 , v2 , v3 , v4 ) ;
public class Cappuccino { /** * Returns a new { @ code CappuccinoResourceWatcher } , which will be associated internally with the name supplied . * @ param name The name of this { @ link CappuccinoResourceWatcher } . * @ return an { @ link CappuccinoResourceWatcher } . */ @ NonNull public static CappuccinoResourceWatcher newIdlingResourceWatcher ( @ NonNull String name ) { } }
CappuccinoResourceWatcher watcher = new CappuccinoResourceWatcher ( ) ; mResourceWatcherRegistry . put ( name , watcher ) ; return watcher ;
public class CompatibleTypeUtils { /** * 兼容类型转换 。 * < ul > * < li > String - & gt ; char , enum , Date < / li > * < li > Number - & gt ; Number < / li > * < li > List - & gt ; Array < / li > * < / ul > * @ param value 原始值 * @ param type 目标类型 * @ return 目标值 */ @ SuppressWarnings ( { } }
"unchecked" , "rawtypes" } ) public static Object convert ( Object value , Class < ? > type ) { if ( value == null || type == null || type . isAssignableFrom ( value . getClass ( ) ) ) { return value ; } if ( value instanceof String ) { String string = ( String ) value ; if ( char . class . equals ( type ) || Character . class . equals ( type ) ) { if ( string . length ( ) != 1 ) { throw new IllegalArgumentException ( String . format ( "can not convert String(%s) to char!" + " when convert String to char, the String must only 1 char." , string ) ) ; } return string . charAt ( 0 ) ; } else if ( type . isEnum ( ) ) { return Enum . valueOf ( ( Class < Enum > ) type , string ) ; } else if ( type == BigInteger . class ) { return new BigInteger ( string ) ; } else if ( type == BigDecimal . class ) { return new BigDecimal ( string ) ; } else if ( type == Short . class || type == short . class ) { return Short . valueOf ( string ) ; } else if ( type == Integer . class || type == int . class ) { return Integer . valueOf ( string ) ; } else if ( type == Long . class || type == long . class ) { return Long . valueOf ( string ) ; } else if ( type == Double . class || type == double . class ) { return new Double ( string ) ; } else if ( type == Float . class || type == float . class ) { return new Float ( string ) ; } else if ( type == Byte . class || type == byte . class ) { return Byte . valueOf ( string ) ; } else if ( type == Boolean . class || type == boolean . class ) { return Boolean . valueOf ( string ) ; } else if ( type == Date . class || type == java . sql . Date . class || type == java . sql . Time . class || type == java . sql . Timestamp . class ) { try { if ( type == Date . class ) { return DateUtils . strToDate ( string , DateUtils . DATE_FORMAT_TIME ) ; } else if ( type == java . sql . Date . class ) { return new java . sql . Date ( DateUtils . strToLong ( string ) ) ; } else if ( type == java . sql . Timestamp . class ) { return new java . sql . Timestamp ( DateUtils . strToLong ( string ) ) ; } else { return new java . sql . Time ( DateUtils . strToLong ( string ) ) ; } } catch ( ParseException e ) { throw new IllegalStateException ( "Failed to parse date " + value + " by format " + DateUtils . DATE_FORMAT_TIME + ", cause: " + e . getMessage ( ) , e ) ; } } else if ( type == Class . class ) { return ClassTypeUtils . getClass ( ( String ) value ) ; } } else if ( value instanceof Number ) { Number number = ( Number ) value ; if ( type == byte . class || type == Byte . class ) { return number . byteValue ( ) ; } else if ( type == short . class || type == Short . class ) { return number . shortValue ( ) ; } else if ( type == int . class || type == Integer . class ) { return number . intValue ( ) ; } else if ( type == long . class || type == Long . class ) { return number . longValue ( ) ; } else if ( type == float . class || type == Float . class ) { return number . floatValue ( ) ; } else if ( type == double . class || type == Double . class ) { return number . doubleValue ( ) ; } else if ( type == BigInteger . class ) { return BigInteger . valueOf ( number . longValue ( ) ) ; } else if ( type == BigDecimal . class ) { return BigDecimal . valueOf ( number . doubleValue ( ) ) ; } else if ( type == Date . class ) { return new Date ( number . longValue ( ) ) ; } else if ( type == java . sql . Date . class ) { return new java . sql . Date ( number . longValue ( ) ) ; } else if ( type == java . sql . Time . class ) { return new java . sql . Time ( number . longValue ( ) ) ; } else if ( type == java . sql . Timestamp . class ) { return new java . sql . Timestamp ( number . longValue ( ) ) ; } } else if ( value instanceof Collection ) { Collection collection = ( Collection ) value ; if ( type . isArray ( ) ) { int length = collection . size ( ) ; Object array = Array . newInstance ( type . getComponentType ( ) , length ) ; int i = 0 ; for ( Object item : collection ) { Array . set ( array , i ++ , item ) ; } return array ; } else if ( ! type . isInterface ( ) ) { try { Collection result = ( Collection ) type . newInstance ( ) ; result . addAll ( collection ) ; return result ; } catch ( Throwable ignore ) { // NOPMD } } else if ( type == List . class ) { return new ArrayList < Object > ( collection ) ; } else if ( type == Set . class ) { return new HashSet < Object > ( collection ) ; } } else if ( value . getClass ( ) . isArray ( ) && Collection . class . isAssignableFrom ( type ) ) { Collection collection ; if ( ! type . isInterface ( ) ) { try { collection = ( Collection ) type . newInstance ( ) ; } catch ( Throwable e ) { collection = new ArrayList < Object > ( ) ; } } else if ( type == Set . class ) { collection = new HashSet < Object > ( ) ; } else { collection = new ArrayList < Object > ( ) ; } int length = Array . getLength ( value ) ; for ( int i = 0 ; i < length ; i ++ ) { collection . add ( Array . get ( value , i ) ) ; } return collection ; } return value ;
public class SQLite { /** * Get an { @ link # aliased ( String ) aliased } result column that applies the aggregate function to * the datetime column and converts the result to epoch milliseconds . * @ since 2.4.0 */ public static String millis ( String function , String column ) { } }
return millis ( function , column , aliased ( column ) ) ;
public class OidcUtil { /** * Encodes each parameter in the provided query . Expects the query argument to be the query string of a URL with parameters * in the format : param = value ( & param2 = value2 ) * * @ param query * @ return */ public static String encodeQuery ( String query ) { } }
if ( query == null ) { return null ; } StringBuilder rebuiltQuery = new StringBuilder ( ) ; // Encode parameters to mitigate XSS attacks String [ ] queryParams = query . split ( "&" ) ; for ( String param : queryParams ) { String rebuiltParam = encode ( param ) ; int equalIndex = param . indexOf ( "=" ) ; if ( equalIndex > - 1 ) { String name = param . substring ( 0 , equalIndex ) ; String value = ( equalIndex < ( param . length ( ) - 1 ) ) ? param . substring ( equalIndex + 1 ) : "" ; rebuiltParam = encode ( name ) + "=" + encode ( value ) ; } if ( ! rebuiltParam . isEmpty ( ) ) { rebuiltQuery . append ( rebuiltParam + "&" ) ; } } // Remove trailing ' & ' character if ( rebuiltQuery . length ( ) > 0 && rebuiltQuery . charAt ( rebuiltQuery . length ( ) - 1 ) == '&' ) { rebuiltQuery . deleteCharAt ( rebuiltQuery . length ( ) - 1 ) ; } return rebuiltQuery . toString ( ) ;
public class HttpUtils { /** * Do a GET request on the provided URL and construct the Query String part * with the provided list of parameters . If the URL already contains * parameters ( already contains a ' ? ' character ) , then the parameters are * added to the existing parameters . The parameters are converted into * < code > application / x - www - form - urlencoded < / code > . For example : * < code > field1 = value1 & amp ; field1 = value2 & amp ; field2 = value3 < / code > . The special * characters are encoded . If there is a space , it is encoded into ' % 20 ' . * @ param url * the base url * @ param params * the list of parameters to append to the query string * @ return the response * @ throws HttpException * when the request has failed */ public static Response get ( String url , List < Parameter > params ) throws HttpException { } }
String fullUrl = url ; String paramsStr = URLEncodedUtils . format ( convert ( params ) , "UTF-8" ) ; fullUrl += ( fullUrl . contains ( "?" ) ? "&" : "?" ) + paramsStr ; // spaces are replaced by ' + ' but some servers doesn ' t handle it // correctly // = > convert space to ' % 20' fullUrl = fullUrl . replaceAll ( "\\+" , "%20" ) ; try { LOG . debug ( "Sending HTTP GET request to {}" , fullUrl ) ; HttpGet request = new HttpGet ( fullUrl ) ; HttpResponse response = CLIENT . execute ( request ) ; int statusCode = response . getStatusLine ( ) . getStatusCode ( ) ; LOG . debug ( "HTTP GET request successfully sent to {}. Status code: {}" , fullUrl , statusCode ) ; return new Response ( statusCode , IOUtils . toString ( response . getEntity ( ) . getContent ( ) ) ) ; } catch ( IOException e ) { throw new HttpException ( "Failed to send GET request to " + fullUrl , e ) ; }
public class TaskDetails { /** * Looks through the hbase result ' s map of task details * and populates fields of { @ link TaskDetails } * @ param taskValues */ public void populate ( Map < byte [ ] , byte [ ] > taskValues ) { } }
this . taskId = ByteUtil . getValueAsString ( JobHistoryKeys . KEYS_TO_BYTES . get ( JobHistoryKeys . TASKID ) , taskValues ) ; this . type = ByteUtil . getValueAsString ( JobHistoryKeys . KEYS_TO_BYTES . get ( JobHistoryKeys . TASK_TYPE ) , taskValues ) ; this . status = ByteUtil . getValueAsString ( JobHistoryKeys . KEYS_TO_BYTES . get ( JobHistoryKeys . TASK_STATUS ) , taskValues ) ; String taskSplits = ByteUtil . getValueAsString ( JobHistoryKeys . KEYS_TO_BYTES . get ( JobHistoryKeys . SPLITS ) , taskValues ) ; if ( taskSplits != null ) { this . splits = taskSplits . split ( "," ) ; } this . startTime = ByteUtil . getValueAsLong ( JobHistoryKeys . KEYS_TO_BYTES . get ( JobHistoryKeys . START_TIME ) , taskValues ) ; this . finishTime = ByteUtil . getValueAsLong ( JobHistoryKeys . KEYS_TO_BYTES . get ( JobHistoryKeys . FINISH_TIME ) , taskValues ) ; this . taskAttemptId = ByteUtil . getValueAsString ( JobHistoryKeys . KEYS_TO_BYTES . get ( JobHistoryKeys . TASK_ATTEMPT_ID ) , taskValues ) ; this . trackerName = ByteUtil . getValueAsString ( JobHistoryKeys . KEYS_TO_BYTES . get ( JobHistoryKeys . TRACKER_NAME ) , taskValues ) ; this . httpPort = ByteUtil . getValueAsInt ( JobHistoryKeys . KEYS_TO_BYTES . get ( JobHistoryKeys . HTTP_PORT ) , taskValues ) ; this . hostname = ByteUtil . getValueAsString ( JobHistoryKeys . KEYS_TO_BYTES . get ( JobHistoryKeys . HOSTNAME ) , taskValues ) ; this . state = ByteUtil . getValueAsString ( JobHistoryKeys . KEYS_TO_BYTES . get ( JobHistoryKeys . STATE_STRING ) , taskValues ) ; this . error = ByteUtil . getValueAsString ( JobHistoryKeys . KEYS_TO_BYTES . get ( JobHistoryKeys . ERROR ) , taskValues ) ; this . shuffleFinished = ByteUtil . getValueAsLong ( JobHistoryKeys . KEYS_TO_BYTES . get ( JobHistoryKeys . SHUFFLE_FINISHED ) , taskValues ) ; this . sortFinished = ByteUtil . getValueAsLong ( JobHistoryKeys . KEYS_TO_BYTES . get ( JobHistoryKeys . SORT_FINISHED ) , taskValues ) ; // populate task counters this . counters = JobHistoryService . parseCounters ( Constants . COUNTER_COLUMN_PREFIX_BYTES , taskValues ) ;
public class KNXnetIPRouter { /** * Sets the default hop count ( TTL ) used in the IP header of encapsulated cEMI * messages . * This value is used to limit the multicast geographically , although this is just a * rough estimation . The hop count value is forwarded to the underlying multicast * socket used for communication . * @ param hopCount hop count value , 0 & lt ; = value & lt ; = 255 */ public final void setHopCount ( int hopCount ) { } }
if ( hopCount < 0 || hopCount > 255 ) throw new KNXIllegalArgumentException ( "hop count out of range" ) ; try { ( ( MulticastSocket ) socket ) . setTimeToLive ( hopCount ) ; } catch ( final IOException e ) { logger . error ( "failed to set hop count" , e ) ; }
public class WebUserDataPermission { /** * Returns a canonical String representation of the actions of this WebUserDataPermission . The canonical form of the * actions of a WebUserDataPermission is described by the following syntax description . * < pre > * ExtensionMethod : : = any token as defined by RFC 2616 * ( that is , 1 * [ any CHAR except CTLs or separators ] ) * HTTPMethod : : = " GET " | " POST " | " PUT " | " DELETE " | " HEAD " | * " OPTIONS " | " TRACE " | ExtensionMethod * HTTPMethodList : : = HTTPMethod | HTTPMethodList comma HTTPMethod * HTTPMethodExceptionList : : = exclaimationPoint HTTPMethodList * HTTPMethodSpec : : = emptyString | HTTPMethodExceptionList | * HTTPMethodList * transportType : : = " INTEGRAL " | " CONFIDENTIAL " | " NONE " * actions : : = null | HTTPMethodList | * HTTPMethodSpec colon transportType * < / pre > * If the permission ’ s HTTP methods correspond to the entire HTTP method set and the permission ’ s transport * type is “ INTEGRAL ” or “ CONFIDENTIAL ” , the HTTP methods shall be represented in the canonical form by an * emptyString HTTPMethodSpec . If the permission ’ s HTTP methods correspond to the entire HTTP method set , and the * permission ’ s transport type is not “ INTEGRAL ” or “ CONFIDENTIAL ” , the canonical actions value shall be the null * value . * If the permission ’ s methods do not correspond to the entire HTTP method set , duplicates must be eliminated and the * remaining elements must be ordered such that the predefined methods preceed the extension methods , and such that * within each method classification the corresponding methods occur in ascending lexical order . The resulting * ( non - emptyString ) HTTPMethodSpec must be included in the canonical form , and if the permission ’ s transport type is * not “ INTEGRAL ” or “ CONFIDENTIAL ” , the canonical actions value must be exactly the resulting HTTPMethodSpec . * @ return a String containing the canonicalized actions of this WebUserDataPermission ( or the null value ) . */ @ Override public String getActions ( ) { } }
String actions = null ; if ( httpMethodsString != null ) { actions = httpMethodsString ; } else if ( httpExceptionString != null ) { actions = "!" + httpExceptionString ; } if ( transportType != null ) { actions = ( actions == null ) ? ":" + transportType : actions + ":" + transportType ; } return actions ;
public class SQLBuilder { /** * Only the dirty properties will be set into the result SQL if the specified entity is a dirty marker entity . * @ param entity * @ param excludedPropNames * @ return */ public SQLBuilder set ( final Object entity , final Set < String > excludedPropNames ) { } }
if ( entity instanceof String ) { return set ( N . asArray ( ( String ) entity ) ) ; } else if ( entity instanceof Map ) { if ( N . isNullOrEmpty ( excludedPropNames ) ) { return set ( ( Map < String , Object > ) entity ) ; } else { final Map < String , Object > props = new LinkedHashMap < > ( ( Map < String , Object > ) entity ) ; Maps . removeKeys ( props , excludedPropNames ) ; return set ( props ) ; } } else { final Class < ? > entityClass = entity . getClass ( ) ; this . entityClass = entityClass ; final Collection < String > propNames = getUpdatePropNamesByClass ( entityClass , excludedPropNames ) ; final Set < String > dirtyPropNames = N . isDirtyMarker ( entityClass ) ? ( ( DirtyMarker ) entity ) . dirtyPropNames ( ) : null ; final Map < String , Object > props = N . newHashMap ( N . initHashCapacity ( N . isNullOrEmpty ( dirtyPropNames ) ? propNames . size ( ) : dirtyPropNames . size ( ) ) ) ; for ( String propName : propNames ) { if ( N . isNullOrEmpty ( dirtyPropNames ) || dirtyPropNames . contains ( propName ) ) { props . put ( propName , ClassUtil . getPropValue ( entity , propName ) ) ; } } return set ( props ) ; }
public class RTPDataChannel { /** * Checks whether the data channel is available for media exchange . * @ return */ public boolean isAvailable ( ) { } }
// The channel is available is is connected boolean available = this . rtpChannel != null && this . rtpChannel . isConnected ( ) ; // In case of WebRTC calls the DTLS handshake must be completed if ( this . isWebRtc ) { available = available && this . webRtcHandler . isHandshakeComplete ( ) ; } return available ;
public class CommittableFileLog { /** * This method appends a line to the file channel */ public void append ( byte [ ] toWrite ) throws BitsyException { } }
ByteBuffer buf = ByteBuffer . wrap ( toWrite ) ; append ( buf ) ;
public class JavaSoundPlayer { /** * On a spooling thread , */ protected void playSound ( SoundKey key ) { } }
if ( ! key . running ) { return ; } key . thread = Thread . currentThread ( ) ; SourceDataLine line = null ; try { // get the sound data from our LRU cache byte [ ] data = getClipData ( key ) ; if ( data == null ) { return ; // borked ! } else if ( key . isExpired ( ) ) { if ( _verbose . getValue ( ) ) { log . info ( "Sound expired [key=" + key . key + "]." ) ; } return ; } AudioInputStream stream = setupAudioStream ( data ) ; if ( key . isLoop ( ) && stream . markSupported ( ) ) { stream . mark ( data . length ) ; } // open the sound line AudioFormat format = stream . getFormat ( ) ; line = ( SourceDataLine ) AudioSystem . getLine ( new DataLine . Info ( SourceDataLine . class , format ) ) ; line . open ( format , LINEBUF_SIZE ) ; float setVolume = 1 ; float setPan = PAN_CENTER ; line . start ( ) ; _soundSeemsToWork = true ; long startTime = System . currentTimeMillis ( ) ; byte [ ] buffer = new byte [ LINEBUF_SIZE ] ; int totalRead = 0 ; do { // play the sound int count = 0 ; while ( key . running && count != - 1 ) { float vol = key . volume ; if ( vol != setVolume ) { adjustVolume ( line , vol ) ; setVolume = vol ; } float pan = key . pan ; if ( pan != setPan ) { adjustPan ( line , pan ) ; setPan = pan ; } try { count = stream . read ( buffer , 0 , buffer . length ) ; totalRead += count ; // The final - 1 will make us slightly off , but that ' s ok } catch ( IOException e ) { // this shouldn ' t ever ever happen because the stream // we ' re given is from a reliable source log . warning ( "Error reading clip data!" , e ) ; return ; } if ( count >= 0 ) { line . write ( buffer , 0 , count ) ; } } if ( key . isLoop ( ) ) { // if we ' re going to loop , reset the stream to the beginning if we can , // otherwise just remake the stream if ( stream . markSupported ( ) ) { stream . reset ( ) ; } else { stream = setupAudioStream ( data ) ; } } } while ( key . isLoop ( ) && key . running ) ; // sleep the drain time . We never trust line . drain ( ) because // it is buggy and locks up on natively multithreaded systems // ( linux , winXP with HT ) . float sampleRate = format . getSampleRate ( ) ; if ( sampleRate == AudioSystem . NOT_SPECIFIED ) { sampleRate = 11025 ; // most of our sounds are } int sampleSize = format . getSampleSizeInBits ( ) ; if ( sampleSize == AudioSystem . NOT_SPECIFIED ) { sampleSize = 16 ; } // Calculate the numerator as a long as a decent sized clip * 8000 can overflow an int int drainTime = ( int ) Math . ceil ( ( totalRead * 8 * 1000L ) / ( sampleRate * sampleSize ) ) ; // subtract out time we ' ve already spent doing things . drainTime -= System . currentTimeMillis ( ) - startTime ; drainTime = Math . max ( 0 , drainTime ) ; // add in a fudge factor of half a second drainTime += 500 ; try { Thread . sleep ( drainTime ) ; } catch ( InterruptedException ie ) { } } catch ( IOException ioe ) { log . warning ( "Error loading sound file [key=" + key + ", e=" + ioe + "]." ) ; } catch ( UnsupportedAudioFileException uafe ) { log . warning ( "Unsupported sound format [key=" + key + ", e=" + uafe + "]." ) ; } catch ( LineUnavailableException lue ) { String err = "Line not available to play sound [key=" + key . key + ", e=" + lue + "]." ; if ( _soundSeemsToWork ) { log . warning ( err ) ; } else { // this error comes every goddamned time we play a sound on someone with a // misconfigured sound card , so let ' s just keep it to ourselves log . debug ( err ) ; } } finally { if ( line != null ) { line . close ( ) ; } key . thread = null ; }
public class AbstractExecutableMemberWriter { /** * Add the inherited summary link for the member . * @ param te the type element that we should link to * @ param member the member being linked to * @ param linksTree the content tree to which the link will be added */ @ Override protected void addInheritedSummaryLink ( TypeElement te , Element member , Content linksTree ) { } }
linksTree . addContent ( writer . getDocLink ( MEMBER , te , member , name ( member ) , false ) ) ;
public class JobEnableOptions { /** * Set the time the request was issued . Client libraries typically set this to the current system clock time ; set it explicitly if you are calling the REST API directly . * @ param ocpDate the ocpDate value to set * @ return the JobEnableOptions object itself . */ public JobEnableOptions withOcpDate ( DateTime ocpDate ) { } }
if ( ocpDate == null ) { this . ocpDate = null ; } else { this . ocpDate = new DateTimeRfc1123 ( ocpDate ) ; } return this ;
public class CRFSegmenter { /** * Inits the . * @ param modelDir the model dir */ public void init ( String modelDir ) { } }
// Read feature template file String templateFile = modelDir + File . separator + "featuretemplate.xml" ; Vector < Element > nodes = BasicContextGenerator . readFeatureNodes ( templateFile ) ; for ( int i = 0 ; i < nodes . size ( ) ; ++ i ) { Element node = nodes . get ( i ) ; String cpType = node . getAttribute ( "value" ) ; BasicContextGenerator contextGen = null ; if ( cpType . equals ( "Conjunction" ) ) { contextGen = new ConjunctionContextGenerator ( node ) ; } else if ( cpType . equals ( "Lexicon" ) ) { contextGen = new LexiconContextGenerator ( node ) ; LexiconContextGenerator . loadVietnameseDict ( modelDir + File . separator + "VNDic_UTF-8.txt" ) ; LexiconContextGenerator . loadViLocationList ( modelDir + File . separator + "vnlocations.txt" ) ; LexiconContextGenerator . loadViPersonalNames ( modelDir + File . separator + "vnpernames.txt" ) ; } else if ( cpType . equals ( "Regex" ) ) { contextGen = new RegexContextGenerator ( node ) ; } else if ( cpType . equals ( "SyllableFeature" ) ) { contextGen = new SyllableContextGenerator ( node ) ; } else if ( cpType . equals ( "ViSyllableFeature" ) ) { contextGen = new VietnameseContextGenerator ( node ) ; } if ( contextGen != null ) dataTagger . addContextGenerator ( contextGen ) ; } // create context generators labeling = new Labeling ( modelDir , dataTagger , reader , writer ) ;
public class PackageUseWriter { /** * Add the list of packages that use the given package . * @ param contentTree the content tree to which the package list will be added */ protected void addPackageList ( Content contentTree ) { } }
Content caption = getTableCaption ( configuration . getContent ( "doclet.ClassUse_Packages.that.use.0" , getPackageLink ( packageElement , utils . getPackageName ( packageElement ) ) ) ) ; Content table = ( configuration . isOutputHtml5 ( ) ) ? HtmlTree . TABLE ( HtmlStyle . useSummary , caption ) : HtmlTree . TABLE ( HtmlStyle . useSummary , useTableSummary , caption ) ; table . addContent ( getSummaryTableHeader ( packageTableHeader , "col" ) ) ; Content tbody = new HtmlTree ( HtmlTag . TBODY ) ; boolean altColor = true ; for ( String pkgname : usingPackageToUsedClasses . keySet ( ) ) { PackageElement pkg = utils . elementUtils . getPackageElement ( pkgname ) ; HtmlTree tr = new HtmlTree ( HtmlTag . TR ) ; tr . addStyle ( altColor ? HtmlStyle . altColor : HtmlStyle . rowColor ) ; altColor = ! altColor ; addPackageUse ( pkg , tr ) ; tbody . addContent ( tr ) ; } table . addContent ( tbody ) ; Content li = HtmlTree . LI ( HtmlStyle . blockList , table ) ; contentTree . addContent ( li ) ;
public class LinkedServersInner { /** * Gets the detailed information about a linked server of a redis cache ( requires Premium SKU ) . * @ param resourceGroupName The name of the resource group . * @ param name The name of the redis cache . * @ param linkedServerName The name of the linked server . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the RedisLinkedServerWithPropertiesInner object */ public Observable < RedisLinkedServerWithPropertiesInner > getAsync ( String resourceGroupName , String name , String linkedServerName ) { } }
return getWithServiceResponseAsync ( resourceGroupName , name , linkedServerName ) . map ( new Func1 < ServiceResponse < RedisLinkedServerWithPropertiesInner > , RedisLinkedServerWithPropertiesInner > ( ) { @ Override public RedisLinkedServerWithPropertiesInner call ( ServiceResponse < RedisLinkedServerWithPropertiesInner > response ) { return response . body ( ) ; } } ) ;
public class GuiRenderer { /** * Ends the clipping . * @ param area the area */ public void endClipping ( ClipArea area ) { } }
if ( area . noClip ( ) ) return ; next ( ) ; GL11 . glDisable ( GL11 . GL_SCISSOR_TEST ) ; GL11 . glPopAttrib ( ) ;
public class Flowable { /** * Maps the upstream items into { @ link SingleSource } s and subscribes to them one after the * other succeeds or fails , emits their success values and optionally delays errors * till both this { @ code Flowable } and all inner { @ code SingleSource } s terminate . * < img width = " 640 " height = " 305 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / concatMap . png " alt = " " > * < dl > * < dt > < b > Backpressure : < / b > < / dt > * < dd > The operator expects the upstream to support backpressure and honors * the backpressure from downstream . If this { @ code Flowable } violates the rule , the operator will * signal a { @ code MissingBackpressureException } . < / dd > * < dt > < b > Scheduler : < / b > < / dt > * < dd > { @ code concatMapSingleDelayError } does not operate by default on a particular { @ link Scheduler } . < / dd > * < / dl > * < p > History : 2.1.11 - experimental * @ param < R > the result type of the inner { @ code SingleSource } s * @ param mapper the function called with the upstream item and should return * a { @ code SingleSource } to become the next source to * be subscribed to * @ param tillTheEnd If { @ code true } , errors from this { @ code Flowable } or any of the * inner { @ code SingleSource } s are delayed until all * of them terminate . If { @ code false } , an error from this * { @ code Flowable } is delayed until the current inner * { @ code SingleSource } terminates and only then is * it emitted to the downstream . * @ param prefetch The number of upstream items to prefetch so that fresh items are * ready to be mapped when a previous { @ code SingleSource } terminates . * The operator replenishes after half of the prefetch amount has been consumed * and turned into { @ code SingleSource } s . * @ return a new Flowable instance * @ see # concatMapSingle ( Function , int ) * @ since 2.2 */ @ CheckReturnValue @ BackpressureSupport ( BackpressureKind . FULL ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final < R > Flowable < R > concatMapSingleDelayError ( Function < ? super T , ? extends SingleSource < ? extends R > > mapper , boolean tillTheEnd , int prefetch ) { } }
ObjectHelper . requireNonNull ( mapper , "mapper is null" ) ; ObjectHelper . verifyPositive ( prefetch , "prefetch" ) ; return RxJavaPlugins . onAssembly ( new FlowableConcatMapSingle < T , R > ( this , mapper , tillTheEnd ? ErrorMode . END : ErrorMode . BOUNDARY , prefetch ) ) ;
public class SessionStoreInterceptor { /** * Returns an object in session . * @ param session session . * @ param key Key under which object is saved . * @ return Object . * @ deprecated Use { @ link HttpSession # getAttribute ( String ) } instead . */ @ Deprecated public static Object getAttribute ( HttpSession session , String key ) { } }
return session . getAttribute ( key ) ;
public class Const { /** * { @ inheritDoc } */ @ Override public < C , D > Const < C , D > biMap ( Function < ? super A , ? extends C > lFn , Function < ? super B , ? extends D > rFn ) { } }
return new Const < > ( lFn . apply ( a ) ) ;
public class JDBCClob { /** * Retrieves the < code > CLOB < / code > value designated by this < code > Clob < / code > * object as a < code > java . io . Reader < / code > object ( or as a stream of * characters ) . * @ return a < code > java . io . Reader < / code > object containing the * < code > CLOB < / code > data * @ exception SQLException if there is an error accessing the * < code > CLOB < / code > value * @ exception SQLFeatureNotSupportedException if the JDBC driver does not support * this method * @ see # setCharacterStream * @ since JDK 1.2 , HSQLDB 1.7.2 */ public java . io . Reader getCharacterStream ( ) throws SQLException { } }
final String ldata = data ; checkValid ( ldata ) ; return new StringReader ( ldata ) ;
public class StreamEx { /** * Returns a stream consisting of the elements of this stream for which the * supplied mapper function returns the given value . * This is an < a href = " package - summary . html # StreamOps " > intermediate * operation < / a > . * This method behaves like * { @ code filter ( t - > Objects . equals ( value , mapper . apply ( t ) ) ) } . * @ param < K > type of the value returned by mapper function . * @ param mapper a * < a href = " package - summary . html # NonInterference " > non - interfering * < / a > , < a href = " package - summary . html # Statelessness " > stateless < / a > * function which is applied to the stream element and its returned * value is compared with the supplied value . * @ param value a value the mapper function must return to pass the filter . * @ return the new stream * @ since 0.6.4 * @ see # filter ( Predicate ) */ public < K > StreamEx < T > filterBy ( Function < ? super T , ? extends K > mapper , K value ) { } }
return value == null ? filter ( t -> mapper . apply ( t ) == null ) : filter ( t -> value . equals ( mapper . apply ( t ) ) ) ;
public class DOMHelper { /** * Get the next sibling element . * @ param node The start node . * @ return The next sibling element or { @ code null } . */ public static final Element getNextSiblingElement ( Node node ) { } }
List < Node > siblings = node . getParent ( ) . getChildren ( ) ; Node n = null ; int index = siblings . indexOf ( node ) + 1 ; if ( index > 0 && index < siblings . size ( ) ) { n = siblings . get ( index ) ; while ( ! ( n instanceof Element ) && ++ index < siblings . size ( ) ) { n = siblings . get ( index ) ; } if ( index == siblings . size ( ) ) { n = null ; } } return ( Element ) n ;
public class route6 { /** * Use this API to fetch all the route6 resources that are configured on netscaler . * This uses route6 _ args which is a way to provide additional arguments while fetching the resources . */ public static route6 [ ] get ( nitro_service service , route6_args args ) throws Exception { } }
route6 obj = new route6 ( ) ; options option = new options ( ) ; option . set_args ( nitro_util . object_to_string_withoutquotes ( args ) ) ; route6 [ ] response = ( route6 [ ] ) obj . get_resources ( service , option ) ; return response ;
public class EFMImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public void setFMName ( String newFMName ) { } }
String oldFMName = fmName ; fmName = newFMName ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , AfplibPackage . EFM__FM_NAME , oldFMName , fmName ) ) ;
public class EJBSecurityCollaboratorImpl { /** * If invoked and received cred are null , then set the unauthenticated subject . * @ param invokedSubject * @ param receivedSubject * @ return { @ code true } if the unauthenticated subject was set , { @ code false } otherwise . */ private boolean setUnauthenticatedSubjectIfNeeded ( Subject invokedSubject , Subject receivedSubject ) { } }
if ( ( invokedSubject == null ) && ( receivedSubject == null ) ) { // create the unauthenticated subject and set as the invocation subject subjectManager . setInvocationSubject ( unauthenticatedSubjectServiceRef . getService ( ) . getUnauthenticatedSubject ( ) ) ; return true ; } return false ;
public class TransactionLogger { /** * Get string value of flow context for current instance * @ return string value of flow context */ public static String getFlowContext ( ) { } }
TransactionLogger instance = getInstance ( ) ; if ( instance == null ) { return null ; } return instance . flowContext ;
public class ValueUtils { /** * Convert a target object to { @ link List } . * @ param target * @ return */ public static List < ? > convertArrayOrList ( Object target ) { } }
if ( target instanceof JsonNode ) { return convertArrayOrList ( ( JsonNode ) target ) ; } return target instanceof Object [ ] ? Arrays . asList ( ( Object [ ] ) target ) : target instanceof Collection ? new ArrayList < Object > ( ( Collection < ? > ) target ) : null ;