signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class ReflectionUtils { /** * This helper method facilitates creation of wrapper arrays and pre - populates them with the set of String values * provided . E . g . , of wrapper arrays include Integer [ ] , Character [ ] , Boolean [ ] and so on . This method can also be * used to create arrays of types which has a 1 argument String constructor defined . * @ param type * The type of the desired array . * @ param values * A { @ link String } array that represents the set of values that should be used to pre - populate the * newly constructed array . * @ return An array of the type that was specified . */ public static Object instantiateWrapperArray ( Class < ? > type , String [ ] values ) { } }
logger . entering ( new Object [ ] { type , values } ) ; validateParams ( type , values ) ; boolean condition = ( isWrapperArray ( type ) || hasOneArgStringConstructor ( type . getComponentType ( ) ) ) ; checkArgument ( condition , type . getName ( ) + " is neither awrapper type nor has a 1 arg String constructor defined." ) ; Class < ? > componentType = type . getComponentType ( ) ; Object arrayToReturn = Array . newInstance ( componentType , values . length ) ; for ( int i = 0 ; i < values . length ; i ++ ) { try { Array . set ( arrayToReturn , i , componentType . getConstructor ( String . class ) . newInstance ( values [ i ] ) ) ; } catch ( ArrayIndexOutOfBoundsException | IllegalArgumentException | InstantiationException | IllegalAccessException | InvocationTargetException | NoSuchMethodException | SecurityException e ) { throw new ReflectionException ( e ) ; } } logger . exiting ( arrayToReturn ) ; return arrayToReturn ;
public class CloudSchedulerClient { /** * Pauses a job . * < p > If a job is paused then the system will stop executing the job until it is re - enabled via * [ ResumeJob ] [ google . cloud . scheduler . v1beta1 . CloudScheduler . ResumeJob ] . The state of the job is * stored in [ state ] [ google . cloud . scheduler . v1beta1 . Job . state ] ; if paused it will be set to * [ Job . State . PAUSED ] [ google . cloud . scheduler . v1beta1 . Job . State . PAUSED ] . A job must be in * [ Job . State . ENABLED ] [ google . cloud . scheduler . v1beta1 . Job . State . ENABLED ] to be paused . * < p > Sample code : * < pre > < code > * try ( CloudSchedulerClient cloudSchedulerClient = CloudSchedulerClient . create ( ) ) { * JobName name = JobName . of ( " [ PROJECT ] " , " [ LOCATION ] " , " [ JOB ] " ) ; * Job response = cloudSchedulerClient . pauseJob ( name . toString ( ) ) ; * < / code > < / pre > * @ param name Required . * < p > The job name . For example : ` projects / PROJECT _ ID / locations / LOCATION _ ID / jobs / JOB _ ID ` . * @ throws com . google . api . gax . rpc . ApiException if the remote call fails */ public final Job pauseJob ( String name ) { } }
PauseJobRequest request = PauseJobRequest . newBuilder ( ) . setName ( name ) . build ( ) ; return pauseJob ( request ) ;
public class LazyLoadingInterceptor { /** * { @ inheritDoc } */ @ Override public Object intercept ( Object proxy , Method method , Object [ ] args , MethodProxy arg3 ) throws Throwable { } }
if ( id == null ) { throw new NullPointerException ( ) ; } try { if ( loadedTarget == null ) { loadedTarget = daoSupport . findById ( id , targetedLoad ) ; } return method . invoke ( loadedTarget , args ) ; } catch ( Throwable thr ) { thr . printStackTrace ( ) ; if ( InvocationTargetException . class . isInstance ( thr ) ) thr = ( ( InvocationTargetException ) thr ) . getTargetException ( ) ; if ( RuntimeException . class . isInstance ( thr ) ) throw thr ; if ( Error . class . isInstance ( thr ) ) throw thr ; Class < ? > [ ] declaredExceptions = method . getExceptionTypes ( ) ; for ( int i = 0 ; i < declaredExceptions . length ; i ++ ) { if ( declaredExceptions [ i ] . isInstance ( thr ) ) throw thr ; } throw new UndeclaredThrowableException ( thr ) ; }
public class FeatureShapes { /** * Add a map shape with the feature id , database , and table * @ param mapShape map shape * @ param featureId feature id * @ param database GeoPackage database * @ param table table name */ public void addMapShape ( GoogleMapShape mapShape , long featureId , String database , String table ) { } }
FeatureShape featureShape = getFeatureShape ( database , table , featureId ) ; featureShape . addShape ( mapShape ) ;
public class DescribeDBClustersResult { /** * Contains a list of DB clusters for the user . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setDBClusters ( java . util . Collection ) } or { @ link # withDBClusters ( java . util . Collection ) } if you want to * override the existing values . * @ param dBClusters * Contains a list of DB clusters for the user . * @ return Returns a reference to this object so that method calls can be chained together . */ public DescribeDBClustersResult withDBClusters ( DBCluster ... dBClusters ) { } }
if ( this . dBClusters == null ) { setDBClusters ( new java . util . ArrayList < DBCluster > ( dBClusters . length ) ) ; } for ( DBCluster ele : dBClusters ) { this . dBClusters . add ( ele ) ; } return this ;
public class ParameterBuilder { /** * Builds the parameter definition . * @ return Parameter definition */ public Parameter < T > build ( ) { } }
if ( this . name == null ) { throw new IllegalArgumentException ( "Name is missing." ) ; } if ( this . type == null ) { throw new IllegalArgumentException ( "Type is missing." ) ; } if ( this . applicationId == null ) { throw new IllegalArgumentException ( "Application id is missing." ) ; } return new Parameter < T > ( this . name , this . type , this . applicationId , this . defaultOsgiConfigProperty , this . defaultValue , ImmutableValueMap . copyOf ( this . properties ) ) ;
public class ResultUtil { /** * Add a child result . * @ param parent Parent * @ param child Child */ public static void addChildResult ( HierarchicalResult parent , Result child ) { } }
parent . getHierarchy ( ) . add ( parent , child ) ;
public class Dj2JrCrosstabBuilder { /** * set proper expression text invoking the DJCRosstabMeasurePrecalculatedTotalProvider for the cell * @ param auxRows * @ param auxCols * @ param measureExp * @ param djmeasure * @ param crosstabColumn * @ param crosstabRow * @ param meausrePrefix */ private void setExpressionForPrecalculatedTotalValue ( DJCrosstabColumn [ ] auxCols , DJCrosstabRow [ ] auxRows , JRDesignExpression measureExp , DJCrosstabMeasure djmeasure , DJCrosstabColumn crosstabColumn , DJCrosstabRow crosstabRow , String meausrePrefix ) { } }
String rowValuesExp = "new Object[]{" ; String rowPropsExp = "new String[]{" ; for ( int i = 0 ; i < auxRows . length ; i ++ ) { if ( auxRows [ i ] . getProperty ( ) == null ) continue ; rowValuesExp += "$V{" + auxRows [ i ] . getProperty ( ) . getProperty ( ) + "}" ; rowPropsExp += "\"" + auxRows [ i ] . getProperty ( ) . getProperty ( ) + "\"" ; if ( i + 1 < auxRows . length && auxRows [ i + 1 ] . getProperty ( ) != null ) { rowValuesExp += ", " ; rowPropsExp += ", " ; } } rowValuesExp += "}" ; rowPropsExp += "}" ; String colValuesExp = "new Object[]{" ; String colPropsExp = "new String[]{" ; for ( int i = 0 ; i < auxCols . length ; i ++ ) { if ( auxCols [ i ] . getProperty ( ) == null ) continue ; colValuesExp += "$V{" + auxCols [ i ] . getProperty ( ) . getProperty ( ) + "}" ; colPropsExp += "\"" + auxCols [ i ] . getProperty ( ) . getProperty ( ) + "\"" ; if ( i + 1 < auxCols . length && auxCols [ i + 1 ] . getProperty ( ) != null ) { colValuesExp += ", " ; colPropsExp += ", " ; } } colValuesExp += "}" ; colPropsExp += "}" ; String measureProperty = meausrePrefix + djmeasure . getProperty ( ) . getProperty ( ) ; String expText = "(((" + DJCRosstabMeasurePrecalculatedTotalProvider . class . getName ( ) + ")$P{crosstab-measure__" + measureProperty + "_totalProvider}).getValueFor( " + colPropsExp + ", " + colValuesExp + ", " + rowPropsExp + ", " + rowValuesExp + " ))" ; if ( djmeasure . getValueFormatter ( ) != null ) { String fieldsMap = ExpressionUtils . getTextForFieldsFromScriptlet ( ) ; String parametersMap = ExpressionUtils . getTextForParametersFromScriptlet ( ) ; String variablesMap = ExpressionUtils . getTextForVariablesFromScriptlet ( ) ; String stringExpression = "(((" + DJValueFormatter . class . getName ( ) + ")$P{crosstab-measure__" + measureProperty + "_vf}).evaluate( " + "(" + expText + "), " + fieldsMap + ", " + variablesMap + ", " + parametersMap + " ))" ; measureExp . setText ( stringExpression ) ; measureExp . setValueClassName ( djmeasure . getValueFormatter ( ) . getClassName ( ) ) ; } else { // String expText = " ( ( ( " + DJCRosstabMeasurePrecalculatedTotalProvider . class . getName ( ) + " ) $ P { crosstab - measure _ _ " + djmeasure . getProperty ( ) . getProperty ( ) + " _ totalProvider } ) . getValueFor ( " // + colPropsExp + " , " // + colValuesExp + " , " // + rowPropsExp // + rowValuesExp log . debug ( "text for crosstab total provider is: " + expText ) ; measureExp . setText ( expText ) ; // measureExp . setValueClassName ( djmeasure . getValueFormatter ( ) . getClassName ( ) ) ; String valueClassNameForOperation = ExpressionUtils . getValueClassNameForOperation ( djmeasure . getOperation ( ) , djmeasure . getProperty ( ) ) ; measureExp . setValueClassName ( valueClassNameForOperation ) ; }
public class HierarchyControl { /** * Sets the value of provided property to null . * @ param propName * allowed object is { @ link String } */ @ Override public void unset ( String propName ) { } }
if ( propName . equals ( "level" ) ) { unsetLevel ( ) ; } if ( propName . equals ( "treeView" ) ) { unsetTreeView ( ) ; } super . unset ( propName ) ;
public class NPM { /** * Utility method to extract the version from a NPM by reading its ' package . json ' file . * @ param npmDirectory the directory in which the NPM is installed * @ param log the logger object * @ return the read version , " 0.0.0 " if there are not ' package . json ' file , { @ code null } if this file cannot be * read or does not contain the " version " metadata */ public static String getVersionFromNPM ( File npmDirectory , Log log ) { } }
File packageFile = new File ( npmDirectory , PACKAGE_JSON ) ; if ( ! packageFile . isFile ( ) ) { return "0.0.0" ; } FileReader reader = null ; try { reader = new FileReader ( packageFile ) ; // NOSONAR JSONObject json = ( JSONObject ) JSONValue . parseWithException ( reader ) ; return ( String ) json . get ( "version" ) ; } catch ( IOException | ParseException e ) { log . error ( "Cannot extract version from " + packageFile . getAbsolutePath ( ) , e ) ; } finally { IOUtils . closeQuietly ( reader ) ; } return null ;
public class UnmountPRequest { /** * < code > optional . alluxio . grpc . file . UnmountPOptions options = 2 ; < / code > */ public alluxio . grpc . UnmountPOptionsOrBuilder getOptionsOrBuilder ( ) { } }
return options_ == null ? alluxio . grpc . UnmountPOptions . getDefaultInstance ( ) : options_ ;
public class Component { /** * is the template ending with a component extension ? * @ param page * @ return return true if so false otherwse and null if the code is not depending on a template */ private Boolean isInsideCITemplate ( Page page ) { } }
SourceCode sc = page . getSourceCode ( ) ; if ( ! ( sc instanceof PageSourceCode ) ) return null ; PageSource psc = ( ( PageSourceCode ) sc ) . getPageSource ( ) ; String src = psc . getDisplayPath ( ) ; return Constants . isComponentExtension ( ResourceUtil . getExtension ( src , "" ) ) ; // int pos = src . lastIndexOf ( " . " ) ; // return pos ! = - 1 & & pos < src . length ( ) & & src . substring ( pos + 1 ) . equals ( Constants . COMPONENT _ EXTENSION ) ;
public class CommsByteBuffer { /** * Puts a SelectionCriteria object into the byte buffer . * @ param criteria */ public synchronized void putSelectionCriteria ( SelectionCriteria criteria ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "putSelectionCriteria" , criteria ) ; checkValid ( ) ; String discriminator = null ; String selector = null ; short selectorDomain = ( short ) SelectorDomain . SIMESSAGE . toInt ( ) ; if ( criteria != null ) { discriminator = criteria . getDiscriminator ( ) ; selector = criteria . getSelectorString ( ) ; SelectorDomain selDomain = criteria . getSelectorDomain ( ) ; if ( selDomain != null ) { selectorDomain = ( short ) selDomain . toInt ( ) ; } } putShort ( selectorDomain ) ; putString ( discriminator ) ; putString ( selector ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "putSelectionCriteria" ) ;
public class User { /** * Creates a user with a new id . * @ param id The new id . * @ return The user with new id . */ public User withId ( final long id ) { } }
return new User ( id , username , displayName , slug , email , createTimestamp , url , metadata ) ;
public class snmp_user { /** * Use this API to fetch filtered set of snmp _ user resources . * filter string should be in JSON format . eg : " vm _ state : DOWN , name : [ a - z ] + " */ public static snmp_user [ ] get_filtered ( nitro_service service , String filter ) throws Exception { } }
snmp_user obj = new snmp_user ( ) ; options option = new options ( ) ; option . set_filter ( filter ) ; snmp_user [ ] response = ( snmp_user [ ] ) obj . getfiltered ( service , option ) ; return response ;
public class XAttributeUtils { /** * Static helper method for extracting all extensions from an attribute map . * @ param attributeMap * The attribute map from which to extract extensions . * @ return The set of extensions in the attribute map . */ public static Set < XExtension > extractExtensions ( Map < String , XAttribute > attributeMap ) { } }
HashSet < XExtension > extensions = new HashSet < XExtension > ( ) ; for ( XAttribute attribute : attributeMap . values ( ) ) { XExtension extension = attribute . getExtension ( ) ; if ( extension != null ) { extensions . add ( extension ) ; } } return extensions ;
public class Viewport { /** * Set the viewport ' s coordinates from the data stored in the specified parcel . To write a viewport to a parcel , * call writeToParcel ( ) . * @ param in The parcel to read the viewport ' s coordinates from */ public void readFromParcel ( Parcel in ) { } }
left = in . readFloat ( ) ; top = in . readFloat ( ) ; right = in . readFloat ( ) ; bottom = in . readFloat ( ) ;
public class X509CRLEntryImpl { /** * This static method is the default implementation of the * getRevocationReason method in X509CRLEntry . */ public static CRLReason getRevocationReason ( X509CRLEntry crlEntry ) { } }
try { byte [ ] ext = crlEntry . getExtensionValue ( "2.5.29.21" ) ; if ( ext == null ) { return null ; } DerValue val = new DerValue ( ext ) ; byte [ ] data = val . getOctetString ( ) ; CRLReasonCodeExtension rcExt = new CRLReasonCodeExtension ( Boolean . FALSE , data ) ; return rcExt . getReasonCode ( ) ; } catch ( IOException ioe ) { return null ; }
public class ExecArgList { /** * @ return Join a list of strings and then quote the entire string , if specified * @ param commandList1 list of commands * @ param quote quote converter */ public static String joinAndQuote ( List < String > commandList1 , Converter < String , String > quote ) { } }
String join = DataContextUtils . join ( commandList1 , " " ) ; if ( null != quote ) { join = quote . convert ( join ) ; } return join ;
public class SerializerRegistry { /** * Registers a serializer for the given class . * @ param type The serializable class . * @ param factory The serializer factory . * @ return The serializer registry . * @ throws RegistrationException If the given { @ code type } is already registered */ public SerializerRegistry register ( Class < ? > type , TypeSerializerFactory factory ) { } }
return register ( type , calculateTypeId ( type ) , factory ) ;
public class AmazonEC2Client { /** * Modifies a subnet attribute . You can only modify one attribute at a time . * @ param modifySubnetAttributeRequest * @ return Result of the ModifySubnetAttribute operation returned by the service . * @ sample AmazonEC2 . ModifySubnetAttribute * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / ec2-2016-11-15 / ModifySubnetAttribute " target = " _ top " > AWS API * Documentation < / a > */ @ Override public ModifySubnetAttributeResult modifySubnetAttribute ( ModifySubnetAttributeRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeModifySubnetAttribute ( request ) ;
public class OracleDdlParser { /** * If the index type is a bitmap - join the columns are from the dimension tables which are defined in the FROM clause . All * other index types the columns are from the table the index in on . * < code > * column - expression = = left - paren column - name [ ASC | DESC ] | constant | function [ , column - name [ ASC | DESC ] | constant | function ] * right - paren * < / code > * @ param columnExpressionList the comma separated column expression list ( cannot be < code > null < / code > ) * @ param indexNode the index node whose column expression list is being processed ( cannot be < code > null < / code > ) */ private void parseIndexColumnExpressionList ( final String columnExpressionList , final AstNode indexNode ) { } }
final DdlTokenStream tokens = new DdlTokenStream ( columnExpressionList , DdlTokenStream . ddlTokenizer ( false ) , false ) ; tokens . start ( ) ; tokens . consume ( L_PAREN ) ; // must have opening paren int numLeft = 1 ; int numRight = 0 ; // must have content between the parens if ( ! tokens . matches ( R_PAREN ) ) { final List < String > possibleColumns = new ArrayList < String > ( ) ; // dimension table columns final List < String > functions = new ArrayList < String > ( ) ; // functions , constants final StringBuilder text = new StringBuilder ( ) ; boolean isFunction = false ; while ( tokens . hasNext ( ) ) { if ( tokens . canConsume ( COMMA ) ) { if ( isFunction ) { functions . add ( text . toString ( ) ) ; } else { possibleColumns . add ( text . toString ( ) ) ; } text . setLength ( 0 ) ; // clear out isFunction = false ; continue ; } if ( tokens . matches ( L_PAREN ) ) { isFunction = true ; ++ numLeft ; } else if ( tokens . matches ( "ASC" ) || tokens . matches ( "DESC" ) ) { text . append ( SPACE ) ; } else if ( tokens . matches ( R_PAREN ) ) { if ( numLeft == ++ numRight ) { if ( isFunction ) { functions . add ( text . toString ( ) ) ; } else { possibleColumns . add ( text . toString ( ) ) ; } break ; } } text . append ( tokens . consume ( ) ) ; } if ( ! possibleColumns . isEmpty ( ) ) { List < AstNode > tableNodes = null ; final boolean tableIndex = indexNode . hasMixin ( OracleDdlLexicon . TYPE_CREATE_TABLE_INDEX_STATEMENT ) ; // find appropriate table nodes if ( tableIndex ) { // table index so find table node final String tableName = ( String ) indexNode . getProperty ( OracleDdlLexicon . TABLE_NAME ) ; final AstNode parent = indexNode . getParent ( ) ; final List < AstNode > nodes = parent . childrenWithName ( tableName ) ; if ( ! nodes . isEmpty ( ) ) { if ( nodes . size ( ) == 1 ) { tableNodes = nodes ; } else { // this should not be possible but check none the less for ( final AstNode node : nodes ) { if ( node . hasMixin ( StandardDdlLexicon . TYPE_CREATE_TABLE_STATEMENT ) ) { tableNodes = new ArrayList < AstNode > ( 1 ) ; tableNodes . add ( node ) ; break ; } } } } } else { // must be bitmap - join tableNodes = indexNode . getChildren ( StandardDdlLexicon . TYPE_TABLE_REFERENCE ) ; } if ( ( tableNodes != null ) && ! tableNodes . isEmpty ( ) ) { boolean processed = false ; for ( String possibleColumn : possibleColumns ) { // first determine any ordering final int ascIndex = possibleColumn . toUpperCase ( ) . indexOf ( " ASC" ) ; final boolean asc = ( ascIndex != - 1 ) ; final int descIndex = possibleColumn . toUpperCase ( ) . indexOf ( " DESC" ) ; boolean desc = ( descIndex != - 1 ) ; // adjust column name if there is ordering if ( asc ) { possibleColumn = possibleColumn . substring ( 0 , ascIndex ) ; } else if ( desc ) { possibleColumn = possibleColumn . substring ( 0 , descIndex ) ; } if ( tableIndex ) { if ( tableNodes . isEmpty ( ) ) { if ( asc ) { functions . add ( possibleColumn + SPACE + "ASC" ) ; } else if ( desc ) { functions . add ( possibleColumn + SPACE + "DESC" ) ; } else { functions . add ( possibleColumn ) ; } } else { // only one table reference . need to find column . final AstNode tableNode = tableNodes . get ( 0 ) ; final List < AstNode > columnNodes = tableNode . getChildren ( StandardDdlLexicon . TYPE_COLUMN_DEFINITION ) ; if ( ! columnNodes . isEmpty ( ) ) { // find column for ( final AstNode colNode : columnNodes ) { if ( colNode . getName ( ) . equalsIgnoreCase ( possibleColumn ) ) { final AstNode colRef = nodeFactory ( ) . node ( possibleColumn , indexNode , TYPE_COLUMN_REFERENCE ) ; if ( asc || desc ) { colRef . addMixin ( OracleDdlLexicon . TYPE_INDEX_ORDERABLE ) ; if ( asc ) { colRef . setProperty ( OracleDdlLexicon . INDEX_ORDER , "ASC" ) ; } else { colRef . setProperty ( OracleDdlLexicon . INDEX_ORDER , "DESC" ) ; } } processed = true ; break ; } } } if ( ! processed ) { if ( asc ) { functions . add ( possibleColumn + SPACE + "ASC" ) ; } else if ( desc ) { functions . add ( possibleColumn + SPACE + "DESC" ) ; } else { functions . add ( possibleColumn ) ; } processed = true ; } } } else { // bitmap - join for ( final AstNode dimensionTableNode : tableNodes ) { if ( possibleColumn . toUpperCase ( Locale . ROOT ) . startsWith ( dimensionTableNode . getName ( ) . toUpperCase ( Locale . ROOT ) + PERIOD ) ) { final AstNode colRef = nodeFactory ( ) . node ( possibleColumn , indexNode , TYPE_COLUMN_REFERENCE ) ; if ( asc || desc ) { colRef . addMixin ( OracleDdlLexicon . TYPE_INDEX_ORDERABLE ) ; if ( asc ) { colRef . setProperty ( OracleDdlLexicon . INDEX_ORDER , "ASC" ) ; } else { colRef . setProperty ( OracleDdlLexicon . INDEX_ORDER , "DESC" ) ; } } processed = true ; break ; } } // probably a constant or function if ( ! processed ) { if ( asc ) { functions . add ( possibleColumn + SPACE + "ASC" ) ; } else if ( desc ) { functions . add ( possibleColumn + SPACE + "DESC" ) ; } else { functions . add ( possibleColumn ) ; } processed = true ; } } } } } if ( ! functions . isEmpty ( ) ) { indexNode . setProperty ( OracleDdlLexicon . OTHER_INDEX_REFS , functions ) ; } } if ( numLeft != numRight ) { throw new ParsingException ( tokens . nextPosition ( ) ) ; } tokens . consume ( R_PAREN ) ; // must have closing paren
public class AccountsInner { /** * Attempts to enable a user managed key vault for encryption of the specified Data Lake Store account . * @ param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account . * @ param accountName The name of the Data Lake Store account to attempt to enable the Key Vault for . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the { @ link ServiceResponse } object if successful . */ public Observable < Void > enableKeyVaultAsync ( String resourceGroupName , String accountName ) { } }
return enableKeyVaultWithServiceResponseAsync ( resourceGroupName , accountName ) . map ( new Func1 < ServiceResponse < Void > , Void > ( ) { @ Override public Void call ( ServiceResponse < Void > response ) { return response . body ( ) ; } } ) ;
public class ApiClientMgr { /** * Huawe Api Client 连接成功回到 */ @ Override public void onConnected ( ) { } }
HMSAgentLog . d ( "connect success" ) ; timeoutHandler . removeMessages ( APICLIENT_TIMEOUT_HANDLE_MSG ) ; onConnectEnd ( ConnectionResult . SUCCESS ) ;
public class Datatype_Builder { /** * Replaces the value to be returned by { @ link Datatype # isInterfaceType ( ) } by applying { @ code * mapper } to it and using the result . * @ return this { @ code Builder } object * @ throws NullPointerException if { @ code mapper } is null or returns null * @ throws IllegalStateException if the field has not been set */ public Datatype . Builder mapInterfaceType ( UnaryOperator < Boolean > mapper ) { } }
Objects . requireNonNull ( mapper ) ; return setInterfaceType ( mapper . apply ( isInterfaceType ( ) ) ) ;
public class Jenkins { /** * Gets the names of all the { @ link Job } s . */ public Collection < String > getJobNames ( ) { } }
List < String > names = new ArrayList < > ( ) ; for ( Job j : allItems ( Job . class ) ) names . add ( j . getFullName ( ) ) ; names . sort ( String . CASE_INSENSITIVE_ORDER ) ; return names ;
public class KeyValueStoreSessionManager { @ Override public void doStart ( ) throws Exception { } }
log . info ( "starting..." ) ; super . doStart ( ) ; if ( _cookieDomain == null ) { String [ ] cookieDomains = getContextHandler ( ) . getVirtualHosts ( ) ; // commented as api dropped in jetty9 // if ( cookieDomains = = null | | cookieDomains . length = = 0) // cookieDomains = getContextHandler ( ) . getConnectorNames ( ) ; if ( cookieDomains == null || cookieDomains . length == 0 ) { cookieDomains = new String [ ] { "*" } ; } this . _cookieDomain = cookieDomains [ 0 ] ; } if ( _cookiePath == null ) { String cookiePath = getContext ( ) . getContextPath ( ) ; if ( cookiePath == null || "" . equals ( cookiePath ) ) { cookiePath = "*" ; } this . _cookiePath = cookiePath ; } if ( sessionFactory == null ) { sessionFactory = new SerializableSessionFactory ( ) ; } log . info ( "use " + sessionFactory . getClass ( ) . getSimpleName ( ) + " as session factory." ) ; try { // use context class loader during object deserialization . // thanks Daniel Peters ! ClassLoader cl = getContext ( ) . getClassLoader ( ) ; if ( cl != null ) { sessionFactory . setClassLoader ( cl ) ; log . info ( "use context class loader for session deserializer." ) ; } // FIXME : is there any safe way to refer context ' s class loader ? // getContext ( ) . getClassLoader ( ) may raise SecurityException . // this will be determine by policy configuration of JRE . } catch ( SecurityException error ) { } log . info ( "started." ) ;
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link String } { @ code > } } */ @ XmlElementDecl ( namespace = "http://www.drugbank.ca" , name = "protein-name" , scope = SnpEffectType . class ) public JAXBElement < String > createSnpEffectTypeProteinName ( String value ) { } }
return new JAXBElement < String > ( _SnpAdverseDrugReactionTypeProteinName_QNAME , String . class , SnpEffectType . class , value ) ;
public class AWSServiceDiscoveryClient { /** * Creates a public namespace based on DNS , which will be visible on the internet . The namespace defines your * service naming scheme . For example , if you name your namespace < code > example . com < / code > and name your service * < code > backend < / code > , the resulting DNS name for the service will be < code > backend . example . com < / code > . For the * current limit on the number of namespaces that you can create using the same AWS account , see < a * href = " http : / / docs . aws . amazon . com / cloud - map / latest / dg / cloud - map - limits . html " > AWS Cloud Map Limits < / a > in the * < i > AWS Cloud Map Developer Guide < / i > . * @ param createPublicDnsNamespaceRequest * @ return Result of the CreatePublicDnsNamespace operation returned by the service . * @ throws InvalidInputException * One or more specified values aren ' t valid . For example , a required value might be missing , a numeric * value might be outside the allowed range , or a string value might exceed length constraints . * @ throws NamespaceAlreadyExistsException * The namespace that you ' re trying to create already exists . * @ throws ResourceLimitExceededException * The resource can ' t be created because you ' ve reached the limit on the number of resources . * @ throws DuplicateRequestException * The operation is already in progress . * @ sample AWSServiceDiscovery . CreatePublicDnsNamespace * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / servicediscovery - 2017-03-14 / CreatePublicDnsNamespace " * target = " _ top " > AWS API Documentation < / a > */ @ Override public CreatePublicDnsNamespaceResult createPublicDnsNamespace ( CreatePublicDnsNamespaceRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeCreatePublicDnsNamespace ( request ) ;
public class CSSURLHelper { /** * Surround the passed URL with the CSS " url ( . . . ) " . When the passed URL * contains characters that require quoting , quotes are automatically added ! * @ param sURL * URL to be wrapped . May not be < code > null < / code > but maybe empty . * @ param bForceQuoteURL * if < code > true < / code > single quotes are added around the URL * @ return < code > url ( < i > sURL < / i > ) < / code > or < code > url ( ' < i > sURL < / i > ' ) < / code > */ @ Nonnull @ Nonempty public static String getAsCSSURL ( @ Nonnull final String sURL , final boolean bForceQuoteURL ) { } }
ValueEnforcer . notNull ( sURL , "URL" ) ; final StringBuilder aSB = new StringBuilder ( CCSSValue . PREFIX_URL_OPEN ) ; final boolean bAreQuotesRequired = bForceQuoteURL || isCSSURLRequiringQuotes ( sURL ) ; if ( bAreQuotesRequired ) { // Determine the best quote char to use - default to ' \ ' ' for backwards // compatibility final int nIndexSingleQuote = sURL . indexOf ( '\'' ) ; final int nIndexDoubleQuote = sURL . indexOf ( '"' ) ; final char cQuote = nIndexSingleQuote >= 0 && nIndexDoubleQuote < 0 ? '"' : '\'' ; // Append the quoted and escaped URL aSB . append ( cQuote ) . append ( getEscapedCSSURL ( sURL , cQuote ) ) . append ( cQuote ) ; } else { // No quotes needed aSB . append ( sURL ) ; } return aSB . append ( CCSSValue . SUFFIX_URL_CLOSE ) . toString ( ) ;
public class DefaultRedirectResolver { /** * Check if host matches the registered value . * @ param registered the registered host * @ param requested the requested host * @ return true if they match */ protected boolean hostMatches ( String registered , String requested ) { } }
if ( matchSubdomains ) { return registered . equals ( requested ) || requested . endsWith ( "." + registered ) ; } return registered . equals ( requested ) ;
public class GLTextureView { /** * This method is used as part of the View class and is not normally * called or subclassed by clients of GLSurfaceView . * Must not be called before a renderer has been set . */ @ Override protected void onDetachedFromWindow ( ) { } }
if ( LOG_ATTACH_DETACH ) { Log . d ( TAG , "onDetachedFromWindow" ) ; } if ( mGLThread != null ) { mGLThread . requestExitAndWait ( ) ; } mDetached = true ; super . onDetachedFromWindow ( ) ;
public class RSocketClientCodec { /** * Encoder function . * @ param message client message . * @ param transformer bi function transformer from two headers and data buffers to client * specified object of type T * @ param < T > client specified type which could be constructed out of headers and data bufs . * @ return T object * @ throws MessageCodecException in case if encoding fails */ private < T > T encodeAndTransform ( ClientMessage message , BiFunction < ByteBuf , ByteBuf , T > transformer ) throws MessageCodecException { } }
ByteBuf dataBuffer = Unpooled . EMPTY_BUFFER ; ByteBuf headersBuffer = Unpooled . EMPTY_BUFFER ; if ( message . hasData ( ByteBuf . class ) ) { dataBuffer = message . data ( ) ; } else if ( message . hasData ( ) ) { dataBuffer = ByteBufAllocator . DEFAULT . buffer ( ) ; try { dataCodec . encode ( new ByteBufOutputStream ( dataBuffer ) , message . data ( ) ) ; } catch ( Throwable ex ) { ReferenceCountUtil . safestRelease ( dataBuffer ) ; LOGGER . error ( "Failed to encode data on: {}, cause: {}" , message , ex ) ; throw new MessageCodecException ( "Failed to encode data on message q=" + message . qualifier ( ) , ex ) ; } } if ( ! message . headers ( ) . isEmpty ( ) ) { headersBuffer = ByteBufAllocator . DEFAULT . buffer ( ) ; try { headersCodec . encode ( new ByteBufOutputStream ( headersBuffer ) , message . headers ( ) ) ; } catch ( Throwable ex ) { ReferenceCountUtil . safestRelease ( headersBuffer ) ; ReferenceCountUtil . safestRelease ( dataBuffer ) ; // release data as well LOGGER . error ( "Failed to encode headers on: {}, cause: {}" , message , ex ) ; throw new MessageCodecException ( "Failed to encode headers on message q=" + message . qualifier ( ) , ex ) ; } } return transformer . apply ( dataBuffer , headersBuffer ) ;
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link SemanticsType } { @ code > } } */ @ XmlElementDecl ( namespace = "http://www.w3.org/1998/Math/MathML" , name = "semantics" ) public JAXBElement < SemanticsType > createSemantics ( SemanticsType value ) { } }
return new JAXBElement < SemanticsType > ( _Semantics_QNAME , SemanticsType . class , null , value ) ;
public class ConcurrentCollectorMultiple { /** * Internal method to invoke the performed for the passed list of objects . * @ param aObjectsToPerform * List of objects to be passed to the performer . Never * < code > null < / code > . The length is at last * { @ link # getMaxPerformCount ( ) } . * @ return { @ link ESuccess } */ @ Nonnull private ESuccess _perform ( @ Nonnull final List < DATATYPE > aObjectsToPerform ) { } }
if ( ! aObjectsToPerform . isEmpty ( ) ) { try { // Perform the action on the objects , regardless of whether a // " stop queue message " was received or not m_aPerformer . runAsync ( aObjectsToPerform ) ; } catch ( final Exception ex ) { LOGGER . error ( "Failed to perform actions on " + aObjectsToPerform . size ( ) + " objects with performer " + m_aPerformer + " - objects are lost!" , ex ) ; return ESuccess . FAILURE ; } // clear perform - list anyway aObjectsToPerform . clear ( ) ; } return ESuccess . SUCCESS ;
public class ServerCommonLoginModule { /** * Common method called by all login modules that use the UserRegistry ( UsernameAndPasswordLoginModule , * CertificateLoginModule , HashtableLoginModule and TokenLoginModule ) . Determines the securityName to use * for the login . * @ param loginName The username passed to the login * @ param urAuthenticatedId The id returned by UserRegistry checkPassword or mapCertificate . * @ return The securityName to use for the WSPrincipal . * @ throws EntryNotFoundException * @ throws RegistryException */ protected String getSecurityName ( String loginName , String urAuthenticatedId ) throws EntryNotFoundException , RegistryException { } }
UserRegistry ur = getUserRegistry ( ) ; if ( ur != null && ur . getType ( ) != "CUSTOM" ) { // Preserve the existing behavior for CUSTOM user registries String securityName = ur . getUserSecurityName ( urAuthenticatedId ) ; if ( securityName != null ) { return securityName ; } } // If a loginName was provided , use it . if ( loginName != null ) { return loginName ; } if ( ur != null ) { return ur . getUserSecurityName ( urAuthenticatedId ) ; } else { throw new NullPointerException ( "No user registry" ) ; }
public class GVRAudioManager { /** * Removes an audio source from the audio manager . * @ param audioSource audio source to remove */ public void removeSource ( GVRAudioSource audioSource ) { } }
synchronized ( mAudioSources ) { audioSource . setListener ( null ) ; mAudioSources . remove ( audioSource ) ; }
public class AWSStorageGatewayClient { /** * Updates the type of medium changer in a tape gateway . When you activate a tape gateway , you select a medium * changer type for the tape gateway . This operation enables you to select a different type of medium changer after * a tape gateway is activated . This operation is only supported in the tape gateway type . * @ param updateVTLDeviceTypeRequest * @ return Result of the UpdateVTLDeviceType operation returned by the service . * @ throws InvalidGatewayRequestException * An exception occurred because an invalid gateway request was issued to the service . For more information , * see the error and message fields . * @ throws InternalServerErrorException * An internal server error has occurred during the request . For more information , see the error and message * fields . * @ sample AWSStorageGateway . UpdateVTLDeviceType * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / storagegateway - 2013-06-30 / UpdateVTLDeviceType " * target = " _ top " > AWS API Documentation < / a > */ @ Override public UpdateVTLDeviceTypeResult updateVTLDeviceType ( UpdateVTLDeviceTypeRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeUpdateVTLDeviceType ( request ) ;
public class BNFHeadersImpl { /** * Method to marshall the current set of headers but use the existing parse * buffers they were originally found in . This might require deleting some * headers from those buffers , as well as allocating new buffers to handle * additional headers . * @ param inBuffers * @ return WsByteBuffer [ ] */ private WsByteBuffer [ ] marshallReuseHeaders ( WsByteBuffer [ ] inBuffers ) { } }
final boolean bTrace = TraceComponent . isAnyTracingEnabled ( ) ; WsByteBuffer [ ] src = inBuffers ; if ( bTrace && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Marshalling headers and re-using buffers, change=" + this . headerChangeCount + ", add=" + this . headerAddCount + ", src=" + src ) ; } HeaderElement elem = this . hdrSequence ; WsByteBuffer [ ] buffers = src ; int size = this . parseIndex + ( 0 < this . headerAddCount ? 2 : 1 ) ; int output = 0 ; int input = 0 ; if ( null == src || 0 == src . length ) { // the first line has not changed buffers = new WsByteBuffer [ size ] ; } else { // first line has been remarshalled . We need to update the parse // buffers to trim off the first line data . Dump any first line data // from the cache and flip the last buffer . src = flushCache ( src ) ; src [ src . length - 1 ] . flip ( ) ; int firstHeaderBuffer = elem . getLastCRLFBufferIndex ( ) ; for ( int i = 0 ; i < firstHeaderBuffer ; i ++ ) { if ( bTrace && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Trimming first line data from " + this . parseBuffers [ i ] ) ; } this . parseBuffersStartPos [ i ] = this . parseBuffers [ i ] . limit ( ) ; } int firstHeaderPos = elem . getLastCRLFPosition ( ) + ( elem . isLastCRLFaCR ( ) ? 2 : 1 ) ; if ( bTrace && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Setting first buffer with headers pos to " + firstHeaderPos ) ; } this . parseBuffersStartPos [ firstHeaderBuffer ] = firstHeaderPos ; size = size - firstHeaderBuffer + src . length ; buffers = new WsByteBuffer [ size ] ; System . arraycopy ( src , 0 , buffers , 0 , src . length ) ; output = src . length ; input = firstHeaderBuffer ; } // handle any changed / removed headers if ( 0 < this . headerChangeCount ) { elem = this . hdrSequence ; for ( int i = 0 ; i < this . headerChangeCount && null != elem && - 1 != elem . getLastCRLFBufferIndex ( ) ; ) { if ( elem . wasRemoved ( ) ) { eraseValue ( elem ) ; i ++ ; } else if ( elem . wasChanged ( ) ) { overlayValue ( elem ) ; i ++ ; } elem = elem . nextSequence ; } } // copy the existing parse buffers to the output list , fixing positions // as we go , up until the last header buffer for ( ; input < this . parseIndex ; input ++ , output ++ ) { buffers [ output ] = this . parseBuffers [ input ] ; buffers [ output ] . position ( this . parseBuffersStartPos [ input ] ) ; if ( bTrace && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Copying existing parse buffer: " + buffers [ output ] ) ; } } // now slice the last header buffer . If no additional headers are there , // then leave the double EOL , otherwise trim one of them off int endPos = this . eohPosition ; if ( 0 < this . headerAddCount ) { endPos = this . lastCRLFPosition + 1 ; if ( this . lastCRLFisCR ) { endPos ++ ; } } WsByteBuffer buffer = this . parseBuffers [ input ] ; int pos = buffer . position ( ) ; int lim = buffer . limit ( ) ; buffer . position ( this . parseBuffersStartPos [ input ] ) ; buffer . limit ( endPos ) ; buffers [ output ] = buffer . slice ( ) ; addToCreatedBuffer ( buffers [ output ] ) ; buffer . limit ( lim ) ; buffer . position ( pos ) ; if ( bTrace && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Sliced last header buffer: " + buffers [ output ] ) ; } // check whether we need to marshall any new headers if ( 0 < this . headerAddCount ) { buffers = marshallAddedHeaders ( buffers , ++ output ) ; } return buffers ;
public class URLHandler { /** * Encode the specified URL String with percent encoding . * Order of encoding : * 1 . Encode percent signs to " % 25 " . Not doing this first will clobber subsequent encodings . * 2 . Encode semi - colons to " % 3B " since they are invalid in cookie values . * 3 . Encode commas to " % 2C " . * @ param url a non - null String * @ return encoded version of url */ @ Sensitive protected String encodeURL ( @ Sensitive String url ) { } }
url = url . replaceAll ( "%" , "%25" ) ; url = url . replaceAll ( ";" , "%3B" ) ; url = url . replaceAll ( "," , "%2C" ) ; return url ;
public class MCARGImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public Object eGet ( int featureID , boolean resolve , boolean coreType ) { } }
switch ( featureID ) { case AfplibPackage . MCARG__RG_LENGTH : return getRGLength ( ) ; case AfplibPackage . MCARG__TRIPLETS : return getTriplets ( ) ; } return super . eGet ( featureID , resolve , coreType ) ;
public class XConstructorCallImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public void eUnset ( int featureID ) { } }
switch ( featureID ) { case XbasePackage . XCONSTRUCTOR_CALL__CONSTRUCTOR : setConstructor ( ( JvmConstructor ) null ) ; return ; case XbasePackage . XCONSTRUCTOR_CALL__ARGUMENTS : getArguments ( ) . clear ( ) ; return ; case XbasePackage . XCONSTRUCTOR_CALL__TYPE_ARGUMENTS : getTypeArguments ( ) . clear ( ) ; return ; case XbasePackage . XCONSTRUCTOR_CALL__INVALID_FEATURE_ISSUE_CODE : setInvalidFeatureIssueCode ( INVALID_FEATURE_ISSUE_CODE_EDEFAULT ) ; return ; case XbasePackage . XCONSTRUCTOR_CALL__EXPLICIT_CONSTRUCTOR_CALL : setExplicitConstructorCall ( EXPLICIT_CONSTRUCTOR_CALL_EDEFAULT ) ; return ; case XbasePackage . XCONSTRUCTOR_CALL__ANONYMOUS_CLASS_CONSTRUCTOR_CALL : setAnonymousClassConstructorCall ( ANONYMOUS_CLASS_CONSTRUCTOR_CALL_EDEFAULT ) ; return ; } super . eUnset ( featureID ) ;
public class KeyVaultClientBaseImpl { /** * Updates the specified certificate issuer . * The UpdateCertificateIssuer operation performs an update on the specified certificate issuer entity . This operation requires the certificates / setissuers permission . * @ param vaultBaseUrl The vault name , for example https : / / myvault . vault . azure . net . * @ param issuerName The name of the issuer . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ throws KeyVaultErrorException thrown if the request is rejected by server * @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @ return the IssuerBundle object if successful . */ public IssuerBundle updateCertificateIssuer ( String vaultBaseUrl , String issuerName ) { } }
return updateCertificateIssuerWithServiceResponseAsync ( vaultBaseUrl , issuerName ) . toBlocking ( ) . single ( ) . body ( ) ;
public class NumberRange { /** * Increments by given step * @ param value the value to increment * @ param step the amount to increment * @ return the incremented value */ @ SuppressWarnings ( "unchecked" ) private Comparable increment ( Object value , Number step ) { } }
return ( Comparable ) plus ( ( Number ) value , step ) ;
public class RoaringBitmap { /** * Checks whether the value is included , which is equivalent to checking if the corresponding bit * is set ( get in BitSet class ) . * @ param x integer value * @ return whether the integer value is included . */ @ Override public boolean contains ( final int x ) { } }
final short hb = Util . highbits ( x ) ; final Container c = highLowContainer . getContainer ( hb ) ; return c != null && c . contains ( Util . lowbits ( x ) ) ;
public class RequestMessage { /** * @ see javax . servlet . ServletRequest # getServerName ( ) */ @ Override public String getServerName ( ) { } }
String name = this . request . getVirtualHost ( ) ; if ( null == name ) { name = "localhost" ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "getServerName: " + name ) ; } return name ;
public class SamlProfileSamlAuthNStatementBuilder { /** * Creates an authentication statement for the current request . * @ param casAssertion the cas assertion * @ param authnRequest the authn request * @ param adaptor the adaptor * @ param service the service * @ param binding the binding * @ param messageContext the message context * @ param request the request * @ return constructed authentication statement * @ throws SamlException the saml exception */ private AuthnStatement buildAuthnStatement ( final Object casAssertion , final RequestAbstractType authnRequest , final SamlRegisteredServiceServiceProviderMetadataFacade adaptor , final SamlRegisteredService service , final String binding , final MessageContext messageContext , final HttpServletRequest request ) throws SamlException { } }
val assertion = Assertion . class . cast ( casAssertion ) ; val authenticationMethod = this . authnContextClassRefBuilder . build ( assertion , authnRequest , adaptor , service ) ; var id = request != null ? CommonUtils . safeGetParameter ( request , CasProtocolConstants . PARAMETER_TICKET ) : StringUtils . EMPTY ; if ( StringUtils . isBlank ( id ) ) { LOGGER . warn ( "Unable to locate service ticket as the session index; Generating random identifier instead..." ) ; id = '_' + String . valueOf ( RandomUtils . nextLong ( ) ) ; } val statement = newAuthnStatement ( authenticationMethod , DateTimeUtils . zonedDateTimeOf ( assertion . getAuthenticationDate ( ) ) , id ) ; if ( assertion . getValidUntilDate ( ) != null ) { val dt = DateTimeUtils . zonedDateTimeOf ( assertion . getValidUntilDate ( ) ) ; statement . setSessionNotOnOrAfter ( DateTimeUtils . dateTimeOf ( dt . plusSeconds ( casProperties . getAuthn ( ) . getSamlIdp ( ) . getResponse ( ) . getSkewAllowance ( ) ) ) ) ; } val subjectLocality = buildSubjectLocality ( assertion , authnRequest , adaptor , binding ) ; statement . setSubjectLocality ( subjectLocality ) ; return statement ;
public class NioDatagramChannel { /** * Block the given sourceToBlock address for the given multicastAddress on the given networkInterface */ @ Override public ChannelFuture block ( InetAddress multicastAddress , NetworkInterface networkInterface , InetAddress sourceToBlock , ChannelPromise promise ) { } }
checkJavaVersion ( ) ; if ( multicastAddress == null ) { throw new NullPointerException ( "multicastAddress" ) ; } if ( sourceToBlock == null ) { throw new NullPointerException ( "sourceToBlock" ) ; } if ( networkInterface == null ) { throw new NullPointerException ( "networkInterface" ) ; } synchronized ( this ) { if ( memberships != null ) { List < MembershipKey > keys = memberships . get ( multicastAddress ) ; for ( MembershipKey key : keys ) { if ( networkInterface . equals ( key . networkInterface ( ) ) ) { try { key . block ( sourceToBlock ) ; } catch ( IOException e ) { promise . setFailure ( e ) ; } } } } } promise . setSuccess ( ) ; return promise ;
public class SeekBarPreference { /** * Obtains the maximum value , the preference allows to choose , from a specific typed array . * @ param typedArray * The typed array , the maximum value should be obtained from , as an instance of the * class { @ link TypedArray } . The typed array may not be null */ private void obtainMaxValue ( @ NonNull final TypedArray typedArray ) { } }
int defaultValue = getContext ( ) . getResources ( ) . getInteger ( R . integer . seek_bar_preference_default_max_value ) ; setMaxValue ( typedArray . getInteger ( R . styleable . AbstractNumericPreference_android_max , defaultValue ) ) ;
public class EncodedImage { /** * Copy the meta data from another EncodedImage . * @ param encodedImage the EncodedImage to copy the meta data from . */ public void copyMetaDataFrom ( EncodedImage encodedImage ) { } }
mImageFormat = encodedImage . getImageFormat ( ) ; mWidth = encodedImage . getWidth ( ) ; mHeight = encodedImage . getHeight ( ) ; mRotationAngle = encodedImage . getRotationAngle ( ) ; mExifOrientation = encodedImage . getExifOrientation ( ) ; mSampleSize = encodedImage . getSampleSize ( ) ; mStreamSize = encodedImage . getSize ( ) ; mBytesRange = encodedImage . getBytesRange ( ) ; mColorSpace = encodedImage . getColorSpace ( ) ;
public class DateTimeExpression { /** * Create a week expression * @ return week */ public NumberExpression < Integer > week ( ) { } }
if ( week == null ) { week = Expressions . numberOperation ( Integer . class , Ops . DateTimeOps . WEEK , mixin ) ; } return week ;
public class DefaultProcessDiagramCanvas { /** * Generates an image of what currently is drawn on the canvas . * Throws an { @ link ActivitiImageException } when { @ link # close ( ) } is already * called . */ public InputStream generateImage ( ) { } }
if ( closed ) { throw new ActivitiImageException ( "ProcessDiagramGenerator already closed" ) ; } try { ByteArrayOutputStream stream = new ByteArrayOutputStream ( ) ; Writer out ; out = new OutputStreamWriter ( stream , "UTF-8" ) ; g . stream ( out , true ) ; return new ByteArrayInputStream ( stream . toByteArray ( ) ) ; } catch ( UnsupportedEncodingException | SVGGraphics2DIOException e ) { throw new ActivitiImageException ( "Error while generating process image" , e ) ; }
public class OptionConfiguration { /** * A list of VpcSecurityGroupMembership name strings used for this option . * @ param vpcSecurityGroupMemberships * A list of VpcSecurityGroupMembership name strings used for this option . */ public void setVpcSecurityGroupMemberships ( java . util . Collection < String > vpcSecurityGroupMemberships ) { } }
if ( vpcSecurityGroupMemberships == null ) { this . vpcSecurityGroupMemberships = null ; return ; } this . vpcSecurityGroupMemberships = new com . amazonaws . internal . SdkInternalList < String > ( vpcSecurityGroupMemberships ) ;
public class Composite { /** * Replace an object within the composite . */ public boolean replace ( Object oldObj , Object newObj ) { } }
if ( nest != null ) { return nest . replace ( oldObj , newObj ) ; } else { int sz = elements . size ( ) ; for ( int i = 0 ; i < sz ; i ++ ) { if ( elements . get ( i ) == oldObj ) { elements . set ( i , newObj ) ; return true ; } } } return false ;
public class LookupService { /** * Returns the country the IP address is in . * @ param addr * the IP address as Inet6Address . * @ return the country the IP address is from . */ public synchronized Country getCountryV6 ( InetAddress addr ) { } }
if ( file == null && ( dboptions & GEOIP_MEMORY_CACHE ) == 0 ) { throw new IllegalStateException ( "Database has been closed." ) ; } int ret = seekCountryV6 ( addr ) - COUNTRY_BEGIN ; if ( ret == 0 ) { return UNKNOWN_COUNTRY ; } else { return new Country ( countryCode [ ret ] , countryName [ ret ] ) ; }
public class RoundRobin { /** * Returns the next item . * @ return the next item */ public V next ( ) { } }
Collection < ? extends V > collection = this . collection ; V offset = this . offset ; if ( offset != null ) { boolean accept = false ; for ( V element : collection ) { if ( element == offset ) { accept = true ; continue ; } if ( accept ) { return this . offset = element ; } } } return this . offset = collection . iterator ( ) . next ( ) ;
public class CompositeFilter { /** * / * ( non - Javadoc ) * @ see org . archive . wayback . resourceindex . SearchResultFilter # filterSearchResult ( org . archive . wayback . core . SearchResult ) */ public int filterObject ( CaptureSearchResult r ) { } }
for ( ObjectFilter < CaptureSearchResult > filter : filters ) { if ( filter == null ) { return FILTER_EXCLUDE ; } int result = filter . filterObject ( r ) ; if ( result != FILTER_INCLUDE ) { return result ; } } return FILTER_INCLUDE ;
public class InjectionBinding { /** * F743-32637 */ private InjectionTargetMethod createInjectionTarget ( Method method , InjectionBinding < ? > binding ) throws InjectionException { } }
if ( method . getParameterTypes ( ) . length != 1 ) // d706744 { return new InjectionTargetMultiParamMethod ( method , binding ) ; } return new InjectionTargetMethod ( method , binding ) ;
public class LinkInfoImpl { /** * { @ inheritDoc } * This method sets the link attributes to the appropriate values * based on the context . * @ param c the context id to set . */ public final void setContext ( Kind c ) { } }
// NOTE : Put context specific link code here . switch ( c ) { case ALL_CLASSES_FRAME : case PACKAGE_FRAME : case IMPLEMENTED_CLASSES : case SUBCLASSES : case EXECUTABLE_ELEMENT_COPY : case VARIABLE_ELEMENT_COPY : case PROPERTY_COPY : case CLASS_USE_HEADER : includeTypeInClassLinkLabel = false ; break ; case ANNOTATION : excludeTypeParameterLinks = true ; excludeTypeBounds = true ; break ; case IMPLEMENTED_INTERFACES : case SUPER_INTERFACES : case SUBINTERFACES : case CLASS_TREE_PARENT : case TREE : case CLASS_SIGNATURE_PARENT_NAME : excludeTypeParameterLinks = true ; excludeTypeBounds = true ; includeTypeInClassLinkLabel = false ; includeTypeAsSepLink = true ; break ; case PACKAGE : case CLASS_USE : case CLASS_HEADER : case CLASS_SIGNATURE : case RECEIVER_TYPE : excludeTypeParameterLinks = true ; includeTypeAsSepLink = true ; includeTypeInClassLinkLabel = false ; break ; case MEMBER_TYPE_PARAMS : includeTypeAsSepLink = true ; includeTypeInClassLinkLabel = false ; break ; case RETURN_TYPE : case SUMMARY_RETURN_TYPE : excludeTypeBounds = true ; break ; case EXECUTABLE_MEMBER_PARAM : excludeTypeBounds = true ; break ; } context = c ; if ( type != null && utils . isTypeVariable ( type ) && utils . isExecutableElement ( utils . asTypeElement ( type ) . getEnclosingElement ( ) ) ) { excludeTypeParameterLinks = true ; }
public class Normalization { /** * Scale based on min , max * @ param schema the schema of the data to scale * @ param data the data to sclae * @ param min the minimum value * @ param max the maximum value * @ return the normalized ata */ public static JavaRDD < List < Writable > > normalize ( Schema schema , JavaRDD < List < Writable > > data , double min , double max ) { } }
DataRowsFacade frame = DataFrames . toDataFrame ( schema , data ) ; return DataFrames . toRecords ( normalize ( frame , min , max , Collections . < String > emptyList ( ) ) ) . getSecond ( ) ;
public class TermConverter { /** * { @ inheritDoc } */ @ Override public XBELTerm convert ( Term source ) { } }
if ( source == null ) return null ; XBELTerm xt = new XBELTerm ( ) ; FunctionEnum functionEnum = source . getFunctionEnum ( ) ; Function func = Function . fromValue ( functionEnum . getDisplayValue ( ) ) ; xt . setFunction ( func ) ; List < BELObject > functionArgs = source . getFunctionArguments ( ) ; List < JAXBElement > prmtrms = xt . getParameterOrTerm ( ) ; final ParameterConverter pConverter = new ParameterConverter ( ) ; for ( final BELObject bo : functionArgs ) { if ( bo instanceof Parameter ) { // Defer to ParameterConverter prmtrms . add ( pConverter . convert ( ( Parameter ) bo ) ) ; } else if ( bo instanceof Term ) { prmtrms . add ( convert ( ( Term ) bo ) ) ; } } return xt ;
public class FileBatchConflictDetectServiceImpl { /** * 具体冲突检测的行为 */ private FileBatch onFileConflictDetect ( FileConflictDetectEvent event ) { } }
final FileBatch fileBatch = event . getFileBatch ( ) ; if ( CollectionUtils . isEmpty ( fileBatch . getFiles ( ) ) ) { return fileBatch ; } ExecutorTemplate executorTemplate = executorTemplateGetter . get ( ) ; try { MDC . put ( OtterConstants . splitPipelineLoadLogFileKey , String . valueOf ( fileBatch . getIdentity ( ) . getPipelineId ( ) ) ) ; executorTemplate . start ( ) ; // 重新设置下poolSize Pipeline pipeline = configClientService . findPipeline ( fileBatch . getIdentity ( ) . getPipelineId ( ) ) ; executorTemplate . adjustPoolSize ( pipeline . getParameters ( ) . getFileLoadPoolSize ( ) ) ; // 启动 final List < FileData > result = Collections . synchronizedList ( new ArrayList < FileData > ( ) ) ; final List < FileData > filter = Collections . synchronizedList ( new ArrayList < FileData > ( ) ) ; for ( final FileData source : fileBatch . getFiles ( ) ) { EventType type = source . getEventType ( ) ; if ( type . isDelete ( ) ) { result . add ( source ) ; } else { executorTemplate . submit ( new Runnable ( ) { public void run ( ) { MDC . put ( OtterConstants . splitPipelineLoadLogFileKey , String . valueOf ( fileBatch . getIdentity ( ) . getPipelineId ( ) ) ) ; // 处理更新类型 String namespace = source . getNameSpace ( ) ; String path = source . getPath ( ) ; FileData target = null ; int count = 0 ; while ( count ++ < retry ) { // 进行重试处理 try { if ( true == StringUtils . isBlank ( namespace ) ) { // local file java . io . File targetFile = new java . io . File ( path ) ; if ( true == targetFile . exists ( ) ) { // modified time cost long lastModified = targetFile . lastModified ( ) ; long size = targetFile . length ( ) ; // 更新数据 target = new FileData ( ) ; target . setLastModifiedTime ( lastModified ) ; target . setSize ( size ) ; } } else { // remote file throw new RuntimeException ( source + " is not support!" ) ; } break ; // 不出异常就跳出 } catch ( Exception ex ) { target = null ; } } boolean shouldSync = false ; if ( target != null ) { if ( true == accept ( target , source ) ) { shouldSync = true ; } } else { shouldSync = true ; } if ( true == shouldSync ) { result . add ( source ) ; } else { filter . add ( source ) ; } } } ) ; } } // 等待所有都处理完成 executorTemplate . waitForResult ( ) ; if ( pipeline . getParameters ( ) . getDumpEvent ( ) && logger . isInfoEnabled ( ) ) { logger . info ( FileloadDumper . dumpFilterFileDatas ( fileBatch . getIdentity ( ) , fileBatch . getFiles ( ) . size ( ) , result . size ( ) , filter ) ) ; } // 构造返回结果 FileBatch target = new FileBatch ( ) ; target . setIdentity ( fileBatch . getIdentity ( ) ) ; target . setFiles ( result ) ; return target ; } finally { if ( executorTemplate != null ) { executorTemplateGetter . release ( executorTemplate ) ; } MDC . remove ( OtterConstants . splitPipelineLoadLogFileKey ) ; }
public class HighwayHash { /** * Updates the hash with the last 1 to 31 bytes of the data . You must use * updatePacket first per 32 bytes of the data , if and only if 1 to 31 bytes * of the data are not processed after that , updateRemainder must be used for * those final bytes . * @ param bytes data array which has a length of at least pos + size _ mod32 * @ param pos position in the array to start reading size _ mod32 bytes from * @ param size _ mod32 the amount of bytes to read */ public void updateRemainder ( byte [ ] bytes , int pos , int size_mod32 ) { } }
if ( pos < 0 ) { throw new IllegalArgumentException ( String . format ( "Pos (%s) must be positive" , pos ) ) ; } if ( size_mod32 < 0 || size_mod32 >= 32 ) { throw new IllegalArgumentException ( String . format ( "size_mod32 (%s) must be between 0 and 31" , size_mod32 ) ) ; } if ( pos + size_mod32 > bytes . length ) { throw new IllegalArgumentException ( "bytes must have at least size_mod32 bytes after pos" ) ; } int size_mod4 = size_mod32 & 3 ; int remainder = size_mod32 & ~ 3 ; byte [ ] packet = new byte [ 32 ] ; for ( int i = 0 ; i < 4 ; ++ i ) { v0 [ i ] += ( ( long ) size_mod32 << 32 ) + size_mod32 ; } rotate32By ( size_mod32 , v1 ) ; for ( int i = 0 ; i < remainder ; i ++ ) { packet [ i ] = bytes [ pos + i ] ; } if ( ( size_mod32 & 16 ) != 0 ) { for ( int i = 0 ; i < 4 ; i ++ ) { packet [ 28 + i ] = bytes [ pos + remainder + i + size_mod4 - 4 ] ; } } else { if ( size_mod4 != 0 ) { packet [ 16 + 0 ] = bytes [ pos + remainder + 0 ] ; packet [ 16 + 1 ] = bytes [ pos + remainder + ( size_mod4 >>> 1 ) ] ; packet [ 16 + 2 ] = bytes [ pos + remainder + ( size_mod4 - 1 ) ] ; } } updatePacket ( packet , 0 ) ;
public class GroupProjectsFilter { /** * Get the query params specified by this filter . * @ return a GitLabApiForm instance holding the query parameters for this ProjectFilter instance */ public GitLabApiForm getQueryParams ( ) { } }
return ( new GitLabApiForm ( ) . withParam ( "archived" , archived ) . withParam ( "visibility" , visibility ) . withParam ( "order_by" , orderBy ) . withParam ( "sort" , sort ) . withParam ( "search" , search ) . withParam ( "simple" , simple ) . withParam ( "owned" , owned ) . withParam ( "starred" , starred ) . withParam ( "with_custom_attributes" , withCustomAttributes ) . withParam ( "with_issues_enabled" , withIssuesEnabled ) . withParam ( "with_merge_requests_enabled " , withMergeRequestsEnabled ) ) ;
public class FastMath { /** * Compute least significant bit ( Unit in Last Position ) for a number . * @ param x number from which ulp is requested * @ return ulp ( x ) */ public static double ulp ( double x ) { } }
if ( Double . isInfinite ( x ) ) { return Double . POSITIVE_INFINITY ; } return abs ( x - Double . longBitsToDouble ( Double . doubleToLongBits ( x ) ^ 1 ) ) ;
public class EventSubscriptionsInner { /** * List all regional event subscriptions under an Azure subscription . * List all event subscriptions from the given location under a specific Azure subscription . * @ param location Name of the location * @ param serviceCallback the async ServiceCallback to handle successful and failed responses . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the { @ link ServiceFuture } object */ public ServiceFuture < List < EventSubscriptionInner > > listRegionalBySubscriptionAsync ( String location , final ServiceCallback < List < EventSubscriptionInner > > serviceCallback ) { } }
return ServiceFuture . fromResponse ( listRegionalBySubscriptionWithServiceResponseAsync ( location ) , serviceCallback ) ;
public class GVRShaderData { /** * Bind an { @ code int } to the shader uniform { @ code key } . * Throws an exception of the key does not exist . * @ param key Name of the shader uniform * @ param value New data */ public void setInt ( String key , int value ) { } }
checkKeyIsUniform ( key ) ; NativeShaderData . setInt ( getNative ( ) , key , value ) ;
public class JavaGeneratingProcessor { /** * Generates a source file from the specified { @ link io . sundr . codegen . model . TypeDef } . * @ param model The model of the class to generate . * @ param resourceName The template to use . * @ throws IOException If it fails to create the source file . */ public void generateFromResources ( TypeDef model , String resourceName ) throws IOException { } }
try { generateFromResources ( model , processingEnv . getFiler ( ) . createSourceFile ( model . getFullyQualifiedName ( ) ) , resourceName ) ; } catch ( FilerException e ) { // TODO : Need to avoid dublicate interfaces here . }
public class ModelControllerLock { /** * Acquire the exclusive lock , with a max wait timeout to acquire . * @ param permit - the permit Integer for this operation . May not be { @ code null } . * @ param timeout - the timeout scalar quantity . * @ param unit - see { @ code TimeUnit } for quantities . * @ return { @ code boolean } true on successful acquire . * @ throws InterruptedException - if the acquiring thread was interrupted . * @ throws IllegalArgumentException if { @ code permit } is null . */ boolean lockInterruptibly ( final Integer permit , final long timeout , final TimeUnit unit ) throws InterruptedException { } }
if ( permit == null ) { throw new IllegalArgumentException ( ) ; } return sync . tryAcquireNanos ( permit , unit . toNanos ( timeout ) ) ;
public class BaseDrawerItem { /** * helper method to decide for the correct color * @ param ctx * @ return */ protected int getSelectedTextColor ( Context ctx ) { } }
return ColorHolder . color ( getSelectedTextColor ( ) , ctx , R . attr . material_drawer_selected_text , R . color . material_drawer_selected_text ) ;
public class GoogleMapShapeConverter { /** * Add a shape to the map * @ param map google map * @ param shape google map shape * @ return google map shape */ public static GoogleMapShape addShapeToMap ( GoogleMap map , GoogleMapShape shape ) { } }
GoogleMapShape addedShape = null ; switch ( shape . getShapeType ( ) ) { case LAT_LNG : addedShape = new GoogleMapShape ( shape . getGeometryType ( ) , GoogleMapShapeType . MARKER , addLatLngToMap ( map , ( LatLng ) shape . getShape ( ) ) ) ; break ; case MARKER_OPTIONS : addedShape = new GoogleMapShape ( shape . getGeometryType ( ) , GoogleMapShapeType . MARKER , addMarkerOptionsToMap ( map , ( MarkerOptions ) shape . getShape ( ) ) ) ; break ; case POLYLINE_OPTIONS : addedShape = new GoogleMapShape ( shape . getGeometryType ( ) , GoogleMapShapeType . POLYLINE , addPolylineToMap ( map , ( PolylineOptions ) shape . getShape ( ) ) ) ; break ; case POLYGON_OPTIONS : addedShape = new GoogleMapShape ( shape . getGeometryType ( ) , GoogleMapShapeType . POLYGON , addPolygonToMap ( map , ( PolygonOptions ) shape . getShape ( ) ) ) ; break ; case MULTI_LAT_LNG : addedShape = new GoogleMapShape ( shape . getGeometryType ( ) , GoogleMapShapeType . MULTI_MARKER , addLatLngsToMap ( map , ( MultiLatLng ) shape . getShape ( ) ) ) ; break ; case MULTI_POLYLINE_OPTIONS : addedShape = new GoogleMapShape ( shape . getGeometryType ( ) , GoogleMapShapeType . MULTI_POLYLINE , addPolylinesToMap ( map , ( MultiPolylineOptions ) shape . getShape ( ) ) ) ; break ; case MULTI_POLYGON_OPTIONS : addedShape = new GoogleMapShape ( shape . getGeometryType ( ) , GoogleMapShapeType . MULTI_POLYGON , addPolygonsToMap ( map , ( MultiPolygonOptions ) shape . getShape ( ) ) ) ; break ; case COLLECTION : List < GoogleMapShape > addedShapeList = new ArrayList < GoogleMapShape > ( ) ; @ SuppressWarnings ( "unchecked" ) List < GoogleMapShape > shapeList = ( List < GoogleMapShape > ) shape . getShape ( ) ; for ( GoogleMapShape shapeListItem : shapeList ) { addedShapeList . add ( addShapeToMap ( map , shapeListItem ) ) ; } addedShape = new GoogleMapShape ( shape . getGeometryType ( ) , GoogleMapShapeType . COLLECTION , addedShapeList ) ; break ; default : throw new GeoPackageException ( "Unsupported Shape Type: " + shape . getShapeType ( ) ) ; } return addedShape ;
public class CmsCloneModuleThread { /** * Replaces the referenced formatters within the new XSD files with the new formatter paths . < p > * @ param targetModule the target module * @ throws CmsException if something goes wrong * @ throws UnsupportedEncodingException if the file content could not be read with the determined encoding */ private void replaceFormatterPaths ( CmsModule targetModule ) throws CmsException , UnsupportedEncodingException { } }
CmsResource formatterSourceFolder = getCms ( ) . readResource ( "/system/modules/" + m_cloneInfo . getFormatterSourceModule ( ) + "/" ) ; CmsResource formatterTargetFolder = getCms ( ) . readResource ( "/system/modules/" + m_cloneInfo . getFormatterTargetModule ( ) + "/" ) ; for ( I_CmsResourceType type : targetModule . getResourceTypes ( ) ) { String schemaPath = type . getConfiguration ( ) . get ( "schema" ) ; CmsResource res = getCms ( ) . readResource ( schemaPath ) ; CmsFile file = getCms ( ) . readFile ( res ) ; if ( CmsResourceTypeXmlContent . isXmlContent ( file ) ) { CmsXmlContent xmlContent = CmsXmlContentFactory . unmarshal ( getCms ( ) , file ) ; xmlContent . setAutoCorrectionEnabled ( true ) ; file = xmlContent . correctXmlStructure ( getCms ( ) ) ; } String encoding = CmsLocaleManager . getResourceEncoding ( getCms ( ) , file ) ; String content = new String ( file . getContents ( ) , encoding ) ; content = content . replaceAll ( formatterSourceFolder . getRootPath ( ) , formatterTargetFolder . getRootPath ( ) ) ; file . setContents ( content . getBytes ( encoding ) ) ; getCms ( ) . writeFile ( file ) ; }
public class JVMMetrics { /** * These metrics can be useful for diagnosing native memory usage . */ private void updateBufferPoolMetrics ( ) { } }
for ( BufferPoolMXBean bufferPoolMXBean : bufferPoolMXBeanList ) { String normalizedKeyName = bufferPoolMXBean . getName ( ) . replaceAll ( "[^\\w]" , "-" ) ; final ByteAmount memoryUsed = ByteAmount . fromBytes ( bufferPoolMXBean . getMemoryUsed ( ) ) ; final ByteAmount totalCapacity = ByteAmount . fromBytes ( bufferPoolMXBean . getTotalCapacity ( ) ) ; final ByteAmount count = ByteAmount . fromBytes ( bufferPoolMXBean . getCount ( ) ) ; // The estimated memory the JVM is using for this buffer pool jvmBufferPoolMemoryUsage . safeScope ( normalizedKeyName + "-memory-used" ) . setValue ( memoryUsed . asMegabytes ( ) ) ; // The estimated total capacity of the buffers in this pool jvmBufferPoolMemoryUsage . safeScope ( normalizedKeyName + "-total-capacity" ) . setValue ( totalCapacity . asMegabytes ( ) ) ; // THe estimated number of buffers in this pool jvmBufferPoolMemoryUsage . safeScope ( normalizedKeyName + "-count" ) . setValue ( count . asMegabytes ( ) ) ; }
public class authenticationcertpolicy_vpnglobal_binding { /** * Use this API to fetch authenticationcertpolicy _ vpnglobal _ binding resources of given name . */ public static authenticationcertpolicy_vpnglobal_binding [ ] get ( nitro_service service , String name ) throws Exception { } }
authenticationcertpolicy_vpnglobal_binding obj = new authenticationcertpolicy_vpnglobal_binding ( ) ; obj . set_name ( name ) ; authenticationcertpolicy_vpnglobal_binding response [ ] = ( authenticationcertpolicy_vpnglobal_binding [ ] ) obj . get_resources ( service ) ; return response ;
public class SpecificationMethodAdapter { /** * Injects calls to old value contract methods . old value contract * methods get called with , in this order : * < ul > * < li > the { @ code this } pointer , if any ; * < li > and the original method ' s parameters . * < / ul > * @ param kind either OLD or SIGNAL _ OLD * @ param list the list that holds the allocated old value variable * indexes */ @ Requires ( { } }
"kind != null" , "kind.isOld()" , "list != null" } ) protected void invokeOldValues ( ContractKind kind , List < Integer > list ) { List < MethodContractHandle > olds = contracts . getMethodHandles ( kind , methodName , methodDesc , 0 ) ; if ( olds . isEmpty ( ) ) { return ; } for ( MethodContractHandle h : olds ) { MethodNode contractMethod = injectContractMethod ( h ) ; int k = h . getKey ( ) ; if ( ! statik ) { loadThis ( ) ; } loadArgs ( ) ; invokeContractMethod ( contractMethod ) ; storeLocal ( list . get ( k ) ) ; }
public class ScriptExecutionHistorysInner { /** * Promotes the specified ad - hoc script execution to a persisted script . * @ param resourceGroupName The name of the resource group . * @ param clusterName The name of the cluster . * @ param scriptExecutionId The script execution Id * @ param serviceCallback the async ServiceCallback to handle successful and failed responses . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the { @ link ServiceFuture } object */ public ServiceFuture < Void > promoteAsync ( String resourceGroupName , String clusterName , String scriptExecutionId , final ServiceCallback < Void > serviceCallback ) { } }
return ServiceFuture . fromResponse ( promoteWithServiceResponseAsync ( resourceGroupName , clusterName , scriptExecutionId ) , serviceCallback ) ;
public class JreProxyInstaller { /** * Filter the given document . * @ param obj the document to filter . * @ param expectedType the expected type of the { @ code obj } . * @ return the filtered { @ code obj } . */ protected Object processElement ( Object obj , Class < ? > expectedType ) { } }
if ( obj == null || obj instanceof Proxy ) { return obj ; } if ( obj instanceof Doc ) { return wrap ( obj ) ; } else if ( expectedType != null && expectedType . isArray ( ) ) { final Class < ? > componentType = expectedType . getComponentType ( ) ; if ( Doc . class . isAssignableFrom ( componentType ) ) { final int len = Array . getLength ( obj ) ; final List < Object > list = new ArrayList < > ( len ) ; final ApidocExcluder excluder = this . configuration . get ( ) . getApidocExcluder ( ) ; for ( int i = 0 ; i < len ; ++ i ) { final Object entry = Array . get ( obj , i ) ; if ( ! ( entry instanceof Doc ) ) { list . add ( processElement ( entry , componentType ) ) ; } else if ( excluder . isExcluded ( ( Doc ) entry ) ) { if ( excluder . isTranslatableToTag ( ( Doc ) entry ) ) { } } else { list . add ( processElement ( entry , componentType ) ) ; } } final Object newArray = Array . newInstance ( componentType , list . size ( ) ) ; int i = 0 ; for ( final Object element : list ) { Array . set ( newArray , i , element ) ; ++ i ; } return newArray ; } } return obj ;
public class QueueFactory { /** * Retrieve a new QueueBuilder using the ROOT _ QUEUE * as a parent . * @ return The new QueueBuilder object . */ public static < B extends ProcessBuilder > QueueBuilder < B > newQueueBuilder ( Class < B > process_builder_class ) { } }
return new QueueBuilder < B > ( ROOT_QUEUE , process_builder_class ) ;
public class CoNLLSentence { /** * 找出特定依存关系的子节点 * @ param word * @ param relation * @ return */ public List < CoNLLWord > findChildren ( CoNLLWord word , String relation ) { } }
List < CoNLLWord > result = new LinkedList < CoNLLWord > ( ) ; for ( CoNLLWord other : this ) { if ( other . HEAD == word && other . DEPREL . equals ( relation ) ) result . add ( other ) ; } return result ;
public class Modal { /** * Add a modal component in the dialog . * @ param dialog * the dialog * @ param component * the component for modal * @ param listener * the listener for modal * @ param modalDepth * the depth for modal */ public static void addModal ( JDialog dialog , Component component , ModalListener listener , Integer modalDepth ) { } }
addModal_ ( dialog , component , listener , modalDepth ) ;
public class JDBCStatement { /** * # ifdef JAVA4 */ public synchronized int executeUpdate ( String sql , int autoGeneratedKeys ) throws SQLException { } }
if ( autoGeneratedKeys != Statement . RETURN_GENERATED_KEYS && autoGeneratedKeys != Statement . NO_GENERATED_KEYS ) { throw Util . invalidArgument ( "autoGeneratedKeys" ) ; } fetchResult ( sql , StatementTypes . RETURN_COUNT , autoGeneratedKeys , null , null ) ; if ( resultIn . isError ( ) ) { throw Util . sqlException ( resultIn ) ; } return resultIn . getUpdateCount ( ) ;
public class ExecutorComparator { /** * < pre > * function defines the Memory comparator . * Note : comparator firstly take the absolute value of the remaining memory , if both sides have * the same value , * it go further to check the percent of the remaining memory . * < / pre > * @ param weight weight of the comparator . */ private static FactorComparator < Executor > getMemoryComparator ( final int weight ) { } }
return FactorComparator . create ( MEMORY_COMPARATOR_NAME , weight , new Comparator < Executor > ( ) { @ Override public int compare ( final Executor o1 , final Executor o2 ) { final ExecutorInfo stat1 = o1 . getExecutorInfo ( ) ; final ExecutorInfo stat2 = o2 . getExecutorInfo ( ) ; final int result = 0 ; if ( statisticsObjectCheck ( stat1 , stat2 , MEMORY_COMPARATOR_NAME ) ) { return result ; } if ( stat1 . getRemainingMemoryInMB ( ) != stat2 . getRemainingMemoryInMB ( ) ) { return stat1 . getRemainingMemoryInMB ( ) > stat2 . getRemainingMemoryInMB ( ) ? 1 : - 1 ; } return Double . compare ( stat1 . getRemainingMemoryPercent ( ) , stat2 . getRemainingMemoryPercent ( ) ) ; } } ) ;
public class PerformanceMonitorBeanFactory { /** * Create a new { @ link PerformanceMonitorBean } and map it to the provided * name . If the { @ link MBeanExportOperations } is set , then the * PerformanceMonitorBean will be exported as a JMX MBean . * If the PerformanceMonitor already exists , then the existing instance is * returned . * @ param name the value for the { @ link PerformanceMonitorBean } * @ return the created { @ link PerformanceMonitorBean } * @ throws IllegalArgumentException if the MBean value is invalid . */ public synchronized PerformanceMonitor createPerformanceMonitor ( String name ) { } }
PerformanceMonitorBean performanceMonitor = findPerformanceMonitorBean ( name ) ; if ( performanceMonitor == null ) { performanceMonitor = new PerformanceMonitorBean ( ) ; if ( mBeanExportOperations != null ) { ObjectName objectName ; try { objectName = new ObjectName ( "org.fishwife.jrugged.spring:type=" + "PerformanceMonitorBean,name=" + name ) ; } catch ( MalformedObjectNameException e ) { throw new IllegalArgumentException ( "Invalid MBean Name " + name , e ) ; } mBeanExportOperations . registerManagedResource ( performanceMonitor , objectName ) ; } addPerformanceMonitorToMap ( name , performanceMonitor ) ; } return performanceMonitor ;
public class gslbldnsentries { /** * Use this API to clear gslbldnsentries resources . */ public static base_responses clear ( nitro_service client , gslbldnsentries resources [ ] ) throws Exception { } }
base_responses result = null ; if ( resources != null && resources . length > 0 ) { gslbldnsentries clearresources [ ] = new gslbldnsentries [ resources . length ] ; for ( int i = 0 ; i < resources . length ; i ++ ) { clearresources [ i ] = new gslbldnsentries ( ) ; } result = perform_operation_bulk_request ( client , clearresources , "clear" ) ; } return result ;
public class AbstractPropertyEditor { /** * - - - - - OTHER METHODS - - - - - */ @ Override public void addMaxCardinalityRestriction ( Class < ? extends D > domain , int max ) { } }
if ( multipleCardinality ) { this . maxCardinalities . put ( domain , max ) ; } else { if ( max == 1 ) { if ( log . isInfoEnabled ( ) ) { log . info ( "unnecessary use of cardinality restriction. " + "Maybe you want to use functional instead?" ) ; } } else if ( max == 0 ) { this . maxCardinalities . put ( domain , max ) ; } else { assert false ; } }
public class CancelSpotFleetRequestsResult { /** * Information about the Spot Fleet requests that are successfully canceled . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setSuccessfulFleetRequests ( java . util . Collection ) } or * { @ link # withSuccessfulFleetRequests ( java . util . Collection ) } if you want to override the existing values . * @ param successfulFleetRequests * Information about the Spot Fleet requests that are successfully canceled . * @ return Returns a reference to this object so that method calls can be chained together . */ public CancelSpotFleetRequestsResult withSuccessfulFleetRequests ( CancelSpotFleetRequestsSuccessItem ... successfulFleetRequests ) { } }
if ( this . successfulFleetRequests == null ) { setSuccessfulFleetRequests ( new com . amazonaws . internal . SdkInternalList < CancelSpotFleetRequestsSuccessItem > ( successfulFleetRequests . length ) ) ; } for ( CancelSpotFleetRequestsSuccessItem ele : successfulFleetRequests ) { this . successfulFleetRequests . add ( ele ) ; } return this ;
public class CellModel { /** * Format an { @ link Object } value . This method is used to apply a chain of formatters to some * value . It will return < code > null < / code > if the provided value is null ; in this case , it * is up to the caller to provide an appropriate default value . * @ param value the { @ link Object } to format * @ return If the < code > value < / code > is null , return < code > null < / code > . If there are no registered * { @ link Formatter } instances , return { @ link Object # toString ( ) } for the < code > value < / code > parameter . * Otherwisee , return the formatted value . */ public String formatText ( Object value ) { } }
if ( value == null ) return null ; if ( _formatters == null ) return value . toString ( ) ; Object formatted = value ; for ( int i = 0 ; i < _formatters . size ( ) ; i ++ ) { assert _formatters . get ( i ) instanceof Formatter : "Found invalid formatter type \"" + ( _formatters . get ( i ) != null ? _formatters . get ( i ) . getClass ( ) . getName ( ) : "null" ) + "\"" ; Formatter formatter = ( Formatter ) _formatters . get ( i ) ; assert formatter != null ; try { formatted = formatter . format ( formatted ) ; } catch ( JspException e ) { /* todo : error reporting */ LOGGER . error ( Bundle . getErrorString ( "CellModel_FormatterThrewException" , new Object [ ] { formatter . getClass ( ) . getName ( ) , e } ) , e ) ; } } assert formatted != null ; return formatted . toString ( ) ;
public class XElement { /** * Add an element with the supplied content text . * @ param name the name * @ param value the content * @ return the new element */ public XElement add ( String name , Object value ) { } }
XElement result = add ( name ) ; result . parent = this ; result . setValue ( value ) ; return result ;
public class SnowflakeConnectionV1 { /** * Method to put data from a stream at a stage location . The data will be * uploaded as one file . No splitting is done in this method . * Stream size must match the total size of data in the input stream unless * compressData parameter is set to true . * caller is responsible for passing the correct size for the data in the * stream and releasing the inputStream after the method is called . * @ param stageName stage name : e . g . ~ or table name or stage name * @ param destPrefix path prefix under which the data should be uploaded on the stage * @ param inputStream input stream from which the data will be uploaded * @ param destFileName destination file name to use * @ param compressData whether compression is requested fore uploading data * @ throws SQLException raises if any error occurs */ private void uploadStreamInternal ( String stageName , String destPrefix , InputStream inputStream , String destFileName , boolean compressData ) throws SQLException { } }
logger . debug ( "upload data from stream: stageName={}" + ", destPrefix={}, destFileName={}" , stageName , destPrefix , destFileName ) ; if ( stageName == null ) { throw new SnowflakeSQLException ( SqlState . INTERNAL_ERROR , ErrorCode . INTERNAL_ERROR . getMessageCode ( ) , "stage name is null" ) ; } if ( destFileName == null ) { throw new SnowflakeSQLException ( SqlState . INTERNAL_ERROR , ErrorCode . INTERNAL_ERROR . getMessageCode ( ) , "stage name is null" ) ; } SnowflakeStatementV1 stmt = this . createStatement ( ) . unwrap ( SnowflakeStatementV1 . class ) ; StringBuilder putCommand = new StringBuilder ( ) ; // use a placeholder for source file putCommand . append ( "put file:///tmp/placeholder " ) ; // add stage name if ( ! stageName . startsWith ( "@" ) ) { putCommand . append ( "@" ) ; } putCommand . append ( stageName ) ; // add dest prefix if ( destPrefix != null ) { if ( ! destPrefix . startsWith ( "/" ) ) { putCommand . append ( "/" ) ; } putCommand . append ( destPrefix ) ; } putCommand . append ( " overwrite=true" ) ; SnowflakeFileTransferAgent transferAgent = null ; transferAgent = new SnowflakeFileTransferAgent ( putCommand . toString ( ) , sfSession , stmt . getSfStatement ( ) ) ; transferAgent . setSourceStream ( inputStream ) ; transferAgent . setDestFileNameForStreamSource ( destFileName ) ; transferAgent . setCompressSourceFromStream ( compressData ) ; transferAgent . execute ( ) ; stmt . close ( ) ;
public class IPSetDescriptorMarshaller { /** * Marshall the given parameter object . */ public void marshall ( IPSetDescriptor iPSetDescriptor , ProtocolMarshaller protocolMarshaller ) { } }
if ( iPSetDescriptor == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( iPSetDescriptor . getType ( ) , TYPE_BINDING ) ; protocolMarshaller . marshall ( iPSetDescriptor . getValue ( ) , VALUE_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class LRUVectorTileCache { /** * Returns a cached Object given a key * @ param key * The key of the Object stored on the HashMap * @ return The Object or null if it is not stored in the cache */ public synchronized Object get ( final String key ) { } }
try { final Object value = super . get ( key ) ; if ( value != null ) { updateKey ( key ) ; } return value ; } catch ( Exception e ) { log . log ( Level . SEVERE , "get" , e ) ; return null ; }
public class LWJGL3TypeConversions { /** * Convert types from GL constants . * @ param type The GL constant . * @ return The value . */ public static JCGLType typeFromGL ( final int type ) { } }
switch ( type ) { case GL20 . GL_BOOL : return JCGLType . TYPE_BOOLEAN ; case GL20 . GL_BOOL_VEC2 : return JCGLType . TYPE_BOOLEAN_VECTOR_2 ; case GL20 . GL_BOOL_VEC3 : return JCGLType . TYPE_BOOLEAN_VECTOR_3 ; case GL20 . GL_BOOL_VEC4 : return JCGLType . TYPE_BOOLEAN_VECTOR_4 ; case GL11 . GL_FLOAT : return JCGLType . TYPE_FLOAT ; case GL20 . GL_FLOAT_MAT2 : return JCGLType . TYPE_FLOAT_MATRIX_2 ; case GL20 . GL_FLOAT_MAT3 : return JCGLType . TYPE_FLOAT_MATRIX_3 ; case GL20 . GL_FLOAT_MAT4 : return JCGLType . TYPE_FLOAT_MATRIX_4 ; case GL21 . GL_FLOAT_MAT4x3 : return JCGLType . TYPE_FLOAT_MATRIX_4x3 ; case GL21 . GL_FLOAT_MAT4x2 : return JCGLType . TYPE_FLOAT_MATRIX_4x2 ; case GL21 . GL_FLOAT_MAT3x4 : return JCGLType . TYPE_FLOAT_MATRIX_3x4 ; case GL21 . GL_FLOAT_MAT3x2 : return JCGLType . TYPE_FLOAT_MATRIX_3x2 ; case GL21 . GL_FLOAT_MAT2x4 : return JCGLType . TYPE_FLOAT_MATRIX_2x4 ; case GL21 . GL_FLOAT_MAT2x3 : return JCGLType . TYPE_FLOAT_MATRIX_2x3 ; case GL20 . GL_FLOAT_VEC2 : return JCGLType . TYPE_FLOAT_VECTOR_2 ; case GL20 . GL_FLOAT_VEC3 : return JCGLType . TYPE_FLOAT_VECTOR_3 ; case GL20 . GL_FLOAT_VEC4 : return JCGLType . TYPE_FLOAT_VECTOR_4 ; case GL11 . GL_INT : return JCGLType . TYPE_INTEGER ; case GL20 . GL_INT_VEC2 : return JCGLType . TYPE_INTEGER_VECTOR_2 ; case GL20 . GL_INT_VEC3 : return JCGLType . TYPE_INTEGER_VECTOR_3 ; case GL20 . GL_INT_VEC4 : return JCGLType . TYPE_INTEGER_VECTOR_4 ; case GL11 . GL_UNSIGNED_INT : return JCGLType . TYPE_UNSIGNED_INTEGER ; case GL30 . GL_UNSIGNED_INT_VEC2 : return JCGLType . TYPE_UNSIGNED_INTEGER_VECTOR_2 ; case GL30 . GL_UNSIGNED_INT_VEC3 : return JCGLType . TYPE_UNSIGNED_INTEGER_VECTOR_3 ; case GL30 . GL_UNSIGNED_INT_VEC4 : return JCGLType . TYPE_UNSIGNED_INTEGER_VECTOR_4 ; case GL20 . GL_SAMPLER_2D : return JCGLType . TYPE_SAMPLER_2D ; case GL20 . GL_SAMPLER_3D : return JCGLType . TYPE_SAMPLER_3D ; case GL20 . GL_SAMPLER_CUBE : return JCGLType . TYPE_SAMPLER_CUBE ; default : throw new UnreachableCodeException ( ) ; }
public class J4pReadResponse { /** * Get the name of all attributes fetched for a certain MBean name . If the request was * performed for a single MBean , then the given name must match that of the MBean name * provided in the request . If < code > null < / code > is given as argument , then this method * will return all attributes for the single MBean given in the request * @ param pObjectName MBean for which to get the attribute names , * @ return a collection of attribute names */ public Collection < String > getAttributes ( ObjectName pObjectName ) { } }
ObjectName requestMBean = getRequest ( ) . getObjectName ( ) ; if ( requestMBean . isPattern ( ) ) { // We need to got down one level in the returned values JSONObject attributes = getAttributesForObjectNameWithPatternRequest ( pObjectName ) ; return attributes . keySet ( ) ; } else { if ( pObjectName != null && ! pObjectName . equals ( requestMBean ) ) { throw new IllegalArgumentException ( "Given ObjectName " + pObjectName + " doesn't match with" + " the single ObjectName " + requestMBean + " given in the request" ) ; } return getAttributes ( ) ; }
public class AmazonAppStreamClient { /** * Stops the specified image builder . * @ param stopImageBuilderRequest * @ return Result of the StopImageBuilder operation returned by the service . * @ throws ResourceNotFoundException * The specified resource was not found . * @ throws OperationNotPermittedException * The attempted operation is not permitted . * @ throws ConcurrentModificationException * An API error occurred . Wait a few minutes and try again . * @ sample AmazonAppStream . StopImageBuilder * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / appstream - 2016-12-01 / StopImageBuilder " target = " _ top " > AWS API * Documentation < / a > */ @ Override public StopImageBuilderResult stopImageBuilder ( StopImageBuilderRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeStopImageBuilder ( request ) ;
public class JTrees { /** * Returns the children of the given node in the given tree model * @ param treeModel The tree model * @ param node The node * @ return The children */ public static List < Object > getChildren ( TreeModel treeModel , Object node ) { } }
List < Object > children = new ArrayList < Object > ( ) ; int n = treeModel . getChildCount ( node ) ; for ( int i = 0 ; i < n ; i ++ ) { Object child = treeModel . getChild ( node , i ) ; children . add ( child ) ; } return children ;
public class BoyerMoore { /** * Computes the function < i > last < / i > and stores its values in the array < code > last < / code > . * The function is defined as follows : * < pre > * last ( Char ch ) = the index of the right - most occurrence of the character ch * in the pattern ; * - 1 if ch does not occur in the pattern . * < / pre > * The running time is O ( pattern . length ( ) + | Alphabet | ) . */ private void computeLast ( ) { } }
for ( int k = 0 ; k < last . length ; k ++ ) { last [ k ] = - 1 ; } for ( int j = pattern . length ( ) - 1 ; j >= 0 ; j -- ) { if ( last [ pattern . charAt ( j ) ] < 0 ) { last [ pattern . charAt ( j ) ] = j ; } }
public class CollectionFactory { /** * Sort the input collection ; if the ordering is unstable and an error is * thrown ( due to the use of TimSort in JDK 1.7 and newer ) , catch it and * leave the collection unsorted . NOTE : use this method if ordering is * desirable but not necessary . * @ param < T > * list type * @ param toReturn * list to sort */ public static < T extends Comparable < T > > void sortOptionallyComparables ( @ Nonnull List < T > toReturn ) { } }
try { Collections . sort ( toReturn ) ; } catch ( IllegalArgumentException e ) { // catch possible sorting misbehaviour if ( ! e . getMessage ( ) . contains ( "Comparison method violates its general contract!" ) ) { throw e ; } // otherwise print a warning and leave the list unsorted }
public class DefaultConfigurationFactory { /** * Creates default implementation of { @ link MemoryCache } - { @ link LruMemoryCache } < br / > * Default cache size = 1/8 of available app memory . */ public static MemoryCache createMemoryCache ( Context context , int memoryCacheSize ) { } }
if ( memoryCacheSize == 0 ) { ActivityManager am = ( ActivityManager ) context . getSystemService ( Context . ACTIVITY_SERVICE ) ; int memoryClass = am . getMemoryClass ( ) ; if ( hasHoneycomb ( ) && isLargeHeap ( context ) ) { memoryClass = getLargeMemoryClass ( am ) ; } memoryCacheSize = 1024 * 1024 * memoryClass / 8 ; } return new LruMemoryCache ( memoryCacheSize ) ;
public class BitMatrixParser { /** * < p > Reads the 8 bits of the special corner condition 1 . < / p > * < p > See ISO 16022:2006 , Figure F . 3 < / p > * @ param numRows Number of rows in the mapping matrix * @ param numColumns Number of columns in the mapping matrix * @ return byte from the Corner condition 1 */ private int readCorner1 ( int numRows , int numColumns ) { } }
int currentByte = 0 ; if ( readModule ( numRows - 1 , 0 , numRows , numColumns ) ) { currentByte |= 1 ; } currentByte <<= 1 ; if ( readModule ( numRows - 1 , 1 , numRows , numColumns ) ) { currentByte |= 1 ; } currentByte <<= 1 ; if ( readModule ( numRows - 1 , 2 , numRows , numColumns ) ) { currentByte |= 1 ; } currentByte <<= 1 ; if ( readModule ( 0 , numColumns - 2 , numRows , numColumns ) ) { currentByte |= 1 ; } currentByte <<= 1 ; if ( readModule ( 0 , numColumns - 1 , numRows , numColumns ) ) { currentByte |= 1 ; } currentByte <<= 1 ; if ( readModule ( 1 , numColumns - 1 , numRows , numColumns ) ) { currentByte |= 1 ; } currentByte <<= 1 ; if ( readModule ( 2 , numColumns - 1 , numRows , numColumns ) ) { currentByte |= 1 ; } currentByte <<= 1 ; if ( readModule ( 3 , numColumns - 1 , numRows , numColumns ) ) { currentByte |= 1 ; } return currentByte ;
public class KrakenImpl { /** * Parse and execute SQL . */ public void exec ( String sql , Object [ ] params , Result < Object > result ) { } }
QueryBuilderKraken query = QueryParserKraken . parse ( this , sql ) ; query . build ( result . then ( ( q , r ) -> q . exec ( r , params ) ) ) ;