signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class ConvolutionUtils { /** * Get heigh / width / channels as length 3 int [ ] from the InputType * @ param inputType Input type to get * @ return Length */ public static int [ ] getHWDFromInputType ( InputType inputType ) { } }
int inH ; int inW ; int inDepth ; // FIXME : int cast if ( inputType instanceof InputType . InputTypeConvolutional ) { InputType . InputTypeConvolutional conv = ( InputType . InputTypeConvolutional ) inputType ; inH = ( int ) conv . getHeight ( ) ; inW = ( int ) conv . getWidth ( ) ; inDepth = ( int ) conv . getChannels ( ) ; } else if ( inputType instanceof InputType . InputTypeConvolutionalFlat ) { InputType . InputTypeConvolutionalFlat conv = ( InputType . InputTypeConvolutionalFlat ) inputType ; inH = ( int ) conv . getHeight ( ) ; inW = ( int ) conv . getWidth ( ) ; inDepth = ( int ) conv . getDepth ( ) ; } else { throw new IllegalStateException ( "Invalid input type: expected InputTypeConvolutional or InputTypeConvolutionalFlat." + " Got: " + inputType ) ; } return new int [ ] { inH , inW , inDepth } ;
public class ObjectManager { /** * Change the maximum active transactrions that the ObjectManager will allow to start . If this call reduces the * maximum then existing transactions continue but no new ones are allowed until the total has fallen below the new * maximum . * @ param maximumActiveTransactions to set . * @ param transaction controling the update . * @ throws ObjectManagerException */ public final void setMaximumActiveTransactions ( int maximumActiveTransactions , Transaction transaction ) throws ObjectManagerException { } }
if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , "setMaximumActiveTransactions" , new Object [ ] { new Integer ( maximumActiveTransactions ) , transaction } ) ; transaction . lock ( objectManagerState ) ; objectManagerState . maximumActiveTransactions = maximumActiveTransactions ; // saveClonedState does not update the defaultStore . transaction . replace ( objectManagerState ) ; // Save the updates in the restartable ObjectStores . objectManagerState . saveClonedState ( transaction ) ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , "setMaximumActiveTransactions" ) ;
public class URLStreamHandler { /** * Compares the host components of two URLs . * @ param u1 the URL of the first host to compare * @ param u2 the URL of the second host to compare * @ return { @ code true } if and only if they * are equal , { @ code false } otherwise . * @ since 1.3 */ protected boolean hostsEqual ( URL u1 , URL u2 ) { } }
// Android - changed : Don ' t compare the InetAddresses of the hosts . if ( u1 . getHost ( ) != null && u2 . getHost ( ) != null ) return u1 . getHost ( ) . equalsIgnoreCase ( u2 . getHost ( ) ) ; else return u1 . getHost ( ) == null && u2 . getHost ( ) == null ;
public class KDTree { /** * Query for nearest neighbor . Returns the distance and point * @ param point the point to query for * @ return */ public Pair < Double , INDArray > nn ( INDArray point ) { } }
return nn ( root , point , rect , Double . POSITIVE_INFINITY , null , 0 ) ;
public class ParosTableTag { /** * / * ( non - Javadoc ) * @ see org . parosproxy . paros . db . paros . TableTag # getTagsForHistoryID ( long ) */ @ Override public synchronized List < RecordTag > getTagsForHistoryID ( long historyId ) throws DatabaseException { } }
try { List < RecordTag > result = new ArrayList < > ( ) ; psGetTagsForHistoryId . setLong ( 1 , historyId ) ; try ( ResultSet rs = psGetTagsForHistoryId . executeQuery ( ) ) { while ( rs . next ( ) ) { result . add ( new RecordTag ( rs . getLong ( TAGID ) , rs . getLong ( TAGID ) , rs . getString ( TAG ) ) ) ; } } return result ; } catch ( SQLException e ) { throw new DatabaseException ( e ) ; }
public class AsyncTwitterImpl { /** * implementation for AsyncOAuthSupport */ @ Override public void getOAuthRequestTokenAsync ( ) { } }
getDispatcher ( ) . invokeLater ( new AsyncTask ( OAUTH_REQUEST_TOKEN , listeners ) { @ Override public void invoke ( List < TwitterListener > listeners ) throws TwitterException { RequestToken token = twitter . getOAuthRequestToken ( ) ; for ( TwitterListener listener : listeners ) { try { listener . gotOAuthRequestToken ( token ) ; } catch ( Exception e ) { logger . warn ( "Exception at getOAuthRequestTokenAsync" , e ) ; } } } } ) ;
public class Vector4d { /** * / * ( non - Javadoc ) * @ see org . joml . Vector4dc # angle ( org . joml . Vector4dc ) */ public double angle ( Vector4dc v ) { } }
double cos = angleCos ( v ) ; // This is because sometimes cos goes above 1 or below - 1 because of lost precision cos = cos < 1 ? cos : 1 ; cos = cos > - 1 ? cos : - 1 ; return Math . acos ( cos ) ;
public class br_app_by_wan_volume { /** * < pre > * Performs generic data validation for the operation to be performed * < / pre > */ protected void validate ( String operationType ) throws Exception { } }
super . validate ( operationType ) ; MPSString id_validator = new MPSString ( ) ; id_validator . validate ( operationType , id , "\"id\"" ) ; MPSIPAddress ip_address_validator = new MPSIPAddress ( ) ; ip_address_validator . validate ( operationType , ip_address , "\"ip_address\"" ) ; MPSString app_name_validator = new MPSString ( ) ; app_name_validator . validate ( operationType , app_name , "\"app_name\"" ) ; MPSDouble total_wan_volume_validator = new MPSDouble ( ) ; total_wan_volume_validator . validate ( operationType , total_wan_volume , "\"total_wan_volume\"" ) ; MPSDouble total_sent_wan_volume_validator = new MPSDouble ( ) ; total_sent_wan_volume_validator . validate ( operationType , total_sent_wan_volume , "\"total_sent_wan_volume\"" ) ; MPSDouble total_received_wan_volume_validator = new MPSDouble ( ) ; total_received_wan_volume_validator . validate ( operationType , total_received_wan_volume , "\"total_received_wan_volume\"" ) ;
public class WarBuilder { /** * Builds a WAR from the given option . * @ return file URI referencing the WAR in a temporary directory */ public URI buildWar ( ) { } }
if ( option . getName ( ) == null ) { option . name ( UUID . randomUUID ( ) . toString ( ) ) ; } processClassPath ( ) ; try { File webResourceDir = getWebResourceDir ( ) ; File probeWar = new File ( tempDir , option . getName ( ) + ".war" ) ; ZipBuilder builder = new ZipBuilder ( probeWar ) ; for ( String library : option . getLibraries ( ) ) { File file = toLocalFile ( library ) ; /* * ScatteredArchive copies all directory class path items to WEB - INF / classes , * so that separate CDI bean deployment archives get merged into one . To avoid * that , we convert each directory class path to a JAR file . */ if ( file . isDirectory ( ) ) { file = toJar ( file ) ; } LOG . debug ( "including library {} = {}" , library , file ) ; builder . addFile ( file , "WEB-INF/lib/" + file . getName ( ) ) ; } builder . addDirectory ( webResourceDir , "" ) ; builder . close ( ) ; URI warUri = probeWar . toURI ( ) ; LOG . info ( "WAR probe = {}" , warUri ) ; return warUri ; } catch ( IOException exc ) { throw new TestContainerException ( exc ) ; }
public class EhCachePlugin { /** * You can use this method to manually register a { @ link CacheManager } that should be monitored by stagemonitor . * Example : * < pre > * Stagemonitor . getPlugin ( EhCachePlugin . class ) . monitorCaches ( yourCacheManager ) ; * < / pre > * @ param cacheManager The CacheManager to monitor */ public void monitorCaches ( CacheManager cacheManager ) { } }
if ( cacheManager == null ) { logger . warn ( "EhCache can't be monitored; CacheManager is null" ) ; return ; } for ( String cacheName : cacheManager . getCacheNames ( ) ) { monitorCache ( cacheManager . getCache ( cacheName ) ) ; }
public class UserApi { /** * Get currently authenticated user . * < pre > < code > GitLab Endpoint : GET / user < / code > < / pre > * @ return the User instance for the currently authenticated user * @ throws GitLabApiException if any exception occurs */ public User getCurrentUser ( ) throws GitLabApiException { } }
Response response = get ( Response . Status . OK , null , "user" ) ; return ( response . readEntity ( User . class ) ) ;
public class CDIUtils { /** * Creates an object of the service class * @ param serviceClass the service class * @ return the serviceClass object */ public static < S > S prepareInstance ( Class < ? extends S > serviceClass ) { } }
try { final Constructor < ? extends S > constructor = serviceClass . getDeclaredConstructor ( ) ; AccessController . doPrivileged ( new PrivilegedAction < Void > ( ) { @ Override public Void run ( ) { constructor . setAccessible ( true ) ; return null ; } } ) ; return constructor . newInstance ( ) ; } catch ( LinkageError e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "prepareInstance(): Could not instantiate service class " + serviceClass . getName ( ) , e ) ; } return null ; } catch ( InvocationTargetException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "prepareInstance(): The exception happened on loading " + serviceClass . getName ( ) , e ) ; } return null ; } catch ( IllegalArgumentException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "prepareInstance(): The exception happened on loading " + serviceClass . getName ( ) , e ) ; } return null ; } catch ( InstantiationException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "prepareInstance(): The exception happened on loading " + serviceClass . getName ( ) , e ) ; } return null ; } catch ( IllegalAccessException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "prepareInstance(): The exception happened on loading " + serviceClass . getName ( ) , e ) ; } return null ; } catch ( SecurityException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "prepareInstance(): The exception happened on loading " + serviceClass . getName ( ) , e ) ; } return null ; } catch ( NoSuchMethodException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "prepareInstance(): The exception happened on loading " + serviceClass . getName ( ) , e ) ; } return null ; }
public class ShapeType { /** * Determine the ShapeType for the id . * @ param id The id to search for . * @ return The ShapeType for the id . */ public static ShapeType forID ( int id ) { } }
ShapeType t ; switch ( id ) { case 0 : t = NULL ; break ; case 1 : t = POINT ; break ; case 11 : t = POINTZ ; break ; case 21 : t = POINTM ; break ; case 3 : t = ARC ; break ; case 13 : t = ARCZ ; break ; case 23 : t = ARCM ; break ; case 5 : t = POLYGON ; break ; case 15 : t = POLYGONZ ; break ; case 25 : t = POLYGONM ; break ; case 8 : t = MULTIPOINT ; break ; case 18 : t = MULTIPOINTZ ; break ; case 28 : t = MULTIPOINTM ; break ; default : t = UNDEFINED ; break ; } return t ;
public class StandaloneDeploymentFinder { /** * - - - - - deployment methods */ public void loadDeployments ( ) { } }
Operation op = new Operation . Builder ( READ_CHILDREN_RESOURCES_OPERATION , ResourceAddress . ROOT ) . param ( CHILD_TYPE , "deployment" ) . param ( INCLUDE_RUNTIME , true ) . param ( RECURSIVE , true ) . build ( ) ; dispatcher . execute ( new DMRAction ( op ) , new AsyncCallback < DMRResponse > ( ) { @ Override public void onFailure ( final Throwable caught ) { Console . error ( Console . CONSTANTS . unableToLoadDeployments ( ) , caught . getMessage ( ) ) ; } @ Override public void onSuccess ( final DMRResponse response ) { ModelNode result = response . get ( ) ; if ( result . isFailure ( ) ) { Console . error ( Console . CONSTANTS . unableToLoadDeployments ( ) , result . getFailureDescription ( ) ) ; } else { List < Deployment > deployments = new ArrayList < > ( ) ; ModelNode payload = result . get ( RESULT ) ; List < Property > properties = payload . asPropertyList ( ) ; for ( Property property : properties ) { deployments . add ( new Deployment ( ReferenceServer . STANDALONE , property . getValue ( ) ) ) ; } getView ( ) . updateDeployments ( deployments ) ; } } } ) ;
public class Sheet { /** * Updates the row var for iterations over the list . The var value will be updated to the value for the specified rowKey . * @ param context the FacesContext against which to the row var is set . Passed for performance * @ param rowKey the rowKey string */ public void setRowVar ( final FacesContext context , final String rowKey ) { } }
if ( context == null ) { return ; } if ( rowKey == null ) { context . getExternalContext ( ) . getRequestMap ( ) . remove ( getVar ( ) ) ; } else { final Object value = getRowMap ( ) . get ( rowKey ) ; context . getExternalContext ( ) . getRequestMap ( ) . put ( getVar ( ) , value ) ; }
public class PipelineManager { /** * Delete all data store entities corresponding to the given pipeline . * @ param pipelineHandle The handle of the pipeline to be deleted * @ param force If this parameter is not { @ code true } then this method will * throw an { @ link IllegalStateException } if the specified pipeline is * not in the { @ link State # FINALIZED } or { @ link State # STOPPED } state . * @ param async If this parameter is { @ code true } then instead of performing * the delete operation synchronously , this method will enqueue a task * to perform the operation . * @ throws NoSuchObjectException If there is no Job with the given key . * @ throws IllegalStateException If { @ code force = false } and the specified * pipeline is not in the { @ link State # FINALIZED } or * { @ link State # STOPPED } state . */ public static void deletePipelineRecords ( String pipelineHandle , boolean force , boolean async ) throws NoSuchObjectException , IllegalStateException { } }
checkNonEmpty ( pipelineHandle , "pipelineHandle" ) ; Key key = KeyFactory . createKey ( JobRecord . DATA_STORE_KIND , pipelineHandle ) ; backEnd . deletePipeline ( key , force , async ) ;
public class DialogPageUtils { /** * Add a message monitor . Each monitor will have its * { @ link Messagable # setMessage ( Message ) } method called whenever the MESSAGE * property on the dialog page changes . * @ param dialogPage * to monitor * @ param monitor * to add */ public static void addMessageMonitor ( DialogPage dialogPage , Messagable monitor ) { } }
dialogPage . addPropertyChangeListener ( Messagable . MESSAGE_PROPERTY , new MessageHandler ( monitor ) ) ;
public class KBeamArcEagerParser { /** * Needs Conll 2006 format * @ param inputFile * @ param outputFile * @ param rootFirst * @ param beamWidth * @ throws Exception */ public void parseConllFileNoParallel ( String inputFile , String outputFile , boolean rootFirst , int beamWidth , boolean labeled , boolean lowerCased , int numOfThreads , boolean partial , String scorePath ) throws IOException , ExecutionException , InterruptedException { } }
CoNLLReader reader = new CoNLLReader ( inputFile ) ; boolean addScore = false ; if ( scorePath . trim ( ) . length ( ) > 0 ) addScore = true ; ArrayList < Float > scoreList = new ArrayList < Float > ( ) ; long start = System . currentTimeMillis ( ) ; int allArcs = 0 ; int size = 0 ; BufferedWriter writer = new BufferedWriter ( new FileWriter ( outputFile + ".tmp" ) ) ; int dataCount = 0 ; while ( true ) { ArrayList < Instance > data = reader . readData ( 15000 , true , labeled , rootFirst , lowerCased , maps ) ; size += data . size ( ) ; if ( data . size ( ) == 0 ) break ; for ( Instance instance : data ) { dataCount ++ ; if ( dataCount % 100 == 0 ) System . err . print ( dataCount + " ... " ) ; Configuration bestParse ; if ( partial ) bestParse = parsePartial ( instance , instance . getSentence ( ) , rootFirst , beamWidth , numOfThreads ) ; else bestParse = parse ( instance . getSentence ( ) , rootFirst , beamWidth , numOfThreads ) ; int [ ] words = instance . getSentence ( ) . getWords ( ) ; allArcs += words . length - 1 ; if ( addScore ) scoreList . add ( bestParse . score / bestParse . sentence . size ( ) ) ; writeParsedSentence ( writer , rootFirst , bestParse , words ) ; } } // System . err . print ( " \ n " ) ; long end = System . currentTimeMillis ( ) ; float each = ( 1.0f * ( end - start ) ) / size ; float eacharc = ( 1.0f * ( end - start ) ) / allArcs ; writer . flush ( ) ; writer . close ( ) ; // DecimalFormat format = new DecimalFormat ( " # # . 00 " ) ; // System . err . print ( format . format ( eacharc ) + " ms for each arc ! \ n " ) ; // System . err . print ( format . format ( each ) + " ms for each sentence ! \ n \ n " ) ; BufferedReader gReader = new BufferedReader ( new FileReader ( inputFile ) ) ; BufferedReader pReader = new BufferedReader ( new FileReader ( outputFile + ".tmp" ) ) ; BufferedWriter pwriter = new BufferedWriter ( new FileWriter ( outputFile ) ) ; String line ; while ( ( line = pReader . readLine ( ) ) != null ) { String gLine = gReader . readLine ( ) ; if ( line . trim ( ) . length ( ) > 0 ) { while ( gLine . trim ( ) . length ( ) == 0 ) gLine = gReader . readLine ( ) ; String [ ] ps = line . split ( "\t" ) ; String [ ] gs = gLine . split ( "\t" ) ; gs [ 6 ] = ps [ 0 ] ; gs [ 7 ] = ps [ 1 ] ; StringBuilder output = new StringBuilder ( ) ; for ( int i = 0 ; i < gs . length ; i ++ ) { output . append ( gs [ i ] ) . append ( "\t" ) ; } pwriter . write ( output . toString ( ) . trim ( ) + "\n" ) ; } else { pwriter . write ( "\n" ) ; } } pwriter . flush ( ) ; pwriter . close ( ) ; if ( addScore ) { BufferedWriter scoreWriter = new BufferedWriter ( new FileWriter ( scorePath ) ) ; for ( int i = 0 ; i < scoreList . size ( ) ; i ++ ) scoreWriter . write ( scoreList . get ( i ) + "\n" ) ; scoreWriter . flush ( ) ; scoreWriter . close ( ) ; } IOUtil . deleteFile ( outputFile + ".tmp" ) ;
public class Neo4JGraph { /** * Executes the given statement on the current { @ link Graph } instance . WARNING : There is no * guarantee that the results are confined within the current { @ link Neo4JReadPartition } . * @ param statement The CYPHER statement . * @ param parameters The CYPHER statement parameters . * @ return The { @ link StatementResult } with the CYPHER statement execution results . */ public StatementResult execute ( String statement , Map < String , Object > parameters ) { } }
Objects . requireNonNull ( statement , "statement cannot be null" ) ; Objects . requireNonNull ( parameters , "parameters cannot be null" ) ; // use overloaded method return execute ( new Statement ( statement , parameters ) ) ;
public class IoUtils { /** * Returns a list of the unique values in { @ code columnNumber } of * { @ code filename } . The columns of { @ code filename } are delimited * by { @ code delimiter } . * @ param filename * @ param columnNumber * @ param delimiter * @ return */ public static List < String > readUniqueColumnValuesFromDelimitedFile ( String filename , int columnNumber , String delimiter ) { } }
Set < String > values = Sets . newHashSet ( readColumnFromDelimitedFile ( filename , columnNumber , delimiter ) ) ; return Lists . newArrayList ( values ) ;
public class EntityDrivenAction { /** * 导入信息 */ public String importData ( ) { } }
TransferResult tr = new TransferResult ( ) ; EntityImporter importer = buildEntityImporter ( ) ; if ( null == importer ) { return forward ( "/components/importData/error" ) ; } try { configImporter ( importer ) ; importer . transfer ( tr ) ; put ( "importer" , importer ) ; put ( "importResult" , tr ) ; if ( tr . hasErrors ( ) ) { return forward ( "/components/importData/error" ) ; } else { return forward ( "/components/importData/result" ) ; } } catch ( IllegalImportFormatException e ) { tr . addFailure ( getText ( "error.importformat" ) , e . getMessage ( ) ) ; put ( "importResult" , tr ) ; return forward ( "/components/importData/error" ) ; }
public class vpnsessionpolicy { /** * Use this API to add vpnsessionpolicy . */ public static base_response add ( nitro_service client , vpnsessionpolicy resource ) throws Exception { } }
vpnsessionpolicy addresource = new vpnsessionpolicy ( ) ; addresource . name = resource . name ; addresource . rule = resource . rule ; addresource . action = resource . action ; return addresource . add_resource ( client ) ;
public class RepresentationModel { /** * Returns all { @ link Link } s with the given relation . * @ param relation must not be { @ literal null } . * @ return the links in a { @ link List } */ public List < Link > getLinks ( String relation ) { } }
Assert . hasText ( relation , "Link relation must not be null or empty!" ) ; return links . stream ( ) . filter ( link -> link . hasRel ( relation ) ) . collect ( Collectors . toList ( ) ) ;
public class JsApiMessageImpl { /** * Helper method used by the main Message Property methods to obtain the * non - JMS - valid Property items in the form of a map . * The method has package level visibility as it is used by JsJmsMessageImpl , * JsSdoMessageimpl and MQJsJmsMessageEncoderImpl . * @ return A JsMsgMap containing the Message Property name - value pairs . */ final JsMsgMap getOtherUserPropertyMap ( ) { } }
if ( otherUserPropertyMap == null ) { List < String > keys = ( List < String > ) getApi ( ) . getField ( JsApiAccess . OTHERPROPERTY_NAME ) ; List < Object > values = ( List < Object > ) getApi ( ) . getField ( JsApiAccess . OTHERPROPERTY_VALUE ) ; otherUserPropertyMap = new JsMsgMap ( keys , values ) ; } return otherUserPropertyMap ;
public class AdministrationDao { /** * Writes the counted nodes and the used operators back to the staging area . */ private void writeAmountOfNodesBack ( List < ExampleQuery > exampleQueries ) { } }
String sqlTemplate = "UPDATE _" + EXAMPLE_QUERIES_TAB + " SET nodes=?, used_ops=CAST(? AS text[]) WHERE example_query=?;" ; for ( ExampleQuery eQ : exampleQueries ) { getJdbcTemplate ( ) . update ( sqlTemplate , eQ . getNodes ( ) , eQ . getUsedOperators ( ) , eQ . getExampleQuery ( ) ) ; }
public class GenerateParseInfoVisitor { /** * Private helper for appendImmutableList ( ) and appendImmutableSortedSet ( ) . * @ param ilb The builder for the code . * @ param creationFunctionSnippet Code snippet for the qualified name of the list or set creation * function ( without trailing parentheses ) . * @ param itemSnippets Code snippets for the items to put into the list or set . */ private static void appendListOrSetHelper ( IndentedLinesBuilder ilb , String creationFunctionSnippet , Collection < String > itemSnippets ) { } }
if ( itemSnippets . isEmpty ( ) ) { ilb . appendLineStart ( creationFunctionSnippet , "()" ) ; } else { ilb . appendLine ( creationFunctionSnippet , "(" ) ; boolean isFirst = true ; for ( String item : itemSnippets ) { if ( isFirst ) { isFirst = false ; } else { ilb . appendLineEnd ( "," ) ; } ilb . appendLineStart ( " " , item ) ; } ilb . append ( ")" ) ; }
public class JoinDomainRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( JoinDomainRequest joinDomainRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( joinDomainRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( joinDomainRequest . getGatewayARN ( ) , GATEWAYARN_BINDING ) ; protocolMarshaller . marshall ( joinDomainRequest . getDomainName ( ) , DOMAINNAME_BINDING ) ; protocolMarshaller . marshall ( joinDomainRequest . getOrganizationalUnit ( ) , ORGANIZATIONALUNIT_BINDING ) ; protocolMarshaller . marshall ( joinDomainRequest . getDomainControllers ( ) , DOMAINCONTROLLERS_BINDING ) ; protocolMarshaller . marshall ( joinDomainRequest . getUserName ( ) , USERNAME_BINDING ) ; protocolMarshaller . marshall ( joinDomainRequest . getPassword ( ) , PASSWORD_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class VirtualHostImpl { /** * Given a new shiny inbound connection , figure out which HttpContainer * will handle the inbound request , and return a Runnable that should * be used to dispatch the work . * @ param inboundConnection * @ return the Runnable that should be queued for execution to handle the work , * or null if it is an unknown / unmatched context root */ public Runnable discriminate ( HttpInboundConnectionExtended inboundConnection ) { } }
String requestUri = inboundConnection . getRequest ( ) . getURI ( ) ; Runnable requestHandler = null ; // Find the container that can handle this URI . // The first to return a non - null wins for ( HttpContainerContext ctx : httpContainers ) { requestHandler = ctx . container . createRunnableHandler ( inboundConnection ) ; if ( requestHandler != null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { if ( ! requestUri . endsWith ( "/" ) ) { // Strip the query string and append a / to help the best match int pos = requestUri . lastIndexOf ( '?' ) ; if ( pos >= 0 ) { requestUri = requestUri . substring ( 0 , pos ) ; } requestUri += "/" ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( this , tc , "Discriminate " + requestUri , ctx . container ) ; } } break ; } } return requestHandler ;
public class PageLeafImpl { /** * Sends a write - request to the sequence writer for the page . * Called in the TableServerImpl thread . */ @ Override @ InService ( PageServiceImpl . class ) void writeImpl ( TableKelp table , PageServiceImpl pageServiceImpl , TableWriterService readWrite , SegmentStream sOut , long oldSequence , int saveLength , int saveTail ) { } }
Objects . requireNonNull ( sOut ) ; // System . out . println ( " WIMPL : " + this + " " + Long . toHexString ( System . identityHashCode ( this ) ) + " " + _ stub ) ; if ( saveLength <= 0 || oldSequence != sOut . getSequence ( ) || _stub == null || ! _stub . allowDelta ( ) ) { PageLeafImpl newPage ; if ( ! isDirty ( ) && ( _blocks . length == 0 || _blocks [ 0 ] . isCompact ( ) ) ) { newPage = copy ( getSequence ( ) ) ; } else { newPage = compact ( table ) ; } int sequenceWrite = newPage . nextWriteSequence ( ) ; if ( ! pageServiceImpl . compareAndSetLeaf ( this , newPage ) && ! pageServiceImpl . compareAndSetLeaf ( _stub , newPage ) ) { System . out . println ( "HMPH: " + pageServiceImpl . getPage ( getId ( ) ) + " " + this + " " + _stub ) ; } saveLength = newPage . getDataLengthWritten ( ) ; // newPage . write ( db , pageActor , sOut , saveLength ) ; // oldSequence = newPage . getSequence ( ) ; saveTail = newPage . getSaveTail ( ) ; newPage . clearDirty ( ) ; readWrite . writePage ( newPage , sOut , oldSequence , saveLength , saveTail , sequenceWrite , Result . of ( x -> newPage . afterDataFlush ( pageServiceImpl , sequenceWrite ) ) ) ; } else { int sequenceWrite = nextWriteSequence ( ) ; clearDirty ( ) ; readWrite . writePage ( this , sOut , oldSequence , saveLength , saveTail , sequenceWrite , Result . of ( x -> afterDataFlush ( pageServiceImpl , sequenceWrite ) ) ) ; }
public class AWSOpsWorksClient { /** * Stops a specified stack . * < b > Required Permissions < / b > : To use this action , an IAM user must have a Manage permissions level for the stack , * or an attached policy that explicitly grants permissions . For more information on user permissions , see < a * href = " http : / / docs . aws . amazon . com / opsworks / latest / userguide / opsworks - security - users . html " > Managing User * Permissions < / a > . * @ param stopStackRequest * @ return Result of the StopStack operation returned by the service . * @ throws ValidationException * Indicates that a request was not valid . * @ throws ResourceNotFoundException * Indicates that a resource was not found . * @ sample AWSOpsWorks . StopStack * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / opsworks - 2013-02-18 / StopStack " target = " _ top " > AWS API * Documentation < / a > */ @ Override public StopStackResult stopStack ( StopStackRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeStopStack ( request ) ;
public class Locations { /** * All { @ link Location locations } in the classpath that match the supplied package . * @ param pkg the package to look for within the classpath * @ return { @ link Location Locations } of all paths that match the supplied package */ @ PublicAPI ( usage = ACCESS ) public static Set < Location > ofPackage ( String pkg ) { } }
ImmutableSet . Builder < Location > result = ImmutableSet . builder ( ) ; for ( Location location : getLocationsOf ( asResourceName ( pkg ) ) ) { result . add ( location ) ; } return result . build ( ) ;
public class TopologyContextImpl { /** * Gets the index of this task id in getComponentTasks ( getThisComponentId ( ) ) . * An example use case for this method is determining which task * accesses which resource in a distributed resource to ensure an even distribution . */ public int getThisTaskIndex ( ) { } }
List < Integer > allTasks = getComponentTasks ( getThisComponentId ( ) ) ; int retVal = 0 ; for ( Integer tsk : allTasks ) { if ( tsk < myTaskId ) { retVal ++ ; } } return retVal ;
public class CacheArgumentServices { /** * Compute the part of cache key that depends of arguments * @ param keys : key from annotation * @ param jsonArgs : actual args * @ param paramNames : parameter name of concern method * @ return */ String computeSpecifiedArgPart ( String [ ] keys , List < String > jsonArgs , List < String > paramNames ) { } }
StringBuilder sb = new StringBuilder ( "[" ) ; boolean first = true ; for ( String key : keys ) { if ( ! first ) { sb . append ( "," ) ; } first = false ; String [ ] path = key . split ( "\\." ) ; logger . debug ( "Process '{}' : {} token(s)" , key , path . length ) ; String paramName = path [ 0 ] ; int idx = paramNames . indexOf ( paramName ) ; logger . debug ( "Index of param '{}' : '{}'" , paramName , idx ) ; String jsonArg = jsonArgs . get ( idx ) ; logger . debug ( "Param '{}' : '{}'" , paramName , jsonArg ) ; sb . append ( processArg ( Arrays . copyOfRange ( path , 1 , path . length ) , jsonArg ) ) ; } sb . append ( "]" ) ; return sb . toString ( ) ;
public class MongoDB { /** * Returns an instance of the specified target class with the property values from the specified JSON String . * @ param targetClass < code > Bson . class < / code > , < code > Document . class < / code > , < code > BasicBSONObject . class < / code > , < code > BasicDBObject . class < / code > * @ param json * @ return */ public static < T > T fromJSON ( final Class < T > targetClass , final String json ) { } }
if ( targetClass . equals ( Bson . class ) || targetClass . equals ( Document . class ) ) { final Document doc = new Document ( ) ; jsonParser . readString ( doc , json ) ; return ( T ) doc ; } else if ( targetClass . equals ( BasicBSONObject . class ) ) { final BasicBSONObject result = new BasicBSONObject ( ) ; jsonParser . readString ( result , json ) ; return ( T ) result ; } else if ( targetClass . equals ( BasicDBObject . class ) ) { final BasicDBObject result = new BasicDBObject ( ) ; jsonParser . readString ( result , json ) ; return ( T ) result ; } else { throw new IllegalArgumentException ( "Unsupported type: " + ClassUtil . getCanonicalClassName ( targetClass ) ) ; }
public class SipResourceAdaptor { /** * ( non - Javadoc ) * @ see javax . slee . resource . ResourceAdaptor # raConfigurationUpdate ( javax . slee . resource . ConfigProperties ) */ public void raConfigurationUpdate ( ConfigProperties properties ) { } }
try { Set < String > oldTransports = new HashSet < String > ( this . transports ) ; raConfigure ( properties ) ; } catch ( Throwable ex ) { String msg = "error while updating RA configuration" ; tracer . severe ( msg , ex ) ; throw new RuntimeException ( msg , ex ) ; }
public class CharsetEncoder { /** * Changes this encoder ' s action for malformed - input errors . < / p > * < p > This method invokes the { @ link # implOnMalformedInput * implOnMalformedInput } method , passing the new action . < / p > * @ param newAction The new action ; must not be < tt > null < / tt > * @ return This encoder * @ throws IllegalArgumentException * If the precondition on the parameter does not hold */ public final CharsetEncoder onMalformedInput ( CodingErrorAction newAction ) { } }
if ( newAction == null ) throw new IllegalArgumentException ( "Null action" ) ; malformedInputAction = newAction ; implOnMalformedInput ( newAction ) ; return this ;
public class RpcWrapper { /** * Decide whether to retry or throw an exception . * @ param e * The exception . * @ param attemptNumber * The number of attempts so far . * @ throws IOException */ private void handleRpcException ( RpcException e , int attemptNumber ) throws IOException { } }
String messageStart ; if ( ! ( e . getStatus ( ) . equals ( RpcStatus . NETWORK_ERROR ) ) ) { messageStart = "rpc" ; } else { // check whether to retry if ( attemptNumber + 1 < _maximumRetries ) { try { int waitTime = _retryWait * ( attemptNumber + 1 ) ; Thread . sleep ( waitTime ) ; } catch ( InterruptedException ie ) { // restore the interrupt status Thread . currentThread ( ) . interrupt ( ) ; } LOG . warn ( "network error happens, server {}, attemptNumber {}" , new Object [ ] { _server , attemptNumber } ) ; return ; } messageStart = "network" ; } throw new NfsException ( NfsStatus . NFS3ERR_IO , String . format ( "%s error, server: %s, RPC error: %s" , messageStart , _server , e . getMessage ( ) ) , e ) ;
public class DiskFileItem { /** * A convenience method to write an uploaded item to disk . The client code is * not concerned with whether or not the item is stored in memory , or on disk * in a temporary location . They just want to write the uploaded item to a * file . * This implementation first attempts to rename the uploaded item to the * specified destination file , if the item was originally written to disk . * Otherwise , the data will be copied to the specified file . * This method is only guaranteed to work < em > once < / em > , the first time it is * invoked for a particular item . This is because , in the event that the * method renames a temporary file , that file will no longer be available to * copy or rename again at a later time . * @ param aDstFile * The < code > File < / code > into which the uploaded item should be stored . * @ throws FileUploadException * if an error occurs . */ @ Nonnull public ISuccessIndicator write ( @ Nonnull final File aDstFile ) throws FileUploadException { } }
ValueEnforcer . notNull ( aDstFile , "DstFile" ) ; if ( isInMemory ( ) ) return SimpleFileIO . writeFile ( aDstFile , directGet ( ) ) ; final File aOutputFile = getStoreLocation ( ) ; if ( aOutputFile != null ) { // Save the length of the file m_nSize = aOutputFile . length ( ) ; /* * The uploaded file is being stored on disk in a temporary location so * move it to the desired file . */ if ( FileOperations . renameFile ( aOutputFile , aDstFile ) . isSuccess ( ) ) return ESuccess . SUCCESS ; // Copying needed return FileOperations . copyFile ( aOutputFile , aDstFile ) ; } // For whatever reason we cannot write the file to disk . throw new FileUploadException ( "Cannot write uploaded file to: " + aDstFile . getAbsolutePath ( ) ) ;
public class ServletEnvironment { /** * Set a mime mapping . * @ param extension Extension * @ param type Mime type */ public void addMimeMapping ( String extension , String type ) { } }
handler . getMimeTypes ( ) . addMimeMapping ( extension , type ) ;
public class Parser { /** * A { @ link Parser } that runs { @ code this } parser for at least { @ code min } times and up to { @ code max } times , with * all the return values ignored . */ public final Parser < Void > skipTimes ( int min , int max ) { } }
Checks . checkMinMax ( min , max ) ; return new SkipTimesParser ( this , min , max ) ;
public class KeyArea { /** * Initialize the class . * @ param record The parent record . * @ param iKeyDup The type of key ( UNIQUE / NOT _ UNIQUE / SECONDARY ) . * @ param strKeyName The name of this key ( default to first fieldnameKEY ) . */ public void init ( Rec record , int iKeyDup , String strKeyName ) { } }
super . init ( record , iKeyDup , strKeyName ) ; m_iKeyActualLength = 0 ; // Actual Byte length m_iKeyByteLength = 0 ; // Key length ( 0-64 bytes ) ( including trailer bytes )
public class PdfGState { /** * Determines the behavior of overlapping glyphs within a text object * in the transparent imaging model . * @ param v */ public void setTextKnockout ( boolean v ) { } }
put ( PdfName . TK , v ? PdfBoolean . PDFTRUE : PdfBoolean . PDFFALSE ) ;
public class I18nTool { /** * Uses { @ link SimpleDateFormat } to translate the supplied { @ link * Long } or { @ link Date } argument into a formatted date string using * the locale appropriate to the current request . */ public String date ( String format , Object arg ) { } }
Date when = massageDate ( arg ) ; if ( when == null ) { return format ; } SimpleDateFormat fmt = new SimpleDateFormat ( format , getLocale ( ) ) ; return fmt . format ( when ) ;
public class ModelsImpl { /** * Deletes a regex entity model from the application . * @ param appId The application ID . * @ param versionId The version ID . * @ param regexEntityId The regex entity extractor ID . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the OperationStatus object */ public Observable < OperationStatus > deleteRegexEntityModelAsync ( UUID appId , String versionId , UUID regexEntityId ) { } }
return deleteRegexEntityModelWithServiceResponseAsync ( appId , versionId , regexEntityId ) . map ( new Func1 < ServiceResponse < OperationStatus > , OperationStatus > ( ) { @ Override public OperationStatus call ( ServiceResponse < OperationStatus > response ) { return response . body ( ) ; } } ) ;
public class BitZMarketDataServiceRaw { /** * 获取每种交易对的信息 * @ param currencyPairs * @ throws IOException */ public BitZSymbolList getSymbolList ( CurrencyPair ... currencyPairs ) throws IOException { } }
List < String > symbolList = new ArrayList < > ( currencyPairs . length ) ; Arrays . stream ( currencyPairs ) . forEach ( currencyPair -> symbolList . add ( BitZUtils . toPairString ( currencyPair ) ) ) ; String symbols = symbolList . stream ( ) . collect ( Collectors . joining ( "," ) ) ; return bitz . getSymbolList ( symbols ) . getData ( ) ;
public class DevLockManager { boolean isLockedByMe ( final DeviceProxy deviceProxy ) throws DevFailed { } }
final LockerInfo info = getLockerInfo ( deviceProxy ) ; return info . isMe ( ) ;
public class SignalRsInner { /** * Create a new SignalR service and update an exiting SignalR service . * @ param resourceGroupName The name of the resource group that contains the resource . You can obtain this value from the Azure Resource Manager API or the portal . * @ param resourceName The name of the SignalR resource . * @ param parameters Parameters for the create or update operation * @ 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 < SignalRResourceInner > beginCreateOrUpdateAsync ( String resourceGroupName , String resourceName , SignalRCreateParameters parameters , final ServiceCallback < SignalRResourceInner > serviceCallback ) { } }
return ServiceFuture . fromResponse ( beginCreateOrUpdateWithServiceResponseAsync ( resourceGroupName , resourceName , parameters ) , serviceCallback ) ;
public class AbstractDoclet { /** * Generate the class files for single classes specified on the command line . * @ param classtree the data structure representing the class tree . */ private void generateClassFiles ( ClassTree classtree ) { } }
String [ ] packageNames = configuration . classDocCatalog . packageNames ( ) ; for ( String packageName : packageNames ) { generateClassFiles ( configuration . classDocCatalog . allClasses ( packageName ) , classtree ) ; }
public class PolicyStatesInner { /** * Summarizes policy states for the subscription level policy set definition . * @ param subscriptionId Microsoft Azure subscription ID . * @ param policySetDefinitionName Policy set definition name . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ throws QueryFailureException thrown if the request is rejected by server * @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @ return the SummarizeResultsInner object if successful . */ public SummarizeResultsInner summarizeForPolicySetDefinition ( String subscriptionId , String policySetDefinitionName ) { } }
return summarizeForPolicySetDefinitionWithServiceResponseAsync ( subscriptionId , policySetDefinitionName ) . toBlocking ( ) . single ( ) . body ( ) ;
public class SetStatusRequest { /** * The IDs of the objects . The corresponding objects can be either physical or components , but not a mix of both * types . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setObjectIds ( java . util . Collection ) } or { @ link # withObjectIds ( java . util . Collection ) } if you want to * override the existing values . * @ param objectIds * The IDs of the objects . The corresponding objects can be either physical or components , but not a mix of * both types . * @ return Returns a reference to this object so that method calls can be chained together . */ public SetStatusRequest withObjectIds ( String ... objectIds ) { } }
if ( this . objectIds == null ) { setObjectIds ( new com . amazonaws . internal . SdkInternalList < String > ( objectIds . length ) ) ; } for ( String ele : objectIds ) { this . objectIds . add ( ele ) ; } return this ;
public class WSConnectionRequestInfoImpl { /** * Determine if the result set holdability property matches . It is considered to match if * - Both holdability values are unspecified . * - Both holdability values are the same value . * - One of the holdability values is unspecified and the other CRI requested the default value . * @ return true if the result set holdabilities match , otherwise false . */ private final boolean matchHoldability ( WSConnectionRequestInfoImpl cri ) { } }
// At least one of the CRIs should know the default value . int defaultValue = defaultHoldability == 0 ? cri . defaultHoldability : defaultHoldability ; return ivHoldability == cri . ivHoldability || ivHoldability == 0 && match ( defaultValue , cri . ivHoldability ) || cri . ivHoldability == 0 && match ( ivHoldability , defaultValue ) ;
public class BESecurityConfig { /** * Add empty sDep and method configurations given by the map if they are * not already already defined . */ public void addEmptyConfigs ( Map < String , List < String > > pidToMethodList ) { } }
Iterator < String > pIter = pidToMethodList . keySet ( ) . iterator ( ) ; while ( pIter . hasNext ( ) ) { String sDepPID = pIter . next ( ) ; // add the sDep indicated by the key if it doesn ' t exist ServiceDeploymentRoleConfig sDepRoleConfig = m_sDepConfigs . get ( sDepPID ) ; if ( sDepRoleConfig == null ) { sDepRoleConfig = new ServiceDeploymentRoleConfig ( m_defaultConfig , sDepPID ) ; m_sDepConfigs . put ( sDepPID , sDepRoleConfig ) ; } // add each method indicated by the List which doesn ' t already exist Iterator < String > mIter = pidToMethodList . get ( sDepPID ) . iterator ( ) ; while ( mIter . hasNext ( ) ) { String methodName = ( String ) mIter . next ( ) ; MethodRoleConfig methodRoleConfig = sDepRoleConfig . getMethodConfigs ( ) . get ( methodName ) ; if ( methodRoleConfig == null ) { methodRoleConfig = new MethodRoleConfig ( sDepRoleConfig , methodName ) ; sDepRoleConfig . getMethodConfigs ( ) . put ( methodName , methodRoleConfig ) ; } } }
public class SoyProtoValue { /** * it if we can */ private ProtoClass clazz ( ) { } }
ProtoClass localClazz = clazz ; if ( localClazz == null ) { localClazz = classCache . getUnchecked ( proto . getDescriptorForType ( ) ) ; clazz = localClazz ; } return localClazz ;
public class ParagraphBuilder { /** * Create a link in the current paragraph . * @ param text the text * @ param file the destination * @ return this for fluent style */ public ParagraphBuilder link ( final String text , final File file ) { } }
final ParagraphElement paragraphElement = Link . create ( text , file ) ; this . paragraphElements . add ( paragraphElement ) ; return this ;
public class RecyclerView { /** * Offset the bounds of all child views by < code > dy < / code > pixels . * Useful for implementing simple scrolling in { @ link com . twotoasters . android . support . v7 . widget . RecyclerView . LayoutManager LayoutManagers } . * @ param dy Vertical pixel offset to apply to the bounds of all child views */ public void offsetChildrenVertical ( int dy ) { } }
final int childCount = getChildCount ( ) ; for ( int i = 0 ; i < childCount ; i ++ ) { getChildAt ( i ) . offsetTopAndBottom ( dy ) ; }
public class RangeSliceResponseResolver { /** * ( this is not currently an issue since we don ' t do read repair for range queries . ) */ public Iterable < Row > resolve ( ) { } }
ArrayList < RowIterator > iters = new ArrayList < RowIterator > ( responses . size ( ) ) ; int n = 0 ; for ( MessageIn < RangeSliceReply > response : responses ) { RangeSliceReply reply = response . payload ; n = Math . max ( n , reply . rows . size ( ) ) ; iters . add ( new RowIterator ( reply . rows . iterator ( ) , response . from ) ) ; } // for each row , compute the combination of all different versions seen , and repair incomplete versions // TODO do we need to call close ? CloseableIterator < Row > iter = MergeIterator . get ( iters , pairComparator , new Reducer ( ) ) ; List < Row > resolvedRows = new ArrayList < Row > ( n ) ; while ( iter . hasNext ( ) ) resolvedRows . add ( iter . next ( ) ) ; return resolvedRows ;
public class SQLiteDatabase { /** * Runs ' pragma integrity _ check ' on the given database ( and all the attached databases ) * and returns true if the given database ( and all its attached databases ) pass integrity _ check , * false otherwise . * If the result is false , then this method logs the errors reported by the integrity _ check * command execution . * Note that ' pragma integrity _ check ' on a database can take a long time . * @ return true if the given database ( and all its attached databases ) pass integrity _ check , * false otherwise . */ public boolean isDatabaseIntegrityOk ( ) { } }
acquireReference ( ) ; try { List < Pair < String , String > > attachedDbs = null ; try { attachedDbs = getAttachedDbs ( ) ; if ( attachedDbs == null ) { throw new IllegalStateException ( "databaselist for: " + getPath ( ) + " couldn't " + "be retrieved. probably because the database is closed" ) ; } } catch ( com . couchbase . lite . internal . database . sqlite . exception . SQLiteException e ) { // can ' t get attachedDb list . do integrity check on the main database attachedDbs = new ArrayList < Pair < String , String > > ( ) ; attachedDbs . add ( new Pair < String , String > ( "main" , getPath ( ) ) ) ; } for ( int i = 0 ; i < attachedDbs . size ( ) ; i ++ ) { Pair < String , String > p = attachedDbs . get ( i ) ; com . couchbase . lite . internal . database . sqlite . SQLiteStatement prog = null ; try { prog = compileStatement ( "PRAGMA " + p . first + ".integrity_check(1);" ) ; String rslt = prog . simpleQueryForString ( ) ; if ( ! rslt . equalsIgnoreCase ( "ok" ) ) { // integrity _ checker failed on main or attached databases DLog . e ( TAG , "PRAGMA integrity_check on " + p . second + " returned: " + rslt ) ; return false ; } } finally { if ( prog != null ) prog . close ( ) ; } } } finally { releaseReference ( ) ; } return true ;
public class HttpOutboundLink { /** * Initialize this object . * @ param inVC * @ param channel */ public void init ( VirtualConnection inVC , HttpOutboundChannel channel ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Init on link: " + this + " " + inVC ) ; } super . init ( inVC ) ; this . myChannel = channel ; this . bIsActive = true ; setEnableReconnect ( this . myChannel . getHttpConfig ( ) . allowsRetries ( ) ) ; setAllowReconnect ( true ) ;
public class SObject { /** * deprecated * @ see # of ( String , File , String . . . ) */ @ Deprecated public static SObject valueOf ( String key , InputStream is , String ... attrs ) { } }
return of ( key , is , attrs ) ;
public class Context { /** * Determines whether a particular context is valid for the end of a block of a particular content * kind . */ public final boolean isValidEndContextForContentKind ( SanitizedContentKind contentKind ) { } }
if ( templateNestDepth != 0 ) { return false ; } switch ( contentKind ) { case CSS : return state == HtmlContext . CSS && elType == ElementType . NONE ; case HTML : return state == HtmlContext . HTML_PCDATA && elType == ElementType . NONE ; case ATTRIBUTES : // Allow any html attribute context or html tag this . HTML _ TAG is needed for constructs // like " checked " that don ' t require an attribute value . Explicitly disallow // HTML _ NORMAL _ ATTR _ VALUE ( e . g . foo = { $ x } without quotes ) to help catch cases where // attributes aren ' t safely composable ( e . g . foo = { $ x } checked would end up with one long // attribute value , whereas foo = " { $ x } " checked would be parsed as intended ) . return state == HtmlContext . HTML_ATTRIBUTE_NAME || state == HtmlContext . HTML_TAG ; case JS : // Just ensure the state is JS - - don ' t worry about whether a regex is coming or not . return state == HtmlContext . JS && elType == ElementType . NONE ; case URI : // Ensure that the URI content is non - empty and the URI type remains normal ( which is // the assumed type of the URI content kind ) . return state == HtmlContext . URI && uriType == UriType . NORMAL && uriPart != UriPart . START ; case TEXT : return state == HtmlContext . TEXT ; case TRUSTED_RESOURCE_URI : // Ensure that the URI content is non - empty and the URI type remains normal ( which is // the assumed type of the URI content kind ) . return state == HtmlContext . URI && uriType == UriType . TRUSTED_RESOURCE && uriPart != UriPart . START ; } throw new IllegalArgumentException ( "Specified content kind " + contentKind + " has no associated end context." ) ;
public class PersonGroupPersonsImpl { /** * Add a representative face to a person for identification . The input face is specified as an image with a targetFace rectangle . * @ param personGroupId Id referencing a particular person group . * @ param personId Id referencing a particular person . * @ param image An image stream . * @ param addPersonFaceFromStreamOptionalParameter the object representing the optional parameters to be set before calling this API * @ throws IllegalArgumentException thrown if parameters fail the validation * @ throws APIErrorException thrown if the request is rejected by server * @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @ return the PersistedFace object if successful . */ public PersistedFace addPersonFaceFromStream ( String personGroupId , UUID personId , byte [ ] image , AddPersonFaceFromStreamOptionalParameter addPersonFaceFromStreamOptionalParameter ) { } }
return addPersonFaceFromStreamWithServiceResponseAsync ( personGroupId , personId , image , addPersonFaceFromStreamOptionalParameter ) . toBlocking ( ) . single ( ) . body ( ) ;
public class AdditionalPropertiesDeserializer { /** * Gets a module wrapping this serializer as an adapter for the Jackson * ObjectMapper . * @ param mapper the object mapper for default deserializations * @ return a simple module to be plugged onto Jackson ObjectMapper . */ public static SimpleModule getModule ( final ObjectMapper mapper ) { } }
SimpleModule module = new SimpleModule ( ) ; module . setDeserializerModifier ( new BeanDeserializerModifier ( ) { @ Override public JsonDeserializer < ? > modifyDeserializer ( DeserializationConfig config , BeanDescription beanDesc , JsonDeserializer < ? > deserializer ) { for ( Class < ? > c : TypeToken . of ( beanDesc . getBeanClass ( ) ) . getTypes ( ) . classes ( ) . rawTypes ( ) ) { Field [ ] fields = c . getDeclaredFields ( ) ; for ( Field field : fields ) { if ( "additionalProperties" . equalsIgnoreCase ( field . getName ( ) ) ) { JsonProperty property = field . getAnnotation ( JsonProperty . class ) ; if ( property != null && property . value ( ) . isEmpty ( ) ) { return new AdditionalPropertiesDeserializer ( beanDesc . getBeanClass ( ) , deserializer , mapper ) ; } } } } return deserializer ; } } ) ; return module ;
public class CmsContainerpageController { /** * Checks for container elements that are no longer present within the DOM . < p > */ public void cleanUpContainers ( ) { } }
List < String > removed = new ArrayList < String > ( ) ; for ( Entry < String , CmsContainerPageContainer > entry : m_targetContainers . entrySet ( ) ) { if ( ! RootPanel . getBodyElement ( ) . isOrHasChild ( entry . getValue ( ) . getElement ( ) ) ) { removed . add ( entry . getKey ( ) ) ; } } for ( String containerId : removed ) { m_targetContainers . remove ( containerId ) ; m_containers . remove ( containerId ) ; } if ( removed . size ( ) > 0 ) { scheduleGalleryUpdate ( ) ; }
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 * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the List & lt ; EventSubscriptionInner & gt ; object */ public Observable < List < EventSubscriptionInner > > listRegionalBySubscriptionAsync ( String location ) { } }
return listRegionalBySubscriptionWithServiceResponseAsync ( location ) . map ( new Func1 < ServiceResponse < List < EventSubscriptionInner > > , List < EventSubscriptionInner > > ( ) { @ Override public List < EventSubscriptionInner > call ( ServiceResponse < List < EventSubscriptionInner > > response ) { return response . body ( ) ; } } ) ;
public class NonBlockingBufferedInputStream { /** * Check to make sure that underlying input stream has not been nulled out due * to close ; if not return it ; */ @ Nonnull private InputStream _getInIfOpen ( ) throws IOException { } }
final InputStream ret = in ; if ( ret == null ) throw new IOException ( "Stream closed" ) ; return ret ;
public class Label { /** * Returns the text this label is displaying . Multi - line labels will have their text concatenated with \ n , even if * they were originally set using multi - line text having \ r \ n as line terminators . * @ return String of the text this label is displaying */ public synchronized String getText ( ) { } }
if ( lines . length == 0 ) { return "" ; } StringBuilder bob = new StringBuilder ( lines [ 0 ] ) ; for ( int i = 1 ; i < lines . length ; i ++ ) { bob . append ( "\n" ) . append ( lines [ i ] ) ; } return bob . toString ( ) ;
public class DescribeServicesRequest { /** * A JSON - formatted list of service codes available for AWS services . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setServiceCodeList ( java . util . Collection ) } or { @ link # withServiceCodeList ( java . util . Collection ) } if you * want to override the existing values . * @ param serviceCodeList * A JSON - formatted list of service codes available for AWS services . * @ return Returns a reference to this object so that method calls can be chained together . */ public DescribeServicesRequest withServiceCodeList ( String ... serviceCodeList ) { } }
if ( this . serviceCodeList == null ) { setServiceCodeList ( new com . amazonaws . internal . SdkInternalList < String > ( serviceCodeList . length ) ) ; } for ( String ele : serviceCodeList ) { this . serviceCodeList . add ( ele ) ; } return this ;
public class CmsJspActionElement { /** * Include a named sub - element with parameters from the OpenCms VFS , same as * using the < code > & lt ; cms : include file = " * * * " element = " * * * " / & gt ; < / code > tag * with parameters in the tag body . < p > * The parameter map should be a map where the keys are Strings * ( the parameter names ) and the values are of type String [ ] . * However , as a convenience feature , * in case you provide just a String for the parameter value , * it will automatically be translated to a String [ 1 ] . < p > * The handling of the < code > element < / code > parameter depends on the * included file type . Most often it is used as template selector . < p > * < b > Important : < / b > Exceptions that occur in the include process are NOT * handled even if { @ link # setSupressingExceptions ( boolean ) } was set to < code > true < / code > . * @ param target the target URI of the file in the OpenCms VFS ( can be relative or absolute ) * @ param element the element ( template selector ) to display from the target * @ param editable flag to indicate if direct edit should be enabled for the element * @ param cacheable flag to indicate if the target should be cacheable in the Flex cache * @ param parameterMap a map of the request parameters * @ throws JspException in case there were problems including the target * @ see org . opencms . jsp . CmsJspTagInclude */ public void include ( String target , String element , boolean editable , boolean cacheable , Map < String , ? > parameterMap ) throws JspException { } }
if ( isNotInitialized ( ) ) { return ; } Map < String , String [ ] > modParameterMap = null ; if ( parameterMap != null ) { try { modParameterMap = new HashMap < String , String [ ] > ( parameterMap . size ( ) ) ; // ensure parameters are always of type String [ ] not just String Iterator < ? > i = parameterMap . entrySet ( ) . iterator ( ) ; while ( i . hasNext ( ) ) { Map . Entry < String , ? > entry = ( Entry < String , ? > ) i . next ( ) ; String key = entry . getKey ( ) ; Object value = entry . getValue ( ) ; if ( value instanceof String [ ] ) { modParameterMap . put ( key , ( String [ ] ) value ) ; } else { if ( value == null ) { value = "null" ; } String [ ] newValue = new String [ ] { value . toString ( ) } ; modParameterMap . put ( key , newValue ) ; } } } catch ( UnsupportedOperationException e ) { // parameter map is immutable , just use it " as is " } } CmsJspTagInclude . includeTagAction ( getJspContext ( ) , target , element , null , editable , cacheable , modParameterMap , CmsRequestUtil . getAtrributeMap ( getRequest ( ) ) , getRequest ( ) , getResponse ( ) ) ;
public class Cnf { /** * If the given disjunction consists of a single assertion , returns the * equivalent assertion . Otherwise , return null . */ public static IAssertion toAssertion ( IDisjunct disjunct ) { } }
return disjunct . getAssertionCount ( ) == 1 ? disjunct . getAssertions ( ) . next ( ) : null ;
public class PhysicalTable { /** * Move this Field ' s data to the record area ( Override this for non - standard buffers ) . * Warning : Check to make sure the field . isSelected ( ) before moving data ! * @ param field The field to move the current data to . * @ exception DBException File exception . */ public void fieldToData ( Field field ) throws DBException { } }
( ( BaseBuffer ) this . getHandle ( DBConstants . DATA_SOURCE_HANDLE ) ) . addNextField ( ( FieldInfo ) field ) ;
public class RootEngine { /** * { @ link RootEngine } 接口 . 调用此方法判断并处理请求 . 如果本引擎能够找到该请求相应的控制器方法处理 , 则启动整个调用过程 , * 并最终渲染页面到客户端 ; * @ param request * @ param response * @ return * @ throws ServletException */ @ Override public Object execute ( Rose rose ) throws Throwable { } }
InvocationBean inv = rose . getInvocation ( ) ; ServletRequest request = inv . getRequest ( ) ; if ( request . getCharacterEncoding ( ) == null ) { request . setCharacterEncoding ( "UTF-8" ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( "set request.characterEncoding by default:" + request . getCharacterEncoding ( ) ) ; } } final RequestPath requestPath = inv . getRequestPath ( ) ; // save before include if ( requestPath . isIncludeRequest ( ) ) { saveAttributesBeforeInclude ( inv ) ; // 恢复include请求前的各种请求属性 ( 包括Model对象 ) rose . addAfterCompletion ( new AfterCompletion ( ) { @ Override public void afterCompletion ( Invocation inv , Throwable ex ) throws Exception { restoreRequestAttributesAfterInclude ( inv ) ; } } ) ; } // 调用之前设置内置属性 inv . addModel ( "invocation" , inv ) ; inv . addModel ( "ctxpath" , requestPath . getCtxpath ( ) ) ; // instruction是控制器action方法的返回结果或其对应的Instruction对象 ( 也可能是拦截器 、 错误处理器返回的 ) Object instruction = rose . doNext ( ) ; if ( Thread . currentThread ( ) . isInterrupted ( ) ) { logger . info ( "stop to render: thread is interrupted" ) ; } else { // 写flash消息到Cookie ( 被include的请求不会有功能 ) if ( ! requestPath . isIncludeRequest ( ) ) { FlashImpl flash = ( FlashImpl ) inv . getFlash ( false ) ; if ( flash != null ) { flash . writeNewMessages ( ) ; } } // 渲染页面 instructionExecutor . render ( inv , instruction ) ; } return instruction ;
public class EventServiceImpl { /** * { @ inheritDoc } * Handles an asynchronous remote event with a { @ link RemoteEventProcessor } . The * processor may determine the thread which will handle the event . If the execution is rejected , * the rejection count is increased and a failure is logged . The event processing is not retried . * @ param packet the response packet to handle * @ see # sendEvent ( Address , EventEnvelope , int ) */ @ Override public void accept ( Packet packet ) { } }
try { eventExecutor . execute ( new RemoteEventProcessor ( this , packet ) ) ; } catch ( RejectedExecutionException e ) { rejectedCount . inc ( ) ; if ( eventExecutor . isLive ( ) ) { Connection conn = packet . getConn ( ) ; String endpoint = conn . getEndPoint ( ) != null ? conn . getEndPoint ( ) . toString ( ) : conn . toString ( ) ; logFailure ( "EventQueue overloaded! Failed to process event packet sent from: %s" , endpoint ) ; } }
public class ReceiveMessageBuilder { /** * Expect this message payload as model object which is mapped to a character sequence * using the default object to json mapper before validation is performed . * @ param payload * @ param objectMapper * @ return */ public T payload ( Object payload , ObjectMapper objectMapper ) { } }
try { setPayload ( objectMapper . writer ( ) . writeValueAsString ( payload ) ) ; } catch ( JsonProcessingException e ) { throw new CitrusRuntimeException ( "Failed to map object graph for message payload" , e ) ; } return self ;
public class OpenHelperManager { /** * Call the constructor on our helper class . */ private static OrmLiteSqliteOpenHelper constructHelper ( Context context , Class < ? extends OrmLiteSqliteOpenHelper > openHelperClass ) { } }
Constructor < ? > constructor ; try { constructor = openHelperClass . getConstructor ( Context . class ) ; } catch ( Exception e ) { throw new IllegalStateException ( "Could not find public constructor that has a single (Context) argument for helper class " + openHelperClass , e ) ; } try { return ( OrmLiteSqliteOpenHelper ) constructor . newInstance ( context ) ; } catch ( Exception e ) { throw new IllegalStateException ( "Could not construct instance of helper class " + openHelperClass , e ) ; }
public class FeatureResolverImpl { /** * This method is passed a list of features to check against the auto features . For each auto feature , the method checks to see if the capability * statement has been satisfied by any of the other features in the list . If so , it is add to the list of features to process . * We then need to recursively check the new set of features to see if other features have their capabilities satisfied by these auto features and keep * going round until we ' ve got the complete list . */ private Set < String > processAutoFeatures ( Collection < ProvisioningFeatureDefinition > kernelFeatures , Set < String > result , Set < String > seenAutoFeatures , SelectionContext selectionContext ) { } }
Set < String > autoFeaturesToProcess = new HashSet < String > ( ) ; Set < ProvisioningFeatureDefinition > filteredFeatureDefs = new HashSet < ProvisioningFeatureDefinition > ( kernelFeatures ) ; for ( String feature : result ) { filteredFeatureDefs . add ( selectionContext . getRepository ( ) . getFeature ( feature ) ) ; } // Iterate over all of the auto - feature definitions . . . for ( ProvisioningFeatureDefinition autoFeatureDef : selectionContext . getRepository ( ) . getAutoFeatures ( ) ) { String featureSymbolicName = autoFeatureDef . getSymbolicName ( ) ; // if we haven ' t been here before , check the capability header against the list of // installed features to see if it should be auto - installed . if ( ! seenAutoFeatures . contains ( featureSymbolicName ) ) if ( autoFeatureDef . isCapabilitySatisfied ( filteredFeatureDefs ) ) { // Add this auto feature to the list of auto features to ignore on subsequent recursions . seenAutoFeatures . add ( featureSymbolicName ) ; // Add the feature to the return value of auto features to install if they are supported in this process . if ( supportedProcessType ( selectionContext . _supportedProcessTypes , autoFeatureDef ) ) { autoFeaturesToProcess . add ( featureSymbolicName ) ; } } } return autoFeaturesToProcess ;
public class EtcdClient { /** * Build url with key and url params */ private URI buildUriWithKeyAndParams ( String key , Map < String , String > params ) { } }
StringBuilder sb = new StringBuilder ( ) ; sb . append ( URI_PREFIX ) ; if ( key . startsWith ( "/" ) ) { key = key . substring ( 1 ) ; } for ( String token : Splitter . on ( "/" ) . split ( key ) ) { sb . append ( "/" ) . append ( urlEscape ( token ) ) ; } if ( params != null ) { sb . append ( "?" ) ; for ( String str : params . keySet ( ) ) { sb . append ( urlEscape ( str ) ) . append ( "=" ) . append ( urlEscape ( params . get ( str ) ) ) ; sb . append ( "&" ) ; } } String url = sb . toString ( ) ; if ( url . endsWith ( "&" ) ) { url = url . substring ( 0 , url . length ( ) - 1 ) ; } return baseUri . resolve ( url ) ;
public class Math { /** * Scales each column of a matrix to range [ lo , hi ] . * @ param lo lower limit of range * @ param hi upper limit of range */ public static void scale ( double [ ] [ ] x , double lo , double hi ) { } }
int n = x . length ; int p = x [ 0 ] . length ; double [ ] min = colMin ( x ) ; double [ ] max = colMax ( x ) ; for ( int j = 0 ; j < p ; j ++ ) { double scale = max [ j ] - min [ j ] ; if ( ! Math . isZero ( scale ) ) { for ( int i = 0 ; i < n ; i ++ ) { x [ i ] [ j ] = ( x [ i ] [ j ] - min [ j ] ) / scale ; } } else { for ( int i = 0 ; i < n ; i ++ ) { x [ i ] [ j ] = 0.5 ; } } }
public class SymmetricDifferenceMatcher { /** * Matches A objects to T targets . Each A is mapped to subset of items . Each * match is passed to consumer . Map is traversed as long as there are matches . * Each match will remove targets mappings . * @ param < A > * @ param samples * @ param consumer */ public < A > void match ( Map < A , ? extends Collection < I > > samples , BiConsumer < T , A > consumer ) { } }
Map < A , Collection < I > > m = new HashMap < > ( samples ) ; boolean cont = true ; while ( cont ) { cont = false ; Iterator < Entry < A , Collection < I > > > iterator = m . entrySet ( ) . iterator ( ) ; while ( iterator . hasNext ( ) ) { Entry < A , Collection < I > > e = iterator . next ( ) ; T match = match ( e . getValue ( ) ) ; if ( match != null ) { consumer . accept ( match , e . getKey ( ) ) ; cont = true ; iterator . remove ( ) ; } } }
public class AESFastEngine { /** * initialise an AES cipher . * @ param forEncryption whether or not we are for encryption . * @ param params the parameters required to set up the cipher . * @ throws IllegalArgumentException if the params argument is * inappropriate . */ public void init ( boolean forEncryption , KeyParameter params ) { } }
WorkingKey = generateWorkingKey ( params . getKey ( ) , forEncryption ) ; this . forEncryption = forEncryption ;
public class FileTag { /** * write to the source file * @ param attributes * @ param mode * @ param acl * @ param serverPassword , booleancreatePath * @ throws PageException */ public static void actionTouch ( PageContext pageContext , SecurityManager securityManager , Resource file , String serverPassword , boolean createPath , Object acl , int mode , String attributes ) throws PageException { } }
checkFile ( pageContext , securityManager , file , serverPassword , createPath , true , true , true ) ; setACL ( pageContext , file , acl ) ; try { ResourceUtil . touch ( file ) ; } catch ( IOException e ) { throw new ApplicationException ( "can't touch file " + file . getAbsolutePath ( ) , e . getMessage ( ) ) ; } setMode ( file , mode ) ; setAttributes ( file , attributes ) ;
public class Counters { /** * This method does not check entries for NAN or INFINITY values in the * doubles returned . It also only iterates over the counter with the smallest * number of keys to help speed up computation . Pair this method with * normalizing your counters before hand and you have a reasonably quick * implementation of cosine . * @ param < E > * @ param c1 * @ param c2 * @ return The dot product of the two counter ( as vectors ) */ public static < E > double optimizedDotProduct ( Counter < E > c1 , Counter < E > c2 ) { } }
double dotProd = 0.0 ; int size1 = c1 . size ( ) ; int size2 = c2 . size ( ) ; if ( size1 < size2 ) { for ( E key : c1 . keySet ( ) ) { double count1 = c1 . getCount ( key ) ; if ( count1 != 0.0 ) { double count2 = c2 . getCount ( key ) ; if ( count2 != 0.0 ) dotProd += ( count1 * count2 ) ; } } } else { for ( E key : c2 . keySet ( ) ) { double count2 = c2 . getCount ( key ) ; if ( count2 != 0.0 ) { double count1 = c1 . getCount ( key ) ; if ( count1 != 0.0 ) dotProd += ( count1 * count2 ) ; } } } return dotProd ;
public class ProducerSequenceFactory { /** * encoded cache multiplex - > encoded cache - > ( disk cache ) - > ( webp transcode ) * @ param inputProducer producer providing the input to the transcode * @ return encoded cache multiplex to webp transcode sequence */ private Producer < EncodedImage > newEncodedCacheMultiplexToTranscodeSequence ( Producer < EncodedImage > inputProducer ) { } }
if ( WebpSupportStatus . sIsWebpSupportRequired && ( ! mWebpSupportEnabled || WebpSupportStatus . sWebpBitmapFactory == null ) ) { inputProducer = mProducerFactory . newWebpTranscodeProducer ( inputProducer ) ; } if ( mDiskCacheEnabled ) { inputProducer = newDiskCacheSequence ( inputProducer ) ; } EncodedMemoryCacheProducer encodedMemoryCacheProducer = mProducerFactory . newEncodedMemoryCacheProducer ( inputProducer ) ; return mProducerFactory . newEncodedCacheKeyMultiplexProducer ( encodedMemoryCacheProducer ) ;
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link ArithType } { @ code > } } */ @ XmlElementDecl ( namespace = "http://www.w3.org/1998/Math/MathML" , name = "root" ) public JAXBElement < ArithType > createRoot ( ArithType value ) { } }
return new JAXBElement < ArithType > ( _Root_QNAME , ArithType . class , null , value ) ;
public class DescribeVpcAttributeRequest { /** * This method is intended for internal use only . Returns the marshaled request configured with additional * parameters to enable operation dry - run . */ @ Override public Request < DescribeVpcAttributeRequest > getDryRunRequest ( ) { } }
Request < DescribeVpcAttributeRequest > request = new DescribeVpcAttributeRequestMarshaller ( ) . marshall ( this ) ; request . addParameter ( "DryRun" , Boolean . toString ( true ) ) ; return request ;
public class XmlUtils { /** * Return list of content Strings of all child elements with given tag name . * @ param elem * @ param childTagName * @ return List */ public static List getChildTextList ( Element elem , String childTagName ) { } }
NodeList nodeList = elem . getElementsByTagName ( childTagName ) ; int len = nodeList . getLength ( ) ; if ( len == 0 ) { return Collections . EMPTY_LIST ; } List list = new ArrayList ( len ) ; for ( int i = 0 ; i < len ; i ++ ) { list . add ( getElementText ( ( Element ) nodeList . item ( i ) ) ) ; } return list ;
public class JDBDT { /** * Dump the contents of a data set . * @ param data Data set . * @ param out Output stream . */ public static void dump ( DataSet data , PrintStream out ) { } }
try ( Log log = Log . create ( out ) ) { log . write ( CallInfo . create ( ) , data ) ; }
public class XCastedExpressionImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public Object eGet ( int featureID , boolean resolve , boolean coreType ) { } }
switch ( featureID ) { case XbasePackage . XCASTED_EXPRESSION__TYPE : return getType ( ) ; case XbasePackage . XCASTED_EXPRESSION__TARGET : return getTarget ( ) ; } return super . eGet ( featureID , resolve , coreType ) ;
public class SM2 { /** * 初始化 < br > * 私钥和公钥同时为空时生成一对新的私钥和公钥 < br > * 私钥和公钥可以单独传入一个 , 如此则只能使用此钥匙来做加密 ( 签名 ) 或者解密 ( 校验 ) * @ param privateKey 私钥 * @ param publicKey 公钥 * @ return this */ public SM2 init ( PrivateKey privateKey , PublicKey publicKey ) { } }
return this . init ( ALGORITHM_SM2 , privateKey , publicKey ) ;
public class appflowparam { /** * Use this API to update appflowparam . */ public static base_response update ( nitro_service client , appflowparam resource ) throws Exception { } }
appflowparam updateresource = new appflowparam ( ) ; updateresource . templaterefresh = resource . templaterefresh ; updateresource . appnamerefresh = resource . appnamerefresh ; updateresource . flowrecordinterval = resource . flowrecordinterval ; updateresource . udppmtu = resource . udppmtu ; updateresource . httpurl = resource . httpurl ; updateresource . aaausername = resource . aaausername ; updateresource . httpcookie = resource . httpcookie ; updateresource . httpreferer = resource . httpreferer ; updateresource . httpmethod = resource . httpmethod ; updateresource . httphost = resource . httphost ; updateresource . httpuseragent = resource . httpuseragent ; updateresource . clienttrafficonly = resource . clienttrafficonly ; updateresource . httpcontenttype = resource . httpcontenttype ; updateresource . httpauthorization = resource . httpauthorization ; updateresource . httpvia = resource . httpvia ; updateresource . httpxforwardedfor = resource . httpxforwardedfor ; updateresource . httplocation = resource . httplocation ; updateresource . httpsetcookie = resource . httpsetcookie ; updateresource . httpsetcookie2 = resource . httpsetcookie2 ; updateresource . connectionchaining = resource . connectionchaining ; return updateresource . update_resource ( client ) ;
public class Util { /** * Checks whether two internet addresses are on the same subnet . * @ param prefixLength the number of bits within an address that identify the network * @ param address1 the first address to be compared * @ param address2 the second address to be compared * @ return true if both addresses share the same network bits */ public static boolean sameNetwork ( int prefixLength , InetAddress address1 , InetAddress address2 ) { } }
if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Comparing address " + address1 . getHostAddress ( ) + " with " + address2 . getHostAddress ( ) + ", prefixLength=" + prefixLength ) ; } long prefixMask = 0xffffffffL & ( - 1 << ( 32 - prefixLength ) ) ; return ( addressToLong ( address1 ) & prefixMask ) == ( addressToLong ( address2 ) & prefixMask ) ;
public class StringUtils { /** * Creates a string consisting of " count " occurrences of char " c " . * @ param c the character to repeat * @ param count the number of times to repeat the character * @ param sb the character sequence to append the characters to */ public static void repeat ( char c , int count , StringBuilder sb ) { } }
for ( int i = 0 ; i < count ; i ++ ) { sb . append ( c ) ; }
public class BatchCoordinator { /** * Operations to do after all subthreads finished their work on index * @ param backend */ private void afterBatch ( BatchBackend backend ) { } }
IndexedTypeSet targetedTypes = searchFactoryImplementor . getIndexedTypesPolymorphic ( rootIndexedTypes ) ; if ( this . optimizeAtEnd ) { backend . optimize ( targetedTypes ) ; } backend . flush ( targetedTypes ) ;
public class DefaultCatalogCache { /** * This is a contract between the TenantCatalogCacheLoader and the DefaultCatalogCache */ private CacheLoaderArgument initializeCacheLoaderArgument ( final boolean filterTemplateCatalog ) { } }
final LoaderCallback loaderCallback = new LoaderCallback ( ) { @ Override public Catalog loadCatalog ( final List < String > catalogXMLs , final Long tenantRecordId ) throws CatalogApiException { return loader . load ( catalogXMLs , filterTemplateCatalog , tenantRecordId ) ; } } ; final Object [ ] args = new Object [ 1 ] ; args [ 0 ] = loaderCallback ; final ObjectType irrelevant = null ; final InternalTenantContext notUsed = null ; return new CacheLoaderArgument ( irrelevant , args , notUsed ) ;
public class Matrix4x3d { /** * Apply rotation of < code > angles . y < / code > radians about the Y axis , followed by a rotation of < code > angles . x < / code > radians about the X axis and * followed by a rotation of < code > angles . z < / code > radians about the Z axis . * When used with a right - handed coordinate system , the produced rotation will rotate a vector * counter - clockwise around the rotation axis , when viewing along the negative axis direction towards the origin . * When used with a left - handed coordinate system , the rotation is clockwise . * If < code > M < / code > is < code > this < / code > matrix and < code > R < / code > the rotation matrix , * then the new matrix will be < code > M * R < / code > . So when transforming a * vector < code > v < / code > with the new matrix by using < code > M * R * v < / code > , the * rotation will be applied first ! * This method is equivalent to calling : < code > rotateY ( angles . y ) . rotateX ( angles . x ) . rotateZ ( angles . z ) < / code > * @ param angles * the Euler angles * @ return this */ public Matrix4x3d rotateYXZ ( Vector3d angles ) { } }
return rotateYXZ ( angles . y , angles . x , angles . z ) ;
public class Actor { /** * The message delivered after the { @ code Actor } has been restarted by its supervisor due to an exception . * Override to implement . * @ param reason the { @ code Throwable } cause of the supervision restart */ protected void afterRestart ( final Throwable reason ) { } }
// override for specific recovery logger ( ) . log ( "Default after restart recovery after: " + reason . getMessage ( ) , reason ) ; lifeCycle . beforeStart ( this ) ;
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link String } { @ code > } } */ @ XmlElementDecl ( namespace = "http://www.ibm.com/websphere/wim" , name = "businessCategory" ) public JAXBElement < String > createBusinessCategory ( String value ) { } }
return new JAXBElement < String > ( _BusinessCategory_QNAME , String . class , null , value ) ;
public class HyperionClient { /** * Set the keep alive configuration to use for this client . * @ param keepAliveConfiguration The keep alive configuration */ public void setKeepAliveConfiguration ( KeepAliveConfiguration keepAliveConfiguration ) { } }
if ( keepAliveConfiguration != null ) client . setConnectionPool ( new ConnectionPool ( keepAliveConfiguration . getMaxIdleConnections ( ) , keepAliveConfiguration . getKeepAliveDurationMs ( ) ) ) ;
public class LongStreamEx { /** * Returns a stream consisting of the elements of this stream sorted * according to the given comparator . Stream elements are boxed before * passing to the comparator . * For ordered streams , the sort is stable . For unordered streams , no * stability guarantees are made . * This is a < a href = " package - summary . html # StreamOps " > stateful intermediate * operation < / a > . * @ param comparator a * < a href = " package - summary . html # NonInterference " > non - interfering * < / a > , < a href = " package - summary . html # Statelessness " > stateless < / a > * { @ code Comparator } to be used to compare stream elements * @ return the new stream */ public LongStreamEx sorted ( Comparator < Long > comparator ) { } }
return new LongStreamEx ( stream ( ) . boxed ( ) . sorted ( comparator ) . mapToLong ( Long :: longValue ) , context ) ;
public class vpnglobal_authenticationlocalpolicy_binding { /** * Use this API to fetch a vpnglobal _ authenticationlocalpolicy _ binding resources . */ public static vpnglobal_authenticationlocalpolicy_binding [ ] get ( nitro_service service ) throws Exception { } }
vpnglobal_authenticationlocalpolicy_binding obj = new vpnglobal_authenticationlocalpolicy_binding ( ) ; vpnglobal_authenticationlocalpolicy_binding response [ ] = ( vpnglobal_authenticationlocalpolicy_binding [ ] ) obj . get_resources ( service ) ; return response ;
public class ObjectStreamUtil { /** * Converts a byte array to a serializable object . */ public static Object bytesToObject ( byte [ ] bytes ) throws IOException , ClassNotFoundException { } }
ByteArrayInputStream bais = new ByteArrayInputStream ( bytes ) ; ObjectInputStream is = new ObjectInputStream ( bais ) ; return is . readObject ( ) ;