signature
stringlengths 43
39.1k
| implementation
stringlengths 0
450k
|
|---|---|
public class FastMath { /** * Cosine function .
* @ param x Argument .
* @ return cos ( x ) */
public static double cos ( double x ) { } }
|
int quadrant = 0 ; /* Take absolute value of the input */
double xa = x ; if ( x < 0 ) { xa = - xa ; } if ( xa != xa || xa == Double . POSITIVE_INFINITY ) { return Double . NaN ; } /* Perform any argument reduction */
double xb = 0 ; if ( xa > 3294198.0 ) { // PI * ( 2 * * 20)
// Argument too big for CodyWaite reduction . Must use
// PayneHanek .
double reduceResults [ ] = new double [ 3 ] ; reducePayneHanek ( xa , reduceResults ) ; quadrant = ( ( int ) reduceResults [ 0 ] ) & 3 ; xa = reduceResults [ 1 ] ; xb = reduceResults [ 2 ] ; } else if ( xa > 1.5707963267948966 ) { final CodyWaite cw = new CodyWaite ( xa ) ; quadrant = cw . getK ( ) & 3 ; xa = cw . getRemA ( ) ; xb = cw . getRemB ( ) ; } // if ( negative )
// quadrant = ( quadrant + 2 ) % 4;
switch ( quadrant ) { case 0 : return cosQ ( xa , xb ) ; case 1 : return - sinQ ( xa , xb ) ; case 2 : return - cosQ ( xa , xb ) ; case 3 : return sinQ ( xa , xb ) ; default : return Double . NaN ; }
|
public class SARLLabelProvider { /** * Invoked when an image descriptor cannot be found .
* @ param params the parameters given to the method polymorphic dispatcher .
* @ param exception the cause of the error .
* @ return the image descriptor for the error . */
protected ImageDescriptor handleImageDescriptorError ( Object [ ] params , Throwable exception ) { } }
|
if ( exception instanceof NullPointerException ) { final Object defaultImage = getDefaultImage ( ) ; if ( defaultImage instanceof ImageDescriptor ) { return ( ImageDescriptor ) defaultImage ; } if ( defaultImage instanceof Image ) { return ImageDescriptor . createFromImage ( ( Image ) defaultImage ) ; } return super . imageDescriptor ( params [ 0 ] ) ; } return Exceptions . throwUncheckedException ( exception ) ;
|
public class LdapIdentityStoreDefinitionWrapper { /** * Evaluate and return the maxResults .
* @ param immediateOnly If true , only return a non - null value if the setting is either an
* immediate EL expression or not set by an EL expression . If false , return the
* value regardless of where it is evaluated .
* @ return The maxResults or null if immediateOnly = = true AND the value is not evaluated
* from a deferred EL expression . */
@ FFDCIgnore ( IllegalArgumentException . class ) private Integer evaluateMaxResults ( boolean immediateOnly ) { } }
|
try { return elHelper . processInt ( "maxResultsExpression" , this . idStoreDefinition . maxResultsExpression ( ) , this . idStoreDefinition . maxResults ( ) , immediateOnly ) ; } catch ( IllegalArgumentException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isWarningEnabled ( ) ) { Tr . warning ( tc , "JAVAEESEC_WARNING_IDSTORE_CONFIG" , new Object [ ] { "maxResults/maxResultsExpression" , "1000" } ) ; } return 1000 ; /* Default value from spec . */
}
|
public class CustomerSession { /** * Set the shipping information on the current customer object .
* @ param shippingInformation the data to be set */
public void setCustomerShippingInformation ( @ NonNull ShippingInformation shippingInformation ) { } }
|
final Map < String , Object > arguments = new HashMap < > ( ) ; arguments . put ( KEY_SHIPPING_INFO , shippingInformation ) ; mEphemeralKeyManager . retrieveEphemeralKey ( null , ACTION_SET_CUSTOMER_SHIPPING_INFO , arguments ) ;
|
public class ClientSessionSubmitter { /** * Resubmits commands starting after the given sequence number .
* The sequence number from which to resend commands is the < em > request < / em > sequence number ,
* not the client - side sequence number . We resend only commands since queries cannot be reliably
* resent without losing linearizable semantics . Commands are resent by iterating through all pending
* operation attempts and retrying commands where the sequence number is greater than the given
* { @ code commandSequence } number and the attempt number is less than or equal to the version . */
private void resubmit ( long commandSequence , OperationAttempt < ? , ? , ? > attempt ) { } }
|
// If the client ' s response sequence number is greater than the given command sequence number ,
// the cluster likely has a new leader , and we need to reset the sequencing in the leader by
// sending a keep - alive request .
// Ensure that the client doesn ' t resubmit many concurrent KeepAliveRequests by tracking the last
// keep - alive response sequence number and only resubmitting if the sequence number has changed .
long responseSequence = state . getCommandResponse ( ) ; if ( commandSequence < responseSequence && keepAliveIndex . get ( ) != responseSequence ) { keepAliveIndex . set ( responseSequence ) ; KeepAliveRequest request = KeepAliveRequest . builder ( ) . withSession ( state . getSessionId ( ) ) . withCommandSequence ( state . getCommandResponse ( ) ) . withEventIndex ( state . getEventIndex ( ) ) . build ( ) ; state . getLogger ( ) . trace ( "{} - Sending {}" , state . getSessionId ( ) , request ) ; connection . < KeepAliveRequest , KeepAliveResponse > sendAndReceive ( request ) . whenComplete ( ( response , error ) -> { if ( error == null ) { state . getLogger ( ) . trace ( "{} - Received {}" , state . getSessionId ( ) , response ) ; // If the keep - alive is successful , recursively resubmit operations starting
// at the submitted response sequence number rather than the command sequence .
if ( response . status ( ) == Response . Status . OK ) { resubmit ( responseSequence , attempt ) ; } else { attempt . retry ( Duration . ofSeconds ( FIBONACCI [ Math . min ( attempt . attempt - 1 , FIBONACCI . length - 1 ) ] ) ) ; } } else { keepAliveIndex . set ( 0 ) ; attempt . retry ( Duration . ofSeconds ( FIBONACCI [ Math . min ( attempt . attempt - 1 , FIBONACCI . length - 1 ) ] ) ) ; } } ) ; } else { for ( Map . Entry < Long , OperationAttempt > entry : attempts . entrySet ( ) ) { OperationAttempt operation = entry . getValue ( ) ; if ( operation instanceof CommandAttempt && operation . request . sequence ( ) > commandSequence && operation . attempt <= attempt . attempt ) { operation . retry ( ) ; } } }
|
public class Utils { /** * Returns true if a type implements Parcelable */
static boolean isParcelable ( Elements elements , Types types , TypeMirror type ) { } }
|
TypeMirror parcelableType = elements . getTypeElement ( PARCELABLE_CLASS_NAME ) . asType ( ) ; return types . isAssignable ( type , parcelableType ) ;
|
public class MonitoringDataSource { /** * Delegates the call to the wrapped data source , wraps the returned
* connection and counts the connections returned .
* @ return a database < code > Connection < / code >
* @ throws java . sql . SQLException
* as a result of the delegation */
@ Override public Connection getConnection ( ) throws SQLException { } }
|
return getConnection ( new Callable < Connection > ( ) { @ Override public Connection call ( ) throws SQLException { return MonitoringDataSource . this . original . getConnection ( ) ; } } , ".getConnection" ) ;
|
public class LiveOutputsInner { /** * Create Live Output .
* Creates a Live Output .
* @ 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 liveOutputName The name of the Live Output .
* @ param parameters Live Output 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 LiveOutputInner object if successful . */
public LiveOutputInner create ( String resourceGroupName , String accountName , String liveEventName , String liveOutputName , LiveOutputInner parameters ) { } }
|
return createWithServiceResponseAsync ( resourceGroupName , accountName , liveEventName , liveOutputName , parameters ) . toBlocking ( ) . last ( ) . body ( ) ;
|
public class InternalSimpleExpressionsParser { /** * InternalSimpleExpressions . g : 640:1 : ruleMethodCallLiteral returns [ AntlrDatatypeRuleToken current = new AntlrDatatypeRuleToken ( ) ] : ( this _ FQN _ 0 = ruleFQN ( kw = ' ( ' ( this _ Argument _ 2 = ruleArgument ( kw = ' , ' this _ Argument _ 4 = ruleArgument ) * ) ? kw = ' ) ' ( kw = ' . ' this _ MethodCallLiteral _ 7 = ruleMethodCallLiteral ) ? ) ? ) ; */
public final AntlrDatatypeRuleToken ruleMethodCallLiteral ( ) throws RecognitionException { } }
|
AntlrDatatypeRuleToken current = new AntlrDatatypeRuleToken ( ) ; Token kw = null ; AntlrDatatypeRuleToken this_FQN_0 = null ; AntlrDatatypeRuleToken this_Argument_2 = null ; AntlrDatatypeRuleToken this_Argument_4 = null ; AntlrDatatypeRuleToken this_MethodCallLiteral_7 = null ; enterRule ( ) ; try { // InternalSimpleExpressions . g : 643:28 : ( ( this _ FQN _ 0 = ruleFQN ( kw = ' ( ' ( this _ Argument _ 2 = ruleArgument ( kw = ' , ' this _ Argument _ 4 = ruleArgument ) * ) ? kw = ' ) ' ( kw = ' . ' this _ MethodCallLiteral _ 7 = ruleMethodCallLiteral ) ? ) ? ) )
// InternalSimpleExpressions . g : 644:1 : ( this _ FQN _ 0 = ruleFQN ( kw = ' ( ' ( this _ Argument _ 2 = ruleArgument ( kw = ' , ' this _ Argument _ 4 = ruleArgument ) * ) ? kw = ' ) ' ( kw = ' . ' this _ MethodCallLiteral _ 7 = ruleMethodCallLiteral ) ? ) ? )
{ // InternalSimpleExpressions . g : 644:1 : ( this _ FQN _ 0 = ruleFQN ( kw = ' ( ' ( this _ Argument _ 2 = ruleArgument ( kw = ' , ' this _ Argument _ 4 = ruleArgument ) * ) ? kw = ' ) ' ( kw = ' . ' this _ MethodCallLiteral _ 7 = ruleMethodCallLiteral ) ? ) ? )
// InternalSimpleExpressions . g : 645:5 : this _ FQN _ 0 = ruleFQN ( kw = ' ( ' ( this _ Argument _ 2 = ruleArgument ( kw = ' , ' this _ Argument _ 4 = ruleArgument ) * ) ? kw = ' ) ' ( kw = ' . ' this _ MethodCallLiteral _ 7 = ruleMethodCallLiteral ) ? ) ?
{ newCompositeNode ( grammarAccess . getMethodCallLiteralAccess ( ) . getFQNParserRuleCall_0 ( ) ) ; pushFollow ( FOLLOW_11 ) ; this_FQN_0 = ruleFQN ( ) ; state . _fsp -- ; current . merge ( this_FQN_0 ) ; afterParserOrEnumRuleCall ( ) ; // InternalSimpleExpressions . g : 655:1 : ( kw = ' ( ' ( this _ Argument _ 2 = ruleArgument ( kw = ' , ' this _ Argument _ 4 = ruleArgument ) * ) ? kw = ' ) ' ( kw = ' . ' this _ MethodCallLiteral _ 7 = ruleMethodCallLiteral ) ? ) ?
int alt12 = 2 ; int LA12_0 = input . LA ( 1 ) ; if ( ( LA12_0 == 13 ) ) { alt12 = 1 ; } switch ( alt12 ) { case 1 : // InternalSimpleExpressions . g : 656:2 : kw = ' ( ' ( this _ Argument _ 2 = ruleArgument ( kw = ' , ' this _ Argument _ 4 = ruleArgument ) * ) ? kw = ' ) ' ( kw = ' . ' this _ MethodCallLiteral _ 7 = ruleMethodCallLiteral ) ?
{ kw = ( Token ) match ( input , 13 , FOLLOW_12 ) ; current . merge ( kw ) ; newLeafNode ( kw , grammarAccess . getMethodCallLiteralAccess ( ) . getLeftParenthesisKeyword_1_0 ( ) ) ; // InternalSimpleExpressions . g : 661:1 : ( this _ Argument _ 2 = ruleArgument ( kw = ' , ' this _ Argument _ 4 = ruleArgument ) * ) ?
int alt10 = 2 ; int LA10_0 = input . LA ( 1 ) ; if ( ( ( LA10_0 >= RULE_INT && LA10_0 <= RULE_ID ) ) ) { alt10 = 1 ; } switch ( alt10 ) { case 1 : // InternalSimpleExpressions . g : 662:5 : this _ Argument _ 2 = ruleArgument ( kw = ' , ' this _ Argument _ 4 = ruleArgument ) *
{ newCompositeNode ( grammarAccess . getMethodCallLiteralAccess ( ) . getArgumentParserRuleCall_1_1_0 ( ) ) ; pushFollow ( FOLLOW_13 ) ; this_Argument_2 = ruleArgument ( ) ; state . _fsp -- ; current . merge ( this_Argument_2 ) ; afterParserOrEnumRuleCall ( ) ; // InternalSimpleExpressions . g : 672:1 : ( kw = ' , ' this _ Argument _ 4 = ruleArgument ) *
loop9 : do { int alt9 = 2 ; int LA9_0 = input . LA ( 1 ) ; if ( ( LA9_0 == 24 ) ) { alt9 = 1 ; } switch ( alt9 ) { case 1 : // InternalSimpleExpressions . g : 673:2 : kw = ' , ' this _ Argument _ 4 = ruleArgument
{ kw = ( Token ) match ( input , 24 , FOLLOW_14 ) ; current . merge ( kw ) ; newLeafNode ( kw , grammarAccess . getMethodCallLiteralAccess ( ) . getCommaKeyword_1_1_1_0 ( ) ) ; newCompositeNode ( grammarAccess . getMethodCallLiteralAccess ( ) . getArgumentParserRuleCall_1_1_1_1 ( ) ) ; pushFollow ( FOLLOW_13 ) ; this_Argument_4 = ruleArgument ( ) ; state . _fsp -- ; current . merge ( this_Argument_4 ) ; afterParserOrEnumRuleCall ( ) ; } break ; default : break loop9 ; } } while ( true ) ; } break ; } kw = ( Token ) match ( input , 14 , FOLLOW_15 ) ; current . merge ( kw ) ; newLeafNode ( kw , grammarAccess . getMethodCallLiteralAccess ( ) . getRightParenthesisKeyword_1_2 ( ) ) ; // InternalSimpleExpressions . g : 695:1 : ( kw = ' . ' this _ MethodCallLiteral _ 7 = ruleMethodCallLiteral ) ?
int alt11 = 2 ; int LA11_0 = input . LA ( 1 ) ; if ( ( LA11_0 == 25 ) ) { alt11 = 1 ; } switch ( alt11 ) { case 1 : // InternalSimpleExpressions . g : 696:2 : kw = ' . ' this _ MethodCallLiteral _ 7 = ruleMethodCallLiteral
{ kw = ( Token ) match ( input , 25 , FOLLOW_16 ) ; current . merge ( kw ) ; newLeafNode ( kw , grammarAccess . getMethodCallLiteralAccess ( ) . getFullStopKeyword_1_3_0 ( ) ) ; newCompositeNode ( grammarAccess . getMethodCallLiteralAccess ( ) . getMethodCallLiteralParserRuleCall_1_3_1 ( ) ) ; pushFollow ( FOLLOW_2 ) ; this_MethodCallLiteral_7 = ruleMethodCallLiteral ( ) ; state . _fsp -- ; current . merge ( this_MethodCallLiteral_7 ) ; afterParserOrEnumRuleCall ( ) ; } break ; } } break ; } } } leaveRule ( ) ; } catch ( RecognitionException re ) { recover ( input , re ) ; appendSkippedTokens ( ) ; } finally { } return current ;
|
public class ColorYuv { /** * Conversion from RGB to YCbCr . See [ Jack07 ] .
* @ param r Red [ 0 to 255]
* @ param g Green [ 0 to 255]
* @ param b Blue [ 0 to 255] */
public static void rgbToYCbCr ( int r , int g , int b , byte yuv [ ] ) { } }
|
// multiply coefficients in book by 1024 , which is 2 ^ 10
yuv [ 0 ] = ( byte ) ( ( ( 187 * r + 629 * g + 63 * b ) >> 10 ) + 16 ) ; yuv [ 1 ] = ( byte ) ( ( ( - 103 * r - 346 * g + 450 * b ) >> 10 ) + 128 ) ; yuv [ 2 ] = ( byte ) ( ( ( 450 * r - 409 * g - 41 * b ) >> 10 ) + 128 ) ;
|
public class DemoActivity { /** * CHECKSTYLE : ON */
@ Override protected void onCreate ( Bundle savedInstanceState ) { } }
|
super . onCreate ( savedInstanceState ) ; setContentView ( R . layout . activity_demo ) ; ButterKnife . bind ( this ) ; mCacheId = getIntent ( ) . getStringExtra ( EXTRA_ID_CACHE ) ; mDiskCacheSize = getIntent ( ) . getIntExtra ( EXTRA_DISK_CACHE_SIZE , 100 ) ; mRamCacheSize = getIntent ( ) . getIntExtra ( EXTRA_RAM_CACHE_SIZE , 50 ) ; CacheSerializer < String > jsonSerializer = new JsonSerializer < > ( String . class ) ; mCache = new Builder < String > ( mCacheId , 1 ) . enableLog ( ) . useSerializerInRam ( mRamCacheSize , jsonSerializer ) . useSerializerInDisk ( mDiskCacheSize , true , jsonSerializer , getApplicationContext ( ) ) . build ( ) ; mHandler = new Handler ( ) ; mHandler . post ( new Runnable ( ) { @ Override public void run ( ) { refreshCacheSize ( ) ; mHandler . postDelayed ( this , 500 ) ; } } ) ; mButtonAddObjectA . setOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View view ) { mCache . put ( "a" , "objectA" ) ; } } ) ; mButtonAddObjectB . setOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View view ) { mCache . put ( "b" , "objectB" ) ; } } ) ; mButtonAddRandomObject . setOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View view ) { mCache . put ( UUID . randomUUID ( ) . toString ( ) , UUID . randomUUID ( ) . toString ( ) ) ; } } ) ; mButtonDisplayObjectB . setOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View view ) { long start = System . currentTimeMillis ( ) ; String result = mCache . get ( "b" ) ; long end = System . currentTimeMillis ( ) ; long time = end - start ; if ( result != null ) { Toast . makeText ( DemoActivity . this , result , Toast . LENGTH_SHORT ) . show ( ) ; } mTextViewDataTime . setText ( "Last access time : " + time + " ms" ) ; } } ) ; mButtonDisplayObjectA . setOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View view ) { long start = System . currentTimeMillis ( ) ; String result = mCache . get ( "a" ) ; long end = System . currentTimeMillis ( ) ; long time = end - start ; if ( result != null ) { Toast . makeText ( DemoActivity . this , result , Toast . LENGTH_SHORT ) . show ( ) ; } mTextViewDataTime . setText ( "Last access time : " + time + " ms" ) ; } } ) ; mButtonInvalidateCache . setOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View view ) { mCache . invalidate ( ) ; } } ) ;
|
public class JBBPTextWriter { /** * Print a value represented by its string .
* @ param value the value to be printed , must not be null
* @ throws IOException it will be thrown for transport errors */
private void printValueString ( final String value ) throws IOException { } }
|
if ( this . valuesLineCounter > 0 && this . valueSeparator . length ( ) > 0 ) { this . write ( this . valueSeparator ) ; } if ( this . prefixValue . length ( ) > 0 ) { this . write ( this . prefixValue ) ; } this . write ( value ) ; if ( this . postfixValue . length ( ) > 0 ) { this . write ( this . postfixValue ) ; } this . valuesLineCounter ++ ; if ( this . maxValuesPerLine > 0 && this . valuesLineCounter >= this . maxValuesPerLine ) { for ( final Extra e : this . extras ) { e . onReachedMaxValueNumberForLine ( this ) ; } ensureNewLineMode ( ) ; }
|
public class HpelBasicFormatter { /** * Generates the basic format event header information that is common to all subclasses of RasEvent starting at
* position 0 of the specified StringBuffer .
* Basic format specifies that the header information will include a formatted timestamp followed by an 8 ( hex )
* digit thread Id , followed by a 13 character name field , followed by a type character . All fields will be
* separated by blanks and the resultant contents of the StringBuffer will also be terminated by a blank .
* @ param record RepositoryLogRecord provided by the caller .
* @ param buffer output buffer where converted entry is appended to . */
protected void createEventHeader ( RepositoryLogRecord record , StringBuilder buffer ) { } }
|
if ( null == record ) { throw new IllegalArgumentException ( "Record cannot be null" ) ; } if ( null == buffer ) { throw new IllegalArgumentException ( "Buffer cannot be null" ) ; } // Create the time stamp
createEventTimeStamp ( record , buffer ) ; // Add the formatted threadID
formatThreadID ( record , buffer ) ; // Build the short 13 character name we display first as a convenience mechanism . This is either the name of the
// JRas logger or the Tr component that registered .
String name = record . getLoggerName ( ) ; boolean isSpecialLogger = false ; if ( name == null ) { name = "" ; } for ( int i = 0 ; i < specialLoggers . length ; i ++ ) { if ( name . trim ( ) . startsWith ( specialLoggers [ i ] ) ) { try { name = specialLoggerReplacement [ i ] + name . substring ( name . indexOf ( "-" ) , name . indexOf ( "-" , name . indexOf ( "-" ) + 1 ) ) ; isSpecialLogger = true ; } catch ( StringIndexOutOfBoundsException e ) { } } } if ( ! isSpecialLogger ) { int index = name . lastIndexOf ( '.' ) + 1 ; if ( ( index + svBasicFormatMaxNameLength ) >= name . length ( ) ) { name = name . substring ( index ) ; } else { name = name . substring ( index , index + svBasicFormatMaxNameLength ) ; } } buffer . append ( name ) ; // pad the string buffer out to svBasicFormatMaxNameLength chars with blanks for readability .
int tmpLen = svBasicFormatMaxNameLength - name . length ( ) ; for ( int i = tmpLen ; i > 0 ; -- i ) { buffer . append ( ' ' ) ; } buffer . append ( mapLevelToType ( record ) ) ; // for JRas records append the className and methodName . For Orb entries , the methodNam will have the threadName
// appended to it .
String classname = record . getSourceClassName ( ) ; String methodname = record . getSourceMethodName ( ) ; if ( classname != null ) { buffer . append ( classname ) ; } buffer . append ( ' ' ) ; if ( methodname != null ) { buffer . append ( methodname ) ; } buffer . append ( ' ' ) ; // END code extracted from TraceLogFormatter . formatHeaderBasic
|
public class PolicyExecutorImpl { /** * Releases a permit against maxConcurrency or transfers it to a worker task that runs on the global thread pool . */
@ Trivial private void transferOrReleasePermit ( ) { } }
|
maxConcurrencyConstraint . release ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "expedites/maxConcurrency available" , expeditesAvailable , maxConcurrencyConstraint . availablePermits ( ) ) ; // The permit might be needed to run tasks on the global executor ,
if ( ! queue . isEmpty ( ) && withheldConcurrency . get ( ) > 0 && maxConcurrencyConstraint . tryAcquire ( ) ) { decrementWithheldConcurrency ( ) ; if ( acquireExpedite ( ) > 0 ) expediteGlobal ( new GlobalPoolTask ( ) ) ; else enqueueGlobal ( new GlobalPoolTask ( ) ) ; }
|
public class CirculantTracker { /** * Computes the weights used in the gaussian kernel
* This isn ' t actually symmetric for even widths . These weights are used has label in the learning phase . Closer
* to one the more likely it is the true target . It should be a peak in the image center . If it is not then
* it will learn an incorrect model . */
protected void computeGaussianWeights ( int width ) { } }
|
// desired output ( gaussian shaped ) , bandwidth proportional to target size
double output_sigma = Math . sqrt ( width * width ) * output_sigma_factor ; double left = - 0.5 / ( output_sigma * output_sigma ) ; int radius = width / 2 ; for ( int y = 0 ; y < gaussianWeight . height ; y ++ ) { int index = gaussianWeight . startIndex + y * gaussianWeight . stride ; double ry = y - radius ; for ( int x = 0 ; x < width ; x ++ ) { double rx = x - radius ; gaussianWeight . data [ index ++ ] = Math . exp ( left * ( ry * ry + rx * rx ) ) ; } } fft . forward ( gaussianWeight , gaussianWeightDFT ) ;
|
public class SarlExampleInstallerWizard { /** * Close the welcome page . */
protected static void closeWelcomePage ( ) { } }
|
final IIntroManager introManager = PlatformUI . getWorkbench ( ) . getIntroManager ( ) ; if ( introManager != null ) { final IIntroPart intro = introManager . getIntro ( ) ; if ( intro != null ) { introManager . closeIntro ( intro ) ; } }
|
public class JobTrackerMetricsInst { /** * Since this object is a registered updater , this method will be called
* periodically , e . g . every 5 seconds . */
public void doUpdates ( MetricsContext unused ) { } }
|
// In case of running in LocalMode tracker = = null
if ( tracker != null ) { synchronized ( tracker ) { synchronized ( this ) { numRunningMaps = 0 ; numRunningReduces = 0 ; numWaitingMaps = 0 ; numWaitingReduces = 0 ; numTasksInMemory = 0 ; List < JobInProgress > jobs = tracker . getRunningJobs ( ) ; for ( JobInProgress jip : jobs ) { for ( TaskInProgress tip : jip . maps ) { if ( tip . isRunning ( ) ) { numRunningMaps ++ ; } else if ( tip . isRunnable ( ) ) { numWaitingMaps ++ ; } } for ( TaskInProgress tip : jip . reduces ) { if ( tip . isRunning ( ) ) { numRunningReduces ++ ; } else if ( tip . isRunnable ( ) ) { numWaitingReduces ++ ; } } numTasksInMemory += jip . getTasks ( TaskType . MAP ) . length ; numTasksInMemory += jip . getTasks ( TaskType . REDUCE ) . length ; } // Get tracker metrics
numTrackersDead = tracker . getDeadNodes ( ) . size ( ) ; ClusterStatus cs = tracker . getClusterStatus ( false ) ; numTrackersExcluded = cs . getNumExcludedNodes ( ) ; } } } synchronized ( this ) { metricsRecord . setMetric ( "map_slots" , numMapSlots ) ; metricsRecord . setMetric ( "reduce_slots" , numReduceSlots ) ; metricsRecord . incrMetric ( "blacklisted_maps" , numBlackListedMapSlots ) ; metricsRecord . incrMetric ( "blacklisted_reduces" , numBlackListedReduceSlots ) ; metricsRecord . incrMetric ( "jobs_submitted" , numJobsSubmitted ) ; metricsRecord . incrMetric ( "jobs_completed" , numJobsCompleted ) ; metricsRecord . setMetric ( "waiting_maps" , numWaitingMaps ) ; metricsRecord . setMetric ( "waiting_reduces" , numWaitingReduces ) ; metricsRecord . incrMetric ( "reserved_map_slots" , numReservedMapSlots ) ; metricsRecord . incrMetric ( "reserved_reduce_slots" , numReservedReduceSlots ) ; metricsRecord . incrMetric ( "occupied_map_slots" , numOccupiedMapSlots ) ; metricsRecord . incrMetric ( "occupied_reduce_slots" , numOccupiedReduceSlots ) ; metricsRecord . incrMetric ( "jobs_failed" , numJobsFailed ) ; metricsRecord . incrMetric ( "jobs_killed" , numJobsKilled ) ; metricsRecord . incrMetric ( "jobs_preparing" , numJobsPreparing ) ; metricsRecord . incrMetric ( "jobs_running" , numJobsRunning ) ; metricsRecord . setMetric ( "running_maps" , numRunningMaps ) ; metricsRecord . setMetric ( "running_reduces" , numRunningReduces ) ; metricsRecord . setMetric ( "num_tasks_in_memory" , numTasksInMemory ) ; metricsRecord . setMetric ( "trackers" , numTrackers ) ; metricsRecord . setMetric ( "trackers_blacklisted" , numTrackersBlackListed ) ; metricsRecord . setMetric ( "trackers_decommissioned" , numTrackersDecommissioned ) ; metricsRecord . setMetric ( "trackers_excluded" , numTrackersExcluded ) ; metricsRecord . setMetric ( "trackers_dead" , numTrackersDead ) ; metricsRecord . incrMetric ( "num_launched_jobs" , numJobsLaunched ) ; metricsRecord . incrMetric ( "total_submit_time" , totalSubmitTime ) ; aggregateJobStats . incrementMetricsAndReset ( metricsRecord ) ; // Update additional speculation stats for measuring the performance
// of different kinds of speculation
for ( SpecStats . TaskType taskType : SpecStats . TaskType . values ( ) ) { for ( SpecStats . SpecType specType : SpecStats . SpecType . values ( ) ) { for ( SpecStats . StatType statType : SpecStats . StatType . values ( ) ) { String key = "speculation_by_" + specType . toString ( ) . toLowerCase ( ) + "_" + "rate_" + taskType . toString ( ) . toLowerCase ( ) + "_" + statType . toString ( ) . toLowerCase ( ) ; long value = specStats . getStat ( taskType , specType , statType ) ; metricsRecord . setMetric ( key , value ) ; } } } for ( Group group : countersToMetrics ) { String groupName = group . getName ( ) ; for ( Counter counter : group ) { String name = groupName + "_" + counter . getName ( ) ; name = name . replaceAll ( "[^a-zA-Z_]" , "_" ) . toLowerCase ( ) ; metricsRecord . incrMetric ( name , counter . getValue ( ) ) ; } } clearCounters ( ) ; numJobsSubmitted = 0 ; numJobsCompleted = 0 ; numWaitingMaps = 0 ; numWaitingReduces = 0 ; numBlackListedMapSlots = 0 ; numBlackListedReduceSlots = 0 ; numReservedMapSlots = 0 ; numReservedReduceSlots = 0 ; numOccupiedMapSlots = 0 ; numOccupiedReduceSlots = 0 ; numJobsFailed = 0 ; numJobsKilled = 0 ; numJobsPreparing = 0 ; numJobsRunning = 0 ; numRunningMaps = 0 ; numRunningReduces = 0 ; numTrackers = 0 ; numTrackersBlackListed = 0 ; totalSubmitTime = 0 ; numJobsLaunched = 0 ; } metricsRecord . update ( ) ;
|
public class SuperPositions { /** * Use the { @ link SuperPosition # getRmsd ( Point3d [ ] , Point3d [ ] ) } method of the
* default static SuperPosition algorithm contained in this Class , assuming
* that the point arrays are centered at the origin . */
public static double getRmsdAtOrigin ( Point3d [ ] fixed , Point3d [ ] moved ) { } }
|
superposer . setCentered ( true ) ; return superposer . getRmsd ( fixed , moved ) ;
|
public class UtilIO { /** * Looks for file names which match the regex in the directory .
* Example : < br >
* BoofMiscOps . findMatches ( new File ( " / path / to / directory " ) , " . + jpg " ) ;
* @ param directory directory
* @ param regex file name regex
* @ return array of matching files */
public static File [ ] findMatches ( File directory , String regex ) { } }
|
final Pattern p = Pattern . compile ( regex ) ; // careful : could also throw an exception !
return directory . listFiles ( file -> p . matcher ( file . getName ( ) ) . matches ( ) ) ;
|
public class CmsContentTypeVisitor { /** * Reads the default value for the given type . < p >
* @ param schemaType the schema type
* @ param path the element path
* @ return the default value */
private String readDefaultValue ( I_CmsXmlSchemaType schemaType , String path ) { } }
|
return m_contentHandler . getDefault ( getCmsObject ( ) , m_file , schemaType , path , m_locale ) ;
|
public class AerospikeDeepJobConfig { /** * { @ inheritDoc } */
@ Override public AerospikeDeepJobConfig < T > initialize ( ) { } }
|
validate ( ) ; configHadoop = new JobConf ( ) ; configHadoop = new Configuration ( ) ; configHadoop . set ( AerospikeConfigUtil . INPUT_HOST , getHost ( ) ) ; configHadoop . set ( AerospikeConfigUtil . INPUT_PORT , Integer . toString ( getAerospikePort ( ) ) ) ; configHadoop . set ( AerospikeConfigUtil . INPUT_NAMESPACE , catalog ) ; configHadoop . set ( AerospikeConfigUtil . INPUT_SETNAME , table ) ; configHadoop . set ( AerospikeConfigUtil . INPUT_OPERATION , operation ) ; if ( numrangeFilter != null ) { configHadoop . set ( AerospikeConfigUtil . INPUT_NUMRANGE_BIN , numrangeFilter . _1 ( ) ) ; configHadoop . set ( AerospikeConfigUtil . INPUT_NUMRANGE_BEGIN , numrangeFilter . _2 ( ) . toString ( ) ) ; configHadoop . set ( AerospikeConfigUtil . INPUT_NUMRANGE_END , numrangeFilter . _3 ( ) . toString ( ) ) ; } configHadoop . set ( AerospikeConfigUtil . OUTPUT_HOST , getHost ( ) ) ; configHadoop . set ( AerospikeConfigUtil . OUTPUT_PORT , Integer . toString ( getAerospikePort ( ) ) ) ; configHadoop . set ( AerospikeConfigUtil . OUTPUT_NAMESPACE , catalog ) ; configHadoop . set ( AerospikeConfigUtil . OUTPUT_SETNAME , table ) ; if ( operation != null ) { configHadoop . set ( AerospikeConfigUtil . INPUT_OPERATION , operation ) ; } return this ;
|
public class UserInterfaceApi { /** * Open Information Window Open the information window for a character ,
* corporation or alliance inside the client - - - SSO Scope :
* esi - ui . open _ window . v1
* @ param targetId
* The target to open ( required )
* @ param datasource
* The server name you would like data from ( optional , default to
* tranquility )
* @ param token
* Access token to use if unable to set a header ( optional )
* @ return ApiResponse & lt ; Void & gt ;
* @ throws ApiException
* If fail to call the API , e . g . server error or cannot
* deserialize the response body */
public ApiResponse < Void > postUiOpenwindowInformationWithHttpInfo ( Integer targetId , String datasource , String token ) throws ApiException { } }
|
com . squareup . okhttp . Call call = postUiOpenwindowInformationValidateBeforeCall ( targetId , datasource , token , null ) ; return apiClient . execute ( call ) ;
|
public class PersistentFactory { /** * Retrieves the object uniquely identified by the value for the specified ID field .
* @ param id the ID field identifying the object
* @ param val the value that uniquely identifies the desired object
* @ return the object matching the query criterion
* @ throws PersistenceException an error occurred talking to the data store */
public T get ( String id , Object val ) throws PersistenceException { } }
|
logger . debug ( "enter - get(String,Object)" ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( "For: " + cache . getTarget ( ) . getName ( ) + "/" + id + "/" + val ) ; } try { Class < ? extends Execution > cls ; CacheLoader < T > loader ; loader = new CacheLoader < T > ( ) { public T load ( Object ... args ) { SearchTerm [ ] terms = new SearchTerm [ 1 ] ; Collection < T > list ; terms [ 0 ] = new SearchTerm ( ( String ) args [ 0 ] , Operator . EQUALS , args [ 1 ] ) ; try { list = PersistentFactory . this . load ( singletons . get ( args [ 0 ] ) , null , terms ) ; } catch ( PersistenceException e ) { try { try { Thread . sleep ( 1000L ) ; } catch ( InterruptedException ignore ) { } list = PersistentFactory . this . load ( singletons . get ( args [ 0 ] ) , null , terms ) ; } catch ( Throwable forgetIt ) { logger . error ( forgetIt . getMessage ( ) , forgetIt ) ; throw new RuntimeException ( e ) ; } } if ( list . isEmpty ( ) ) { return null ; } return list . iterator ( ) . next ( ) ; } } ; synchronized ( this ) { while ( ! singletons . containsKey ( id ) ) { SearchTerm [ ] terms = new SearchTerm [ 1 ] ; terms [ 0 ] = new SearchTerm ( id , Operator . EQUALS , val ) ; compileLoader ( terms , singletons , null ) ; try { wait ( 100L ) ; } catch ( InterruptedException ignore ) { /* ignore this */
} } cls = singletons . get ( id ) ; } if ( cls == null ) { throw new PersistenceException ( "Queries on the field " + id + " will not return single values." ) ; } logger . debug ( "Executing cache find..." ) ; try { return cache . find ( id , val , loader , id , val ) ; } catch ( CacheManagementException e ) { throw new PersistenceException ( e ) ; } catch ( RuntimeException e ) { Throwable t = e . getCause ( ) ; if ( t != null && t instanceof PersistenceException ) { throw ( PersistenceException ) t ; } if ( logger . isDebugEnabled ( ) ) { logger . error ( e . getMessage ( ) , e ) ; } throw new PersistenceException ( e ) ; } finally { logger . debug ( "Executed." ) ; } } finally { logger . debug ( "exit - get(String,Object)" ) ; }
|
public class CLI { /** * / * package */
static void verifyJenkinsConnection ( URLConnection c ) throws IOException { } }
|
if ( c . getHeaderField ( "X-Hudson" ) == null && c . getHeaderField ( "X-Jenkins" ) == null ) throw new NotTalkingToJenkinsException ( c ) ;
|
public class StaticCATXATransaction { /** * Calls start ( ) on the SIXAResource .
* Fields :
* BIT16 XAResourceId
* The XID Structure
* BIT32 Flags
* @ param request
* @ param conversation
* @ param requestNumber
* @ param allocatedFromBufferPool
* @ param partOfExchange */
public static void rcvXAStart ( CommsByteBuffer request , Conversation conversation , int requestNumber , boolean allocatedFromBufferPool , boolean partOfExchange ) { } }
|
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "rcvXAStart" , new Object [ ] { request , conversation , "" + requestNumber , "" + allocatedFromBufferPool , "" + partOfExchange } ) ; ConversationState convState = ( ConversationState ) conversation . getAttachment ( ) ; try { int clientTransactionId = request . getInt ( ) ; CATConnection catConn = ( CATConnection ) convState . getObject ( convState . getConnectionObjectId ( ) ) ; SICoreConnection connection = catConn . getSICoreConnection ( ) ; ServerLinkLevelState linkState = ( ServerLinkLevelState ) conversation . getLinkLevelAttachment ( ) ; SIXAResource xaResource = ( SIXAResource ) linkState . getTransactionTable ( ) . get ( clientTransactionId , true ) ; if ( xaResource == null ) { try { xaResource = connection . getSIXAResource ( ) ; } catch ( SIConnectionUnavailableException e ) { // No FFDC code needed
// Only FFDC if we haven ' t received a meTerminated event .
if ( ! convState . hasMETerminated ( ) ) { FFDCFilter . processException ( e , CLASS_NAME + ".rcvXAStart" , CommsConstants . STATICCATXATRANSACTION_XASTART_04 ) ; } // This should never happen . We are running inside the
// application server - so we should always be able to
// contact a messaging engine . Get very upset about this
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) SibTr . exception ( tc , e ) ; throw new SIErrorException ( e ) ; } catch ( SIResourceException e ) { FFDCFilter . processException ( e , CLASS_NAME + ".rcvXAStart" , CommsConstants . STATICCATXATRANSACTION_XASTART_05 ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) SibTr . exception ( tc , e ) ; throw new XAException ( XAException . XAER_RMERR ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { SibTr . debug ( tc , "XAResource Object ID" , clientTransactionId ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Getting Xid" ) ; Xid xid = request . getXid ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Completed:" , xid ) ; int flags = request . getInt ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Flags: " , flags ) ; // Now call the method on the XA resource
xaResource . start ( xid , flags ) ; linkState . getTransactionTable ( ) . addGlobalTransactionBranch ( clientTransactionId , conversation . getId ( ) , xaResource , ( XidProxy ) xid , false ) ; try { conversation . send ( poolManager . allocate ( ) , JFapChannelConstants . SEG_XASTART_R , requestNumber , JFapChannelConstants . PRIORITY_MEDIUM , true , ThrottlingPolicy . BLOCK_THREAD , null ) ; } catch ( SIException e ) { FFDCFilter . processException ( e , CLASS_NAME + ".rcvXAStart" , CommsConstants . STATICCATXATRANSACTION_XASTART_01 ) ; SibTr . error ( tc , "COMMUNICATION_ERROR_SICO2027" , e ) ; } } catch ( XAException e ) { FFDCFilter . processException ( e , CLASS_NAME + ".rcvXAStart" , CommsConstants . STATICCATXATRANSACTION_XASTART_02 ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "XAException - RC: " + e . errorCode , e ) ; StaticCATHelper . sendExceptionToClient ( e , CommsConstants . STATICCATXATRANSACTION_XASTART_02 , conversation , requestNumber ) ; } request . release ( allocatedFromBufferPool ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "rcvXAStart" ) ;
|
public class UIUtil { /** * Show keyboard and focus to given EditText .
* Use this method if target EditText is in Dialog .
* @ param dialog Dialog
* @ param target EditText to focus */
public static void showKeyboardInDialog ( Dialog dialog , EditText target ) { } }
|
if ( dialog == null || target == null ) { return ; } dialog . getWindow ( ) . setSoftInputMode ( WindowManager . LayoutParams . SOFT_INPUT_STATE_VISIBLE ) ; target . requestFocus ( ) ;
|
public class Graphics { /** * Sets the specular color for No . i light . */
public void setLightSpecular ( int i , Color color ) { } }
|
float [ ] tmpColor = { ( float ) color . getRed ( ) , ( float ) color . getGreen ( ) , ( float ) color . getBlue ( ) , ( float ) color . getAlpha ( ) } ; gl . glLightfv ( GL2 . GL_LIGHT0 + i , GL2 . GL_SPECULAR , tmpColor , 0 ) ;
|
public class MultipointMotionDetectionExample { /** * Gets the motion points from the motion detector and adds it to the HashMap */
@ Override public void motionDetected ( WebcamMotionEvent wme ) { } }
|
for ( Point p : wme . getPoints ( ) ) { motionPoints . put ( p , 0 ) ; }
|
public class CommerceRegionPersistenceImpl { /** * Returns the number of commerce regions where commerceCountryId = & # 63 ; .
* @ param commerceCountryId the commerce country ID
* @ return the number of matching commerce regions */
@ Override public int countByCommerceCountryId ( long commerceCountryId ) { } }
|
FinderPath finderPath = FINDER_PATH_COUNT_BY_COMMERCECOUNTRYID ; Object [ ] finderArgs = new Object [ ] { commerceCountryId } ; Long count = ( Long ) finderCache . getResult ( finderPath , finderArgs , this ) ; if ( count == null ) { StringBundler query = new StringBundler ( 2 ) ; query . append ( _SQL_COUNT_COMMERCEREGION_WHERE ) ; query . append ( _FINDER_COLUMN_COMMERCECOUNTRYID_COMMERCECOUNTRYID_2 ) ; String sql = query . toString ( ) ; Session session = null ; try { session = openSession ( ) ; Query q = session . createQuery ( sql ) ; QueryPos qPos = QueryPos . getInstance ( q ) ; qPos . add ( commerceCountryId ) ; count = ( Long ) q . uniqueResult ( ) ; finderCache . putResult ( finderPath , finderArgs , count ) ; } catch ( Exception e ) { finderCache . removeResult ( finderPath , finderArgs ) ; throw processException ( e ) ; } finally { closeSession ( session ) ; } } return count . intValue ( ) ;
|
public class DAOValidatorMethodExpressionExecutor { /** * Methode d ' obtention du nom de la classe d ' un Object
* @ param objectObjet dont on recherche le nom de classe
* @ returnNom de la classe de l ' Objet */
public String ctxClassName ( Object object ) { } }
|
// Si le nom est null
if ( object == null ) return Object . class . getName ( ) ; // On retourne le nom de la classe
return object . getClass ( ) . getName ( ) ;
|
public class Transformation2D { /** * Returns TRUE if this transformation is a shift transformation within the
* given tolerance .
* @ param tol
* The tolerance value . */
public boolean isShift ( double tol ) { } }
|
Point2D pt = transformWithoutShift ( Point2D . construct ( 0.0 , 1.0 ) ) ; pt . y -= 1.0 ; if ( pt . sqrLength ( ) > tol * tol ) return false ; pt = transformWithoutShift ( Point2D . construct ( 1.0 , 0.0 ) ) ; pt . x -= 1.0 ; return pt . sqrLength ( ) <= tol * tol ;
|
public class TransformerJobBuilder { /** * Gets an output column by name .
* @ see # getOutputColumns ( )
* @ param name
* @ return */
public MutableInputColumn < ? > getOutputColumnByName ( String name ) { } }
|
if ( StringUtils . isNullOrEmpty ( name ) ) { return null ; } final List < MutableInputColumn < ? > > outputColumns = getOutputColumns ( ) ; for ( MutableInputColumn < ? > inputColumn : outputColumns ) { if ( name . equals ( inputColumn . getName ( ) ) ) { return inputColumn ; } } return null ;
|
public class ImplicitObjectELResolver { /** * If the base object is < code > null < / code > , and the property matches
* the name of a JSP implicit object , returns the implicit object .
* < p > The < code > propertyResolved < / code > property of the
* < code > ELContext < / code > object must be set to < code > true < / code > by
* this resolver before returning if an implicit object is matched . If
* this property is not < code > true < / code > after this method is called ,
* the caller should ignore the return value . < / p >
* @ param context The context of this evaluation .
* @ param base Only < code > null < / code > is handled by this resolver .
* Other values will result in an immediate return .
* @ param property The name of the implicit object to resolve .
* @ return If the < code > propertyResolved < / code > property of
* < code > ELContext < / code > was set to < code > true < / code > , then
* the implicit object ; otherwise undefined .
* @ throws NullPointerException if context is < code > null < / code >
* @ throws ELException if an exception was thrown while performing
* the property or variable resolution . The thrown exception
* must be included as the cause property of this exception , if
* available . */
public Object getValue ( ELContext context , Object base , Object property ) { } }
|
if ( context == null ) { throw new NullPointerException ( ) ; } if ( base != null ) { return null ; } PageContext ctxt = ( PageContext ) context . getContext ( JspContext . class ) ; if ( "pageContext" . equals ( property ) ) { context . setPropertyResolved ( true ) ; return ctxt ; } ImplicitObjects implicitObjects = ImplicitObjects . getImplicitObjects ( ctxt ) ; if ( "pageScope" . equals ( property ) ) { context . setPropertyResolved ( true ) ; return implicitObjects . getPageScopeMap ( ) ; } if ( "requestScope" . equals ( property ) ) { context . setPropertyResolved ( true ) ; return implicitObjects . getRequestScopeMap ( ) ; } if ( "sessionScope" . equals ( property ) ) { context . setPropertyResolved ( true ) ; return implicitObjects . getSessionScopeMap ( ) ; } if ( "applicationScope" . equals ( property ) ) { context . setPropertyResolved ( true ) ; return implicitObjects . getApplicationScopeMap ( ) ; } if ( "param" . equals ( property ) ) { context . setPropertyResolved ( true ) ; return implicitObjects . getParamMap ( ) ; } if ( "paramValues" . equals ( property ) ) { context . setPropertyResolved ( true ) ; return implicitObjects . getParamsMap ( ) ; } if ( "header" . equals ( property ) ) { context . setPropertyResolved ( true ) ; return implicitObjects . getHeaderMap ( ) ; } if ( "headerValues" . equals ( property ) ) { context . setPropertyResolved ( true ) ; return implicitObjects . getHeadersMap ( ) ; } if ( "initParam" . equals ( property ) ) { context . setPropertyResolved ( true ) ; return implicitObjects . getInitParamMap ( ) ; } if ( "cookie" . equals ( property ) ) { context . setPropertyResolved ( true ) ; return implicitObjects . getCookieMap ( ) ; } return null ;
|
public class MediaTypeSet { /** * Finds the { @ link MediaType } in this { @ link List } that matches one of the media ranges specified in the
* specified string .
* @ param acceptHeaders the values of the { @ code " accept " } header , as defined in
* < a href = " https : / / www . w3 . org / Protocols / rfc2616 / rfc2616 - sec14 . html " > the section 14.1 , RFC2616 < / a >
* @ return the most preferred { @ link MediaType } that matches one of the specified media ranges .
* { @ link Optional # empty ( ) } if there are no matches or { @ code acceptHeaders } does not contain
* any valid ranges . */
public Optional < MediaType > matchHeaders ( Iterable < ? extends CharSequence > acceptHeaders ) { } }
|
requireNonNull ( acceptHeaders , "acceptHeaders" ) ; final List < MediaType > ranges = new ArrayList < > ( 4 ) ; for ( CharSequence acceptHeader : acceptHeaders ) { addRanges ( ranges , acceptHeader ) ; } return match ( ranges ) ;
|
public class ArrayUtils { /** * Concatenates two arrays into one . If arr1 is null or empty , returns arr2.
* If arr2 is null or empty , returns arr1 . May return null if both arrays are null ,
* or one is empty and the other null . < br >
* The concatenated array has componentType which is compatible with both input arrays ( or Object [ ] )
* @ param arr1 input array
* @ param arr2 input array
* @ return Object the concatenated array , elements of arr1 first */
public static Object concat ( Object arr1 , Object arr2 ) { } }
|
int len1 = ( arr1 == null ) ? ( - 1 ) : Array . getLength ( arr1 ) ; if ( len1 <= 0 ) { return arr2 ; } int len2 = ( arr2 == null ) ? ( - 1 ) : Array . getLength ( arr2 ) ; if ( len2 <= 0 ) { return arr1 ; } Class commonComponentType = commonClass ( arr1 . getClass ( ) . getComponentType ( ) , arr2 . getClass ( ) . getComponentType ( ) ) ; Object newArray = Array . newInstance ( commonComponentType , len1 + len2 ) ; System . arraycopy ( arr1 , 0 , newArray , 0 , len1 ) ; System . arraycopy ( arr2 , 0 , newArray , len1 , len2 ) ; return newArray ;
|
public class KTypeArrayDeque { /** * Return the index of the first ( counting from head ) element equal to
* < code > e1 < / code > . The index points to the { @ link # buffer } array .
* @ param e1
* The element to look for .
* @ return Returns the index of the first element equal to < code > e1 < / code > or
* < code > - 1 < / code > if not found . */
public int bufferIndexOf ( KType e1 ) { } }
|
final int last = tail ; final int bufLen = buffer . length ; for ( int i = head ; i != last ; i = oneRight ( i , bufLen ) ) { if ( Intrinsics . equals ( this , e1 , buffer [ i ] ) ) { return i ; } } return - 1 ;
|
public class DiagnosticsInner { /** * Get Detectors .
* Get Detectors .
* @ param nextPageLink The NextLink from the previous successful call to List operation .
* @ param serviceFuture the ServiceFuture object tracking the Retrofit calls
* @ param serviceCallback the async ServiceCallback to handle successful and failed responses .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the { @ link ServiceFuture } object */
public ServiceFuture < List < DetectorDefinitionInner > > listSiteDetectorsNextAsync ( final String nextPageLink , final ServiceFuture < List < DetectorDefinitionInner > > serviceFuture , final ListOperationCallback < DetectorDefinitionInner > serviceCallback ) { } }
|
return AzureServiceFuture . fromPageResponse ( listSiteDetectorsNextSinglePageAsync ( nextPageLink ) , new Func1 < String , Observable < ServiceResponse < Page < DetectorDefinitionInner > > > > ( ) { @ Override public Observable < ServiceResponse < Page < DetectorDefinitionInner > > > call ( String nextPageLink ) { return listSiteDetectorsNextSinglePageAsync ( nextPageLink ) ; } } , serviceCallback ) ;
|
public class OperatorUtil { /** * Returns the number of inputs for the given { @ link Operator } type . < br >
* Currently , it can be 0 , 1 , or 2.
* @ param contractType
* the type of the Operator
* @ return the number of input contracts */
public static int getNumInputs ( final Class < ? extends Operator < ? > > contractType ) { } }
|
if ( GenericDataSourceBase . class . isAssignableFrom ( contractType ) ) { return 0 ; } if ( GenericDataSinkBase . class . isAssignableFrom ( contractType ) || SingleInputOperator . class . isAssignableFrom ( contractType ) ) { return 1 ; } if ( DualInputOperator . class . isAssignableFrom ( contractType ) ) { return 2 ; } throw new IllegalArgumentException ( "not supported" ) ;
|
public class ProviderFactory { /** * Add the result to cache before return */
private static Type [ ] getGenericInterfaces ( Class < ? > cls , Class < ? > expectedClass , Class < ? > commonBaseCls ) { } }
|
if ( Object . class == cls ) { return emptyType ; } Type [ ] cachedTypes = getTypes ( cls , expectedClass , commonBaseCls ) ; if ( cachedTypes != null ) return cachedTypes ; if ( expectedClass != null ) { Type genericSuperType = cls . getGenericSuperclass ( ) ; if ( genericSuperType instanceof ParameterizedType ) { Class < ? > actualType = InjectionUtils . getActualType ( genericSuperType ) ; if ( actualType != null && actualType . isAssignableFrom ( expectedClass ) ) { Type [ ] tempTypes = new Type [ ] { genericSuperType } ; putTypes ( cls , expectedClass , commonBaseCls , tempTypes ) ; return tempTypes ; } else if ( commonBaseCls != null && commonBaseCls != Object . class && commonBaseCls . isAssignableFrom ( expectedClass ) && commonBaseCls . isAssignableFrom ( actualType ) || expectedClass . isAssignableFrom ( actualType ) ) { putTypes ( cls , expectedClass , commonBaseCls , emptyType ) ; return emptyType ; } } } Type [ ] types = cls . getGenericInterfaces ( ) ; if ( types . length > 0 ) { putTypes ( cls , expectedClass , commonBaseCls , types ) ; return types ; } Type [ ] superGenericTypes = getGenericInterfaces ( cls . getSuperclass ( ) , expectedClass , commonBaseCls ) ; putTypes ( cls , expectedClass , commonBaseCls , superGenericTypes ) ; return superGenericTypes ;
|
public class RegisteredService { /** * Construct a new immutable { @ code RegisteredService } instance .
* @ param name The value for the { @ code name } attribute
* @ param url The value for the { @ code url } attribute
* @ return An immutable RegisteredService instance */
public static RegisteredService of ( String name , URI url , Optional < String > portName ) { } }
|
return new RegisteredService ( name , url , portName ) ;
|
public class GitLabApi { /** * Enable the logging of the requests to and the responses from the GitLab server API using the
* GitLab4J shared Logger instance .
* @ param level the logging level ( SEVERE , WARNING , INFO , CONFIG , FINE , FINER , FINEST )
* @ param maxEntitySize maximum number of entity bytes to be logged . When logging if the maxEntitySize
* is reached , the entity logging will be truncated at maxEntitySize and " . . . more . . . " will be added at
* the end of the log entry . If maxEntitySize is & lt ; = 0 , entity logging will be disabled
* @ param maskedHeaderNames a list of header names that should have the values masked */
public void enableRequestResponseLogging ( Level level , int maxEntitySize , List < String > maskedHeaderNames ) { } }
|
apiClient . enableRequestResponseLogging ( LOGGER , level , maxEntitySize , maskedHeaderNames ) ;
|
public class NumberUtils { /** * makes a hash out of an int */
static int hash ( int n ) { } }
|
int hash = 5381 ; hash = ( ( hash << 5 ) + hash ) + ( n & 0xFF ) ; /* hash * 33 + c */
hash = ( ( hash << 5 ) + hash ) + ( ( n >> 8 ) & 0xFF ) ; hash = ( ( hash << 5 ) + hash ) + ( ( n >> 16 ) & 0xFF ) ; hash = ( ( hash << 5 ) + hash ) + ( ( n >> 24 ) & 0xFF ) ; hash &= 0x7FFFFFFF ; return hash ;
|
public class ChatGlyph { /** * Attempt to translate this glyph . */
public void translate ( int dx , int dy ) { } }
|
setLocation ( _bounds . x + dx , _bounds . y + dy ) ;
|
public class CPAttachmentFileEntryUtil { /** * Returns the number of cp attachment file entries where classNameId = & # 63 ; and classPK = & # 63 ; and displayDate & lt ; & # 63 ; and status = & # 63 ; .
* @ param classNameId the class name ID
* @ param classPK the class pk
* @ param displayDate the display date
* @ param status the status
* @ return the number of matching cp attachment file entries */
public static int countByC_C_LtD_S ( long classNameId , long classPK , Date displayDate , int status ) { } }
|
return getPersistence ( ) . countByC_C_LtD_S ( classNameId , classPK , displayDate , status ) ;
|
public class NamespaceNotifierClient { /** * Removes a previously placed watch for a particular event type from the
* given path . If the watch is not actually present at that path before
* calling the method , nothing will happen .
* To remove the watch for all event types at this path , use
* { @ link # removeAllWatches ( String ) } .
* @ param path the path from which the watch is removed . For the FILE _ ADDED event
* type , this represents the path of the directory under which the
* file will be created .
* @ param watchType the type of the event for which don ' t want to receive
* notifications from now on .
* @ return true if successfully removed watch . false if the watch wasn ' t
* placed before calling this method .
* @ throws WatchNotPlacedException if the watch wasn ' t placed before calling
* this method .
* @ throws NotConnectedToServerException when the Watcher . connectionSuccessful
* method was not called ( the connection to the server isn ' t
* established yet ) at start - up or after a Watcher . connectionFailed
* call . The Watcher . connectionFailed could of happened anytime
* since the last Watcher . connectionSuccessfull call until this
* method returns . */
public void removeWatch ( String path , EventType watchType ) throws NotConnectedToServerException , InterruptedException , WatchNotPlacedException { } }
|
NamespaceEvent event = new NamespaceEvent ( path , watchType . getByteValue ( ) ) ; NamespaceEventKey eventKey = new NamespaceEventKey ( path , watchType ) ; Object connectionLock = connectionManager . getConnectionLock ( ) ; ServerHandler . Client server ; LOG . info ( listeningPort + ": removeWatch: Removing watch from " + NotifierUtils . asString ( eventKey ) + " ..." ) ; if ( ! watchedEvents . containsKey ( eventKey ) ) { LOG . warn ( listeningPort + ": removeWatch: watch doesen't exist at " + NotifierUtils . asString ( eventKey ) + " ..." ) ; throw new WatchNotPlacedException ( ) ; } synchronized ( connectionLock ) { connectionManager . waitForTransparentConnect ( ) ; server = connectionManager . getServer ( ) ; try { server . unsubscribe ( connectionManager . getId ( ) , event ) ; } catch ( InvalidClientIdException e1 ) { LOG . warn ( listeningPort + ": removeWatch: server deleted us" , e1 ) ; connectionManager . failConnection ( true ) ; } catch ( ClientNotSubscribedException e2 ) { LOG . error ( listeningPort + ": removeWatch: event not subscribed" , e2 ) ; } catch ( TException e3 ) { LOG . error ( listeningPort + ": removeWatch: failed communicating to" + " server" , e3 ) ; connectionManager . failConnection ( true ) ; } watchedEvents . remove ( eventKey ) ; } if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( listeningPort + ": Unsubscribed from " + NotifierUtils . asString ( eventKey ) ) ; }
|
public class BuiltInErrorProducer { /** * Helper method to create a accumulator definiton .
* @ param name name of the accumulator .
* @ param valueName name of the value ( initial or total ) .
* @ param statName name of the stat ( exception name or ' cumulated ' ) .
* @ return */
private AccumulatorDefinition createAccumulatorDefinition ( String name , String valueName , String statName ) { } }
|
AccumulatorDefinition definition = new AccumulatorDefinition ( ) ; definition . setName ( name ) ; definition . setProducerName ( getProducerId ( ) ) ; definition . setStatName ( statName ) ; definition . setValueName ( valueName ) ; definition . setIntervalName ( MoskitoConfigurationHolder . getConfiguration ( ) . getErrorHandlingConfig ( ) . getAutoChartErrorsInterval ( ) ) ; return definition ;
|
public class Dialog { /** * Set the margin between content view and Dialog border .
* @ param left The left margin size in pixels .
* @ param top The top margin size in pixels .
* @ param right The right margin size in pixels .
* @ param bottom The bottom margin size in pixels .
* @ return The Dialog for chaining methods . */
public Dialog contentMargin ( int left , int top , int right , int bottom ) { } }
|
mCardView . setContentMargin ( left , top , right , bottom ) ; return this ;
|
public class ApiApp { /** * Set the signer page text 2 color .
* @ param color String hex color code
* @ throws HelloSignException thrown if the color string is an invalid hex
* string */
public void setTextColor2 ( String color ) throws HelloSignException { } }
|
if ( white_labeling_options == null ) { white_labeling_options = new WhiteLabelingOptions ( ) ; } white_labeling_options . setTextColor2 ( color ) ;
|
public class HpackEncoder { /** * Set the maximum table size . */
public void setMaxHeaderTableSize ( ByteBuf out , long maxHeaderTableSize ) throws Http2Exception { } }
|
if ( maxHeaderTableSize < MIN_HEADER_TABLE_SIZE || maxHeaderTableSize > MAX_HEADER_TABLE_SIZE ) { throw connectionError ( PROTOCOL_ERROR , "Header Table Size must be >= %d and <= %d but was %d" , MIN_HEADER_TABLE_SIZE , MAX_HEADER_TABLE_SIZE , maxHeaderTableSize ) ; } if ( this . maxHeaderTableSize == maxHeaderTableSize ) { return ; } this . maxHeaderTableSize = maxHeaderTableSize ; ensureCapacity ( 0 ) ; // Casting to integer is safe as we verified the maxHeaderTableSize is a valid unsigned int .
encodeInteger ( out , 0x20 , 5 , maxHeaderTableSize ) ;
|
public class Menu { /** * Returns for given parameter < i > UUID < / i > the instance of class
* { @ link Menu } .
* @ param _ uuid UUID to search in the cache
* @ return instance of class { @ link Menu }
* @ throws CacheReloadException on error */
public static Menu get ( final UUID _uuid ) throws CacheReloadException { } }
|
return AbstractUserInterfaceObject . < Menu > get ( _uuid , Menu . class , CIAdminUserInterface . Menu . getType ( ) ) ;
|
public class AnnotationUtility { /** * Estract from an annotation of a property the attribute value specified .
* @ param item the item
* @ param annotationClass annotation to analyze
* @ param attribute the attribute
* @ return attribute value as list of string */
public static String extractAsEnumerationValue ( Element item , Class < ? extends Annotation > annotationClass , AnnotationAttributeType attribute ) { } }
|
final Elements elementUtils = BindDataSourceSubProcessor . elementUtils ; final One < String > result = new One < String > ( ) ; extractAttributeValue ( elementUtils , item , annotationClass . getName ( ) , attribute , new OnAttributeFoundListener ( ) { @ Override public void onFound ( String value ) { if ( value . indexOf ( "." ) >= 0 ) result . value0 = value . substring ( value . lastIndexOf ( "." ) + 1 ) ; } } ) ; return result . value0 ;
|
public class SARLValidator { /** * Check the type of the behavior unit ' s guard .
* @ param behaviorUnit the behavior unit . */
@ Check ( CheckType . FAST ) public void checkBehaviorUnitGuardType ( SarlBehaviorUnit behaviorUnit ) { } }
|
final XExpression guard = behaviorUnit . getGuard ( ) ; if ( guard != null ) { if ( this . operationHelper . hasSideEffects ( null , guard ) ) { error ( Messages . SARLValidator_53 , guard , null , ValidationMessageAcceptor . INSIGNIFICANT_INDEX , INVALID_INNER_EXPRESSION ) ; return ; } if ( guard instanceof XBooleanLiteral ) { final XBooleanLiteral booleanLiteral = ( XBooleanLiteral ) guard ; if ( booleanLiteral . isIsTrue ( ) ) { if ( ! isIgnored ( DISCOURAGED_BOOLEAN_EXPRESSION ) ) { addIssue ( Messages . SARLValidator_54 , booleanLiteral , null , ValidationMessageAcceptor . INSIGNIFICANT_INDEX , DISCOURAGED_BOOLEAN_EXPRESSION ) ; } } else if ( ! isIgnored ( UNREACHABLE_BEHAVIOR_UNIT ) ) { addIssue ( Messages . SARLValidator_55 , behaviorUnit , null , ValidationMessageAcceptor . INSIGNIFICANT_INDEX , UNREACHABLE_BEHAVIOR_UNIT , behaviorUnit . getName ( ) . getSimpleName ( ) ) ; } return ; } final LightweightTypeReference fromType = getActualType ( guard ) ; if ( ! fromType . isAssignableFrom ( Boolean . TYPE ) ) { error ( MessageFormat . format ( Messages . SARLValidator_38 , getNameOfTypes ( fromType ) , boolean . class . getName ( ) ) , guard , null , ValidationMessageAcceptor . INSIGNIFICANT_INDEX , INCOMPATIBLE_TYPES ) ; } }
|
public class CachedCounters { /** * Configures component by passing configuration parameters .
* @ param config configuration parameters to be set . */
public void configure ( ConfigParams config ) { } }
|
_interval = config . getAsLongWithDefault ( "interval" , _defaultInterval ) ; _resetTimeout = config . getAsLongWithDefault ( "reset_timeout" , _resetTimeout ) ;
|
public class ScriptContext { /** * Copies a { @ link DataSet } entry from one { @ link DataSet } to another .
* @ param srcDataSetKey
* the source data set key
* @ param srcKey
* the source entry key
* @ param destDataSetKey
* the destination data set key
* @ param destKey
* the destination entry key */
@ Cmd public void copyFormEntry ( final String srcDataSetKey , final String srcKey , final String destDataSetKey , final String destKey ) { } }
|
Map < String , DataSet > currentDataSets = dataSourceProvider . get ( ) . getCurrentDataSets ( ) ; DataSet srcDataSet = currentDataSets . get ( srcDataSetKey ) ; DataSet destDataSet = currentDataSets . get ( destDataSetKey ) ; destDataSet . setFixedValue ( destKey , srcDataSet . getValue ( srcKey ) ) ;
|
public class IPAddressSeqRange { /** * This iterator is used for the case where the range is non - multiple */
protected static < T extends Address , S extends AddressSegment > Iterator < T > iterator ( T original , AddressCreator < T , ? , ? , S > creator ) { } }
|
return IPAddressSection . iterator ( original , creator , null ) ;
|
public class SimpleDataSet { /** * Converts this dataset into one meant for classification problems . The
* given categorical feature index is removed from the data and made the
* target variable for the classification problem .
* @ param index the classification variable index , should be in the range
* [ 0 , { @ link # getNumCategoricalVars ( ) } )
* @ return a new dataset where one categorical variable is removed and made
* the target of a classification dataset */
public ClassificationDataSet asClassificationDataSet ( int index ) { } }
|
if ( index < 0 ) throw new IllegalArgumentException ( "Index must be a non-negative value" ) ; else if ( getNumCategoricalVars ( ) == 0 ) throw new IllegalArgumentException ( "Dataset has no categorical variables, can not create classification dataset" ) ; else if ( index >= getNumCategoricalVars ( ) ) throw new IllegalArgumentException ( "Index " + index + " is larger than number of categorical features " + getNumCategoricalVars ( ) ) ; return new ClassificationDataSet ( this , index ) ;
|
public class UUIDMapper { /** * Returns the { @ link String } representation of the specified { @ link UUID } . The returned value has the same
* collation as { @ link UUIDType } .
* @ param uuid the { @ link UUID } to be serialized
* @ return the { @ link String } representation of the specified { @ link UUID } */
static String serialize ( UUID uuid ) { } }
|
StringBuilder sb = new StringBuilder ( ) ; // Get UUID type version
ByteBuffer bb = UUIDType . instance . decompose ( uuid ) ; int version = ( bb . get ( bb . position ( ) + 6 ) >> 4 ) & 0x0f ; // Add version at the beginning
sb . append ( ByteBufferUtils . toHex ( ( byte ) version ) ) ; // If it ' s a time based UUID , add the UNIX timestamp
if ( version == 1 ) { long timestamp = uuid . timestamp ( ) ; String timestampHex = ByteBufferUtils . toHex ( Longs . toByteArray ( timestamp ) ) ; sb . append ( timestampHex ) ; } // Add the UUID itself
sb . append ( ByteBufferUtils . toHex ( bb ) ) ; return sb . toString ( ) ;
|
public class CommandArgs { /** * Add a map ( hash ) argument .
* @ param map the map , must not be { @ literal null } .
* @ return the command args . */
public CommandArgs < K , V > add ( Map < K , V > map ) { } }
|
LettuceAssert . notNull ( map , "Map must not be null" ) ; for ( Map . Entry < K , V > entry : map . entrySet ( ) ) { addKey ( entry . getKey ( ) ) . addValue ( entry . getValue ( ) ) ; } return this ;
|
public class StandardBeanInfo { /** * Introspects the supplied class and returns a list of the Properties of
* the class
* @ param stopClass -
* the to introspecting at
* @ return The list of Properties as an array of PropertyDescriptors
* @ throws IntrospectionException */
@ SuppressWarnings ( "unchecked" ) private PropertyDescriptor [ ] introspectProperties ( Class < ? > stopClass ) throws IntrospectionException { } }
|
// Get descriptors for the public methods
MethodDescriptor [ ] methodDescriptors = introspectMethods ( ) ; if ( methodDescriptors == null ) { return null ; } ArrayList < MethodDescriptor > methodList = new ArrayList < MethodDescriptor > ( ) ; // Loop over the methods found , looking for public non - static methods
for ( int index = 0 ; index < methodDescriptors . length ; index ++ ) { int modifiers = methodDescriptors [ index ] . getMethod ( ) . getModifiers ( ) ; if ( ! Modifier . isStatic ( modifiers ) ) { methodList . add ( methodDescriptors [ index ] ) ; } } // Get the list of public non - static methods into an array
int methodCount = methodList . size ( ) ; MethodDescriptor [ ] theMethods = null ; if ( methodCount > 0 ) { theMethods = new MethodDescriptor [ methodCount ] ; theMethods = methodList . toArray ( theMethods ) ; } if ( theMethods == null ) { return null ; } HashMap < String , HashMap > propertyTable = new HashMap < String , HashMap > ( theMethods . length ) ; // Search for methods that either get or set a Property
for ( int i = 0 ; i < theMethods . length ; i ++ ) { introspectGet ( theMethods [ i ] . getMethod ( ) , propertyTable ) ; introspectSet ( theMethods [ i ] . getMethod ( ) , propertyTable ) ; } // fix possible getter & setter collisions
fixGetSet ( propertyTable ) ; // If there are listener methods , should be bound .
MethodDescriptor [ ] allMethods = introspectMethods ( true ) ; if ( stopClass != null ) { MethodDescriptor [ ] excludeMethods = introspectMethods ( true , stopClass ) ; if ( excludeMethods != null ) { ArrayList < MethodDescriptor > tempMethods = new ArrayList < MethodDescriptor > ( ) ; for ( MethodDescriptor method : allMethods ) { if ( ! isInSuper ( method , excludeMethods ) ) { tempMethods . add ( method ) ; } } allMethods = tempMethods . toArray ( new MethodDescriptor [ 0 ] ) ; } } for ( int i = 0 ; i < allMethods . length ; i ++ ) { introspectPropertyListener ( allMethods [ i ] . getMethod ( ) ) ; } // Put the properties found into the PropertyDescriptor array
ArrayList < PropertyDescriptor > propertyList = new ArrayList < PropertyDescriptor > ( ) ; for ( Map . Entry < String , HashMap > entry : propertyTable . entrySet ( ) ) { String propertyName = entry . getKey ( ) ; HashMap table = entry . getValue ( ) ; if ( table == null ) { continue ; } String normalTag = ( String ) table . get ( STR_NORMAL ) ; String indexedTag = ( String ) table . get ( STR_INDEXED ) ; if ( ( normalTag == null ) && ( indexedTag == null ) ) { continue ; } Method get = ( Method ) table . get ( STR_NORMAL + PREFIX_GET ) ; Method set = ( Method ) table . get ( STR_NORMAL + PREFIX_SET ) ; Method indexedGet = ( Method ) table . get ( STR_INDEXED + PREFIX_GET ) ; Method indexedSet = ( Method ) table . get ( STR_INDEXED + PREFIX_SET ) ; PropertyDescriptor propertyDesc = null ; if ( indexedTag == null ) { propertyDesc = new PropertyDescriptor ( propertyName , get , set ) ; } else { try { propertyDesc = new IndexedPropertyDescriptor ( propertyName , get , set , indexedGet , indexedSet ) ; } catch ( IntrospectionException e ) { // If the getter and the indexGetter is not compatible , try
// getter / setter is null ;
propertyDesc = new IndexedPropertyDescriptor ( propertyName , null , null , indexedGet , indexedSet ) ; } } // RI set propretyDescriptor as bound . FIXME
// propertyDesc . setBound ( true ) ;
if ( canAddPropertyChangeListener && canRemovePropertyChangeListener ) { propertyDesc . setBound ( true ) ; } else { propertyDesc . setBound ( false ) ; } if ( table . get ( STR_IS_CONSTRAINED ) == Boolean . TRUE ) { // $ NON - NLS - 1 $
propertyDesc . setConstrained ( true ) ; } propertyList . add ( propertyDesc ) ; } PropertyDescriptor [ ] theProperties = new PropertyDescriptor [ propertyList . size ( ) ] ; propertyList . toArray ( theProperties ) ; return theProperties ;
|
public class PrcSalesInvoiceSave { /** * < p > Make save preparations before insert / update block if it ' s need . < / p >
* @ param pReqVars additional param
* @ param pEntity entity
* @ param pRequestData Request Data
* @ throws Exception - an exception */
@ Override public final void makeFirstPrepareForSave ( final Map < String , Object > pReqVars , final SalesInvoice pEntity , final IRequestData pRequestData ) throws Exception { } }
|
if ( pEntity . getPrepaymentFrom ( ) != null ) { pEntity . setPrepaymentFrom ( getSrvOrm ( ) . retrieveEntity ( pReqVars , pEntity . getPrepaymentFrom ( ) ) ) ; if ( pEntity . getReversedId ( ) == null && pEntity . getPrepaymentFrom ( ) . getSalesInvoiceId ( ) != null && ! pEntity . getHasMadeAccEntries ( ) ) { throw new ExceptionWithCode ( ExceptionWithCode . WRONG_PARAMETER , "prepayment_already_in_use" ) ; } if ( pEntity . getReversedId ( ) == null && ! pEntity . getPrepaymentFrom ( ) . getCustomer ( ) . getItsId ( ) . equals ( pEntity . getCustomer ( ) . getItsId ( ) ) ) { throw new ExceptionWithCode ( ExceptionWithCode . WRONG_PARAMETER , "prepayment_for_different_vendor" ) ; } } if ( pEntity . getReversedId ( ) != null && pEntity . getPrepaymentFrom ( ) != null && pEntity . getPaymentTotal ( ) . compareTo ( pEntity . getPrepaymentFrom ( ) . getItsTotal ( ) ) != 0 ) { throw new ExceptionWithCode ( ExceptionWithCode . WRONG_PARAMETER , "reverse_payments_first" ) ; } if ( pEntity . getReversedId ( ) != null && pEntity . getPrepaymentFrom ( ) == null && pEntity . getPaymentTotal ( ) . compareTo ( BigDecimal . ZERO ) != 0 ) { throw new ExceptionWithCode ( ExceptionWithCode . WRONG_PARAMETER , "reverse_payments_first" ) ; } if ( pEntity . getReversedId ( ) == null ) { calculateTotalPayment ( pReqVars , pEntity ) ; } if ( ! pEntity . getIsNew ( ) ) { pReqVars . put ( "DebtorCreditortaxDestinationdeepLevel" , 2 ) ; Set < String > ndFlDc = new HashSet < String > ( ) ; ndFlDc . add ( "itsId" ) ; ndFlDc . add ( "isForeigner" ) ; ndFlDc . add ( "taxDestination" ) ; pReqVars . put ( "DebtorCreditorneededFields" , ndFlDc ) ; }
|
public class TreeNode { /** * Freezes the current tree node to make it the latest child of its parent
* ( discarding nodes that have been tacked on after it in the same hierarchy level ) ; and
* recursively apply to all of its ancestors .
* < p > This is because it ' s only called at time of error . If an ancestor node has a child node that
* was added during the process of trying other alternatives and then failed , those paths don ' t
* matter . So we should restore the tree back to when this most relevant error happened .
* < p > Returns the root node , which can then be used to { @ link # toParseTree ( ) } . */
TreeNode freeze ( int index ) { } }
|
TreeNode node = this ; node . setEndIndex ( index ) ; while ( node . parent != null ) { node . parent . latestChild = node ; node = node . parent ; node . setEndIndex ( index ) ; } return node ;
|
public class ProfileActivationInitializer { /** * This method does two things during the initialization stage of Spring context :
* 1 ) If there is no active or default profile , activate one or more according to the hostname of the computer it is running on ;
* 2 ) Makes the first active profile name available as property " env . mainProfile " */
@ Override public void initialize ( ConfigurableApplicationContext context ) { } }
|
ConfigurableEnvironment env = context . getEnvironment ( ) ; String [ ] activeProfiles = env . getActiveProfiles ( ) ; if ( activeProfiles == null || activeProfiles . length == 0 ) { // don ' t override settings in configuration files and command line argument
activeProfiles = chooser . getActiveProfiles ( ) ; if ( activeProfiles != null && activeProfiles . length > 0 ) { env . setActiveProfiles ( activeProfiles ) ; logger . info ( "Active profiles have been choosen as: " + Arrays . toString ( activeProfiles ) ) ; } else { logger . warn ( "No active profile has been choosen." ) ; } } else { logger . info ( "Active profiles had already been specified as: " + Arrays . toString ( activeProfiles ) ) ; } // set additional properties
activeProfiles = env . getActiveProfiles ( ) ; if ( activeProfiles != null && activeProfiles . length > 0 ) { String firstProfile = activeProfiles [ 0 ] ; // the first one is the " main " one
MutablePropertySources propertySources = env . getPropertySources ( ) ; Map < String , Object > additionalProperties = new HashMap < String , Object > ( ) ; additionalProperties . put ( FIRST_PROFILE_PLACEHOLDER_NAME , firstProfile ) ; System . setProperty ( FIRST_PROFILE_PLACEHOLDER_NAME , firstProfile ) ; logger . info ( "Property (can be used as a placeholder) '{}' has been set to: {}" , FIRST_PROFILE_PLACEHOLDER_NAME , firstProfile ) ; if ( activeProfiles . length > 1 ) { String secondProfile = activeProfiles [ 1 ] ; additionalProperties . put ( SECOND_PROFILE_PLACEHOLDER_NAME , secondProfile ) ; System . setProperty ( SECOND_PROFILE_PLACEHOLDER_NAME , secondProfile ) ; logger . info ( "Property (can be used as a placeholder) '{}' has been set to: {}" , SECOND_PROFILE_PLACEHOLDER_NAME , secondProfile ) ; } propertySources . addFirst ( new MapPropertySource ( PROPERTY_SOURCE_NAME , additionalProperties ) ) ; }
|
public class BccClient { /** * Rollback the volume with the specified volume snapshot .
* You can rollback the specified volume only when the volume is Available ,
* otherwise , it ' s will get < code > 409 < / code > errorCode .
* The snapshot used to rollback must be created by the volume ,
* otherwise , it ' s will get < code > 404 < / code > errorCode .
* If rolling back the system volume , the instance must be Running or Stopped ,
* otherwise , it ' s will get < code > 409 < / code > errorCode . After rolling back the
* volume , all the system disk data will erase .
* @ param request The request containing all options for rolling back the specified volume . */
public void rollbackVolume ( RollbackVolumeRequest request ) { } }
|
checkNotNull ( request , "request should not be null." ) ; checkStringNotEmpty ( request . getVolumeId ( ) , "request volumeId should not be empty." ) ; checkStringNotEmpty ( request . getSnapshotId ( ) , "request snapshotId should not be empty." ) ; InternalRequest internalRequest = this . createRequest ( request , HttpMethodName . PUT , VOLUME_PREFIX , request . getVolumeId ( ) ) ; internalRequest . addParameter ( VolumeAction . rollback . name ( ) , null ) ; fillPayload ( internalRequest , request ) ; invokeHttpClient ( internalRequest , AbstractBceResponse . class ) ;
|
public class XMLUtils { /** * Transform file with XML filters .
* @ param inputFile file to transform and replace
* @ param filters XML filters to transform file with , may be an empty list */
public void transform ( final File inputFile , final List < XMLFilter > filters ) throws DITAOTException { } }
|
final File outputFile = new File ( inputFile . getAbsolutePath ( ) + FILE_EXTENSION_TEMP ) ; transformFile ( inputFile , outputFile , filters ) ; try { deleteQuietly ( inputFile ) ; moveFile ( outputFile , inputFile ) ; } catch ( final RuntimeException e ) { throw e ; } catch ( final Exception e ) { throw new DITAOTException ( "Failed to replace " + inputFile + ": " + e . getMessage ( ) ) ; }
|
public class AuthServerLogic { /** * Validate a user account
* @ param token */
public boolean validateAccount ( String token ) throws DAOException { } }
|
Query q = new QueryBuilder ( ) . select ( ) . from ( Credentials . class ) . where ( "validation" , OPERAND . EQ , token ) . build ( ) ; TransientObject to = ObjectUtils . get1stOrNull ( dao . query ( q ) ) ; if ( to != null ) { ServerCredentials creds = new ServerCredentials ( to ) ; creds . setValidation ( "1" ) ; dao . save ( creds ) ; return true ; } else { return false ; }
|
public class JDBCConnection { /** * # ifdef JAVA4 */
public synchronized Savepoint setSavepoint ( String name ) throws SQLException { } }
|
checkClosed ( ) ; if ( JDBCDatabaseMetaData . JDBC_MAJOR >= 4 && getAutoCommit ( ) ) { throw Util . sqlException ( ErrorCode . X_3B001 ) ; } if ( name == null ) { throw Util . nullArgument ( ) ; } if ( "SYSTEM_SAVEPOINT" . equals ( name ) ) { throw Util . invalidArgument ( ) ; } try { sessionProxy . savepoint ( name ) ; } catch ( HsqlException e ) { Util . throwError ( e ) ; } return new JDBCSavepoint ( name , this ) ;
|
public class SpectatorContext { /** * Create a gauge based on the config . */
public static LazyGauge gauge ( MonitorConfig config ) { } }
|
return new LazyGauge ( Registry :: gauge , registry , createId ( config ) ) ;
|
public class GroovyRuntimeUtil { /** * Note : This method may throw checked exceptions although it doesn ' t say so . */
@ SuppressWarnings ( "unchecked" ) public static < T > T invokeClosure ( Closure < T > closure , Object ... args ) { } }
|
try { return closure . call ( args ) ; } catch ( InvokerInvocationException e ) { ExceptionUtil . sneakyThrow ( e . getCause ( ) ) ; return null ; // never reached
}
|
public class DistributedTreeUtil { /** * Returns an { @ link Iterable } over a node ' s path components .
* @ param node A tree - node ' s full path .
* @ return An { @ link Iterable } over a node ' s path components . */
public static Iterable < String > iterate ( final String node ) { } }
|
return new Iterable < String > ( ) { @ Override public Iterator < String > iterator ( ) { return new Scanner ( node ) . useDelimiter ( "/" ) ; } } ;
|
public class Covers { /** * Computes an incremental transition cover for a given automaton , i . e . a cover that only contains the missing
* sequences for obtaining a complete transition cover .
* @ param automaton
* the automaton for which the cover should be computed
* @ param inputs
* the set of input symbols allowed in the cover sequences
* @ param oldTransCover
* the collection containing the already existing sequences of the transition cover
* @ param newTransCover
* the collection in which the missing sequences will be stored
* @ param < I >
* input symbol type
* @ return { @ code true } if new sequences have been added to the state cover , { @ code false } otherwise .
* @ see # transitionCover ( DeterministicAutomaton , Collection , Collection ) */
public static < I > boolean incrementalTransitionCover ( DeterministicAutomaton < ? , I , ? > automaton , Collection < ? extends I > inputs , Collection < ? extends Word < I > > oldTransCover , Collection < ? super Word < I > > newTransCover ) { } }
|
final int oldTransSize = newTransCover . size ( ) ; incrementalCover ( automaton , inputs , Collections . emptySet ( ) , oldTransCover , w -> { } , newTransCover :: add ) ; return oldTransSize < newTransCover . size ( ) ;
|
public class GVRAvatar { /** * Load a model to attach to the avatar
* @ param avatarResource resource with avatar model
* @ param attachBone name of bone to attach model to */
public void loadModel ( GVRAndroidResource avatarResource , String attachBone ) { } }
|
EnumSet < GVRImportSettings > settings = GVRImportSettings . getRecommendedSettingsWith ( EnumSet . of ( GVRImportSettings . OPTIMIZE_GRAPH , GVRImportSettings . NO_ANIMATION ) ) ; GVRContext ctx = mAvatarRoot . getGVRContext ( ) ; GVRResourceVolume volume = new GVRResourceVolume ( ctx , avatarResource ) ; GVRSceneObject modelRoot = new GVRSceneObject ( ctx ) ; GVRSceneObject boneObject ; int boneIndex ; if ( mSkeleton == null ) { throw new IllegalArgumentException ( "Cannot attach model to avatar - there is no skeleton" ) ; } boneIndex = mSkeleton . getBoneIndex ( attachBone ) ; if ( boneIndex < 0 ) { throw new IllegalArgumentException ( attachBone + " is not a bone in the avatar skeleton" ) ; } boneObject = mSkeleton . getBone ( boneIndex ) ; if ( boneObject == null ) { throw new IllegalArgumentException ( attachBone + " does not have a bone object in the avatar skeleton" ) ; } boneObject . addChildObject ( modelRoot ) ; ctx . getAssetLoader ( ) . loadModel ( volume , modelRoot , settings , false , mLoadModelHandler ) ;
|
public class LineItemActivityAssociation { /** * Sets the clickThroughConversionCost value for this LineItemActivityAssociation .
* @ param clickThroughConversionCost * The amount of money to attribute per click through conversion .
* This attribute is
* required for creating a { @ code LineItemActivityAssociation } .
* The currency code is readonly
* and should match the { @ link LineItem } . */
public void setClickThroughConversionCost ( com . google . api . ads . admanager . axis . v201902 . Money clickThroughConversionCost ) { } }
|
this . clickThroughConversionCost = clickThroughConversionCost ;
|
public class ExecutableFlowPriorityComparator { /** * < pre >
* Sorting order is determined by : -
* 1 . descending order of priority
* 2 . if same priority , ascending order of update time
* 3 . if same priority and updateTime , ascending order of execution id
* < / pre >
* { @ inheritDoc }
* @ see java . util . Comparator # compare ( java . lang . Object , java . lang . Object ) */
@ Override public int compare ( final Pair < ExecutionReference , ExecutableFlow > pair1 , final Pair < ExecutionReference , ExecutableFlow > pair2 ) { } }
|
ExecutableFlow exflow1 = null , exflow2 = null ; if ( pair1 != null && pair1 . getSecond ( ) != null ) { exflow1 = pair1 . getSecond ( ) ; } if ( pair2 != null && pair2 . getSecond ( ) != null ) { exflow2 = pair2 . getSecond ( ) ; } if ( exflow1 == null && exflow2 == null ) { return 0 ; } else if ( exflow1 == null ) { return - 1 ; } else if ( exflow2 == null ) { return 1 ; } else { // descending order of priority
int diff = getPriority ( exflow2 ) - getPriority ( exflow1 ) ; if ( diff == 0 ) { // ascending order of update time , if same priority
diff = Long . compare ( exflow1 . getUpdateTime ( ) , exflow2 . getUpdateTime ( ) ) ; } if ( diff == 0 ) { // ascending order of execution id , if same priority and updateTime
diff = exflow1 . getExecutionId ( ) - exflow2 . getExecutionId ( ) ; } return diff ; }
|
public class X509Extensions { /** * < pre >
* Extensions : : = SEQUENCE SIZE ( 1 . . MAX ) OF Extension
* Extension : : = SEQUENCE {
* extnId EXTENSION . & id ( { ExtensionSet } ) ,
* critical BOOLEAN DEFAULT FALSE ,
* extnValue OCTET STRING }
* < / pre > */
public DERObject toASN1Object ( ) { } }
|
ASN1EncodableVector vec = new ASN1EncodableVector ( ) ; Enumeration e = ordering . elements ( ) ; while ( e . hasMoreElements ( ) ) { DERObjectIdentifier oid = ( DERObjectIdentifier ) e . nextElement ( ) ; X509Extension ext = ( X509Extension ) extensions . get ( oid ) ; ASN1EncodableVector v = new ASN1EncodableVector ( ) ; v . add ( oid ) ; if ( ext . isCritical ( ) ) { v . add ( new DERBoolean ( true ) ) ; } v . add ( ext . getValue ( ) ) ; vec . add ( new DERSequence ( v ) ) ; } return new DERSequence ( vec ) ;
|
public class JPAComponentImpl { /** * Locates and processes persistence . xml file in an EJB module . < p >
* @ param applInfo the application archive information
* @ param module the EJB module archive information */
private void processEJBModulePersistenceXml ( JPAApplInfo applInfo , ContainerInfo module , ClassLoader appClassloader ) { } }
|
final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "processEJBModulePersistenceXml : " + applInfo . getApplName ( ) + "#" + module . getName ( ) ) ; String archiveName = module . getName ( ) ; Container ejbContainer = module . getContainer ( ) ; ClassLoader ejbClassLoader = appClassloader ; // JPA 2.0 Specification - 8.2 Persistence Unit Packaging
// A persistence unit is defined by a persistence . xml file . The jar file or
// directory whose META - INF directory contains the persistence . xml file is
// termed the root of the persistence unit . In Java EE environments , the
// root of a persistence unit may be one of the following :
// - > an EJB - JAR file
// Obtain persistence . xml in META - INF
Entry pxml = ejbContainer . getEntry ( "META-INF/persistence.xml" ) ; if ( pxml != null ) { String appName = applInfo . getApplName ( ) ; URL puRoot = getPXmlRootURL ( appName , archiveName , pxml ) ; applInfo . addPersistenceUnits ( new OSGiJPAPXml ( applInfo , archiveName , JPAPuScope . EJB_Scope , puRoot , ejbClassLoader , pxml ) ) ; } if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "processEJBModulePersistenceXml : " + applInfo . getApplName ( ) + "#" + module . getName ( ) ) ;
|
public class ClientJFapCommunicator { /** * Sets the SICoreConnection reference on the server
* @ param connection */
protected void setSICoreConnection ( SICoreConnection connection ) { } }
|
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "setSICoreConnection" , connection ) ; // Retrieve Client Conversation State if necessary
validateConversationState ( ) ; cConState . setSICoreConnection ( connection ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "setSICoreConnection" ) ;
|
public class BinaryJedis { /** * Move the specified member from the set at srckey to the set at dstkey . This operation is
* atomic , in every given moment the element will appear to be in the source or destination set
* for accessing clients .
* If the source set does not exist or does not contain the specified element no operation is
* performed and zero is returned , otherwise the element is removed from the source set and added
* to the destination set . On success one is returned , even if the element was already present in
* the destination set .
* An error is raised if the source or destination keys contain a non Set value .
* Time complexity O ( 1)
* @ param srckey
* @ param dstkey
* @ param member
* @ return Integer reply , specifically : 1 if the element was moved 0 if the element was not found
* on the first set and no operation was performed */
@ Override public Long smove ( final byte [ ] srckey , final byte [ ] dstkey , final byte [ ] member ) { } }
|
checkIsInMultiOrPipeline ( ) ; client . smove ( srckey , dstkey , member ) ; return client . getIntegerReply ( ) ;
|
public class Metadata { /** * Remove all values for the given key . If there were no values , { @ code null } is returned . */
public < T > Iterable < T > removeAll ( Key < T > key ) { } }
|
if ( isEmpty ( ) ) { return null ; } int writeIdx = 0 ; int readIdx = 0 ; List < T > ret = null ; for ( ; readIdx < size ; readIdx ++ ) { if ( bytesEqual ( key . asciiName ( ) , name ( readIdx ) ) ) { ret = ret != null ? ret : new ArrayList < T > ( ) ; ret . add ( key . parseBytes ( value ( readIdx ) ) ) ; continue ; } name ( writeIdx , name ( readIdx ) ) ; value ( writeIdx , value ( readIdx ) ) ; writeIdx ++ ; } int newSize = writeIdx ; // Multiply by two since namesAndValues is interleaved .
Arrays . fill ( namesAndValues , writeIdx * 2 , len ( ) , null ) ; size = newSize ; return ret ;
|
public class Convolution { /** * Implement column formatted images
* @ param img the image to process
* @ param kh the kernel height
* @ param kw the kernel width
* @ param sy the stride along y
* @ param sx the stride along x
* @ param ph the padding width
* @ param pw the padding height
* @ param isSameMode whether to cover the whole image or not
* @ return the column formatted image */
public static INDArray im2col ( INDArray img , int kh , int kw , int sy , int sx , int ph , int pw , boolean isSameMode ) { } }
|
return im2col ( img , kh , kw , sy , sx , ph , pw , 1 , 1 , isSameMode ) ;
|
public class CmsCmisResourceHelper { /** * Deletes a CMIS object . < p >
* @ param context the call context
* @ param objectId the id of the object to delete
* @ param allVersions flag to delete all version */
public synchronized void deleteObject ( CmsCmisCallContext context , String objectId , boolean allVersions ) { } }
|
try { CmsObject cms = m_repository . getCmsObject ( context ) ; CmsUUID structureId = new CmsUUID ( objectId ) ; CmsResource resource = cms . readResource ( structureId ) ; if ( resource . isFolder ( ) ) { boolean isLeaf = ! hasChildren ( cms , resource ) ; if ( ! isLeaf ) { throw new CmisConstraintException ( "Only leaf resources can be deleted." ) ; } } ensureLock ( cms , resource ) ; cms . deleteResource ( resource . getRootPath ( ) , CmsResource . DELETE_PRESERVE_SIBLINGS ) ; } catch ( CmsException e ) { handleCmsException ( e ) ; }
|
public class ContentHandlerImporter { /** * ( non - Javadoc )
* @ see org . xml . sax . ContentHandler # characters ( char [ ] , int , int ) */
public void characters ( char ch [ ] , int start , int length ) throws SAXException { } }
|
try { importer . characters ( ch , start , length ) ; } catch ( RepositoryException e ) { throw new SAXException ( e ) ; }
|
public class DB { /** * Resolves user , author , terms and meta for a post .
* @ param post The post builder .
* @ return The builder with resolved items .
* @ throws SQLException on database error . */
public Post . Builder resolve ( final Post . Builder post ) throws SQLException { } }
|
Timer . Context ctx = metrics . resolvePostTimer . time ( ) ; try { User author = resolveUser ( post . getAuthorId ( ) ) ; if ( author != null ) { List < Meta > meta = userMetadata ( post . getAuthorId ( ) ) ; if ( meta . size ( ) > 0 ) { author = author . withMetadata ( meta ) ; } post . setAuthor ( author ) ; } List < Meta > meta = selectPostMeta ( post . getId ( ) ) ; if ( meta . size ( ) > 0 ) { post . setMetadata ( meta ) ; } List < TaxonomyTerm > terms = selectPostTerms ( post . getId ( ) ) ; if ( terms . size ( ) > 0 ) { post . setTaxonomyTerms ( terms ) ; } List < Post > children = selectChildren ( post . getId ( ) , false ) ; if ( children . size ( ) > 0 ) { post . setChildren ( children ) ; } return post ; } finally { ctx . stop ( ) ; }
|
public class KeyValuePairMarshaller { /** * Marshall the given parameter object . */
public void marshall ( KeyValuePair keyValuePair , ProtocolMarshaller protocolMarshaller ) { } }
|
if ( keyValuePair == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( keyValuePair . getName ( ) , NAME_BINDING ) ; protocolMarshaller . marshall ( keyValuePair . getValue ( ) , VALUE_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
|
public class HTTPRequest { /** * A complex type that contains two values for each header in the sampled web request : the name of the header and
* the value of the header .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setHeaders ( java . util . Collection ) } or { @ link # withHeaders ( java . util . Collection ) } if you want to override
* the existing values .
* @ param headers
* A complex type that contains two values for each header in the sampled web request : the name of the header
* and the value of the header .
* @ return Returns a reference to this object so that method calls can be chained together . */
public HTTPRequest withHeaders ( HTTPHeader ... headers ) { } }
|
if ( this . headers == null ) { setHeaders ( new java . util . ArrayList < HTTPHeader > ( headers . length ) ) ; } for ( HTTPHeader ele : headers ) { this . headers . add ( ele ) ; } return this ;
|
public class AmazonSageMakerClient { /** * Gets information about a work team provided by a vendor . It returns details about the subscription with a vendor
* in the AWS Marketplace .
* @ param describeSubscribedWorkteamRequest
* @ return Result of the DescribeSubscribedWorkteam operation returned by the service .
* @ sample AmazonSageMaker . DescribeSubscribedWorkteam
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / sagemaker - 2017-07-24 / DescribeSubscribedWorkteam "
* target = " _ top " > AWS API Documentation < / a > */
@ Override public DescribeSubscribedWorkteamResult describeSubscribedWorkteam ( DescribeSubscribedWorkteamRequest request ) { } }
|
request = beforeClientExecution ( request ) ; return executeDescribeSubscribedWorkteam ( request ) ;
|
public class BlockSort { /** * swaps two values in fmap */
private void fswap ( int [ ] fmap , int zz1 , int zz2 ) { } }
|
int zztmp = fmap [ zz1 ] ; fmap [ zz1 ] = fmap [ zz2 ] ; fmap [ zz2 ] = zztmp ;
|
public class VdmBreakpointPropertyPage { /** * Store the breakpoint properties .
* @ see org . eclipse . jface . preference . IPreferencePage # performOk ( ) */
public boolean performOk ( ) { } }
|
IWorkspaceRunnable wr = new IWorkspaceRunnable ( ) { public void run ( IProgressMonitor monitor ) throws CoreException { IVdmBreakpoint breakpoint = getBreakpoint ( ) ; boolean delOnCancel = breakpoint . getMarker ( ) . getAttribute ( ATTR_DELETE_ON_CANCEL ) != null ; if ( delOnCancel ) { // if this breakpoint is being created , remove the " delete on cancel " attribute
// and register with the breakpoint manager
breakpoint . getMarker ( ) . setAttribute ( ATTR_DELETE_ON_CANCEL , ( String ) null ) ; breakpoint . setRegistered ( true ) ; } doStore ( ) ; } } ; try { ResourcesPlugin . getWorkspace ( ) . run ( wr , null , 0 , null ) ; } catch ( CoreException e ) { // JDIDebugUIPlugin . statusDialog ( e . getStatus ( ) ) ;
// JDIDebugUIPlugin . log ( e ) ;
} return super . performOk ( ) ;
|
public class HashCalculator { /** * Removes all whitespaces from the text - the same way that Shir is doing for source files .
* @ param data - byte array
* @ return file as string */
private byte [ ] stripWhiteSpaces ( byte [ ] data ) { } }
|
ByteArrayOutputStream bos = new ByteArrayOutputStream ( ) ; for ( byte b : data ) { if ( ! WHITESPACES . contains ( b ) ) { bos . write ( b ) ; } } return bos . toByteArray ( ) ;
|
public class Pattern { /** * Returns a matcher taking a text stream as target .
* < b > Note that this is not a true POSIX - style stream matching < / b > , i . e . the whole length of the text is preliminary read and stored in a char array .
* @ param text a text stream
* @ param length the length to read from a stream ; if < code > len < / code > is < code > - 1 < / code > , the whole stream is read in .
* @ throws IOException indicates an IO problem */
@ GwtIncompatible public Matcher matcher ( Reader text , int length ) throws IOException { } }
|
Matcher m = new Matcher ( this ) ; m . setTarget ( text , length ) ; return m ;
|
public class TableManipulationConfigurationBuilder { /** * The type of the database column used to store the entries */
public S dataColumnType ( String dataColumnType ) { } }
|
attributes . attribute ( DATA_COLUMN_TYPE ) . set ( dataColumnType ) ; return self ( ) ;
|
public class DatePickerBase { /** * { @ inheritDoc } */
@ Override protected void onLoad ( ) { } }
|
super . onLoad ( ) ; configure ( ) ; // With the new update the parent must have position : relative for positioning to work
if ( getElement ( ) . getParentElement ( ) != null ) { getElement ( ) . getParentElement ( ) . getStyle ( ) . setPosition ( Style . Position . RELATIVE ) ; }
|
public class BpmnParse { /** * Parses a manual task . */
public ActivityImpl parseManualTask ( Element manualTaskElement , ScopeImpl scope ) { } }
|
ActivityImpl activity = createActivityOnScope ( manualTaskElement , scope ) ; activity . setActivityBehavior ( new ManualTaskActivityBehavior ( ) ) ; parseAsynchronousContinuationForActivity ( manualTaskElement , activity ) ; parseExecutionListenersOnScope ( manualTaskElement , activity ) ; for ( BpmnParseListener parseListener : parseListeners ) { parseListener . parseManualTask ( manualTaskElement , scope , activity ) ; } return activity ;
|
public class DeploymentResourceSupport { /** * Checks to see if a resource has already been registered for the specified address on the subsystem .
* @ param subsystemName the name of the subsystem
* @ param address the address to check
* @ return { @ code true } if the address exists on the subsystem otherwise { @ code false } */
public boolean hasDeploymentSubModel ( final String subsystemName , final PathAddress address ) { } }
|
final Resource root = deploymentUnit . getAttachment ( DEPLOYMENT_RESOURCE ) ; final PathElement subsystem = PathElement . pathElement ( SUBSYSTEM , subsystemName ) ; boolean found = false ; if ( root . hasChild ( subsystem ) ) { if ( address == PathAddress . EMPTY_ADDRESS ) { return true ; } Resource parent = root . getChild ( subsystem ) ; for ( PathElement child : address ) { if ( parent . hasChild ( child ) ) { found = true ; parent = parent . getChild ( child ) ; } else { found = false ; break ; } } } return found ;
|
public class CostGraphDef { /** * < code > repeated . tensorflow . CostGraphDef . Node node = 1 ; < / code > */
public java . util . List < ? extends org . tensorflow . framework . CostGraphDef . NodeOrBuilder > getNodeOrBuilderList ( ) { } }
|
return node_ ;
|
public class EObjects { /** * Creates a map entry of type string , string .
* @ param key of entry
* @ param value of entry
* @ return entry */
@ SuppressWarnings ( "unchecked" ) public static EObject createEntry ( String key , Object value , EClass type ) { } }
|
if ( type == EcorePackage . Literals . ESTRING_TO_STRING_MAP_ENTRY ) { final EObject entry = EcoreUtil . create ( EcorePackage . Literals . ESTRING_TO_STRING_MAP_ENTRY ) ; entry . eSet ( EcorePackage . Literals . ESTRING_TO_STRING_MAP_ENTRY__KEY , key ) ; entry . eSet ( EcorePackage . Literals . ESTRING_TO_STRING_MAP_ENTRY__VALUE , value ) ; return entry ; } else { final BasicEMapEntry entry = new BasicEMapEntry < > ( ) ; entry . eSetClass ( type ) ; entry . setKey ( key ) ; entry . setValue ( value ) ; return entry ; }
|
public class MacroCallTransformingVisitor { /** * Finds all extension methods of { @ link MacroContext } for given methodName
* with @ { @ link org . codehaus . groovy . macro . runtime . Macro } annotation . */
private List < MethodNode > findMacroMethods ( String methodName , List < Expression > callArguments ) { } }
|
List < MethodNode > methods = MacroMethodsCache . get ( classLoader ) . get ( methodName ) ; if ( methods == null ) { // Not a macro call
return Collections . emptyList ( ) ; } ClassNode [ ] argumentsList = new ClassNode [ callArguments . size ( ) ] ; for ( int i = 0 ; i < callArguments . size ( ) ; i ++ ) { argumentsList [ i ] = ClassHelper . make ( callArguments . get ( i ) . getClass ( ) ) ; } return StaticTypeCheckingSupport . chooseBestMethod ( MACRO_CONTEXT_CLASS_NODE , methods , argumentsList ) ;
|
public class Alerts { /** * 弹窗 , modality默认为 { @ link Modality # NONE } , window默认为null , style默认为 { @ link StageStyle # DECORATED }
* @ param title 标题
* @ param header 信息头
* @ param content 内容
* @ param alertType { @ link AlertType }
* @ return { @ link ButtonType } */
public static Optional < ButtonType > alert ( String title , String header , String content , AlertType alertType ) { } }
|
return alert ( title , header , content , alertType , Modality . NONE , null , StageStyle . DECORATED ) ;
|
public class ImageIOGreyScale { /** * Determines whether the caller has write access to the cache directory , stores the result in the
* < code > CacheInfo < / code > object , and returns the decision . This method helps to prevent mysterious
* SecurityExceptions to be thrown when this convenience class is used in an applet , for example . */
private static boolean hasCachePermission ( ) { } }
|
Boolean hasPermission = getCacheInfo ( ) . getHasPermission ( ) ; if ( hasPermission != null ) { return hasPermission . booleanValue ( ) ; } else { try { SecurityManager security = System . getSecurityManager ( ) ; if ( security != null ) { File cachedir = getCacheDirectory ( ) ; String cachepath ; if ( cachedir != null ) { cachepath = cachedir . getPath ( ) ; } else { cachepath = getTempDir ( ) ; if ( cachepath == null ) { getCacheInfo ( ) . setHasPermission ( Boolean . FALSE ) ; return false ; } } security . checkWrite ( cachepath ) ; } } catch ( SecurityException e ) { getCacheInfo ( ) . setHasPermission ( Boolean . FALSE ) ; return false ; } getCacheInfo ( ) . setHasPermission ( Boolean . TRUE ) ; return true ; }
|
public class StatementDMQL { /** * Return a list of the display columns for the left most statement from a set op
* @ returnn */
private static List < Expression > getDisplayColumnsForSetOp ( QueryExpression queryExpr ) { } }
|
assert ( queryExpr != null ) ; if ( queryExpr . getLeftQueryExpression ( ) == null ) { // end of recursion . This is a QuerySpecification
assert ( queryExpr instanceof QuerySpecification ) ; QuerySpecification select = ( QuerySpecification ) queryExpr ; return select . displayCols ; } else { // recurse
return getDisplayColumnsForSetOp ( queryExpr . getLeftQueryExpression ( ) ) ; }
|
public class StateParser { /** * Returns the string which was actually parsed with all the substitutions performed */
protected static SubstitutedLine doParse ( String str , ParsingStateCallbackHandler callbackHandler , ParsingState initialState , boolean strict , boolean disableResolutionException , CommandContext cmdCtx ) throws CommandFormatException { } }
|
if ( str == null || str . isEmpty ( ) ) { return new SubstitutedLine ( str ) ; } ParsingContextImpl ctx = new ParsingContextImpl ( ) ; ctx . initialState = initialState ; ctx . callbackHandler = callbackHandler ; ctx . input = str ; ctx . strict = strict ; ctx . cmdCtx = cmdCtx ; ctx . disableResolutionException = disableResolutionException ; ctx . substitued . substitued = ctx . parse ( ) ; return ctx . substitued ;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.