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 . * @ throws InvalidInputException * Lightsail throws this exception when user input does not conform to the validation rules of an input * field . < / p > < note > * Domain - related APIs are only available in the N . Virginia ( us - east - 1 ) Region . Please set your AWS Region * configuration to us - east - 1 to create , view , or edit these resources . * @ throws NotFoundException * Lightsail throws this exception when it cannot find a resource . * @ throws OperationFailureException * Lightsail throws this exception when an operation fails to execute . * @ throws AccessDeniedException * Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to * access a resource . * @ throws AccountSetupInProgressException * Lightsail throws this exception when an account is still in the setup in progress state . * @ throws UnauthenticatedException * Lightsail throws this exception when the user has not been authenticated . * @ sample AmazonLightsail . GetInstances * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / lightsail - 2016-11-28 / GetInstances " target = " _ top " > AWS API * Documentation < / a > */ @ Override public GetInstancesResult getInstances ( GetInstancesRequest request ) { } }
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 < ? > configuration ) { } }
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 ServletException , IOException { } }
// 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 ) ) ; JavaClass serviceInfo = builder . getSources ( ) . stream ( ) . flatMap ( javaSource -> javaSource . getClasses ( ) . stream ( ) ) . filter ( javaClass -> hasAnnotation ( javaClass , ServiceDoc . class ) ) . findFirst ( ) . orElse ( null ) ; // populate further service information from @ ServiceDoc class and @ LinkRelationDoc fields if ( serviceInfo != null ) { service . setDescriptionMarkup ( serviceInfo . getComment ( ) ) ; serviceInfo . getFields ( ) . stream ( ) . filter ( field -> hasAnnotation ( field , LinkRelationDoc . class ) ) . map ( field -> toLinkRelation ( serviceInfo , field , compileClassLoader ) ) . forEach ( service :: addLinkRelation ) ; } // resolve link relations service . resolve ( ) ; return service ;
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 SibRaMessagingEngineConnection connection , final ConsumerSession session , final Throwable throwable ) { } }
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 ) { /* * Output a message to the admin console and attempt to create a new * listener */ SibTr . warning ( TRACE , "CONSUMER_FAILED_CWSIV0770" , new Object [ ] { destination . getDestinationName ( ) , _endpointConfiguration . getBusName ( ) , this , throwable } ) ; try { createListener ( connection ) ; } catch ( final ResourceException exception ) { // No FFDC code needed } } else { if ( SibRaEngineComponent . isMessagingEngineReloading ( connection . getConnection ( ) . getMeUuid ( ) ) ) { /* * Output a warning to the admin console and close the * connection - will be recreated during engineReloaded if * required */ SibTr . warning ( TRACE , "FAILURE_DURING_RELOAD_CWSIV0774" , new Object [ ] { throwable , destination . getDestinationName ( ) , connection . getConnection ( ) . getMeName ( ) , destination . getBusName ( ) , this } ) ; closeConnection ( connection . getConnection ( ) . getMeUuid ( ) ) ; } else { /* * Output a message to the admin console and deactivate the * endpoint */ SibTr . error ( TRACE , "SESSION_ERROR_CWSIV0766" , new Object [ ] { throwable , destination . getDestinationName ( ) , connection . getConnection ( ) . getMeName ( ) , destination . getBusName ( ) , this } ) ; deactivate ( ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . exit ( this , TRACE , methodName ) ; }
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 CDKException { } }
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 ( ) ; while ( oldRuleIt . hasNext ( ) ) { IRule oldRule = oldRuleIt . next ( ) ; if ( oldRule instanceof ElementRule ) { rules . remove ( oldRule ) ; rules . add ( rule ) ; break ; } } this . matrix_Base = getMatrix ( mfRange . getIsotopeCount ( ) ) ; } else if ( rule instanceof ChargeRule ) { this . charge = ( Double ) ( ( Object [ ] ) rule . getParameters ( ) ) [ 0 ] ; // removing the rule Iterator < IRule > oldRuleIt = rules . iterator ( ) ; while ( oldRuleIt . hasNext ( ) ) { IRule oldRule = oldRuleIt . next ( ) ; if ( oldRule instanceof ChargeRule ) { rules . remove ( oldRule ) ; rules . add ( rule ) ; break ; } } } else if ( rule instanceof ToleranceRangeRule ) { this . tolerance = ( Double ) ( ( Object [ ] ) rule . getParameters ( ) ) [ 1 ] ; // removing the rule Iterator < IRule > oldRuleIt = rules . iterator ( ) ; while ( oldRuleIt . hasNext ( ) ) { IRule oldRule = oldRuleIt . next ( ) ; if ( oldRule instanceof ToleranceRangeRule ) { rules . remove ( oldRule ) ; rules . add ( rule ) ; break ; } } } else { rules . add ( rule ) ; } }
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 response:[" + response + "]" ) ; // release the client client . release ( ) ;
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 , dstIndex ) ; dstIndex += 4 ; SMBUtil . writeInt8 ( this . smbCreateFlags , dst , dstIndex ) ; dstIndex += 8 ; dstIndex += 8 ; // Reserved SMBUtil . writeInt4 ( this . desiredAccess , dst , dstIndex ) ; dstIndex += 4 ; SMBUtil . writeInt4 ( this . fileAttributes , dst , dstIndex ) ; dstIndex += 4 ; SMBUtil . writeInt4 ( this . shareAccess , dst , dstIndex ) ; dstIndex += 4 ; SMBUtil . writeInt4 ( this . createDisposition , dst , dstIndex ) ; dstIndex += 4 ; SMBUtil . writeInt4 ( this . createOptions , dst , dstIndex ) ; dstIndex += 4 ; int nameOffsetOffset = dstIndex ; byte [ ] nameBytes = this . name . getBytes ( StandardCharsets . UTF_16LE ) ; SMBUtil . writeInt2 ( nameBytes . length , dst , dstIndex + 2 ) ; dstIndex += 4 ; int createContextOffsetOffset = dstIndex ; dstIndex += 4 ; // createContextOffset int createContextLengthOffset = dstIndex ; dstIndex += 4 ; // createContextLength SMBUtil . writeInt2 ( dstIndex - getHeaderStart ( ) , dst , nameOffsetOffset ) ; System . arraycopy ( nameBytes , 0 , dst , dstIndex , nameBytes . length ) ; if ( nameBytes . length == 0 ) { // buffer must contain at least one byte dstIndex ++ ; } else { dstIndex += nameBytes . length ; } dstIndex += pad8 ( dstIndex ) ; if ( this . createContexts == null || this . createContexts . length == 0 ) { SMBUtil . writeInt4 ( 0 , dst , createContextOffsetOffset ) ; } else { SMBUtil . writeInt4 ( dstIndex - getHeaderStart ( ) , dst , createContextOffsetOffset ) ; } int totalCreateContextLength = 0 ; if ( this . createContexts != null ) { int lastStart = - 1 ; for ( CreateContextRequest createContext : this . createContexts ) { int structStart = dstIndex ; SMBUtil . writeInt4 ( 0 , dst , structStart ) ; // Next if ( lastStart > 0 ) { // set next pointer of previous CREATE _ CONTEXT SMBUtil . writeInt4 ( structStart - dstIndex , dst , lastStart ) ; } dstIndex += 4 ; byte [ ] cnBytes = createContext . getName ( ) ; int cnOffsetOffset = dstIndex ; SMBUtil . writeInt2 ( cnBytes . length , dst , dstIndex + 2 ) ; dstIndex += 4 ; int dataOffsetOffset = dstIndex + 2 ; dstIndex += 4 ; int dataLengthOffset = dstIndex ; dstIndex += 4 ; SMBUtil . writeInt2 ( dstIndex - structStart , dst , cnOffsetOffset ) ; System . arraycopy ( cnBytes , 0 , dst , dstIndex , cnBytes . length ) ; dstIndex += cnBytes . length ; dstIndex += pad8 ( dstIndex ) ; SMBUtil . writeInt2 ( dstIndex - structStart , dst , dataOffsetOffset ) ; int len = createContext . encode ( dst , dstIndex ) ; SMBUtil . writeInt4 ( len , dst , dataLengthOffset ) ; dstIndex += len ; int pad = pad8 ( dstIndex ) ; totalCreateContextLength += len + pad ; dstIndex += pad ; lastStart = structStart ; } } SMBUtil . writeInt4 ( totalCreateContextLength , dst , createContextLengthOffset ) ; return dstIndex - start ;
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 , "" ) ) ; if ( str . startsWith ( "md5:" ) ) { if ( ! rolesDir . exists ( ) ) rolesDir . mkdirs ( ) ; str = str . substring ( 4 ) ; Resource md5 = rolesDir . getRealResource ( str ) ; try { str = IOUtil . toString ( md5 , "utf-8" ) ; } catch ( IOException e ) { str = "" ; } } return new CredentialImpl ( Caster . toString ( arr . get ( 1 , "" ) ) , Caster . toString ( arr . get ( 2 , "" ) ) , str , rolesDir ) ; } if ( len == 2 ) return new CredentialImpl ( Caster . toString ( arr . get ( 1 , "" ) ) , Caster . toString ( arr . get ( 2 , "" ) ) , rolesDir ) ; if ( len == 1 ) return new CredentialImpl ( Caster . toString ( arr . get ( 1 , "" ) ) , rolesDir ) ; return null ;
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 < code > Accept < / code > , < code > Connect < / code > , * < code > Delete < / code > , and < code > Reject < / code > . */ public java . util . List < String > getConnectionEvents ( ) { } }
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 void writeIlinkArgs ( final PropertyWriter writer , final String linkID , final String [ ] args ) throws SAXException { } }
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 , option + ".value" , arg . substring ( equalsPos + 1 ) ) ; } else { writer . write ( linkID , "option." + arg . substring ( 1 ) + ".enabled" , "1" ) ; } } }
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 ( ) ; for ( AnnotationType a : annoTypes ) { if ( a . getName ( ) . equals ( name ) ) { annoType = a ; break ; } } if ( annoType != null ) { break ; } } return annoType ;
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> | --all-nodes] [--confirm]" ) ; stream . println ( ) ; stream . println ( "COMMENTS" ) ; stream . println ( " To set one metadata, please specify one of the following:" ) ; stream . println ( " " + MetadataStore . CLUSTER_KEY + " (meta-value is cluster.xml file path)" ) ; stream . println ( " " + MetadataStore . STORES_KEY + " (meta-value is stores.xml file path)" ) ; stream . println ( " " + MetadataStore . SLOP_STREAMING_ENABLED_KEY ) ; stream . println ( " " + MetadataStore . PARTITION_STREAMING_ENABLED_KEY ) ; stream . println ( " " + MetadataStore . READONLY_FETCH_ENABLED_KEY ) ; stream . println ( " " + MetadataStore . QUOTA_ENFORCEMENT_ENABLED_KEY ) ; stream . println ( " " + MetadataStore . REBALANCING_SOURCE_CLUSTER_XML ) ; stream . println ( " " + MetadataStore . REBALANCING_STEAL_INFO ) ; stream . println ( " " + KEY_OFFLINE ) ; stream . println ( " To set a pair of metadata values, valid meta keys are:" ) ; stream . println ( " " + MetadataStore . CLUSTER_KEY + " (meta-value is cluster.xml file path)" ) ; stream . println ( " " + MetadataStore . STORES_KEY + " (meta-value is stores.xml file path)" ) ; stream . println ( ) ; getParser ( ) . printHelpOn ( stream ) ; stream . println ( ) ;
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 . g . last return code
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 loadJMXSettings ( ) { } }
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 for JMX settings" ) ; return false ; } // create the properties Properties properties = new Properties ( ) ; // load the properties FileInputStream in = null ; try { in = new FileInputStream ( settingsFile ) ; properties . load ( in ) ; } catch ( IOException ioe ) { log . error ( "Unable to load JMX settings: " + ioe . getMessage ( ) ) ; log . error ( ioe ) ; return false ; } finally { try { if ( in != null ) { in . close ( ) ; } } catch ( IOException e ) { /* ignore */ } } // load the settings String value ; value = properties . getProperty ( "EdenSpace" ) ; if ( value != null ) { edenSpace = new String [ ] { value } ; } value = properties . getProperty ( "SurvivorSpace" ) ; if ( value != null ) { survivorSpace = new String [ ] { value } ; } value = properties . getProperty ( "PermGen" ) ; if ( value != null ) { permGen = new String [ ] { value } ; } value = properties . getProperty ( "TenuredGen" ) ; if ( value != null ) { tenuredGen = new String [ ] { value } ; } value = properties . getProperty ( "YoungCollector" ) ; if ( value != null ) { youngCollector = new String [ ] { value } ; } value = properties . getProperty ( "TenuredCollector" ) ; if ( value != null ) { tenuredCollector = new String [ ] { value } ; } // success return true ;
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 skip * @ throws IllegalStateException if called from outside the context of * { @ link PropertyMap # configure ( ) } . */ protected final void skip ( Object source , Object destination ) { } }
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 ( examples : " GO : 0045202 " , " P62158 " ) * @ return Identifiers . org URL for the id * @ throws IllegalArgumentException when datatype not found */ public static String getIdentifiersOrgURI ( String name , String id ) { } }
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 ( ) + id ; break uris ; } } } } else throw new IllegalArgumentException ( "ID pattern mismatch. db=" + db + ", id=" + id + ", regexp: " + datatype . getPattern ( ) ) ; return url ;
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 elements * @ return an immutable list */ @ SafeVarargs public static < T > List < T > of ( T ... elements ) { } }
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 . format ( " msg " , " james " , new Date ( ) ) } < br > * The result is : Hello james , today is 2015-04-14. */ public String format ( String key , Object ... arguments ) { } }
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 addCustomHeader ( @ Nonnull @ Nonempty final String sKey , @ Nonnull final String sValue ) { } }
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 } . * @ return the compass direction for increasing the divider . */ private int mapDirection ( boolean isLeft ) { } }
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 MSICredentials getMSICredentials ( String managementEndpoint ) { } }
// 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 ) ; } else { // We are in a vm / container MSIConfigurationForVirtualMachine config = new MSIConfigurationForVirtualMachine ( managementEndpoint ) ; return forVirtualMachine ( 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 [ ] exceptionCallStack ) { } }
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 of the number . * - If the first digit in the number is 1 and its unit is 10 , the 1 is omitted . * - Sequences of 0 digits and their units are replaced by a single 0 and no unit . * - If there are two such sequences of 0 digits in a level ( 1000 ' s and 10 ' s ) , the 1000 ' s 0 is also omitted . * - The 1000 ' s 0 is also omitted in alternating levels , such that it is omitted in the rightmost * level with a 10 ' s 0 , or if none , in the rightmost level . * - Level symbols are omitted if all of their units are omitted */ public static String chineseNumber ( long n , ChineseDigits zh ) { } }
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 = String . valueOf ( n ) . toCharArray ( ) ; // first , generate all the digits in place // convert runs of zeros into a single zero , but keep places boolean inZero = true ; // true if we should zap zeros in this block , resets at start of block boolean forcedZero = false ; // true if we have a 0 in tens ' s place int x = buf . length ; for ( int i = digits . length , u = - 1 , l = - 1 ; -- i >= 0 ; ) { if ( u == - 1 ) { if ( l != - 1 ) { buf [ -- x ] = zh . levels [ l ] ; inZero = true ; forcedZero = false ; } ++ u ; } else { buf [ -- x ] = zh . units [ u ++ ] ; if ( u == 3 ) { u = - 1 ; ++ l ; } } int d = digits [ i ] - '0' ; if ( d == 0 ) { if ( x < buf . length - 1 && u != 0 ) { buf [ x ] = '*' ; } if ( inZero || forcedZero ) { buf [ -- x ] = '*' ; } else { buf [ -- x ] = zh . digits [ 0 ] ; inZero = true ; forcedZero = u == 1 ; } } else { inZero = false ; buf [ -- x ] = zh . digits [ d ] ; } } // scanning from right , find first required ' ling ' // we only care if n > 101,0000 as this is the first case where // it might shift . remove optional lings in alternating blocks . if ( n > 1000000 ) { boolean last = true ; int i = buf . length - 3 ; do { if ( buf [ i ] == '0' ) { break ; } i -= 8 ; last = ! last ; } while ( i > x ) ; i = buf . length - 7 ; do { if ( buf [ i ] == zh . digits [ 0 ] && ! last ) { buf [ i ] = '*' ; } i -= 8 ; last = ! last ; } while ( i > x ) ; // remove levels for empty blocks if ( n >= 100000000 ) { i = buf . length - 8 ; do { boolean empty = true ; for ( int j = i - 1 , e = Math . max ( x - 1 , i - 8 ) ; j > e ; -- j ) { if ( buf [ j ] != '*' ) { empty = false ; break ; } } if ( empty ) { if ( buf [ i + 1 ] != '*' && buf [ i + 1 ] != zh . digits [ 0 ] ) { buf [ i ] = zh . digits [ 0 ] ; } else { buf [ i ] = '*' ; } } i -= 8 ; } while ( i > x ) ; } } // replace er by liang except before or after shi or after ling for ( int i = x ; i < buf . length ; ++ i ) { if ( buf [ i ] != zh . digits [ 2 ] ) continue ; if ( i < buf . length - 1 && buf [ i + 1 ] == zh . units [ 0 ] ) continue ; if ( i > x && ( buf [ i - 1 ] == zh . units [ 0 ] || buf [ i - 1 ] == zh . digits [ 0 ] || buf [ i - 1 ] == '*' ) ) continue ; buf [ i ] = zh . liang ; } // eliminate leading 1 if following unit is shi if ( buf [ x ] == zh . digits [ 1 ] && ( zh . ko || buf [ x + 1 ] == zh . units [ 0 ] ) ) { ++ x ; } // now , compress out the ' * ' int w = x ; for ( int r = x ; r < buf . length ; ++ r ) { if ( buf [ r ] != '*' ) { buf [ w ++ ] = buf [ r ] ; } } return new String ( buf , x , w - x ) ;
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 a box that will be containing spied result * @ param param1 a box that will be containing the first spied parameter * @ param param2 a box that will be containing the second spied parameter * @ param param3 a box that will be containing the third spied parameter * @ return the proxied predicate */ public static < T1 , T2 , T3 > TriPredicate < T1 , T2 , T3 > spy ( TriPredicate < T1 , T2 , T3 > predicate , Box < Boolean > result , Box < T1 > param1 , Box < T2 > param2 , Box < T3 > param3 ) { } }
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 . Collection ) } if you want to * override the existing values . * @ param sourceInfo * A list of objects describing the source of the CloudFormation stack record . * @ return Returns a reference to this object so that method calls can be chained together . */ public CloudFormationStackRecord withSourceInfo ( CloudFormationStackRecordSourceInfo ... sourceInfo ) { } }
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 > parameters set to * { @ link DatatypeConstants # FIELD _ UNDEFINED } . * A { @ link DatatypeConstants # FIELD _ UNDEFINED } value indicates that field is * not set . * @ param nYear * Year to be created . * @ param nMonth * Month to be created . * @ param nDay * Day to be created . * @ param nTimezone * Offset in minutes . { @ link DatatypeConstants # FIELD _ UNDEFINED } * indicates optional field is not set . * @ return < code > XMLGregorianCalendar < / code > created from parameter values . * @ see DatatypeConstants # FIELD _ UNDEFINED * @ throws IllegalArgumentException * If any individual parameter ' s value is outside the maximum value * constraint for the field as determined by the Date / Time Data * Mapping table in { @ link XMLGregorianCalendar } or if the composite * values constitute an invalid < code > XMLGregorianCalendar < / code > * instance as determined by { @ link XMLGregorianCalendar # isValid ( ) } . */ @ Nonnull public static XMLGregorianCalendar getXMLCalendarDate ( final int nYear , final int nMonth , final int nDay , final int nTimezone ) { } }
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 UserContextResource . * @ throws GuacamoleException * If an error occurs while retrieving the SharingProfile Directory . */ @ Path ( "sharingProfiles" ) public DirectoryResource < SharingProfile , APISharingProfile > getSharingProfileDirectoryResource ( ) throws GuacamoleException { } }
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 ) throws PSQLException { } }
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 ) ; protocolMarshaller . marshall ( setStatusRequest . getStatus ( ) , STATUS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
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 messageParameters the ( optional ) message parameters * @ return a { @ link MessageResolution } object containing the resolved message , * { @ literal null } is returned when the resolver cannot retrieve a message for the given key . This policy is * compliant with the ( Thymeleaf ) standard message resolver . */ @ Override public MessageResolution resolveMessage ( Arguments arguments , String key , Object [ ] messageParameters ) { } }
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 ClassFilter # accept accept ( ) } method returns * < tt > true < / tt > ( implementing a " short - circuited OR " operation . ) < / p > * < p > If the set of contained filters is empty , then this method * returns < tt > true < / tt > . < / p > * @ param classInfo the { @ link com . poolik . classfinder . info . ClassInfo } object to test * @ return < tt > true < / tt > if the name matches , < tt > false < / tt > if it doesn ' t */ public boolean accept ( ClassInfo classInfo , ClassHierarchyResolver hierarchyResolver ) { } }
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 " ) * @ jsptagref . databindable false * @ jsptagref . attributesyntaxvalue < i > string _ imageLineLast < / i > * @ netui : attribute required = " false " rtexprvalue = " true " * description = " Sets the image name for a blank area of the tree . " */ public void setLastLineJoinImage ( String lastLineJoinImage ) { } }
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 */ public AlluxioURI getPath ( InodeView inode ) throws FileDoesNotExistException { } }
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 != null ) _id [ _sparseLen ] = _len ; _sparseLen ++ ; } _len ++ ; assert _sparseLen <= _len ;
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 " ) . * @ return the prepared statement . * @ throws NullPointerException when statement is null . */ public static PrepareStatement prepare ( String statement ) { } }
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 ( PREPARE_PREFIX , "" ) ; } // delegate to other factory method so that a name is generated return prepare ( new N1qlQuery . RawStatement ( statement ) ) ;
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 - > ExitBB */ private BasicBlock buildExitBasicBlock ( Stack < ExceptionRegion > nestedExceptionRegions , BasicBlock firstBB , List < BasicBlock > returnBBs , List < BasicBlock > exceptionBBs , boolean nextIsFallThrough , BasicBlock currBB , BasicBlock entryBB ) { } }
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 , exitBB , EdgeType . EXIT ) ; } if ( nextIsFallThrough ) graph . addEdge ( currBB , exitBB , EdgeType . EXIT ) ; return exitBB ;
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 . This includes nodes which have since been removed from the pool . If this API is invoked on a job which has no Job Preparation or Job Release task , the Batch service returns HTTP status code 409 ( Conflict ) with an error code of JobPreparationTaskNotSpecified . * @ param jobId The ID of the job . * @ param jobListPreparationAndReleaseTaskStatusOptions Additional parameters for the operation * @ throws IllegalArgumentException thrown if parameters fail the validation * @ throws BatchErrorException thrown if the request is rejected by server * @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @ return the PagedList & lt ; JobPreparationAndReleaseTaskExecutionInformation & gt ; object if successful . */ public PagedList < JobPreparationAndReleaseTaskExecutionInformation > listPreparationAndReleaseTaskStatus ( final String jobId , final JobListPreparationAndReleaseTaskStatusOptions jobListPreparationAndReleaseTaskStatusOptions ) { } }
ServiceResponseWithHeaders < Page < JobPreparationAndReleaseTaskExecutionInformation > , JobListPreparationAndReleaseTaskStatusHeaders > response = listPreparationAndReleaseTaskStatusSinglePageAsync ( jobId , jobListPreparationAndReleaseTaskStatusOptions ) . toBlocking ( ) . single ( ) ; return new PagedList < JobPreparationAndReleaseTaskExecutionInformation > ( response . body ( ) ) { @ Override public Page < JobPreparationAndReleaseTaskExecutionInformation > nextPage ( String nextPageLink ) { JobListPreparationAndReleaseTaskStatusNextOptions jobListPreparationAndReleaseTaskStatusNextOptions = null ; if ( jobListPreparationAndReleaseTaskStatusOptions != null ) { jobListPreparationAndReleaseTaskStatusNextOptions = new JobListPreparationAndReleaseTaskStatusNextOptions ( ) ; jobListPreparationAndReleaseTaskStatusNextOptions . withClientRequestId ( jobListPreparationAndReleaseTaskStatusOptions . clientRequestId ( ) ) ; jobListPreparationAndReleaseTaskStatusNextOptions . withReturnClientRequestId ( jobListPreparationAndReleaseTaskStatusOptions . returnClientRequestId ( ) ) ; jobListPreparationAndReleaseTaskStatusNextOptions . withOcpDate ( jobListPreparationAndReleaseTaskStatusOptions . ocpDate ( ) ) ; } return listPreparationAndReleaseTaskStatusNextSinglePageAsync ( nextPageLink , jobListPreparationAndReleaseTaskStatusNextOptions ) . toBlocking ( ) . single ( ) . body ( ) ; } } ;
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 void execute ( Collection < DeleteOp > deleteOps ) throws IOException { } }
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 . failedToDeleteBackup ( ) ; } } catch ( PrepareException pe ) { for ( DeleteOp deleteOp : deleteOps ) { deleteOp . rollback ( ) ; } throw PatchLogger . ROOT_LOGGER . failedToDelete ( pe . getPath ( ) ) ; }
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 ] " , " [ REGISTRY ] " ) ; * String gatewayId = " " ; * String deviceId = " " ; * UnbindDeviceFromGatewayResponse response = deviceManagerClient . unbindDeviceFromGateway ( parent , gatewayId , deviceId ) ; * < / code > < / pre > * @ param parent The name of the registry . For example , * ` projects / example - project / locations / us - central1 / registries / my - registry ` . * @ param gatewayId The value of ` gateway _ id ` can be either the device numeric ID or the * user - defined device identifier . * @ param deviceId The device to disassociate from the specified gateway . The value of ` device _ id ` * can be either the device numeric ID or the user - defined device identifier . * @ throws com . google . api . gax . rpc . ApiException if the remote call fails */ public final UnbindDeviceFromGatewayResponse unbindDeviceFromGateway ( RegistryName parent , String gatewayId , String deviceId ) { } }
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 API 24 and up . When used on a lower API version , * this method will return " unknown " . < / p > * @ return " 4G " , " 3G " , " 2G " , or " unknown " */ @ TargetApi ( 24 ) public String getMobileNetworkType ( ) { } }
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 TelephonyManager . NETWORK_TYPE_UMTS : case TelephonyManager . NETWORK_TYPE_EVDO_0 : case TelephonyManager . NETWORK_TYPE_EVDO_A : case TelephonyManager . NETWORK_TYPE_HSDPA : case TelephonyManager . NETWORK_TYPE_HSUPA : case TelephonyManager . NETWORK_TYPE_HSPA : case TelephonyManager . NETWORK_TYPE_EVDO_B : case TelephonyManager . NETWORK_TYPE_EHRPD : case TelephonyManager . NETWORK_TYPE_HSPAP : return "3G" ; case TelephonyManager . NETWORK_TYPE_GPRS : case TelephonyManager . NETWORK_TYPE_EDGE : case TelephonyManager . NETWORK_TYPE_CDMA : case TelephonyManager . NETWORK_TYPE_1xRTT : case TelephonyManager . NETWORK_TYPE_IDEN : return "2G" ; default : return resultUnknown ; }
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 not support the { @ link java . util . Map . Entry # setValue } method ; attempts to call that method with result * in an { @ link UnsupportedOperationException } being thrown . */ public Set < Map . Entry < List < K > , ClassicCounter < K > > > lowestLevelCounterEntrySet ( ) { } }
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 ( ) , CONTAINEROVERRIDES_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
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 ( protoRequest ) ;
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 HTML for all defined widgets of the named dialog ( page ) */ @ Override protected String createDialogHtml ( String dialog ) { } }
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 ( dialogBlockStart ( key ( Messages . GUI_USERDATA_EXPORT_LABEL_HINT_BLOCK_0 ) ) ) ; result . append ( key ( Messages . GUI_USERDATA_EXPORT_LABEL_HINT_TEXT_0 ) ) ; result . append ( dialogBlockEnd ( ) ) ; result . append ( dialogBlockStart ( key ( Messages . GUI_USERDATA_EXPORT_LABEL_GROUPS_BLOCK_0 ) ) ) ; result . append ( createWidgetTableStart ( ) ) ; result . append ( createDialogRowsHtml ( 0 , 0 ) ) ; result . append ( createWidgetTableEnd ( ) ) ; result . append ( dialogBlockEnd ( ) ) ; result . append ( dialogBlockStart ( key ( Messages . GUI_USERDATA_EXPORT_LABEL_ROLES_BLOCK_0 ) ) ) ; result . append ( createWidgetTableStart ( ) ) ; result . append ( createDialogRowsHtml ( 1 , 1 ) ) ; result . append ( createWidgetTableEnd ( ) ) ; result . append ( dialogBlockEnd ( ) ) ; } result . append ( createWidgetTableEnd ( ) ) ; return result . toString ( ) ;
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_ONE_SHOT ) ; // Construct notification . NotificationCompat . Builder builder = new NotificationCompat . Builder ( mContext ) ; Notification notification = builder . setSmallIcon ( R . drawable . wings__notification ) . setContentTitle ( wingsNotification . getTitle ( ) ) . setContentText ( wingsNotification . getMessage ( ) ) . setTicker ( wingsNotification . getTicker ( ) ) . setAutoCancel ( true ) . setWhen ( System . currentTimeMillis ( ) ) . setContentIntent ( pendingIntent ) . build ( ) ; // Send notification . NotificationManager notificationManager = ( NotificationManager ) getSystemService ( NOTIFICATION_SERVICE ) ; if ( notificationManager != null ) { notificationManager . notify ( wingsNotification . getId ( ) , notification ) ; }
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 target scheduled time . From this level , * we pick the split with the lowest priority . */ @ GuardedBy ( "lock" ) private PrioritizedSplitRunner pollSplit ( ) { } }
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 = levelTime == 0 ? 0 : targetScheduledTime / ( 1.0 * levelTime ) ; if ( selectedLevel == - 1 || ratio > worstRatio ) { worstRatio = ratio ; selectedLevel = level ; } } targetScheduledTime /= levelTimeMultiplier ; } if ( selectedLevel == - 1 ) { return null ; } PrioritizedSplitRunner result = levelWaitingSplits . get ( selectedLevel ) . poll ( ) ; checkState ( result != null , "pollSplit cannot return null" ) ; return result ;
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 * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / greengrass - 2017-06-07 / GetBulkDeploymentStatus " * target = " _ top " > AWS API Documentation < / a > */ @ Override public GetBulkDeploymentStatusResult getBulkDeploymentStatus ( GetBulkDeploymentStatusRequest request ) { } }
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 > ) * @ return the first matching commerce country * @ throws NoSuchCountryException if a matching commerce country could not be found */ @ Override public CommerceCountry findByUuid_C_First ( String uuid , long companyId , OrderByComparator < CommerceCountry > orderByComparator ) throws NoSuchCountryException { } }
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 ( ", companyId=" ) ; msg . append ( companyId ) ; msg . append ( "}" ) ; throw new NoSuchCountryException ( msg . toString ( ) ) ;
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 heartbeatInterval ) { } }
// 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 (interval: {})" , heartbeatInterval ) ; } else { websocket . sendClose ( WebSocketCloseReason . HEARTBEAT_NOT_PROPERLY_ANSWERED . getNumericCloseCode ( ) , WebSocketCloseReason . HEARTBEAT_NOT_PROPERLY_ANSWERED . getCloseReason ( ) ) ; } } catch ( Throwable t ) { logger . error ( "Failed to send heartbeat or close web socket!" , t ) ; } } , 0 , heartbeatInterval , TimeUnit . MILLISECONDS ) ;
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 ManagedPoolDataSource . * @ see # getConnection ( ) */ public Connection getConnection ( String user , String password ) throws SQLException { } }
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 && managedPassword == null ) ) || ( password != null && ! password . equals ( managedPassword ) ) ) { throw new SQLException ( "Connection pool manager user/password validation failed" ) ; } return getConnection ( ) ;
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 cacheDeserializedValues ) { } }
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 refreshed , false otherwise */ protected boolean checkForRefresh ( CacheItem item , List < CacheItem > itemsToRefresh ) { } }
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 returned by the service . * @ throws AuthorizationErrorException * The AWS user account does not have permission to perform the action . Check the IAM policy associated with * this account . * @ throws InvalidParameterException * One or more parameters are not valid . Verify the parameters and try again . * @ throws InvalidParameterValueException * The value of one or more parameters are either invalid or out of range . Verify the parameter values and * try again . * @ throws ServerInternalErrorException * The server experienced an internal error . Try again . * @ sample AWSApplicationDiscovery . GetDiscoverySummary */ @ Override public GetDiscoverySummaryResult getDiscoverySummary ( GetDiscoverySummaryRequest request ) { } }
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 ++ ] = i ; } } int [ ] rv = new int [ n ] ; System . arraycopy ( rvTmp , 0 , rv , 0 , n ) ; return rv ;
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 defaultValue * The default value . * @ return The value . */ public int optInt ( int index , int defaultValue ) { } }
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 * @ since 1.1.2 */ public static byte [ ] writeImageToBytes ( BufferedImage image , String formatName , Float quality ) throws IOException { } }
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 will be wrapped in * a new SessionServiceException with the detail message . * @ param cause the Throwable to convert * @ param interfaceClass * @ param message the specified detail message * @ return a SessionServiceException */ public static SessionServiceException fromThrowable ( Class interfaceClass , String message , Throwable cause ) { } }
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 containerPort of ' 0 ' as a fallback . */ private static int getPort ( Service service , Annotation ... qualifiers ) { } }
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 , @ PathParam ( "gavc" ) final String gavc , @ QueryParam ( ServerAPI . DO_NOT_USE ) final BooleanParam doNotUse , final String commentText ) { } }
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 comment for artifact if available getCommentHandler ( ) . store ( gavc , doNotUse . get ( ) ? "mark as DO_NOT_USE" : "cleared DO_NOT_USE flag" , commentText , credential , DbArtifact . class . getSimpleName ( ) ) ; getArtifactHandler ( ) . updateDoNotUse ( gavc , doNotUse . get ( ) ) ; return Response . ok ( "done" ) . build ( ) ;
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 denominator ) { } }
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 ( ) , Vec . T_NUM , fr ) . outputFrame ( fr . _names , null ) ; return cleanCategorical ( fr , res ) ; // Cleanup categorical misuse
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 . parseInt ( pcs [ 1 ] ) ; cal . set ( Calendar . SECOND , frac % 60 ) ; frac /= 60 ; cal . set ( Calendar . MINUTE , frac % 60 ) ; frac /= 60 ; cal . set ( Calendar . HOUR , frac ) ; } setTime ( cal . getTimeInMillis ( ) ) ;
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 . length ) return false ; for ( int i = 0 ; i < dataPath . length ; i ++ ) { if ( ! dataPath [ i ] . equals ( otherPath [ i ] ) ) return false ; } return true ;
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 ( ResilienceStrategy < K , V > resilienceStrategy ) { } }
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 polling strategy or custom polling strategy . */ public Waiter < DescribeImagesRequest > imageExists ( ) { } }
return new WaiterBuilder < DescribeImagesRequest , DescribeImagesResult > ( ) . withSdkFunction ( new DescribeImagesFunction ( client ) ) . withAcceptors ( new ImageExists . IsTrueMatcher ( ) , new ImageExists . IsInvalidAMIIDNotFoundMatcher ( ) ) . withDefaultPollingStrategy ( new PollingStrategy ( new MaxAttemptsRetryStrategy ( 40 ) , new FixedDelayStrategy ( 15 ) ) ) . withExecutorService ( executorService ) . build ( ) ;
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 ( selectedIoThread == null || load < minLoad ) { minLoad = load ; selectedIoThread = ioThreads . get ( i ) ; } } } return selectedIoThread ;
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 image . Can be either input . Modified . */ public static void diffAbs ( GrayU8 imgA , GrayU8 imgB , GrayU8 output ) { } }
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 < / code > state from any other state . * Each action is specified as an Amazon Resource Name ( ARN ) . */ public void setAlarmActions ( java . util . Collection < String > alarmActions ) { } }
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 ( ) ;