signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class GenericsUtils { /** * Given a parameterized type and a generic type information , aligns actual type parameters . For example , if a * class uses generic type < pre > & lt ; T , U , V & gt ; < / pre > ( redirectGenericTypes ) , is used with actual type parameters * < pre > & lt ; java . lang . String ,...
if ( alignmentTarget == null ) return EMPTY_GENERICS_ARRAY ; if ( parameterizedTypes == null || parameterizedTypes . length == 0 ) return alignmentTarget ; GenericsType [ ] generics = new GenericsType [ alignmentTarget . length ] ; for ( int i = 0 , scgtLength = alignmentTarget . length ; i < scgtLength ; i ++ ) { fina...
public class A_CmsUpdateDBPart { /** * Loads a Java properties hash containing SQL queries . < p > * @ param propertyFilename the package / filename of the properties hash * @ throws IOException if the sql queries property file could not be read */ protected void loadQueryProperties ( String propertyFilename ) thro...
Properties properties = new Properties ( ) ; properties . load ( getClass ( ) . getClassLoader ( ) . getResourceAsStream ( propertyFilename ) ) ; @ SuppressWarnings ( "unchecked" ) Enumeration < String > propertyNames = ( Enumeration < String > ) properties . propertyNames ( ) ; while ( propertyNames . hasMoreElements ...
public class HColumnImpl { /** * Clear value , timestamp and ttl ( the latter two set to ' 0 ' ) leaving only the column name */ @ Override public HColumn < N , V > clear ( ) { } }
column . value = null ; column . timestamp = 0 ; column . ttl = 0 ; column . setTimestampIsSet ( false ) ; column . setTtlIsSet ( false ) ; column . setValueIsSet ( false ) ; return this ;
public class TransferQuotaPolicy { /** * Called to send a ' quota exceeded ' failure . * @ param context * @ param config * @ param chain * @ param rtr */ protected void doQuotaExceededFailure ( final IPolicyContext context , final TransferQuotaConfig config , final IPolicyChain < ? > chain , RateLimitResponse ...
Map < String , String > responseHeaders = RateLimitingPolicy . responseHeaders ( config , rtr , defaultLimitHeader ( ) , defaultRemainingHeader ( ) , defaultResetHeader ( ) ) ; IPolicyFailureFactoryComponent failureFactory = context . getComponent ( IPolicyFailureFactoryComponent . class ) ; PolicyFailure failure = lim...
public class GeneratedDFactoryDaoImpl { /** * query - by method for field clientId * @ param clientId the specified attribute * @ return an Iterable of DFactorys for the specified clientId */ public Iterable < DFactory > queryByClientId ( java . lang . String clientId ) { } }
return queryByField ( null , DFactoryMapper . Field . CLIENTID . getFieldName ( ) , clientId ) ;
public class ManagedApplication { /** * Acknowledges a heart beat . * @ param scopedInstance a root instance */ public void acknowledgeHeartBeat ( Instance scopedInstance ) { } }
String count = scopedInstance . data . get ( MISSED_HEARTBEATS ) ; if ( count != null && Integer . parseInt ( count ) > THRESHOLD ) this . logger . info ( "Agent " + InstanceHelpers . computeInstancePath ( scopedInstance ) + " is alive and reachable again." ) ; // Store the moment the first ACK ( without interruption )...
public class AbstractTriangle3F { /** * Replies if the triangle intersects the capsule . * @ param tx1 x coordinate of the first point of the triangle . * @ param ty1 y coordinate of the first point of the triangle . * @ param tz1 z coordinate of the first point of the triangle . * @ param tx2 x coordinate of t...
double d = distanceSquaredTriangleSegment ( tx1 , ty1 , tz1 , tx2 , ty2 , tz2 , tx3 , ty3 , tz3 , cx1 , cy1 , cz1 , cx2 , cy2 , cz2 ) ; return d < ( radius * radius ) ;
public class EventLogger { /** * Logs events with a level of ALL . * @ param msg The event StructuredDataMessage . */ public static void logEvent ( final StructuredDataMessage msg ) { } }
LOGGER . logIfEnabled ( FQCN , Level . OFF , EVENT_MARKER , msg , null ) ;
public class Cluster { /** * A list of nodes that are currently in the cluster . * @ param nodes * A list of nodes that are currently in the cluster . */ public void setNodes ( java . util . Collection < Node > nodes ) { } }
if ( nodes == null ) { this . nodes = null ; return ; } this . nodes = new java . util . ArrayList < Node > ( nodes ) ;
public class StatefulBeanO { /** * Destroy but do not remove this < code > BeanO < / code > instance . This * method must be used instead of the destroy method when a uncheck * or system exception occurs to ensure no lifecycle callback * ( e . g . ejbRemove or pre - destroy interceptor method ) method is * invo...
final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) // d144064 Tr . entry ( tc , "destroyNotRemove : " + this ) ; if ( state == DESTROYED ) { return ; } // If running in an extended persistence context , the JEERuntime code // maintains a map of SFSBs that mu...
public class LockedInodePath { /** * Locks a descendant of the current path and returns a new locked inode path . The path is * traversed according to the lock pattern . Closing the new path will have no effect on the * current path . * On failure , all locks taken by this method will be released . * @ param de...
LockedInodePath path = new LockedInodePath ( descendantUri , this , PathUtils . getPathComponents ( descendantUri . getPath ( ) ) , lockPattern ) ; path . traverseOrClose ( ) ; return path ;
public class MP3FileID3Controller { /** * A short description like winamp does in its default * @ since 26.12.2008 * @ return */ public String getShortDescription ( ) { } }
String artist = null ; String album = null ; String title = null ; if ( id3v2Exists ( ) ) { artist = getArtist ( ID3V2 ) ; title = getTitle ( ID3V2 ) ; album = getAlbum ( ID3V2 ) ; } if ( id3v1Exists ( ) ) { if ( artist == null || artist . length ( ) == 0 ) artist = getArtist ( ID3V1 ) ; if ( title == null || title . l...
public class UserAttrs { /** * Returns user - defined - attribute - 1 if not found . * @ param path * @ param attribute * @ param options * @ return * @ throws IOException */ public static final short getShortAttribute ( Path path , String attribute , LinkOption ... options ) throws IOException { } }
return getShortAttribute ( path , attribute , ( short ) - 1 , options ) ;
public class ResourceGroovyMethods { /** * Recursively processes each descendant subdirectory in this directory . * Processing consists of calling < code > closure < / code > passing it the current * subdirectory and then recursively processing that subdirectory . * Regular files are ignored during traversal . ...
eachFileRecurse ( self , FileType . DIRECTORIES , closure ) ;
public class MessageFormat { /** * < strong > [ icu ] < / strong > Sets the Format objects to use for the values passed into * < code > format < / code > methods or returned from < code > parse < / code > * methods . The keys in < code > newFormats < / code > are the argument * names in the previously set pattern...
for ( int partIndex = 0 ; ( partIndex = nextTopLevelArgStart ( partIndex ) ) >= 0 ; ) { String key = getArgName ( partIndex + 1 ) ; if ( newFormats . containsKey ( key ) ) { setCustomArgStartFormat ( partIndex , newFormats . get ( key ) ) ; } }
public class MsWordUtils { /** * 获取一个XWPFRun对象 * @ param paragraphIndex XWPFParagraph位置 * @ param runIndex XWPFRun位置 * @ return { @ link XWPFRun } */ public static XWPFRun getRun ( int paragraphIndex , int runIndex ) { } }
createXwpfDocumentIfNull ( ) ; return xwpfDocument . getParagraphs ( ) . get ( paragraphIndex ) . getRuns ( ) . get ( runIndex ) ;
public class P0_JdbcTemplateOp { /** * 使用jdbcTemplate模版执行update , 不支持in ( ? ) 表达式 * @ param sql * @ param args * @ return 实际修改的行数 */ protected int jdbcExecuteUpdate ( String sql , Object ... args ) { } }
log ( sql ) ; long start = System . currentTimeMillis ( ) ; int rows = jdbcTemplate . update ( sql . toString ( ) , args ) ; // 此处可以用jdbcTemplate , 因为没有in ( ? ) 表达式 long cost = System . currentTimeMillis ( ) - start ; logSlow ( cost , sql , args == null ? new ArrayList < Object > ( ) : Arrays . asList ( args ) ) ; retu...
public class ShadedNettyChannelFactory { /** * Converts the given negotiation type to netty ' s negotiation type . * @ param negotiationType The negotiation type to convert . * @ return The converted negotiation type . */ protected static io . grpc . netty . shaded . io . grpc . netty . NegotiationType of ( final N...
switch ( negotiationType ) { case PLAINTEXT : return io . grpc . netty . shaded . io . grpc . netty . NegotiationType . PLAINTEXT ; case PLAINTEXT_UPGRADE : return io . grpc . netty . shaded . io . grpc . netty . NegotiationType . PLAINTEXT_UPGRADE ; case TLS : return io . grpc . netty . shaded . io . grpc . netty . Ne...
public class BoundedLocalCache { /** * Expires entries on the write - order queue . */ @ GuardedBy ( "evictionLock" ) void expireAfterWriteEntries ( long now ) { } }
if ( ! expiresAfterWrite ( ) ) { return ; } long duration = expiresAfterWriteNanos ( ) ; for ( ; ; ) { final Node < K , V > node = writeOrderDeque ( ) . peekFirst ( ) ; if ( ( node == null ) || ( ( now - node . getWriteTime ( ) ) < duration ) ) { break ; } evictEntry ( node , RemovalCause . EXPIRED , now ) ; }
public class CodedConstant { /** * Read a field of any primitive type for immutable messages from a CodedInputStream . Enums , groups , and embedded * messages are not handled by this method . * @ param input The stream from which to read . * @ param type Declared type of the field . * @ param checkUtf8 When tr...
switch ( type ) { case DOUBLE : return input . readDouble ( ) ; case FLOAT : return input . readFloat ( ) ; case INT64 : return input . readInt64 ( ) ; case UINT64 : return input . readUInt64 ( ) ; case INT32 : return input . readInt32 ( ) ; case FIXED64 : return input . readFixed64 ( ) ; case FIXED32 : return input . ...
public class Output { /** * { @ inheritDoc } */ @ Override public void writeByteArray ( ByteArray array ) { } }
writeAMF3 ( ) ; buf . put ( AMF3 . TYPE_BYTEARRAY ) ; if ( hasReference ( array ) ) { putInteger ( getReferenceId ( array ) << 1 ) ; return ; } storeReference ( array ) ; IoBuffer data = array . getData ( ) ; putInteger ( data . limit ( ) << 1 | 1 ) ; byte [ ] tmp = new byte [ data . limit ( ) ] ; int old = data . posi...
public class ChartistJSFApplicationFactory { /** * If the given application not an instance of { @ link ChartistJSFApplication } , nor wraps the { @ link ChartistJSFApplication } , then * it will be wrapped by a new instance of { @ link ChartistJSFApplication } and set as the current instance and returned . * Addit...
Application newApplication = application ; while ( ! ( newApplication instanceof ChartistJSFApplication ) && newApplication instanceof ApplicationWrapper ) { newApplication = ( ( ApplicationWrapper ) newApplication ) . getWrapped ( ) ; } if ( ! ( newApplication instanceof ChartistJSFApplication ) ) { newApplication = n...
public class FilterQuery { /** * Alternative to filter , which accepts a range of items to filter . * For instance , the field might be a year , and minValue 2000 and maxValue 2009 * this filter will return records between the supplied ranges ( inclusive ) * @ param field * @ param minValue * @ param maxValue...
if ( minValue instanceof String ) { if ( StringUtils . isEmpty ( field ) || StringUtils . isEmpty ( ( String ) minValue ) || StringUtils . isEmpty ( ( String ) maxValue ) ) { throw new IllegalArgumentException ( "Expected all attributes to be non empty" ) ; } filterQueries . put ( field , new FilterFieldRange ( field ,...
public class CacheEventListenerConfigurationBuilder { /** * Adds specific { @ link EventFiring } to the returned builder . * < ul > * < li > { @ link EventFiring } defaults to { @ link EventFiring # ASYNCHRONOUS } < / li > * < / ul > * @ param eventFiringMode the { @ code EventFiring } to use * @ return a new...
CacheEventListenerConfigurationBuilder otherBuilder = new CacheEventListenerConfigurationBuilder ( this ) ; otherBuilder . eventFiringMode = eventFiringMode ; return otherBuilder ;
public class UserLog { /** * Set up the screen input fields . */ public void setupFields ( ) { } }
FieldInfo field = null ; field = new FieldInfo ( this , ID , Constants . DEFAULT_FIELD_LENGTH , null , null ) ; field . setDataClass ( Integer . class ) ; field . setHidden ( true ) ; field = new FieldInfo ( this , LAST_CHANGED , Constants . DEFAULT_FIELD_LENGTH , null , null ) ; field . setDataClass ( Date . class ) ;...
public class AttributeValueMarshaller { /** * Marshall the given parameter object . */ public void marshall ( AttributeValue attributeValue , ProtocolMarshaller protocolMarshaller ) { } }
if ( attributeValue == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( attributeValue . getValue ( ) , VALUE_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e...
public class ObjectInputStream { /** * Read a string encoded in { @ link DataInput modified UTF - 8 } from the * receiver . Return the string read . * @ param unshared * read the object unshared * @ return the string just read . * @ throws IOException * If an IO exception happened when reading the String . ...
Object result = input . readUTF ( ) ; if ( enableResolve ) { result = resolveObject ( result ) ; } registerObjectRead ( result , nextHandle ( ) , unshared ) ; return result ;
public class ExamplePnP { /** * Generates synthetic observations randomly in front of the camera . Observations are in normalized image * coordinates and not pixels ! See { @ link PerspectiveOps # convertPixelToNorm } for how to go from pixels * to normalized image coordinates . */ public List < Point2D3D > createO...
Se3_F64 cameraToWorld = worldToCamera . invert ( null ) ; // transform from pixel coordinates to normalized pixel coordinates , which removes lens distortion Point2Transform2_F64 pixelToNorm = LensDistortionFactory . narrow ( intrinsic ) . undistort_F64 ( true , false ) ; List < Point2D3D > observations = new ArrayList...
public class SqlTransientExceptionDetector { /** * Determines if the SQL exception is a connection exception * @ param se the exception * @ return true if it is a code 08nnn , otherwise false */ public static boolean isSqlStateConnectionException ( SQLException se ) { } }
String sqlState = se . getSQLState ( ) ; return sqlState != null && sqlState . startsWith ( "08" ) ;
public class StoredPaymentChannelClientStates { /** * If the peer group has not been set for MAX _ SECONDS _ TO _ WAIT _ FOR _ BROADCASTER _ TO _ BE _ SET seconds , then * the programmer probably forgot to set it and we should throw exception . */ private TransactionBroadcaster getAnnouncePeerGroup ( ) { } }
try { return announcePeerGroupFuture . get ( MAX_SECONDS_TO_WAIT_FOR_BROADCASTER_TO_BE_SET , TimeUnit . SECONDS ) ; } catch ( InterruptedException e ) { throw new RuntimeException ( e ) ; } catch ( ExecutionException e ) { throw new RuntimeException ( e ) ; } catch ( TimeoutException e ) { String err = "Transaction bro...
public class DatabaseDAODefaultImpl { public void deleteAllDevicePipeProperty ( Database database , String deviceName , List < String > pipeNames ) throws DevFailed { } }
String [ ] array = new String [ 1 + pipeNames . size ( ) ] ; int i = 0 ; array [ i ++ ] = deviceName ; for ( String pipeName : pipeNames ) array [ i ++ ] = pipeName ; DeviceData argIn = new DeviceData ( ) ; argIn . insert ( array ) ; database . command_inout ( "DbDeleteAllDevicePipeProperty" , argIn ) ;
public class FessMessages { /** * Add the created action message for the key ' constraints . Digits . message ' with parameters . * < pre > * message : { item } is numeric value out of bounds ( & lt ; { integer } digits & gt ; . & lt ; { fraction } digits & gt ; expected ) . * < / pre > * @ param property The p...
assertPropertyNotNull ( property ) ; add ( property , new UserMessage ( CONSTRAINTS_Digits_MESSAGE , fraction , integer ) ) ; return this ;
public class SipCall { /** * This method sends a basic response to a previously received RE - INVITE request . The response is * constructed based on the parameters passed in . Call this method after waitForReinvite ( ) returns * non - null . Call this method multiple times to send multiple responses to the receive...
return respondToReinvite ( siptrans , statusCode , reasonPhrase , expires , newContact , displayName , body , contentType , contentSubType , null , null ) ;
public class Consumers { /** * Yields nth ( 1 - based ) element of the iterator . * @ param < E > the iterator element type * @ param count the element cardinality * @ param iterator the iterator that will be consumed * @ return the nth element */ public static < E > E nth ( long count , Iterator < E > iterator...
final Iterator < E > filtered = new FilteringIterator < E > ( iterator , new Nth < E > ( count ) ) ; return new FirstElement < E > ( ) . apply ( filtered ) ;
public class ContactTypeLevelOneField { /** * Get ( or make ) the current record for this reference . */ public Record makeReferenceRecord ( RecordOwner recordOwner ) { } }
Record record = super . makeReferenceRecord ( recordOwner ) ; record . addListener ( new CompareFileFilter ( record . getField ( ContactType . LEVEL ) , "1" , DBConstants . EQUALS , null , true ) ) ; return record ;
public class ProviderFactory { /** * Liberty Change for CXF Begin */ @ FFDCIgnore ( value = { } }
Throwable . class } ) // Liberty Change for CXF End protected static Object createProvider ( String className , Bus bus ) { try { Class < ? > cls = ClassLoaderUtils . loadClass ( className , ProviderFactory . class ) ; for ( Constructor < ? > c : cls . getConstructors ( ) ) { if ( c . getParameterTypes ( ) . length == ...
public class PrincipalUserDto { /** * Converts a user entity to DTO . * @ param user The entity to convert . * @ return The DTO . * @ throws WebApplicationException If an error occurs . */ public static PrincipalUserDto transformToDto ( PrincipalUser user ) { } }
if ( user == null ) { throw new WebApplicationException ( "Null entity object cannot be converted to Dto object." , Status . INTERNAL_SERVER_ERROR ) ; } PrincipalUserDto result = createDtoObject ( PrincipalUserDto . class , user ) ; for ( Dashboard dashboard : user . getOwnedDashboards ( ) ) { result . addOwnedDashboar...
public class RoleAssignmentsInner { /** * Creates a role assignment by ID . * @ param roleId The ID of the role assignment to create . * @ param parameters Parameters for the role assignment . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ throws CloudException thrown if the re...
return createByIdWithServiceResponseAsync ( roleId , parameters ) . toBlocking ( ) . single ( ) . body ( ) ;
public class InterpretterConfig { /** * Default binding to be used in groovy interpreters . * Dumpling exposed API is available via < tt > D < / tt > property . */ public Binding getDefaultBinding ( @ Nonnull ProcessStream stream , @ Nonnull List < String > args , @ Nullable ProcessRuntime < ? , ? , ? > runtime ) { }...
Binding binding = new Binding ( ) ; binding . setProperty ( "out" , stream . out ( ) ) ; binding . setProperty ( "err" , stream . err ( ) ) ; binding . setProperty ( "D" , new GroovyApiEntryPoint ( args , runtime , "D" ) ) ; return binding ;
public class IronJacamar { /** * { @ inheritDoc } */ @ Override protected Statement withBeforeClasses ( final Statement statement ) { } }
final Statement beforeClasses = super . withBeforeClasses ( new NoopStatement ( ) ) ; return new Statement ( ) { @ Override public void evaluate ( ) throws Throwable { TestClass tc = getTestClass ( ) ; boolean fullProfile = true ; Configuration configuration = tc . getAnnotation ( Configuration . class ) ; if ( configu...
public class HammingDistanceFunction { /** * Version for number vectors . * @ param o1 First vector * @ param o2 Second vector * @ return hamming distance */ private double hammingDistanceNumberVector ( NumberVector o1 , NumberVector o2 ) { } }
final int d1 = o1 . getDimensionality ( ) , d2 = o2 . getDimensionality ( ) ; int differences = 0 ; int d = 0 ; for ( ; d < d1 && d < d2 ; d ++ ) { double v1 = o1 . doubleValue ( d ) , v2 = o2 . doubleValue ( d ) ; if ( v1 != v1 || v2 != v2 ) { /* NaN */ continue ; } if ( v1 != v2 ) { ++ differences ; } } for ( ; d < d...
public class CliClient { /** * Get AbstractType by function name * @ param functionName - name of the function e . g . utf8 , integer , long etc . * @ return AbstractType type corresponding to the function name */ public static AbstractType < ? > getTypeByFunction ( String functionName ) { } }
Function function ; try { function = Function . valueOf ( functionName . toUpperCase ( ) ) ; } catch ( IllegalArgumentException e ) { String message = String . format ( "Function '%s' not found. Available functions: %s" , functionName , Function . getFunctionNames ( ) ) ; throw new RuntimeException ( message , e ) ; } ...
public class RandomUtil { /** * Returns a new Random object that can be used . The Random object returned * is promised to be a reasonably high quality PSRND with low memory * overhead that is faster to sample from than the default Java * { @ link Random } . Essentially , it will be better than Java ' s default P...
int seed ; if ( INCREMENT_SEEDS ) seed = DEFAULT_SEED . getAndAdd ( SEED_INCREMENT ) ; else seed = DEFAULT_SEED . get ( ) ; return new XORWOW ( seed ) ;
public class JobInProgress { /** * Update the job start / launch time ( upon restart ) and log to history */ synchronized void updateJobInfo ( long startTime , long launchTime ) { } }
// log and change to the job ' s start / launch time this . startTime = startTime ; this . launchTime = launchTime ; JobHistory . JobInfo . logJobInfo ( jobId , startTime , launchTime ) ;
public class AbstractIoService { /** * { @ inheritDoc } */ @ Override public final void dispose ( ) { } }
if ( disposed ) { return ; } IoFuture disposalFuture ; synchronized ( disposalLock ) { disposalFuture = this . disposalFuture ; if ( ! disposing ) { disposing = true ; try { this . disposalFuture = disposalFuture = dispose0 ( ) ; } catch ( Exception e ) { IoSession ioSession = this . disposalFuture != null ? this . dis...
public class UkWaCDocumentIterator { /** * Returns the next document from the file . */ public LabeledDocument next ( ) { } }
LabeledDocument next = nextDoc ; try { advance ( ) ; } catch ( IOException ioe ) { throw new IOError ( ioe ) ; } return next ;
public class UserRoleJetty { /** * < p > Setter for role . < / p > * @ param pRole reference */ public final void setItsRole ( final RoleJetty pRole ) { } }
this . itsRole = pRole ; if ( this . itsId == null ) { this . itsId = new IdUserRoleJetty ( ) ; } this . itsId . setItsRole ( this . itsRole ) ;
public class WorkItemConfigurationsInner { /** * Gets the list work item configurations that exist for the application . * @ param resourceGroupName The name of the resource group . * @ param resourceName The name of the Application Insights component resource . * @ throws IllegalArgumentException thrown if param...
return listWithServiceResponseAsync ( resourceGroupName , resourceName ) . map ( new Func1 < ServiceResponse < List < WorkItemConfigurationInner > > , List < WorkItemConfigurationInner > > ( ) { @ Override public List < WorkItemConfigurationInner > call ( ServiceResponse < List < WorkItemConfigurationInner > > response...
public class RowCell { /** * Creates a new instance of the { @ link RowCell } . */ @ InternalApi public static RowCell create ( @ Nonnull String family , @ Nonnull ByteString qualifier , long timestamp , @ Nonnull List < String > labels , @ Nonnull ByteString value ) { } }
return new AutoValue_RowCell ( family , qualifier , timestamp , value , labels ) ;
public class JobsInner { /** * Gets a list of Jobs within the specified Experiment . * @ param nextPageLink The NextLink from the previous successful call to List operation . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the PagedList & lt ; JobInner & g...
return listByExperimentNextWithServiceResponseAsync ( nextPageLink ) . map ( new Func1 < ServiceResponse < Page < JobInner > > , Page < JobInner > > ( ) { @ Override public Page < JobInner > call ( ServiceResponse < Page < JobInner > > response ) { return response . body ( ) ; } } ) ;
public class ScroogeReadSupport { /** * Validates that the requested group type projection is compatible . * This allows the projection schema to have extra optional fields . * @ param fileType the typed schema of the source * @ param projection requested projection schema */ public static void assertGroupsAreCom...
List < Type > fields = projection . getFields ( ) ; for ( Type otherType : fields ) { if ( fileType . containsField ( otherType . getName ( ) ) ) { Type thisType = fileType . getType ( otherType . getName ( ) ) ; assertAreCompatible ( thisType , otherType ) ; if ( ! otherType . isPrimitive ( ) ) { assertGroupsAreCompat...
public class ConfigManager { /** * Adds the local configuration { @ link LocalConfig } associated with name . Over - rides any config with the same name . * @ param config * The LocalConfig . * @ param name * The name to associate with local config . */ public static synchronized void addConfig ( String name , ...
SeLionLogger . getLogger ( ) . entering ( new Object [ ] { name , config } ) ; checkArgument ( StringUtils . isNotBlank ( name ) , "A testname for which configuration is being added cannot be null (or) empty." ) ; checkArgument ( config != null , "A configuration object cannot be null." ) ; if ( configsMap . containsKe...
public class QrCodeDecoderBits { /** * Decodes a numeric message * @ param qr QR code * @ param data encoded data * @ return Location it has read up to in bits */ private int decodeNumeric ( QrCode qr , PackedBits8 data , int bitLocation ) { } }
int lengthBits = QrCodeEncoder . getLengthBitsNumeric ( qr . version ) ; int length = data . read ( bitLocation , lengthBits , true ) ; bitLocation += lengthBits ; while ( length >= 3 ) { if ( data . size < bitLocation + 10 ) { qr . failureCause = QrCode . Failure . MESSAGE_OVERFLOW ; return - 1 ; } int chunk = data . ...
public class CommerceAccountPersistenceImpl { /** * Returns all the commerce accounts that the user has permission to view where companyId = & # 63 ; . * @ param companyId the company ID * @ return the matching commerce accounts that the user has permission to view */ @ Override public List < CommerceAccount > filt...
return filterFindByCompanyId ( companyId , QueryUtil . ALL_POS , QueryUtil . ALL_POS , null ) ;
public class MappedSuperclass { /** * IMappedSuperclass methods */ @ Override public String _getIDClass ( ) { } }
IdClass idCls = this . getIdClass ( ) ; if ( idCls == null ) { return null ; } return idCls . getClazz ( ) ;
public class NativeIO { /** * Wrapper around native stat ( ) */ public static Stat stat ( File file ) throws IOException { } }
if ( file == null ) { throw new IllegalArgumentException ( "Null parameter passed" ) ; } return stat ( file . getAbsolutePath ( ) ) ;
public class MultipleHttpServiceActivator { /** * Start this service . * Override this to do all the startup . * @ return true if successful . */ @ Override public boolean shutdownService ( Object service , BundleContext context ) { } }
for ( String alias : getAliases ( ) ) { HttpServiceTracker serviceTracker = getServiceTracker ( context , BaseWebappServlet . ALIAS , alias ) ; if ( serviceTracker != null ) serviceTracker . close ( ) ; } return true ;
public class SSLAlpnNegotiator { /** * Using jetty - alpn , set up a new JettyServerNotiator to handle ALPN for a given SSLEngine and link * @ param SSLEngine * @ param SSLConnectionLink * @ return JettyServerNegotiator or null if ALPN was not set up */ protected JettyServerNegotiator registerJettyAlpn ( final SS...
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "registerJettyAlpn entry " + engine ) ; } try { JettyServerNegotiator negotiator = new JettyServerNegotiator ( engine , link ) ; // invoke ALPN . put ( engine , provider ( this ) ) Method m = jettyAlpn . getMethod ( "put" , S...
public class VirtualMachineMBeans { /** * Dumps all of the threads ' current information to an output stream . * @ param out an output stream */ public void getThreadDump ( OutputStream out ) { } }
final ThreadInfo [ ] threads = this . threads . dumpAllThreads ( true , true ) ; final PrintWriter writer = new PrintWriter ( out , true ) ; for ( int ti = threads . length - 1 ; ti >= 0 ; ti -- ) { final ThreadInfo t = threads [ ti ] ; writer . printf ( "%s id=%d state=%s" , t . getThreadName ( ) , t . getThreadId ( )...
public class Queue { /** * Set the unique id for this Queue . */ private static synchronized int setId ( Queue queue ) { } }
String queue_string = queue . toString ( ) ; if ( ! queues . contains ( queue_string ) ) queues . add ( queue_string ) ; return queues . indexOf ( queue_string ) ;
public class ComputeNodesImpl { /** * Deletes a user account from the specified compute node . * You can delete a user account to a node only when it is in the idle or running state . * @ param poolId The ID of the pool that contains the compute node . * @ param nodeId The ID of the machine on which you want to d...
return deleteUserWithServiceResponseAsync ( poolId , nodeId , userName ) . map ( new Func1 < ServiceResponseWithHeaders < Void , ComputeNodeDeleteUserHeaders > , Void > ( ) { @ Override public Void call ( ServiceResponseWithHeaders < Void , ComputeNodeDeleteUserHeaders > response ) { return response . body ( ) ; } } ) ...
public class Solo { /** * Checks if a ToggleButton displaying the specified text is checked . * @ param text the text that the { @ link ToggleButton } displays , specified as a regular expression * @ return { @ code true } if a { @ link ToggleButton } matching the specified text is checked and { @ code false } if i...
if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "isToggleButtonChecked(\"" + text + "\")" ) ; } return checker . isButtonChecked ( ToggleButton . class , text ) ;
public class DefaultResilienceStrategyConfiguration { /** * Returns a configuration object bound to the given store and cache loader - writer . * @ param store store to bind to * @ param loaderWriter loader to bind to * @ return a bound configuration * @ throws IllegalStateException if the configuration is alre...
if ( getInstance ( ) == null ) { Object [ ] arguments = getArguments ( ) ; Object [ ] boundArguments = Arrays . copyOf ( arguments , arguments . length + 2 ) ; boundArguments [ arguments . length ] = store ; boundArguments [ arguments . length + 1 ] = loaderWriter ; return new BoundConfiguration ( getClazz ( ) , boundA...
public class AdminCommandQuota { /** * Parses command - line and directs to sub - commands . * @ param args Command - line input * @ throws Exception */ public static void executeCommand ( String [ ] args ) throws Exception { } }
String subCmd = ( args . length > 0 ) ? args [ 0 ] : "" ; args = AdminToolUtils . copyArrayCutFirst ( args ) ; if ( subCmd . equals ( "get" ) ) { SubCommandQuotaGet . executeCommand ( args ) ; } else if ( subCmd . equals ( "set" ) ) { SubCommandQuotaSet . executeCommand ( args ) ; } else if ( subCmd . equals ( "reserve...
public class WasInformedBy { /** * Gets the value of the label property . * This accessor method returns a reference to the live list , * not a snapshot . Therefore any modification you make to the * returned list will be present inside the JAXB object . * This is why there is not a < CODE > set < / CODE > meth...
CascadeType . ALL } ) @ JoinColumn ( name = "LABEL_WASINFORMEDBY_PK" ) public List < org . openprovenance . prov . model . LangString > getLabel ( ) { if ( label == null ) { label = new ArrayList < org . openprovenance . prov . model . LangString > ( ) ; } return this . label ;
public class ImageRequest { /** * Scales one side of a rectangle to fit aspect ratio . * @ param maxPrimary Maximum size of the primary dimension ( i . e . width for * max width ) , or zero to maintain aspect ratio with secondary * dimension * @ param maxSecondary Maximum size of the secondary dimension , or ze...
// If no dominant value at all , just return the actual . if ( ( maxPrimary == 0 ) && ( maxSecondary == 0 ) ) { return actualPrimary ; } // If ScaleType . FIT _ XY fill the whole rectangle , ignore ratio . if ( scaleType == ScaleType . FIT_XY ) { if ( maxPrimary == 0 ) { return actualPrimary ; } return maxPrimary ; } /...
public class MethodHandleUtil { /** * 代理对象方法 * 会根据方法名和方法参数严格匹配 * @ param target 代理对象 * @ param methodName 对象方法名 * @ param args 对象方法参数 * @ return */ public static MethodHandleProxy proxyMethod ( Object target , String methodName , Object ... args ) { } }
MethodHandle mh = findMethodHandle ( target , methodName , args ) ; if ( mh != null ) { return new MethodHandleProxy ( target , mh , args ) ; } return null ;
public class ExportApi { /** * Get export status . * Check the status of the specified export and return the percentage complete . * @ param id The ID of a previously started export . ( required ) * @ return ExportStatusResponse * @ throws ApiException If fail to call the API , e . g . server error or cannot de...
ApiResponse < ExportStatusResponse > resp = getExportStatusWithHttpInfo ( id ) ; return resp . getData ( ) ;
public class RandomStringUtils { /** * < p > Creates a random string whose length is the number of characters * specified . < / p > * < p > Characters will be chosen from the set of alpha - numeric * characters as indicated by the arguments . < / p > * @ param count the length of random string to create * @ p...
return random ( count , start , end , letters , numbers , null , RANDOM ) ;
public class TableFactorBuilder { /** * Gets a { @ code TableFactorBuilder } where each outcome is initialized with a * weight of 1. * @ param variables * @ return */ public static TableFactorBuilder ones ( VariableNumMap variables ) { } }
TableFactorBuilder builder = new TableFactorBuilder ( variables ) ; Iterator < Assignment > allAssignmentIter = new AllAssignmentIterator ( variables ) ; while ( allAssignmentIter . hasNext ( ) ) { builder . setWeight ( allAssignmentIter . next ( ) , 1.0 ) ; } return builder ;
public class ModelsImpl { /** * Delete an entity role . * @ param appId The application ID . * @ param versionId The version ID . * @ param entityId The entity ID . * @ param roleId The entity role Id . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to...
return deleteClosedListEntityRoleWithServiceResponseAsync ( appId , versionId , entityId , roleId ) . map ( new Func1 < ServiceResponse < OperationStatus > , OperationStatus > ( ) { @ Override public OperationStatus call ( ServiceResponse < OperationStatus > response ) { return response . body ( ) ; } } ) ;
public class CmsAliasView { /** * Ensures that rows with errors will be placed at the top of the table . < p > */ public void sortByErrors ( ) { } }
ColumnSortList columnSort = m_table . getColumnSortList ( ) ; columnSort . clear ( ) ; columnSort . push ( m_table . getErrorColumn ( ) ) ; columnSort . push ( m_table . getErrorColumn ( ) ) ; ColumnSortEvent . fire ( m_table , columnSort ) ;
public class ConfluenceGreenPepper { /** * < p > getPageContent . < / p > * @ param currentPage a { @ link com . atlassian . confluence . pages . Page } object . * @ param implementedVersion a { @ link java . lang . Boolean } object . * @ return a { @ link java . lang . String } object . * @ throws com . greenp...
AbstractPage page = currentPage ; if ( implementedVersion ) { page = getImplementedPage ( currentPage ) ; } return getBodyTypeAwareRenderer ( ) . render ( page ) ;
public class Materials { /** * 获取图文素材 * @ param mediaId media id * @ return 图文素材 */ public MpNews getMpNews ( String mediaId ) { } }
String url = WxEndpoint . get ( "url.material.mpnews.get" ) ; String json = String . format ( "{\"media_id\":\"%s\"}" , mediaId ) ; logger . info ( "get mpnews: {}" , json ) ; String response = wxClient . post ( url , json ) ; return JsonMapper . defaultMapper ( ) . fromJson ( response , MpNews . class ) ;
public class CATConsumer { /** * Resets a browser session . This implementation barfs because this method should * never be invoked on anything other than a CATBrowseConsumer ( which overrides it ) . */ public void reset ( ) throws SISessionUnavailableException , SISessionDroppedException , SIConnectionUnavailableExc...
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "reset" ) ; SIErrorException e = new SIErrorException ( nls . getFormattedMessage ( "PROTOCOL_ERROR_SICO2003" , null , null ) ) ; FFDCFilter . processException ( e , CLASS_NAME + ".reset" , CommsConstants . CATCONSUMER_RESET...
public class Monos { /** * Perform a For Comprehension over a Mono , accepting a generating function . * This results in a two level nested internal iteration over the provided Monos . * < pre > * { @ code * import static cyclops . companion . reactor . Monos . forEach ; * forEach ( Mono . just ( 1 ) , * a ...
Future < R > res = Future . fromPublisher ( value1 ) . flatMap ( in -> { Future < R1 > a = Future . fromPublisher ( value2 . apply ( in ) ) ; return a . map ( ina -> yieldingFunction . apply ( in , ina ) ) ; } ) ; return Mono . from ( res ) ;
public class CmsXmlDocumentComparison { /** * Returns the elements . < p > * @ return the elements */ public List < CmsElementComparison > getElements ( ) { } }
if ( m_elements == null ) { return Collections . emptyList ( ) ; } return Collections . unmodifiableList ( m_elements ) ;
public class GobblinHelixJobLauncher { /** * Inject in some additional properties * @ param jobProps job properties * @ param inputTags list of metadata tags * @ return */ private static List < ? extends Tag < ? > > addAdditionalMetadataTags ( Properties jobProps , List < ? extends Tag < ? > > inputTags ) { } }
List < Tag < ? > > metadataTags = Lists . newArrayList ( inputTags ) ; String jobId ; // generate job id if not already set if ( jobProps . containsKey ( ConfigurationKeys . JOB_ID_KEY ) ) { jobId = jobProps . getProperty ( ConfigurationKeys . JOB_ID_KEY ) ; } else { jobId = JobLauncherUtils . newJobId ( JobState . get...
public class TimelineBarrier { /** * 判断自己的timestamp是否可以通过 , 带超时控制 * @ throws InterruptedException * @ throws TimeoutException */ public void await ( Event event , long timeout , TimeUnit unit ) throws InterruptedException , TimeoutException { } }
long timestamp = getTimestamp ( event ) ; try { lock . lockInterruptibly ( ) ; single ( timestamp ) ; while ( isPermit ( event , timestamp ) == false ) { condition . await ( timeout , unit ) ; } } finally { lock . unlock ( ) ; }
public class VehicleManager { /** * Register to receive asynchronous updates for a specific VehicleMessage * type . * Use this method to register an object implementing the * VehicleMessage . Listener interface to receive real - time updates * whenever a new value is received for the specified message type . ...
Log . i ( TAG , "Adding listener " + listener + " for " + messageType ) ; mNotifier . register ( messageType , listener ) ;
public class AuditorFactory { /** * Create a new instance of the specified IHE Auditor non - abstract subclass that * implements the auditor API . * @ param clazzClass instance to instantiate a new instance for * @ return New IHE Auditor instance */ private static IHEAuditor getAuditorForClass ( Class < ? extends...
if ( null == clazz ) { LOGGER . error ( "Error - Cannot specify a null auditor class" ) ; } else { try { return clazz . newInstance ( ) ; } catch ( ClassCastException e ) { LOGGER . error ( "The requested class " + clazz . getName ( ) + " is not a valid auditor" , e ) ; } catch ( Exception e ) { LOGGER . error ( "Error...
public class MergeSmallRegions { /** * Go through each pixel in the image and examine its neighbors according to a 4 - connect rule . If one of * the pixels is in a region that is to be pruned mark them as neighbors . The image is traversed such that * the number of comparisons is minimized . */ protected void find...
// - - - - - Do the inner pixels first if ( connect . length == 4 ) adjacentInner4 ( pixelToRegion ) ; else if ( connect . length == 8 ) { adjacentInner8 ( pixelToRegion ) ; } adjacentBorder ( pixelToRegion ) ;
public class ElasticSearchRestDAOV5 { /** * Determines whether a resource exists in ES . This will call a GET method to a particular path and * return true if status 200 ; false otherwise . * @ param resourcePath The path of the resource to get . * @ return True if it exists ; false otherwise . * @ throws IOExc...
Response response = elasticSearchAdminClient . performRequest ( HttpMethod . HEAD , resourcePath ) ; return response . getStatusLine ( ) . getStatusCode ( ) == HttpStatus . SC_OK ;
public class CmmnExecution { /** * sentry : ( 2 ) handle transitions */ public void handleChildTransition ( CmmnExecution child , String transition ) { } }
// Step 1 : collect all affected sentries List < String > affectedSentries = collectAffectedSentries ( child , transition ) ; // Step 2 : fire force update on all case sentry part // contained by a affected sentry to provoke an // OptimisticLockingException forceUpdateOnSentries ( affectedSentries ) ; // Step 3 : check...
public class Error { /** * Get the error as a string in html format * @ return error in html format */ public String toHtml ( ) { } }
StringBuilder stringBuilder = new StringBuilder ( ) ; stringBuilder . append ( "<p>" ) . append ( objectNode . get ( TYPE ) . asText ( ) ) . append ( ": " ) . append ( objectNode . get ( MESSAGE ) . asText ( ) ) . append ( " -> " ) . append ( objectNode . get ( DETAILS ) . toString ( ) ) . append ( "</p>" ) ; return st...
public class Icon { /** * Copies the values from { @ link Icon base } to this { @ link Icon } . * @ param base the icon to copy from */ @ Override public void copyFrom ( TextureAtlasSprite base ) { } }
this . originX = base . getOriginX ( ) ; this . originY = base . getOriginY ( ) ; this . width = base . getIconWidth ( ) ; this . height = base . getIconHeight ( ) ; this . minU = base . getMinU ( ) ; this . maxU = base . getMaxU ( ) ; this . minV = base . getMinV ( ) ; this . maxV = base . getMaxV ( ) ; for ( int i = ...
public class GeneratedDUserDaoImpl { /** * query - by method for field updatedBy * @ param updatedBy the specified attribute * @ return an Iterable of DUsers for the specified updatedBy */ public Iterable < DUser > queryByUpdatedBy ( java . lang . String updatedBy ) { } }
return queryByField ( null , DUserMapper . Field . UPDATEDBY . getFieldName ( ) , updatedBy ) ;
public class JobState { /** * Get { @ link TaskState } s of { @ link Task } s of this job . * @ return a list of { @ link TaskState } s */ public List < TaskState > getTaskStates ( ) { } }
return ImmutableList . < TaskState > builder ( ) . addAll ( this . taskStates . values ( ) ) . build ( ) ;
public class LimesurveyRC { /** * Gets participant properties . * @ param surveyId the survey id of the participant ' s survey * @ param token the token of the participant * @ param tokenProperties the token properties * @ return the participant properties * @ throws LimesurveyRCException the limesurvey rc ex...
LsApiBody . LsApiParams params = getParamsWithKey ( surveyId ) ; Map < String , String > queryProperties = new HashMap < > ( ) ; queryProperties . put ( "token" , token ) ; params . setTokenQueryProperties ( queryProperties ) ; params . setTokenProperties ( tokenProperties ) ; return gson . fromJson ( callRC ( new LsAp...
public class IncludeWebClass { /** * Builds a HTTP service from a method . * < pre > < code > * & # 64 ; Get * void myMethod ( & 64 ; Query ( " id " ) id , Result & lt ; String & gt ; result ) ; * < / code > < / pre > * Method parameters are filled from the request . * @ param builder called to create the s...
Parameter [ ] params = method . getParameters ( ) ; WebParam [ ] webParam = new WebParam [ params . length ] ; for ( int i = 0 ; i < params . length ; i ++ ) { webParam [ i ] = buildParam ( builder , params [ i ] ) ; } return new WebServiceMethod ( beanFactory , method , webParam ) ;
public class BlobInfo { /** * Returns a { @ code BlobInfo } builder where blob identity is set using the provided values . */ public static Builder newBuilder ( BucketInfo bucketInfo , String name ) { } }
return newBuilder ( bucketInfo . getName ( ) , name ) ;
public class Engine { /** * Indicates whether an input variable of the given name is in the input * variables * @ param name is the name of the input variable * @ return whether an input variable is registered with the given name */ public boolean hasInputVariable ( String name ) { } }
for ( InputVariable inputVariable : this . inputVariables ) { if ( inputVariable . getName ( ) . equals ( name ) ) { return true ; } } return false ;
public class PhaseTwoApplication { /** * Returns the application ' s description . * @ return String */ @ Override public String getApplicationDescription ( ) { } }
final StringBuilder bldr = new StringBuilder ( ) ; bldr . append ( "Merges proto-networks into a composite network and " ) ; bldr . append ( "equivalences term references across namespaces." ) ; return bldr . toString ( ) ;
public class CmsJspTagEditable { /** * Checks if the current request should be direct edit enabled . < p > * @ param req the servlet request * @ return < code > true < / code > if the current request should be direct edit enabled */ public static boolean isEditableRequest ( ServletRequest req ) { } }
boolean result = false ; if ( CmsHistoryResourceHandler . isHistoryRequest ( req ) || CmsJspTagEnableAde . isDirectEditDisabled ( req ) ) { // don ' t display direct edit buttons on an historical resource result = false ; } else { CmsFlexController controller = CmsFlexController . getController ( req ) ; CmsObject cms ...
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EClass getIfcDuctSegmentType ( ) { } }
if ( ifcDuctSegmentTypeEClass == null ) { ifcDuctSegmentTypeEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 203 ) ; } return ifcDuctSegmentTypeEClass ;
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EClass getIfcPlanarExtent ( ) { } }
if ( ifcPlanarExtentEClass == null ) { ifcPlanarExtentEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 426 ) ; } return ifcPlanarExtentEClass ;
public class CmsWorkplaceManager { /** * Adds newly created export point to the workplace configuration . < p > * @ param uri the export point uri * @ param destination the export point destination */ public void addExportPoint ( String uri , String destination ) { } }
CmsExportPoint point = new CmsExportPoint ( uri , destination ) ; m_exportPoints . add ( point ) ; if ( CmsLog . INIT . isInfoEnabled ( ) && ( point . getDestinationPath ( ) != null ) ) { CmsLog . INIT . info ( Messages . get ( ) . getBundle ( ) . key ( Messages . INIT_ADD_EXPORT_POINT_2 , point . getUri ( ) , point . ...
public class ZonedDateTime { /** * Returns a copy of this { @ code ZonedDateTime } with the specified number of seconds subtracted . * This operates on the instant time - line , such that subtracting one second will * always be a duration of one second earlier . * This may cause the local date - time to change by...
return ( seconds == Long . MIN_VALUE ? plusSeconds ( Long . MAX_VALUE ) . plusSeconds ( 1 ) : plusSeconds ( - seconds ) ) ;
public class ExceptionSoftener { /** * Soften a CheckedBiFunction that can throw Checked Exceptions to a standard BiFunction that can also throw Checked Exceptions ( without declaring them ) * < pre > * { @ code * ExceptionSoftener . softenBiFunction ( this : : loadDir ) . applyHKT ( " . core " , " / tmp / dir " ...
return ( t1 , t2 ) -> { try { return fn . apply ( t1 , t2 ) ; } catch ( final Throwable e ) { throw throwSoftenedException ( e ) ; } } ;
public class ValueFileIOHelper { /** * Write value array of bytes to a file . * @ param file * File * @ param value * ValueData * @ return size of wrote content * @ throws IOException * if error occurs */ protected long writeByteArrayValue ( File file , ValueData value ) throws IOException { } }
OutputStream out = new FileOutputStream ( file ) ; try { byte [ ] data = value . getAsByteArray ( ) ; out . write ( data ) ; return data . length ; } finally { out . close ( ) ; }