signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class CmsButtonBarHandler { /** * Handles the mouse over event for a button bar . < p > * @ param buttonBar the event source */ private void overButtonBar ( Widget buttonBar ) { } }
if ( ( m_buttonBar == null ) || ( buttonBar . getElement ( ) != m_buttonBar . getElement ( ) ) ) { closeAll ( ) ; m_buttonBar = buttonBar ; setButtonBarVisibility ( m_buttonBar , true ) ; }
public class AmazonLightsailClient { /** * Returns information about all Amazon Lightsail virtual private servers , or < i > instances < / i > . * @ param getInstancesRequest * @ return Result of the GetInstances operation returned by the service . * @ throws ServiceException * A general service exception . *...
request = beforeClientExecution ( request ) ; return executeGetInstances ( request ) ;
public class CacheConfigurationBuilder { /** * Removes a { @ link ServiceConfiguration } from the returned builder . * @ param configuration the service configuration to remove * @ return a new builder without the specified configuration */ public CacheConfigurationBuilder < K , V > remove ( ServiceConfiguration < ...
CacheConfigurationBuilder < K , V > otherBuilder = new CacheConfigurationBuilder < > ( this ) ; otherBuilder . serviceConfigurations . remove ( configuration ) ; return otherBuilder ;
public class FileCacheServlet { /** * Process HEAD request . This returns the same headers as GET request , but * without content . * @ see HttpServlet # doHead ( HttpServletRequest , HttpServletResponse ) . */ protected void doHead ( HttpServletRequest request , HttpServletResponse response ) throws ServletExcepti...
// Process request without content . processRequest ( request , response , false ) ;
public class DatagramUtil { /** * 读取数据报长度 * @ param data 数据 * @ return 长度 , 返回小于0时表示数据报报头不完整 */ public static int readLen ( byte [ ] data ) { } }
if ( data . length < Datagram . HEADER_LEN ) { log . warn ( "要读取长度的数据报报头不完整" ) ; return - 1 ; } else { return convert ( data , Datagram . LEN_OFFSET ) ; }
public class GenerateHalDocsJsonMojo { /** * Get service infos from current maven project . * @ return Service */ private Service getServiceInfos ( ClassLoader compileClassLoader ) { } }
Service service = new Service ( ) ; // get some service properties from pom service . setServiceId ( serviceId ) ; service . setName ( project . getName ( ) ) ; // find @ ServiceDoc annotated class in source folder JavaProjectBuilder builder = new JavaProjectBuilder ( ) ; builder . addSourceTree ( new File ( source ) )...
public class SibRaStaticDestinationEndpointActivation { /** * Indicates that an error has been detected on the given session . * @ param connection * the parent connection for the session * @ param session * the session * @ param throwable * the error */ void sessionError ( final SibRaMessagingEngineConnect...
final String methodName = "sessionError" ; if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . entry ( this , TRACE , methodName , new Object [ ] { connection , session } ) ; } final SIDestinationAddress destination = session . getDestinationAddress ( ) ; if ( _remoteDestination ) { ...
public class MassToFormulaTool { /** * Set the restrictions that must be presents in the molecular formula . * @ param rulesNew The restrictions to impose * @ see # getRestrictions ( ) * @ see # setDefaultRestrictions ( ) * @ see IRule */ public void setRestrictions ( List < IRule > rulesNew ) throws CDKExcepti...
Iterator < IRule > itRules = rulesNew . iterator ( ) ; while ( itRules . hasNext ( ) ) { IRule rule = itRules . next ( ) ; if ( rule instanceof ElementRule ) { mfRange = ( MolecularFormulaRange ) ( ( Object [ ] ) rule . getParameters ( ) ) [ 0 ] ; // removing the rule Iterator < IRule > oldRuleIt = rules . iterator ( )...
public class JavascriptResourceExtension { /** * use the resource manager */ public static void useResource ( String host , int port , String user , String password , Authentication authType ) throws ResourceNotFoundException , ForbiddenUserException , FailedRequestException { } }
// create the client DatabaseClient client = DatabaseClientFactory . newClient ( host , port , user , password , authType ) ; // create the resource extension client HelloWorld hello = new HelloWorld ( client ) ; String response = hello . sayHello ( ) ; System . out . println ( "Called hello worlds service, got respons...
public class Smb2CreateRequest { /** * { @ inheritDoc } * @ see jcifs . internal . smb2 . ServerMessageBlock2 # writeBytesWireFormat ( byte [ ] , int ) */ @ Override protected int writeBytesWireFormat ( byte [ ] dst , int dstIndex ) { } }
int start = dstIndex ; if ( log . isDebugEnabled ( ) ) { log . debug ( "Opening " + this . name ) ; } SMBUtil . writeInt2 ( 57 , dst , dstIndex ) ; dst [ dstIndex + 2 ] = this . securityFlags ; dst [ dstIndex + 3 ] = this . requestedOplockLevel ; dstIndex += 4 ; SMBUtil . writeInt4 ( this . impersonationLevel , dst , d...
public class MethodMessageBase { /** * Returns the calling outbox from the current context , if available . * The outbox is associated with the current thread and is used to * batch and deliver messages . */ public static OutboxAmp getOutboxCurrent ( ) { } }
OutboxAmp outbox = OutboxAmp . current ( ) ; if ( outbox != null ) { // OutboxAmp outbox = ( OutboxAmp ) outboxDeliver ; return outbox ; } else { return OutboxAmpNull . NULL ; }
public class CredentialImpl { /** * decode the Credential form a Base64 String value * @ param encoded * @ return Credential from decoded string * @ throws PageException */ public static Credential decode ( Object encoded , Resource rolesDir ) throws PageException { } }
String dec ; try { dec = Base64Coder . decodeToString ( Caster . toString ( encoded ) , "UTF-8" ) ; } catch ( Exception e ) { throw Caster . toPageException ( e ) ; } Array arr = ListUtil . listToArray ( dec , "" + ONE ) ; int len = arr . size ( ) ; if ( len == 3 ) { String str = Caster . toString ( arr . get ( 3 , "" ...
public class ModifyVpcEndpointConnectionNotificationRequest { /** * One or more events for the endpoint . Valid values are < code > Accept < / code > , < code > Connect < / code > , * < code > Delete < / code > , and < code > Reject < / code > . * @ return One or more events for the endpoint . Valid values are < co...
if ( connectionEvents == null ) { connectionEvents = new com . amazonaws . internal . SdkInternalList < String > ( ) ; } return connectionEvents ;
public class KriptonContentValues { /** * Adds the where args . * @ param value the value */ public void addWhereArgs ( String value ) { } }
if ( this . compiledStatement != null ) { compiledStatement . bindString ( compiledStatementBindIndex ++ , value ) ; } whereArgs . add ( value ) ; valueType . add ( ParamType . STRING ) ;
public class CBuilderXProjectWriter { /** * Writes ilink32 linker options to project file . * @ param writer * PropertyWriter property writer * @ param linkID * String linker identifier * @ param preArgs * String [ ] linker arguments * @ throws SAXException * thrown if unable to write option */ private ...
for ( final String arg : args ) { if ( arg . charAt ( 0 ) == '/' || arg . charAt ( 0 ) == '-' ) { final int equalsPos = arg . indexOf ( '=' ) ; if ( equalsPos > 0 ) { final String option = "option." + arg . substring ( 0 , equalsPos - 1 ) ; writer . write ( linkID , option + ".enabled" , "1" ) ; writer . write ( linkID...
public class KamSummarizer { /** * Returns the first annotation type matching the specified name * @ param kam * @ param name * @ return AnnotationType , maybe null */ private AnnotationType getAnnotationType ( final KAMStore kAMStore , final Kam kam , final String name ) throws KAMStoreException { } }
AnnotationType annoType = null ; List < BelDocumentInfo > belDocs = kAMStore . getBelDocumentInfos ( kam . getKamInfo ( ) ) ; // loop through all BEL documents used for this KAM for ( BelDocumentInfo doc : belDocs ) { // check annotation type on each document List < AnnotationType > annoTypes = doc . getAnnotationTypes...
public class SubCommandMetaSet { /** * Prints help menu for command . * @ param stream PrintStream object for output * @ throws IOException */ public static void printHelp ( PrintStream stream ) throws IOException { } }
stream . println ( ) ; stream . println ( "NAME" ) ; stream . println ( " meta set - Set metadata on nodes" ) ; stream . println ( ) ; stream . println ( "SYNOPSIS" ) ; stream . println ( " meta set <meta-key>=<meta-value>[,<meta-key2>=<meta-value2>] -u <url>" ) ; stream . println ( " [-n <node-id-list> | -...
public class SMailHonestPostie { protected void actuallySend ( SMailPostingMessage message ) throws MessagingException { } }
final Transport transport = prepareTransport ( ) ; final MimeMessage mimeMessage = message . getMimeMessage ( ) ; transport . connect ( ) ; // authenticated by session ' s authenticator transport . sendMessage ( mimeMessage , mimeMessage . getAllRecipients ( ) ) ; message . acceptSentTransport ( transport ) ; // keep e...
public class JMXContext { /** * Load the previously saved and configured JMX settings for memory pools * and collectors . The settings are stored in the temporary / working * directory of the servlet . * @ return true if successfully saved , false otherwise * @ see # saveJMXSettings ( ) */ public boolean loadJM...
Log log = config . getLog ( ) ; // load settings file // if non - existant , nothing to load so return success File settingsFile = getSettingsFile ( ) ; if ( ! settingsFile . exists ( ) ) { return true ; } // validate file is readable if ( ! settingsFile . canRead ( ) ) { log . warn ( "Temporary directory not readable ...
public class SftpClient { /** * Determine whether the file object is pointing to a symbolic link that is * pointing to a directory . * @ return boolean */ public boolean isDirectoryOrLinkedDirectory ( SftpFile file ) throws SftpStatusException , SshException { } }
return file . isDirectory ( ) || ( file . isLink ( ) && stat ( file . getAbsolutePath ( ) ) . isDirectory ( ) ) ;
public class EditLogOutputStream { /** * Flush data to persistent store . * Collect sync metrics . */ public void flush ( boolean durable ) throws IOException { } }
numSync ++ ; long start = System . nanoTime ( ) ; flushAndSync ( durable ) ; long time = DFSUtil . getElapsedTimeMicroSeconds ( start ) ; totalTimeSync += time ; if ( sync != null ) { sync . inc ( time ) ; }
public class ReUtil { /** * 删除匹配的第一个内容 * @ param pattern 正则 * @ param content 被匹配的内容 * @ return 删除后剩余的内容 */ public static String delFirst ( Pattern pattern , CharSequence content ) { } }
if ( null == pattern || StrUtil . isBlank ( content ) ) { return StrUtil . str ( content ) ; } return pattern . matcher ( content ) . replaceFirst ( StrUtil . EMPTY ) ;
public class PropertyMap { /** * Specifies that mapping from the { @ code source } to the { @ code destination } be skipped during the * mapping process . See the EDSL examples at { @ link PropertyMap } . See the < a href = " # 3 " > EDSL * examples < / a > . * @ param source to skip * @ param destination to sk...
assertBuilder ( ) ; builder . skip ( source , destination ) ;
public class MiriamLink { /** * Gets the Identifiers . org URI / URL of the entity ( example : " http : / / identifiers . org / obo . go / GO : 0045202 " ) . * @ param name - name , URI / URL , or ID of a data type ( examples : " ChEBI " , " MIR : 000005 " ) * @ param id identifier of an entity within the data type...
String url = null ; Datatype datatype = getDatatype ( name ) ; String db = datatype . getName ( ) ; if ( checkRegExp ( id , db ) ) { uris : for ( Uris uris : datatype . getUris ( ) ) { for ( Uri uri : uris . getUri ( ) ) { if ( uri . getValue ( ) . startsWith ( "http://identifiers.org/" ) ) { url = uri . getValue ( ) +...
public class ImmutableList { /** * Creates an immutable list that consists of the given elements . This method should only be used in the varargs form . If there is a need to create * an immutable list of an array of elements , { @ link # copyOf ( Object [ ] ) } should be used instead . * @ param elements the given...
Preconditions . checkNotNull ( elements ) ; return ofInternal ( elements ) ;
public class Delta { /** * Undo differential coding ( in - place ) . Effectively computes a prefix * sum . * @ param data * to be modified . */ public static void inverseDelta ( int [ ] data ) { } }
for ( int i = 1 ; i < data . length ; ++ i ) { data [ i ] += data [ i - 1 ] ; }
public class Res { /** * Get the message value from ResourceBundle by the key then format with the arguments . * Example : < br > * In resource file : msg = Hello { 0 } , today is { 1 } . < br > * In java code : res . format ( " msg " , " james " , new Date ( ) ) ; < br > * In freemarker template : $ { _ res . ...
return MessageFormat . format ( resourceBundle . getString ( key ) , arguments ) ;
public class SnowballProgram { /** * / * to replace chars between c _ bra and c _ ket in current by the * chars in s . */ protected int replace_s ( int c_bra , int c_ket , String s ) { } }
int adjustment = s . length ( ) - ( c_ket - c_bra ) ; current . replace ( c_bra , c_ket , s ) ; limit += adjustment ; if ( cursor >= c_ket ) cursor += adjustment ; else if ( cursor > c_bra ) cursor = c_bra ; return adjustment ;
public class FineUploaderBasic { /** * Additional headers sent along with the XHR POST request . Note that is option * is only relevant to the ajax / XHR uploader . * @ param sKey * Custom header name * @ param sValue * Custom header value * @ return this */ @ Nonnull public FineUploaderBasic addCustomHeade...
ValueEnforcer . notEmpty ( sKey , "Key" ) ; ValueEnforcer . notNull ( sValue , "Value" ) ; m_aRequestCustomHeaders . put ( sKey , sValue ) ; return this ;
public class SeaGlassSplitPaneDivider { /** * Convert the orientation of the pane into compass points based on the pane * orientation and the left - right orientation of the containter . * @ param isLeft { @ code true } if the component ' s container is laid out * left - to - right , otherwise { @ code false } . ...
if ( isLeft ) { if ( splitPane . getOrientation ( ) == JSplitPane . HORIZONTAL_SPLIT ) { return SwingConstants . WEST ; } return SwingConstants . NORTH ; } if ( splitPane . getOrientation ( ) == JSplitPane . HORIZONTAL_SPLIT ) { return SwingConstants . EAST ; } return SwingConstants . SOUTH ;
public class MSICredentials { /** * This method checks if the env vars " MSI _ ENDPOINT " and " MSI _ SECRET " exist . If they do , we return the msi creds class for APP Svcs * otherwise we return one for VM * @ param managementEndpoint Management endpoint in Azure * @ return MSICredentials */ public static MSICr...
// check if we are running in a web app String websiteName = System . getenv ( "WEBSITE_SITE_NAME" ) ; if ( websiteName != null && ! websiteName . isEmpty ( ) ) { // We are in a web app . . . MSIConfigurationForAppService config = new MSIConfigurationForAppService ( managementEndpoint ) ; return forAppService ( config ...
public class WebAppParser { /** * Parses welcome files out of web . xml . * @ param welcomeFileList welcomeFileList element from web . xml * @ param webApp model for web . xml */ private static void parseWelcomeFiles ( final WelcomeFileListType welcomeFileList , final WebApp webApp ) { } }
if ( welcomeFileList != null && welcomeFileList . getWelcomeFile ( ) != null && ! welcomeFileList . getWelcomeFile ( ) . isEmpty ( ) ) { welcomeFileList . getWelcomeFile ( ) . forEach ( webApp :: addWelcomeFile ) ; }
public class IncidentLogger { /** * Create the call stack array expected by diagnostic modules from an array * of StackTraceElements * @ param exceptionCallStack * The stack trace elements * @ return The call stack */ private static String [ ] getCallStackFromStackTraceElement ( StackTraceElement [ ] exceptionC...
if ( exceptionCallStack == null ) return null ; String [ ] answer = new String [ exceptionCallStack . length ] ; for ( int i = 0 ; i < exceptionCallStack . length ; i ++ ) { answer [ exceptionCallStack . length - 1 - i ] = exceptionCallStack [ i ] . getClassName ( ) ; } return answer ;
public class Utils { /** * Interesting features of chinese numbers : * - Each digit is followed by a unit symbol ( 10 ' s , 100 ' s , 1000 ' s ) . * - Units repeat in levels of 10,000 , there are symbols for each level too ( except 1 ' s ) . * - The digit 2 has a special form before the 10 symbol and at the end o...
if ( n < 0 ) { n = - n ; } if ( n <= 10 ) { if ( n == 2 ) { return String . valueOf ( zh . liang ) ; } return String . valueOf ( zh . digits [ ( int ) n ] ) ; } // 9223372036854775807 char [ ] buf = new char [ 40 ] ; // as long as we get , and actually we can ' t get this high , no units past zhao char [ ] digits = Str...
public class Spies { /** * Proxies a ternary predicate spying for result and parameters . * @ param < T1 > the predicate first parameter type * @ param < T2 > the predicate second parameter type * @ param < T3 > the predicate third parameter type * @ param predicate the predicate to be spied * @ param result ...
return new TernaryCapturingPredicate < T1 , T2 , T3 > ( predicate , result , param1 , param2 , param3 ) ;
public class CloudFormationStackRecord { /** * A list of objects describing the source of the CloudFormation stack record . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setSourceInfo ( java . util . Collection ) } or { @ link # withSourceInfo ( java . util...
if ( this . sourceInfo == null ) { setSourceInfo ( new java . util . ArrayList < CloudFormationStackRecordSourceInfo > ( sourceInfo . length ) ) ; } for ( CloudFormationStackRecordSourceInfo ele : sourceInfo ) { this . sourceInfo . add ( ele ) ; } return this ;
public class PDTXMLConverter { /** * Create a Java representation of XML Schema builtin datatype * < code > date < / code > or < code > g * < / code > . * For example , an instance of < code > gYear < / code > can be created invoking this * factory with < code > month < / code > and < code > day < / code > parame...
return s_aDTFactory . newXMLGregorianCalendarDate ( nYear , nMonth , nDay , nTimezone ) ;
public class Address { /** * Determines the IP address of a host * @ param name The hostname to look up * @ return The first matching IP address * @ throws UnknownHostException The hostname does not have any addresses */ public static InetAddress getByName ( String name ) throws UnknownHostException { } }
try { return getByAddress ( name ) ; } catch ( UnknownHostException e ) { Record [ ] records = lookupHostName ( name ) ; return addrFromRecord ( name , records [ 0 ] ) ; }
public class UserContextResource { /** * Returns a new resource which represents the SharingProfile Directory * contained within the UserContext exposed by this UserContextResource . * @ return * A new resource which represents the SharingProfile Directory * contained within the UserContext exposed by this User...
return sharingProfileDirectoryResourceFactory . create ( userContext , userContext . getSharingProfileDirectory ( ) ) ;
public class AfplibPackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EEnum getOBPYoaOrent ( ) { } }
if ( obpYoaOrentEEnum == null ) { obpYoaOrentEEnum = ( EEnum ) EPackage . Registry . INSTANCE . getEPackage ( AfplibPackage . eNS_URI ) . getEClassifiers ( ) . get ( 55 ) ; } return obpYoaOrentEEnum ;
public class QueryExecutorImpl { /** * Obtain lock over this connection for given object , blocking to wait if necessary . * @ param obtainer object that gets the lock . Normally current thread . * @ throws PSQLException when already holding the lock or getting interrupted . */ private void lock ( Object obtainer )...
if ( lockedFor == obtainer ) { throw new PSQLException ( GT . tr ( "Tried to obtain lock while already holding it" ) , PSQLState . OBJECT_NOT_IN_STATE ) ; } waitOnLock ( ) ; lockedFor = obtainer ;
public class SimplePluginRegistry { /** * Creates a new { @ link SimplePluginRegistry } . * @ return * @ deprecated use { @ link # empty ( ) } instead . */ @ Deprecated public static < S , T extends Plugin < S > > SimplePluginRegistry < T , S > create ( ) { } }
return of ( Collections . < T > emptyList ( ) ) ;
public class SetStatusRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( SetStatusRequest setStatusRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( setStatusRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( setStatusRequest . getPipelineId ( ) , PIPELINEID_BINDING ) ; protocolMarshaller . marshall ( setStatusRequest . getObjectIds ( ) , OBJECTIDS_BINDING ) ; protocolMarsha...
public class RecordTypeInfo { /** * Deserialize the type information for a record */ public void deserialize ( RecordInput rin , String tag ) throws IOException { } }
// read in any header , version info rin . startRecord ( tag ) ; // name this . name = rin . readString ( tag ) ; sTid . read ( rin , tag ) ; rin . endRecord ( tag ) ;
public class WisdomMessageResolver { /** * Resolve the message , returning a { @ link MessageResolution } object . * If the message cannot be resolved , this method should return null . * @ param arguments the { @ link Arguments } object being used for template processing * @ param key the message key * @ param...
Locale [ ] locales = getLocales ( ) ; String message = i18n . get ( locales , key , messageParameters ) ; // Same policy as the Thymeleaf standard message resolver . if ( message == null ) { return null ; } return new MessageResolution ( message ) ;
public class Or { /** * < p > Determine whether a class name is to be accepted or not , based on * the contained filters . The class name name is accepted if any * one of the contained filters accepts it . This method stops * looping over the contained filters as soon as it encounters one * whose { @ link Class...
if ( filters . size ( ) == 0 ) return true ; else for ( ClassFilter filter : filters ) if ( filter . accept ( classInfo , hierarchyResolver ) ) return true ; return false ;
public class Tree { /** * Sets the image name for a blank area of the tree . * ( Defaults to " lastLineJoin . gif " ) . * @ param lastLineJoinImage the image name ( including extension ) * @ jsptagref . attributedescription The image name for a blank area of the tree . * ( Defaults to " lastLineJoin . gif " ) ...
String val = setNonEmptyValueAttribute ( lastLineJoinImage ) ; if ( val != null ) _iState . setLastLineJoinImage ( setNonEmptyValueAttribute ( val ) ) ;
public class InodeTree { /** * Returns the path for a particular inode . The inode and the path to the inode must already be * locked . * @ param inode the inode to get the path for * @ return the { @ link AlluxioURI } for the path of the inode * @ throws FileDoesNotExistException if the path does not exist */ ...
StringBuilder builder = new StringBuilder ( ) ; computePathForInode ( inode , builder ) ; return new AlluxioURI ( builder . toString ( ) ) ;
public class NewChunk { /** * Fast - path append long data */ void append2 ( long l , int x ) { } }
if ( _id == null || l != 0 ) { if ( _ls == null || _sparseLen == _ls . length ) { append2slow ( ) ; // again call append2 since calling append2slow might have changed things ( eg might have switched to sparse and l could be 0) append2 ( l , x ) ; return ; } _ls [ _sparseLen ] = l ; _xs [ _sparseLen ] = x ; if ( _id != ...
public class PrepareStatement { /** * Construct a { @ link PrepareStatement } from a statement in { @ link String } format . * Statement shouldn ' t begin with " PREPARE " , otherwise a syntax error may be returned by the server . * @ param statement the statement to prepare ( not starting with " PREPARE " ) . * ...
if ( statement == null ) { throw new NullPointerException ( "Statement to prepare cannot be null" ) ; } // this is a guard against " PREPARE SELECT " , but not enough anymore as it could be " PREPARE name FROM SELECT " . . . if ( statement . startsWith ( PREPARE_PREFIX ) ) { statement = statement . replaceFirst ( PREPA...
public class CFG { /** * Create special empty exit BasicBlock that all BasicBlocks will eventually * flow into . All Edges to this ' dummy ' BasicBlock will get marked with * an edge type of EXIT . * Special BasicBlocks worth noting : * 1 . Exceptions , Returns , Entry ( why ? ) - > ExitBB * 2 . Returns - > E...
exitBB = createBB ( nestedExceptionRegions ) ; graph . addEdge ( entryBB , exitBB , EdgeType . EXIT ) ; graph . addEdge ( entryBB , firstBB , EdgeType . FALL_THROUGH ) ; for ( BasicBlock rb : returnBBs ) { graph . addEdge ( rb , exitBB , EdgeType . EXIT ) ; } for ( BasicBlock rb : exceptionBBs ) { graph . addEdge ( rb ...
public class JobsImpl { /** * Lists the execution status of the Job Preparation and Job Release task for the specified job across the compute nodes where the job has run . * This API returns the Job Preparation and Job Release task status on all compute nodes that have run the Job Preparation or Job Release task . Th...
ServiceResponseWithHeaders < Page < JobPreparationAndReleaseTaskExecutionInformation > , JobListPreparationAndReleaseTaskStatusHeaders > response = listPreparationAndReleaseTaskStatusSinglePageAsync ( jobId , jobListPreparationAndReleaseTaskStatusOptions ) . toBlocking ( ) . single ( ) ; return new PagedList < JobPrepa...
public class DeleteOp { /** * performs all delete operations together - if error occurs in one of them , all the operations are rolled back . * For details see { @ link DeleteOp # execute ( ) } * @ param deleteOps list of { @ code DeleteOp } to perform * @ throws IOException if an error occurred */ public static ...
try { for ( DeleteOp deleteOp : deleteOps ) { deleteOp . prepare ( ) ; } // best effort cleanup - delete what ' s possible and report error if anything remains boolean commitResult = true ; for ( DeleteOp op : deleteOps ) { commitResult &= op . commit ( ) ; } if ( ! commitResult ) { throw PatchLogger . ROOT_LOGGER . fa...
public class DeviceManagerClient { /** * Deletes the association between the device and the gateway . * < p > Sample code : * < pre > < code > * try ( DeviceManagerClient deviceManagerClient = DeviceManagerClient . create ( ) ) { * RegistryName parent = RegistryName . of ( " [ PROJECT ] " , " [ LOCATION ] " , "...
UnbindDeviceFromGatewayRequest request = UnbindDeviceFromGatewayRequest . newBuilder ( ) . setParent ( parent == null ? null : parent . toString ( ) ) . setGatewayId ( gatewayId ) . setDeviceId ( deviceId ) . build ( ) ; return unbindDeviceFromGateway ( request ) ;
public class NetworkMonitor { /** * Get the type of mobile data network connection . * It is recommended to call { @ link # getCurrentConnectionType ( ) } before this method to make sure * that the device does have a mobile data connection . * < p > < b > Note : < / b > This method is only available for Android A...
String resultUnknown = "unknown" ; if ( Build . VERSION . SDK_INT < Build . VERSION_CODES . N ) { return resultUnknown ; } if ( getTelephonyManager ( ) == null ) { return resultUnknown ; } switch ( getTelephonyManager ( ) . getDataNetworkType ( ) ) { case TelephonyManager . NETWORK_TYPE_LTE : return "4G" ; case Telepho...
public class Ghprb { /** * Returns skip build phrases from Jenkins global configuration * @ return skip build phrases */ public Set < String > getSkipBuildPhrases ( ) { } }
return new HashSet < String > ( Arrays . asList ( getTrigger ( ) . getSkipBuildPhrase ( ) . split ( "[\\r\\n]+" ) ) ) ;
public class ApplePayDomain { /** * Retrieve an apple pay domain . */ public static ApplePayDomain retrieve ( String domain ) throws StripeException { } }
return retrieve ( domain , ( Map < String , Object > ) null , ( RequestOptions ) null ) ;
public class GeneralizedCounter { /** * Returns a set of entries , where each key is a read - only { @ link * List } of size one less than the depth of the GeneralizedCounter , and * each value is a { @ link ClassicCounter } . Each entry is a { @ link java . util . Map . Entry } object , but these objects * do no...
return ErasureUtils . < Set < Map . Entry < List < K > , ClassicCounter < K > > > > uncheckedCast ( lowestLevelCounterEntrySet ( new HashSet < Map . Entry < Object , ClassicCounter < K > > > ( ) , zeroKey , true ) ) ;
public class JsonParserBuilder { /** * Sets the parser options . The previous options , if any , are discarded . * @ param first parser option * @ param rest the rest parser options * @ return a reference to this builder */ public JsonParserBuilder options ( JsonParserOption first , JsonParserOption ... rest ) { ...
this . options = EnumSet . of ( first , rest ) ; return this ;
public class NodePropertyOverrideMarshaller { /** * Marshall the given parameter object . */ public void marshall ( NodePropertyOverride nodePropertyOverride , ProtocolMarshaller protocolMarshaller ) { } }
if ( nodePropertyOverride == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( nodePropertyOverride . getTargetNodes ( ) , TARGETNODES_BINDING ) ; protocolMarshaller . marshall ( nodePropertyOverride . getContainerOverrides ( ) , CONTAINEROVER...
public class BigtableTableAdminClientWrapper { /** * { @ inheritDoc } */ @ Override public void dropRowRange ( String tableId , String rowKeyPrefix ) { } }
Preconditions . checkNotNull ( rowKeyPrefix ) ; DropRowRangeRequest protoRequest = DropRowRangeRequest . newBuilder ( ) . setName ( instanceName . toTableNameStr ( tableId ) ) . setDeleteAllDataFromTable ( false ) . setRowKeyPrefix ( ByteString . copyFromUtf8 ( rowKeyPrefix ) ) . build ( ) ; delegate . dropRowRange ( p...
public class CmsUserDataExportDialog { /** * Creates the dialog HTML for all defined widgets of the named dialog ( page ) . < p > * This overwrites the method from the super class to create a layout variation for the widgets . < p > * @ param dialog the dialog ( page ) to get the HTML for * @ return the dialog HT...
StringBuffer result = new StringBuffer ( 1024 ) ; result . append ( createWidgetTableStart ( ) ) ; // show error header once if there were validation errors result . append ( createWidgetErrorHeader ( ) ) ; if ( dialog . equals ( PAGES [ 0 ] ) ) { // create the widgets for the first dialog page result . append ( dialog...
public class WingsService { /** * Sends a { @ link com . groundupworks . wings . WingsEndpoint . ShareNotification } to the notification bar . */ private void sendNotification ( WingsEndpoint . ShareNotification wingsNotification ) { } }
// Construct pending intent . The wrapped Intent must not be null as some versions of Android require it . Intent intent = wingsNotification . getIntent ( ) ; intent . setFlags ( Intent . FLAG_ACTIVITY_NEW_TASK ) ; PendingIntent pendingIntent = PendingIntent . getActivity ( mContext , 0 , intent , PendingIntent . FLAG_...
public class MultilevelSplitQueue { /** * Presto attempts to give each level a target amount of scheduled time , which is configurable * using levelTimeMultiplier . * This function selects the level that has the the lowest ratio of actual to the target time * with the objective of minimizing deviation from the ta...
long targetScheduledTime = getLevel0TargetTime ( ) ; double worstRatio = 1 ; int selectedLevel = - 1 ; for ( int level = 0 ; level < LEVEL_THRESHOLD_SECONDS . length ; level ++ ) { if ( ! levelWaitingSplits . get ( level ) . isEmpty ( ) ) { long levelTime = levelScheduledTime [ level ] . get ( ) ; double ratio = levelT...
public class NotificationViewCallback { /** * Called when the view has been clicked . * @ param view * @ param contentView * @ param entry * @ return boolean true , if handled . */ public void onClickContentView ( NotificationView view , View contentView , NotificationEntry entry ) { } }
if ( DBG ) Log . v ( TAG , "onClickContentView - " + entry . ID ) ;
public class AWSGreengrassClient { /** * Returns the status of a bulk deployment . * @ param getBulkDeploymentStatusRequest * @ return Result of the GetBulkDeploymentStatus operation returned by the service . * @ throws BadRequestException * invalid request * @ sample AWSGreengrass . GetBulkDeploymentStatus ...
request = beforeClientExecution ( request ) ; return executeGetBulkDeploymentStatus ( request ) ;
public class CommerceCountryPersistenceImpl { /** * Returns the first commerce country 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 >...
CommerceCountry commerceCountry = fetchByUuid_C_First ( uuid , companyId , orderByComparator ) ; if ( commerceCountry != null ) { return commerceCountry ; } StringBundler msg = new StringBundler ( 6 ) ; msg . append ( _NO_SUCH_ENTITY_WITH_KEY ) ; msg . append ( "uuid=" ) ; msg . append ( uuid ) ; msg . append ( ", comp...
public class AfplibFactoryImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public String convertObjectCountSubObjToString ( EDataType eDataType , Object instanceValue ) { } }
return instanceValue == null ? null : instanceValue . toString ( ) ;
public class DiscordWebSocketAdapter { /** * Starts the heartbeat . * @ param websocket The websocket the heartbeat should be sent to . * @ param heartbeatInterval The heartbeat interval . * @ return The timer used for the heartbeat . */ private Future < ? > startHeartbeat ( final WebSocket websocket , final int ...
// first heartbeat should assume last heartbeat was answered properly heartbeatAckReceived . set ( true ) ; return api . getThreadPool ( ) . getScheduler ( ) . scheduleWithFixedDelay ( ( ) -> { try { if ( heartbeatAckReceived . getAndSet ( false ) ) { sendHeartbeat ( websocket ) ; logger . debug ( "Sent heartbeat (inte...
public class ManagedPoolDataSource { /** * Performs a getConnection ( ) after validating the given username * and password . * @ param user String which must match the ' user ' configured for this * ManagedPoolDataSource . * @ param password String which must match the ' password ' configured * for this Manag...
String managedPassword = getPassword ( ) ; String managedUser = getUsername ( ) ; if ( ( ( user == null && managedUser != null ) || ( user != null && managedUser == null ) ) || ( user != null && ! user . equals ( managedUser ) ) || ( ( password == null && managedPassword != null ) || ( password != null && managedPasswo...
public class BroadcastStationsFile { /** * Stores contents if url is a file otherwise throws IllegalArgumentException * @ throws IOException */ public void store ( ) throws IOException { } }
try { File file = new File ( url . toURI ( ) ) ; try ( FileOutputStream fos = new FileOutputStream ( file ) ; OutputStreamWriter osw = new OutputStreamWriter ( fos , UTF_8 ) ; BufferedWriter bw = new BufferedWriter ( osw ) ) { store ( bw ) ; } } catch ( URISyntaxException ex ) { throw new RuntimeException ( ex ) ; }
public class MapConfig { /** * Configure de - serialized value caching . * Default : { @ link CacheDeserializedValues # INDEX _ ONLY } * @ return this { @ code MapConfig } instance * @ see CacheDeserializedValues * @ since 3.6 */ public MapConfig setCacheDeserializedValues ( CacheDeserializedValues cacheDeseria...
validateCacheDeserializedValuesOption ( cacheDeserializedValues ) ; this . cacheDeserializedValues = cacheDeserializedValues ; this . setCacheDeserializedValuesExplicitlyInvoked = true ; return this ;
public class AbstractCommonShapeFileReader { /** * Skip an amount of bytes . * @ param amount the amount to skip . * @ throws IOException in case of error . */ protected void skipBytes ( int amount ) throws IOException { } }
ensureAvailableBytes ( amount ) ; this . buffer . position ( this . buffer . position ( ) + amount ) ;
public class EntityInfo { /** * 获取Entity的INSERT SQL * @ param bean Entity对象 * @ return String */ public String getInsertPrepareSQL ( T bean ) { } }
if ( this . tableStrategy == null ) return insertPrepareSQL ; return insertPrepareSQL . replace ( "${newtable}" , getTable ( bean ) ) ;
public class CacheImpl { /** * Checks if a given { @ link CacheItem } needs to be refreshed . If so , then it is added to the listen of items to * refresh . * @ param item * @ param itemsToRefresh the list of items where to put the specified item if it needs to be refreshed * @ return true if the item will be r...
if ( item . getLoader ( ) != null && item . needsRefresh ( ticks . get ( ) ) ) { itemsToRefresh . add ( item ) ; return true ; } else { return false ; }
public class AWSApplicationDiscoveryClient { /** * Retrieves a short summary of discovered assets . * This API operation takes no request parameters and is called as is at the command prompt as shown in the example . * @ param getDiscoverySummaryRequest * @ return Result of the GetDiscoverySummary operation retur...
request = beforeClientExecution ( request ) ; return executeGetDiscoverySummary ( request ) ;
public class ListSelectionValueModelAdapter { /** * Returns the indices of all selected rows in the model . * @ return an array of integers containing the indices of all selected rows , * or an empty array if no row is selected */ private int [ ] getSelectedRows ( ) { } }
int iMin = model . getMinSelectionIndex ( ) ; int iMax = model . getMaxSelectionIndex ( ) ; if ( ( iMin == - 1 ) || ( iMax == - 1 ) ) { return new int [ 0 ] ; } int [ ] rvTmp = new int [ 1 + ( iMax - iMin ) ] ; int n = 0 ; for ( int i = iMin ; i <= iMax ; i ++ ) { if ( model . isSelectedIndex ( i ) ) { rvTmp [ n ++ ] =...
public class JSONArray { /** * Get the optional int value associated with an index . The defaultValue is * returned if there is no value for the index , or if the value is not a * number and cannot be converted to a number . * @ param index * The index must be between 0 and length ( ) - 1. * @ param defaultVa...
final Number val = this . optNumber ( index , null ) ; if ( val == null ) { return defaultValue ; } return val . intValue ( ) ;
public class ImageUtils { /** * Write the image to bytes in the provided format and optional quality * @ param image * buffered image * @ param formatName * image format name * @ param quality * null or quality between 0.0 and 1.0 * @ return image bytes * @ throws IOException * upon failure * @ sinc...
byte [ ] bytes = null ; if ( quality != null ) { bytes = compressAndWriteImageToBytes ( image , formatName , quality ) ; } else { bytes = writeImageToBytes ( image , formatName ) ; } return bytes ;
public class SessionServiceException { /** * Converts a Throwable to a SessionServiceException with the specified detail message . If the * Throwable is a SessionServiceException and if the Throwable ' s message is identical to the * one supplied , the Throwable will be passed through unmodified ; otherwise , it wi...
return ( cause instanceof SessionServiceException && Objects . equals ( interfaceClass , ( ( SessionServiceException ) cause ) . getInterfaceClass ( ) ) && Objects . equals ( message , cause . getMessage ( ) ) ) ? ( SessionServiceException ) cause : new SessionServiceException ( interfaceClass , message , cause ) ;
public class KuberntesServiceUrlResourceProvider { /** * Find the the qualified container port of the target service * Uses java annotations first or returns the container port . * @ param service * The target service . * @ param qualifiers * The set of qualifiers . * @ return Returns the resolved container...
for ( Annotation q : qualifiers ) { if ( q instanceof Port ) { Port port = ( Port ) q ; if ( port . value ( ) > 0 ) { return port . value ( ) ; } } } ServicePort servicePort = findQualifiedServicePort ( service , qualifiers ) ; if ( servicePort != null ) { return servicePort . getPort ( ) ; } return 0 ;
public class Optional { /** * Returns inner value if present , otherwise returns { @ code other } . * @ param other the value to be returned if inner value is not present * @ return inner value if present , otherwise { @ code other } */ @ Nullable public T orElse ( @ Nullable T other ) { } }
return value != null ? value : other ;
public class KxReactiveStreams { /** * warning : blocks the calling thread . Need to execute in a separate thread if called * from within a callback */ public < T > Stream < T > stream ( Publisher < T > pub ) { } }
return stream ( pub , batchSize ) ;
public class AssociationValue { /** * Sets the specified image URL attribute to the specified value . * @ param name name of the attribute * @ param value value of the attribute * @ since 1.9.0 */ public void setImageUrlAttribute ( String name , String value ) { } }
ensureAttributes ( ) ; Attribute attribute = new ImageUrlAttribute ( value ) ; attribute . setEditable ( isEditable ( name ) ) ; getAllAttributes ( ) . put ( name , attribute ) ;
public class ArtifactResource { /** * Add " DO _ NOT _ USE " flag to an artifact * @ param credential DbCredential * @ param gavc String * @ param doNotUse boolean * @ return Response */ @ POST @ Path ( "/{gavc}" + ServerAPI . SET_DO_NOT_USE ) public Response postDoNotUse ( @ Auth final DbCredential credential ...
if ( ! credential . getRoles ( ) . contains ( AvailableRoles . ARTIFACT_CHECKER ) ) { throw new WebApplicationException ( Response . status ( Response . Status . UNAUTHORIZED ) . build ( ) ) ; } if ( LOG . isInfoEnabled ( ) ) { LOG . info ( String . format ( "Got a add \"DO_NOT_USE\" request [%s]" , gavc ) ) ; } // Set...
public class RandomVariableLazyEvaluation { /** * / * ( non - Javadoc ) * @ see net . finmath . stochastic . RandomVariable # addRatio ( net . finmath . stochastic . RandomVariable , net . finmath . stochastic . RandomVariable ) */ @ Override public RandomVariable addRatio ( RandomVariable numerator , RandomVariable ...
return apply ( new DoubleBinaryOperator ( ) { @ Override public double applyAsDouble ( double x , double y ) { return x + y ; } } , new DoubleBinaryOperator ( ) { @ Override public double applyAsDouble ( double x , double y ) { return x / y ; } } , numerator , denominator ) ;
public class AstBinOp { /** * Auto - widen the scalar to every element of the frame */ private ValFrame scalar_op_frame ( final double d , Frame fr ) { } }
Frame res = new MRTask ( ) { @ Override public void map ( Chunk [ ] chks , NewChunk [ ] cress ) { for ( int c = 0 ; c < chks . length ; c ++ ) { Chunk chk = chks [ c ] ; NewChunk cres = cress [ c ] ; for ( int i = 0 ; i < chk . _len ; i ++ ) cres . addNum ( op ( d , chk . atd ( i ) ) ) ; } } } . doAll ( fr . numCols ( ...
public class POSTrainGenerating { /** * / * ( non - Javadoc ) * @ see jvntextpro . data . TrainDataGenerating # init ( ) */ @ Override public void init ( ) { } }
// TODO Auto - generated method stub this . reader = new POSDataReader ( true ) ; this . tagger = new TaggingData ( ) ; tagger . addContextGenerator ( new POSContextGenerator ( templateFile ) ) ;
public class CmsResourceTypeStatsView { /** * Sets up the combo box for choosing the resource type . < p > */ private void setupResourceType ( ) { } }
IndexedContainer resTypes = CmsVaadinUtils . getResourceTypesContainer ( ) ; resTypes . addContainerFilter ( CmsVaadinUtils . FILTER_NO_FOLDERS ) ; m_resType . setContainerDataSource ( resTypes ) ; m_resType . setItemCaptionPropertyId ( PropertyId . caption ) ; m_resType . setItemIconPropertyId ( PropertyId . icon ) ;
public class HODate { /** * Sets the date to the value corresponding to the $ H value . * @ param value $ H - formatted date . */ public void setHODate ( String value ) { } }
Calendar cal = Calendar . getInstance ( ) ; cal . setTimeZone ( TimeZone . getDefault ( ) ) ; String [ ] pcs = value . split ( "\\," , 2 ) ; long ms = ( Long . parseLong ( pcs [ 0 ] ) - 47116 ) * 24 * 60 * 60 * 1000 ; cal . setTimeInMillis ( ms ) ; hasTime = pcs . length == 2 ; if ( hasTime ) { int frac = Integer . par...
public class DataDescriptor { /** * Returns true if this descriptor has same path * same type , same moduleName , instanceName , and dataId as the other DataDescriptor . */ public boolean isSamePath ( DataDescriptor other ) { } }
if ( other == null ) return false ; if ( type == TYPE_INVALID || other . getType ( ) == TYPE_INVALID ) return false ; if ( type != other . getType ( ) ) return false ; if ( dataPath == null || other . getPath ( ) == null ) return false ; String [ ] otherPath = other . getPath ( ) ; if ( dataPath . length != otherPath ....
public class AwsSignatureHelper { /** * todo does not recognize properly us - east - 2 . quicksight . amazonaws . com , us - west - 1 . queue . amazonaws . com types of hostname */ public String getAmazonRegion ( String endpoint ) { } }
if ( isBlank ( endpoint ) ) { return DEFAULT_AMAZON_REGION ; } final Pattern pattern = Pattern . compile ( "(https://)?(.+)?\\.(.+)\\." + AMAZON_HOSTNAME + "(\\.cn)?" ) ; final Matcher matcher = pattern . matcher ( endpoint ) ; if ( matcher . find ( ) ) { return matcher . group ( 3 ) ; } return DEFAULT_AMAZON_REGION ;
public class CacheConfigurationBuilder { /** * Adds a { @ link ResilienceStrategy } to the configured builder . * @ param resilienceStrategy the resilience strategy to use * @ return a new builder with the added resilience strategy configuration */ public CacheConfigurationBuilder < K , V > withResilienceStrategy (...
return addOrReplaceConfiguration ( new DefaultResilienceStrategyConfiguration ( requireNonNull ( resilienceStrategy , "Null resilienceStrategy" ) ) ) ;
public class AmazonEC2Waiters { /** * Builds a ImageExists waiter by using custom parameters waiterParameters and other parameters defined in the * waiters specification , and then polls until it determines whether the resource entered the desired state or not , * where polling criteria is bound by either default p...
return new WaiterBuilder < DescribeImagesRequest , DescribeImagesResult > ( ) . withSdkFunction ( new DescribeImagesFunction ( client ) ) . withAcceptors ( new ImageExists . IsTrueMatcher ( ) , new ImageExists . IsInvalidAMIIDNotFoundMatcher ( ) ) . withDefaultPollingStrategy ( new PollingStrategy ( new MaxAttemptsRetr...
public class Ctx { /** * Returns NULL if no I / O thread is available . */ IOThread chooseIoThread ( long affinity ) { } }
if ( ioThreads . isEmpty ( ) ) { return null ; } // Find the I / O thread with minimum load . int minLoad = - 1 ; IOThread selectedIoThread = null ; for ( int i = 0 ; i != ioThreads . size ( ) ; i ++ ) { if ( affinity == 0 || ( affinity & ( 1L << i ) ) > 0 ) { int load = ioThreads . get ( i ) . getLoad ( ) ; if ( selec...
public class PixelMath { /** * Computes the absolute value of the difference between each pixel in the two images . < br > * d ( x , y ) = | img1 ( x , y ) - img2 ( x , y ) | * @ param imgA Input image . Not modified . * @ param imgB Input image . Not modified . * @ param output Absolute value of difference ima...
InputSanityCheck . checkSameShape ( imgA , imgB ) ; output . reshape ( imgA . width , imgA . height ) ; if ( BoofConcurrency . USE_CONCURRENT ) { ImplPixelMath_MT . diffAbs ( imgA , imgB , output ) ; } else { ImplPixelMath . diffAbs ( imgA , imgB , output ) ; }
public class HystrixScriptModuleExecutor { /** * Helper method to get or create a ExecutionStatistics instance * @ param moduleId * @ return new or existing module statistics */ protected ExecutionStatistics getOrCreateModuleStatistics ( ModuleId moduleId ) { } }
ExecutionStatistics moduleStats = statistics . get ( moduleId ) ; if ( moduleStats == null ) { moduleStats = new ExecutionStatistics ( ) ; ExecutionStatistics existing = statistics . put ( moduleId , moduleStats ) ; if ( existing != null ) { moduleStats = existing ; } } return moduleStats ;
public class IoSessionFactory { /** * Returns a list of all server socket addresses to which sessions are already * established or being established * @ return List of socket addresses */ public Set < SocketAddress > getCurrentSessionAddresses ( ) { } }
Set < SocketAddress > result = new HashSet < SocketAddress > ( ) ; synchronized ( lock ) { result . addAll ( sessions . keySet ( ) ) ; result . addAll ( pendingConnections . keySet ( ) ) ; } return result ;
public class MetricAlarm { /** * The actions to execute when this alarm transitions to the < code > ALARM < / code > state from any other state . Each * action is specified as an Amazon Resource Name ( ARN ) . * @ param alarmActions * The actions to execute when this alarm transitions to the < code > ALARM < / co...
if ( alarmActions == null ) { this . alarmActions = null ; return ; } this . alarmActions = new com . amazonaws . internal . SdkInternalList < String > ( alarmActions ) ;
public class MultiDbJDBCConnection { /** * { @ inheritDoc } */ @ Override protected ResultSet findReferences ( String nodeIdentifier ) throws SQLException { } }
if ( findReferences == null ) { findReferences = dbConnection . prepareStatement ( FIND_REFERENCES ) ; } else { findReferences . clearParameters ( ) ; } findReferences . setString ( 1 , nodeIdentifier ) ; return findReferences . executeQuery ( ) ;