signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class Futures { /** * Create a promise that emits a { @ code Boolean } value on completion of the { @ code future }
* @ param future the future .
* @ return Promise emitting a { @ code Boolean } value . { @ literal true } if the { @ code future } completed successfully , otherwise
* the cause wil be transported . */
static Promise < Boolean > toBooleanPromise ( Future < ? > future ) { } } | DefaultPromise < Boolean > result = new DefaultPromise < > ( GlobalEventExecutor . INSTANCE ) ; if ( future . isDone ( ) || future . isCancelled ( ) ) { if ( future . isSuccess ( ) ) { result . setSuccess ( true ) ; } else { result . setFailure ( future . cause ( ) ) ; } return result ; } future . addListener ( ( GenericFutureListener < Future < Object > > ) f -> { if ( f . isSuccess ( ) ) { result . setSuccess ( true ) ; } else { result . setFailure ( f . cause ( ) ) ; } } ) ; return result ; |
public class BaselineProfile { /** * Check if the tags that define the image are correct and consistent .
* @ param ifd the ifd
* @ param n the ifd number
* @ param metadata the ifd metadata */
public void checkImage ( IFD ifd , int n , IfdTags metadata ) { } } | CheckCommonFields ( ifd , n , metadata ) ; if ( ! metadata . containsTagId ( TiffTags . getTagId ( "PhotometricInterpretation" ) ) ) { validation . addErrorLoc ( "Missing Photometric Interpretation" , "IFD" + n ) ; } else if ( metadata . get ( TiffTags . getTagId ( "PhotometricInterpretation" ) ) . getValue ( ) . size ( ) != 1 ) { validation . addErrorLoc ( "Invalid Photometric Interpretation" , "IFD" + n ) ; } else { photometric = ( int ) metadata . get ( TiffTags . getTagId ( "PhotometricInterpretation" ) ) . getFirstNumericValue ( ) ; switch ( photometric ) { case 0 : case 1 : if ( ! metadata . containsTagId ( TiffTags . getTagId ( "BitsPerSample" ) ) || metadata . get ( TiffTags . getTagId ( "BitsPerSample" ) ) . getFirstNumericValue ( ) == 1 ) { type = ImageType . BILEVEL ; CheckBilevelImage ( metadata , n ) ; } else { type = ImageType . GRAYSCALE ; CheckGrayscaleImage ( metadata , n ) ; } break ; case 2 : type = ImageType . RGB ; CheckRGBImage ( metadata , n ) ; break ; case 3 : type = ImageType . PALETTE ; CheckPalleteImage ( metadata , n ) ; break ; case 4 : type = ImageType . TRANSPARENCY_MASK ; CheckTransparencyMask ( metadata , n ) ; break ; case 5 : type = ImageType . CMYK ; CheckCMYK ( metadata , n ) ; break ; case 6 : type = ImageType . YCbCr ; CheckYCbCr ( metadata , n ) ; break ; case 8 : case 9 : case 10 : type = ImageType . CIELab ; CheckCIELab ( metadata , n ) ; break ; default : validation . addWarning ( "Unknown Photometric Interpretation" , "" + photometric , "IFD" + n ) ; break ; } } |
public class ChannelHelper { /** * Channel copy method 1 . This method copies data from the src channel and
* writes it to the dest channel until EOF on src . This implementation makes
* use of compact ( ) on the temp buffer to pack down the data if the buffer
* wasn ' t fully drained . This may result in data copying , but minimizes system
* calls . It also requires a cleanup loop to make sure all the data gets sent .
* < br >
* Source : Java NIO , page 60
* @ param aSrc
* Source channel . May not be < code > null < / code > . Is not closed after
* the operation .
* @ param aDest
* Destination channel . May not be < code > null < / code > . Is not closed
* after the operation .
* @ return The number of bytes written . */
@ Nonnegative private static long _channelCopy1 ( @ Nonnull @ WillNotClose final ReadableByteChannel aSrc , @ Nonnull @ WillNotClose final WritableByteChannel aDest ) throws IOException { } } | long nBytesWritten = 0 ; final ByteBuffer aBuffer = ByteBuffer . allocateDirect ( 16 * 1024 ) ; while ( aSrc . read ( aBuffer ) != - 1 ) { // Prepare the buffer to be drained
aBuffer . flip ( ) ; // Write to the channel ; may block
nBytesWritten += aDest . write ( aBuffer ) ; // If partial transfer , shift remainder down
// If buffer is empty , same as doing clear ( )
aBuffer . compact ( ) ; } // EOF will leave buffer in fill state
aBuffer . flip ( ) ; // Make sure that the buffer is fully drained
while ( aBuffer . hasRemaining ( ) ) nBytesWritten += aDest . write ( aBuffer ) ; return nBytesWritten ; |
public class StateBuilder { /** * public State build ( ) { return new State ( state , fanIn . get ( ) , fanOut . get ( ) , getCandidates ( ) ,
* failedEvents . build ( ) ) ; } */
public State build ( ) { } } | return new State ( state , fanIn . get ( ) , fanOut . get ( ) , getCandidates ( ) , failedEvents . build ( ) , state . hasNearDuplicate ( ) , getNearestState ( ) , state . getDistToNearestState ( ) , timeAdded ) ; |
public class QueryExprInvoker { /** * < p > invoke . < / p >
* @ param queryExprMeta a { @ link ameba . db . dsl . QueryExprMeta } object .
* @ return a T object . */
@ SuppressWarnings ( "unchecked" ) protected T invoke ( QueryExprMeta queryExprMeta ) { } } | List < Val < ? > > args = queryExprMeta . arguments ( ) ; if ( args == null ) { args = EMP_ARGS ; } int argCount = args . size ( ) ; Val < T > [ ] argsArray = new Val [ argCount ] ; String field = queryExprMeta . field ( ) ; String op = queryExprMeta . operator ( ) ; for ( int i = 0 ; i < argCount ; i ++ ) { Val < ? > argObj = args . get ( i ) ; if ( argObj . object ( ) instanceof QueryExprMeta ) { argsArray [ i ] = Val . of ( invoke ( argObj . meta ( ) ) ) ; } else { argsArray [ i ] = arg ( field , op , ( Val < T > ) argObj , i , argCount , queryExprMeta . parent ( ) ) ; } } return expr ( field , op , argsArray , queryExprMeta . parent ( ) ) . expr ( ) ; |
public class InstantSearch { /** * Enables the display of a spinning { @ link android . widget . ProgressBar ProgressBar } in the SearchView when waiting for results . */
@ SuppressWarnings ( { } } | "WeakerAccess" , "unused" } ) // For library users
public void enableProgressBar ( ) { showProgressBar = true ; if ( searchBoxViewModel != null ) { progressController = new SearchProgressController ( new SearchProgressController . ProgressListener ( ) { @ Override public void onStart ( ) { updateProgressBar ( searchBoxViewModel , true ) ; } @ Override public void onStop ( ) { updateProgressBar ( searchBoxViewModel , false ) ; } } , progressBarDelay ) ; } |
public class ValidationDriver { /** * Loads a schema . Subsequent calls to < code > validate < / code > will validate with
* respect the loaded schema . This can be called more than once to allow
* multiple documents to be validated against different schemas .
* @ param in the InputSource for the schema
* @ return < code > true < / code > if the schema was loaded successfully ; < code > false < / code > otherwise
* @ throws IOException if an I / O error occurred
* @ throws SAXException if an XMLReader or ErrorHandler threw a SAXException */
public boolean loadSchema ( InputSource in ) throws SAXException , IOException { } } | try { schema = sr . createSchema ( new SAXSource ( in ) , schemaProperties ) ; validator = null ; return true ; } catch ( IncorrectSchemaException e ) { return false ; } |
public class BufferFileChannelReader { /** * Reads data from the object ' s file channel into the given buffer .
* @ param buffer the buffer to read into
* @ return whether the end of the file has been reached ( < tt > true < / tt > ) or not ( < tt > false < / tt > ) */
public boolean readBufferFromFileChannel ( Buffer buffer ) throws IOException { } } | checkArgument ( fileChannel . size ( ) - fileChannel . position ( ) > 0 ) ; // Read header
header . clear ( ) ; fileChannel . read ( header ) ; header . flip ( ) ; final boolean isBuffer = header . getInt ( ) == 1 ; final int size = header . getInt ( ) ; if ( size > buffer . getMaxCapacity ( ) ) { throw new IllegalStateException ( "Buffer is too small for data: " + buffer . getMaxCapacity ( ) + " bytes available, but " + size + " needed. This is most likely due to an serialized event, which is larger than the buffer size." ) ; } checkArgument ( buffer . getSize ( ) == 0 , "Buffer not empty" ) ; fileChannel . read ( buffer . getNioBuffer ( 0 , size ) ) ; buffer . setSize ( size ) ; if ( ! isBuffer ) { buffer . tagAsEvent ( ) ; } return fileChannel . size ( ) - fileChannel . position ( ) == 0 ; |
public class DFSUtil { /** * Helper for extracting bytes either from " str "
* or from the array of chars " charArray " ,
* depending if fast conversion is possible ,
* specified by " canFastConvert " */
private static byte [ ] extractBytes ( String str , int startIndex , int endIndex , char [ ] charArray , boolean canFastConvert ) throws UnsupportedEncodingException { } } | if ( canFastConvert ) { // fast conversion , just copy the raw bytes
final int len = endIndex - startIndex ; byte [ ] strBytes = new byte [ len ] ; for ( int i = 0 ; i < len ; i ++ ) { strBytes [ i ] = ( byte ) charArray [ startIndex + i ] ; } return strBytes ; } // otherwise , do expensive conversion
return str . substring ( startIndex , endIndex ) . getBytes ( utf8charsetName ) ; |
public class GaliosFieldTableOps { /** * Computes the following the value of output such that : < br >
* < p > divide ( multiply ( x , y ) , y ) = = x for any x and any nonzero y . < / p > */
public int divide ( int x , int y ) { } } | if ( y == 0 ) throw new ArithmeticException ( "Divide by zero" ) ; if ( x == 0 ) return 0 ; return exp [ log [ x ] + max_value - log [ y ] ] ; |
public class AbstractPipeline { /** * Performs a parallel evaluation of the operation using the specified
* { @ code PipelineHelper } which describes the upstream intermediate
* operations . Only called on stateful operations . If { @ link
* # opIsStateful ( ) } returns true then implementations must override the
* default implementation .
* @ implSpec The default implementation always throw
* { @ code UnsupportedOperationException } .
* @ param helper the pipeline helper describing the pipeline stages
* @ param spliterator the source { @ code Spliterator }
* @ param generator the array generator
* @ return a { @ code Node } describing the result of the evaluation */
public < P_IN > Node < E_OUT > opEvaluateParallel ( PipelineHelper < E_OUT > helper , Spliterator < P_IN > spliterator , IntFunction < E_OUT [ ] > generator ) { } } | throw new UnsupportedOperationException ( "Parallel evaluation is not supported" ) ; |
public class ModifySourceCollectionInStream { /** * TODO ( b / 125767228 ) : Consider a rigorous implementation to check tree structure equivalence . */
@ SuppressWarnings ( "TreeToString" ) // Indented to ignore whitespace , comments , and source position .
private static boolean isSameExpression ( ExpressionTree leftTree , ExpressionTree rightTree ) { } } | // The left tree and right tree must have the same symbol resolution .
// This ensures the symbol kind on field , parameter or local var .
if ( ASTHelpers . getSymbol ( leftTree ) != ASTHelpers . getSymbol ( rightTree ) ) { return false ; } String leftTreeTextRepr = stripPrefixIfPresent ( leftTree . toString ( ) , "this." ) ; String rightTreeTextRepr = stripPrefixIfPresent ( rightTree . toString ( ) , "this." ) ; return leftTreeTextRepr . contentEquals ( rightTreeTextRepr ) ; |
public class HeaderInterceptor { /** * { @ inheritDoc } */
@ Override public < ReqT , RespT > ClientCall < ReqT , RespT > interceptCall ( MethodDescriptor < ReqT , RespT > method , CallOptions callOptions , Channel next ) { } } | return new CheckedForwardingClientCall < ReqT , RespT > ( next . newCall ( method , callOptions ) ) { @ Override protected void checkedStart ( Listener < RespT > responseListener , Metadata headers ) { updateHeaders ( headers ) ; delegate ( ) . start ( responseListener , headers ) ; } } ; |
public class DEBBuilder { /** * Add debian / control Conflicts field .
* @ param name
* @ param version
* @ param dependency
* @ return */
@ Override public DEBBuilder addConflict ( String name , String version , Condition ... dependency ) { } } | control . addConflict ( release , version , dependency ) ; return this ; |
public class MapMaker { /** * Specifies that each entry should be automatically removed from the map once a fixed duration
* has elapsed after the entry ' s last read or write access .
* < p > When { @ code duration } is zero , elements can be successfully added to the map , but are
* evicted immediately . This has a very similar effect to invoking { @ link # maximumSize
* maximumSize } { @ code ( 0 ) } . It can be useful in testing , or to disable caching temporarily without
* a code change .
* < p > Expired entries may be counted by { @ link Map # size } , but will never be visible to read or
* write operations . Expired entries are currently cleaned up during write operations , or during
* occasional read operations in the absense of writes ; though this behavior may change in the
* future .
* @ param duration the length of time after an entry is last accessed that it should be
* automatically removed
* @ param unit the unit that { @ code duration } is expressed in
* @ throws IllegalArgumentException if { @ code duration } is negative
* @ throws IllegalStateException if the time to idle or time to live was already set
* @ deprecated Caching functionality in { @ code MapMaker } has been moved to
* { @ link com . google . common . cache . CacheBuilder } , with { @ link # expireAfterAccess } being
* replaced by { @ link com . google . common . cache . CacheBuilder # expireAfterAccess } . Note that
* { @ code CacheBuilder } is simply an enhanced API for an implementation which was branched
* from { @ code MapMaker } . */
@ Deprecated @ GwtIncompatible ( "To be supported" ) @ Override MapMaker expireAfterAccess ( long duration , TimeUnit unit ) { } } | checkExpiration ( duration , unit ) ; this . expireAfterAccessNanos = unit . toNanos ( duration ) ; if ( duration == 0 && this . nullRemovalCause == null ) { // SIZE trumps EXPIRED
this . nullRemovalCause = RemovalCause . EXPIRED ; } useCustomMap = true ; return this ; |
public class CmsWorkplace { /** * Stores the settings in the given session . < p >
* @ param session the session to store the settings in
* @ param settings the settings */
static void storeSettings ( HttpSession session , CmsWorkplaceSettings settings ) { } } | // save the workplace settings in the session
session . setAttribute ( CmsWorkplaceManager . SESSION_WORKPLACE_SETTINGS , settings ) ; |
public class AWSMigrationHubClient { /** * Disassociate an Application Discovery Service ( ADS ) discovered resource from a migration task .
* @ param disassociateDiscoveredResourceRequest
* @ return Result of the DisassociateDiscoveredResource operation returned by the service .
* @ throws AccessDeniedException
* You do not have sufficient access to perform this action .
* @ throws InternalServerErrorException
* Exception raised when there is an internal , configuration , or dependency error encountered .
* @ throws ServiceUnavailableException
* Exception raised when there is an internal , configuration , or dependency error encountered .
* @ throws DryRunOperationException
* Exception raised to indicate a successfully authorized action when the < code > DryRun < / code > flag is set to
* " true " .
* @ throws UnauthorizedOperationException
* Exception raised to indicate a request was not authorized when the < code > DryRun < / code > flag is set to
* " true " .
* @ throws InvalidInputException
* Exception raised when the provided input violates a policy constraint or is entered in the wrong format
* or data type .
* @ throws ResourceNotFoundException
* Exception raised when the request references a resource ( ADS configuration , update stream , migration
* task , etc . ) that does not exist in ADS ( Application Discovery Service ) or in Migration Hub ' s repository .
* @ sample AWSMigrationHub . DisassociateDiscoveredResource
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / AWSMigrationHub - 2017-05-31 / DisassociateDiscoveredResource "
* target = " _ top " > AWS API Documentation < / a > */
@ Override public DisassociateDiscoveredResourceResult disassociateDiscoveredResource ( DisassociateDiscoveredResourceRequest request ) { } } | request = beforeClientExecution ( request ) ; return executeDisassociateDiscoveredResource ( request ) ; |
public class YesterdayReader { /** * Make the request to the Twilio API to perform the read .
* @ param client TwilioRestClient with which to make the request
* @ return Yesterday ResourceSet */
@ Override public ResourceSet < Yesterday > read ( final TwilioRestClient client ) { } } | return new ResourceSet < > ( this , client , firstPage ( client ) ) ; |
public class HBasePanel { /** * Print this screen ' s content area .
* @ param out The out stream .
* @ exception DBException File exception . */
public void printScreen ( PrintWriter out , ResourceBundle reg ) throws DBException { } } | String strParamHelp = this . getProperty ( DBParams . HELP ) ; // Display record
if ( strParamHelp != null ) return ; // Don ' t do this for help screens
this . printHtmlStartForm ( out ) ; int iHtmlOptions = this . getScreenField ( ) . getPrintOptions ( ) ; if ( ( iHtmlOptions & HtmlConstants . PRINT_TOOLBAR_BEFORE ) != 0 ) this . printZmlToolbarData ( out , iHtmlOptions ) ; if ( ( iHtmlOptions & HtmlConstants . DONT_PRINT_SCREEN ) == 0 ) this . getScreenField ( ) . printData ( out , iHtmlOptions ) ; // DO print screen
if ( ( iHtmlOptions & HtmlConstants . PRINT_TOOLBAR_AFTER ) != 0 ) this . printZmlToolbarData ( out , iHtmlOptions ) ; this . printHtmlEndForm ( out ) ; |
public class Main { /** * This function takes a string of floating - point numbers separated by commas and converts it to an array of doubles .
* Examples :
* > > > stringToDoubleArray ( ' 1.2 , 1.3 , 2.3 , 2.4 , 6.5 ' )
* { 1.2 , 1.3 , 2.3 , 2.4 , 6.5}
* > > > stringToDoubleArray ( ' 2.3 , 2.4 , 5.6 , 5.4 , 8.9 ' )
* { 2.3 , 2.4 , 5.6 , 5.4 , 8.9}
* > > > stringToDoubleArray ( ' 0.3 , 0.5 , 7.8 , 9.4 ' )
* { 0.3 , 0.5 , 7.8 , 9.4} */
public static double [ ] stringToDoubleArray ( String inputStr ) { } public static void main ( String [ ] args ) { // Test
double [ ] result = stringToDoubleArray ( "1.2, 1.3, 2.3, 2.4, 6.5" ) ; for ( double num : result ) { System . out . print ( num + " " ) ; } } } Note : Java does not natively support Tuples , so the closest alternative is to return an array of doubles . | String [ ] strArr = inputStr . split ( ", " ) ; double [ ] doubleArr = new double [ strArr . length ] ; for ( int i = 0 ; i < strArr . length ; i ++ ) { doubleArr [ i ] = Double . parseDouble ( strArr [ i ] ) ; } return doubleArr ; |
public class GSPSImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public void eUnset ( int featureID ) { } } | switch ( featureID ) { case AfplibPackage . GSPS__LCID : setLCID ( LCID_EDEFAULT ) ; return ; } super . eUnset ( featureID ) ; |
public class AzureClient { /** * Handles an initial response from a PUT or PATCH operation response by polling the status of the operation
* asynchronously , once the operation finishes emits the final response .
* @ param observable the initial observable from the PUT or PATCH operation .
* @ param resourceType the java . lang . reflect . Type of the resource .
* @ param < T > the return type of the caller .
* @ return the observable of which a subscription will lead to a final response . */
public < T > Observable < ServiceResponse < T > > getPutOrPatchResultAsync ( Observable < Response < ResponseBody > > observable , final Type resourceType ) { } } | return this . < T > beginPutOrPatchAsync ( observable , resourceType ) . toObservable ( ) . flatMap ( new Func1 < PollingState < T > , Observable < PollingState < T > > > ( ) { @ Override public Observable < PollingState < T > > call ( PollingState < T > pollingState ) { return pollPutOrPatchAsync ( pollingState , resourceType ) ; } } ) . last ( ) . map ( new Func1 < PollingState < T > , ServiceResponse < T > > ( ) { @ Override public ServiceResponse < T > call ( PollingState < T > pollingState ) { return new ServiceResponse < > ( pollingState . resource ( ) , pollingState . response ( ) ) ; } } ) ; |
public class QuestConfigPanel { /** * GEN - LAST : event _ chkRewriteActionPerformed */
private void chkAnnotationsActionPerformed ( java . awt . event . ActionEvent evt ) { } } | // GEN - FIRST : event _ chkAnnotationsActionPerformed
preference . put ( OntopMappingSettings . QUERY_ONTOLOGY_ANNOTATIONS , String . valueOf ( chkAnnotations . isSelected ( ) ) ) ; |
public class ApiResource { /** * URL - encode a string ID in url path formatting . */
public static String urlEncodeId ( String id ) throws InvalidRequestException { } } | try { return urlEncode ( id ) ; } catch ( UnsupportedEncodingException e ) { throw new InvalidRequestException ( String . format ( "Unable to encode `%s` in the url to %s. " + "Please contact support@stripe.com for assistance." , id , CHARSET ) , null , null , null , 0 , e ) ; } |
public class JsonHandler { /** * { @ inheritDoc } */
@ Override protected String format ( String request ) { } } | String result = request ; if ( request != null && ! "" . equals ( request ) ) { try { JsonNode rootNode = mapper . readValue ( request , JsonNode . class ) ; result = mapper . writeValueAsString ( rootNode ) ; } catch ( Exception e ) { log . error ( null , e ) ; } } return result ; |
public class Matrix4x3f { /** * / * ( non - Javadoc )
* @ see org . joml . Matrix4x3fc # normal ( org . joml . Matrix3f ) */
public Matrix3f normal ( Matrix3f dest ) { } } | if ( ( properties & PROPERTY_ORTHONORMAL ) != 0 ) return normalOrthonormal ( dest ) ; return normalGeneric ( dest ) ; |
public class JodaBeanReferencingBinReader { /** * parses the bean using the class information */
private Object parseBean ( int propertyCount , ClassInfo classInfo ) { } } | String propName = "" ; if ( classInfo . metaProperties . length != propertyCount ) { throw new IllegalArgumentException ( "Invalid binary data: Expected " + classInfo . metaProperties . length + " properties but was: " + propertyCount ) ; } try { SerDeserializer deser = settings . getDeserializers ( ) . findDeserializer ( classInfo . type ) ; MetaBean metaBean = deser . findMetaBean ( classInfo . type ) ; BeanBuilder < ? > builder = deser . createBuilder ( classInfo . type , metaBean ) ; for ( MetaProperty < ? > metaProp : classInfo . metaProperties ) { if ( metaProp == null ) { MsgPackInput . skipObject ( input ) ; } else { propName = metaProp . name ( ) ; Object value = parseObject ( SerOptional . extractType ( metaProp , classInfo . type ) , metaProp , classInfo . type , null , false ) ; deser . setValue ( builder , metaProp , SerOptional . wrapValue ( metaProp , classInfo . type , value ) ) ; } propName = "" ; } return deser . build ( classInfo . type , builder ) ; } catch ( Exception ex ) { throw new RuntimeException ( "Error parsing bean: " + classInfo . type . getName ( ) + "::" + propName + ", " + ex . getMessage ( ) , ex ) ; } |
public class InitialBundleSelectorImpl { /** * / * ( non - Javadoc )
* @ see nz . co . senanque . workflow . BundleSelector # selectInitialBundle ( java . lang . Object ) */
@ Override public String selectInitialBundle ( Object o ) { } } | if ( o instanceof String ) { String processName = ( String ) o ; for ( ProcessDefinition processDefinition : m_queueProcessmanager . getVisibleProcesses ( m_permissionManager ) ) { if ( processDefinition . getName ( ) . equals ( processName ) ) { m_bundleManager . setBundle ( processDefinition . getVersion ( ) ) ; return processDefinition . getVersion ( ) ; } } } m_bundleManager . setBundle ( "order-workflow" ) ; log . debug ( "Selected bundle order-workflow" ) ; return "order-workflow" ; |
public class DecimalFormat { /** * Set roundingDouble , roundingDoubleReciprocal and actualRoundingIncrement
* based on rounding mode and width of fractional digits . Whenever setting affecting
* rounding mode , rounding increment and maximum width of fractional digits , then
* this method must be called .
* roundingIncrementICU is the field storing the custom rounding increment value ,
* while actual rounding increment could be larger . */
private void resetActualRounding ( ) { } } | if ( roundingIncrementICU != null ) { BigDecimal byWidth = getMaximumFractionDigits ( ) > 0 ? BigDecimal . ONE . movePointLeft ( getMaximumFractionDigits ( ) ) : BigDecimal . ONE ; if ( roundingIncrementICU . compareTo ( byWidth ) >= 0 ) { actualRoundingIncrementICU = roundingIncrementICU ; } else { actualRoundingIncrementICU = byWidth . equals ( BigDecimal . ONE ) ? null : byWidth ; } } else { if ( roundingMode == BigDecimal . ROUND_HALF_EVEN || isScientificNotation ( ) ) { // This rounding fix is irrelevant if mode is ROUND _ HALF _ EVEN as DigitList
// does ROUND _ HALF _ EVEN for us . This rounding fix won ' t work at all for
// scientific notation .
actualRoundingIncrementICU = null ; } else { if ( getMaximumFractionDigits ( ) > 0 ) { actualRoundingIncrementICU = BigDecimal . ONE . movePointLeft ( getMaximumFractionDigits ( ) ) ; } else { actualRoundingIncrementICU = BigDecimal . ONE ; } } } if ( actualRoundingIncrementICU == null ) { setRoundingDouble ( 0.0d ) ; actualRoundingIncrement = null ; } else { setRoundingDouble ( actualRoundingIncrementICU . doubleValue ( ) ) ; actualRoundingIncrement = actualRoundingIncrementICU . toBigDecimal ( ) ; } |
public class MtasUpdateRequestProcessorResultWriter { /** * Adds the item .
* @ param term the term
* @ param offsetStart the offset start
* @ param offsetEnd the offset end
* @ param posIncr the pos incr
* @ param payload the payload
* @ param flags the flags */
public void addItem ( String term , Integer offsetStart , Integer offsetEnd , Integer posIncr , BytesRef payload , Integer flags ) { } } | if ( ! closed ) { tokenNumber ++ ; MtasUpdateRequestProcessorResultItem item = new MtasUpdateRequestProcessorResultItem ( term , offsetStart , offsetEnd , posIncr , payload , flags ) ; try { objectOutputStream . writeObject ( item ) ; objectOutputStream . reset ( ) ; objectOutputStream . flush ( ) ; } catch ( IOException e ) { forceCloseAndDelete ( ) ; log . debug ( e ) ; } } |
public class SystemInputDefBuilder { /** * Adds system functions . */
public SystemInputDefBuilder functions ( FunctionInputDef ... functions ) { } } | for ( FunctionInputDef function : functions ) { systemInputDef_ . addFunctionInputDef ( function ) ; } return this ; |
public class SpoonUtils { /** * Get an { @ link com . android . ddmlib . AndroidDebugBridge } instance given an SDK path . */
public static AndroidDebugBridge initAdb ( File sdk , Duration timeOut ) { } } | AndroidDebugBridge . initIfNeeded ( false ) ; File adbPath = FileUtils . getFile ( sdk , "platform-tools" , "adb" ) ; AndroidDebugBridge adb = AndroidDebugBridge . createBridge ( adbPath . getAbsolutePath ( ) , false ) ; waitForAdb ( adb , timeOut ) ; return adb ; |
public class Logging { /** * Removes logging target ( s ) from target list of the specified device ( s )
* @ param dvsa A string array where str [ i ] = dev - name and str [ i + 1 ] = target _ type : : target _ name */
public void remove_logging_target ( String [ ] dvsa ) throws DevFailed { } } | // - Fight against " zombie appender " synfrom
kill_zombie_appenders ( ) ; // - N x [ device - name , ttype : : tname ] expected
if ( ( dvsa . length % 2 ) != 0 ) { String desc = "Incorrect number of arguments" ; Except . throw_exception ( "API_MethodArgument" , desc , "Logging::remove_logging_target" ) ; } // - The device name list which name match pattern
Vector dl ; // - For each tuple { dev - name , ttype : : tname } in dvsa
for ( int t = 0 ; t < dvsa . length ; ) { // - Get device name pattern
String pattern = dvsa [ t ++ ] . toLowerCase ( ) ; // - Get devices which name match the pattern
dl = Util . instance ( ) . get_device_list ( pattern ) ; // - Throw exception if list is empty
if ( dl . size ( ) == 0 ) { String desc = "No device matching pattern <" + pattern + ">" ; Except . throw_exception ( "API_DeviceNotFound" , desc , "Logging::remove_logging_target" ) ; } // - Split type : : name into target type and name
String type = get_target_type ( dvsa [ t ] ) . toLowerCase ( ) ; String name = get_target_name ( dvsa [ t ++ ] ) . toLowerCase ( ) ; int type_id = LOGGING_UNKNOWN_TARGET_ID ; if ( LOGGING_FILE_TARGET . equals ( type ) ) { type_id = LOGGING_FILE_TARGET_ID ; } else if ( LOGGING_DEVICE_TARGET . equals ( type ) ) { type_id = LOGGING_DEVICE_TARGET_ID ; } else if ( LOGGING_CONSOLE_TARGET . equals ( type ) ) { type_id = LOGGING_CONSOLE_TARGET_ID ; name = LOGGING_CONSOLE_TARGET ; } else { String desc = "Invalid logging target type specified (" + type + ")" ; Except . throw_exception ( "API_MethodArgument" , desc , "Logging::remove_logging_target" ) ; } // - Remove all targets ?
boolean remove_all_targets = name . equals ( "*" ) ; // - For each device matching pattern . . .
for ( Object aDl : dl ) { Logger logger = ( ( DeviceImpl ) aDl ) . get_logger ( ) ; // CASE I : remove ONE target of type < type >
if ( remove_all_targets == false ) { // build full appender name
String full_name = type + LOGGING_SEPARATOR ; // a special case : target is the a file
if ( type_id == LOGGING_FILE_TARGET_ID ) { if ( name . equals ( _DefaultTargetName ) ) { // - use default path and file name
full_name = logging_path + "/" ; full_name += device_to_file_name ( logger . getName ( ) ) + ".log" ; } else if ( name . indexOf ( '/' ) != - 1 ) { // - user specified path and file name
full_name = name ; } else { // - user specified file name
full_name = logging_path + "/" + name ; } } else { full_name += name ; } Util . out4 . println ( "Removing target " + full_name + " from " + logger . getName ( ) ) ; // remove appender from device ' s logger
logger . removeAppender ( full_name ) ; } // CASE II : remove ALL targets of type < tg _ type _ str >
else { Util . out4 . println ( "Removing ALL <" + type + "> targets from " + logger . getName ( ) ) ; // get logger ' s appender list
Enumeration all_appenders = logger . getAllAppenders ( ) ; // find appenders of type < type > in < al >
String prefix = type + LOGGING_SEPARATOR ; // for each appender in < al >
while ( all_appenders . hasMoreElements ( ) ) { Appender appender = ( Appender ) all_appenders . nextElement ( ) ; if ( appender . getName ( ) . indexOf ( prefix ) != - 1 ) { logger . removeAppender ( appender . getName ( ) ) ; } } // all _ appenders . hasMoreElements
} // else ( if remove _ all _ targets )
} // for each device in < dl >
} |
public class Slf4jLogger { /** * This method is similar to { @ link # trace ( String , Object , Object ) }
* method except that the marker data is also taken into
* consideration .
* @ param marker the marker data specific to this log statement
* @ param format the format string
* @ param arg1 the first argument
* @ param arg2 the second argument */
public void trace ( Marker marker , String format , Object arg1 , Object arg2 ) { } } | if ( m_delegate . isTraceEnabled ( ) ) { FormattingTuple tuple = MessageFormatter . format ( format , arg1 , arg2 ) ; setMDCMarker ( marker ) ; m_delegate . trace ( tuple . getMessage ( ) , tuple . getThrowable ( ) ) ; resetMDCMarker ( ) ; } |
public class QueryByIdentity { /** * Answer the search class .
* This is the class of the example object or
* the class represented by Identity .
* @ return Class */
public Class getSearchClass ( ) { } } | Object obj = getExampleObject ( ) ; if ( obj instanceof Identity ) { return ( ( Identity ) obj ) . getObjectsTopLevelClass ( ) ; } else { return obj . getClass ( ) ; } |
public class MockEC2QueryHandler { /** * Handles " describeVpcs " request and returns response with a vpc .
* @ return a DescribeVpcsResponseType with our predefined vpc in aws - mock . properties ( or if not overridden , as
* defined in aws - mock - default . properties ) */
private DescribeVpcsResponseType describeVpcs ( ) { } } | DescribeVpcsResponseType ret = new DescribeVpcsResponseType ( ) ; ret . setRequestId ( UUID . randomUUID ( ) . toString ( ) ) ; VpcSetType vpcSet = new VpcSetType ( ) ; for ( Iterator < MockVpc > mockVpc = mockVpcController . describeVpcs ( ) . iterator ( ) ; mockVpc . hasNext ( ) ; ) { MockVpc item = mockVpc . next ( ) ; VpcType vpcType = new VpcType ( ) ; if ( ! DEFAULT_MOCK_PLACEMENT . getAvailabilityZone ( ) . equals ( currentRegion ) ) { vpcType . setVpcId ( currentRegion + "_" + item . getVpcId ( ) ) ; } else { vpcType . setVpcId ( item . getVpcId ( ) ) ; } vpcType . setState ( item . getState ( ) ) ; vpcType . setCidrBlock ( item . getCidrBlock ( ) ) ; vpcType . setIsDefault ( item . getIsDefault ( ) ) ; vpcSet . getItem ( ) . add ( vpcType ) ; } ret . setVpcSet ( vpcSet ) ; return ret ; |
public class LiveEventsInner { /** * Create Live Event .
* Creates a Live Event .
* @ param resourceGroupName The name of the resource group within the Azure subscription .
* @ param accountName The Media Services account name .
* @ param liveEventName The name of the Live Event .
* @ param parameters Live Event properties needed for creation .
* @ 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 LiveEventInner object if successful . */
public LiveEventInner beginCreate ( String resourceGroupName , String accountName , String liveEventName , LiveEventInner parameters ) { } } | return beginCreateWithServiceResponseAsync ( resourceGroupName , accountName , liveEventName , parameters ) . toBlocking ( ) . single ( ) . body ( ) ; |
public class ImageHelper { /** * Load the specified url into this { @ link ImageView } .
* @ param v the target view
* @ param url the url to load
* @ param transformation transformation to apply , can be null
* @ return this helper */
public ImageHelper load ( ImageView v , String url , Transformation transformation ) { } } | return load ( v , new Request ( url , transformation ) ) ; |
public class RequestCreator { /** * Resize the image to the specified dimension size .
* Use 0 as desired dimension to resize keeping aspect ratio . */
@ NonNull public RequestCreator resizeDimen ( int targetWidthResId , int targetHeightResId ) { } } | Resources resources = picasso . context . getResources ( ) ; int targetWidth = resources . getDimensionPixelSize ( targetWidthResId ) ; int targetHeight = resources . getDimensionPixelSize ( targetHeightResId ) ; return resize ( targetWidth , targetHeight ) ; |
public class ObjectSpace { /** * Registers an object to allow the remote end of the ObjectSpace ' s connections to access it using the specified ID .
* If a connection is added to multiple ObjectSpaces , the same object ID should not be registered in more than one of those
* ObjectSpaces .
* @ param objectID Must not be Integer . MAX _ VALUE .
* @ see # getRemoteObject ( Connection , int , Class . . . ) */
public void register ( int objectID , Object object ) { } } | if ( objectID == Integer . MAX_VALUE ) throw new IllegalArgumentException ( "objectID cannot be Integer.MAX_VALUE." ) ; if ( object == null ) throw new IllegalArgumentException ( "object cannot be null." ) ; idToObject . put ( objectID , object ) ; objectToID . put ( object , objectID ) ; if ( TRACE ) trace ( "kryonet" , "Object registered with ObjectSpace as " + objectID + ": " + object ) ; |
public class RemoteNeo4jHelper { /** * Check if the node matches the column values
* @ param nodeProperties the properties on the node
* @ param keyColumnNames the name of the columns to check
* @ param keyColumnValues the value of the columns to check
* @ return true if the properties of the node match the column names and values */
public static boolean matches ( Map < String , Object > nodeProperties , String [ ] keyColumnNames , Object [ ] keyColumnValues ) { } } | for ( int i = 0 ; i < keyColumnNames . length ; i ++ ) { String property = keyColumnNames [ i ] ; Object expectedValue = keyColumnValues [ i ] ; boolean containsProperty = nodeProperties . containsKey ( property ) ; if ( containsProperty ) { Object actualValue = nodeProperties . get ( property ) ; if ( ! sameValue ( expectedValue , actualValue ) ) { return false ; } } else if ( expectedValue != null ) { return false ; } } return true ; |
public class MinerAdapter { /** * Creates a SIF interaction for the given match .
* @ param m match to use for SIF creation
* @ param fetcher ID generator from BioPAX object
* @ return SIF interaction */
public Set < SIFInteraction > createSIFInteraction ( Match m , IDFetcher fetcher ) { } } | BioPAXElement sourceBpe = m . get ( ( ( SIFMiner ) this ) . getSourceLabel ( ) , getPattern ( ) ) ; BioPAXElement targetBpe = m . get ( ( ( SIFMiner ) this ) . getTargetLabel ( ) , getPattern ( ) ) ; Set < String > sources = fetchIDs ( sourceBpe , fetcher ) ; Set < String > targets = fetchIDs ( targetBpe , fetcher ) ; SIFType sifType = ( ( SIFMiner ) this ) . getSIFType ( ) ; Set < SIFInteraction > set = new HashSet < SIFInteraction > ( ) ; for ( String source : sources ) { for ( String target : targets ) { if ( source . equals ( target ) ) continue ; else if ( sifType . isDirected ( ) || source . compareTo ( target ) < 0 ) { set . add ( new SIFInteraction ( source , target , sourceBpe , targetBpe , sifType , new HashSet < BioPAXElement > ( m . get ( getMediatorLabels ( ) , getPattern ( ) ) ) , new HashSet < BioPAXElement > ( m . get ( getSourcePELabels ( ) , getPattern ( ) ) ) , new HashSet < BioPAXElement > ( m . get ( getTargetPELabels ( ) , getPattern ( ) ) ) ) ) ; } else { set . add ( new SIFInteraction ( target , source , targetBpe , sourceBpe , sifType , new HashSet < BioPAXElement > ( m . get ( getMediatorLabels ( ) , getPattern ( ) ) ) , new HashSet < BioPAXElement > ( m . get ( getTargetPELabels ( ) , getPattern ( ) ) ) , new HashSet < BioPAXElement > ( m . get ( getSourcePELabels ( ) , getPattern ( ) ) ) ) ) ; } } } return set ; |
public class JDBC4ClientConnection { /** * Drop the client connection , e . g . when a NoConnectionsException is caught .
* It will try to reconnect as needed and appropriate .
* @ param clientToDrop caller - provided client to avoid re - nulling from another thread that comes in later */
protected synchronized void dropClient ( ClientImpl clientToDrop ) { } } | Client currentClient = this . client . get ( ) ; if ( currentClient != null && currentClient == clientToDrop ) { try { currentClient . close ( ) ; this . client . set ( null ) ; } catch ( Exception x ) { // ignore
} } this . users = 0 ; |
public class CpcCompression { /** * the length of this array is known to the source sketch . */
private static int [ ] uncompressTheSurprisingValues ( final CompressedState source ) { } } | final int srcK = 1 << source . lgK ; final int numPairs = source . numCsv ; assert numPairs > 0 ; final int [ ] pairs = new int [ numPairs ] ; final int numBaseBits = CpcCompression . golombChooseNumberOfBaseBits ( srcK + numPairs , numPairs ) ; lowLevelUncompressPairs ( pairs , numPairs , numBaseBits , source . csvStream , source . csvLengthInts ) ; return pairs ; |
public class ClientSocketFactory { /** * Open a stream if the target server ' s heartbeat is active .
* @ return the socket ' s read / write pair . */
public ClientSocket openIfHeartbeatActive ( ) { } } | if ( _state . isClosed ( ) ) { return null ; } if ( ! _isHeartbeatActive && _isHeartbeatServer ) { return null ; } ClientSocket stream = openRecycle ( ) ; if ( stream != null ) return stream ; return connect ( ) ; |
public class RequestRouter { /** * Binds a new controller .
* @ param controller the controller */
@ Bind ( aggregate = true , optional = true ) public synchronized void bindController ( Controller controller ) { } } | LOGGER . info ( "Adding routes from " + controller ) ; List < Route > newRoutes = new ArrayList < > ( ) ; try { List < Route > annotatedNewRoutes = RouteUtils . collectRouteFromControllerAnnotations ( controller ) ; newRoutes . addAll ( annotatedNewRoutes ) ; newRoutes . addAll ( controller . routes ( ) ) ; // check if these new routes don ' t pre - exist
ensureNoConflicts ( newRoutes ) ; } catch ( RoutingException e ) { LOGGER . error ( "The controller {} declares routes conflicting with existing routes, " + "the controller is ignored, reason: {}" , controller , e . getMessage ( ) , e ) ; // remove all new routes as one has failed
routes . removeAll ( newRoutes ) ; // NOSONAR
} catch ( Exception e ) { LOGGER . error ( "The controller {} declares invalid routes, " + "the controller is ignored, reason: {}" , controller , e . getMessage ( ) , e ) ; // remove all new routes as one has failed
routes . removeAll ( newRoutes ) ; // NOSONAR
} |
public class FileSystem { /** * Opens an FSDataOutputStream at the indicated Path .
* < p > This method is deprecated , because most of its parameters are ignored by most file systems .
* To control for example the replication factor and block size in the Hadoop Distributed File system ,
* make sure that the respective Hadoop configuration file is either linked from the Flink configuration ,
* or in the classpath of either Flink or the user code .
* @ param f
* the file name to open
* @ param overwrite
* if a file with this name already exists , then if true ,
* the file will be overwritten , and if false an error will be thrown .
* @ param bufferSize
* the size of the buffer to be used .
* @ param replication
* required block replication for the file .
* @ param blockSize
* the size of the file blocks
* @ throws IOException Thrown , if the stream could not be opened because of an I / O , or because
* a file already exists at that path and the write mode indicates to not
* overwrite the file .
* @ deprecated Deprecated because not well supported across types of file systems .
* Control the behavior of specific file systems via configurations instead . */
@ Deprecated public FSDataOutputStream create ( Path f , boolean overwrite , int bufferSize , short replication , long blockSize ) throws IOException { } } | return create ( f , overwrite ? WriteMode . OVERWRITE : WriteMode . NO_OVERWRITE ) ; |
public class Activator { /** * { @ inheritDoc } */
@ Override public void start ( BundleContext context ) throws Exception { } } | context . registerService ( FeatureResolver . class , new FeatureResolverImpl ( ) , null ) ; |
public class SimpleExpressionsFactoryImpl { /** * Creates the default factory implementation .
* < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public static SimpleExpressionsFactory init ( ) { } } | try { SimpleExpressionsFactory theSimpleExpressionsFactory = ( SimpleExpressionsFactory ) EPackage . Registry . INSTANCE . getEFactory ( SimpleExpressionsPackage . eNS_URI ) ; if ( theSimpleExpressionsFactory != null ) { return theSimpleExpressionsFactory ; } } catch ( Exception exception ) { EcorePlugin . INSTANCE . log ( exception ) ; } return new SimpleExpressionsFactoryImpl ( ) ; |
public class ContextItems { /** * Remove all context items for the specified subject .
* @ param subject Prefix whose items are to be removed . */
public void removeSubject ( String subject ) { } } | String prefix = normalizePrefix ( subject ) ; for ( String suffix : getSuffixes ( prefix ) . keySet ( ) ) { setItem ( prefix + suffix , null ) ; } |
public class AsynchronousRequest { /** * For more info on delivery API go < a href = " https : / / wiki . guildwars2 . com / wiki / API : 2 / commerce / delivery " > here < / a > < br / >
* Give user the access to { @ link Callback # onResponse ( Call , Response ) } and { @ link Callback # onFailure ( Call , Throwable ) } methods for custom interactions
* @ param API API key
* @ param callback callback that is going to be used for { @ link Call # enqueue ( Callback ) }
* @ throws GuildWars2Exception invalid API key
* @ throws NullPointerException if given { @ link Callback } is empty
* @ see Delivery devlivery info */
public void getTPDeliveryInfo ( String API , Callback < Delivery > callback ) throws GuildWars2Exception , NullPointerException { } } | isParamValid ( new ParamChecker ( ParamType . API , API ) ) ; gw2API . getTPDeliveryInfo ( API ) . enqueue ( callback ) ; |
public class StringUtils { /** * Safely trims input string */
public static String trim ( String str ) { } } | return str != null && str . length ( ) > 0 ? str . trim ( ) : str ; |
public class SelectColumn { /** * @ deprecated
* class中的字段名
* @ param cols 排除的字段名集合
* @ param columns 排除的字段名集合
* @ return SelectColumn */
@ Deprecated public static SelectColumn createExcludes ( String [ ] cols , String ... columns ) { } } | return new SelectColumn ( Utility . append ( cols , columns ) , true ) ; |
public class XPathImpl { /** * < p > Establishes a variable resolver . < / p >
* @ param resolver Variable Resolver */
public void setXPathVariableResolver ( XPathVariableResolver resolver ) { } } | if ( resolver == null ) { String fmsg = XSLMessages . createXPATHMessage ( XPATHErrorResources . ER_ARG_CANNOT_BE_NULL , new Object [ ] { "XPathVariableResolver" } ) ; throw new NullPointerException ( fmsg ) ; } this . variableResolver = resolver ; |
public class Bag { /** * Retrieve a mapped element and return it as a Long .
* @ param key A string value used to index the element .
* @ param notFound A function to create a new Long if the requested key was not found
* @ return The element as a Long , or notFound if the element is not found . */
public Long getLong ( String key , Supplier < Long > notFound ) { } } | return getParsed ( key , Long :: new , notFound ) ; |
public class MultipleFileTransfer { /** * Set the state based on the states of all file downloads . Assumes all file
* downloads are done .
* A single failed sub - transfer makes the entire transfer failed . If there
* are no failed sub - transfers , a single canceled sub - transfer makes the
* entire transfer canceled . Otherwise , we consider ourselves Completed . */
public void collateFinalState ( ) { } } | boolean seenCanceled = false ; for ( T download : subTransfers ) { if ( download . getState ( ) == TransferState . Failed ) { setState ( TransferState . Failed ) ; return ; } else if ( download . getState ( ) == TransferState . Canceled ) { seenCanceled = true ; } } if ( seenCanceled ) setState ( TransferState . Canceled ) ; else setState ( TransferState . Completed ) ; |
public class Scte20PlusEmbeddedDestinationSettingsMarshaller { /** * Marshall the given parameter object . */
public void marshall ( Scte20PlusEmbeddedDestinationSettings scte20PlusEmbeddedDestinationSettings , ProtocolMarshaller protocolMarshaller ) { } } | if ( scte20PlusEmbeddedDestinationSettings == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class Links { /** * Returns whether the current { @ link Links } contain all given { @ link Link } s ( but potentially others ) .
* @ param links must not be { @ literal null } .
* @ return */
public boolean contains ( Iterable < Link > links ) { } } | return this . links . containsAll ( Links . of ( links ) . toList ( ) ) ; |
public class OsmMapShapeConverter { /** * Convert a { @ link MultiPoint } to a { @ link MultiLatLng }
* @ param multiPoint
* @ return */
public MultiLatLng toLatLngs ( MultiPoint multiPoint ) { } } | MultiLatLng multiLatLng = new MultiLatLng ( ) ; for ( Point point : multiPoint . getPoints ( ) ) { GeoPoint latLng = toLatLng2 ( point ) ; multiLatLng . add ( latLng ) ; } return multiLatLng ; |
public class AbstractQueryRunner { /** * Execute a batch of SQL INSERT , UPDATE , or DELETE queries .
* @ param stmtHandler { @ link StatementHandler } implementation
* @ param sql The SQL query to execute .
* @ param params An array of query replacement parameters . Each row in
* this array is one set of batch replacement values .
* @ return array of row affected
* @ throws SQLException if exception would be thrown by Driver / Database */
protected int [ ] batch ( StatementHandler stmtHandler , String sql , QueryParameters [ ] params ) throws SQLException { } } | Connection conn = this . transactionHandler . getConnection ( ) ; if ( sql == null ) { this . transactionHandler . rollback ( ) ; this . transactionHandler . closeConnection ( ) ; throw new SQLException ( "Null SQL statement" ) ; } if ( params == null ) { this . transactionHandler . rollback ( ) ; this . transactionHandler . closeConnection ( ) ; throw new SQLException ( "Null parameters. If parameters aren't need, pass an empty array." ) ; } PreparedStatement stmt = null ; int [ ] rows = null ; QueryParameters [ ] processedParams = new QueryParameters [ params . length ] ; try { stmt = this . prepareStatement ( conn , null , sql , false ) ; for ( int i = 0 ; i < params . length ; i ++ ) { processedParams [ i ] = typeHandler . processInput ( stmt , params [ i ] ) ; stmtHandler . setStatement ( stmt , processedParams [ i ] ) ; stmt . addBatch ( ) ; } rows = stmt . executeBatch ( ) ; for ( int i = 0 ; i < params . length ; i ++ ) { typeHandler . afterExecute ( stmt , processedParams [ i ] , params [ i ] ) ; } if ( this . isTransactionManualMode ( ) == false ) { this . transactionHandler . commit ( ) ; } } catch ( SQLException e ) { if ( this . isTransactionManualMode ( ) == false ) { this . transactionHandler . rollback ( ) ; } rethrow ( conn , e , sql , ( Object [ ] ) params ) ; } finally { stmtHandler . beforeClose ( ) ; MjdbcUtils . closeQuietly ( stmt ) ; stmtHandler . afterClose ( ) ; this . transactionHandler . closeConnection ( ) ; } return rows ; |
public class McGregor { /** * matrix will be stored in function partsearch . */
private boolean checkmArcs ( List < Integer > mArcsT , int neighborBondNumA , int neighborBondNumB ) { } } | int size = neighborBondNumA * neighborBondNumA ; List < Integer > posNumList = new ArrayList < Integer > ( size ) ; for ( int i = 0 ; i < posNumList . size ( ) ; i ++ ) { posNumList . add ( i , 0 ) ; } int yCounter = 0 ; int countEntries = 0 ; for ( int x = 0 ; x < ( neighborBondNumA * neighborBondNumB ) ; x ++ ) { if ( mArcsT . get ( x ) == 1 ) { posNumList . add ( yCounter ++ , x ) ; countEntries ++ ; } } boolean flag = false ; verifyNodes ( posNumList , first , 0 , countEntries ) ; if ( isNewMatrix ( ) ) { flag = true ; } return flag ; |
public class MPApiResponse { /** * Parses the http request in a custom MPApiResponse object .
* @ param httpMethod enum with the method executed
* @ param request HttpRequestBase object
* @ param payload JsonObject with the payload
* @ throws MPException */
private void parseRequest ( HttpMethod httpMethod , HttpRequestBase request , JsonObject payload ) throws MPException { } } | this . method = httpMethod . toString ( ) ; this . url = request . getURI ( ) . toString ( ) ; if ( payload != null ) { this . payload = payload . toString ( ) ; } |
public class ApiOvhEmailexchange { /** * External contacts for this service
* REST : GET / email / exchange / { organizationName } / service / { exchangeService } / externalContact
* @ param lastName [ required ] Filter the value of lastName property ( like )
* @ param displayName [ required ] Filter the value of displayName property ( like )
* @ param id [ required ] Filter the value of id property ( like )
* @ param externalEmailAddress [ required ] Filter the value of externalEmailAddress property ( like )
* @ param firstName [ required ] Filter the value of firstName property ( like )
* @ param organizationName [ required ] The internal name of your exchange organization
* @ param exchangeService [ required ] The internal name of your exchange service */
public ArrayList < String > organizationName_service_exchangeService_externalContact_GET ( String organizationName , String exchangeService , String displayName , String externalEmailAddress , String firstName , Long id , String lastName ) throws IOException { } } | String qPath = "/email/exchange/{organizationName}/service/{exchangeService}/externalContact" ; StringBuilder sb = path ( qPath , organizationName , exchangeService ) ; query ( sb , "displayName" , displayName ) ; query ( sb , "externalEmailAddress" , externalEmailAddress ) ; query ( sb , "firstName" , firstName ) ; query ( sb , "id" , id ) ; query ( sb , "lastName" , lastName ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , t1 ) ; |
public class MatchAccumulator { /** * Invokes the { @ link Matcher # matches ( java . lang . Object ) } method on the supplied matcher against a given target object
* and appends relevant text to the mismatch description if the match fails .
* @ param matcher the matcher to invoke
* @ param item the target object to be matched
* @ param < P > the type of item to be matched
* @ return this instance , to allow multiple calls to be chained */
public < P > MatchAccumulator matches ( Matcher < ? > matcher , P item ) { } } | if ( ! matcher . matches ( item ) ) { handleMismatch ( matcher , item ) ; } appliedMatchers . add ( matcher ) ; return this ; |
public class Matrix4d { /** * Pre - multiply the rotation - and possibly scaling - transformation of the given { @ link Quaterniondc } to this matrix and store
* the result in < code > dest < / code > .
* 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 > Q < / code > the rotation matrix obtained from the given quaternion ,
* then the new matrix will be < code > Q * M < / code > . So when transforming a
* vector < code > v < / code > with the new matrix by using < code > Q * M * v < / code > ,
* the quaternion rotation will be applied last !
* In order to set the matrix to a rotation transformation without pre - multiplying ,
* use { @ link # rotation ( Quaterniondc ) } .
* Reference : < a href = " http : / / en . wikipedia . org / wiki / Rotation _ matrix # Quaternion " > http : / / en . wikipedia . org < / a >
* @ see # rotation ( Quaterniondc )
* @ param quat
* the { @ link Quaterniondc }
* @ param dest
* will hold the result
* @ return dest */
public Matrix4d rotateLocal ( Quaterniondc quat , Matrix4d dest ) { } } | double w2 = quat . w ( ) * quat . w ( ) , x2 = quat . x ( ) * quat . x ( ) ; double y2 = quat . y ( ) * quat . y ( ) , z2 = quat . z ( ) * quat . z ( ) ; double zw = quat . z ( ) * quat . w ( ) , dzw = zw + zw , xy = quat . x ( ) * quat . y ( ) , dxy = xy + xy ; double xz = quat . x ( ) * quat . z ( ) , dxz = xz + xz , yw = quat . y ( ) * quat . w ( ) , dyw = yw + yw ; double yz = quat . y ( ) * quat . z ( ) , dyz = yz + yz , xw = quat . x ( ) * quat . w ( ) , dxw = xw + xw ; double lm00 = w2 + x2 - z2 - y2 ; double lm01 = dxy + dzw ; double lm02 = dxz - dyw ; double lm10 = - dzw + dxy ; double lm11 = y2 - z2 + w2 - x2 ; double lm12 = dyz + dxw ; double lm20 = dyw + dxz ; double lm21 = dyz - dxw ; double lm22 = z2 - y2 - x2 + w2 ; double nm00 = lm00 * m00 + lm10 * m01 + lm20 * m02 ; double nm01 = lm01 * m00 + lm11 * m01 + lm21 * m02 ; double nm02 = lm02 * m00 + lm12 * m01 + lm22 * m02 ; double nm03 = m03 ; double nm10 = lm00 * m10 + lm10 * m11 + lm20 * m12 ; double nm11 = lm01 * m10 + lm11 * m11 + lm21 * m12 ; double nm12 = lm02 * m10 + lm12 * m11 + lm22 * m12 ; double nm13 = m13 ; double nm20 = lm00 * m20 + lm10 * m21 + lm20 * m22 ; double nm21 = lm01 * m20 + lm11 * m21 + lm21 * m22 ; double nm22 = lm02 * m20 + lm12 * m21 + lm22 * m22 ; double nm23 = m23 ; double nm30 = lm00 * m30 + lm10 * m31 + lm20 * m32 ; double nm31 = lm01 * m30 + lm11 * m31 + lm21 * m32 ; double nm32 = lm02 * m30 + lm12 * m31 + lm22 * m32 ; double nm33 = m33 ; dest . m00 = nm00 ; dest . m01 = nm01 ; dest . m02 = nm02 ; dest . m03 = nm03 ; dest . m10 = nm10 ; dest . m11 = nm11 ; dest . m12 = nm12 ; dest . m13 = nm13 ; dest . m20 = nm20 ; dest . m21 = nm21 ; dest . m22 = nm22 ; dest . m23 = nm23 ; dest . m30 = nm30 ; dest . m31 = nm31 ; dest . m32 = nm32 ; dest . m33 = nm33 ; dest . properties = properties & ~ ( PROPERTY_PERSPECTIVE | PROPERTY_IDENTITY | PROPERTY_TRANSLATION ) ; return dest ; |
public class RpcServlet { /** * VisibleForTesting */
void writeResult ( final RpcResult < ? , ? > result , final HttpServletResponse resp ) throws IOException { } } | if ( result . isSuccess ( ) ) { resp . setStatus ( HttpServletResponse . SC_OK ) ; resp . setContentType ( JSON_CONTENT_TYPE ) ; } else { resp . setStatus ( APPLICATION_EXC_STATUS ) ; resp . setContentType ( JSON_CONTENT_TYPE ) ; } PrintWriter writer = resp . getWriter ( ) ; result . toJson ( writer , true ) ; writer . flush ( ) ; |
public class Resources { /** * Gets the integer from the properties .
* @ param key the key of the property .
* @ return the value of the key . return - 1 if the value is not found . */
public Integer getInteger ( String key ) { } } | try { return Integer . valueOf ( resource . getString ( key ) ) ; } catch ( MissingResourceException e ) { return new Integer ( - 1 ) ; } |
public class CharMatcher { /** * Returns a string copy of the input character sequence , with each group of consecutive
* characters that match this matcher replaced by a single replacement character . For example :
* < pre > { @ code
* CharMatcher . anyOf ( " eko " ) . collapseFrom ( " bookkeeper " , ' - ' ) } < / pre >
* . . . returns { @ code " b - p - r " } .
* < p > The default implementation uses { @ link # indexIn ( CharSequence ) } to find the first matching
* character , then iterates the remainder of the sequence calling { @ link # matches ( char ) } for each
* character .
* @ param sequence the character sequence to replace matching groups of characters in
* @ param replacement the character to append to the result string in place of each group of
* matching characters in { @ code sequence }
* @ return the new string */
public String collapseFrom ( CharSequence sequence , char replacement ) { } } | // This implementation avoids unnecessary allocation .
int len = sequence . length ( ) ; for ( int i = 0 ; i < len ; i ++ ) { char c = sequence . charAt ( i ) ; if ( matches ( c ) ) { if ( c == replacement && ( i == len - 1 || ! matches ( sequence . charAt ( i + 1 ) ) ) ) { // a no - op replacement
i ++ ; } else { StringBuilder builder = new StringBuilder ( len ) . append ( sequence . subSequence ( 0 , i ) ) . append ( replacement ) ; return finishCollapseFrom ( sequence , i + 1 , len , replacement , builder , true ) ; } } } // no replacement needed
return sequence . toString ( ) ; |
public class SparseIntArray { /** * Returns an index for which { @ link # valueAt } would return the
* specified key , or a negative number if no keys map to the
* specified value .
* Beware that this is a linear search , unlike lookups by key ,
* and that multiple keys can map to the same value and this will
* find only one of them . */
public int indexOfValue ( int value ) { } } | for ( int i = 0 ; i < mSize ; i ++ ) if ( mValues [ i ] == value ) return i ; return - 1 ; |
public class JMPredicate { /** * Gets less or equal .
* @ param target the target
* @ return the less or equal */
public static Predicate < Number > getLessOrEqual ( Number target ) { } } | return number -> number . doubleValue ( ) <= target . doubleValue ( ) ; |
public class RequestUrl { /** * Get the relative url to the current servlet .
* Uses the request URI and removes : the context path , the servlet path if used .
* @ param request
* The current HTTP request
* @ param servlet
* true to remove the servlet path
* @ return the url , relative to the servlet mapping . */
public static String getRelativeUrl ( HttpServletRequest request , boolean servlet ) { } } | // Raw request url
String requestURI = request . getRequestURI ( ) ; // Application ( war ) context path
String contextPath = request . getContextPath ( ) ; // Servlet mapping
String servletPath = request . getServletPath ( ) ; String relativeUrl = requestURI ; // Remove application context path
if ( contextPath != null && relativeUrl . startsWith ( contextPath ) ) { relativeUrl = relativeUrl . substring ( contextPath . length ( ) ) ; } // Remove servlet mapping path
if ( servlet && servletPath != null && relativeUrl . startsWith ( servletPath ) ) { relativeUrl = relativeUrl . substring ( servletPath . length ( ) ) ; } if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( "requestURI: {}, contextPath: {}, servletPath: {}, relativeUrl: {}, " , requestURI , contextPath , servletPath , relativeUrl ) ; } return relativeUrl ; |
public class CoronaJobTracker { /** * Return this grant and request a different one .
* This can happen because the task has failed , was killed
* or the job tracker decided that the resource is bad
* @ param grant The grant identifier .
* @ param abandonHost - if true then this host will be excluded
* from the list of possibilities for this request */
public void processBadResource ( int grant , boolean abandonHost ) { } } | synchronized ( lockObject ) { Set < String > excludedHosts = null ; TaskInProgress tip = requestToTipMap . get ( grant ) ; if ( ! job . canLaunchJobCleanupTask ( ) && ( ! tip . isRunnable ( ) || ( tip . isRunning ( ) && ! ( speculatedMaps . contains ( tip ) || speculatedReduces . contains ( tip ) ) ) ) ) { // The task is not runnable anymore . Job is done / killed / failed or the
// task has finished and this is a speculative resource
// Or the task is running and this is a speculative resource
// but the speculation is no longer needed
resourceTracker . releaseResource ( grant ) ; return ; } if ( abandonHost ) { ResourceGrant resource = resourceTracker . getGrant ( grant ) ; String hostToExlcude = resource . getAddress ( ) . getHost ( ) ; taskToContextMap . get ( tip ) . excludedHosts . add ( hostToExlcude ) ; excludedHosts = taskToContextMap . get ( tip ) . excludedHosts ; } ResourceRequest newReq = resourceTracker . releaseAndRequestResource ( grant , excludedHosts ) ; requestToTipMap . put ( newReq . getId ( ) , tip ) ; TaskContext context = taskToContextMap . get ( tip ) ; if ( context == null ) { context = new TaskContext ( newReq ) ; } else { context . resourceRequests . add ( newReq ) ; } taskToContextMap . put ( tip , context ) ; } |
public class ApproximateHistogram { /** * Returns the approximate number of items less than or equal to b in the histogram
* @ param b the cutoff
* @ return the approximate number of items less than or equal to b */
public double sum ( final float b ) { } } | if ( b < min ) { return 0 ; } if ( b >= max ) { return count ; } int index = Arrays . binarySearch ( positions , 0 , binCount , b ) ; boolean exactMatch = index >= 0 ; index = exactMatch ? index : - ( index + 1 ) ; // we want positions [ index ] < = b < positions [ index + 1]
if ( ! exactMatch ) { index -- ; } final boolean outerLeft = index < 0 ; final boolean outerRight = index >= ( binCount - 1 ) ; final long m0 = outerLeft ? 0 : ( bins [ index ] & COUNT_BITS ) ; final long m1 = outerRight ? 0 : ( bins [ index + 1 ] & COUNT_BITS ) ; final double p0 = outerLeft ? min : positions [ index ] ; final double p1 = outerRight ? max : positions [ index + 1 ] ; final boolean exact0 = ( ! outerLeft && ( bins [ index ] & APPROX_FLAG_BIT ) == 0 ) ; final boolean exact1 = ( ! outerRight && ( bins [ index + 1 ] & APPROX_FLAG_BIT ) == 0 ) ; // handle case when p0 = p1 , which happens if the first bin = min or the last bin = max
final double l = ( p1 == p0 ) ? 0 : ( b - p0 ) / ( p1 - p0 ) ; // don ' t include exact counts in the trapezoid calculation
long tm0 = m0 ; long tm1 = m1 ; if ( exact0 ) { tm0 = 0 ; } if ( exact1 ) { tm1 = 0 ; } final double mb = tm0 + ( tm1 - tm0 ) * l ; double s = 0.5 * ( tm0 + mb ) * l ; for ( int i = 0 ; i < index ; ++ i ) { s += ( bins [ i ] & COUNT_BITS ) ; } // add full bin count if left bin count is exact
if ( exact0 ) { return ( s + m0 ) ; } else { // otherwise add only the left half of the bin
return ( s + 0.5 * m0 ) ; } |
public class EJSHome { /** * d142250 */
public EJBObject postCreate ( BeanO beanO , Object primaryKey , boolean inSupportOfEJBPostCreateChanges ) throws CreateException , RemoteException { } } | boolean supportEJBPostCreateChanges = inSupportOfEJBPostCreateChanges && ! ivAllowEarlyInsert ; // PQ89520
// If noLocalCopies and allowPrimaryKeyMutation are true then we
// must create a deep copy of the primaryKey object to avoid data
// corruption . PQ62081 d138865
// " Primary Key " should not be copied for a StatefulSession bean . d247634
if ( noLocalCopies && allowPrimaryKeyMutation && ! statefulSessionHome ) { try { primaryKey = container . ivObjectCopier . copy ( ( Serializable ) primaryKey ) ; // RTC102299
} catch ( Throwable t ) { FFDCFilter . processException ( t , CLASS_NAME + ".postCreate" , "1551" , this ) ; ContainerEJBException ex = new ContainerEJBException ( "postCreate failed attempting to process PrimaryKey" , t ) ; Tr . error ( tc , "CAUGHT_EXCEPTION_THROWING_NEW_EXCEPTION_CNTR0035E" , new Object [ ] { t , ex . toString ( ) } ) ; // d194031
throw ex ; } } EJSWrapperCommon common = postCreateCommon ( beanO , primaryKey , supportEJBPostCreateChanges ) ; // d142250
EJSWrapper w = common . getRemoteWrapper ( ) ; // f111627
// Pop the callback bean if afterPostCreate will not be called . This
// must be be the last action of this method because if anything throws ,
// createFailure is called and we should not pop twice .
if ( ! inSupportOfEJBPostCreateChanges || statefulSessionHome ) { EJSContainer . getThreadData ( ) . popCallbackBeanO ( ) ; } return w ; |
public class CoalescingBufferQueue { /** * Remove a { @ link ByteBuf } from the queue with the specified number of bytes . Any added buffer who ' s bytes are
* fully consumed during removal will have it ' s promise completed when the passed aggregate { @ link ChannelPromise }
* completes .
* @ param bytes the maximum number of readable bytes in the returned { @ link ByteBuf } , if { @ code bytes } is greater
* than { @ link # readableBytes } then a buffer of length { @ link # readableBytes } is returned .
* @ param aggregatePromise used to aggregate the promises and listeners for the constituent buffers .
* @ return a { @ link ByteBuf } composed of the enqueued buffers . */
public ByteBuf remove ( int bytes , ChannelPromise aggregatePromise ) { } } | return remove ( channel . alloc ( ) , bytes , aggregatePromise ) ; |
public class WxCryptUtil { /** * 对密文进行解密 .
* @ param cipherText 需要解密的密文
* @ return 解密得到的明文 */
public String decrypt ( String cipherText ) { } } | byte [ ] original ; try { // 设置解密模式为AES的CBC模式
Cipher cipher = Cipher . getInstance ( "AES/CBC/NoPadding" ) ; SecretKeySpec key_spec = new SecretKeySpec ( aesKey , "AES" ) ; IvParameterSpec iv = new IvParameterSpec ( Arrays . copyOfRange ( aesKey , 0 , 16 ) ) ; cipher . init ( Cipher . DECRYPT_MODE , key_spec , iv ) ; // 使用BASE64对密文进行解码
byte [ ] encrypted = Base64 . decodeBase64 ( cipherText ) ; // 解密
original = cipher . doFinal ( encrypted ) ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; } String xmlContent , from_appid ; try { // 去除补位字符
byte [ ] bytes = PKCS7Encoder . decode ( original ) ; // 分离16位随机字符串 , 网络字节序和AppId
byte [ ] networkOrder = Arrays . copyOfRange ( bytes , 16 , 20 ) ; int xmlLength = bytesNetworkOrder2Number ( networkOrder ) ; xmlContent = new String ( Arrays . copyOfRange ( bytes , 20 , 20 + xmlLength ) , CHARSET ) ; from_appid = new String ( Arrays . copyOfRange ( bytes , 20 + xmlLength , bytes . length ) , CHARSET ) ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; } // appid不相同的情况
if ( ! from_appid . equals ( appidOrCorpid ) ) { throw new RuntimeException ( "AppID不正确" ) ; } return xmlContent ; |
public class Ransac { /** * Initialize internal data structures */
public void initialize ( List < Point > dataSet ) { } } | bestFitPoints . clear ( ) ; if ( dataSet . size ( ) > matchToInput . length ) { matchToInput = new int [ dataSet . size ( ) ] ; bestMatchToInput = new int [ dataSet . size ( ) ] ; } |
public class QueryResultUtil { /** * Get value by column type .
* @ param resultSet result set
* @ param columnIndex column index
* @ return column value
* @ throws SQLException SQL exception */
public static Object getValueByColumnType ( final ResultSet resultSet , final int columnIndex ) throws SQLException { } } | ResultSetMetaData metaData = resultSet . getMetaData ( ) ; switch ( metaData . getColumnType ( columnIndex ) ) { case Types . BIT : case Types . BOOLEAN : return resultSet . getBoolean ( columnIndex ) ; case Types . TINYINT : return resultSet . getByte ( columnIndex ) ; case Types . SMALLINT : return resultSet . getShort ( columnIndex ) ; case Types . INTEGER : return resultSet . getInt ( columnIndex ) ; case Types . BIGINT : return resultSet . getLong ( columnIndex ) ; case Types . NUMERIC : case Types . DECIMAL : return resultSet . getBigDecimal ( columnIndex ) ; case Types . FLOAT : case Types . DOUBLE : return resultSet . getDouble ( columnIndex ) ; case Types . CHAR : case Types . VARCHAR : case Types . LONGVARCHAR : return resultSet . getString ( columnIndex ) ; case Types . BINARY : case Types . VARBINARY : case Types . LONGVARBINARY : return resultSet . getBytes ( columnIndex ) ; case Types . DATE : return resultSet . getDate ( columnIndex ) ; case Types . TIME : return resultSet . getTime ( columnIndex ) ; case Types . TIMESTAMP : return resultSet . getTimestamp ( columnIndex ) ; case Types . CLOB : return resultSet . getClob ( columnIndex ) ; case Types . BLOB : return resultSet . getBlob ( columnIndex ) ; default : return resultSet . getObject ( columnIndex ) ; } |
public class DFSInputStream { /** * / * This is a used by regular read ( ) and handles ChecksumExceptions .
* name readBuffer ( ) is chosen to imply similarity to readBuffer ( ) in
* ChecksumFileSystem */
private synchronized int readBuffer ( byte buf [ ] , int off , int len ) throws IOException { } } | IOException ioe ; /* we retry current node only once . So this is set to true only here .
* Intention is to handle one common case of an error that is not a
* failure on datanode or client : when DataNode closes the connection
* since client is idle . If there are other cases of " non - errors " then
* then a datanode might be retried by setting this to true again . */
boolean retryCurrentNode = true ; while ( true ) { // retry as many times as seekToNewSource allows .
try { InjectionHandler . processEventIO ( InjectionEvent . DFSCLIENT_READBUFFER_BEFORE , deadNodes , locatedBlocks ) ; int bytesRead = blockReader . read ( buf , off , len ) ; InjectionHandler . processEventIO ( InjectionEvent . DFSCLIENT_READBUFFER_AFTER , blockReader ) ; // update length of file under construction if needed
if ( isCurrentBlockUnderConstruction && blockReader . isBlkLenInfoUpdated ( ) ) { locatedBlocks . setLastBlockSize ( currentBlock . getBlockId ( ) , blockReader . getUpdatedBlockLength ( ) ) ; this . blockEnd = locatedBlocks . getFileLength ( ) - 1 ; blockReader . resetBlockLenInfo ( ) ; // if the last block is finalized , get file info from name - node .
// It is necessary because there might be new blocks added to
// the file . The client needs to check with the name - node whether
// it is the case , or the file has been finalized .
if ( blockReader . isBlockFinalized ( ) && src != null ) { openInfo ( ) ; } } if ( cliData != null ) { cliData . recordReadBufferTime ( ) ; } return bytesRead ; } catch ( DataNodeSlowException dnse ) { DFSClient . LOG . warn ( "Node " + currentNode + " is too slow when reading blk " + this . currentBlock + ". Try another datanode." ) ; ioe = dnse ; retryCurrentNode = false ; } catch ( ChecksumException ce ) { DFSClient . LOG . warn ( "Found Checksum error for " + currentBlock + " from " + currentNode . getName ( ) + " at " + ce . getPos ( ) ) ; dfsClient . reportChecksumFailure ( src , currentBlock , currentNode ) ; ioe = ce ; retryCurrentNode = false ; } catch ( IOException e ) { if ( ! retryCurrentNode ) { DFSClient . LOG . warn ( "Exception while reading from " + currentBlock + " of " + src + " from " + currentNode + ": " + StringUtils . stringifyException ( e ) ) ; } ioe = e ; } boolean sourceFound = false ; if ( retryCurrentNode ) { /* possibly retry the same node so that transient errors don ' t
* result in application level failures ( e . g . Datanode could have
* closed the connection because the client is idle for too long ) . */
sourceFound = seekToBlockSource ( pos , len != 0 ) ; } else { addToDeadNodes ( currentNode ) ; sourceFound = seekToNewSource ( pos , len != 0 ) ; } if ( ! sourceFound ) { throw ioe ; } else { dfsClient . incReadExpCntToStats ( ) ; } retryCurrentNode = false ; } |
public class CmsSearchManager { /** * Sets the timeout to abandon threads indexing a resource as a String . < p >
* @ param value the timeout in milliseconds */
public void setTimeout ( String value ) { } } | try { setTimeout ( Long . parseLong ( value ) ) ; } catch ( Exception e ) { LOG . error ( Messages . get ( ) . getBundle ( ) . key ( Messages . LOG_PARSE_TIMEOUT_FAILED_2 , value , new Long ( DEFAULT_TIMEOUT ) ) , e ) ; setTimeout ( DEFAULT_TIMEOUT ) ; } |
public class CommerceWishListItemUtil { /** * Returns the first commerce wish list item in the ordered set where commerceWishListId = & # 63 ; and CProductId = & # 63 ; .
* @ param commerceWishListId the commerce wish list ID
* @ param CProductId the c product ID
* @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > )
* @ return the first matching commerce wish list item , or < code > null < / code > if a matching commerce wish list item could not be found */
public static CommerceWishListItem fetchByCW_CP_First ( long commerceWishListId , long CProductId , OrderByComparator < CommerceWishListItem > orderByComparator ) { } } | return getPersistence ( ) . fetchByCW_CP_First ( commerceWishListId , CProductId , orderByComparator ) ; |
public class WarUtils { /** * < p > This method updates a template war with the following settings . < / p >
* @ param templateWar The name of the template war to pull from the classpath .
* @ param war The path of an external war to update ( optional ) .
* @ param newWarNames The name to give the new war . ( note : only the first element of this list is used . )
* @ param repoUri The uri to a github repo to pull content from .
* @ param branch The branch of the github repo to pull content from .
* @ param configRepoUri The uri to a github repo to pull config from .
* @ param configBranch The branch of the github repo to pull config from .
* @ param domain The domain to bind a vHost to .
* @ param context The context root that this war will deploy to .
* @ param secure A flag to set if this war needs to have its contents password protected .
* @ throws Exception */
public static void updateWar ( String templateWar , String war , List < String > newWarNames , String repoUri , String branch , String configRepoUri , String configBranch , String domain , String context , boolean secure , Logger log ) throws Exception { } } | ZipFile inZip = null ; ZipOutputStream outZip = null ; InputStream in = null ; OutputStream out = null ; try { if ( war != null ) { if ( war . equals ( newWarNames . get ( 0 ) ) ) { File tmpZip = File . createTempFile ( war , null ) ; tmpZip . delete ( ) ; tmpZip . deleteOnExit ( ) ; new File ( war ) . renameTo ( tmpZip ) ; war = tmpZip . getAbsolutePath ( ) ; } inZip = new ZipFile ( war ) ; } else { File tmpZip = File . createTempFile ( "cadmium-war" , "war" ) ; tmpZip . delete ( ) ; tmpZip . deleteOnExit ( ) ; in = WarUtils . class . getClassLoader ( ) . getResourceAsStream ( templateWar ) ; out = new FileOutputStream ( tmpZip ) ; FileSystemManager . streamCopy ( in , out ) ; inZip = new ZipFile ( tmpZip ) ; } outZip = new ZipOutputStream ( new FileOutputStream ( newWarNames . get ( 0 ) ) ) ; ZipEntry cadmiumPropertiesEntry = null ; cadmiumPropertiesEntry = inZip . getEntry ( "WEB-INF/cadmium.properties" ) ; Properties cadmiumProps = updateProperties ( inZip , cadmiumPropertiesEntry , repoUri , branch , configRepoUri , configBranch ) ; ZipEntry jbossWeb = null ; jbossWeb = inZip . getEntry ( "WEB-INF/jboss-web.xml" ) ; Enumeration < ? extends ZipEntry > entries = inZip . entries ( ) ; while ( entries . hasMoreElements ( ) ) { ZipEntry e = entries . nextElement ( ) ; if ( e . getName ( ) . equals ( cadmiumPropertiesEntry . getName ( ) ) ) { storeProperties ( outZip , cadmiumPropertiesEntry , cadmiumProps , newWarNames ) ; } else if ( ( ( domain != null && domain . length ( ) > 0 ) || ( context != null && context . length ( ) > 0 ) ) && e . getName ( ) . equals ( jbossWeb . getName ( ) ) ) { updateDomain ( inZip , outZip , jbossWeb , domain , context ) ; } else if ( secure && e . getName ( ) . equals ( "WEB-INF/web.xml" ) ) { addSecurity ( inZip , outZip , e ) ; } else { outZip . putNextEntry ( e ) ; if ( ! e . isDirectory ( ) ) { FileSystemManager . streamCopy ( inZip . getInputStream ( e ) , outZip , true ) ; } outZip . closeEntry ( ) ; } } } finally { if ( FileSystemManager . exists ( "tmp_cadmium-war.war" ) ) { new File ( "tmp_cadmium-war.war" ) . delete ( ) ; } try { if ( inZip != null ) { inZip . close ( ) ; } } catch ( Exception e ) { if ( log != null ) { log . error ( "Failed to close " + war ) ; } } try { if ( outZip != null ) { outZip . close ( ) ; } } catch ( Exception e ) { if ( log != null ) { log . error ( "Failed to close " + newWarNames . get ( 0 ) ) ; } } try { if ( out != null ) { out . close ( ) ; } } catch ( Exception e ) { } try { if ( in != null ) { in . close ( ) ; } } catch ( Exception e ) { } } |
public class ServiceStarter { /** * region main ( ) */
public static void main ( String [ ] args ) throws Exception { } } | AtomicReference < ServiceStarter > serviceStarter = new AtomicReference < > ( ) ; try { System . err . println ( System . getProperty ( ServiceBuilderConfig . CONFIG_FILE_PROPERTY_NAME , "config.properties" ) ) ; // Load up the ServiceBuilderConfig , using this priority order ( lowest to highest ) :
// 1 . Configuration file ( either default or specified via SystemProperties )
// 2 . System Properties overrides ( these will be passed in via the command line or inherited from the JVM )
ServiceBuilderConfig config = ServiceBuilderConfig . builder ( ) . include ( System . getProperty ( ServiceBuilderConfig . CONFIG_FILE_PROPERTY_NAME , "config.properties" ) ) . include ( System . getProperties ( ) ) . build ( ) ; // For debugging purposes , it may be useful to know the non - default values for configurations being used .
// This will unfortunately include all System Properties as well , but knowing those can be useful too sometimes .
log . info ( "Segment store configuration:" ) ; config . forEach ( ( key , value ) -> log . info ( "{} = {}" , key , value ) ) ; serviceStarter . set ( new ServiceStarter ( config ) ) ; } catch ( Throwable e ) { log . error ( "Could not create a Service with default config, Aborting." , e ) ; System . exit ( 1 ) ; } try { serviceStarter . get ( ) . start ( ) ; } catch ( Throwable e ) { log . error ( "Could not start the Service, Aborting." , e ) ; System . exit ( 1 ) ; } try { Runtime . getRuntime ( ) . addShutdownHook ( new Thread ( ( ) -> { log . info ( "Caught interrupt signal..." ) ; serviceStarter . get ( ) . shutdown ( ) ; } ) ) ; Thread . sleep ( Long . MAX_VALUE ) ; } catch ( InterruptedException ex ) { log . info ( "Caught interrupt signal..." ) ; } finally { serviceStarter . get ( ) . shutdown ( ) ; System . exit ( 0 ) ; } |
public class AmazonIdentityManagementClient { /** * Generates a credential report for the AWS account . For more information about the credential report , see < a
* href = " https : / / docs . aws . amazon . com / IAM / latest / UserGuide / credential - reports . html " > Getting Credential Reports < / a > in
* the < i > IAM User Guide < / i > .
* @ param generateCredentialReportRequest
* @ return Result of the GenerateCredentialReport operation returned by the service .
* @ throws LimitExceededException
* The request was rejected because it attempted to create resources beyond the current AWS account limits .
* The error message describes the limit exceeded .
* @ throws ServiceFailureException
* The request processing has failed because of an unknown error , exception or failure .
* @ sample AmazonIdentityManagement . GenerateCredentialReport
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / iam - 2010-05-08 / GenerateCredentialReport " target = " _ top " > AWS
* API Documentation < / a > */
@ Override public GenerateCredentialReportResult generateCredentialReport ( GenerateCredentialReportRequest request ) { } } | request = beforeClientExecution ( request ) ; return executeGenerateCredentialReport ( request ) ; |
public class ComputationGraph { /** * Set the mask arrays for features and labels . Mask arrays are typically used in situations such as one - to - many
* and many - to - one learning with recurrent neural networks , as well as for supporting time series of varying lengths
* within the same minibatch . < br >
* For example , with RNN data sets with input of shape [ miniBatchSize , nIn , timeSeriesLength ] and outputs of shape
* [ miniBatchSize , nOut , timeSeriesLength ] , the features and mask arrays will have shape [ miniBatchSize , timeSeriesLength ]
* and contain values 0 or 1 at each element ( to specify whether a given input / example is present - or merely padding -
* at a given time step ) . < br >
* < b > NOTE < / b > : This method is not usually used directly . Instead , the various feedForward and fit methods handle setting
* of masking internally .
* @ param featureMaskArrays Mask array for features ( input )
* @ param labelMaskArrays Mask array for labels ( output )
* @ see # clearLayerMaskArrays ( ) */
public void setLayerMaskArrays ( INDArray [ ] featureMaskArrays , INDArray [ ] labelMaskArrays ) { } } | this . clearLayerMaskArrays ( ) ; this . inputMaskArrays = featureMaskArrays ; this . labelMaskArrays = labelMaskArrays ; if ( featureMaskArrays != null ) { if ( featureMaskArrays . length != numInputArrays ) { throw new IllegalArgumentException ( "Invalid number of feature mask arrays" ) ; } long minibatchSize = - 1 ; for ( INDArray i : featureMaskArrays ) { if ( i != null ) { minibatchSize = i . size ( 0 ) ; } } // Here : need to do forward pass through the network according to the topological ordering of the network
Map < Integer , Pair < INDArray , MaskState > > map = new HashMap < > ( ) ; for ( int i = 0 ; i < topologicalOrder . length ; i ++ ) { GraphVertex current = vertices [ topologicalOrder [ i ] ] ; if ( current . isInputVertex ( ) ) { INDArray fMask = featureMaskArrays [ current . getVertexIndex ( ) ] ; map . put ( current . getVertexIndex ( ) , new Pair < > ( fMask , MaskState . Active ) ) ; } else { VertexIndices [ ] inputVertices = current . getInputVertices ( ) ; // Now : work out the mask arrays to feed forward . . .
INDArray [ ] inputMasks = null ; // new INDArray [ inputVertices . length ] ;
MaskState maskState = null ; for ( int j = 0 ; j < inputVertices . length ; j ++ ) { Pair < INDArray , MaskState > p = map . get ( inputVertices [ j ] . getVertexIndex ( ) ) ; if ( p != null ) { if ( inputMasks == null ) { inputMasks = new INDArray [ inputVertices . length ] ; } inputMasks [ j ] = p . getFirst ( ) ; if ( maskState == null || maskState == MaskState . Passthrough ) { maskState = p . getSecond ( ) ; } } } // FIXME : int cast
Pair < INDArray , MaskState > outPair = current . feedForwardMaskArrays ( inputMasks , maskState , ( int ) minibatchSize ) ; map . put ( topologicalOrder [ i ] , outPair ) ; } } } if ( labelMaskArrays != null ) { if ( labelMaskArrays . length != numOutputArrays ) { throw new IllegalArgumentException ( "Invalid number of label mask arrays" ) ; } for ( int i = 0 ; i < labelMaskArrays . length ; i ++ ) { if ( labelMaskArrays [ i ] == null ) { // This output doesn ' t have a mask , we can skip it .
continue ; } String outputName = configuration . getNetworkOutputs ( ) . get ( i ) ; GraphVertex v = verticesMap . get ( outputName ) ; Layer ol = v . getLayer ( ) ; ol . setMaskArray ( labelMaskArrays [ i ] ) ; } } |
public class TouchExplorationHelper { /** * Requests accessibility focus be placed on the specified item .
* @ param item The item to place focus on . */
public void setFocusedItem ( T item ) { } } | final int itemId = getIdForItem ( item ) ; if ( itemId == INVALID_ID ) { return ; } performAction ( itemId , AccessibilityNodeInfoCompat . ACTION_ACCESSIBILITY_FOCUS , null ) ; |
public class JavaSQLDataSourceExample { /** * $ example off : schema _ merging $ */
public static void main ( String [ ] args ) { } } | SparkSession spark = SparkSession . builder ( ) . appName ( "Java Spark SQL data sources example" ) . config ( "spark.some.config.option" , "some-value" ) . getOrCreate ( ) ; runBasicDataSourceExample ( spark ) ; runBasicParquetExample ( spark ) ; runParquetSchemaMergingExample ( spark ) ; runJsonDatasetExample ( spark ) ; runJdbcDatasetExample ( spark ) ; spark . stop ( ) ; |
public class FileUtil { /** * Create a directory . The parent directories will be created if < i > createParents < / i > is passed as true .
* @ param directory
* directory
* @ param createParents
* whether to create all parents
* @ return true if directory was created ; false if it already existed
* @ throws IOException
* if we cannot create directory */
public static boolean makeDirectory ( String directory , boolean createParents ) throws IOException { } } | boolean created = false ; File dir = new File ( directory ) ; if ( createParents ) { created = dir . mkdirs ( ) ; if ( created ) { log . debug ( "Directory created: {}" , dir . getAbsolutePath ( ) ) ; } else { log . debug ( "Directory was not created: {}" , dir . getAbsolutePath ( ) ) ; } } else { created = dir . mkdir ( ) ; if ( created ) { log . debug ( "Directory created: {}" , dir . getAbsolutePath ( ) ) ; } else { log . debug ( "Directory was not created: {}" , dir . getAbsolutePath ( ) ) ; } } dir = null ; return created ; |
public class GetOperationsForResourceRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( GetOperationsForResourceRequest getOperationsForResourceRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( getOperationsForResourceRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( getOperationsForResourceRequest . getResourceName ( ) , RESOURCENAME_BINDING ) ; protocolMarshaller . marshall ( getOperationsForResourceRequest . getPageToken ( ) , PAGETOKEN_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class SequenceAlgorithms { /** * Returns the longest common subsequence between two strings .
* @ return a list of size 2 int arrays that corresponds
* to match of index in sequence 1 to index in sequence 2. */
public static List < int [ ] > longestCommonSubsequence ( String s0 , String s1 ) { } } | int [ ] [ ] lengths = new int [ s0 . length ( ) + 1 ] [ s1 . length ( ) + 1 ] ; for ( int i = 0 ; i < s0 . length ( ) ; i ++ ) for ( int j = 0 ; j < s1 . length ( ) ; j ++ ) if ( s0 . charAt ( i ) == ( s1 . charAt ( j ) ) ) lengths [ i + 1 ] [ j + 1 ] = lengths [ i ] [ j ] + 1 ; else lengths [ i + 1 ] [ j + 1 ] = Math . max ( lengths [ i + 1 ] [ j ] , lengths [ i ] [ j + 1 ] ) ; return extractIndexes ( lengths , s0 . length ( ) , s1 . length ( ) ) ; |
public class Channel { /** * Removes the peer connection from the channel .
* This does NOT unjoin the peer from from the channel .
* Fabric does not support that at this time - - maybe some day , but not today
* @ param peer */
public void removePeer ( Peer peer ) throws InvalidArgumentException { } } | if ( shutdown ) { throw new InvalidArgumentException ( format ( "Can not remove peer from channel %s already shutdown." , name ) ) ; } logger . debug ( format ( "removePeer %s from channel %s" , peer , toString ( ) ) ) ; checkPeer ( peer ) ; removePeerInternal ( peer ) ; peer . shutdown ( true ) ; |
public class GuiceWatchableRegistrationContainer { /** * returns all the watchers associated to the type of the given id . */
@ SuppressWarnings ( "unchecked" ) private < T > List < WatcherRegistration < T > > getWatcherRegistrations ( Id < T > id ) { } } | return ( List < WatcherRegistration < T > > ) ( ( Container ) watcherRegistry ) . getAll ( id . type ( ) ) ; |
public class LazyUtil { /** * Check is current property was initialized
* @ param method - hibernate static method , which check
* is initilized property
* @ param obj - object which need for lazy check
* @ return boolean value */
private static boolean checkInitialize ( Method method , Object obj ) { } } | boolean isInitialized = true ; try { isInitialized = ( Boolean ) method . invoke ( null , new Object [ ] { obj } ) ; } catch ( IllegalArgumentException e ) { // do nothing
} catch ( IllegalAccessException e ) { // do nothing
} catch ( InvocationTargetException e ) { // do nothing
} return isInitialized ; |
public class Speed { /** * Create a new GPS { @ code Speed } object .
* @ param speed the GPS speed value
* @ param unit the speed unit
* @ return a new GPS { @ code Speed } object
* @ throws NullPointerException if the given speed { @ code unit } is
* { @ code null } */
public static Speed of ( final double speed , final Unit unit ) { } } | requireNonNull ( unit ) ; return new Speed ( Unit . METERS_PER_SECOND . convert ( speed , unit ) ) ; |
public class MediaApi { /** * Remove the attachment of the open - media interaction
* Remove the attachment of the interaction specified in the documentId path parameter
* @ param mediatype media - type of interaction to remove attachment ( required )
* @ param id id of interaction ( required )
* @ param documentId id of document to remove ( required )
* @ param removeAttachmentData ( optional )
* @ return ApiSuccessResponse
* @ throws ApiException If fail to call the API , e . g . server error or cannot deserialize the response body */
public ApiSuccessResponse removeAttachment ( String mediatype , String id , String documentId , RemoveAttachmentData removeAttachmentData ) throws ApiException { } } | ApiResponse < ApiSuccessResponse > resp = removeAttachmentWithHttpInfo ( mediatype , id , documentId , removeAttachmentData ) ; return resp . getData ( ) ; |
public class ModelImporter { /** * This method is used to ensure backwards compatible loading , type names in model info may be qualified with the model name */
private String ensureUnqualified ( String name ) { } } | if ( name . startsWith ( String . format ( "%s." , this . modelInfo . getName ( ) ) ) ) { return name . substring ( name . indexOf ( '.' ) + 1 ) ; } return name ; |
public class AmazonLightsailClient { /** * Returns a list of available database blueprints in Amazon Lightsail . A blueprint describes the major engine
* version of a database .
* You can use a blueprint ID to create a new database that runs a specific database engine .
* @ param getRelationalDatabaseBlueprintsRequest
* @ return Result of the GetRelationalDatabaseBlueprints operation returned by the service .
* @ throws ServiceException
* A general service exception .
* @ throws InvalidInputException
* Lightsail throws this exception when user input does not conform to the validation rules of an input
* field . < / p > < note >
* Domain - related APIs are only available in the N . Virginia ( us - east - 1 ) Region . Please set your AWS Region
* configuration to us - east - 1 to create , view , or edit these resources .
* @ throws NotFoundException
* Lightsail throws this exception when it cannot find a resource .
* @ throws OperationFailureException
* Lightsail throws this exception when an operation fails to execute .
* @ throws AccessDeniedException
* Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to
* access a resource .
* @ throws AccountSetupInProgressException
* Lightsail throws this exception when an account is still in the setup in progress state .
* @ throws UnauthenticatedException
* Lightsail throws this exception when the user has not been authenticated .
* @ sample AmazonLightsail . GetRelationalDatabaseBlueprints
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / lightsail - 2016-11-28 / GetRelationalDatabaseBlueprints "
* target = " _ top " > AWS API Documentation < / a > */
@ Override public GetRelationalDatabaseBlueprintsResult getRelationalDatabaseBlueprints ( GetRelationalDatabaseBlueprintsRequest request ) { } } | request = beforeClientExecution ( request ) ; return executeGetRelationalDatabaseBlueprints ( request ) ; |
public class CommerceWarehousePersistenceImpl { /** * Returns the first commerce warehouse in the ordered set where groupId = & # 63 ; and active = & # 63 ; and primary = & # 63 ; .
* @ param groupId the group ID
* @ param active the active
* @ param primary the primary
* @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > )
* @ return the first matching commerce warehouse
* @ throws NoSuchWarehouseException if a matching commerce warehouse could not be found */
@ Override public CommerceWarehouse findByG_A_P_First ( long groupId , boolean active , boolean primary , OrderByComparator < CommerceWarehouse > orderByComparator ) throws NoSuchWarehouseException { } } | CommerceWarehouse commerceWarehouse = fetchByG_A_P_First ( groupId , active , primary , orderByComparator ) ; if ( commerceWarehouse != null ) { return commerceWarehouse ; } StringBundler msg = new StringBundler ( 8 ) ; msg . append ( _NO_SUCH_ENTITY_WITH_KEY ) ; msg . append ( "groupId=" ) ; msg . append ( groupId ) ; msg . append ( ", active=" ) ; msg . append ( active ) ; msg . append ( ", primary=" ) ; msg . append ( primary ) ; msg . append ( "}" ) ; throw new NoSuchWarehouseException ( msg . toString ( ) ) ; |
public class ResourceUtil { /** * Checks the access control policies for enabled changes ( node creation and property change ) .
* @ param resource
* @ param relPath
* @ return
* @ throws RepositoryException */
public static boolean isWriteEnabled ( Resource resource , String relPath ) throws RepositoryException { } } | ResourceResolver resolver = resource . getResourceResolver ( ) ; Session session = resolver . adaptTo ( Session . class ) ; AccessControlManager accessManager = AccessControlUtil . getAccessControlManager ( session ) ; String resourcePath = resource . getPath ( ) ; Privilege [ ] addPrivileges = new Privilege [ ] { accessManager . privilegeFromName ( Privilege . JCR_ADD_CHILD_NODES ) } ; boolean result = accessManager . hasPrivileges ( resourcePath , addPrivileges ) ; if ( StringUtils . isNotBlank ( relPath ) ) { if ( ! resourcePath . endsWith ( "/" ) ) { resourcePath += "/" ; } resourcePath += relPath ; } Privilege [ ] changePrivileges = new Privilege [ ] { accessManager . privilegeFromName ( Privilege . JCR_MODIFY_PROPERTIES ) } ; try { result = result && accessManager . hasPrivileges ( resourcePath , changePrivileges ) ; } catch ( PathNotFoundException pnfex ) { // ok , let ' s create it
} return result ; |
public class ConnectivityInfoMarshaller { /** * Marshall the given parameter object . */
public void marshall ( ConnectivityInfo connectivityInfo , ProtocolMarshaller protocolMarshaller ) { } } | if ( connectivityInfo == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( connectivityInfo . getHostAddress ( ) , HOSTADDRESS_BINDING ) ; protocolMarshaller . marshall ( connectivityInfo . getId ( ) , ID_BINDING ) ; protocolMarshaller . marshall ( connectivityInfo . getMetadata ( ) , METADATA_BINDING ) ; protocolMarshaller . marshall ( connectivityInfo . getPortNumber ( ) , PORTNUMBER_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.