signature
stringlengths 43
39.1k
| implementation
stringlengths 0
450k
|
---|---|
public class ManagedComponent { /** * Emits a notification through this manageable , entering the notification into a logger along the way . */
@ Override public void emit ( Level level , String message , long sequence , Logger logger ) { } }
|
emit ( level , message , sequence ) ; logger . log ( level , message ) ;
|
public class DataProvider { /** * Monitor future completion
* @ param timer Timer that will be close on Future success or failure
* @ param listenableFuture Listenable future
* @ param userCallback User callback that will be executed on Future success
* @ param < Input > Future class type
* @ param < Output > User callback output
* @ return Listenable future */
private < Input , Output > ListenableFuture < Output > monitorFuture ( Timer timer , ListenableFuture < Input > listenableFuture , Function < Input , Output > userCallback ) { } }
|
Futures . addCallback ( listenableFuture , new FutureTimerCallback < > ( timer ) ) ; return Futures . transform ( listenableFuture , new JdkFunctionWrapper < > ( userCallback ) ) ;
|
public class InboundVirtualConnectionImpl { /** * Clean up potential state information left in this VC from any
* of the discriminators in the group which resulted in MAYBE during
* the discrimination process . */
public void cleanUpMaybeDiscriminatorState ( ) { } }
|
if ( this . dp != null ) { Discriminator d ; Iterator < Discriminator > it = this . dp . getDiscriminators ( ) . iterator ( ) ; int i = 0 ; while ( it . hasNext ( ) ) { d = it . next ( ) ; if ( Discriminator . MAYBE == this . discStatus [ i ++ ] ) { d . cleanUpState ( this ) ; } } }
|
public class Functions { /** * Converts the specified { @ link Consumer } into a { @ link Function } that returns { @ code null } . */
public static < T > Function < T , Void > voidFunction ( Consumer < T > consumer ) { } }
|
return v -> { consumer . accept ( v ) ; return null ; } ;
|
public class GammaProcess { /** * Lazy initialization of gammaIncrement . Synchronized to ensure thread safety of lazy init . */
private void doGenerateGammaIncrements ( ) { } }
|
if ( gammaIncrements != null ) { return ; // Nothing to do
} // Create random number sequence generator
MersenneTwister mersenneTwister = new MersenneTwister ( seed ) ; // Allocate memory
double [ ] [ ] [ ] gammaIncrementsArray = new double [ timeDiscretization . getNumberOfTimeSteps ( ) ] [ numberOfFactors ] [ numberOfPaths ] ; // Pre - calculate distributions
GammaDistribution [ ] gammaDistributions = new GammaDistribution [ timeDiscretization . getNumberOfTimeSteps ( ) ] ; for ( int timeIndex = 0 ; timeIndex < gammaDistributions . length ; timeIndex ++ ) { double deltaT = timeDiscretization . getTimeStep ( timeIndex ) ; gammaDistributions [ timeIndex ] = new GammaDistribution ( shape * deltaT , scale ) ; } /* * Generate gamma distributed independent increments .
* The inner loop goes over time and factors .
* MersenneTwister is known to generate " independent " increments in 623 dimensions .
* Since we want to generate independent streams ( paths ) , the loop over path is the outer loop . */
for ( int path = 0 ; path < numberOfPaths ; path ++ ) { for ( int timeIndex = 0 ; timeIndex < timeDiscretization . getNumberOfTimeSteps ( ) ; timeIndex ++ ) { GammaDistribution gammaDistribution = gammaDistributions [ timeIndex ] ; // Generate uncorrelated Gamma distributed increment
for ( int factor = 0 ; factor < numberOfFactors ; factor ++ ) { double uniformIncrement = mersenneTwister . nextDouble ( ) ; gammaIncrementsArray [ timeIndex ] [ factor ] [ path ] = gammaDistribution . inverseCumulativeDistribution ( uniformIncrement ) ; } } } // Allocate memory for RandomVariable wrapper objects .
gammaIncrements = new RandomVariableInterface [ timeDiscretization . getNumberOfTimeSteps ( ) ] [ numberOfFactors ] ; // Wrap the values in RandomVariable objects
for ( int timeIndex = 0 ; timeIndex < timeDiscretization . getNumberOfTimeSteps ( ) ; timeIndex ++ ) { double time = timeDiscretization . getTime ( timeIndex + 1 ) ; for ( int factor = 0 ; factor < numberOfFactors ; factor ++ ) { gammaIncrements [ timeIndex ] [ factor ] = randomVariableFactory . createRandomVariable ( time , gammaIncrementsArray [ timeIndex ] [ factor ] ) ; } }
|
public class DevicesInner { /** * Gets information about the availability of updates based on the last scan of the device . It also gets information about any ongoing download or install jobs on the device .
* @ param deviceName The device name .
* @ param resourceGroupName The resource group name .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the UpdateSummaryInner object */
public Observable < ServiceResponse < UpdateSummaryInner > > getUpdateSummaryWithServiceResponseAsync ( String deviceName , String resourceGroupName ) { } }
|
if ( deviceName == null ) { throw new IllegalArgumentException ( "Parameter deviceName is required and cannot be null." ) ; } if ( this . client . subscriptionId ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.subscriptionId() is required and cannot be null." ) ; } if ( resourceGroupName == null ) { throw new IllegalArgumentException ( "Parameter resourceGroupName is required and cannot be null." ) ; } if ( this . client . apiVersion ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.apiVersion() is required and cannot be null." ) ; } return service . getUpdateSummary ( deviceName , this . client . subscriptionId ( ) , resourceGroupName , this . client . apiVersion ( ) , this . client . acceptLanguage ( ) , this . client . userAgent ( ) ) . flatMap ( new Func1 < Response < ResponseBody > , Observable < ServiceResponse < UpdateSummaryInner > > > ( ) { @ Override public Observable < ServiceResponse < UpdateSummaryInner > > call ( Response < ResponseBody > response ) { try { ServiceResponse < UpdateSummaryInner > clientResponse = getUpdateSummaryDelegate ( response ) ; return Observable . just ( clientResponse ) ; } catch ( Throwable t ) { return Observable . error ( t ) ; } } } ) ;
|
public class BoxRetentionPolicy { /** * Used to create a new retention policy .
* @ param api the API connection to be used by the created user .
* @ param name the name of the retention policy .
* @ param type the type of the retention policy . Can be " finite " or " indefinite " .
* @ param length the duration in days that the retention policy will be active for after being assigned to content .
* @ param action the disposition action can be " permanently _ delete " or " remove _ retention " .
* @ return the created retention policy ' s info . */
private static BoxRetentionPolicy . Info createRetentionPolicy ( BoxAPIConnection api , String name , String type , int length , String action ) { } }
|
return createRetentionPolicy ( api , name , type , length , action , null ) ;
|
public class JcNumber { /** * < div color = ' red ' style = " font - size : 24px ; color : red " > < b > < i > < u > JCYPHER < / u > < / i > < / b > < / div >
* < div color = ' red ' style = " font - size : 18px ; color : red " > < i > return the result of subtracting two numbers , return a < b > JcNumber < / b > < / i > < / div >
* < br / > */
public JcNumber minus ( Number val ) { } }
|
JcNumber ret = new JcNumber ( val , this , OPERATOR . Number . MINUS ) ; QueryRecorder . recordInvocationConditional ( this , "minus" , ret , QueryRecorder . literal ( val ) ) ; return ret ;
|
public class DBSetup { /** * Truncate table .
* @ param callInfo Call info .
* @ param table Table . */
static void truncate ( CallInfo callInfo , Table table ) { } }
|
final DB db = table . getDB ( ) ; db . access ( callInfo , ( ) -> { String sql = "TRUNCATE TABLE " + table . getName ( ) ; table . setDirtyStatus ( true ) ; db . logSetup ( callInfo , sql ) ; try ( WrappedStatement ws = db . compile ( sql ) ) { ws . getStatement ( ) . execute ( ) ; } return 0 ; } ) ;
|
public class CmsPublishDataModel { /** * Sends a signal to all publish items in a given group . < p >
* @ param signal the signal to send
* @ param groupNum the group index */
public void signalGroup ( Signal signal , int groupNum ) { } }
|
CmsPublishGroup group = m_groups . get ( groupNum ) ; for ( CmsPublishResource res : group . getResources ( ) ) { CmsUUID id = res . getId ( ) ; m_status . get ( id ) . handleSignal ( signal ) ; } runSelectionChangeAction ( ) ;
|
public class FingerprinterTool { /** * This lists all bits set in bs2 and not in bs2 ( other way round not considered ) in a list and to logger .
* See . { @ link # differences ( java . util . BitSet , java . util . BitSet ) } for a method to list all differences ,
* including those missing present in bs2 but not bs1.
* @ param bs1 First bitset
* @ param bs2 Second bitset
* @ return An arrayList of Integers
* @ see # differences ( java . util . BitSet , java . util . BitSet ) */
public static List < Integer > listDifferences ( BitSet bs1 , BitSet bs2 ) { } }
|
List < Integer > l = new ArrayList < Integer > ( ) ; LOGGER . debug ( "Listing bit positions set in bs2 but not in bs1" ) ; for ( int f = 0 ; f < bs2 . size ( ) ; f ++ ) { if ( bs2 . get ( f ) && ! bs1 . get ( f ) ) { l . add ( f ) ; LOGGER . debug ( "Bit " + f + " not set in bs1" ) ; } } return l ;
|
public class WTableRenderer { /** * Paint the row selection aspects of the table .
* @ param table the WDataTable being rendered
* @ param xml the string builder in use */
private void paintExpansionDetails ( final WTable table , final XmlStringBuilder xml ) { } }
|
xml . appendTagOpen ( "ui:rowexpansion" ) ; switch ( table . getExpandMode ( ) ) { case CLIENT : xml . appendAttribute ( "mode" , "client" ) ; break ; case LAZY : xml . appendAttribute ( "mode" , "lazy" ) ; break ; case DYNAMIC : xml . appendAttribute ( "mode" , "dynamic" ) ; break ; case NONE : break ; default : throw new SystemException ( "Unknown expand mode: " + table . getExpandMode ( ) ) ; } xml . appendOptionalAttribute ( "expandAll" , table . isExpandAll ( ) , "true" ) ; xml . appendEnd ( ) ;
|
public class WeatherForeCastWSImpl { /** * Parser for actual conditions
* @ param feed
* @ return */
private String parseRssFeed ( String feed ) { } }
|
String [ ] result = feed . split ( "<br />" ) ; String [ ] result2 = result [ 2 ] . split ( "<BR />" ) ; return result2 [ 0 ] ;
|
public class MailBuilder { /** * Adds a CC recipient ' s address .
* @ param name the name of the CC recipient
* @ param email the address of the CC recipient
* @ return this builder */
public MailBuilder cc ( String name , String email ) { } }
|
return param ( "cc" , email ( name , email ) ) ;
|
public class Assert { /** * Asserts that the { @ link Class ' from ' class type } is assignable to the { @ link Class ' to ' class type } .
* The assertion holds if and only if the { @ link Class ' from ' class type } is the same as or a subclass
* of the { @ link Class ' to ' class type } .
* @ param from { @ link Class class type } being evaluated for assignment compatibility
* with the { @ link Class ' to ' class type } .
* @ param to { @ link Class class type } used to determine if the { @ link Class ' from ' class type }
* is assignment compatible .
* @ param message { @ link String } containing the message used in the { @ link ClassCastException } thrown
* if the assertion fails .
* @ param arguments array of { @ link Object arguments } used as placeholder values
* when formatting the { @ link String message } .
* @ throws java . lang . ClassCastException if the { @ link Class ' from ' class type } is not assignment compatible
* with the { @ link Class ' to ' class type } .
* @ see # isAssignableTo ( Class , Class , RuntimeException )
* @ see java . lang . Class # isAssignableFrom ( Class ) */
public static void isAssignableTo ( Class < ? > from , Class < ? > to , String message , Object ... arguments ) { } }
|
isAssignableTo ( from , to , new ClassCastException ( format ( message , arguments ) ) ) ;
|
public class JarFile { /** * Register a { @ literal ' java . protocol . handler . pkgs ' } property so that a
* { @ link URLStreamHandler } will be located to deal with jar URLs . */
public static void registerUrlProtocolHandler ( ) { } }
|
String handlers = System . getProperty ( PROTOCOL_HANDLER , "" ) ; System . setProperty ( PROTOCOL_HANDLER , ( "" . equals ( handlers ) ? HANDLERS_PACKAGE : handlers + "|" + HANDLERS_PACKAGE ) ) ; resetCachedUrlHandlers ( ) ;
|
public class RegExpImpl { /** * Analog of replace _ glob ( ) in jsstr . c */
private static void replace_glob ( GlobData rdata , Context cx , Scriptable scope , RegExpImpl reImpl , int leftIndex , int leftlen ) { } }
|
int replen ; String lambdaStr ; if ( rdata . lambda != null ) { // invoke lambda function with args lastMatch , $ 1 , $ 2 , . . . $ n ,
// leftContext . length , whole string .
SubString [ ] parens = reImpl . parens ; int parenCount = ( parens == null ) ? 0 : parens . length ; Object [ ] args = new Object [ parenCount + 3 ] ; args [ 0 ] = reImpl . lastMatch . toString ( ) ; for ( int i = 0 ; i < parenCount ; i ++ ) { SubString sub = parens [ i ] ; if ( sub != null ) { args [ i + 1 ] = sub . toString ( ) ; } else { args [ i + 1 ] = Undefined . instance ; } } args [ parenCount + 1 ] = Integer . valueOf ( reImpl . leftContext . length ) ; args [ parenCount + 2 ] = rdata . str ; // This is a hack to prevent expose of reImpl data to
// JS function which can run new regexps modifing
// regexp that are used later by the engine .
// TODO : redesign is necessary
if ( reImpl != ScriptRuntime . getRegExpProxy ( cx ) ) Kit . codeBug ( ) ; RegExpImpl re2 = new RegExpImpl ( ) ; re2 . multiline = reImpl . multiline ; re2 . input = reImpl . input ; ScriptRuntime . setRegExpProxy ( cx , re2 ) ; try { Scriptable parent = ScriptableObject . getTopLevelScope ( scope ) ; Object result = rdata . lambda . call ( cx , parent , parent , args ) ; lambdaStr = ScriptRuntime . toString ( result ) ; } finally { ScriptRuntime . setRegExpProxy ( cx , reImpl ) ; } replen = lambdaStr . length ( ) ; } else { lambdaStr = null ; replen = rdata . repstr . length ( ) ; if ( rdata . dollar >= 0 ) { int [ ] skip = new int [ 1 ] ; int dp = rdata . dollar ; do { SubString sub = interpretDollar ( cx , reImpl , rdata . repstr , dp , skip ) ; if ( sub != null ) { replen += sub . length - skip [ 0 ] ; dp += skip [ 0 ] ; } else { ++ dp ; } dp = rdata . repstr . indexOf ( '$' , dp ) ; } while ( dp >= 0 ) ; } } int growth = leftlen + replen + reImpl . rightContext . length ; StringBuilder charBuf = rdata . charBuf ; if ( charBuf == null ) { charBuf = new StringBuilder ( growth ) ; rdata . charBuf = charBuf ; } else { charBuf . ensureCapacity ( rdata . charBuf . length ( ) + growth ) ; } charBuf . append ( reImpl . leftContext . str , leftIndex , leftIndex + leftlen ) ; if ( rdata . lambda != null ) { charBuf . append ( lambdaStr ) ; } else { do_replace ( rdata , cx , reImpl ) ; }
|
public class JMResources { /** * Gets uri .
* @ param classpathOrFilePath the classpath or file path
* @ return the uri */
public static URI getURI ( String classpathOrFilePath ) { } }
|
return Optional . ofNullable ( getResourceURI ( classpathOrFilePath ) ) . orElseGet ( ( ) -> new File ( classpathOrFilePath ) . toURI ( ) ) ;
|
public class RowRangeAdapter { /** * To determine { @ link Range < RowKeyWrapper > } based start / end key & { @ link BoundType } . */
@ VisibleForTesting Range < RowKeyWrapper > boundedRange ( BoundType startBound , ByteString startKey , BoundType endBound , ByteString endKey ) { } }
|
// Bigtable doesn ' t allow empty row keys , so an empty start row which is open or closed is
// considered unbounded . ie . all row keys are bigger than the empty key ( no need to
// differentiate between open / closed )
final boolean startUnbounded = startKey . isEmpty ( ) ; // Bigtable doesn ' t allow empty row keys , so an empty end row which is open or closed is
// considered unbounded . ie . all row keys are smaller than the empty end key ( no need to
// differentiate between open / closed )
final boolean endUnbounded = endKey . isEmpty ( ) ; if ( startUnbounded && endUnbounded ) { return Range . all ( ) ; } else if ( startUnbounded ) { return Range . upTo ( new RowKeyWrapper ( endKey ) , endBound ) ; } else if ( endUnbounded ) { return Range . downTo ( new RowKeyWrapper ( startKey ) , startBound ) ; } else { return Range . range ( new RowKeyWrapper ( startKey ) , startBound , new RowKeyWrapper ( endKey ) , endBound ) ; }
|
public class CreatePipelineRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( CreatePipelineRequest createPipelineRequest , ProtocolMarshaller protocolMarshaller ) { } }
|
if ( createPipelineRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( createPipelineRequest . getPipeline ( ) , PIPELINE_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
|
public class FieldInfoMarshaller { /** * Marshall the given parameter object . */
public void marshall ( FieldInfo fieldInfo , ProtocolMarshaller protocolMarshaller ) { } }
|
if ( fieldInfo == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( fieldInfo . getName ( ) , NAME_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
|
public class Messenger { /** * Save message draft
* @ param peer destination peer
* @ param draft message draft */
@ ObjectiveCName ( "saveDraftWithPeer:withDraft:" ) public void saveDraft ( Peer peer , String draft ) { } }
|
modules . getMessagesModule ( ) . saveDraft ( peer , draft ) ;
|
public class ElementParametersImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ SuppressWarnings ( "unchecked" ) @ Override public void eSet ( int featureID , Object newValue ) { } }
|
switch ( featureID ) { case BpsimPackage . ELEMENT_PARAMETERS__TIME_PARAMETERS : setTimeParameters ( ( TimeParameters ) newValue ) ; return ; case BpsimPackage . ELEMENT_PARAMETERS__CONTROL_PARAMETERS : setControlParameters ( ( ControlParameters ) newValue ) ; return ; case BpsimPackage . ELEMENT_PARAMETERS__RESOURCE_PARAMETERS : setResourceParameters ( ( ResourceParameters ) newValue ) ; return ; case BpsimPackage . ELEMENT_PARAMETERS__PRIORITY_PARAMETERS : setPriorityParameters ( ( PriorityParameters ) newValue ) ; return ; case BpsimPackage . ELEMENT_PARAMETERS__COST_PARAMETERS : setCostParameters ( ( CostParameters ) newValue ) ; return ; case BpsimPackage . ELEMENT_PARAMETERS__PROPERTY_PARAMETERS : setPropertyParameters ( ( PropertyParameters ) newValue ) ; return ; case BpsimPackage . ELEMENT_PARAMETERS__VENDOR_EXTENSION : getVendorExtension ( ) . clear ( ) ; getVendorExtension ( ) . addAll ( ( Collection < ? extends VendorExtension > ) newValue ) ; return ; case BpsimPackage . ELEMENT_PARAMETERS__ELEMENT_REF : setElementRef ( ( String ) newValue ) ; return ; case BpsimPackage . ELEMENT_PARAMETERS__ID : setId ( ( String ) newValue ) ; return ; } super . eSet ( featureID , newValue ) ;
|
public class Gauge { /** * A convenient method to set the color of foreground elements like
* title , subTitle , unit , value , tickLabel and tickMark to the given
* Color .
* @ param COLOR */
public void setForegroundBaseColor ( final Color COLOR ) { } }
|
if ( null == titleColor ) { _titleColor = COLOR ; } else { titleColor . set ( COLOR ) ; } if ( null == subTitleColor ) { _subTitleColor = COLOR ; } else { subTitleColor . set ( COLOR ) ; } if ( null == unitColor ) { _unitColor = COLOR ; } else { unitColor . set ( COLOR ) ; } if ( null == valueColor ) { _valueColor = COLOR ; } else { valueColor . set ( COLOR ) ; } if ( null == tickLabelColor ) { _tickLabelColor = COLOR ; } else { tickLabelColor . set ( COLOR ) ; } if ( null == zeroColor ) { _zeroColor = COLOR ; } else { zeroColor . set ( COLOR ) ; } if ( null == tickMarkColor ) { _tickMarkColor = COLOR ; } else { tickMarkColor . set ( COLOR ) ; } if ( null == majorTickMarkColor ) { _majorTickMarkColor = COLOR ; } else { majorTickMarkColor . set ( COLOR ) ; } if ( null == mediumTickMarkColor ) { _mediumTickMarkColor = COLOR ; } else { mediumTickMarkColor . set ( COLOR ) ; } if ( null == minorTickMarkColor ) { _minorTickMarkColor = COLOR ; } else { minorTickMarkColor . set ( COLOR ) ; } fireUpdateEvent ( REDRAW_EVENT ) ;
|
public class EmbeddableTransactionImpl { /** * Called by interceptor when incoming request arrives .
* This polices the single threaded operation of the transaction . */
@ Override public synchronized void addAssociation ( ) { } }
|
final boolean traceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( traceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "addAssociation" ) ; if ( _activeAssociations > _suspendedAssociations ) { if ( traceOn && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "addAssociation received incoming request for active context" ) ; try { setRollbackOnly ( ) ; } catch ( Exception ex ) { FFDCFilter . processException ( ex , "com.ibm.ws.Transaction.JTA.TransactionImpl.addAssociation" , "1701" , this ) ; if ( traceOn && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "setRollbackOnly threw exception" , ex ) ; // swallow this exception
} if ( traceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "addAssociation throwing rolledback" ) ; throw new TRANSACTION_ROLLEDBACK ( "Context already active" ) ; } stopInactivityTimer ( ) ; _activeAssociations ++ ; if ( traceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "addAssociation" ) ;
|
public class ThroughputStatServiceImpl { /** * 用于Model对象转化为DO对象
* @ param throughputStat
* @ return throughputStatDO */
private ThroughputStatDO throughputStatModelToDo ( ThroughputStat throughputStat ) { } }
|
ThroughputStatDO throughputStatDO = new ThroughputStatDO ( ) ; throughputStatDO . setId ( throughputStat . getId ( ) ) ; throughputStatDO . setPipelineId ( throughputStat . getPipelineId ( ) ) ; throughputStatDO . setStartTime ( throughputStat . getStartTime ( ) ) ; throughputStatDO . setEndTime ( throughputStat . getEndTime ( ) ) ; throughputStatDO . setType ( throughputStat . getType ( ) ) ; throughputStatDO . setNumber ( throughputStat . getNumber ( ) ) ; throughputStatDO . setSize ( throughputStat . getSize ( ) ) ; throughputStatDO . setGmtCreate ( throughputStat . getGmtCreate ( ) ) ; throughputStatDO . setGmtModified ( throughputStat . getGmtModified ( ) ) ; return throughputStatDO ;
|
public class Main { /** * Entry point for embedded applications . This method attaches
* to the global { @ link ContextFactory } with a scope of a newly
* created { @ link Global } object . No I / O redirection is performed
* as with { @ link # main ( String [ ] ) } . */
public static Main mainEmbedded ( String title ) { } }
|
ContextFactory factory = ContextFactory . getGlobal ( ) ; Global global = new Global ( ) ; global . init ( factory ) ; return mainEmbedded ( factory , global , title ) ;
|
public class ComputationGraph { /** * Conduct forward pass using an array of inputs
* @ param input An array of ComputationGraph inputs
* @ param train If true : do forward pass at training time ; false : do forward pass at test time
* @ return A map of activations for each layer ( not each GraphVertex ) . Keys = layer name , values = layer activations */
public Map < String , INDArray > feedForward ( INDArray [ ] input , boolean train ) { } }
|
return feedForward ( input , train , true ) ;
|
public class LocaleFacet { /** * { @ inheritDoc }
* < p > Changes the Locale during the execution of the plugin . < / p > */
@ Override public void setup ( ) { } }
|
if ( log . isInfoEnabled ( ) ) { log . info ( "Setting default locale to [" + newLocale + "]" ) ; } try { Locale . setDefault ( newLocale ) ; } catch ( Exception e ) { log . error ( "Could not switch locale to [" + newLocale + "]. Continuing with standard locale." , e ) ; }
|
public class LocalDateRangeRandomizer { /** * Create a new { @ link LocalDateRangeRandomizer } .
* @ param min min value
* @ param max max value
* @ param seed initial seed
* @ return a new { @ link LocalDateRangeRandomizer } . */
public static LocalDateRangeRandomizer aNewLocalDateRangeRandomizer ( final LocalDate min , final LocalDate max , final long seed ) { } }
|
return new LocalDateRangeRandomizer ( min , max , seed ) ;
|
public class UserAuthenticationResource { /** * Create new ticket granting ticket .
* @ param requestBody username and password application / x - www - form - urlencoded values
* @ param request raw HttpServletRequest used to call this method
* @ return ResponseEntity representing RESTful response */
@ PostMapping ( value = "/v1/users" , consumes = MediaType . APPLICATION_FORM_URLENCODED_VALUE ) public ResponseEntity < String > createTicketGrantingTicket ( @ RequestBody final MultiValueMap < String , String > requestBody , final HttpServletRequest request ) { } }
|
try { val credential = this . credentialFactory . fromRequest ( request , requestBody ) ; if ( credential == null || credential . isEmpty ( ) ) { throw new BadRestRequestException ( "No credentials are provided or extracted to authenticate the REST request" ) ; } val service = this . serviceFactory . createService ( request ) ; val authenticationResult = authenticationSystemSupport . handleAndFinalizeSingleAuthenticationTransaction ( service , credential ) ; if ( authenticationResult == null ) { throw new FailedLoginException ( "Authentication failed" ) ; } return this . userAuthenticationResourceEntityResponseFactory . build ( authenticationResult , request ) ; } catch ( final AuthenticationException e ) { return RestResourceUtils . createResponseEntityForAuthnFailure ( e , request , applicationContext ) ; } catch ( final BadRestRequestException e ) { LOGGER . error ( e . getMessage ( ) , e ) ; return new ResponseEntity < > ( e . getMessage ( ) , HttpStatus . BAD_REQUEST ) ; } catch ( final Exception e ) { LOGGER . error ( e . getMessage ( ) , e ) ; return new ResponseEntity < > ( e . getMessage ( ) , HttpStatus . INTERNAL_SERVER_ERROR ) ; }
|
public class DialogPlusBuilder { /** * Get margins if provided or assign default values based on gravity
* @ param gravity the gravity of the dialog
* @ param margin the value defined in the builder
* @ param minimumMargin the minimum margin when gravity center is selected
* @ return the value of the margin */
private int getMargin ( int gravity , int margin , int minimumMargin ) { } }
|
switch ( gravity ) { case Gravity . CENTER : return ( margin == INVALID ) ? minimumMargin : margin ; default : return ( margin == INVALID ) ? 0 : margin ; }
|
public class Vfs { /** * return an iterable of all { @ link org . reflections . vfs . Vfs . File } in given urls , matching filePredicate */
public static Iterable < File > findFiles ( final Collection < URL > inUrls , final Predicate < File > filePredicate ) { } }
|
Iterable < File > result = new ArrayList < File > ( ) ; for ( final URL url : inUrls ) { try { result = Iterables . concat ( result , Iterables . filter ( new Iterable < File > ( ) { public Iterator < File > iterator ( ) { return fromURL ( url ) . getFiles ( ) . iterator ( ) ; } } , filePredicate ) ) ; } catch ( Throwable e ) { if ( Reflections . log != null ) { Reflections . log . error ( "could not findFiles for url. continuing. [" + url + "]" , e ) ; } } } return result ;
|
public class ConfigMapper { /** * Loads the given configuration file using the mapper , falling back to the given resources .
* @ param type the type to load
* @ param files the files to load
* @ param resources the resources to which to fall back
* @ param < T > the resulting type
* @ return the loaded configuration */
public < T > T loadFiles ( Class < T > type , List < File > files , List < String > resources ) { } }
|
if ( files == null ) { return loadResources ( type , resources ) ; } Config config = ConfigFactory . systemProperties ( ) ; for ( File file : files ) { config = config . withFallback ( ConfigFactory . parseFile ( file , ConfigParseOptions . defaults ( ) . setAllowMissing ( false ) ) ) ; } for ( String resource : resources ) { config = config . withFallback ( ConfigFactory . load ( classLoader , resource ) ) ; } return map ( checkNotNull ( config , "config cannot be null" ) . resolve ( ) , type ) ;
|
public class QueryLifecycle { /** * Authorize the query . Will return an Access object denoting whether the query is authorized or not .
* @ param req HTTP request object of the request . If provided , the auth - related fields in the HTTP request
* will be automatically set .
* @ return authorization result */
public Access authorize ( HttpServletRequest req ) { } }
|
transition ( State . INITIALIZED , State . AUTHORIZING ) ; return doAuthorize ( AuthorizationUtils . authenticationResultFromRequest ( req ) , AuthorizationUtils . authorizeAllResourceActions ( req , Iterables . transform ( baseQuery . getDataSource ( ) . getNames ( ) , AuthorizationUtils . DATASOURCE_READ_RA_GENERATOR ) , authorizerMapper ) ) ;
|
public class RelaxedTypeResolver { /** * Attempt to bind a given parameter type ( which may contain one or more type
* variables ) against a given ( conrete ) argument type . For example , binding
* < code > LinkedList < T > < / code > against < code > LinkedList < int > < / code > produces the
* binding < code > T = int < / code > .
* The essential challenge here is to recurse through the parameter type until a
* type variable is reached . For example , consider binding < code > { T f } < / code >
* against < code > { int f } < / code > . To extract the binding < code > T = int < / code > we
* must recurse through the fields of the record .
* @ param index
* @ param parameter
* @ param argument
* @ param arguments
* @ param binding
* @ param bindings
* @ param lifetimes */
private ConstraintSet bind ( Type parameter , SemanticType argument , ConstraintSet constraints , BinaryRelation < SemanticType > assumptions ) { } }
|
if ( assumptions . get ( parameter , argument ) ) { // Have visited this pair before , therefore nothing further to be gained .
// Furthermore , must terminate here to prevent infinite loop .
return constraints ; } else { assumptions . set ( parameter , argument , true ) ; // Recursive case . Proceed destructuring type at given index
switch ( parameter . getOpcode ( ) ) { case TYPE_null : case TYPE_bool : case TYPE_byte : case TYPE_int : // do nothing !
break ; case TYPE_variable : constraints = bind ( ( Type . Variable ) parameter , argument , constraints , assumptions ) ; break ; case TYPE_array : constraints = bind ( ( Type . Array ) parameter , argument , constraints , assumptions ) ; break ; case TYPE_record : constraints = bind ( ( Type . Record ) parameter , argument , constraints , assumptions ) ; break ; case TYPE_staticreference : case TYPE_reference : constraints = bind ( ( Type . Reference ) parameter , argument , constraints , assumptions ) ; break ; case TYPE_function : case TYPE_property : case TYPE_method : constraints = bind ( ( Type . Callable ) parameter , argument , constraints , assumptions ) ; break ; case TYPE_nominal : constraints = bind ( ( Type . Nominal ) parameter , argument , constraints , assumptions ) ; break ; case TYPE_union : constraints = bind ( ( Type . Union ) parameter , argument , constraints , assumptions ) ; break ; default : throw new IllegalArgumentException ( "Unknown type encountered: " + parameter ) ; } // Unset the assumptions from this traversal . The benefit of this is that , after
// the method has completed , everything is as it was . Therefore , we can reuse
// the relation .
assumptions . set ( parameter , argument , false ) ; return constraints ; }
|
public class ASrvDrawItemEntry { /** * < p > Withdrawal warehouse item for use / sale / loss from given source . < / p >
* @ param pAddParam additional param
* @ param pEntity drawing entity
* @ param pSource drawn entity
* @ param pQuantityToDraw quantity to draw
* @ throws Exception - an exception */
@ Override public final void withdrawalFrom ( final Map < String , Object > pAddParam , final IMakingWarehouseEntry pEntity , final IDrawItemSource pSource , final BigDecimal pQuantityToDraw ) throws Exception { } }
|
if ( ! pEntity . getIdDatabaseBirth ( ) . equals ( getSrvOrm ( ) . getIdDatabase ( ) ) ) { throw new ExceptionWithCode ( ExceptionWithCode . WRONG_PARAMETER , "can_not_make_di_entry_for_foreign_src" ) ; } T die = createDrawItemEntry ( pAddParam ) ; die . setItsDate ( pEntity . getDocumentDate ( ) ) ; die . setIdDatabaseBirth ( getSrvOrm ( ) . getIdDatabase ( ) ) ; die . setSourceType ( pSource . constTypeCode ( ) ) ; die . setSourceId ( pSource . getItsId ( ) ) ; die . setDrawingType ( pEntity . constTypeCode ( ) ) ; die . setDrawingId ( pEntity . getItsId ( ) ) ; die . setDrawingOwnerId ( pEntity . getOwnerId ( ) ) ; die . setDrawingOwnerType ( pEntity . getOwnerType ( ) ) ; die . setSourceOwnerId ( pSource . getOwnerId ( ) ) ; die . setSourceOwnerType ( pSource . getOwnerType ( ) ) ; die . setItsQuantity ( pQuantityToDraw ) ; die . setItsCost ( pSource . getItsCost ( ) ) ; die . setInvItem ( pEntity . getInvItem ( ) ) ; die . setUnitOfMeasure ( pEntity . getUnitOfMeasure ( ) ) ; die . setItsTotal ( pSource . getItsCost ( ) . multiply ( die . getItsQuantity ( ) ) . setScale ( getSrvAccSettings ( ) . lazyGetAccSettings ( pAddParam ) . getCostPrecision ( ) , getSrvAccSettings ( ) . lazyGetAccSettings ( pAddParam ) . getRoundingMode ( ) ) ) ; die . setDescription ( makeDescription ( pAddParam , pEntity , die ) ) ; this . srvOrm . insertEntity ( pAddParam , die ) ; die . setIsNew ( false ) ; pSource . setTheRest ( pSource . getTheRest ( ) . subtract ( pQuantityToDraw ) ) ; this . srvOrm . updateEntity ( pAddParam , pSource ) ;
|
public class AmazonKinesisAsyncClient { /** * Simplified method form for invoking the DescribeStream operation with an AsyncHandler .
* @ see # describeStreamAsync ( DescribeStreamRequest , com . amazonaws . handlers . AsyncHandler ) */
@ Override public java . util . concurrent . Future < DescribeStreamResult > describeStreamAsync ( String streamName , Integer limit , String exclusiveStartShardId , com . amazonaws . handlers . AsyncHandler < DescribeStreamRequest , DescribeStreamResult > asyncHandler ) { } }
|
return describeStreamAsync ( new DescribeStreamRequest ( ) . withStreamName ( streamName ) . withLimit ( limit ) . withExclusiveStartShardId ( exclusiveStartShardId ) , asyncHandler ) ;
|
public class Reflection { /** * Find the method on the target class that matches the supplied method name .
* @ param methodNamePattern the regular expression pattern for the name of the method that is to be found .
* @ return the first Method object found that has a matching name , or null if there are no methods that have a matching name . */
public Method findFirstMethod ( Pattern methodNamePattern ) { } }
|
final Method [ ] allMethods = this . targetClass . getMethods ( ) ; for ( int i = 0 ; i < allMethods . length ; i ++ ) { final Method m = allMethods [ i ] ; if ( methodNamePattern . matcher ( m . getName ( ) ) . matches ( ) ) { return m ; } } return null ;
|
public class SARLCodeMiningProvider { /** * Add an annotation when the variable ' s type is implicit and inferred by the SARL compiler .
* @ param resource the resource to parse .
* @ param acceptor the code mining acceptor . */
private void createImplicitVariableType ( XtextResource resource , IAcceptor < ? super ICodeMining > acceptor ) { } }
|
createImplicitVarValType ( resource , acceptor , XtendVariableDeclaration . class , it -> it . getType ( ) , it -> { LightweightTypeReference type = getLightweightType ( it . getRight ( ) ) ; if ( type . isAny ( ) ) { type = getTypeForVariableDeclaration ( it . getRight ( ) ) ; } return type . getSimpleName ( ) ; } , it -> it . getRight ( ) , ( ) -> this . grammar . getXVariableDeclarationAccess ( ) . getRightAssignment_3_1 ( ) ) ;
|
public class AtomTypeMapper { /** * Instantiates an atom type to atom type mapping , based on the given mapping file .
* For example , the mapping file < code > org . openscience . cdk . config . data . cdk - sybyl - mappings . owl < / code >
* which defines how CDK atom types are mapped to Sybyl atom types .
* @ param mappingFile File name of the OWL file defining the atom type to atom type mappings .
* @ return An instance of AtomTypeMapper for the given mapping file . */
public static AtomTypeMapper getInstance ( String mappingFile ) { } }
|
if ( ! mappers . containsKey ( mappingFile ) ) { mappers . put ( mappingFile , new AtomTypeMapper ( mappingFile ) ) ; } return mappers . get ( mappingFile ) ;
|
public class ProcessorConfigurationUtils { /** * Wraps an implementation of { @ link ICommentProcessor } into an object that adds some information
* required internally ( like e . g . the dialect this processor was registered for ) .
* This method is meant for < strong > internal < / strong > use only .
* @ param processor the processor to be wrapped .
* @ param dialect the dialect this processor was configured for .
* @ return the wrapped processor . */
public static ICommentProcessor wrap ( final ICommentProcessor processor , final IProcessorDialect dialect ) { } }
|
Validate . notNull ( dialect , "Dialect cannot be null" ) ; if ( processor == null ) { return null ; } return new CommentProcessorWrapper ( processor , dialect ) ;
|
public class LengthBetween { /** * Checks the preconditions for creating a new { @ link LengthBetween } processor .
* @ param min
* the minimum String length
* @ param max
* the maximum String length
* @ throws IllegalArgumentException
* { @ literal if max < min , or min is < 0} */
private static void checkPreconditions ( final int min , final int max ) { } }
|
if ( min > max ) { throw new IllegalArgumentException ( String . format ( "max (%d) should not be < min (%d)" , max , min ) ) ; } if ( min < 0 ) { throw new IllegalArgumentException ( String . format ( "min length (%d) should not be < 0" , min ) ) ; }
|
public class GetProposalLineItemsForProposal { /** * Runs the example .
* @ param adManagerServices the services factory .
* @ param session the session .
* @ param proposalId the ID of the proposal .
* @ throws ApiException if the API request failed with one or more service errors .
* @ throws RemoteException if the API request failed due to other errors . */
public static void runExample ( AdManagerServices adManagerServices , AdManagerSession session , long proposalId ) throws RemoteException { } }
|
ProposalLineItemServiceInterface proposalLineItemService = adManagerServices . get ( session , ProposalLineItemServiceInterface . class ) ; // Create a statement to select proposal line items .
StatementBuilder statementBuilder = new StatementBuilder ( ) . where ( "proposalId = :proposalId" ) . orderBy ( "id ASC" ) . limit ( StatementBuilder . SUGGESTED_PAGE_LIMIT ) . withBindVariableValue ( "proposalId" , proposalId ) ; // Retrieve a small amount of proposal line items at a time , paging through
// until all proposal line items have been retrieved .
int totalResultSetSize = 0 ; do { ProposalLineItemPage page = proposalLineItemService . getProposalLineItemsByStatement ( statementBuilder . toStatement ( ) ) ; if ( page . getResults ( ) != null ) { // Print out some information for each proposal line item .
totalResultSetSize = page . getTotalResultSetSize ( ) ; int i = page . getStartIndex ( ) ; for ( ProposalLineItem proposalLineItem : page . getResults ( ) ) { System . out . printf ( "%d) Proposal line item with ID %d and name '%s' was found.%n" , i ++ , proposalLineItem . getId ( ) , proposalLineItem . getName ( ) ) ; } } statementBuilder . increaseOffsetBy ( StatementBuilder . SUGGESTED_PAGE_LIMIT ) ; } while ( statementBuilder . getOffset ( ) < totalResultSetSize ) ; System . out . printf ( "Number of results found: %d%n" , totalResultSetSize ) ;
|
public class Template { /** * Merge this template .
* @ param out
* @ param encoding
* @ return Context
* @ throws ScriptRuntimeException
* @ throws ParseException */
public Context merge ( final OutputStream out , final String encoding ) { } }
|
return merge ( Vars . EMPTY , new OutputStreamOut ( out , InternedEncoding . intern ( encoding ) , engine ) ) ;
|
public class ProtobufVariableProvider { /** * { @ inheritDoc }
* @ param variable { @ inheritDoc }
* @ return { @ inheritDoc }
* @ throws NotAvailableException { @ inheritDoc } */
@ Override public String getValue ( String variable ) throws NotAvailableException { } }
|
String key ; for ( Map . Entry < Descriptors . FieldDescriptor , Object > fieldEntry : message . getAllFields ( ) . entrySet ( ) ) { key = StringProcessor . transformToUpperCase ( fieldEntry . getKey ( ) . getName ( ) ) ; if ( key . equals ( variable ) || ( StringProcessor . transformToUpperCase ( message . getClass ( ) . getSimpleName ( ) ) + "/" + key ) . equals ( variable ) ) { if ( ! fieldEntry . getValue ( ) . toString ( ) . isEmpty ( ) ) { return fieldEntry . getValue ( ) . toString ( ) ; } } } throw new NotAvailableException ( "Value for Variable[" + variable + "]" ) ;
|
public class Logger { /** * Delegates to { @ link org . slf4j . Logger # trace ( String ) } method in SLF4J . */
public void trace ( Object message ) { } }
|
differentiatedLog ( null , LOGGER_FQCN , LocationAwareLogger . TRACE_INT , message , null ) ;
|
public class GenericDraweeHierarchyInflater { /** * Returns the scale type indicated in XML , or null if the special ' none ' value was found .
* Important : these values need to be in sync with GenericDraweeHierarchy styleable attributes . */
@ Nullable private static ScaleType getScaleTypeFromXml ( TypedArray gdhAttrs , int attrId ) { } }
|
switch ( gdhAttrs . getInt ( attrId , - 2 ) ) { case - 1 : // none
return null ; case 0 : // fitXY
return ScaleType . FIT_XY ; case 1 : // fitStart
return ScaleType . FIT_START ; case 2 : // fitCenter
return ScaleType . FIT_CENTER ; case 3 : // fitEnd
return ScaleType . FIT_END ; case 4 : // center
return ScaleType . CENTER ; case 5 : // centerInside
return ScaleType . CENTER_INSIDE ; case 6 : // centerCrop
return ScaleType . CENTER_CROP ; case 7 : // focusCrop
return ScaleType . FOCUS_CROP ; case 8 : // fitBottomStart
return ScaleType . FIT_BOTTOM_START ; default : // this method is supposed to be called only when XML attribute is specified .
throw new RuntimeException ( "XML attribute not specified!" ) ; }
|
public class ObjectGraphBuilder { /** * Sets the current ChildPropertySetter . < br >
* It will assign DefaultChildPropertySetter if null . < br >
* It accepts a ChildPropertySetter instance or a Closure . */
public void setChildPropertySetter ( final Object childPropertySetter ) { } }
|
if ( childPropertySetter instanceof ChildPropertySetter ) { this . childPropertySetter = ( ChildPropertySetter ) childPropertySetter ; } else if ( childPropertySetter instanceof Closure ) { final ObjectGraphBuilder self = this ; this . childPropertySetter = new ChildPropertySetter ( ) { public void setChild ( Object parent , Object child , String parentName , String propertyName ) { Closure cls = ( Closure ) childPropertySetter ; cls . setDelegate ( self ) ; cls . call ( parent , child , parentName , propertyName ) ; } } ; } else { this . childPropertySetter = new DefaultChildPropertySetter ( ) ; }
|
public class SimpleFormatterImpl { /** * Formats the given values , appending to the appendTo builder .
* @ param compiledPattern Compiled form of a pattern string .
* @ param appendTo Gets the formatted pattern and values appended .
* @ param offsets offsets [ i ] receives the offset of where
* values [ i ] replaced pattern argument { i } .
* Can be null , or can be shorter or longer than values .
* If there is no { i } in the pattern , then offsets [ i ] is set to - 1.
* @ param values The argument values .
* An argument value must not be the same object as appendTo .
* values . length must be at least getArgumentLimit ( ) .
* Can be null if getArgumentLimit ( ) = = 0.
* @ return appendTo */
public static StringBuilder formatAndAppend ( String compiledPattern , StringBuilder appendTo , int [ ] offsets , CharSequence ... values ) { } }
|
int valuesLength = values != null ? values . length : 0 ; if ( valuesLength < getArgumentLimit ( compiledPattern ) ) { throw new IllegalArgumentException ( "Too few values." ) ; } return format ( compiledPattern , values , appendTo , null , true , offsets ) ;
|
public class ClassLister { /** * Returns all the packages that were found for this superclass .
* @ param superclassthe superclass to return the packages for
* @ returnthe packages */
public String [ ] getPackages ( String superclass ) { } }
|
String packages ; packages = m_Packages . getProperty ( superclass ) ; if ( ( packages == null ) || ( packages . length ( ) == 0 ) ) return new String [ 0 ] ; else return packages . split ( "," ) ;
|
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public EClass getIfcTextStyle ( ) { } }
|
if ( ifcTextStyleEClass == null ) { ifcTextStyleEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 713 ) ; } return ifcTextStyleEClass ;
|
public class ApiOvhOrder { /** * Create order
* REST : POST / order / overTheBox / { serviceName } / migrate
* @ param offer [ required ] Offer name to migrate to
* @ param shippingContactID [ required ] Contact ID to deliver to
* @ param shippingRelayID [ required ] Relay ID to deliver to . Needed if shipping is mondialRelay
* @ param shippingMethod [ required ] How do you want your shipment shipped
* @ param hardware [ required ] If you want to migrate with a new hardware
* @ param serviceName [ required ] The internal name of your overTheBox offer
* API beta */
public OvhOrder overTheBox_serviceName_migrate_POST ( String serviceName , Boolean hardware , String offer , String shippingContactID , OvhShippingMethodEnum shippingMethod , Long shippingRelayID ) throws IOException { } }
|
String qPath = "/order/overTheBox/{serviceName}/migrate" ; StringBuilder sb = path ( qPath , serviceName ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "hardware" , hardware ) ; addBody ( o , "offer" , offer ) ; addBody ( o , "shippingContactID" , shippingContactID ) ; addBody ( o , "shippingMethod" , shippingMethod ) ; addBody ( o , "shippingRelayID" , shippingRelayID ) ; String resp = exec ( qPath , "POST" , sb . toString ( ) , o ) ; return convertTo ( resp , OvhOrder . class ) ;
|
public class MediaChannel { /** * Binds the RTCP component to a suitable address and port .
* @ param isLocal
* Whether the binding address must be in local range .
* @ param port
* A specific port to bind to
* @ throws IOException
* When the RTCP component cannot be bound to an address .
* @ throws IllegalStateException
* The binding operation is not allowed if ICE is active */
public void bindRtcp ( boolean isLocal , int port ) throws IOException , IllegalStateException { } }
|
if ( this . ice ) { throw new IllegalStateException ( "Cannot bind when ICE is enabled" ) ; } this . rtcpChannel . bind ( isLocal , port ) ; this . rtcpMux = ( port == this . rtpChannel . getLocalPort ( ) ) ;
|
public class JettySetting { /** * 读取resourceBase
* @ return resourceBase */
private static String getResourceBase ( ) { } }
|
String resourceBase = setting . getStr ( "webRoot" ) ; if ( StrUtil . isEmpty ( resourceBase ) ) { resourceBase = "./src/main/webapp" ; // 用于Maven测试
File file = new File ( resourceBase ) ; if ( false == file . exists ( ) || false == file . isDirectory ( ) ) { resourceBase = "." ; } } log . debug ( "Jetty resource base: [{}]" , resourceBase ) ; return resourceBase ; // 当前目录 , 用于部署环境
|
public class TypeResolver { /** * Factory method for resolving specified Java { @ link java . lang . reflect . Type } , given
* { @ link TypeBindings } needed to resolve any type variables .
* Use of this method is discouraged ( use if and only if you really know what you
* are doing ! ) ; but if used , type bindings passed should come from { @ link ResolvedType }
* instance of declaring class ( or interface ) . */
public ResolvedType resolve ( TypeBindings typeBindings , Type jdkType ) { } }
|
return _fromAny ( null , jdkType , typeBindings ) ;
|
public class CmsJspContentAccessValueWrapper { /** * Returns a lazy initialized Map that provides the Lists of nested sub values
* for the current value from the XML content . < p >
* The provided Map key is assumed to be a String that represents the relative xpath to the value .
* Use this method in case you want to iterate over a List of values form the XML content . < p >
* In case the current value is not a nested XML content value , or the XML content value does not exist ,
* the { @ link CmsConstantMap # CONSTANT _ EMPTY _ LIST _ MAP } is returned . < p >
* Usage example on a JSP with the JSTL : < pre >
* & lt ; cms : contentload . . . & gt ;
* & lt ; cms : contentaccess var = " content " / & gt ;
* & lt ; c : forEach var = " desc " items = " $ { content . value [ ' Link ' ] . valueList [ ' Description ' ] } " & gt ;
* $ { desc }
* & lt ; / c : forEach & gt ;
* & lt ; / cms : contentload & gt ; < / pre >
* @ return a lazy initialized Map that provides a Lists of sub values for the current value from the XML content */
public Map < String , List < CmsJspContentAccessValueWrapper > > getValueList ( ) { } }
|
if ( m_valueList == null ) { m_valueList = CmsCollectionsGenericWrapper . createLazyMap ( new CmsValueListTransformer ( ) ) ; } return m_valueList ;
|
public class ModuleFields { /** * Returns a list of output ports defined by the module .
* @ return A list of output ports defined by the module . */
public List < String > getOutPorts ( ) { } }
|
List < String > ports = new ArrayList < > ( ) ; JsonObject jsonPorts = config . getObject ( "ports" ) ; if ( jsonPorts == null ) { return ports ; } JsonArray jsonOutPorts = jsonPorts . getArray ( "out" ) ; if ( jsonOutPorts == null ) { return ports ; } for ( Object jsonOutPort : jsonOutPorts ) { ports . add ( ( String ) jsonOutPort ) ; } return ports ;
|
public class AnnotatedTypeBuilder { /** * Remove an annotation from the specified method .
* @ param method the method to remove the annotation from
* @ param annotationType the annotation type to remove
* @ throws IllegalArgumentException if the annotationType is null or if the
* method is not currently declared on the type */
public AnnotatedTypeBuilder < X > removeFromMethod ( Method method , Class < ? extends Annotation > annotationType ) { } }
|
if ( methods . get ( method ) == null ) { throw new IllegalArgumentException ( "Method not present " + method . toString ( ) + " on " + javaClass ) ; } else { methods . get ( method ) . remove ( annotationType ) ; } return this ;
|
public class BulkMutation { /** * Adds a { @ link com . google . bigtable . v2 . MutateRowsRequest . Entry } to the { @ link
* com . google . bigtable . v2 . MutateRowsRequest . Builder } .
* @ param entry The { @ link com . google . bigtable . v2 . MutateRowsRequest . Entry } to add
* @ return a { @ link com . google . common . util . concurrent . SettableFuture } that will be populated when
* the { @ link MutateRowsResponse } returns from the server . See { @ link
* BulkMutation . Batch # addCallback ( ListenableFuture ) } for more information about how the
* SettableFuture is set . */
public synchronized ListenableFuture < MutateRowResponse > add ( MutateRowsRequest . Entry entry ) { } }
|
Preconditions . checkNotNull ( entry , "Entry is null" ) ; Preconditions . checkArgument ( ! entry . getRowKey ( ) . isEmpty ( ) , "Request has an empty rowkey" ) ; if ( entry . getMutationsCount ( ) >= MAX_NUMBER_OF_MUTATIONS ) { // entry . getRowKey ( ) . toStringUtf8 ( ) can be expensive , so don ' t add it in a standard
// Precondition . checkArgument ( ) which will always run it .
throw new IllegalArgumentException ( String . format ( "Key %s has %d mutations, which is over the %d maximum." , entry . getRowKey ( ) . toStringUtf8 ( ) , entry . getMutationsCount ( ) , MAX_NUMBER_OF_MUTATIONS ) ) ; } ; boolean didSend = false ; if ( currentBatch != null && currentBatch . wouldBeFull ( entry ) ) { sendUnsent ( ) ; if ( scheduledFlush != null ) { scheduledFlush . cancel ( true ) ; scheduledFlush = null ; } didSend = true ; } if ( currentBatch == null ) { batchMeter . mark ( ) ; currentBatch = new Batch ( ) ; } ListenableFuture < MutateRowResponse > future = currentBatch . add ( entry ) ; if ( ! didSend ) { // TODO ( sduskis ) : enable flush by default .
// If autoflushing is enabled and there is pending data then schedule a flush if one hasn ' t been scheduled
// NOTE : this is optimized for adding minimal overhead to per item adds , at the expense of periodic partial batches
if ( this . autoflushMs > 0 && currentBatch != null && scheduledFlush == null ) { scheduledFlush = retryExecutorService . schedule ( new Runnable ( ) { @ Override public void run ( ) { synchronized ( BulkMutation . this ) { scheduledFlush = null ; sendUnsent ( ) ; } } } , autoflushMs , TimeUnit . MILLISECONDS ) ; } } return future ;
|
public class AbstractCoupons { /** * Called by DirectCouponHashSet . growHashSet ( ) */
static final int find ( final int [ ] array , final int lgArrInts , final int coupon ) { } }
|
final int arrMask = array . length - 1 ; int probe = coupon & arrMask ; final int loopIndex = probe ; do { final int couponAtIdx = array [ probe ] ; if ( couponAtIdx == EMPTY ) { return ~ probe ; // empty
} else if ( coupon == couponAtIdx ) { return probe ; // duplicate
} final int stride = ( ( coupon & KEY_MASK_26 ) >>> lgArrInts ) | 1 ; probe = ( probe + stride ) & arrMask ; } while ( probe != loopIndex ) ; throw new SketchesArgumentException ( "Key not found and no empty slots!" ) ;
|
public class CmsSynchronizeSettings { /** * Optimizes the list of VFS source files by removing all resources that
* have a parent resource already included in the list . < p >
* @ param sourceListInVfs the list of VFS resources to optimize
* @ return the optimized result list */
protected List < String > optimizeSourceList ( List < String > sourceListInVfs ) { } }
|
// input should be sorted but may be immutable
List < String > input = new ArrayList < String > ( sourceListInVfs ) ; Collections . sort ( input ) ; List < String > result = new ArrayList < String > ( ) ; Iterator < String > i = input . iterator ( ) ; while ( i . hasNext ( ) ) { // check all sources in the list
String sourceInVfs = i . next ( ) ; if ( CmsStringUtil . isEmpty ( sourceInVfs ) ) { // skip empty strings
continue ; } boolean found = false ; for ( int j = ( result . size ( ) - 1 ) ; j >= 0 ; j -- ) { // check if this source is indirectly contained because a parent folder is contained
String check = result . get ( j ) ; if ( sourceInVfs . startsWith ( check ) ) { found = true ; break ; } } if ( ! found ) { // the source is not already contained in the result
result . add ( sourceInVfs ) ; } } return result ;
|
public class JBasePopupPanel { /** * Add all the components in this panel .
* @ param applet */
public void addComponents ( BaseApplet applet ) { } }
|
this . setLayout ( new BoxLayout ( this , BoxLayout . Y_AXIS ) ) ; String strTitle = "Add component:" ; try { strTitle = applet . getApplication ( ) . getResources ( null , true ) . getString ( strTitle ) ; } catch ( MissingResourceException e ) { // Ignore
} this . add ( new JLabel ( strTitle ) ) ; // + this . add ( this . createComponentButton ( ProductConstants . TOUR , applet ) ) ;
this . setBackground ( new Color ( 255 , 255 , 224 ) ) ;
|
public class AsmInvokeDistributeFactory { /** * 为类构建默认构造器 ( 正常编译器会自动生成 , 但是此处要手动生成bytecode就只能手动生成无参构造器了
* @ param cw ClassWriter
* @ param parentClass 构建类的父类 , 会自动调用父类的构造器
* @ param className 生成的新类名 */
private static void generateDefaultConstructor ( ClassWriter cw , Class < ? > parentClass , String className ) { } }
|
MethodVisitor mv = cw . visitMethod ( ACC_PUBLIC , // public method
INIT , // method name
getDesc ( void . class , parentClass ) , // descriptor
null , // signature ( null means not generic )
null ) ; // exceptions ( array of strings )
mv . visitCode ( ) ; // Start the code for this method
// 调用父类构造器
mv . visitVarInsn ( ALOAD , 0 ) ; // Load " this " onto the stack
mv . visitMethodInsn ( INVOKESPECIAL , // Invoke an instance method ( non - virtual )
convert ( parentClass ) , // Class on which the method is defined
INIT , // Name of the method
getDesc ( void . class ) , // Descriptor
false ) ; // Is this class an interface ?
// 设置字段值 , 相当于this . target = target ;
mv . visitVarInsn ( ALOAD , 0 ) ; // 加载this
mv . visitVarInsn ( ALOAD , 1 ) ; // 加载参数
mv . visitFieldInsn ( PUTFIELD , convert ( className ) , TARGET_FIELD_NAME , getByteCodeType ( parentClass ) ) ; mv . visitMaxs ( 2 , 1 ) ; mv . visitInsn ( RETURN ) ; // End the constructor method
mv . visitEnd ( ) ;
|
public class TrafficRoute { /** * The ARN of one listener . The listener identifies the route between a target group and a load balancer . This is an
* array of strings with a maximum size of one .
* @ param listenerArns
* The ARN of one listener . The listener identifies the route between a target group and a load balancer .
* This is an array of strings with a maximum size of one . */
public void setListenerArns ( java . util . Collection < String > listenerArns ) { } }
|
if ( listenerArns == null ) { this . listenerArns = null ; return ; } this . listenerArns = new com . amazonaws . internal . SdkInternalList < String > ( listenerArns ) ;
|
public class ReadWriteTypeExtractor { /** * Provides a simplistic form of type union which , in some cases , does slightly
* better than simply creating a new union . For example , unioning
* < code > int < / code > with < code > int < / code > will return < code > int < / code > rather
* than < code > int | int < / code > .
* @ param lhs
* @ param rhs
* @ return */
@ SuppressWarnings ( "unchecked" ) protected static < T extends SemanticType > T unionHelper ( T lhs , T rhs ) { } }
|
if ( lhs . equals ( rhs ) ) { return lhs ; } else if ( lhs instanceof Type . Void ) { return rhs ; } else if ( rhs instanceof Type . Void ) { return lhs ; } else if ( lhs instanceof Type && rhs instanceof Type ) { return ( T ) new Type . Union ( new Type [ ] { ( Type ) lhs , ( Type ) rhs } ) ; } else { return ( T ) new SemanticType . Union ( new SemanticType [ ] { lhs , rhs } ) ; }
|
public class ImgUtil { /** * 旋转图片为指定角度 < br >
* 此方法不会关闭输出流 , 输出格式为JPG
* @ param image 目标图像
* @ param degree 旋转角度
* @ param out 输出图像流
* @ since 3.2.2
* @ throws IORuntimeException IO异常 */
public static void rotate ( Image image , int degree , ImageOutputStream out ) throws IORuntimeException { } }
|
writeJpg ( rotate ( image , degree ) , out ) ;
|
public class AtomicShortIntArray { /** * Sets the array equal to the given array . The array should be the same length as this array
* @ param initial the array containing the new values */
public void set ( int [ ] initial ) { } }
|
resizeLock . lock ( ) ; try { if ( initial . length != length ) { throw new IllegalArgumentException ( "Array length mismatch, expected " + length + ", got " + initial . length ) ; } int unique = AtomicShortIntArray . getUnique ( initial ) ; int allowedPalette = AtomicShortIntPaletteBackingArray . getAllowedPalette ( length ) ; if ( unique == 1 ) { store . set ( new AtomicShortIntUniformBackingArray ( length , initial [ 0 ] ) ) ; } else if ( unique > allowedPalette ) { store . set ( new AtomicShortIntDirectBackingArray ( length , initial ) ) ; } else { store . set ( new AtomicShortIntPaletteBackingArray ( length , unique , initial ) ) ; } } finally { resizeLock . unlock ( ) ; }
|
public class InMemoryThreadPoolBulkheadRegistry { /** * { @ inheritDoc } */
@ Override public ThreadPoolBulkhead bulkhead ( String name , Supplier < ThreadPoolBulkheadConfig > bulkheadConfigSupplier ) { } }
|
return computeIfAbsent ( name , ( ) -> ThreadPoolBulkhead . of ( name , Objects . requireNonNull ( Objects . requireNonNull ( bulkheadConfigSupplier , SUPPLIER_MUST_NOT_BE_NULL ) . get ( ) , CONFIG_MUST_NOT_BE_NULL ) ) ) ;
|
public class CmsParameterConfiguration { /** * Counts the number of successive times ' ch ' appears in the
* ' line ' before the position indicated by the ' index ' . < p >
* @ param line the line to count
* @ param index the index position to start
* @ param ch the character to count
* @ return the number of successive times ' ch ' appears in the ' line '
* before the position indicated by the ' index ' */
protected static int countPreceding ( String line , int index , char ch ) { } }
|
int i ; for ( i = index - 1 ; i >= 0 ; i -- ) { if ( line . charAt ( i ) != ch ) { break ; } } return index - 1 - i ;
|
public class Matrix { /** * Removes one row from matrix .
* @ param i the row index
* @ return matrix without row . */
public Matrix removeRow ( int i ) { } }
|
if ( i >= rows || i < 0 ) { throw new IndexOutOfBoundsException ( "Illegal row number, must be 0.." + ( rows - 1 ) ) ; } Matrix result = blankOfShape ( rows - 1 , columns ) ; for ( int ii = 0 ; ii < i ; ii ++ ) { result . setRow ( ii , getRow ( ii ) ) ; } for ( int ii = i + 1 ; ii < rows ; ii ++ ) { result . setRow ( ii - 1 , getRow ( ii ) ) ; } return result ;
|
public class Vector3f { /** * Divide this Vector3f component - wise by another Vector3fc .
* @ param v
* the vector to divide by
* @ return a vector holding the result */
public Vector3f div ( Vector3fc v ) { } }
|
return div ( v . x ( ) , v . y ( ) , v . z ( ) , thisOrNew ( ) ) ;
|
public class ClosestPointPathShadow3afp { /** * Compute the crossings between this shadow and
* the given segment .
* @ param crossings is the initial value of the crossings .
* @ param x0 is the first point of the segment .
* @ param y0 is the first point of the segment .
* @ param z0 is the first point of the segment .
* @ param x1 is the second point of the segment .
* @ param y1 is the second point of the segment .
* @ param z1 is the second point of the segment .
* @ return the crossings or { @ link MathConstants # SHAPE _ INTERSECTS } . */
@ SuppressWarnings ( "checkstyle:npathcomplexity" ) public int computeCrossings ( int crossings , double x0 , double y0 , double z0 , double x1 , double y1 , double z1 ) { } }
|
// The segment is intersecting the bounds of the shadow path .
// We must consider the shape of shadow path now .
this . x4ymin = this . boundingMinX ; this . x4ymax = this . boundingMinX ; this . crossings = 0 ; this . hasX4ymin = false ; this . hasX4ymax = false ; final PathIterator3afp < ? > iterator ; if ( this . started ) { iterator = this . pathIterator . restartIterations ( ) ; } else { this . started = true ; iterator = this . pathIterator ; } discretizePathIterator ( iterator , x0 , y0 , z0 , x1 , y1 , z1 ) ; // Test if the shape is intesecting the shadow shape .
if ( this . crossings == GeomConstants . SHAPE_INTERSECTS ) { // The given line is intersecting the path shape
return GeomConstants . SHAPE_INTERSECTS ; } // There is no intersection with the shadow path ' s shape .
// Compute the crossings with the minimum / maximum y borders .
int inc = 0 ; if ( this . hasX4ymin ) { ++ inc ; } if ( this . hasX4ymax ) { ++ inc ; } final int numCrosses ; if ( y0 < y1 ) { numCrosses = inc ; } else { numCrosses = - inc ; } // Apply the previously computed crossings
return crossings + numCrosses ;
|
public class CmsOUHandler { /** * Get base ou for given manageable ous . < p >
* @ return Base ou ( may be outside of given ou ) */
public String getBaseOU ( ) { } }
|
if ( m_isRootAccountManager ) { return "" ; } if ( m_managableOU . contains ( "" ) ) { return "" ; } String base = m_managableOU . get ( 0 ) ; for ( String ou : m_managableOU ) { while ( ! ou . startsWith ( base ) ) { base = base . substring ( 0 , base . length ( ) - 1 ) ; if ( base . lastIndexOf ( "/" ) > - 1 ) { base = base . substring ( 0 , base . lastIndexOf ( "/" ) ) ; } else { return "" ; } } } return base ;
|
public class nsaptlicense { /** * Use this API to change nsaptlicense resources . */
public static base_responses change ( nitro_service client , nsaptlicense resources [ ] ) throws Exception { } }
|
base_responses result = null ; if ( resources != null && resources . length > 0 ) { nsaptlicense updateresources [ ] = new nsaptlicense [ resources . length ] ; for ( int i = 0 ; i < resources . length ; i ++ ) { updateresources [ i ] = new nsaptlicense ( ) ; updateresources [ i ] . id = resources [ i ] . id ; updateresources [ i ] . sessionid = resources [ i ] . sessionid ; updateresources [ i ] . bindtype = resources [ i ] . bindtype ; updateresources [ i ] . countavailable = resources [ i ] . countavailable ; updateresources [ i ] . licensedir = resources [ i ] . licensedir ; } result = perform_operation_bulk_request ( client , updateresources , "update" ) ; } return result ;
|
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link AbstractGriddedSurfaceType } { @ code > }
* @ param value
* Java instance representing xml element ' s value .
* @ return
* the new instance of { @ link JAXBElement } { @ code < } { @ link AbstractGriddedSurfaceType } { @ code > } */
@ XmlElementDecl ( namespace = "http://www.opengis.net/gml" , name = "_GriddedSurface" , substitutionHeadNamespace = "http://www.opengis.net/gml" , substitutionHeadName = "_ParametricCurveSurface" ) public JAXBElement < AbstractGriddedSurfaceType > create_GriddedSurface ( AbstractGriddedSurfaceType value ) { } }
|
return new JAXBElement < AbstractGriddedSurfaceType > ( __GriddedSurface_QNAME , AbstractGriddedSurfaceType . class , null , value ) ;
|
public class Hexs { /** * Returns a hexadecimal string representation of { @ code length } bytes of { @ code bytes }
* starting at offset { @ code offset } .
* @ param bytes a bytes to convert
* @ param offset start offset in the bytes
* @ param length maximum number of bytes to use
* @ return a hexadecimal string representation of each bytes of { @ code bytes } */
public String fromByteArray ( byte [ ] bytes , int offset , int length ) { } }
|
java . util . Objects . requireNonNull ( bytes , "bytes" ) ; Objects . validArgument ( offset >= 0 , "offset must be equal or greater than zero" ) ; Objects . validArgument ( length > 0 , "length must be greater than zero" ) ; Objects . validArgument ( offset + length <= bytes . length , "(offset + length) must be less than %s" , bytes . length ) ; if ( byteSeparator != null && byteSeparator . length ( ) > 0 ) { return fromByteArrayInternal ( bytes , offset , length , byteSeparator ) ; } else { return fromByteArrayInternal ( bytes , offset , length ) ; }
|
public class BceHttpClient { /** * Create connection manager for asynchronous http client .
* @ return Connection manager for asynchronous http client .
* @ throws IOReactorException in case if a non - recoverable I / O error . */
protected NHttpClientConnectionManager createNHttpClientConnectionManager ( ) throws IOReactorException { } }
|
ConnectingIOReactor ioReactor = new DefaultConnectingIOReactor ( IOReactorConfig . custom ( ) . setSoTimeout ( this . config . getSocketTimeoutInMillis ( ) ) . setTcpNoDelay ( true ) . build ( ) ) ; PoolingNHttpClientConnectionManager connectionManager = new PoolingNHttpClientConnectionManager ( ioReactor ) ; connectionManager . setDefaultMaxPerRoute ( this . config . getMaxConnections ( ) ) ; connectionManager . setMaxTotal ( this . config . getMaxConnections ( ) ) ; return connectionManager ;
|
public class DHistogram { /** * Interpolate d to find bin # */
public int bin ( double col_data ) { } }
|
if ( Double . isNaN ( col_data ) ) return _nbin ; // NA bucket
if ( Double . isInfinite ( col_data ) ) // Put infinity to most left / right bin
if ( col_data < 0 ) return 0 ; else return _nbin - 1 ; assert _min <= col_data && col_data < _maxEx : "Coldata " + col_data + " out of range " + this ; // When the model is exposed to new test data , we could have data that is
// out of range of any bin - however this binning call only happens during
// model - building .
int idx1 ; double pos = _hasQuantiles ? col_data : ( ( col_data - _min ) * _step ) ; if ( _splitPts != null ) { idx1 = Arrays . binarySearch ( _splitPts , pos ) ; if ( idx1 < 0 ) idx1 = - idx1 - 2 ; } else { idx1 = ( int ) pos ; } if ( idx1 == _nbin ) idx1 -- ; // Roundoff error allows idx1 to hit upper bound , so truncate
assert 0 <= idx1 && idx1 < _nbin : idx1 + " " + _nbin ; return idx1 ;
|
public class GeometryExpression { /** * Returns the name of the instantiable subtype of Geometry of which this
* geometric object is an instantiable member . The name of the subtype of Geometry is returned as a string .
* @ return geometry type */
public StringExpression geometryType ( ) { } }
|
if ( geometryType == null ) { geometryType = Expressions . stringOperation ( SpatialOps . GEOMETRY_TYPE , mixin ) ; } return geometryType ;
|
public class JDBCStorageConnection { /** * Load NodeData record .
* @ param parentPath
* parent path
* @ param cname
* Node name
* @ param cid
* Node id
* @ param cpid
* Node parent id
* @ param cindex
* Node index
* @ param cversion
* Node persistent version
* @ param cnordernumb
* Node order number
* @ param parentACL
* Node parent ACL
* @ return PersistedNodeData
* @ throws RepositoryException
* Repository error
* @ throws SQLException
* database error */
protected PersistedNodeData loadNodeRecord ( QPath parentPath , String cname , String cid , String cpid , int cindex , int cversion , int cnordernumb , AccessControlList parentACL ) throws RepositoryException , SQLException { } }
|
try { InternalQName qname = InternalQName . parse ( cname ) ; QPath qpath ; String parentCid ; if ( parentPath != null ) { // get by parent and name
qpath = QPath . makeChildPath ( parentPath , qname , cindex , getIdentifier ( cid ) ) ; parentCid = cpid ; } else { // get by id
if ( cpid . equals ( Constants . ROOT_PARENT_UUID ) ) { // root node
qpath = Constants . ROOT_PATH ; parentCid = null ; } else { qpath = QPath . makeChildPath ( traverseQPath ( cpid ) , qname , cindex , getIdentifier ( cid ) ) ; parentCid = cpid ; } } // PRIMARY
ResultSet ptProp = findPropertyByName ( cid , Constants . JCR_PRIMARYTYPE . getAsString ( ) ) ; try { if ( ! ptProp . next ( ) ) { throw new PrimaryTypeNotFoundException ( "FATAL ERROR primary type record not found. Node " + qpath . getAsString ( ) + ", id " + getIdentifier ( cid ) + ", container " + this . containerConfig . containerName , null ) ; } byte [ ] data = ptProp . getBytes ( COLUMN_VDATA ) ; InternalQName ptName = InternalQName . parse ( new String ( ( data != null ? data : new byte [ ] { } ) ) ) ; // MIXIN
MixinInfo mixins = readMixins ( cid ) ; // ACL
AccessControlList acl ; // NO DEFAULT values !
if ( mixins . hasOwneable ( ) ) { // has own owner
if ( mixins . hasPrivilegeable ( ) ) { // and permissions
acl = new AccessControlList ( readACLOwner ( cid ) , readACLPermisions ( cid ) ) ; } else if ( parentACL != null ) { // use permissions from existed parent
acl = new AccessControlList ( readACLOwner ( cid ) , parentACL . hasPermissions ( ) ? parentACL . getPermissionEntries ( ) : null ) ; } else { // have to search nearest ancestor permissions in ACL manager
// acl = new AccessControlList ( readACLOwner ( cid ) , traverseACLPermissions ( cpid ) ) ;
acl = new AccessControlList ( readACLOwner ( cid ) , null ) ; } } else if ( mixins . hasPrivilegeable ( ) ) { // has own permissions
if ( mixins . hasOwneable ( ) ) { // and owner
acl = new AccessControlList ( readACLOwner ( cid ) , readACLPermisions ( cid ) ) ; } else if ( parentACL != null ) { // use owner from existed parent
acl = new AccessControlList ( parentACL . getOwner ( ) , readACLPermisions ( cid ) ) ; } else { // have to search nearest ancestor owner in ACL manager
// acl = new AccessControlList ( traverseACLOwner ( cpid ) , readACLPermisions ( cid ) ) ;
acl = new AccessControlList ( null , readACLPermisions ( cid ) ) ; } } else { if ( parentACL != null ) { // construct ACL from existed parent ACL
acl = new AccessControlList ( parentACL . getOwner ( ) , parentACL . hasPermissions ( ) ? parentACL . getPermissionEntries ( ) : null ) ; } else { // have to search nearest ancestor owner and permissions in ACL manager
// acl = traverseACL ( cpid ) ;
acl = null ; } } return new PersistedNodeData ( getIdentifier ( cid ) , qpath , getIdentifier ( parentCid ) , cversion , cnordernumb , ptName , mixins . mixinNames ( ) , acl ) ; } catch ( IllegalACLException e ) { throw new RepositoryException ( "FATAL ERROR Node " + getIdentifier ( cid ) + " " + qpath . getAsString ( ) + " has wrong formed ACL. " , e ) ; } finally { try { ptProp . close ( ) ; } catch ( SQLException e ) { LOG . error ( "Can't close the ResultSet: " + e . getMessage ( ) ) ; } } } catch ( IllegalNameException e ) { throw new RepositoryException ( e ) ; }
|
public class AWSGreengrassClient { /** * Retrieves the service role that is attached to your account .
* @ param getServiceRoleForAccountRequest
* @ return Result of the GetServiceRoleForAccount operation returned by the service .
* @ throws InternalServerErrorException
* server error
* @ sample AWSGreengrass . GetServiceRoleForAccount
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / greengrass - 2017-06-07 / GetServiceRoleForAccount "
* target = " _ top " > AWS API Documentation < / a > */
@ Override public GetServiceRoleForAccountResult getServiceRoleForAccount ( GetServiceRoleForAccountRequest request ) { } }
|
request = beforeClientExecution ( request ) ; return executeGetServiceRoleForAccount ( request ) ;
|
public class Container { /** * Start the server .
* Generate LifeCycleEvents for starting and started either side of a call to doStart */
public synchronized final void start ( ) throws Exception { } }
|
if ( _started || _starting ) return ; _starting = true ; if ( log . isDebugEnabled ( ) ) log . debug ( "Starting " + this ) ; LifeCycleEvent event = new LifeCycleEvent ( this ) ; for ( int i = 0 ; i < LazyList . size ( _eventListeners ) ; i ++ ) { EventListener listener = ( EventListener ) LazyList . get ( _eventListeners , i ) ; if ( listener instanceof LifeCycleListener ) ( ( LifeCycleListener ) listener ) . lifeCycleStarting ( event ) ; } try { doStart ( ) ; _started = true ; log . info ( "Started " + this ) ; for ( int i = 0 ; i < LazyList . size ( _eventListeners ) ; i ++ ) { EventListener listener = ( EventListener ) LazyList . get ( _eventListeners , i ) ; if ( listener instanceof LifeCycleListener ) ( ( LifeCycleListener ) listener ) . lifeCycleStarted ( event ) ; } } catch ( Throwable e ) { LifeCycleEvent failed = new LifeCycleEvent ( this , e ) ; for ( int i = 0 ; i < LazyList . size ( _eventListeners ) ; i ++ ) { EventListener listener = ( EventListener ) LazyList . get ( _eventListeners , i ) ; if ( listener instanceof LifeCycleListener ) ( ( LifeCycleListener ) listener ) . lifeCycleFailure ( event ) ; } if ( e instanceof Exception ) throw ( Exception ) e ; if ( e instanceof RuntimeException ) throw ( RuntimeException ) e ; if ( e instanceof Error ) throw ( Error ) e ; log . warn ( LogSupport . EXCEPTION , e ) ; } finally { _starting = false ; }
|
public class PatchContentLoader { /** * Open a new content stream .
* @ param item the content item
* @ return the content stream */
InputStream openContentStream ( final ContentItem item ) throws IOException { } }
|
final File file = getFile ( item ) ; if ( file == null ) { throw new IllegalStateException ( ) ; } return new FileInputStream ( file ) ;
|
public class CmsImportHelper { /** * Returns the class system location . < p >
* i . e : < code > org / opencms / importexport < / code > < p >
* @ param clazz the class to get the location for
* @ return the class system location */
public String getLocation ( Class < ? > clazz ) { } }
|
String filename = clazz . getName ( ) . replace ( '.' , '/' ) ; int pos = filename . lastIndexOf ( '/' ) + 1 ; return ( pos > 0 ? filename . substring ( 0 , pos ) : "" ) ;
|
public class HibernateDao { /** * Create a JPA2 CriteriaQuery , which should have constraints generated using the methods in { @ link # getCriteriaBuilder ( ) }
* @ param < O >
* the return type of the query
* @ param clazz
* the return type of the query
* @ return */
protected < O > CriteriaQuery < O > createCriteriaQuery ( Class < O > clazz ) { } }
|
return getCriteriaBuilder ( ) . createQuery ( clazz ) ;
|
public class AWSS3V4Signer { /** * Read the content of the request to get the length of the stream . This
* method will wrap the stream by SdkBufferedInputStream if it is not
* mark - supported . */
static long getContentLength ( SignableRequest < ? > request ) throws IOException { } }
|
final InputStream content = request . getContent ( ) ; if ( ! content . markSupported ( ) ) throw new IllegalStateException ( "Bug: request input stream must have been made mark-and-resettable at this point" ) ; ReadLimitInfo info = request . getReadLimitInfo ( ) ; final int readLimit = info . getReadLimit ( ) ; long contentLength = 0 ; byte [ ] tmp = new byte [ 4096 ] ; int read ; content . mark ( readLimit ) ; while ( ( read = content . read ( tmp ) ) != - 1 ) { contentLength += read ; } try { content . reset ( ) ; } catch ( IOException ex ) { throw new ResetException ( "Failed to reset the input stream" , ex ) ; } return contentLength ;
|
public class MethodExpressionValueChangeListener { /** * < p > < span
* class = " changed _ modified _ 2_0 changed _ modified _ 2_2 " > Call < / span >
* through to the { @ link MethodExpression } passed in our
* constructor . < span class = " changed _ added _ 2_0 " > First , try to
* invoke the < code > MethodExpression < / code > passed to the
* constructor of this instance , passing the argument { @ link
* ValueChangeEvent } as the argument . If a { @ link
* MethodNotFoundException } is thrown , call to the zero argument
* < code > MethodExpression < / code > derived from the
* < code > MethodExpression < / code > passed to the constructor of this
* instance . < span class = " changed _ deleted _ 2_2 " > < del > If that fails
* for any reason , throw an { @ link AbortProcessingException } ,
* including the cause of the failure . < / del > < / span > < / span > < / p >
* @ throws NullPointerException if the argument valueChangeEvent is null .
* @ throws AbortProcessingException { @ inheritDoc } */
public void processValueChange ( ValueChangeEvent valueChangeEvent ) throws AbortProcessingException { } }
|
if ( valueChangeEvent == null ) { throw new NullPointerException ( ) ; } FacesContext context = FacesContext . getCurrentInstance ( ) ; ELContext elContext = context . getELContext ( ) ; // PENDING : The corresponding code in MethodExpressionActionListener
// has an elaborate message capture , logging , and rethrowing block .
// Why not here ?
try { methodExpressionOneArg . invoke ( elContext , new Object [ ] { valueChangeEvent } ) ; } catch ( MethodNotFoundException mnf ) { if ( null != methodExpressionZeroArg ) { // try to invoke a no - arg version
methodExpressionZeroArg . invoke ( elContext , new Object [ ] { } ) ; } }
|
public class UnicodeSetIterator { /** * Resets this iterator to the start of the set . */
public void reset ( ) { } }
|
endRange = set . getRangeCount ( ) - 1 ; range = 0 ; endElement = - 1 ; nextElement = 0 ; if ( endRange >= 0 ) { loadRange ( range ) ; } stringIterator = null ; if ( set . strings != null ) { stringIterator = set . strings . iterator ( ) ; if ( ! stringIterator . hasNext ( ) ) { stringIterator = null ; } }
|
public class Signatures { /** * Reads a list of API signatures . Closes the Reader when done ( on Exception , too ) ! */
public void parseSignaturesStream ( InputStream in , String name ) throws IOException , ParseException { } }
|
logger . info ( "Reading API signatures: " + name ) ; final Set < String > missingClasses = new TreeSet < String > ( ) ; parseSignaturesStream ( in , false , missingClasses ) ; reportMissingSignatureClasses ( missingClasses ) ;
|
public class CustomCommandSerializer { /** * A custom serializer for Custom Command . The custom commands are received in
* HashMap and then each key value is mapped as separate properties rather than a single
* JsonArray . This allows us to add any number of custom commands and then send it in openxc
* standard message format .
* @ param customCommand
* @ param typeOfSrc
* @ param context
* @ return */
@ Override public JsonElement serialize ( CustomCommand customCommand , Type typeOfSrc , JsonSerializationContext context ) { } }
|
JsonObject jObject = new JsonObject ( ) ; HashMap < String , String > commands = customCommand . getCommands ( ) ; for ( Map . Entry < String , String > entry : commands . entrySet ( ) ) { jObject . addProperty ( entry . getKey ( ) , entry . getValue ( ) ) ; } return jObject ;
|
public class LocalisationManager { /** * Method setLocal
* < p > Resets hasLocal . */
public void setLocal ( ) { } }
|
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "setLocal" , Boolean . valueOf ( _hasLocal ) ) ; _hasLocal = true ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "setLocal" ) ;
|
public class Ser { /** * Reads the state from the stream .
* @ param in the input stream , not null
* @ return the epoch seconds , not null
* @ throws IOException if an error occurs */
static long readEpochSec ( DataInput in ) throws IOException { } }
|
int hiByte = in . readByte ( ) & 255 ; if ( hiByte == 255 ) { return in . readLong ( ) ; } else { int midByte = in . readByte ( ) & 255 ; int loByte = in . readByte ( ) & 255 ; long tot = ( ( hiByte << 16 ) + ( midByte << 8 ) + loByte ) ; return ( tot * 900 ) - 4575744000L ; }
|
public class ID3v2Frame { /** * Pulls out extra information inserted in the frame data depending
* on what flags are set .
* @ param data the frame data */
private void parseData ( byte [ ] data ) { } }
|
int bytesRead = 0 ; if ( grouped ) { group = data [ bytesRead ] ; bytesRead ++ ; } if ( encrypted ) { encrType = data [ bytesRead ] ; bytesRead ++ ; } if ( lengthIndicator ) { dataLength = Helpers . convertDWordToInt ( data , bytesRead ) ; bytesRead += 4 ; } frameData = new byte [ data . length - bytesRead ] ; System . arraycopy ( data , bytesRead , frameData , 0 , frameData . length ) ;
|
public class ColumnFamilyRowCopy { /** * Copy the source row to the destination row .
* @ throws HectorException if any required fields are not set */
public void copy ( ) throws HectorException { } }
|
if ( this . cf == null ) { throw new HectorException ( "Unable to clone row with null column family" ) ; } if ( this . rowKey == null ) { throw new HectorException ( "Unable to clone row with null row key" ) ; } if ( this . destinationKey == null ) { throw new HectorException ( "Unable to clone row with null clone key" ) ; } ColumnFamilyTemplate < K , ByteBuffer > template = new ThriftColumnFamilyTemplate < K , ByteBuffer > ( this . keyspace , this . cf , this . keySerializer , this . bs ) ; Mutator < K > mutator = HFactory . createMutator ( this . keyspace , this . keySerializer , new BatchSizeHint ( 1 , this . mutateInterval ) ) ; ColumnFamilyUpdater < K , ByteBuffer > updater = template . createUpdater ( this . destinationKey , mutator ) ; SliceQuery < K , ByteBuffer , ByteBuffer > query = HFactory . createSliceQuery ( this . keyspace , this . keySerializer , this . bs , this . bs ) . setColumnFamily ( this . cf ) . setKey ( this . rowKey ) ; ColumnSliceIterator < K , ByteBuffer , ByteBuffer > iterator = new ColumnSliceIterator < K , ByteBuffer , ByteBuffer > ( query , this . bs . fromBytes ( new byte [ 0 ] ) , this . bs . fromBytes ( new byte [ 0 ] ) , false ) ; while ( iterator . hasNext ( ) ) { HColumn < ByteBuffer , ByteBuffer > column = iterator . next ( ) ; updater . setValue ( column . getName ( ) , column . getValue ( ) , this . bs ) ; } template . update ( updater ) ;
|
public class MouseHeadless { /** * Mouse */
@ Override public void doClick ( int click ) { } }
|
if ( click < clicks . length ) { clicks [ click ] = true ; lastClick = click ; }
|
public class GradleStrategyStage { /** * Gets all dependencies ( and the transitive ones too ) as given ShrinkWrap Archive type .
* @ param archive ShrinkWrap archive .
* @ return List of dependencies and transitive ones for configured state . */
public List < ? extends Archive > asList ( final Class < ? extends Archive > archive ) { } }
|
final List < Archive > archives = new ArrayList < > ( ) ; final GradleEffectiveDependencies gradleEffectiveDependencies = GradleRunner . getEffectiveDependencies ( projectDirectory ) ; for ( ScopeType scopeType : scopeTypesDependencies ) { final List < File > dependenciesByScope = gradleEffectiveDependencies . getDependenciesByScope ( scopeType ) ; for ( File dependency : dependenciesByScope ) { try { final Archive dep = ShrinkWrap . create ( ZipImporter . class , dependency . getName ( ) ) . importFrom ( dependency ) . as ( archive ) ; archives . add ( dep ) ; } catch ( Exception e ) { log . log ( Level . WARNING , "Cannot import gradle dependency " + dependency + ". Not a zip-like format" , e ) ; } } } return archives ;
|
public class CommerceTierPriceEntryLocalServiceUtil { /** * Returns the commerce tier price entry matching the UUID and group .
* @ param uuid the commerce tier price entry ' s UUID
* @ param groupId the primary key of the group
* @ return the matching commerce tier price entry , or < code > null < / code > if a matching commerce tier price entry could not be found */
public static com . liferay . commerce . price . list . model . CommerceTierPriceEntry fetchCommerceTierPriceEntryByUuidAndGroupId ( String uuid , long groupId ) { } }
|
return getService ( ) . fetchCommerceTierPriceEntryByUuidAndGroupId ( uuid , groupId ) ;
|
public class Base64 { /** * 对字符串进行base64解码 < / br >
* @ param content
* 字符串
* @ return 解码后的字符串 */
public static String decode ( String content ) { } }
|
// return content ;
if ( content == null || content . length ( ) == 0 ) { return content ; } else { byte [ ] decodeQueryString = org . apache . commons . codec . binary . Base64 . decodeBase64 ( content ) ; return new String ( decodeQueryString ) ; }
|
public class RuntimeExceptionsFactory { /** * Constructs and initializes a new { @ link NoSuchElementException } with the given { @ link String message }
* formatted with the given { @ link Object [ ] arguments } .
* @ param message { @ link String } describing the { @ link NoSuchElementException } .
* @ param args { @ link Object [ ] arguments } used to replace format placeholders in the { @ link String message } .
* @ return a new { @ link NoSuchElementException } with the given { @ link String message } .
* @ see # newNoSuchElementException ( Throwable , String , Object . . . )
* @ see java . util . NoSuchElementException */
public static NoSuchElementException newNoSuchElementException ( String message , Object ... args ) { } }
|
return newNoSuchElementException ( null , message , args ) ;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.