signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class DatasourceJBossASClient { /** * Checks to see if there is already a XA datasource with the given name . * @ param datasourceName the name to check * @ return true if there is a XA datasource with the given name already in existence * @ throws Exception any error */ public boolean isXADatasource ( String datasourceName ) throws Exception { } }
Address addr = Address . root ( ) . add ( SUBSYSTEM , SUBSYSTEM_DATASOURCES ) ; String haystack = XA_DATA_SOURCE ; return null != findNodeInList ( addr , haystack , datasourceName ) ;
public class MtasSolrComponentDocument { /** * ( non - Javadoc ) * @ see * mtas . solr . handler . component . util . MtasSolrComponent # modifyRequest ( org . apache * . solr . handler . component . ResponseBuilder , * org . apache . solr . handler . component . SearchComponent , * org . apache . solr . handler . component . ShardRequest ) */ public void modifyRequest ( ResponseBuilder rb , SearchComponent who , ShardRequest sreq ) { } }
if ( sreq . params . getBool ( MtasSolrSearchComponent . PARAM_MTAS , false ) && sreq . params . getBool ( PARAM_MTAS_DOCUMENT , false ) ) { if ( ( sreq . purpose & ShardRequest . PURPOSE_GET_FIELDS ) != 0 ) { // do nothing } else { Set < String > keys = MtasSolrResultUtil . getIdsFromParameters ( rb . req . getParams ( ) , PARAM_MTAS_DOCUMENT ) ; sreq . params . remove ( PARAM_MTAS_DOCUMENT ) ; for ( String key : keys ) { sreq . params . remove ( PARAM_MTAS_DOCUMENT + "." + key + "." + NAME_MTAS_DOCUMENT_FIELD ) ; sreq . params . remove ( PARAM_MTAS_DOCUMENT + "." + key + "." + NAME_MTAS_DOCUMENT_KEY ) ; sreq . params . remove ( PARAM_MTAS_DOCUMENT + "." + key + "." + NAME_MTAS_DOCUMENT_PREFIX ) ; } } }
public class FlowLoaderUtils { /** * Clean up the directory . * @ param dir the directory to be deleted */ public static void cleanUpDir ( final File dir ) { } }
try { if ( dir != null && dir . exists ( ) ) { FileUtils . deleteDirectory ( dir ) ; } } catch ( final IOException e ) { logger . error ( "Failed to delete the directory" , e ) ; dir . deleteOnExit ( ) ; }
public class NotificationHubsInner { /** * Gets the authorization rules for a NotificationHub . * @ param nextPageLink The NextLink from the previous successful call to List operation . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ throws CloudException thrown if the request is rejected by server * @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @ return the PagedList & lt ; SharedAccessAuthorizationRuleResourceInner & gt ; object if successful . */ public PagedList < SharedAccessAuthorizationRuleResourceInner > listAuthorizationRulesNext ( final String nextPageLink ) { } }
ServiceResponse < Page < SharedAccessAuthorizationRuleResourceInner > > response = listAuthorizationRulesNextSinglePageAsync ( nextPageLink ) . toBlocking ( ) . single ( ) ; return new PagedList < SharedAccessAuthorizationRuleResourceInner > ( response . body ( ) ) { @ Override public Page < SharedAccessAuthorizationRuleResourceInner > nextPage ( String nextPageLink ) { return listAuthorizationRulesNextSinglePageAsync ( nextPageLink ) . toBlocking ( ) . single ( ) . body ( ) ; } } ;
public class NotificationHubsInner { /** * Deletes a notificationHub authorization rule . * @ param resourceGroupName The name of the resource group . * @ param namespaceName The namespace name . * @ param notificationHubName The notification hub name . * @ param authorizationRuleName Authorization Rule Name . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the { @ link ServiceResponse } object if successful . */ public Observable < ServiceResponse < Void > > deleteAuthorizationRuleWithServiceResponseAsync ( String resourceGroupName , String namespaceName , String notificationHubName , String authorizationRuleName ) { } }
if ( resourceGroupName == null ) { throw new IllegalArgumentException ( "Parameter resourceGroupName is required and cannot be null." ) ; } if ( namespaceName == null ) { throw new IllegalArgumentException ( "Parameter namespaceName is required and cannot be null." ) ; } if ( notificationHubName == null ) { throw new IllegalArgumentException ( "Parameter notificationHubName is required and cannot be null." ) ; } if ( authorizationRuleName == null ) { throw new IllegalArgumentException ( "Parameter authorizationRuleName is required and cannot be null." ) ; } if ( this . client . subscriptionId ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.subscriptionId() is required and cannot be null." ) ; } if ( this . client . apiVersion ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.apiVersion() is required and cannot be null." ) ; } return service . deleteAuthorizationRule ( resourceGroupName , namespaceName , notificationHubName , authorizationRuleName , this . client . subscriptionId ( ) , this . client . apiVersion ( ) , this . client . acceptLanguage ( ) , this . client . userAgent ( ) ) . flatMap ( new Func1 < Response < ResponseBody > , Observable < ServiceResponse < Void > > > ( ) { @ Override public Observable < ServiceResponse < Void > > call ( Response < ResponseBody > response ) { try { ServiceResponse < Void > clientResponse = deleteAuthorizationRuleDelegate ( response ) ; return Observable . just ( clientResponse ) ; } catch ( Throwable t ) { return Observable . error ( t ) ; } } } ) ;
public class FoxHttpClient { /** * Register an interceptor * @ param interceptorType Type of the interceptor * @ param foxHttpInterceptor Interceptor instance * @ throws FoxHttpException Throws an exception if the interceptor does not match the type */ public void register ( FoxHttpInterceptorType interceptorType , FoxHttpInterceptor foxHttpInterceptor ) throws FoxHttpException { } }
FoxHttpInterceptorType . verifyInterceptor ( interceptorType , foxHttpInterceptor ) ; if ( foxHttpInterceptors . containsKey ( interceptorType ) ) { foxHttpInterceptors . get ( interceptorType ) . add ( foxHttpInterceptor ) ; } else { foxHttpInterceptors . put ( interceptorType , new ArrayList < > ( Arrays . asList ( foxHttpInterceptor ) ) ) ; }
public class RequestHttp1 { /** * Handles a timeout . */ @ Override public void onTimeout ( ) { } }
try { // request ( ) . sendError ( WebRequest . INTERNAL _ SERVER _ ERROR ) ; if ( true ) throw new UnsupportedOperationException ( ) ; } catch ( Exception e ) { log . log ( Level . FINEST , e . toString ( ) , e ) ; } closeResponse ( ) ;
public class ParsedSelectStmt { /** * Read the schema from the XML . Add the parsed columns to the * list of columns . One might think this is the same as * AbstractParsedStmt . parseTable , but it is not . That function * parses a statement scan from a join expression , not a * table schema . */ private void parseTableSchemaFromXML ( String tableName , StmtCommonTableScanShared tableScan , VoltXMLElement voltXMLElement ) { } }
assert ( "table" . equals ( voltXMLElement . name ) ) ; List < VoltXMLElement > columnSet = voltXMLElement . findChildren ( "columns" ) ; assert ( columnSet . size ( ) == 1 ) ; columnSet = columnSet . get ( 0 ) . children ; for ( int idx = 0 ; idx < columnSet . size ( ) ; idx += 1 ) { VoltXMLElement columnXML = columnSet . get ( idx ) ; assert ( "column" . equals ( columnXML . name ) ) ; String columnName = columnXML . attributes . get ( "name" ) ; // If valuetype is not defined , then we will get type // " none " , about which typeFromString will complain . // Note that the types may be widened from the type // of the base query of a recursive common table . This // happens if the corresponding type in the recursive // query is wider than that of the base case . But // HSQL will have taken care of this for us , so we // will not see the widening here . VoltType valueType = VoltType . typeFromString ( columnXML . getStringAttribute ( "valuetype" , "none" ) ) ; Integer columnIndex = columnXML . getIntAttribute ( "index" , null ) ; assert ( columnIndex != null ) ; // These appear to be optional . Certainly " bytes " // only appears if the type is variably sized . Integer size = columnXML . getIntAttribute ( "size" , 0 ) ; Boolean inBytes = columnXML . getBoolAttribute ( "bytes" , null ) ; // This TVE holds the metadata . TupleValueExpression tve = new TupleValueExpression ( tableName , tableName , columnName , columnName , columnIndex ) ; tve . setValueType ( valueType ) ; tve . setDifferentiator ( idx ) ; if ( size == 0 ) { if ( valueType . isVariableLength ( ) ) { size = valueType . defaultLengthForVariableLengthType ( ) ; } else { size = valueType . getLengthInBytesForFixedTypes ( ) ; } } tve . setValueSize ( size ) ; if ( inBytes != null ) { tve . setInBytes ( inBytes ) ; } // There really is no aliasing going on here , so the table // name and column name are the same as the table alias and // column alias . SchemaColumn schemaColumn = new SchemaColumn ( tableName , tableName , columnName , columnName , tve , idx ) ; tableScan . addOutputColumn ( schemaColumn ) ; }
public class PubType { /** * getter for pubDate - gets The date on which the document was published , O * @ generated * @ return value of the feature */ public Date getPubDate ( ) { } }
if ( PubType_Type . featOkTst && ( ( PubType_Type ) jcasType ) . casFeat_pubDate == null ) jcasType . jcas . throwFeatMissing ( "pubDate" , "de.julielab.jules.types.PubType" ) ; return ( Date ) ( jcasType . ll_cas . ll_getFSForRef ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( PubType_Type ) jcasType ) . casFeatCode_pubDate ) ) ) ;
public class Stock { /** * Requests the historical splits for this stock with the following characteristics . * < ul > * < li > from : specified value * < li > to : specified value * < / ul > * @ param from start date of the historical data * @ param to end date of the historical data * @ return a list of historical splits from this stock * @ throws java . io . IOException when there ' s a connection problem * @ see # getSplitHistory ( ) */ public List < HistoricalSplit > getSplitHistory ( Calendar from , Calendar to ) throws IOException { } }
if ( YahooFinance . HISTQUOTES2_ENABLED . equalsIgnoreCase ( "true" ) ) { HistSplitsRequest histSplit = new HistSplitsRequest ( this . symbol , from , to ) ; this . setSplitHistory ( histSplit . getResult ( ) ) ; } else { // Historical splits cannot be retrieved without CRUMB this . setSplitHistory ( null ) ; } return this . splitHistory ;
public class TimeExpression { /** * Create a hours expression ( range 0-23) * @ return hour */ public NumberExpression < Integer > hour ( ) { } }
if ( hours == null ) { hours = Expressions . numberOperation ( Integer . class , Ops . DateTimeOps . HOUR , mixin ) ; } return hours ;
public class SarlSkillBuilderImpl { /** * Add a modifier . * @ param modifier the modifier to add . */ public void addModifier ( String modifier ) { } }
if ( ! Strings . isEmpty ( modifier ) ) { this . sarlSkill . getModifiers ( ) . add ( modifier ) ; }
public class AmazonPinpointClient { /** * Returns information about an export job . * @ param getExportJobRequest * @ return Result of the GetExportJob operation returned by the service . * @ throws BadRequestException * 400 response * @ throws InternalServerErrorException * 500 response * @ throws ForbiddenException * 403 response * @ throws NotFoundException * 404 response * @ throws MethodNotAllowedException * 405 response * @ throws TooManyRequestsException * 429 response * @ sample AmazonPinpoint . GetExportJob * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / pinpoint - 2016-12-01 / GetExportJob " target = " _ top " > AWS API * Documentation < / a > */ @ Override public GetExportJobResult getExportJob ( GetExportJobRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeGetExportJob ( request ) ;
public class SARLProjectConfigurator { /** * Read the SARL configuration . * @ param request the configuration request . * @ param monitor the monitor . * @ return the SARL configuration . * @ throws CoreException if something wrong appends . */ protected SARLConfiguration readConfiguration ( ProjectConfigurationRequest request , IProgressMonitor monitor ) throws CoreException { } }
SARLConfiguration initConfig = null ; SARLConfiguration compileConfig = null ; final List < MojoExecution > mojos = getMojoExecutions ( request , monitor ) ; for ( final MojoExecution mojo : mojos ) { final String goal = mojo . getGoal ( ) ; switch ( goal ) { case "initialize" : // $ NON - NLS - 1 $ initConfig = readInitializeConfiguration ( request , mojo , monitor ) ; break ; case "compile" : // $ NON - NLS - 1 $ compileConfig = readCompileConfiguration ( request , mojo , monitor ) ; break ; default : } } if ( compileConfig != null && initConfig != null ) { compileConfig . setFrom ( initConfig ) ; } return compileConfig ;
public class Years { /** * Obtains an instance of < code > Years < / code > that may be cached . * < code > Years < / code > is immutable , so instances can be cached and shared . * This factory method provides access to shared instances . * @ param years the number of years to obtain an instance for * @ return the instance of Years */ public static Years years ( int years ) { } }
switch ( years ) { case 0 : return ZERO ; case 1 : return ONE ; case 2 : return TWO ; case 3 : return THREE ; case Integer . MAX_VALUE : return MAX_VALUE ; case Integer . MIN_VALUE : return MIN_VALUE ; default : return new Years ( years ) ; }
public class NexusSearch { /** * Do a preflight request to see if the repository is actually working . * @ return whether the repository is listening and returns the / status URL * correctly */ public boolean preflightRequest ( ) { } }
final HttpURLConnection conn ; try { final URL url = new URL ( rootURL , "status" ) ; final URLConnectionFactory factory = new URLConnectionFactory ( settings ) ; conn = factory . createHttpURLConnection ( url , useProxy ) ; conn . addRequestProperty ( "Accept" , "application/xml" ) ; final String authHeader = buildHttpAuthHeaderValue ( ) ; if ( ! authHeader . isEmpty ( ) ) { conn . addRequestProperty ( "Authorization" , authHeader ) ; } conn . connect ( ) ; if ( conn . getResponseCode ( ) != 200 ) { LOGGER . warn ( "Expected 200 result from Nexus, got {}" , conn . getResponseCode ( ) ) ; return false ; } final DocumentBuilder builder = XmlUtils . buildSecureDocumentBuilder ( ) ; final Document doc = builder . parse ( conn . getInputStream ( ) ) ; if ( ! "status" . equals ( doc . getDocumentElement ( ) . getNodeName ( ) ) ) { LOGGER . warn ( "Expected root node name of status, got {}" , doc . getDocumentElement ( ) . getNodeName ( ) ) ; return false ; } } catch ( IOException | ParserConfigurationException | SAXException e ) { return false ; } return true ;
public class SubjectUtils { /** * Returns a new collection containing all elements in { @ code items } for which there exists at * least one element in { @ code itemsToCheck } that has the same { @ code toString ( ) } value without * being equal . * < p > Example : { @ code retainMatchingToString ( [ 1L , 2L , 2L ] , [ 2 , 3 ] ) = = [ 2L , 2L ] } */ static List < Object > retainMatchingToString ( Iterable < ? > items , Iterable < ? > itemsToCheck ) { } }
SetMultimap < String , Object > stringValueToItemsToCheck = HashMultimap . create ( ) ; for ( Object itemToCheck : itemsToCheck ) { stringValueToItemsToCheck . put ( String . valueOf ( itemToCheck ) , itemToCheck ) ; } List < Object > result = Lists . newArrayList ( ) ; for ( Object item : items ) { for ( Object itemToCheck : stringValueToItemsToCheck . get ( String . valueOf ( item ) ) ) { if ( ! Objects . equal ( itemToCheck , item ) ) { result . add ( item ) ; break ; } } } return result ;
public class ns_cluster { /** * < pre > * Performs generic data validation for the operation to be performed * < / pre > */ protected void validate ( String operationType ) throws Exception { } }
super . validate ( operationType ) ; MPSIPAddress ipaddress_validator = new MPSIPAddress ( ) ; ipaddress_validator . validate ( operationType , ipaddress , "\"ipaddress\"" ) ; MPSIPAddress clip_validator = new MPSIPAddress ( ) ; clip_validator . validate ( operationType , clip , "\"clip\"" ) ; MPSInt nodeid_validator = new MPSInt ( ) ; nodeid_validator . setConstraintMinValue ( MPSConstants . GENERIC_CONSTRAINT , 0 ) ; nodeid_validator . setConstraintMaxValue ( MPSConstants . GENERIC_CONSTRAINT , 31 ) ; nodeid_validator . validate ( operationType , nodeid , "\"nodeid\"" ) ; MPSInt clusterid_validator = new MPSInt ( ) ; clusterid_validator . setConstraintMinValue ( MPSConstants . GENERIC_CONSTRAINT , 1 ) ; clusterid_validator . setConstraintMaxValue ( MPSConstants . GENERIC_CONSTRAINT , 16 ) ; clusterid_validator . validate ( operationType , clusterid , "\"clusterid\"" ) ; MPSString password_validator = new MPSString ( ) ; password_validator . setConstraintMaxStrLen ( MPSConstants . GENERIC_CONSTRAINT , 128 ) ; password_validator . setConstraintMinStrLen ( MPSConstants . GENERIC_CONSTRAINT , 1 ) ; password_validator . validate ( operationType , password , "\"password\"" ) ; MPSBoolean iscco_validator = new MPSBoolean ( ) ; iscco_validator . validate ( operationType , iscco , "\"iscco\"" ) ; MPSString backplane_validator = new MPSString ( ) ; backplane_validator . setConstraintMaxStrLen ( MPSConstants . GENERIC_CONSTRAINT , 32 ) ; backplane_validator . setConstraintMinStrLen ( MPSConstants . GENERIC_CONSTRAINT , 1 ) ; backplane_validator . validate ( operationType , backplane , "\"backplane\"" ) ; MPSString health_validator = new MPSString ( ) ; health_validator . setConstraintMaxStrLen ( MPSConstants . GENERIC_CONSTRAINT , 32 ) ; health_validator . setConstraintMinStrLen ( MPSConstants . GENERIC_CONSTRAINT , 1 ) ; health_validator . validate ( operationType , health , "\"health\"" ) ; MPSString state_validator = new MPSString ( ) ; state_validator . setConstraintMaxStrLen ( MPSConstants . GENERIC_CONSTRAINT , 32 ) ; state_validator . setConstraintMinStrLen ( MPSConstants . GENERIC_CONSTRAINT , 1 ) ; state_validator . validate ( operationType , state , "\"state\"" ) ; MPSIPAddress clviewleader_validator = new MPSIPAddress ( ) ; clviewleader_validator . validate ( operationType , clviewleader , "\"clviewleader\"" ) ; MPSDouble clbkplanerx_validator = new MPSDouble ( ) ; clbkplanerx_validator . validate ( operationType , clbkplanerx , "\"clbkplanerx\"" ) ; MPSDouble clbkplanetx_validator = new MPSDouble ( ) ; clbkplanetx_validator . validate ( operationType , clbkplanetx , "\"clbkplanetx\"" ) ; MPSDouble clbkplanerxrate_validator = new MPSDouble ( ) ; clbkplanerxrate_validator . validate ( operationType , clbkplanerxrate , "\"clbkplanerxrate\"" ) ; MPSDouble clbkplanetxrate_validator = new MPSDouble ( ) ; clbkplanetxrate_validator . validate ( operationType , clbkplanetxrate , "\"clbkplanetxrate\"" ) ; MPSDouble totsteeredpkts_validator = new MPSDouble ( ) ; totsteeredpkts_validator . validate ( operationType , totsteeredpkts , "\"totsteeredpkts\"" ) ; MPSDouble numdfddroppkts_validator = new MPSDouble ( ) ; numdfddroppkts_validator . validate ( operationType , numdfddroppkts , "\"numdfddroppkts\"" ) ; MPSDouble totpropagationtimeout_validator = new MPSDouble ( ) ; totpropagationtimeout_validator . validate ( operationType , totpropagationtimeout , "\"totpropagationtimeout\"" ) ; MPSString clcurstatus_validator = new MPSString ( ) ; clcurstatus_validator . validate ( operationType , clcurstatus , "\"clcurstatus\"" ) ; MPSInt clnumnodes_validator = new MPSInt ( ) ; clnumnodes_validator . setConstraintMinValue ( MPSConstants . GENERIC_CONSTRAINT , 0 ) ; clnumnodes_validator . setConstraintMaxValue ( MPSConstants . GENERIC_CONSTRAINT , 32 ) ; clnumnodes_validator . validate ( operationType , clnumnodes , "\"clnumnodes\"" ) ; MPSDouble cpu_usage_validator = new MPSDouble ( ) ; cpu_usage_validator . validate ( operationType , cpu_usage , "\"cpu_usage\"" ) ; MPSDouble mgmt_cpu_usage_validator = new MPSDouble ( ) ; mgmt_cpu_usage_validator . validate ( operationType , mgmt_cpu_usage , "\"mgmt_cpu_usage\"" ) ; MPSDouble memory_usage_validator = new MPSDouble ( ) ; memory_usage_validator . validate ( operationType , memory_usage , "\"memory_usage\"" ) ; MPSDouble tx_validator = new MPSDouble ( ) ; tx_validator . validate ( operationType , tx , "\"tx\"" ) ; MPSDouble rx_validator = new MPSDouble ( ) ; rx_validator . validate ( operationType , rx , "\"rx\"" ) ; MPSDouble http_req_validator = new MPSDouble ( ) ; http_req_validator . validate ( operationType , http_req , "\"http_req\"" ) ; MPSString profile_name_validator = new MPSString ( ) ; profile_name_validator . setConstraintCharSetRegEx ( MPSConstants . GENERIC_CONSTRAINT , "[ a-zA-Z0-9_#.:@=-]+" ) ; profile_name_validator . setConstraintMaxStrLen ( MPSConstants . GENERIC_CONSTRAINT , 128 ) ; profile_name_validator . validate ( operationType , profile_name , "\"profile_name\"" ) ; MPSString clnodes_validator = new MPSString ( ) ; clnodes_validator . validate ( operationType , clnodes , "\"clnodes\"" ) ; MPSString act_id_validator = new MPSString ( ) ; act_id_validator . validate ( operationType , act_id , "\"act_id\"" ) ; MPSString operationalstate_validator = new MPSString ( ) ; operationalstate_validator . validate ( operationType , operationalstate , "\"operationalstate\"" ) ;
public class EasyPredictModelWrapper { /** * Make a prediction on a new data point using a Ordinal model . * @ param data A new data point . * @ param offset Prediction offset * @ return The prediction . * @ throws PredictException */ public OrdinalModelPrediction predictOrdinal ( RowData data , double offset ) throws PredictException { } }
double [ ] preds = preamble ( ModelCategory . Ordinal , data , offset ) ; OrdinalModelPrediction p = new OrdinalModelPrediction ( ) ; p . classProbabilities = new double [ m . getNumResponseClasses ( ) ] ; p . labelIndex = ( int ) preds [ 0 ] ; String [ ] domainValues = m . getDomainValues ( m . getResponseIdx ( ) ) ; p . label = domainValues [ p . labelIndex ] ; System . arraycopy ( preds , 1 , p . classProbabilities , 0 , p . classProbabilities . length ) ; return p ;
public class AmBaseSpout { /** * Use only MessageKey ( Use key history ' s value ) and not use MessageId ( Id identify by storm ) . < br > * Send message to downstream component . < br > * Use following situation . * < ol > * < li > Use this class ' s key history function . < / li > * < li > Not use storm ' s fault detect function . < / li > * < / ol > * @ param message sending message * @ param messageKey MessageKey ( Use key history ' s value ) */ protected void emitWithOnlyKey ( StreamMessage message , Object messageKey ) { } }
if ( this . recordHistory ) { message . getHeader ( ) . addHistory ( messageKey . toString ( ) ) ; } this . getCollector ( ) . emit ( new Values ( "" , message ) ) ;
public class SmilesParser { /** * Parses CXSMILES layer and set attributes for atoms and bonds on the provided reaction . * @ param title SMILES title field * @ param rxn parsed reaction */ private void parseRxnCXSMILES ( String title , IReaction rxn ) { } }
CxSmilesState cxstate ; int pos ; if ( title != null && title . startsWith ( "|" ) ) { if ( ( pos = CxSmilesParser . processCx ( title , cxstate = new CxSmilesState ( ) ) ) >= 0 ) { // set the correct title rxn . setProperty ( CDKConstants . TITLE , title . substring ( pos ) ) ; final Map < IAtom , IAtomContainer > atomToMol = new HashMap < > ( 100 ) ; final List < IAtom > atoms = new ArrayList < > ( ) ; handleFragmentGrouping ( rxn , cxstate ) ; // merge all together for ( IAtomContainer mol : rxn . getReactants ( ) . atomContainers ( ) ) { for ( IAtom atom : mol . atoms ( ) ) { atoms . add ( atom ) ; atomToMol . put ( atom , mol ) ; } } for ( IAtomContainer mol : rxn . getAgents ( ) . atomContainers ( ) ) { for ( IAtom atom : mol . atoms ( ) ) { atoms . add ( atom ) ; atomToMol . put ( atom , mol ) ; } } for ( IAtomContainer mol : rxn . getProducts ( ) . atomContainers ( ) ) { for ( IAtom atom : mol . atoms ( ) ) { atoms . add ( atom ) ; atomToMol . put ( atom , mol ) ; } } assignCxSmilesInfo ( rxn . getBuilder ( ) , rxn , atoms , atomToMol , cxstate ) ; } }
public class IndexedSet { /** * { @ inheritDoc } */ @ Override public int compareTo ( ExtendedSet < T > o ) { } }
return indices . compareTo ( convert ( o ) . indices ) ;
public class CmsTinyMceToolbarHelper { /** * Returns the context menu entries according to the configured tool - bar items . < p > * @ param barItems the tool - bar items * @ return the context menu entries */ public static String getContextMenuEntries ( List < String > barItems ) { } }
String result = "" ; if ( barItems . contains ( "link" ) ) { result += translateButton ( "link" ) ; } if ( barItems . contains ( "downloadgallery" ) ) { result += " " + translateButton ( "downloadgallery" ) ; } if ( barItems . contains ( "imagegallery" ) ) { result += " " + translateButton ( "imagegallery" ) ; } if ( barItems . contains ( "table" ) ) { result += " inserttable | cell row column deletetable" ; } return result . trim ( ) ;
public class WaveformGenerator { /** * SID reset . */ public void reset ( ) { } }
accumulator = 0 ; if ( ANTTI_LANKILA_PATCH ) shift_register = 0x7ffffc ; else shift_register = 0x7ffff8 ; freq = 0 ; pw = 0 ; test = 0 ; ring_mod = 0 ; sync = 0 ; msb_rising = false ;
public class WalletNameResolver { /** * Resolve a Wallet Name URL Endpoint * @ param url Wallet Name URL Endpoint * @ param verifyTLSA Do TLSA validation for URL Endpoint ? * @ return String data value returned by URL Endpoint * @ throws WalletNameLookupException Wallet Name Address Service URL Processing Failure */ public BitcoinURI processWalletNameUrl ( URL url , boolean verifyTLSA ) throws WalletNameLookupException { } }
HttpsURLConnection conn = null ; InputStream ins ; InputStreamReader isr ; BufferedReader in = null ; Certificate possibleRootCert = null ; if ( verifyTLSA ) { try { if ( ! this . tlsaValidator . validateTLSA ( url ) ) { throw new WalletNameTlsaValidationException ( "TLSA Validation Failed" ) ; } } catch ( ValidSelfSignedCertException ve ) { // TLSA Uses a Self - Signed Root Cert , We Need to Add to CACerts possibleRootCert = ve . getRootCert ( ) ; } catch ( Exception e ) { throw new WalletNameTlsaValidationException ( "TLSA Validation Failed" , e ) ; } } try { conn = ( HttpsURLConnection ) url . openConnection ( ) ; // If we have a self - signed cert returned during TLSA Validation , add it to the SSLContext for the HTTPS Connection if ( possibleRootCert != null ) { try { KeyStore ssKeystore = KeyStore . getInstance ( KeyStore . getDefaultType ( ) ) ; ssKeystore . load ( null , null ) ; ssKeystore . setCertificateEntry ( ( ( X509Certificate ) possibleRootCert ) . getSubjectDN ( ) . toString ( ) , possibleRootCert ) ; TrustManagerFactory tmf = TrustManagerFactory . getInstance ( TrustManagerFactory . getDefaultAlgorithm ( ) ) ; tmf . init ( ssKeystore ) ; SSLContext ctx = SSLContext . getInstance ( "TLS" ) ; ctx . init ( null , tmf . getTrustManagers ( ) , null ) ; conn . setSSLSocketFactory ( ctx . getSocketFactory ( ) ) ; } catch ( Exception e ) { throw new WalletNameTlsaValidationException ( "Failed to Add TLSA Self Signed Certificate to HttpsURLConnection" , e ) ; } } ins = conn . getInputStream ( ) ; isr = new InputStreamReader ( ins ) ; in = new BufferedReader ( isr ) ; String inputLine ; String data = "" ; while ( ( inputLine = in . readLine ( ) ) != null ) { data += inputLine ; } try { return new BitcoinURI ( data ) ; } catch ( BitcoinURIParseException e ) { throw new WalletNameLookupException ( "Unable to create BitcoinURI" , e ) ; } } catch ( IOException e ) { throw new WalletNameURLFailedException ( "WalletName URL Connection Failed" , e ) ; } finally { if ( conn != null && in != null ) { try { in . close ( ) ; } catch ( IOException e ) { // Do Nothing } conn . disconnect ( ) ; } }
public class MathFunctions { /** * < div color = ' red ' style = " font - size : 24px ; color : red " > < b > < i > < u > JCYPHER < / u > < / i > < / b > < / div > * < div color = ' red ' style = " font - size : 18px ; color : red " > < i > return the square root of a number . < / i > < / div > * < div color = ' red ' style = " font - size : 18px ; color : red " > < i > The number argument is the one to which this function is appended , < / i > < / div > * < div color = ' red ' style = " font - size : 18px ; color : red " > < i > in accordance to a post - fix notation . < / i > < / div > * < div color = ' red ' style = " font - size : 18px ; color : red " > < i > e . g . < b > n . numberProperty ( " number " ) . math ( ) . sqrt ( ) < / b > < / i > < / div > * < br / > */ public JcNumber sqrt ( ) { } }
JcNumber ret = new JcNumber ( null , this . argument , new FunctionInstance ( FUNCTION . Math . SQRT , 1 ) ) ; QueryRecorder . recordInvocationConditional ( this , "sqrt" , ret ) ; return ret ;
public class JavaScriptEscape { /** * Perform a JavaScript level 1 ( only basic set ) < strong > escape < / strong > operation * on a < tt > char [ ] < / tt > input . * < em > Level 1 < / em > means this method will only escape the JavaScript basic escape set : * < ul > * < li > The < em > Single Escape Characters < / em > : * < tt > & # 92;0 < / tt > ( < tt > U + 0000 < / tt > ) , * < tt > & # 92 ; b < / tt > ( < tt > U + 0008 < / tt > ) , * < tt > & # 92 ; t < / tt > ( < tt > U + 0009 < / tt > ) , * < tt > & # 92 ; n < / tt > ( < tt > U + 000A < / tt > ) , * < tt > & # 92 ; v < / tt > ( < tt > U + 000B < / tt > ) , * < tt > & # 92 ; f < / tt > ( < tt > U + 000C < / tt > ) , * < tt > & # 92 ; r < / tt > ( < tt > U + 000D < / tt > ) , * < tt > & # 92 ; & quot ; < / tt > ( < tt > U + 0022 < / tt > ) , * < tt > & # 92 ; & # 39 ; < / tt > ( < tt > U + 0027 < / tt > ) , * < tt > & # 92 ; & # 92 ; < / tt > ( < tt > U + 005C < / tt > ) and * < tt > & # 92 ; & # 47 ; < / tt > ( < tt > U + 002F < / tt > ) . * Note that < tt > & # 92 ; & # 47 ; < / tt > is optional , and will only be used when the < tt > & # 47 ; < / tt > * symbol appears after < tt > & lt ; < / tt > , as in < tt > & lt ; & # 47 ; < / tt > . This is to avoid accidentally * closing < tt > & lt ; script & gt ; < / tt > tags in HTML . Also , note that < tt > & # 92 ; v < / tt > * ( < tt > U + 000B < / tt > ) is actually included as a Single Escape * Character in the JavaScript ( ECMAScript ) specification , but will not be used as it * is not supported by Microsoft Internet Explorer versions & lt ; 9. * < / li > * < li > * Two ranges of non - displayable , control characters ( some of which are already part of the * < em > single escape characters < / em > list ) : < tt > U + 0001 < / tt > to < tt > U + 001F < / tt > and * < tt > U + 007F < / tt > to < tt > U + 009F < / tt > . * < / li > * < / ul > * This method calls * { @ link # escapeJavaScript ( char [ ] , int , int , java . io . Writer , JavaScriptEscapeType , JavaScriptEscapeLevel ) } * with the following preconfigured values : * < ul > * < li > < tt > type < / tt > : * { @ link org . unbescape . javascript . JavaScriptEscapeType # SINGLE _ ESCAPE _ CHARS _ DEFAULT _ TO _ XHEXA _ AND _ UHEXA } < / li > * < li > < tt > level < / tt > : * { @ link org . unbescape . javascript . JavaScriptEscapeLevel # LEVEL _ 1 _ BASIC _ ESCAPE _ SET } < / li > * < / ul > * This method is < strong > thread - safe < / strong > . * @ param text the < tt > char [ ] < / tt > to be escaped . * @ param offset the position in < tt > text < / tt > at which the escape operation should start . * @ param len the number of characters in < tt > text < / tt > that should be escaped . * @ param writer the < tt > java . io . Writer < / tt > to which the escaped result will be written . Nothing will * be written at all to this writer if input is < tt > null < / tt > . * @ throws IOException if an input / output exception occurs */ public static void escapeJavaScriptMinimal ( final char [ ] text , final int offset , final int len , final Writer writer ) throws IOException { } }
escapeJavaScript ( text , offset , len , writer , JavaScriptEscapeType . SINGLE_ESCAPE_CHARS_DEFAULT_TO_XHEXA_AND_UHEXA , JavaScriptEscapeLevel . LEVEL_1_BASIC_ESCAPE_SET ) ;
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EClass getIfcEnvironmentalImpactValue ( ) { } }
if ( ifcEnvironmentalImpactValueEClass == null ) { ifcEnvironmentalImpactValueEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 208 ) ; } return ifcEnvironmentalImpactValueEClass ;
public class SubscriptionItem { /** * For the specified subscription item , returns a list of summary objects . Each object in the list * provides usage information that ’ s been summarized from multiple usage records and over a * subscription billing period ( e . g . , 15 usage records in the billing plan ’ s month of September ) . * < p > The list is sorted in reverse - chronological order ( newest first ) . The first list item * represents the most current usage period that hasn ’ t ended yet . Since new usage records can * still be added , the returned summary information for the subscription item ’ s ID should be seen * as unstable until the subscription billing period ends . */ public UsageRecordSummaryCollection usageRecordSummaries ( Map < String , Object > params , RequestOptions options ) throws StripeException { } }
String url = String . format ( "%s%s" , Stripe . getApiBase ( ) , String . format ( "/v1/subscription_items/%s/usage_record_summaries" , ApiResource . urlEncodeId ( this . getId ( ) ) ) ) ; return requestCollection ( url , params , UsageRecordSummaryCollection . class , options ) ;
public class GetPipelineDefinitionRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( GetPipelineDefinitionRequest getPipelineDefinitionRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( getPipelineDefinitionRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( getPipelineDefinitionRequest . getPipelineId ( ) , PIPELINEID_BINDING ) ; protocolMarshaller . marshall ( getPipelineDefinitionRequest . getVersion ( ) , VERSION_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class FontUtils { /** * Gets the specified font with the specified size , correctly scaled * @ param font * @ param size * @ since 2.7.0 * @ return the specified font with the specified size , correctly scaled */ public static Font getFont ( Font font , Size size ) { } }
float s ; switch ( size ) { case smallest : s = ( float ) ( font . getSize ( ) * 0.5 ) ; break ; case much_smaller : s = ( float ) ( font . getSize ( ) * 0.7 ) ; break ; case smaller : s = ( float ) ( font . getSize ( ) * 0.8 ) ; break ; case standard : s = ( float ) font . getSize ( ) ; break ; case larger : s = ( float ) ( font . getSize ( ) * 1.5 ) ; break ; case much_larger : s = ( float ) ( font . getSize ( ) * 3 ) ; break ; case huge : s = ( float ) ( font . getSize ( ) * 4 ) ; break ; default : s = ( float ) ( font . getSize ( ) ) ; break ; } return font . deriveFont ( s ) ;
public class Async { /** * Convert a synchronous function call into an asynchronous function call through an Observable . * < img width = " 640 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / toAsync . s . png " alt = " " > * @ param < R > the result type * @ param func the function to convert * @ param scheduler the Scheduler used to call the { @ code func } * @ return a function that returns an Observable that executes the { @ code func } and emits its returned value * @ see < a href = " https : / / github . com / ReactiveX / RxJava / wiki / Async - Operators # wiki - toasync - or - asyncaction - or - asyncfunc " > RxJava Wiki : toAsync ( ) < / a > */ public static < R > FuncN < Observable < R > > toAsyncThrowing ( final ThrowingFuncN < ? extends R > func , final Scheduler scheduler ) { } }
return new FuncN < Observable < R > > ( ) { @ Override public Observable < R > call ( Object ... args ) { return startCallable ( ThrowingFunctions . toCallable ( func , args ) , scheduler ) ; } } ;
public class MssEncryptionMarshaller { /** * Marshall the given parameter object . */ public void marshall ( MssEncryption mssEncryption , ProtocolMarshaller protocolMarshaller ) { } }
if ( mssEncryption == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( mssEncryption . getSpekeKeyProvider ( ) , SPEKEKEYPROVIDER_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class AtomContainer { /** * { @ inheritDoc } */ @ Override public void removeAllElements ( ) { } }
removeAllElectronContainers ( ) ; for ( int f = 0 ; f < getAtomCount ( ) ; f ++ ) { getAtom ( f ) . removeListener ( this ) ; } atoms = new IAtom [ growArraySize ] ; atomCount = 0 ; stereoElements . clear ( ) ; notifyChanged ( ) ;
public class Entity { /** * 设置字段列表 , 用于限制加入的字段的值 * @ param fieldNames 字段列表 * @ return 自身 */ public Entity setFieldNames ( String ... fieldNames ) { } }
if ( ArrayUtil . isNotEmpty ( fieldNames ) ) { this . fieldNames = CollectionUtil . newHashSet ( fieldNames ) ; } return this ;
public class Buffer { /** * Like { @ link # varintSizeInBytes ( int ) } , except for uint64. */ public static int varintSizeInBytes ( long v ) { } }
if ( ( v & ( 0xffffffffffffffffL << 7 ) ) == 0 ) return 1 ; if ( ( v & ( 0xffffffffffffffffL << 14 ) ) == 0 ) return 2 ; if ( ( v & ( 0xffffffffffffffffL << 21 ) ) == 0 ) return 3 ; if ( ( v & ( 0xffffffffffffffffL << 28 ) ) == 0 ) return 4 ; if ( ( v & ( 0xffffffffffffffffL << 35 ) ) == 0 ) return 5 ; if ( ( v & ( 0xffffffffffffffffL << 42 ) ) == 0 ) return 6 ; if ( ( v & ( 0xffffffffffffffffL << 49 ) ) == 0 ) return 7 ; if ( ( v & ( 0xffffffffffffffffL << 56 ) ) == 0 ) return 8 ; if ( ( v & ( 0xffffffffffffffffL << 63 ) ) == 0 ) return 9 ; return 10 ;
public class Yarrgs { /** * Parses < code > args < / code > into an instance of < code > argsType < / code > using * { @ link Parsers # createFieldParserFactory ( ) } . If the user supplied bad arguments , * < code > YarrgParseException < / code > is thrown . If they asked for help , * < code > YarrgHelpException < / code > is thrown . It ' s up to the caller to present the parse * failure to the user . */ public static < T > T parse ( Class < T > argsType , String [ ] args ) throws YarrgParseException { } }
return parse ( argsType , args , Parsers . createFieldParserFactory ( ) ) ;
public class CmsSitemapHoverbar { /** * Installs a hover bar for the given item widget . < p > * @ param controller the controller * @ param treeItem the item to hover * @ param buttons the buttons * @ return the hover bar instance */ public static CmsSitemapHoverbar installOn ( CmsSitemapController controller , CmsTreeItem treeItem , Collection < Widget > buttons ) { } }
CmsSitemapHoverbar hoverbar = new CmsSitemapHoverbar ( controller , buttons ) ; installHoverbar ( hoverbar , treeItem . getListItemWidget ( ) ) ; return hoverbar ;
public class FindPositionArray { /** * Returns a list of Long that contains the indices of positions computed * according to the given bit vector . * @ return a list of Long that contains the indices of positions computed * according to the given bit vector */ List < Long > getPositionList ( ) { } }
List < Long > ret = new ArrayList < Long > ( ) ; ret . add ( - 1L ) ; /* * This - 1 is pointing to the previous position of the first valid * position of the bit vector , which starts at index 0 . Since the zeroth * occurrence of a bit is undefined , the first occurrence can be at * position 0 , or later . */ long count = 0 ; for ( long index = 0 ; index < this . bitVector . size ( ) ; index ++ ) { if ( this . bitVector . getBit ( index ) == this . bit ) { count ++ ; } if ( count >= this . blockSize ) { count = 0 ; ret . add ( index ) ; } } return ret ;
public class OrcInputStream { /** * This comes from the Apache Hive ORC code */ private void advance ( ) throws IOException { } }
if ( compressedSliceInput == null || compressedSliceInput . remaining ( ) == 0 ) { current = null ; return ; } // 3 byte header // NOTE : this must match BLOCK _ HEADER _ SIZE currentCompressedBlockOffset = toIntExact ( compressedSliceInput . position ( ) ) ; int b0 = compressedSliceInput . readUnsignedByte ( ) ; int b1 = compressedSliceInput . readUnsignedByte ( ) ; int b2 = compressedSliceInput . readUnsignedByte ( ) ; boolean isUncompressed = ( b0 & 0x01 ) == 1 ; int chunkLength = ( b2 << 15 ) | ( b1 << 7 ) | ( b0 >>> 1 ) ; if ( chunkLength < 0 || chunkLength > compressedSliceInput . remaining ( ) ) { throw new OrcCorruptionException ( orcDataSourceId , "The chunkLength (%s) must not be negative or greater than remaining size (%s)" , chunkLength , compressedSliceInput . remaining ( ) ) ; } Slice chunk = compressedSliceInput . readSlice ( chunkLength ) ; if ( isUncompressed ) { current = chunk . getInput ( ) ; } else { OrcDecompressor . OutputBuffer output = new OrcDecompressor . OutputBuffer ( ) { @ Override public byte [ ] initialize ( int size ) { if ( buffer == null || size > buffer . length ) { buffer = new byte [ size ] ; bufferMemoryUsage . setBytes ( buffer . length ) ; } return buffer ; } @ Override public byte [ ] grow ( int size ) { if ( size > buffer . length ) { buffer = Arrays . copyOfRange ( buffer , 0 , size ) ; bufferMemoryUsage . setBytes ( buffer . length ) ; } return buffer ; } } ; int uncompressedSize = decompressor . get ( ) . decompress ( ( byte [ ] ) chunk . getBase ( ) , ( int ) ( chunk . getAddress ( ) - ARRAY_BYTE_BASE_OFFSET ) , chunk . length ( ) , output ) ; current = Slices . wrappedBuffer ( buffer , 0 , uncompressedSize ) . getInput ( ) ; }
public class RequestQueries { /** * Returns the request query form produced from the given input arguments . */ protected String buildQuery ( Properties parms , RequestType type ) { } }
if ( parms . isEmpty ( ) ) type = RequestType . query ; RString result = new RString ( _queryHtml ) ; result . replace ( "REQ_NAME" , this . getClass ( ) . getSimpleName ( ) ) ; StringBuilder query = new StringBuilder ( ) ; query . append ( "<form onsubmit='return false;'>" ) ; RString script = new RString ( _queryJs ) ; script . replace ( "REQUEST_NAME" , getClass ( ) . getSimpleName ( ) ) ; for ( Argument arg : _arguments ) { try { arg . check ( RequestQueries . this , parms . getProperty ( arg . _name , "" ) ) ; queryArgumentValueSet ( arg , parms ) ; } catch ( IllegalArgumentException e ) { // in query mode only display error for arguments present if ( ( type != RequestType . query ) || ! parms . getProperty ( arg . _name , "" ) . isEmpty ( ) ) query . append ( "<div class='alert alert-error'>" + e . getMessage ( ) + "</div>" ) ; } if ( arg . _hideInQuery ) continue ; if ( ! arg . disabled ( ) ) { RString x = script . restartGroup ( "REQUEST_ELEMENT" ) ; x . replace ( "ELEMENT_NAME" , arg . _name ) ; // If some Argument has prerequisites , and those pre - reqs changed on // this very page load then we do not assign the arg here : the values // passed will be something valid from the PRIOR page - based on the // old pre - req - and won ' t be correct . Not assigning them here means // we ' ll act " as if " the field was never filled in . if ( arg . _prerequisites != null ) { StringBuilder sb = new StringBuilder ( "if( " ) ; ArrayList < RequestArguments . Argument > preqs = arg . _prerequisites ; for ( RequestArguments . Argument dep : preqs ) sb . append ( "specArg!=='" ) . append ( dep . _name ) . append ( "' && " ) ; sb . append ( "true ) " ) ; x . replace ( "ELEMENT_PREQ" , sb ) ; } x . append ( ) ; x = script . restartGroup ( "ELEMENT_VALUE" ) ; x . replace ( "ELEMENT_NAME" , arg . _name ) ; x . replace ( "BODY" , "function query_value_" + arg . _name + "() { " + arg . jsValue ( ) + "} " ) ; x . append ( ) ; } if ( arg . refreshOnChange ( ) ) { RString x = script . restartGroup ( "ELEMENT_ONCHANGE" ) ; x . replace ( "BODY" , arg . jsRefresh ( "query_refresh" ) ) ; x . append ( ) ; } RString x = script . restartGroup ( "ELEMENT_ADDONS" ) ; x . replace ( "BODY" , arg . jsAddons ( ) ) ; x . append ( ) ; } for ( Argument arg : _arguments ) { if ( arg . _hideInQuery ) continue ; query . append ( arg . query ( ) ) ; } query . append ( "</form>" ) ; result . replace ( "QUERY" , query . toString ( ) ) ; result . replace ( "SCRIPT" , script . toString ( ) ) ; return result . toString ( ) ; }
public class SymbolTable { /** * Returns a hashcode value for the specified symbol . The value * returned by this method must be identical to the value returned * by the < code > hash ( char [ ] , int , int ) < / code > method when called * with the character array that comprises the symbol string . * @ param symbol The symbol to hash . */ public int hash ( String symbol ) { } }
int code = 0 ; int length = symbol . length ( ) ; for ( int i = 0 ; i < length ; i ++ ) { code = code * 37 + symbol . charAt ( i ) ; } return code & 0x7FFFFFF ;
public class GenericMapper { /** * @ param meta * @ param genericMapper2 * @ return 下午3:45:38 created by Darwin ( Tianxin ) * @ throws SQLException */ private List < Setter > getSetters ( ResultSetMetaData meta ) throws SQLException { } }
int columnCount = meta . getColumnCount ( ) ; List < Setter > setters = new ArrayList < Setter > ( columnCount ) ; for ( int i = 1 ; i <= columnCount ; i ++ ) { String column = meta . getColumnName ( i ) ; Method setMethod = orMapping . getSetter ( column ) ; if ( setMethod != null ) { Setter setter = new Setter ( setMethod , column , setMethod . getParameterTypes ( ) [ 0 ] ) ; setters . add ( setter ) ; } } return setters ;
public class ConstantListIndex { /** * returns whether the array item was returned from a common method that the user can ' t do anything about and so don ' t report CLI in this case . * @ param item * the stack item representing the array * @ return if the array was returned from a common method */ private static boolean isArrayFromUbiquitousMethod ( OpcodeStack . Item item ) { } }
XMethod method = item . getReturnValueOf ( ) ; if ( method == null ) { return false ; } FQMethod methodDesc = new FQMethod ( method . getClassName ( ) . replace ( '.' , '/' ) , method . getName ( ) , method . getSignature ( ) ) ; return ubiquitousMethods . contains ( methodDesc ) ;
public class InstrumentedExecutors { /** * Creates an instrumented thread pool that can schedule commands to run after a * given delay , or to execute periodically . * @ param corePoolSize the number of threads to keep in the pool , * even if they are idle * @ param registry the { @ link MetricRegistry } that will contain the metrics . * @ return a newly created scheduled thread pool * @ throws IllegalArgumentException if { @ code corePoolSize < 0} * @ see Executors # newScheduledThreadPool ( int ) */ public static InstrumentedScheduledExecutorService newScheduledThreadPool ( int corePoolSize , MetricRegistry registry ) { } }
return new InstrumentedScheduledExecutorService ( Executors . newScheduledThreadPool ( corePoolSize ) , registry ) ;
public class AbstractRestClient { /** * Load X509 certificate from resources . * Certificates can be in binary or base64 DER / . crt format . * @ param resourcethe resource name * @ returnX509 certificate * @ throws CertificateExceptionif the certificate couldn ' t be loaded */ protected X509Certificate loadX509CertificateFromResource ( String resource ) throws CertificateException { } }
InputStream derInputStream = this . getClass ( ) . getClassLoader ( ) . getResourceAsStream ( resource ) ; CertificateFactory certificateFactory = CertificateFactory . getInstance ( "X.509" ) ; X509Certificate cert = ( X509Certificate ) certificateFactory . generateCertificate ( derInputStream ) ; try { derInputStream . close ( ) ; } catch ( IOException e ) { // ignore } return cert ;
public class DefaultExpander { /** * Clean up constructions that exists only in the unexpanded code * @ param drl * @ return */ private String cleanupExpressions ( String drl ) { } }
// execute cleanup for ( final DSLMappingEntry entry : this . cleanup ) { drl = entry . getKeyPattern ( ) . matcher ( drl ) . replaceAll ( entry . getValuePattern ( ) ) ; } return drl ;
public class CmsForm { /** * Collects all values from the form fields . < p > * This method omits form fields whose values are null . * @ return a map of the form field values */ public Map < String , String > collectValues ( ) { } }
Map < String , String > result = new HashMap < String , String > ( ) ; for ( Map . Entry < String , I_CmsFormField > entry : m_fields . entrySet ( ) ) { String key = entry . getKey ( ) ; String value = null ; I_CmsFormField field = entry . getValue ( ) ; value = field . getModelValue ( ) ; result . put ( key , value ) ; } return result ;
public class ObjectArrayDump { /** * ~ Methods - - - - - */ public long getSize ( ) { } }
int idSize = dumpClass . getHprofBuffer ( ) . getIDSize ( ) ; return dumpClass . classDumpSegment . getMinimumInstanceSize ( ) + HPROF_ARRAY_OVERHEAD + ( ( long ) idSize * getLength ( ) ) ;
public class MetadataVersionStoreUtils { /** * Retrieves a properties ( hashmap ) consisting of all the metadata versions * @ param versionStore The system store client used to retrieve the metadata * versions * @ return Properties object containing all the * ' property _ name = property _ value ' values */ public static Properties getProperties ( SystemStoreClient < String , String > versionStore ) { } }
Properties props = null ; Versioned < String > versioned = versionStore . getSysStore ( SystemStoreConstants . VERSIONS_METADATA_KEY ) ; if ( versioned != null && versioned . getValue ( ) != null ) { try { String versionList = versioned . getValue ( ) ; props = new Properties ( ) ; props . load ( new ByteArrayInputStream ( versionList . getBytes ( ) ) ) ; } catch ( Exception e ) { logger . warn ( "Error retrieving properties " , e ) ; } } return props ;
public class ExecutorServlet { /** * Prepare the executor for shutdown . * @ param respMap json response object */ private void shutdown ( final Map < String , Object > respMap ) { } }
try { logger . warn ( "Shutting down executor..." ) ; // Set the executor to inactive . Will receive no new flows . setActiveInternal ( false ) ; this . application . shutdown ( ) ; respMap . put ( ConnectorParams . STATUS_PARAM , ConnectorParams . RESPONSE_SUCCESS ) ; } catch ( final Exception e ) { logger . error ( e . getMessage ( ) , e ) ; respMap . put ( ConnectorParams . RESPONSE_ERROR , e . getMessage ( ) ) ; }
public class RelatedTablesExtension { /** * Get the related id mappings for the base id * @ param tableName * mapping table name * @ param baseId * base id * @ return IDs representing the matching related IDs */ public List < Long > getMappingsForBase ( String tableName , long baseId ) { } }
List < Long > relatedIds = new ArrayList < > ( ) ; UserMappingDao userMappingDao = getMappingDao ( tableName ) ; UserCustomResultSet resultSet = userMappingDao . queryByBaseId ( baseId ) ; try { while ( resultSet . moveToNext ( ) ) { UserMappingRow row = userMappingDao . getRow ( resultSet ) ; relatedIds . add ( row . getRelatedId ( ) ) ; } } finally { resultSet . close ( ) ; } return relatedIds ;
public class OverrideHelper { /** * / * @ Nullable */ protected JvmOperation findOverriddenOperation ( JvmOperation operation , LightweightTypeReference declaringType , TypeParameterSubstitutor < ? > substitutor , ITypeReferenceOwner owner , IVisibilityHelper visibilityHelper ) { } }
int parameterSize = operation . getParameters ( ) . size ( ) ; List < LightweightTypeReference > superTypes = declaringType . getSuperTypes ( ) ; for ( LightweightTypeReference superType : superTypes ) { if ( superType . getType ( ) instanceof JvmDeclaredType ) { JvmDeclaredType declaredSuperType = ( JvmDeclaredType ) superType . getType ( ) ; if ( declaredSuperType != null ) { Iterable < JvmFeature > equallyNamedFeatures = declaredSuperType . findAllFeaturesByName ( operation . getSimpleName ( ) ) ; for ( JvmFeature feature : equallyNamedFeatures ) { if ( feature instanceof JvmOperation ) { JvmOperation candidate = ( JvmOperation ) feature ; if ( parameterSize == candidate . getParameters ( ) . size ( ) ) { if ( visibilityHelper . isVisible ( feature ) ) { boolean matchesSignature = true ; for ( int i = 0 ; i < parameterSize && matchesSignature ; i ++ ) { JvmFormalParameter parameter = operation . getParameters ( ) . get ( i ) ; JvmFormalParameter candidateParameter = candidate . getParameters ( ) . get ( i ) ; matchesSignature = isMatchesSignature ( parameter , candidateParameter , substitutor , owner ) ; } if ( matchesSignature ) { return candidate ; } } } } } } } } return null ;
public class XLinkConnectorManagerImpl { /** * URLEncodes the given Parameter in UTF - 8 */ private static String urlEncodeParameter ( String parameter ) { } }
try { return URLEncoder . encode ( parameter , "UTF-8" ) ; } catch ( UnsupportedEncodingException ex ) { log . warn ( "Could not encode parameter." , ex ) ; } return parameter ;
public class CallbackImpl { /** * { @ inheritDoc } */ public Principal mapPrincipal ( String name ) { } }
if ( principals != null ) { String mapping = principals . get ( name ) ; if ( mapping != null ) { return new SimplePrincipal ( mapping ) ; } } return null ;
public class DisassociateDRTLogBucketRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DisassociateDRTLogBucketRequest disassociateDRTLogBucketRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( disassociateDRTLogBucketRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( disassociateDRTLogBucketRequest . getLogBucket ( ) , LOGBUCKET_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class PluginConfigSupport { /** * return the filename of the project artifact to be installed by * install - apps goal */ protected String getApplicationFilename ( ) { } }
// A project doesn ' t build a web application artifact but getting the // application artifacts from dependencies . e . g . liberty - assembly type // project . if ( "dependencies" . equals ( getInstallAppPackages ( ) ) ) { return null ; } // project artifact has not be created yet when create - server goal is // called in pre - package phase String name = project . getBuild ( ) . getFinalName ( ) ; if ( stripVersion ) { int versionBeginIndex = project . getBuild ( ) . getFinalName ( ) . lastIndexOf ( "-" + project . getVersion ( ) ) ; if ( versionBeginIndex != - 1 ) { name = project . getBuild ( ) . getFinalName ( ) . substring ( 0 , versionBeginIndex ) ; } } // liberty only supports these application types : ear , war , eba , esa switch ( project . getPackaging ( ) ) { case "ear" : case "war" : case "eba" : case "esa" : name += "." + project . getPackaging ( ) ; if ( looseApplication ) { name += ".xml" ; } break ; case "liberty-assembly" : // assuming liberty - assembly project will also have a war file // output . File dir = getWarSourceDirectory ( project ) ; if ( dir . exists ( ) ) { name += ".war" ; if ( looseApplication ) { name += ".xml" ; } } break ; default : log . debug ( "The project artifact cannot be installed to a Liberty server because " + project . getPackaging ( ) + " is not a supported packaging type." ) ; name = null ; break ; } return name ;
public class CacheControlBuilder { /** * Set the maximum age for shared caches relative to the request time . Similar * to max - age , except that it only applies to shared ( e . g . , proxy ) caches . * @ param eTimeUnit * { @ link TimeUnit } to use * @ param nDuration * The duration in the passed unit * @ return this */ @ Nonnull public CacheControlBuilder setSharedMaxAge ( @ Nonnull final TimeUnit eTimeUnit , final long nDuration ) { } }
return setSharedMaxAgeSeconds ( eTimeUnit . toSeconds ( nDuration ) ) ;
public class HostCertificateManager { /** * Replaces the trusted Certificate Authority ( CA ) certificates and Certification Revocation List ( CRL ) used by the * server with the provided values . These determine whether the server can verify the identity of an external entity . * @ param caCert List of SSL certificates , in PEM format , of all CAs that should be trusted * @ param caCrl List of SSL CRLs , in PEM format , issued by trusted CAs from the above list * @ throws HostConfigFault * @ throws RuntimeFault * @ throws RemoteException */ public void replaceCACertificatesAndCRLs ( String [ ] caCert , String [ ] caCrl ) throws HostConfigFault , RuntimeFault , RemoteException { } }
getVimService ( ) . replaceCACertificatesAndCRLs ( getMOR ( ) , caCert , caCrl ) ;
public class VariableImpl { /** * check if the arguments are named arguments or regular arguments , throws a exception when mixed * @ param funcName * @ param args * @ param line * @ return * @ throws TransformerException */ private static boolean isNamed ( String funcName , Argument [ ] args ) throws TransformerException { } }
if ( ArrayUtil . isEmpty ( args ) ) return false ; boolean named = false ; for ( int i = 0 ; i < args . length ; i ++ ) { if ( args [ i ] instanceof NamedArgument ) named = true ; else if ( named ) throw new TransformerException ( "invalid argument for function " + funcName + ", you can not mix named and unnamed arguments" , args [ i ] . getStart ( ) ) ; } return named ;
public class DeviceAttribute_3DAODefaultImpl { public void insert ( final float [ ] argin , final int dim_x , final int dim_y ) { } }
attrval . r_dim . dim_x = dim_x ; attrval . r_dim . dim_y = dim_y ; DevVarFloatArrayHelper . insert ( attrval . value , argin ) ;
public class SecurityActions { /** * Returns a system property value using the specified < code > key < / code > . * @ param key * @ return */ static String getSystemProperty ( final String key ) { } }
final SecurityManager sm = System . getSecurityManager ( ) ; if ( sm != null ) { return AccessController . doPrivileged ( new PrivilegedAction < String > ( ) { public String run ( ) { return System . getProperty ( key ) ; } } ) ; } else { return System . getProperty ( key ) ; }
public class CUtil { /** * Compares the contents of 2 arrays for equaliy . */ public static boolean sameList ( final Object [ ] a , final Object [ ] b ) { } }
if ( a == null || b == null || a . length != b . length ) { return false ; } for ( int i = 0 ; i < a . length ; i ++ ) { if ( ! a [ i ] . equals ( b [ i ] ) ) { return false ; } } return true ;
public class GeneratedModel { /** * Allocates a double [ ] and a float [ ] for every row */ public float [ ] predict ( Map < String , Double > row ) { } }
return predict ( map ( row , new double [ getNames ( ) . length ] ) , new float [ getNumResponseClasses ( ) + 1 ] ) ;
public class JournalHelper { /** * Copy an input stream to a temporary file , so we can hand an input stream * to the delegate and have another input stream for the journal . */ public static File copyToTempFile ( InputStream serialization ) throws IOException , FileNotFoundException { } }
File tempFile = createTempFile ( ) ; StreamUtility . pipeStream ( serialization , new FileOutputStream ( tempFile ) , 4096 ) ; return tempFile ;
public class JerseyVerticle { /** * { @ inheritDoc } */ @ Override public void start ( final Future < Void > startedResult ) throws Exception { } }
this . start ( ) ; jerseyServer . start ( ar -> { if ( ar . succeeded ( ) ) { startedResult . complete ( ) ; } else { startedResult . fail ( ar . cause ( ) ) ; } } ) ;
public class OrmDescriptorImpl { /** * If not already created , a new < code > persistence - unit - metadata < / code > element with the given value will be created . * Otherwise , the existing < code > persistence - unit - metadata < / code > element will be returned . * @ return a new or existing instance of < code > PersistenceUnitMetadata < OrmDescriptor > < / code > */ public PersistenceUnitMetadata < OrmDescriptor > getOrCreatePersistenceUnitMetadata ( ) { } }
Node node = model . getOrCreate ( "persistence-unit-metadata" ) ; PersistenceUnitMetadata < OrmDescriptor > persistenceUnitMetadata = new PersistenceUnitMetadataImpl < OrmDescriptor > ( this , "persistence-unit-metadata" , model , node ) ; return persistenceUnitMetadata ;
public class NetworkWatchersInner { /** * Lists all available internet service providers for a specified Azure region . * @ param resourceGroupName The name of the network watcher resource group . * @ param networkWatcherName The name of the network watcher resource . * @ param parameters Parameters that scope the list of available providers . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the AvailableProvidersListInner object */ public Observable < ServiceResponse < AvailableProvidersListInner > > beginListAvailableProvidersWithServiceResponseAsync ( String resourceGroupName , String networkWatcherName , AvailableProvidersListParameters parameters ) { } }
if ( resourceGroupName == null ) { throw new IllegalArgumentException ( "Parameter resourceGroupName is required and cannot be null." ) ; } if ( networkWatcherName == null ) { throw new IllegalArgumentException ( "Parameter networkWatcherName is required and cannot be null." ) ; } if ( this . client . subscriptionId ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.subscriptionId() is required and cannot be null." ) ; } if ( parameters == null ) { throw new IllegalArgumentException ( "Parameter parameters is required and cannot be null." ) ; } Validator . validate ( parameters ) ; final String apiVersion = "2018-06-01" ; return service . beginListAvailableProviders ( resourceGroupName , networkWatcherName , this . client . subscriptionId ( ) , parameters , apiVersion , this . client . acceptLanguage ( ) , this . client . userAgent ( ) ) . flatMap ( new Func1 < Response < ResponseBody > , Observable < ServiceResponse < AvailableProvidersListInner > > > ( ) { @ Override public Observable < ServiceResponse < AvailableProvidersListInner > > call ( Response < ResponseBody > response ) { try { ServiceResponse < AvailableProvidersListInner > clientResponse = beginListAvailableProvidersDelegate ( response ) ; return Observable . just ( clientResponse ) ; } catch ( Throwable t ) { return Observable . error ( t ) ; } } } ) ;
public class DateTimeAdapter { /** * Marshal a Date to a String for use by JAXB . * @ param value Date object to marshal . * @ return String form of date . */ public String marshal ( Date value ) { } }
String val = "" ; if ( value != null ) { Calendar cal = new GregorianCalendar ( ) ; cal . setTime ( value ) ; return DatatypeConverter . printDateTime ( cal ) ; } System . out . println ( "Date value: " + value ) ; return val ;
public class EvaluateIntrinsicDimensionalityEstimators { /** * Generate a data sample . * @ param maxk Number of entries . * @ return Data sample */ protected double [ ] makeSample ( int maxk ) { } }
final Random rnd = this . rnd . getSingleThreadedRandom ( ) ; double [ ] dists = new double [ maxk + 1 ] ; final double e = 1. / dim ; for ( int i = 0 ; i <= maxk ; i ++ ) { dists [ i ] = FastMath . pow ( rnd . nextDouble ( ) , e ) ; } Arrays . sort ( dists ) ; return dists ;
public class LettuceAssert { /** * Assert that a string is not empty , it must not be { @ code null } and it must not be empty . * @ param string the object to check * @ param message the exception message to use if the assertion fails * @ throws IllegalArgumentException if the object is { @ code null } or the underlying string is empty */ public static void notEmpty ( String string , String message ) { } }
if ( LettuceStrings . isEmpty ( string ) ) { throw new IllegalArgumentException ( message ) ; }
public class Matchers { /** * Matches an class based on whether it is nested in another class or method . * @ param kind The kind of nesting to match , eg ANONYMOUS , LOCAL , MEMBER , TOP _ LEVEL */ public static Matcher < ClassTree > nestingKind ( final NestingKind kind ) { } }
return new Matcher < ClassTree > ( ) { @ Override public boolean matches ( ClassTree classTree , VisitorState state ) { ClassSymbol sym = ASTHelpers . getSymbol ( classTree ) ; return sym . getNestingKind ( ) == kind ; } } ;
public class Stylesheet { /** * Get an " xsl : decimal - format " property . * @ see DecimalFormatProperties * @ see < a href = " http : / / www . w3 . org / TR / xslt # format - number " > format - number in XSLT Specification < / a > * @ param name The qualified name of the decimal format property . * @ return null if not found , otherwise a DecimalFormatProperties * object , from which you can get a DecimalFormatSymbols object . */ public DecimalFormatProperties getDecimalFormat ( QName name ) { } }
if ( null == m_DecimalFormatDeclarations ) return null ; int n = getDecimalFormatCount ( ) ; for ( int i = ( n - 1 ) ; i >= 0 ; i ++ ) { DecimalFormatProperties dfp = getDecimalFormat ( i ) ; if ( dfp . getName ( ) . equals ( name ) ) return dfp ; } return null ;
public class DriverFactory { /** * Creates new { @ link RetryLogic } . * < b > This method is protected only for testing < / b > */ protected RetryLogic createRetryLogic ( RetrySettings settings , EventExecutorGroup eventExecutorGroup , Logging logging ) { } }
return new ExponentialBackoffRetryLogic ( settings , eventExecutorGroup , createClock ( ) , logging ) ;
public class StreamingLocatorsInner { /** * List Paths . * List Paths supported by this Streaming Locator . * @ param resourceGroupName The name of the resource group within the Azure subscription . * @ param accountName The Media Services account name . * @ param streamingLocatorName The Streaming Locator name . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the ListPathsResponseInner object */ public Observable < ListPathsResponseInner > listPathsAsync ( String resourceGroupName , String accountName , String streamingLocatorName ) { } }
return listPathsWithServiceResponseAsync ( resourceGroupName , accountName , streamingLocatorName ) . map ( new Func1 < ServiceResponse < ListPathsResponseInner > , ListPathsResponseInner > ( ) { @ Override public ListPathsResponseInner call ( ServiceResponse < ListPathsResponseInner > response ) { return response . body ( ) ; } } ) ;
public class Palette { /** * Generate heat color palette . * @ param n the number of colors in the palette . * @ param alpha the parameter in [ 0,1 ] for transparency . */ public static Color [ ] heat ( int n , float alpha ) { } }
int j = n / 4 ; int k = n - j ; float h = 1.0f / 6 ; Color [ ] c = rainbow ( k , 0 , h , alpha ) ; Color [ ] palette = new Color [ n ] ; System . arraycopy ( c , 0 , palette , 0 , k ) ; float s = 1 - 1.0f / ( 2 * j ) ; float end = 1.0f / ( 2 * j ) ; float w = ( end - s ) / ( j - 1 ) ; for ( int i = k ; i < n ; i ++ ) { palette [ i ] = hsv ( h , s , 1.0f , alpha ) ; s += w ; } return palette ;
public class AsynchronousRequest { /** * For more info on files API go < a href = " https : / / wiki . guildwars2 . com / wiki / API : 2 / files " > here < / a > < br / > * Give user the access to { @ link Callback # onResponse ( Call , Response ) } and { @ link Callback # onFailure ( Call , Throwable ) } methods for custom interactions * @ param callback callback that is going to be used for { @ link Call # enqueue ( Callback ) } * @ throws NullPointerException if given { @ link Callback } is empty * @ see Asset file info */ public void getAllFileID ( Callback < List < String > > callback ) throws NullPointerException { } }
gw2API . getAllFileIDs ( ) . enqueue ( callback ) ;
public class DigitalPackageUrl { /** * Get Resource Url for GetAvailableDigitalPackageFulfillmentActions * @ param digitalPackageId This parameter supplies package ID to get fulfillment actions for the digital package . * @ param orderId Unique identifier of the order . * @ return String Resource Url */ public static MozuUrl getAvailableDigitalPackageFulfillmentActionsUrl ( String digitalPackageId , String orderId ) { } }
UrlFormatter formatter = new UrlFormatter ( "/api/commerce/orders/{orderId}/digitalpackages/{digitalPackageId}/actions" ) ; formatter . formatUrl ( "digitalPackageId" , digitalPackageId ) ; formatter . formatUrl ( "orderId" , orderId ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ;
public class MetricsSystem { /** * Starts sinks from a given metrics configuration . This is made public for unit test . * @ param config the metrics config */ public static synchronized void startSinksFromConfig ( MetricsConfig config ) { } }
if ( sSinks != null ) { LOG . info ( "Sinks have already been started." ) ; return ; } LOG . info ( "Starting sinks with config: {}." , config ) ; sSinks = new ArrayList < > ( ) ; Map < String , Properties > sinkConfigs = MetricsConfig . subProperties ( config . getProperties ( ) , SINK_REGEX ) ; for ( Map . Entry < String , Properties > entry : sinkConfigs . entrySet ( ) ) { String classPath = entry . getValue ( ) . getProperty ( "class" ) ; if ( classPath != null ) { LOG . info ( "Starting sink {}." , classPath ) ; try { Sink sink = ( Sink ) Class . forName ( classPath ) . getConstructor ( Properties . class , MetricRegistry . class ) . newInstance ( entry . getValue ( ) , METRIC_REGISTRY ) ; sink . start ( ) ; sSinks . add ( sink ) ; } catch ( Exception e ) { LOG . error ( "Sink class {} cannot be instantiated" , classPath , e ) ; } } }
public class AttributeCriterionPane { /** * Return the operator code from an operator label . The difference is this : an operator label is a string like * " is equal to " , while it ' s code is " = " . * @ param label * The operator label . * @ return operator code */ public static String getOperatorCodeFromLabel ( String label ) { } }
if ( label != null ) { if ( I18nProvider . getSearch ( ) . operatorEquals ( ) . equals ( label ) ) { return "=" ; } else if ( I18nProvider . getSearch ( ) . operatorNotEquals ( ) . equals ( label ) ) { return "<>" ; } else if ( I18nProvider . getSearch ( ) . operatorST ( ) . equals ( label ) ) { return "<" ; } else if ( I18nProvider . getSearch ( ) . operatorSE ( ) . equals ( label ) ) { return "<=" ; } else if ( I18nProvider . getSearch ( ) . operatorBT ( ) . equals ( label ) ) { return ">" ; } else if ( I18nProvider . getSearch ( ) . operatorBE ( ) . equals ( label ) ) { return ">=" ; } else if ( I18nProvider . getSearch ( ) . operatorContains ( ) . equals ( label ) ) { return "contains" ; } else if ( I18nProvider . getSearch ( ) . operatorBefore ( ) . equals ( label ) ) { return "BEFORE" ; } else if ( I18nProvider . getSearch ( ) . operatorAfter ( ) . equals ( label ) ) { return "AFTER" ; } } return label ;
public class UserGroupSkinMappingTransformerConfigurationSource { /** * Inits and / or returns already initialized logger . < br > * You have to use this method in order to use the logger , < br > * you should not call the private variable directly . < br > * This was done because Tomcat may instantiate all listeners before calling contextInitialized * on any listener . < br > * Note that there is no synchronization here on purpose . The object returned by getLog for a * logger name is < br > * idempotent and getLog itself is thread safe . Eventually all < br > * threads will see an instance level logger variable and calls to getLog will stop . * @ return the log for this class */ protected Logger getLogger ( ) { } }
Logger l = this . logger ; if ( l == null ) { l = LoggerFactory . getLogger ( LOGGER_NAME ) ; this . logger = l ; } return l ;
public class PropertiesManager { /** * Returns the value of a property for a given name including whitespace trailing the property * value , but not including whitespace leading the property value . An UndeclaredPortalException * is thrown if the property cannot be found . This method will never return null . * @ param name the name of the requested property * @ return value the value of the property matching the requested name * @ throws MissingPropertyException - ( undeclared ) if the requested property is not found */ public static String getPropertyUntrimmed ( String name ) throws MissingPropertyException { } }
if ( PropertiesManager . props == null ) loadProps ( ) ; if ( props == null ) { boolean alreadyReported = registerMissingProperty ( name ) ; throw new MissingPropertyException ( name , alreadyReported ) ; } String val = props . getProperty ( name ) ; if ( val == null ) { boolean alreadyReported = registerMissingProperty ( name ) ; throw new MissingPropertyException ( name , alreadyReported ) ; } return val ;
public class Noise { /** * Compute 2 - dimensional Perlin noise . * @ param x the x coordinate * @ param y the y coordinate * @ return noise value at ( x , y ) */ public static float noise2 ( float x , float y ) { } }
int bx0 , bx1 , by0 , by1 , b00 , b10 , b01 , b11 ; float rx0 , rx1 , ry0 , ry1 , q [ ] , sx , sy , a , b , t , u , v ; int i , j ; if ( start ) { start = false ; init ( ) ; } t = x + N ; bx0 = ( ( int ) t ) & BM ; bx1 = ( bx0 + 1 ) & BM ; rx0 = t - ( int ) t ; rx1 = rx0 - 1.0f ; t = y + N ; by0 = ( ( int ) t ) & BM ; by1 = ( by0 + 1 ) & BM ; ry0 = t - ( int ) t ; ry1 = ry0 - 1.0f ; i = p [ bx0 ] ; j = p [ bx1 ] ; b00 = p [ i + by0 ] ; b10 = p [ j + by0 ] ; b01 = p [ i + by1 ] ; b11 = p [ j + by1 ] ; sx = sCurve ( rx0 ) ; sy = sCurve ( ry0 ) ; q = g2 [ b00 ] ; u = rx0 * q [ 0 ] + ry0 * q [ 1 ] ; q = g2 [ b10 ] ; v = rx1 * q [ 0 ] + ry0 * q [ 1 ] ; a = lerp ( sx , u , v ) ; q = g2 [ b01 ] ; u = rx0 * q [ 0 ] + ry1 * q [ 1 ] ; q = g2 [ b11 ] ; v = rx1 * q [ 0 ] + ry1 * q [ 1 ] ; b = lerp ( sx , u , v ) ; return 1.5f * lerp ( sy , a , b ) ;
public class SAXReaderSettings { /** * Create a clone of the passed settings , depending on the parameter . If the * parameter is < code > null < / code > a new empty { @ link SAXReaderSettings } object * is created , otherwise a copy of the parameter is created . * @ param aOther * The parameter to be used . May be < code > null < / code > . * @ return Never < code > null < / code > . */ @ Nonnull public static SAXReaderSettings createCloneOnDemand ( @ Nullable final ISAXReaderSettings aOther ) { } }
if ( aOther == null ) { // Create plain object return new SAXReaderSettings ( ) ; } // Create a clone return new SAXReaderSettings ( aOther ) ;
public class ArtifactHandlerUtils { /** * Interfaces WebApp & & DeploymentSlot define their own warDeploy API separately . * Ideally , it should be defined in their base interface WebAppBase . * { @ link com . microsoft . azure . management . appservice . WebAppBase } * Comparing to abstracting an adapter for WebApp & & DeploymentSlot , we choose a lighter solution : * work around to get the real implementation of warDeploy . */ public static Runnable getRealWarDeployExecutor ( final DeployTarget target , final File war , final String path ) throws MojoExecutionException { } }
if ( target instanceof WebAppDeployTarget ) { return new Runnable ( ) { @ Override public void run ( ) { ( ( WebAppDeployTarget ) target ) . warDeploy ( war , path ) ; } } ; } if ( target instanceof DeploymentSlotDeployTarget ) { return new Runnable ( ) { @ Override public void run ( ) { ( ( DeploymentSlotDeployTarget ) target ) . warDeploy ( war , path ) ; } } ; } throw new MojoExecutionException ( "The type of deploy target is unknown, supported types are WebApp and DeploymentSlot." ) ;
public class ListFileSharesResult { /** * An array of information about the file gateway ' s file shares . * @ param fileShareInfoList * An array of information about the file gateway ' s file shares . */ public void setFileShareInfoList ( java . util . Collection < FileShareInfo > fileShareInfoList ) { } }
if ( fileShareInfoList == null ) { this . fileShareInfoList = null ; return ; } this . fileShareInfoList = new com . amazonaws . internal . SdkInternalList < FileShareInfo > ( fileShareInfoList ) ;
public class PersonRecognition { /** * 维特比算法求解最优标签 * @ param roleTagList * @ return */ public static List < NR > viterbiCompute ( List < EnumItem < NR > > roleTagList ) { } }
return Viterbi . computeEnum ( roleTagList , PersonDictionary . transformMatrixDictionary ) ;
public class AWSSimpleSystemsManagementClient { /** * Deletes a patch baseline . * @ param deletePatchBaselineRequest * @ return Result of the DeletePatchBaseline operation returned by the service . * @ throws ResourceInUseException * Error returned if an attempt is made to delete a patch baseline that is registered for a patch group . * @ throws InternalServerErrorException * An error occurred on the server side . * @ sample AWSSimpleSystemsManagement . DeletePatchBaseline * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / ssm - 2014-11-06 / DeletePatchBaseline " target = " _ top " > AWS API * Documentation < / a > */ @ Override public DeletePatchBaselineResult deletePatchBaseline ( DeletePatchBaselineRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeDeletePatchBaseline ( request ) ;
public class ConvertNV21 { /** * Converts an NV21 image into a { @ link Planar } YUV image . * @ param data Input : NV21 image data * @ param width Input : NV21 image width * @ param height Input : NV21 image height * @ param output Output : Optional storage for output image . Can be null . * @ param outputType Output : Type of output image * @ param < T > Output image type */ public static < T extends ImageGray < T > > Planar < T > nv21ToPlanarYuv ( byte [ ] data , int width , int height , Planar < T > output , Class < T > outputType ) { } }
if ( outputType == GrayU8 . class ) { return ( Planar ) nv21ToPlanarYuv_U8 ( data , width , height , ( Planar ) output ) ; } else if ( outputType == GrayF32 . class ) { return ( Planar ) nv21TPlanarYuv_F32 ( data , width , height , ( Planar ) output ) ; } else { throw new IllegalArgumentException ( "Unsupported BoofCV Image Type " + outputType . getSimpleName ( ) ) ; }
public class FilterPanel { /** * Initialize JTable that contains namespaces */ private void initTable ( ) { } }
namespaces = new JTable ( new FilterTableModel ( ) ) ; namespaces . removeColumn ( namespaces . getColumn ( "#" ) ) ; namespaces . setFillsViewportHeight ( true ) ; namespaces . setPreferredScrollableViewportSize ( new Dimension ( 500 , 70 ) ) ; // Create the scroll pane and add the table to it . JScrollPane scrollPane = new JScrollPane ( namespaces ) ; scrollPane . setBounds ( 70 , 10 , 300 , 200 ) ; this . add ( scrollPane ) ;
public class ServerView { /** * / * @ inheritDoc */ public void serverChanged ( HadoopServer location , int type ) { } }
Display . getDefault ( ) . syncExec ( new Runnable ( ) { public void run ( ) { ServerView . this . viewer . refresh ( ) ; } } ) ;
public class SearchBuilders { /** * Returns a new { @ link PhraseConditionBuilder } for the specified field and values . * @ param field The name of the field to be matched . * @ param values The values of the field to be matched . * @ return A new { @ link PhraseConditionBuilder } for the specified field and values . */ public static PhraseConditionBuilder phrase ( String field , List < String > values ) { } }
return new PhraseConditionBuilder ( field , values ) ;
public class DdthCipherInputStream { /** * Load data to internal buffer , return the number of bytes read , or { @ code - 1 } if no more data * to read . * @ return * @ throws IOException */ private int getMoreData ( ) throws IOException { } }
if ( noMoreInput ) { return - 1 ; } else { byte [ ] buffer = new byte [ 1024 ] ; int bytesRead = input . read ( buffer ) ; if ( bytesRead == - 1 ) { noMoreInput = true ; try { obuffer = cipher . doFinal ( ) ; } catch ( IllegalBlockSizeException | BadPaddingException e ) { throw new CipherException ( e ) ; } if ( obuffer == null ) { return - 1 ; } else { ostart = 0 ; return ofinish = obuffer . length ; } } else { obuffer = cipher . update ( buffer , 0 , bytesRead ) ; ostart = 0 ; return ofinish = ( obuffer == null ? 0 : obuffer . length ) ; } }
public class HTMLBoxFactory { /** * Checks whether the given tag ( DOM element ) processing is supported by this factory . * @ param e The DOM element to be checked . * @ return < code > true < / code > when the element may be processed by this factory . */ public boolean isTagSupported ( Element e ) { } }
if ( e . getNodeName ( ) != null && supported . contains ( e . getNodeName ( ) . toLowerCase ( ) ) ) // completely supported tags return true ; else // special cases { // empty anchor elements must be preserved if ( e . getNodeName ( ) . toLowerCase ( ) . equals ( "a" ) && e . hasAttribute ( "name" ) && ( e . getTextContent ( ) == null || e . getTextContent ( ) . trim ( ) . length ( ) == 0 ) ) return true ; else return false ; }
public class Host { /** * The IDs and instance type that are currently running on the Dedicated Host . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setInstances ( java . util . Collection ) } or { @ link # withInstances ( java . util . Collection ) } if you want to * override the existing values . * @ param instances * The IDs and instance type that are currently running on the Dedicated Host . * @ return Returns a reference to this object so that method calls can be chained together . */ public Host withInstances ( HostInstance ... instances ) { } }
if ( this . instances == null ) { setInstances ( new com . amazonaws . internal . SdkInternalList < HostInstance > ( instances . length ) ) ; } for ( HostInstance ele : instances ) { this . instances . add ( ele ) ; } return this ;
public class WebUtil { /** * redirect to url * @ param response HttpServletResponse object * @ param url recirect url * @ param movePermanently true 301 for permanent redirect , false 302 ( temporary redirect ) * @ throws java . io . IOException */ public static void redirect ( HttpServletResponse response , String url , boolean movePermanently ) throws IOException { } }
if ( ! movePermanently ) { response . sendRedirect ( url ) ; } else { response . setStatus ( HttpServletResponse . SC_MOVED_PERMANENTLY ) ; response . setHeader ( "Location" , url ) ; }
public class WriterBasedGenerator { /** * Method called to output textual context which has been copied * to the output buffer prior to call . If any escaping is needed , * it will also be handled by the method . * Note : when called , textual content to write is within output * buffer , right after buffered content ( if any ) . That ' s why only * length of that text is passed , as buffer and offset are implied . */ private final void _writeSegment ( int end ) throws IOException , JsonGenerationException { } }
final int [ ] escCodes = _outputEscapes ; final int escLen = escCodes . length ; int ptr = 0 ; int start = ptr ; output_loop : while ( ptr < end ) { // Fast loop for chars not needing escaping char c ; while ( true ) { c = _outputBuffer [ ptr ] ; if ( c < escLen && escCodes [ c ] != 0 ) { break ; } if ( ++ ptr >= end ) { break ; } } // Ok , bumped into something that needs escaping . /* First things first : need to flush the buffer . * Inlined , as we don ' t want to lose tail pointer */ int flushLen = ( ptr - start ) ; if ( flushLen > 0 ) { _writer . write ( _outputBuffer , start , flushLen ) ; if ( ptr >= end ) { break output_loop ; } } ++ ptr ; // So ; either try to prepend ( most likely ) , or write directly : start = _prependOrWriteCharacterEscape ( _outputBuffer , ptr , end , c , escCodes [ c ] ) ; }
public class DocPath { /** * Return the path for a class . * For example , if the class is java . lang . Object , * the path is java / lang / Object . html . */ public static DocPath forClass ( ClassDoc cd ) { } }
return ( cd == null ) ? empty : forPackage ( cd . containingPackage ( ) ) . resolve ( forName ( cd ) ) ;
public class InodeTree { /** * Deletes a single inode from the inode tree by removing it from the parent inode . * @ param rpcContext the rpc context * @ param inodePath the { @ link LockedInodePath } to delete * @ param opTimeMs the operation time * @ throws FileDoesNotExistException if the Inode cannot be retrieved */ public void deleteInode ( RpcContext rpcContext , LockedInodePath inodePath , long opTimeMs ) throws FileDoesNotExistException { } }
Preconditions . checkState ( inodePath . getLockPattern ( ) == LockPattern . WRITE_EDGE ) ; Inode inode = inodePath . getInode ( ) ; mState . applyAndJournal ( rpcContext , DeleteFileEntry . newBuilder ( ) . setId ( inode . getId ( ) ) . setRecursive ( false ) . setOpTimeMs ( opTimeMs ) . build ( ) ) ; if ( inode . isFile ( ) ) { rpcContext . getBlockDeletionContext ( ) . registerBlocksForDeletion ( inode . asFile ( ) . getBlockIds ( ) ) ; }
public class AbstractFilter { /** * Returns the stream that provides output from the filter . */ protected OutputStream getFilterOutput ( ) { } }
OutputStream target = getTarget ( ) ; return target == null ? System . out : target ;