signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class NetworkInterface { /** * Convenience method to search for a network interface that
* has the specified Internet Protocol ( IP ) address bound to
* it .
* If the specified IP address is bound to multiple network
* interfaces it is not defined which network interface is
* returned .
* @ param addr
* The < tt > InetAddress < / tt > to search with .
* @ return A < tt > NetworkInterface < / tt >
* or < tt > null < / tt > if there is no network interface
* with the specified IP address .
* @ throws SocketException
* If an I / O error occurs .
* @ throws NullPointerException
* If the specified address is < tt > null < / tt > . */
public static NetworkInterface getByInetAddress ( InetAddress addr ) throws SocketException { } } | if ( addr == null ) { throw new NullPointerException ( ) ; } if ( ! ( addr instanceof Inet4Address || addr instanceof Inet6Address ) ) { throw new IllegalArgumentException ( "invalid address type" ) ; } return getByInetAddress0 ( addr ) ; |
public class SQSMessageConsumerPrefetch { /** * Call < code > receiveMessage < / code > with long - poll wait time of 20 seconds
* with available prefetch batch size and potential re - tries . */
protected List < Message > getMessages ( int prefetchBatchSize ) throws InterruptedException { } } | assert prefetchBatchSize > 0 ; ReceiveMessageRequest receiveMessageRequest = new ReceiveMessageRequest ( queueUrl ) . withMaxNumberOfMessages ( prefetchBatchSize ) . withAttributeNames ( ALL ) . withMessageAttributeNames ( ALL ) . withWaitTimeSeconds ( WAIT_TIME_SECONDS ) ; // if the receive request is for FIFO queue , provide a unique receive request attempt it , so that
// failed calls retried by SDK will claim the same messages
if ( sqsDestination . isFifo ( ) ) { receiveMessageRequest . withReceiveRequestAttemptId ( UUID . randomUUID ( ) . toString ( ) ) ; } List < Message > messages = null ; try { ReceiveMessageResult receivedMessageResult = amazonSQSClient . receiveMessage ( receiveMessageRequest ) ; messages = receivedMessageResult . getMessages ( ) ; retriesAttempted = 0 ; } catch ( JMSException e ) { LOG . warn ( "Encountered exception during receive in ConsumerPrefetch thread" , e ) ; try { sleep ( backoffStrategy . delayBeforeNextRetry ( retriesAttempted ++ ) ) ; } catch ( InterruptedException ex ) { LOG . warn ( "Interrupted while retrying on receive" , ex ) ; throw ex ; } } return messages ; |
public class WebhooksInner { /** * Updates a webhook with the specified parameters .
* @ param resourceGroupName The name of the resource group to which the container registry belongs .
* @ param registryName The name of the container registry .
* @ param webhookName The name of the webhook .
* @ param webhookUpdateParameters The parameters for updating a webhook .
* @ 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 < WebhookInner > updateAsync ( String resourceGroupName , String registryName , String webhookName , WebhookUpdateParameters webhookUpdateParameters , final ServiceCallback < WebhookInner > serviceCallback ) { } } | return ServiceFuture . fromResponse ( updateWithServiceResponseAsync ( resourceGroupName , registryName , webhookName , webhookUpdateParameters ) , serviceCallback ) ; |
public class ErrorCollector { /** * Adds to the table the exception , if any , thrown from { @ code callable } .
* Execution continues , but the test will fail at the end if
* { @ code callable } threw an exception . */
public < T > T checkSucceeds ( Callable < T > callable ) { } } | try { return callable . call ( ) ; } catch ( Throwable e ) { addError ( e ) ; return null ; } |
public class SarlActionBuilderImpl { /** * Add an annotation .
* @ param type the qualified name of the annotation */
public void addAnnotation ( String type ) { } } | if ( ! Strings . isEmpty ( type ) ) { XAnnotation annotation = XAnnotationsFactory . eINSTANCE . createXAnnotation ( ) ; annotation . setAnnotationType ( newTypeRef ( getSarlAction ( ) , type ) . getType ( ) ) ; getSarlAction ( ) . getAnnotations ( ) . add ( annotation ) ; } |
public class JBlinkLabel { /** * Creates new JBlinkLabel .
* @ param obj Undefined . */
public void init ( Object obj ) { } } | for ( int i = 0 ; i < MAX_ICONS ; i ++ ) { ImageIcon icon = this . getImageIcon ( i ) ; if ( icon == null ) break ; this . addIcon ( icon , i ) ; } |
public class servicegroup { /** * Use this API to disable servicegroup . */
public static base_response disable ( nitro_service client , servicegroup resource ) throws Exception { } } | servicegroup disableresource = new servicegroup ( ) ; disableresource . servicegroupname = resource . servicegroupname ; disableresource . servername = resource . servername ; disableresource . port = resource . port ; disableresource . delay = resource . delay ; disableresource . graceful = resource . graceful ; return disableresource . perform_operation ( client , "disable" ) ; |
public class AbstractTemplateView { /** * Create an Launch the animation between two sub slides .
* @ param nextSlide the next subSlide to show */
private void performStepAnimation ( final Node nextSlide ) { } } | // setSlideLocked ( true ) ;
this . slideStepAnimation = ParallelTransitionBuilder . create ( ) . onFinished ( new EventHandler < ActionEvent > ( ) { @ Override public void handle ( final ActionEvent event ) { AbstractTemplateView . this . currentSubSlide = nextSlide ; // AbstractTemplateView . this . setSlideLocked ( false ) ;
} } ) . children ( SequentialTransitionBuilder . create ( ) . node ( this . currentSubSlide ) . children ( TranslateTransitionBuilder . create ( ) . duration ( Duration . millis ( 400 ) ) . fromY ( 0 ) . toY ( - 700 ) // . fromZ ( - 10)
. build ( ) , TimelineBuilder . create ( ) . keyFrames ( new KeyFrame ( Duration . millis ( 0 ) , new KeyValue ( this . currentSubSlide . visibleProperty ( ) , true ) ) , new KeyFrame ( Duration . millis ( 1 ) , new KeyValue ( this . currentSubSlide . visibleProperty ( ) , false ) ) ) . build ( ) ) . build ( ) , SequentialTransitionBuilder . create ( ) . node ( nextSlide ) . children ( TimelineBuilder . create ( ) . keyFrames ( new KeyFrame ( Duration . millis ( 0 ) , new KeyValue ( nextSlide . visibleProperty ( ) , false ) ) , new KeyFrame ( Duration . millis ( 1 ) , new KeyValue ( nextSlide . visibleProperty ( ) , true ) ) ) . build ( ) , TranslateTransitionBuilder . create ( ) . duration ( Duration . millis ( 400 ) ) . fromY ( 700 ) . toY ( 0 ) // . fromZ ( - 10)
. build ( ) ) . build ( ) ) . build ( ) ; this . slideStepAnimation . play ( ) ; |
public class AbstractExternalHighlightingFragment2 { /** * Replies the mime types for the SARL source code .
* @ return the mime type for SARL . */
@ Pure public List < String > getMimeTypes ( ) { } } | if ( this . mimeTypes . isEmpty ( ) ) { return Arrays . asList ( "text/x-" + getLanguageSimpleName ( ) . toLowerCase ( ) ) ; // $ NON - NLS - 1 $
} return this . mimeTypes ; |
public class MariaDbStatement { /** * Reset timeout after query , re - throw SQL exception .
* @ param sqle current exception
* @ return SQLException exception with new message in case of timer timeout . */
protected SQLException executeExceptionEpilogue ( SQLException sqle ) { } } | // if has a failover , closing the statement
if ( sqle . getSQLState ( ) != null && sqle . getSQLState ( ) . startsWith ( "08" ) ) { try { close ( ) ; } catch ( SQLException sqlee ) { // eat exception
} } if ( isTimedout ) { return new SQLTimeoutException ( "(conn:" + getServerThreadId ( ) + ") Query timed out" , "JZ0002" , 1317 , sqle ) ; } SQLException sqlException = ExceptionMapper . getException ( sqle , connection , this , queryTimeout != 0 ) ; logger . error ( "error executing query" , sqlException ) ; return sqlException ; |
public class ProxyEndpoint { /** * Override to track your own request stats
* @ return */
protected RequestStat createRequestStat ( ) { } } | BasicRequestStat basicRequestStat = new BasicRequestStat ( origin . getName ( ) ) ; RequestStat . putInSessionContext ( basicRequestStat , context ) ; return basicRequestStat ; |
public class MetaDataSlotServiceImpl { /** * declarative service */
public synchronized void deactivate ( ) { } } | // Allow garbage collection of all slots reserved by this component .
// Clean up all the metadata used by the slots .
for ( MetaDataSlotImpl slot : slots ) { MetaDataManager < ? , ? > manager = ( MetaDataManager < ? , ? > ) slot . getManager ( ) ; manager . destroyMetaDataSlot ( slot ) ; } slots = null ; |
public class Http { /** * = = = = = POST SYNC = = = = = */
public static String postSync ( String url , List < StrParam > strParams ) { } } | return postSync ( String . class , url , null , Util . listToParams ( strParams , StrParam . class ) ) ; |
public class DialChart { /** * Add a series for a Dial type chart
* @ param seriesName
* @ param value
* @ param annotation
* @ return */
public DialSeries addSeries ( String seriesName , double value , String annotation ) { } } | // Sanity checks
sanityCheck ( seriesName , value ) ; DialSeries series = new DialSeries ( seriesName , value , annotation ) ; seriesMap . put ( seriesName , series ) ; return series ; |
public class StringUtil { /** * Generates a camel case version of a phrase from underscore .
* < pre >
* if { @ code capitalicapitalizeFirstChar }
* " alice _ in _ wonderland " becomes : " AliceInWonderLand "
* else
* " alice _ in _ wonderland " becomes : " aliceInWonderLand "
* < / pre >
* @ param underscored underscored version of a word to converted to camel case .
* @ param capitalizeFirstChar set to true if first character needs to be capitalized , false if not .
* @ return camel case version of underscore . */
public static String camelize ( String underscored , boolean capitalizeFirstChar ) { } } | String result = "" ; StringTokenizer st = new StringTokenizer ( underscored , "_" ) ; while ( st . hasMoreTokens ( ) ) { result += capitalize ( st . nextToken ( ) ) ; } return capitalizeFirstChar ? result : result . substring ( 0 , 1 ) . toLowerCase ( ) + result . substring ( 1 ) ; |
public class AbstractGwtValidatorFactory { /** * initialize factory .
* @ param configState ConfigurationState */
public final void init ( final ConfigurationState configState ) { } } | final ConstraintValidatorFactory configConstraintValidatorFactory = configState . getConstraintValidatorFactory ( ) ; constraintValidatorFactory = configConstraintValidatorFactory == null ? GWT . < ConstraintValidatorFactory > create ( ConstraintValidatorFactory . class ) : configConstraintValidatorFactory ; final TraversableResolver configTraversableResolver = configState . getTraversableResolver ( ) ; traversableResolver = configTraversableResolver == null ? new DefaultTraversableResolver ( ) : configTraversableResolver ; final MessageInterpolator configMessageInterpolator = configState . getMessageInterpolator ( ) ; messageInterpolator = configMessageInterpolator == null ? new GwtMessageInterpolator ( ) : configMessageInterpolator ; parameterNameProvider = configState . getParameterNameProvider ( ) ; |
public class CanalEmbedSelector { /** * 处理无数据的情况 , 避免空循环挂死 */
private void applyWait ( int emptyTimes ) { } } | int newEmptyTimes = emptyTimes > maxEmptyTimes ? maxEmptyTimes : emptyTimes ; if ( emptyTimes <= 3 ) { // 3次以内
Thread . yield ( ) ; } else { // 超过3次 , 最多只sleep 10ms
LockSupport . parkNanos ( 1000 * 1000L * newEmptyTimes ) ; } |
public class CacheingMatcher { /** * Delegate put */
public void put ( Conjunction selector , MatchTarget object , InternTable subExpr ) throws MatchingException { } } | if ( tc . isEntryEnabled ( ) ) tc . entry ( this , cclass , "put" , new Object [ ] { selector , object , subExpr } ) ; vacantChild = Factory . createMatcher ( ordinalPosition , selector , vacantChild ) ; vacantChild . put ( selector , object , subExpr ) ; if ( tc . isEntryEnabled ( ) ) tc . exit ( this , cclass , "put" ) ; |
public class AmazonPinpointClient { /** * Returns a list of export jobs for a specific segment .
* @ param getSegmentExportJobsRequest
* @ return Result of the GetSegmentExportJobs operation returned by the service .
* @ throws BadRequestException
* 400 response
* @ throws InternalServerErrorException
* 500 response
* @ throws ForbiddenException
* 403 response
* @ throws NotFoundException
* 404 response
* @ throws MethodNotAllowedException
* 405 response
* @ throws TooManyRequestsException
* 429 response
* @ sample AmazonPinpoint . GetSegmentExportJobs
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / pinpoint - 2016-12-01 / GetSegmentExportJobs " target = " _ top " > AWS
* API Documentation < / a > */
@ Override public GetSegmentExportJobsResult getSegmentExportJobs ( GetSegmentExportJobsRequest request ) { } } | request = beforeClientExecution ( request ) ; return executeGetSegmentExportJobs ( request ) ; |
public class QueryBasedExtractor { /** * build schema , record count and high water mark */
public Extractor < S , D > build ( ) throws ExtractPrepareException { } } | String watermarkColumn = this . workUnitState . getProp ( ConfigurationKeys . EXTRACT_DELTA_FIELDS_KEY ) ; long lwm = partition . getLowWatermark ( ) ; long hwm = partition . getHighWatermark ( ) ; log . info ( "Low water mark: " + lwm + "; and High water mark: " + hwm ) ; WatermarkType watermarkType ; if ( StringUtils . isBlank ( this . workUnitState . getProp ( ConfigurationKeys . SOURCE_QUERYBASED_WATERMARK_TYPE ) ) ) { watermarkType = null ; } else { watermarkType = WatermarkType . valueOf ( this . workUnitState . getProp ( ConfigurationKeys . SOURCE_QUERYBASED_WATERMARK_TYPE ) . toUpperCase ( ) ) ; } log . info ( "Source Entity is " + this . entity ) ; try { this . setTimeOut ( this . workUnitState . getPropAsInt ( ConfigurationKeys . SOURCE_CONN_TIMEOUT , ConfigurationKeys . DEFAULT_CONN_TIMEOUT ) ) ; this . extractMetadata ( this . schema , this . entity , this . workUnit ) ; if ( StringUtils . isNotBlank ( watermarkColumn ) ) { if ( partition . isLastPartition ( ) ) { // Get a more accurate high watermark from the source
long adjustedHighWatermark = this . getLatestWatermark ( watermarkColumn , watermarkType , lwm , hwm ) ; log . info ( "High water mark from source: " + adjustedHighWatermark ) ; // If the source reports a finer high watermark , then consider the same as runtime high watermark .
// Else , consider the low watermark as high water mark ( with no delta ) . i . e , don ' t move the pointer
if ( adjustedHighWatermark == ConfigurationKeys . DEFAULT_WATERMARK_VALUE ) { adjustedHighWatermark = getLowWatermarkWithNoDelta ( lwm ) ; } this . highWatermark = adjustedHighWatermark ; } else { this . highWatermark = hwm ; } log . info ( "High water mark for the current run: " + highWatermark ) ; this . setRangePredicates ( watermarkColumn , watermarkType , lwm , highWatermark ) ; } // if it is set to true , skip count calculation and set source count to - 1
if ( ! Boolean . valueOf ( this . workUnitState . getProp ( ConfigurationKeys . SOURCE_QUERYBASED_SKIP_COUNT_CALC ) ) ) { this . sourceRecordCount = this . getSourceCount ( this . schema , this . entity , this . workUnit , this . predicateList ) ; } else { log . info ( "Skip count calculation" ) ; this . sourceRecordCount = - 1 ; } if ( this . sourceRecordCount == 0 ) { log . info ( "Record count is 0; Setting fetch status to false to skip readRecord()" ) ; this . setFetchStatus ( false ) ; } } catch ( SchemaException e ) { throw new ExtractPrepareException ( "Failed to get schema for this object; error - " + e . getMessage ( ) , e ) ; } catch ( HighWatermarkException e ) { throw new ExtractPrepareException ( "Failed to get high watermark; error - " + e . getMessage ( ) , e ) ; } catch ( RecordCountException e ) { throw new ExtractPrepareException ( "Failed to get record count; error - " + e . getMessage ( ) , e ) ; } catch ( Exception e ) { throw new ExtractPrepareException ( "Failed to prepare the extract build; error - " + e . getMessage ( ) , e ) ; } return this ; |
public class Jav { /** * Returns a String capable for java identifier . Throws IllegalArgumentException
* if same id was already created .
* < p > Same id returns always the same java id .
* @ param id
* @ return */
public String makeJavaIdentifier ( String id ) { } } | String jid = makeJavaId ( id ) ; String old = map . put ( jid , id ) ; if ( old != null && ! old . equals ( id ) ) { throw new IllegalArgumentException ( "both " + id + " and " + old + " makes the same java id " + jid ) ; } return jid ; |
public class BeanUtil { /** * 对象转Map < br >
* 通过实现 { @ link Editor } 可以自定义字段值 , 如果这个Editor返回null则忽略这个字段 , 以便实现 :
* < pre >
* 1 . 字段筛选 , 可以去除不需要的字段
* 2 . 字段变换 , 例如实现驼峰转下划线
* 3 . 自定义字段前缀或后缀等等
* < / pre >
* @ param bean bean对象
* @ param targetMap 目标的Map
* @ param ignoreNullValue 是否忽略值为空的字段
* @ param keyEditor 属性字段 ( Map的key ) 编辑器 , 用于筛选 、 编辑key
* @ return Map
* @ since 4.0.5 */
public static Map < String , Object > beanToMap ( Object bean , Map < String , Object > targetMap , boolean ignoreNullValue , Editor < String > keyEditor ) { } } | if ( bean == null ) { return null ; } final Collection < PropDesc > props = BeanUtil . getBeanDesc ( bean . getClass ( ) ) . getProps ( ) ; String key ; Method getter ; Object value ; for ( PropDesc prop : props ) { key = prop . getFieldName ( ) ; // 过滤class属性
// 得到property对应的getter方法
getter = prop . getGetter ( ) ; if ( null != getter ) { // 只读取有getter方法的属性
try { value = getter . invoke ( bean ) ; } catch ( Exception ignore ) { continue ; } if ( false == ignoreNullValue || ( null != value && false == value . equals ( bean ) ) ) { key = keyEditor . edit ( key ) ; if ( null != key ) { targetMap . put ( key , value ) ; } } } } return targetMap ; |
public class EndpointBatchRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( EndpointBatchRequest endpointBatchRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( endpointBatchRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( endpointBatchRequest . getItem ( ) , ITEM_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class DummyTransaction { /** * Rolls back this transaction .
* @ throws IllegalStateException If the transaction is in a state where it cannot be rolled back . This could be
* because the transaction is no longer active , or because it is in the { @ link
* Status # STATUS _ PREPARED prepared state } .
* @ throws SystemException If the transaction service fails in an unexpected way . */
@ Override public void rollback ( ) throws IllegalStateException , SystemException { } } | if ( trace ) { log . tracef ( "Transaction.rollback() invoked in transaction with Xid=%s" , xid ) ; } if ( isDone ( ) ) { throw new IllegalStateException ( "Transaction is done. Cannot rollback transaction" ) ; } try { status = Status . STATUS_MARKED_ROLLBACK ; endResources ( ) ; runCommit ( false ) ; } catch ( HeuristicMixedException | HeuristicRollbackException e ) { log . errorRollingBack ( e ) ; SystemException systemException = new SystemException ( "Unable to rollback transaction" ) ; systemException . initCause ( e ) ; throw systemException ; } catch ( RollbackException e ) { // ignored
if ( trace ) { log . trace ( "RollbackException thrown while rolling back" , e ) ; } } |
public class LogFileCompressor { /** * Starts the compressor . */
final void begin ( ) { } } | if ( LogFileCompressionStrategy . existsFor ( this . properties ) ) { final Thread thread = new Thread ( this , "Log4J File Compressor" ) ; thread . setDaemon ( true ) ; thread . start ( ) ; this . threadRef = thread ; } |
public class ZuulProxyAutoConfiguration { /** * route filters */
@ Bean @ ConditionalOnMissingBean ( RibbonRoutingFilter . class ) public RibbonRoutingFilter ribbonRoutingFilter ( ProxyRequestHelper helper , RibbonCommandFactory < ? > ribbonCommandFactory ) { } } | RibbonRoutingFilter filter = new RibbonRoutingFilter ( helper , ribbonCommandFactory , this . requestCustomizers ) ; return filter ; |
public class AlluxioFuseFileSystem { /** * Flushes cached data on Alluxio .
* Called on explicit sync ( ) operation or at close ( ) .
* @ param path The path on the FS of the file to close
* @ param fi FileInfo data struct kept by FUSE
* @ return 0 on success , a negative value on error */
@ Override public int flush ( String path , FuseFileInfo fi ) { } } | LOG . trace ( "flush({})" , path ) ; final long fd = fi . fh . get ( ) ; OpenFileEntry oe = mOpenFiles . getFirstByField ( ID_INDEX , fd ) ; if ( oe == null ) { LOG . error ( "Cannot find fd for {} in table" , path ) ; return - ErrorCodes . EBADFD ( ) ; } if ( oe . getOut ( ) != null ) { try { oe . getOut ( ) . flush ( ) ; } catch ( IOException e ) { LOG . error ( "Failed to flush {}" , path , e ) ; return - ErrorCodes . EIO ( ) ; } } else { LOG . debug ( "Not flushing: {} was not open for writing" , path ) ; } return 0 ; |
public class ApiOvhVrack { /** * Get this object properties
* REST : GET / vrack / { serviceName } / cloudProject / { project }
* @ param serviceName [ required ] The internal name of your vrack
* @ param project [ required ] publicCloud project */
public OvhCloudProject serviceName_cloudProject_project_GET ( String serviceName , String project ) throws IOException { } } | String qPath = "/vrack/{serviceName}/cloudProject/{project}" ; StringBuilder sb = path ( qPath , serviceName , project ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , OvhCloudProject . class ) ; |
public class DataSet { /** * Create a new { @ code DataSet } object with the given number of parameters
* and the data set names .
* @ param parameterCount the number of parameters one data sample consist of
* @ param dataSetNames the names of the created { @ code Data } sets
* @ return a new data set object */
public static DataSet of ( final int parameterCount , final String ... dataSetNames ) { } } | return new DataSet ( Arrays . stream ( dataSetNames ) . map ( name -> Data . of ( name , parameterCount ) ) . collect ( ISeq . toISeq ( ) ) ) ; |
public class DefaultLoginWebflowConfigurer { /** * Create default global exception handlers .
* @ param flow the flow */
protected void createDefaultEndStates ( final Flow flow ) { } } | createRedirectUnauthorizedServiceUrlEndState ( flow ) ; createServiceErrorEndState ( flow ) ; createRedirectEndState ( flow ) ; createPostEndState ( flow ) ; createInjectHeadersActionState ( flow ) ; createGenericLoginSuccessEndState ( flow ) ; createServiceWarningViewState ( flow ) ; createEndWebflowEndState ( flow ) ; |
public class AppServicePlansInner { /** * Get all App Service plans in a resource group .
* Get all App Service plans in a resource group .
* @ param nextPageLink The NextLink from the previous successful call to List operation .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the PagedList & lt ; AppServicePlanInner & gt ; object */
public Observable < Page < AppServicePlanInner > > listByResourceGroupNextAsync ( final String nextPageLink ) { } } | return listByResourceGroupNextWithServiceResponseAsync ( nextPageLink ) . map ( new Func1 < ServiceResponse < Page < AppServicePlanInner > > , Page < AppServicePlanInner > > ( ) { @ Override public Page < AppServicePlanInner > call ( ServiceResponse < Page < AppServicePlanInner > > response ) { return response . body ( ) ; } } ) ; |
public class AsteriskQueueImpl { /** * Creates a new AsteriskQueueEntry , adds it to this queue . < p >
* Fires :
* < ul >
* < li > PCE on channel < / li >
* < li > NewEntry on this queue < / li >
* < li > PCE on other queue entries if shifted ( never happens ) < / li >
* < li > NewQueueEntry on server < / li >
* < / ul >
* @ param channel the channel that joined the queue
* @ param reportedPosition the position as given by Asterisk ( currently not used )
* @ param dateReceived the date the hannel joined the queue */
void createNewEntry ( AsteriskChannelImpl channel , int reportedPosition , Date dateReceived ) { } } | AsteriskQueueEntryImpl qe = new AsteriskQueueEntryImpl ( server , this , channel , reportedPosition , dateReceived ) ; long delay = serviceLevel * 1000L ; if ( delay > 0 ) { ServiceLevelTimerTask timerTask = new ServiceLevelTimerTask ( qe ) ; timer . schedule ( timerTask , delay ) ; synchronized ( serviceLevelTimerTasks ) { serviceLevelTimerTasks . put ( qe , timerTask ) ; } } synchronized ( entries ) { entries . add ( qe ) ; // at the end of the list
// Keep the lock !
// This will fire PCE on the newly created queue entry
// but hopefully this one has no listeners yet
shift ( ) ; } // Set the channel property ony here as queue entries and channels
// maintain a reciprocal reference .
// That way property change on channel and new entry event on queue will be
// lanched when BOTH channel and queue are correctly set .
channel . setQueueEntry ( qe ) ; fireNewEntry ( qe ) ; server . fireNewQueueEntry ( qe ) ; |
public class StreamInfoMarshaller { /** * Marshall the given parameter object . */
public void marshall ( StreamInfo streamInfo , ProtocolMarshaller protocolMarshaller ) { } } | if ( streamInfo == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( streamInfo . getDeviceName ( ) , DEVICENAME_BINDING ) ; protocolMarshaller . marshall ( streamInfo . getStreamName ( ) , STREAMNAME_BINDING ) ; protocolMarshaller . marshall ( streamInfo . getStreamARN ( ) , STREAMARN_BINDING ) ; protocolMarshaller . marshall ( streamInfo . getMediaType ( ) , MEDIATYPE_BINDING ) ; protocolMarshaller . marshall ( streamInfo . getKmsKeyId ( ) , KMSKEYID_BINDING ) ; protocolMarshaller . marshall ( streamInfo . getVersion ( ) , VERSION_BINDING ) ; protocolMarshaller . marshall ( streamInfo . getStatus ( ) , STATUS_BINDING ) ; protocolMarshaller . marshall ( streamInfo . getCreationTime ( ) , CREATIONTIME_BINDING ) ; protocolMarshaller . marshall ( streamInfo . getDataRetentionInHours ( ) , DATARETENTIONINHOURS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class LabelSausage { /** * Paints the label sausage . */
protected void paint ( Graphics2D gfx , int x , int y , Color background , Object cliData ) { } } | // turn on anti - aliasing ( for our sausage lines )
Object oalias = SwingUtil . activateAntiAliasing ( gfx ) ; // draw the base sausage
gfx . setColor ( background ) ; drawBase ( gfx , x , y ) ; // render our icon if we ' ve got one
drawIcon ( gfx , x , y , cliData ) ; drawLabel ( gfx , x , y ) ; drawBorder ( gfx , x , y ) ; drawExtras ( gfx , x , y , cliData ) ; // restore original hints
SwingUtil . restoreAntiAliasing ( gfx , oalias ) ; |
public class OObjectProxyMethodHandler { /** * Method that detaches all fields contained in the document to the given object
* @ param self
* : - The object containing this handler instance
* @ throws InvocationTargetException
* @ throws IllegalAccessException
* @ throws NoSuchMethodException */
public void detach ( Object self ) throws NoSuchMethodException , IllegalAccessException , InvocationTargetException { } } | for ( String fieldName : doc . fieldNames ( ) ) { Object value = getValue ( self , fieldName , false , null ) ; if ( value instanceof OLazyObjectMultivalueElement ) ( ( OLazyObjectMultivalueElement ) value ) . detach ( ) ; OObjectEntitySerializer . setFieldValue ( getField ( fieldName , self . getClass ( ) ) , self , value ) ; } OObjectEntitySerializer . setIdField ( self . getClass ( ) , self , doc . getIdentity ( ) ) ; OObjectEntitySerializer . setVersionField ( self . getClass ( ) , self , doc . getVersion ( ) ) ; |
public class TldTaglibTypeImpl { /** * Returns all < code > taglib - extension < / code > elements
* @ return list of < code > taglib - extension < / code > */
public List < TldExtensionType < TldTaglibType < T > > > getAllTaglibExtension ( ) { } } | List < TldExtensionType < TldTaglibType < T > > > list = new ArrayList < TldExtensionType < TldTaglibType < T > > > ( ) ; List < Node > nodeList = childNode . get ( "taglib-extension" ) ; for ( Node node : nodeList ) { TldExtensionType < TldTaglibType < T > > type = new TldExtensionTypeImpl < TldTaglibType < T > > ( this , "taglib-extension" , childNode , node ) ; list . add ( type ) ; } return list ; |
public class InternalPureXbaseParser { /** * InternalPureXbase . g : 1235:1 : ruleXEqualityExpression returns [ EObject current = null ] : ( this _ XRelationalExpression _ 0 = ruleXRelationalExpression ( ( ( ( ( ) ( ( ruleOpEquality ) ) ) ) = > ( ( ) ( ( ruleOpEquality ) ) ) ) ( ( lv _ rightOperand _ 3_0 = ruleXRelationalExpression ) ) ) * ) ; */
public final EObject ruleXEqualityExpression ( ) throws RecognitionException { } } | EObject current = null ; EObject this_XRelationalExpression_0 = null ; EObject lv_rightOperand_3_0 = null ; enterRule ( ) ; try { // InternalPureXbase . g : 1241:2 : ( ( this _ XRelationalExpression _ 0 = ruleXRelationalExpression ( ( ( ( ( ) ( ( ruleOpEquality ) ) ) ) = > ( ( ) ( ( ruleOpEquality ) ) ) ) ( ( lv _ rightOperand _ 3_0 = ruleXRelationalExpression ) ) ) * ) )
// InternalPureXbase . g : 1242:2 : ( this _ XRelationalExpression _ 0 = ruleXRelationalExpression ( ( ( ( ( ) ( ( ruleOpEquality ) ) ) ) = > ( ( ) ( ( ruleOpEquality ) ) ) ) ( ( lv _ rightOperand _ 3_0 = ruleXRelationalExpression ) ) ) * )
{ // InternalPureXbase . g : 1242:2 : ( this _ XRelationalExpression _ 0 = ruleXRelationalExpression ( ( ( ( ( ) ( ( ruleOpEquality ) ) ) ) = > ( ( ) ( ( ruleOpEquality ) ) ) ) ( ( lv _ rightOperand _ 3_0 = ruleXRelationalExpression ) ) ) * )
// InternalPureXbase . g : 1243:3 : this _ XRelationalExpression _ 0 = ruleXRelationalExpression ( ( ( ( ( ) ( ( ruleOpEquality ) ) ) ) = > ( ( ) ( ( ruleOpEquality ) ) ) ) ( ( lv _ rightOperand _ 3_0 = ruleXRelationalExpression ) ) ) *
{ if ( state . backtracking == 0 ) { newCompositeNode ( grammarAccess . getXEqualityExpressionAccess ( ) . getXRelationalExpressionParserRuleCall_0 ( ) ) ; } pushFollow ( FOLLOW_22 ) ; this_XRelationalExpression_0 = ruleXRelationalExpression ( ) ; state . _fsp -- ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { current = this_XRelationalExpression_0 ; afterParserOrEnumRuleCall ( ) ; } // InternalPureXbase . g : 1251:3 : ( ( ( ( ( ) ( ( ruleOpEquality ) ) ) ) = > ( ( ) ( ( ruleOpEquality ) ) ) ) ( ( lv _ rightOperand _ 3_0 = ruleXRelationalExpression ) ) ) *
loop24 : do { int alt24 = 2 ; switch ( input . LA ( 1 ) ) { case 33 : { int LA24_2 = input . LA ( 2 ) ; if ( ( synpred12_InternalPureXbase ( ) ) ) { alt24 = 1 ; } } break ; case 34 : { int LA24_3 = input . LA ( 2 ) ; if ( ( synpred12_InternalPureXbase ( ) ) ) { alt24 = 1 ; } } break ; case 35 : { int LA24_4 = input . LA ( 2 ) ; if ( ( synpred12_InternalPureXbase ( ) ) ) { alt24 = 1 ; } } break ; case 36 : { int LA24_5 = input . LA ( 2 ) ; if ( ( synpred12_InternalPureXbase ( ) ) ) { alt24 = 1 ; } } break ; } switch ( alt24 ) { case 1 : // InternalPureXbase . g : 1252:4 : ( ( ( ( ) ( ( ruleOpEquality ) ) ) ) = > ( ( ) ( ( ruleOpEquality ) ) ) ) ( ( lv _ rightOperand _ 3_0 = ruleXRelationalExpression ) )
{ // InternalPureXbase . g : 1252:4 : ( ( ( ( ) ( ( ruleOpEquality ) ) ) ) = > ( ( ) ( ( ruleOpEquality ) ) ) )
// InternalPureXbase . g : 1253:5 : ( ( ( ) ( ( ruleOpEquality ) ) ) ) = > ( ( ) ( ( ruleOpEquality ) ) )
{ // InternalPureXbase . g : 1263:5 : ( ( ) ( ( ruleOpEquality ) ) )
// InternalPureXbase . g : 1264:6 : ( ) ( ( ruleOpEquality ) )
{ // InternalPureXbase . g : 1264:6 : ( )
// InternalPureXbase . g : 1265:7:
{ if ( state . backtracking == 0 ) { current = forceCreateModelElementAndSet ( grammarAccess . getXEqualityExpressionAccess ( ) . getXBinaryOperationLeftOperandAction_1_0_0_0 ( ) , current ) ; } } // InternalPureXbase . g : 1271:6 : ( ( ruleOpEquality ) )
// InternalPureXbase . g : 1272:7 : ( ruleOpEquality )
{ // InternalPureXbase . g : 1272:7 : ( ruleOpEquality )
// InternalPureXbase . g : 1273:8 : ruleOpEquality
{ if ( state . backtracking == 0 ) { if ( current == null ) { current = createModelElement ( grammarAccess . getXEqualityExpressionRule ( ) ) ; } } if ( state . backtracking == 0 ) { newCompositeNode ( grammarAccess . getXEqualityExpressionAccess ( ) . getFeatureJvmIdentifiableElementCrossReference_1_0_0_1_0 ( ) ) ; } pushFollow ( FOLLOW_3 ) ; ruleOpEquality ( ) ; state . _fsp -- ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { afterParserOrEnumRuleCall ( ) ; } } } } } // InternalPureXbase . g : 1289:4 : ( ( lv _ rightOperand _ 3_0 = ruleXRelationalExpression ) )
// InternalPureXbase . g : 1290:5 : ( lv _ rightOperand _ 3_0 = ruleXRelationalExpression )
{ // InternalPureXbase . g : 1290:5 : ( lv _ rightOperand _ 3_0 = ruleXRelationalExpression )
// InternalPureXbase . g : 1291:6 : lv _ rightOperand _ 3_0 = ruleXRelationalExpression
{ if ( state . backtracking == 0 ) { newCompositeNode ( grammarAccess . getXEqualityExpressionAccess ( ) . getRightOperandXRelationalExpressionParserRuleCall_1_1_0 ( ) ) ; } pushFollow ( FOLLOW_22 ) ; lv_rightOperand_3_0 = ruleXRelationalExpression ( ) ; state . _fsp -- ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { if ( current == null ) { current = createModelElementForParent ( grammarAccess . getXEqualityExpressionRule ( ) ) ; } set ( current , "rightOperand" , lv_rightOperand_3_0 , "org.eclipse.xtext.xbase.Xbase.XRelationalExpression" ) ; afterParserOrEnumRuleCall ( ) ; } } } } break ; default : break loop24 ; } } while ( true ) ; } } if ( state . backtracking == 0 ) { leaveRule ( ) ; } } catch ( RecognitionException re ) { recover ( input , re ) ; appendSkippedTokens ( ) ; } finally { } return current ; |
public class DeleteByteMatchSetRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( DeleteByteMatchSetRequest deleteByteMatchSetRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( deleteByteMatchSetRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( deleteByteMatchSetRequest . getByteMatchSetId ( ) , BYTEMATCHSETID_BINDING ) ; protocolMarshaller . marshall ( deleteByteMatchSetRequest . getChangeToken ( ) , CHANGETOKEN_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class MethodInfo { /** * Get the names of any classes in the type descriptor or type signature .
* @ param classNames
* the class names */
@ Override protected void findReferencedClassNames ( final Set < String > classNames ) { } } | final MethodTypeSignature methodSig = getTypeSignature ( ) ; if ( methodSig != null ) { methodSig . findReferencedClassNames ( classNames ) ; } final MethodTypeSignature methodDesc = getTypeDescriptor ( ) ; if ( methodDesc != null ) { methodDesc . findReferencedClassNames ( classNames ) ; } if ( annotationInfo != null ) { for ( final AnnotationInfo ai : annotationInfo ) { ai . findReferencedClassNames ( classNames ) ; } } for ( final MethodParameterInfo mpi : getParameterInfo ( ) ) { final AnnotationInfo [ ] aiArr = mpi . annotationInfo ; if ( aiArr != null ) { for ( final AnnotationInfo ai : aiArr ) { ai . findReferencedClassNames ( classNames ) ; } } } |
public class FontFileReader { /** * Read 4 bytes .
* @ return One unsigned integer
* @ throws IOException If EOF is reached */
public final long readTTFULong ( ) throws IOException { } } | long ret = readTTFUByte ( ) ; ret = ( ret << 8 ) + readTTFUByte ( ) ; ret = ( ret << 8 ) + readTTFUByte ( ) ; ret = ( ret << 8 ) + readTTFUByte ( ) ; return ret ; |
public class ChineseCalendar { /** * Compute fields for the Chinese calendar system . This method can
* either set all relevant fields , as required by
* < code > handleComputeFields ( ) < / code > , or it can just set the MONTH and
* IS _ LEAP _ MONTH fields , as required by
* < code > handleComputeMonthStart ( ) < / code > .
* < p > As a side effect , this method sets { @ link # isLeapYear } .
* @ param days days after January 1 , 1970 0:00 astronomical base zone of the
* date to compute fields for
* @ param gyear the Gregorian year of the given date
* @ param gmonth the Gregorian month of the given date
* @ param setAllFields if true , set the EXTENDED _ YEAR , ERA , YEAR ,
* DAY _ OF _ MONTH , and DAY _ OF _ YEAR fields . In either case set the MONTH
* and IS _ LEAP _ MONTH fields . */
private void computeChineseFields ( int days , int gyear , int gmonth , boolean setAllFields ) { } } | // Find the winter solstices before and after the target date .
// These define the boundaries of this Chinese year , specifically ,
// the position of month 11 , which always contains the solstice .
// We want solsticeBefore < = date < solsticeAfter .
int solsticeBefore ; int solsticeAfter = winterSolstice ( gyear ) ; if ( days < solsticeAfter ) { solsticeBefore = winterSolstice ( gyear - 1 ) ; } else { solsticeBefore = solsticeAfter ; solsticeAfter = winterSolstice ( gyear + 1 ) ; } // Find the start of the month after month 11 . This will be either
// the prior month 12 or leap month 11 ( very rare ) . Also find the
// start of the following month 11.
int firstMoon = newMoonNear ( solsticeBefore + 1 , true ) ; int lastMoon = newMoonNear ( solsticeAfter + 1 , false ) ; int thisMoon = newMoonNear ( days + 1 , false ) ; // Start of this month
// Note : isLeapYear is a member variable
isLeapYear = synodicMonthsBetween ( firstMoon , lastMoon ) == 12 ; int month = synodicMonthsBetween ( firstMoon , thisMoon ) ; if ( isLeapYear && isLeapMonthBetween ( firstMoon , thisMoon ) ) { month -- ; } if ( month < 1 ) { month += 12 ; } boolean isLeapMonth = isLeapYear && hasNoMajorSolarTerm ( thisMoon ) && ! isLeapMonthBetween ( firstMoon , newMoonNear ( thisMoon - SYNODIC_GAP , false ) ) ; internalSet ( MONTH , month - 1 ) ; // Convert from 1 - based to 0 - based
internalSet ( IS_LEAP_MONTH , isLeapMonth ? 1 : 0 ) ; if ( setAllFields ) { // Extended year and cycle year is based on the epoch year
int extended_year = gyear - epochYear ; int cycle_year = gyear - CHINESE_EPOCH_YEAR ; if ( month < 11 || gmonth >= JULY ) { extended_year ++ ; cycle_year ++ ; } int dayOfMonth = days - thisMoon + 1 ; internalSet ( EXTENDED_YEAR , extended_year ) ; // 0 - > 0,60 1 - > 1,1 60 - > 1,60 61 - > 2,1 etc .
int [ ] yearOfCycle = new int [ 1 ] ; int cycle = floorDivide ( cycle_year - 1 , 60 , yearOfCycle ) ; internalSet ( ERA , cycle + 1 ) ; internalSet ( YEAR , yearOfCycle [ 0 ] + 1 ) ; internalSet ( DAY_OF_MONTH , dayOfMonth ) ; // Days will be before the first new year we compute if this
// date is in month 11 , leap 11 , 12 . There is never a leap 12.
// New year computations are cached so this should be cheap in
// the long run .
int newYear = newYear ( gyear ) ; if ( days < newYear ) { newYear = newYear ( gyear - 1 ) ; } internalSet ( DAY_OF_YEAR , days - newYear + 1 ) ; } |
public class DescribeProtectedResourceRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( DescribeProtectedResourceRequest describeProtectedResourceRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( describeProtectedResourceRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( describeProtectedResourceRequest . getResourceArn ( ) , RESOURCEARN_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class StoryFinder { /** * Finds paths from a source path , allowing for include / exclude patterns .
* Paths found are normalised by { @ link StoryFinder # normalise ( List < String > ) }
* @ param searchIn the source path to search in
* @ param includes the List of include patterns , or < code > null < / code > if
* none
* @ param excludes the List of exclude patterns , or < code > null < / code > if
* none
* @ return A List of paths found */
public List < String > findPaths ( String searchIn , List < String > includes , List < String > excludes ) { } } | return normalise ( sort ( scan ( searchIn , includes , excludes ) ) ) ; |
public class GodHandableAction { protected Object invokeExecuteMethod ( Method executeMethod , Object [ ] requestArgs ) { } } | Object result = null ; try { result = executeMethod . invoke ( action , requestArgs ) ; // # to _ action just here
redCardableAssist . checkValidatorCalled ( ) ; } catch ( InvocationTargetException e ) { // e . g . exception in the method
return handleExecuteMethodInvocationTargetException ( executeMethod , requestArgs , e ) ; } catch ( IllegalAccessException e ) { // e . g . private invoking
throwExecuteMethodAccessFailureException ( executeMethod , requestArgs , e ) ; } catch ( IllegalArgumentException e ) { // e . g . different argument number
throwExecuteMethodArgumentMismatchException ( executeMethod , requestArgs , e ) ; } return result ; |
public class GraniteUi { /** * Get current content resource
* If it does not exist , go up the content path and return the first resource that exists .
* @ param request Request
* @ return Current content resource or the first existing parent / ancestor . */
public static @ Nullable Resource getContentResourceOrParent ( @ NotNull HttpServletRequest request ) { } } | String contentPath = getContentPath ( request ) ; return getContentResourceOrParentFromPath ( ( SlingHttpServletRequest ) request , contentPath ) ; |
public class SynchronousRequest { /** * For more info on continents API go < a href = " https : / / wiki . guildwars2 . com / wiki / API : 2 / continents " > here < / a > < br / >
* Get continent info for the given continent floor id ( s )
* @ param continentID { @ link Continent # id }
* @ param ids list of continent floor id
* @ return list of continent floor info
* @ throws GuildWars2Exception see { @ link ErrorCode } for detail
* @ see ContinentFloor continent floor info */
public List < ContinentFloor > getContinentFloorInfo ( int continentID , int [ ] ids ) throws GuildWars2Exception { } } | isParamValid ( new ParamChecker ( ids ) ) ; try { Response < List < ContinentFloor > > response = gw2API . getContinentFloorInfo ( Integer . toString ( continentID ) , processIds ( ids ) , GuildWars2 . lang . getValue ( ) ) . execute ( ) ; if ( ! response . isSuccessful ( ) ) throwError ( response . code ( ) , response . errorBody ( ) ) ; return response . body ( ) ; } catch ( IOException e ) { throw new GuildWars2Exception ( ErrorCode . Network , "Network Error: " + e . getMessage ( ) ) ; } |
public class UnixSshPath { /** * { @ inheritDoc } */
@ Override public UnixSshPath getParent ( ) { } } | // if ( parts . length = = 0 & & ! isAbsolute ( ) ) {
if ( parts . length == 0 || ( parts . length == 1 && ! isAbsolute ( ) ) ) { return null ; } if ( parts . length <= 1 ) { return new UnixSshPath ( getFileSystem ( ) , isAbsolute ( ) ) ; } return new UnixSshPath ( getFileSystem ( ) , isAbsolute ( ) , Arrays . copyOfRange ( parts , 0 , parts . length - 1 ) ) ; |
public class IntCounter { /** * Adds the counts in the given Counter to the counts in this Counter .
* To copy the values from another Counter rather than adding them , use */
public void addAll ( IntCounter < E > counter ) { } } | for ( E key : counter . keySet ( ) ) { int count = counter . getIntCount ( key ) ; incrementCount ( key , count ) ; } |
public class TextFidelityImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public void setStpTxtEx ( Integer newStpTxtEx ) { } } | Integer oldStpTxtEx = stpTxtEx ; stpTxtEx = newStpTxtEx ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , AfplibPackage . TEXT_FIDELITY__STP_TXT_EX , oldStpTxtEx , stpTxtEx ) ) ; |
public class Meeting { public String roomToken ( String roomName , String userId , String perm , Date expireAt ) throws Exception { } } | RoomAccess access = new RoomAccess ( roomName , userId , perm , expireAt ) ; String json = gson . toJson ( access ) ; return this . cli . getMac ( ) . signRoomToken ( json ) ; |
public class Compiler { /** * Returns the module type for the provided namespace . */
@ Override @ Nullable CompilerInput . ModuleType getModuleTypeByName ( String moduleName ) { } } | return moduleTypesByName . get ( moduleName ) ; |
public class JvmTypeParameterImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public void setName ( String newName ) { } } | String oldName = name ; name = newName ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , TypesPackage . JVM_TYPE_PARAMETER__NAME , oldName , name ) ) ; |
public class PLTable { /** * Add a new table row . All contained elements are added with the specified
* width in the constructor . < code > null < / code > elements are represented as
* empty cells .
* @ param aCells
* The cells to add . May not be < code > null < / code > .
* @ param aHeight
* Row height to be used .
* @ return this */
@ Nonnull public PLTable addRow ( @ Nonnull final Iterable < ? extends PLTableCell > aCells , @ Nonnull final HeightSpec aHeight ) { } } | addAndReturnRow ( aCells , aHeight ) ; return this ; |
public class Element { /** * ( non - Javadoc )
* @ see qc . automation . framework . widget . IElement # waitForText ( java . lang . Long ) */
@ Override public void waitForText ( long time ) throws WidgetException , WidgetTimeoutException { } } | waitForCommand ( new ITimerCallback ( ) { @ Override public boolean execute ( ) throws WidgetException { String val = getText ( ) ; if ( val == null || val . equals ( "" ) ) return false ; return true ; } @ Override public String toString ( ) { return "Waiting for text on the element with the " + "locator: " + locator ; } } , time ) ; |
public class CommerceCountryPersistenceImpl { /** * Returns a range of all the commerce countries where groupId = & # 63 ; .
* Useful when paginating results . Returns a maximum of < code > end - start < / code > instances . < code > start < / code > and < code > end < / code > are not primary keys , they are indexes in the result set . Thus , < code > 0 < / code > refers to the first result in the set . Setting both < code > start < / code > and < code > end < / code > to { @ link QueryUtil # ALL _ POS } will return the full result set . If < code > orderByComparator < / code > is specified , then the query will include the given ORDER BY logic . If < code > orderByComparator < / code > is absent and pagination is required ( < code > start < / code > and < code > end < / code > are not { @ link QueryUtil # ALL _ POS } ) , then the query will include the default ORDER BY logic from { @ link CommerceCountryModelImpl } . If both < code > orderByComparator < / code > and pagination are absent , for performance reasons , the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order .
* @ param groupId the group ID
* @ param start the lower bound of the range of commerce countries
* @ param end the upper bound of the range of commerce countries ( not inclusive )
* @ return the range of matching commerce countries */
@ Override public List < CommerceCountry > findByGroupId ( long groupId , int start , int end ) { } } | return findByGroupId ( groupId , start , end , null ) ; |
public class AhoCorasickDoubleArrayTrie { /** * 持久化
* @ param out 一个ObjectOutputStream
* @ throws IOException 可能的IO异常 */
public void save ( ObjectOutputStream out ) throws IOException { } } | out . writeObject ( base ) ; out . writeObject ( check ) ; out . writeObject ( fail ) ; out . writeObject ( output ) ; out . writeObject ( l ) ; |
public class BigtableTableAdminGCJClient { /** * { @ inheritDoc } */
@ Override public ApiFuture < Operation > createTableFromSnapshotAsync ( CreateTableFromSnapshotRequest request ) { } } | return baseAdminClient . createTableFromSnapshotCallable ( ) . futureCall ( request ) ; |
public class AtomContainer { /** * { @ inheritDoc } */
@ Override public void removeAllBonds ( ) { } } | for ( int f = 0 ; f < getBondCount ( ) ; f ++ ) { getBond ( f ) . removeListener ( this ) ; } bonds = new IBond [ growArraySize ] ; bondCount = 0 ; notifyChanged ( ) ; |
public class RoleManager { /** * Sets the { @ link net . dv8tion . jda . core . Permission Permissions } of the selected { @ link net . dv8tion . jda . core . entities . Role Role } .
* < p > Permissions may only include already present Permissions for the currently logged in account .
* < br > You are unable to give permissions you don ' t have !
* @ param perms
* The new raw permission value for the selected { @ link net . dv8tion . jda . core . entities . Role Role }
* @ throws net . dv8tion . jda . core . exceptions . InsufficientPermissionException
* If the currently logged in account does not have permission to apply one of the specified permissions
* @ return RoleManager for chaining convenience
* @ see # setPermissions ( Collection )
* @ see # setPermissions ( Permission . . . ) */
@ CheckReturnValue public RoleManager setPermissions ( long perms ) { } } | long selfPermissions = PermissionUtil . getEffectivePermission ( getGuild ( ) . getSelfMember ( ) ) ; setupPermissions ( ) ; long missingPerms = perms ; // include permissions we want to set to
missingPerms &= ~ selfPermissions ; // exclude permissions we have
missingPerms &= ~ this . permissions ; // exclude permissions the role has
// if any permissions remain , we have an issue
if ( missingPerms != 0 && isPermissionChecksEnabled ( ) ) { List < Permission > permissionList = Permission . getPermissions ( missingPerms ) ; if ( ! permissionList . isEmpty ( ) ) throw new InsufficientPermissionException ( permissionList . get ( 0 ) ) ; } this . permissions = perms ; set |= PERMISSION ; return this ; |
public class JodaBeanSimpleJsonWriter { /** * write map with complex keys */
private void writeMapComplex ( SerIterator itemIterator ) throws IOException { } } | output . writeObjectStart ( ) ; while ( itemIterator . hasNext ( ) ) { itemIterator . next ( ) ; Object key = itemIterator . key ( ) ; if ( key == null ) { throw new IllegalArgumentException ( "Unable to write map key as it cannot be null" ) ; } String str = settings . getConverter ( ) . convertToString ( itemIterator . key ( ) ) ; if ( str == null ) { throw new IllegalArgumentException ( "Unable to write map key as it cannot be a null string" ) ; } output . writeObjectKey ( str ) ; writeObject ( itemIterator . valueType ( ) , itemIterator . value ( ) , itemIterator ) ; } output . writeObjectEnd ( ) ; |
public class CssReader { /** * Reads forward and returns the the next n characters in the stream . Escapes
* are returned verbatim . At return , the reader is at positioned such that
* next ( ) will return n + 1 or EOF ( - 1 ) .
* @ param n the number of characters to read
* @ return An array with guaranteed length n , with - 1 being the value for
* all elements at and after EOF .
* @ throws IOException */
int [ ] collect ( int n ) throws IOException { } } | int [ ] buf = new int [ n ] ; boolean seenEOF = false ; for ( int i = 0 ; i < buf . length ; i ++ ) { if ( seenEOF ) { buf [ i ] = - 1 ; } else { buf [ i ] = next ( ) ; if ( curChar == - 1 ) { seenEOF = true ; } } } return buf ; |
public class JavacFileManager { /** * Converts a relative file name to a relative URI . This is
* different from File . toURI as this method does not canonicalize
* the file before creating the URI . Furthermore , no schema is
* used .
* @ param file a relative file name
* @ return a relative URI
* @ throws IllegalArgumentException if the file name is not
* relative according to the definition given in { @ link
* javax . tools . JavaFileManager # getFileForInput } */
public static String getRelativeName ( File file ) { } } | if ( ! file . isAbsolute ( ) ) { String result = file . getPath ( ) . replace ( File . separatorChar , '/' ) ; if ( isRelativeUri ( result ) ) return result ; } throw new IllegalArgumentException ( "Invalid relative path: " + file ) ; |
public class XNElement { /** * Store the element ' s content and recursively call itself for children .
* @ param stream the stream output
* @ throws XMLStreamException if an error occurs */
protected void saveInternal ( XMLStreamWriter stream ) throws XMLStreamException { } } | if ( namespace != null ) { stream . writeStartElement ( prefix , namespace , name ) ; } else { stream . writeStartElement ( name ) ; } for ( Map . Entry < XAttributeName , String > a : attributes . entrySet ( ) ) { XAttributeName an = a . getKey ( ) ; if ( an . namespace != null ) { stream . writeAttribute ( an . prefix , an . namespace , an . name , a . getValue ( ) ) ; } else { stream . writeAttribute ( an . name , a . getValue ( ) ) ; } } if ( content != null ) { stream . writeCharacters ( content ) ; } else { for ( XNElement e : children ) { e . saveInternal ( stream ) ; } } stream . writeEndElement ( ) ; |
public class ExpressRouteCircuitPeeringsInner { /** * Creates or updates a peering in the specified express route circuits .
* @ param resourceGroupName The name of the resource group .
* @ param circuitName The name of the express route circuit .
* @ param peeringName The name of the peering .
* @ param peeringParameters Parameters supplied to the create or update express route circuit peering operation .
* @ param serviceCallback the async ServiceCallback to handle successful and failed responses .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the { @ link ServiceFuture } object */
public ServiceFuture < ExpressRouteCircuitPeeringInner > beginCreateOrUpdateAsync ( String resourceGroupName , String circuitName , String peeringName , ExpressRouteCircuitPeeringInner peeringParameters , final ServiceCallback < ExpressRouteCircuitPeeringInner > serviceCallback ) { } } | return ServiceFuture . fromResponse ( beginCreateOrUpdateWithServiceResponseAsync ( resourceGroupName , circuitName , peeringName , peeringParameters ) , serviceCallback ) ; |
public class RelationID { /** * creates relation id from the database record ( as though it is quoted )
* @ param schema as is in DB ( possibly null )
* @ param table as is in DB
* @ return */
public static RelationID createRelationIdFromDatabaseRecord ( QuotedIDFactory idfac , String schema , String table ) { } } | // both IDs are as though they are quoted - - DB stores names as is
return new RelationID ( QuotedID . createIdFromDatabaseRecord ( idfac , schema ) , QuotedID . createIdFromDatabaseRecord ( idfac , table ) ) ; |
public class PackageSummaryBuilder { /** * Build the package documentation .
* @ param node the XML element that specifies which components to document
* @ param contentTree the content tree to which the documentation will be added */
public void buildPackageDoc ( XMLNode node , Content contentTree ) throws Exception { } } | contentTree = packageWriter . getPackageHeader ( Util . getPackageName ( packageDoc ) ) ; buildChildren ( node , contentTree ) ; packageWriter . addPackageFooter ( contentTree ) ; packageWriter . printDocument ( contentTree ) ; packageWriter . close ( ) ; Util . copyDocFiles ( configuration , packageDoc ) ; |
public class IdGenerator { /** * Extracts the ( UNIX ) timestamp from a tiny ascii id ( radix
* { @ link Character # MAX _ RADIX } ) .
* @ param idTinyAscii
* @ return the UNIX timestamp ( milliseconds )
* @ throws NumberFormatException */
public static long extractTimestampTinyAscii ( String idTinyAscii ) throws NumberFormatException { } } | return extractTimestampTiny ( Long . parseLong ( idTinyAscii , Character . MAX_RADIX ) ) ; |
public class StatusCodes { /** * Initialize this status code with the input information .
* @ param code
* @ param phrase
* @ param isError */
protected void init ( int code , String phrase , boolean isError ) { } } | this . myPhrase = phrase ; this . myPhraseBytes = HttpChannelUtils . getEnglishBytes ( phrase ) ; this . myIntCode = code ; if ( isError ) { this . myError = new HttpError ( code , this . myPhrase ) ; } initSpecialArrays ( ) ; checkForAllowedBody ( ) ; |
public class BaseDfuImpl { /** * Writes the operation code to the characteristic .
* This method is SYNCHRONOUS and wait until the
* { @ link android . bluetooth . BluetoothGattCallback # onCharacteristicWrite ( android . bluetooth . BluetoothGatt , android . bluetooth . BluetoothGattCharacteristic , int ) }
* will be called or the device gets disconnected .
* If connection state will change , or an error will occur , an exception will be thrown .
* @ param characteristic the characteristic to write to . Should be the DFU CONTROL POINT
* @ param value the value to write to the characteristic
* @ param reset whether the command trigger restarting the device
* @ throws DeviceDisconnectedException Thrown when the device will disconnect in the middle of
* the transmission .
* @ throws DfuException Thrown if DFU error occur .
* @ throws UploadAbortedException Thrown if DFU operation was aborted by user . */
void writeOpCode ( @ NonNull final BluetoothGattCharacteristic characteristic , @ NonNull final byte [ ] value , final boolean reset ) throws DeviceDisconnectedException , DfuException , UploadAbortedException { } } | if ( mAborted ) throw new UploadAbortedException ( ) ; mReceivedData = null ; mError = 0 ; mRequestCompleted = false ; /* * Sending a command that will make the DFU target to reboot may cause an error 133
* ( 0x85 - Gatt Error ) . If so , with this flag set , the error will not be shown to the user
* as the peripheral is disconnected anyway .
* See : mGattCallback # onCharacteristicWrite ( . . . ) method */
mResetRequestSent = reset ; characteristic . setWriteType ( BluetoothGattCharacteristic . WRITE_TYPE_DEFAULT ) ; characteristic . setValue ( value ) ; mService . sendLogBroadcast ( DfuBaseService . LOG_LEVEL_VERBOSE , "Writing to characteristic " + characteristic . getUuid ( ) ) ; mService . sendLogBroadcast ( DfuBaseService . LOG_LEVEL_DEBUG , "gatt.writeCharacteristic(" + characteristic . getUuid ( ) + ")" ) ; mGatt . writeCharacteristic ( characteristic ) ; // We have to wait for confirmation
try { synchronized ( mLock ) { while ( ( ! mRequestCompleted && mConnected && mError == 0 ) || mPaused ) mLock . wait ( ) ; } } catch ( final InterruptedException e ) { loge ( "Sleeping interrupted" , e ) ; } if ( ! mResetRequestSent && ! mConnected ) throw new DeviceDisconnectedException ( "Unable to write Op Code " + value [ 0 ] + ": device disconnected" ) ; if ( ! mResetRequestSent && mError != 0 ) throw new DfuException ( "Unable to write Op Code " + value [ 0 ] , mError ) ; |
public class RichByteBufferImpl { /** * Resets the buffer with a new underlying buffer .
* @ param buff
* @ param p */
void reset ( com . ibm . wsspi . bytebuffer . WsByteBuffer buff , RichByteBufferPool p ) { } } | this . buffer = buff ; this . pool = p ; |
public class ShutdownUtil { /** * TODO : make wait time configurable ? */
public static void shutdownExecutor ( ExecutorService executor , final String name ) { } } | executor . shutdown ( ) ; try { log . info ( "Waiting for %s to shutdown" , name ) ; if ( ! executor . awaitTermination ( 5 , TimeUnit . SECONDS ) ) { log . warn ( "%s did not shutdown properly" , name ) ; } } catch ( InterruptedException e ) { log . warn ( "Interrupted while waiting for %s to shutdown" , name ) ; Thread . currentThread ( ) . interrupt ( ) ; } |
public class ClosureOptimizePrimitives { /** * Converts all of the given call nodes to object literals that are safe to
* do so . */
private void processObjectCreateCall ( Node callNode ) { } } | Node curParam = callNode . getSecondChild ( ) ; if ( canOptimizeObjectCreate ( curParam ) ) { Node objNode = IR . objectlit ( ) . srcref ( callNode ) ; while ( curParam != null ) { Node keyNode = curParam ; Node valueNode = curParam . getNext ( ) ; curParam = valueNode . getNext ( ) ; callNode . removeChild ( keyNode ) ; callNode . removeChild ( valueNode ) ; addKeyValueToObjLit ( objNode , keyNode , valueNode ) ; } callNode . replaceWith ( objNode ) ; compiler . reportChangeToEnclosingScope ( objNode ) ; } |
public class TagletWriterImpl { /** * { @ inheritDoc } */
public Content returnTagOutput ( Tag returnTag ) { } } | ContentBuilder result = new ContentBuilder ( ) ; result . addContent ( HtmlTree . DT ( HtmlTree . SPAN ( HtmlStyle . returnLabel , new StringContent ( configuration . getText ( "doclet.Returns" ) ) ) ) ) ; result . addContent ( HtmlTree . DD ( htmlWriter . commentTagsToContent ( returnTag , null , returnTag . inlineTags ( ) , false ) ) ) ; return result ; |
public class Strings { /** * Return { @ code true } if the given string is surrounded by the quote character given , and { @ code
* false } otherwise .
* @ param value The string to inspect .
* @ return { @ code true } if the given string is surrounded by the quote character , and { @ code
* false } otherwise . */
private static boolean isQuoted ( String value , char quoteChar ) { } } | return value != null && value . length ( ) > 1 && value . charAt ( 0 ) == quoteChar && value . charAt ( value . length ( ) - 1 ) == quoteChar ; |
public class LikeFunctions { /** * TODO : this should not be callable from SQL */
@ ScalarFunction ( value = "like" , hidden = true ) @ LiteralParameters ( "x" ) @ SqlType ( StandardTypes . BOOLEAN ) public static boolean likeVarchar ( @ SqlType ( "varchar(x)" ) Slice value , @ SqlType ( LikePatternType . NAME ) Regex pattern ) { } } | // Joni can infinite loop with UTF8Encoding when invalid UTF - 8 is encountered .
// NonStrictUTF8Encoding must be used to avoid this issue .
byte [ ] bytes = value . getBytes ( ) ; return regexMatches ( pattern , bytes ) ; |
public class SimpleAsyncManager { protected Runnable createRunnable ( ConcurrentAsyncCall call , String keyword ) { } } | // in caller thread
final Map < String , Object > threadCacheMap = inheritThreadCacheContext ( call ) ; final AccessContext accessContext = inheritAccessContext ( call ) ; final CallbackContext callbackContext = inheritCallbackContext ( call ) ; final Map < String , Object > variousContextMap = findCallerVariousContextMap ( ) ; return ( ) -> { // in new thread
prepareThreadCacheContext ( call , threadCacheMap ) ; preparePreparedAccessContext ( call , accessContext ) ; prepareCallbackContext ( call , callbackContext ) ; final Object variousPreparedObj = prepareVariousContext ( call , variousContextMap ) ; final long before = showRunning ( keyword ) ; Throwable cause = null ; try { call . callback ( ) ; } catch ( Throwable e ) { handleAsyncCallbackException ( call , before , e ) ; cause = e ; } finally { showFinishing ( keyword , before , cause ) ; // should be before clearing because of using them
clearVariousContext ( call , variousContextMap , variousPreparedObj ) ; clearCallbackContext ( call ) ; clearPreparedAccessContext ( call ) ; clearThreadCacheContext ( call ) ; } } ; |
public class HessianSkeleton { /** * Invoke the object with the request from the input stream .
* @ param in the Hessian input stream
* @ param out the Hessian output stream */
public void invoke ( AbstractHessianInput in , AbstractHessianOutput out ) throws Exception { } } | invoke ( _service , in , out ) ; |
public class AddConversionTrackers { /** * Runs the example .
* @ param adWordsServices the services factory .
* @ param session the session .
* @ throws ApiException if the API request failed with one or more service errors .
* @ throws RemoteException if the API request failed due to other errors . */
public static void runExample ( AdWordsServicesInterface adWordsServices , AdWordsSession session ) throws RemoteException { } } | // Get the ConversionTrackerService .
ConversionTrackerServiceInterface service = adWordsServices . get ( session , ConversionTrackerServiceInterface . class ) ; List < ConversionTracker > conversionTrackers = new ArrayList < > ( ) ; // Create an AdWords conversion tracker .
AdWordsConversionTracker adWordsConversionTracker = new AdWordsConversionTracker ( ) ; adWordsConversionTracker . setName ( "Earth to Mars Cruises Conversion # " + System . currentTimeMillis ( ) ) ; adWordsConversionTracker . setCategory ( ConversionTrackerCategory . DEFAULT ) ; // You can optionally provide these field ( s ) .
adWordsConversionTracker . setStatus ( ConversionTrackerStatus . ENABLED ) ; adWordsConversionTracker . setViewthroughLookbackWindow ( 15 ) ; adWordsConversionTracker . setDefaultRevenueValue ( 1d ) ; adWordsConversionTracker . setAlwaysUseDefaultRevenueValue ( Boolean . TRUE ) ; conversionTrackers . add ( adWordsConversionTracker ) ; // Create an upload conversion for offline conversion imports .
UploadConversion uploadConversion = new UploadConversion ( ) ; // Set an appropriate category . This field is optional , and will be set to
// DEFAULT if not mentioned .
uploadConversion . setCategory ( ConversionTrackerCategory . LEAD ) ; uploadConversion . setName ( "Upload Conversion #" + System . currentTimeMillis ( ) ) ; uploadConversion . setViewthroughLookbackWindow ( 30 ) ; uploadConversion . setCtcLookbackWindow ( 90 ) ; // Optional : Set the default currency code to use for conversions
// that do not specify a conversion currency . This must be an ISO 4217
// 3 - character currency code such as " EUR " or " USD " .
// If this field is not set on this UploadConversion , AdWords will use
// the account ' s currency .
uploadConversion . setDefaultRevenueCurrencyCode ( "EUR" ) ; // Optional : Set the default revenue value to use for conversions
// that do not specify a conversion value . Note that this value
// should NOT be in micros .
uploadConversion . setDefaultRevenueValue ( 2.50 ) ; // Optional : To upload fractional conversion credits , mark the upload conversion
// as externally attributed . See
// https : / / developers . google . com / adwords / api / docs / guides / conversion - tracking # importing _ externally _ attributed _ conversions
// to learn more about importing externally attributed conversions .
// uploadConversion . setIsExternallyAttributed ( true ) ;
conversionTrackers . add ( uploadConversion ) ; // Create operations .
List < ConversionTrackerOperation > operations = conversionTrackers . stream ( ) . map ( conversionTracker -> { ConversionTrackerOperation operation = new ConversionTrackerOperation ( ) ; operation . setOperator ( Operator . ADD ) ; operation . setOperand ( conversionTracker ) ; return operation ; } ) . collect ( Collectors . toList ( ) ) ; // Add the conversions .
ConversionTrackerReturnValue result = service . mutate ( operations . toArray ( new ConversionTrackerOperation [ operations . size ( ) ] ) ) ; // Display conversion .
for ( ConversionTracker conversionTracker : result . getValue ( ) ) { System . out . printf ( "Conversion with ID %d, name '%s', status '%s', " + "category '%s' was added.%n" , conversionTracker . getId ( ) , conversionTracker . getName ( ) , conversionTracker . getStatus ( ) , conversionTracker . getCategory ( ) ) ; if ( conversionTracker instanceof AdWordsConversionTracker ) { System . out . printf ( "Google global site tag:%n%s%n%n" , conversionTracker . getGoogleGlobalSiteTag ( ) ) ; System . out . printf ( "Google event snippet:%n%s%n%n" , conversionTracker . getGoogleEventSnippet ( ) ) ; } } |
public class ReconfigurationServlet { /** * { @ inheritDoc } */
@ SuppressWarnings ( "unchecked" ) @ Override protected void doPost ( HttpServletRequest req , HttpServletResponse resp ) throws ServletException , IOException { } } | LOG . info ( "POST from address: " + req . getRemoteAddr ( ) + " Values trying to set: " + mapToString ( req . getParameterMap ( ) ) ) ; PrintWriter out = resp . getWriter ( ) ; Reconfigurable reconf = getReconfigurable ( req ) ; String nodeName = reconf . getClass ( ) . getCanonicalName ( ) ; printHeader ( out , nodeName ) ; try { applyChanges ( out , reconf , req ) ; } catch ( ReconfigurationException e ) { resp . sendError ( HttpServletResponse . SC_INTERNAL_SERVER_ERROR , StringUtils . stringifyException ( e ) ) ; return ; } out . println ( "<p><a href=\"" + req . getServletPath ( ) + "\">back</a></p>" ) ; printFooter ( out ) ; |
public class ConfigRESTHandler { /** * Compute the unique identifier from the id and config . displayId .
* If a top level configuration element has an id , the id is the unique identifier .
* Otherwise , the config . displayId is the unique identifier .
* @ param configDisplayId config . displayId of configuration element .
* @ param id id of configuration element . Null if none .
* @ return the unique identifier ( uid ) */
@ Trivial private static final String getUID ( String configDisplayId , String id ) { } } | return id == null || configDisplayId . matches ( ".*/.*\\[.*\\].*" ) ? configDisplayId : id ; |
public class Search { /** * Removes a stop criterion . In case this stop criterion had not been added , < code > false < / code > is returned .
* Note that this method may only be called when the search is idle .
* @ param stopCriterion stop criterion to be removed
* @ return < code > true < / code > if the stop criterion has been successfully removed
* @ throws SearchException if the search is not idle */
public boolean removeStopCriterion ( StopCriterion stopCriterion ) { } } | // acquire status lock
synchronized ( statusLock ) { // assert idle
assertIdle ( "Cannot remove stop criterion." ) ; // remove from checker
if ( stopCriterionChecker . remove ( stopCriterion ) ) { // log
LOGGER . debug ( "{}: removed stop criterion {}" , this , stopCriterion ) ; return true ; } else { return false ; } } |
public class NetworkEndpointGroupClient { /** * Retrieves the list of network endpoint groups that are located in the specified project and
* zone .
* < p > Sample code :
* < pre > < code >
* try ( NetworkEndpointGroupClient networkEndpointGroupClient = NetworkEndpointGroupClient . create ( ) ) {
* ProjectZoneName zone = ProjectZoneName . of ( " [ PROJECT ] " , " [ ZONE ] " ) ;
* for ( NetworkEndpointGroup element : networkEndpointGroupClient . listNetworkEndpointGroups ( zone ) . iterateAll ( ) ) {
* / / doThingsWith ( element ) ;
* < / code > < / pre >
* @ param zone The name of the zone where the network endpoint group is located . It should comply
* with RFC1035.
* @ throws com . google . api . gax . rpc . ApiException if the remote call fails */
@ BetaApi public final ListNetworkEndpointGroupsPagedResponse listNetworkEndpointGroups ( ProjectZoneName zone ) { } } | ListNetworkEndpointGroupsHttpRequest request = ListNetworkEndpointGroupsHttpRequest . newBuilder ( ) . setZone ( zone == null ? null : zone . toString ( ) ) . build ( ) ; return listNetworkEndpointGroups ( request ) ; |
public class HotdeployBehavior { @ Override protected ComponentDef getComponentDef ( LaContainer container , Object key ) { } } | synchronized ( this ) { // to avoid too - many registration of async hot - deploy ( basically job )
return doGetComponentDef ( container , key ) ; } |
public class Telemetry { /** * Initialize the telemetry connector
* @ param conn connection with the session to use for the connector
* @ param flushSize maximum size of telemetry batch before flush
* @ return a telemetry connector */
public static Telemetry createTelemetry ( Connection conn , int flushSize ) { } } | try { return createTelemetry ( conn . unwrap ( SnowflakeConnectionV1 . class ) . getSfSession ( ) , flushSize ) ; } catch ( SQLException ex ) { logger . debug ( "input connection is not a SnowflakeConnection" ) ; return null ; } |
public class GeoPackageTextOutput { /** * Text output from a Contents
* @ param contents
* contents
* @ return text */
public String textOutput ( Contents contents ) { } } | StringBuilder output = new StringBuilder ( ) ; output . append ( "\t" + Contents . COLUMN_TABLE_NAME + ": " + contents . getTableName ( ) ) ; output . append ( "\n\t" + Contents . COLUMN_DATA_TYPE + ": " + contents . getDataType ( ) ) ; output . append ( "\n\t" + Contents . COLUMN_IDENTIFIER + ": " + contents . getIdentifier ( ) ) ; output . append ( "\n\t" + Contents . COLUMN_DESCRIPTION + ": " + contents . getDescription ( ) ) ; output . append ( "\n\t" + Contents . COLUMN_LAST_CHANGE + ": " + contents . getLastChange ( ) ) ; output . append ( "\n\t" + Contents . COLUMN_MIN_X + ": " + contents . getMinX ( ) ) ; output . append ( "\n\t" + Contents . COLUMN_MIN_Y + ": " + contents . getMinY ( ) ) ; output . append ( "\n\t" + Contents . COLUMN_MAX_X + ": " + contents . getMaxX ( ) ) ; output . append ( "\n\t" + Contents . COLUMN_MAX_Y + ": " + contents . getMaxY ( ) ) ; output . append ( "\n" + textOutput ( contents . getSrs ( ) ) ) ; return output . toString ( ) ; |
public class ValueMatcherBuilder { /** * 处理数组形式表达式 < br >
* 处理的形式包括 :
* < ul >
* < li > < strong > a < / strong > 或 < strong > * < / strong > < / li >
* < li > < strong > a , b , c , d < / strong > < / li >
* < / ul >
* @ param value 子表达式值
* @ param parser 针对这个字段的解析器
* @ return 值列表 */
private static List < Integer > parseArray ( String value , ValueParser parser ) { } } | final List < Integer > values = new ArrayList < > ( ) ; final List < String > parts = StrUtil . split ( value , StrUtil . C_COMMA ) ; for ( String part : parts ) { CollectionUtil . addAllIfNotContains ( values , parseStep ( part , parser ) ) ; } return values ; |
public class JmsJcaManagedConnectionFactoryImpl { /** * Returns the map of properties required by TRM .
* @ return the map of TRM properties */
Map getTrmProperties ( ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . entry ( this , TRACE , "getTrmProperties" ) ; } final Map trmProperties = new HashMap ( ) ; final String trmBusName = getBusName ( ) ; if ( ( trmBusName != null ) && ( ! trmBusName . equals ( "" ) ) ) { trmProperties . put ( SibTrmConstants . BUSNAME , trmBusName ) ; } final String trmTarget = getTarget ( ) ; if ( ( trmTarget != null ) && ( ! trmTarget . equals ( "" ) ) ) { trmProperties . put ( SibTrmConstants . TARGET_GROUP , trmTarget ) ; } final String trmTargetType = getTargetType ( ) ; if ( ( trmTargetType != null ) && ( ! trmTargetType . equals ( "" ) ) ) { trmProperties . put ( SibTrmConstants . TARGET_TYPE , trmTargetType ) ; } final String trmTargetSignificance = getTargetSignificance ( ) ; if ( ( trmTargetSignificance != null ) && ( ! trmTargetSignificance . equals ( "" ) ) ) { trmProperties . put ( SibTrmConstants . TARGET_SIGNIFICANCE , trmTargetSignificance ) ; } final String trmTargetTransportChain = getTargetTransportChain ( ) ; if ( ( trmTargetTransportChain != null ) && ( ! trmTargetTransportChain . equals ( "" ) ) ) { trmProperties . put ( SibTrmConstants . TARGET_TRANSPORT_CHAIN , trmTargetTransportChain ) ; } final String trmProviderEndpoints = getRemoteServerAddress ( ) ; if ( ( trmProviderEndpoints != null ) && ( ! trmProviderEndpoints . equals ( "" ) ) ) { trmProperties . put ( SibTrmConstants . PROVIDER_ENDPOINTS , trmProviderEndpoints ) ; } final String trmTargetTransport = getTargetTransport ( ) ; if ( ( trmTargetTransport != null ) && ( ! trmTargetTransport . equals ( "" ) ) ) { trmProperties . put ( SibTrmConstants . TARGET_TRANSPORT_TYPE , trmTargetTransport ) ; } final String trmConnectionProximity = getConnectionProximity ( ) ; if ( ( trmConnectionProximity != null ) && ( ! trmConnectionProximity . equals ( "" ) ) ) { trmProperties . put ( SibTrmConstants . CONNECTION_PROXIMITY , trmConnectionProximity ) ; } final String trmSubscriptionProtocol = getSubscriptionProtocol ( ) ; if ( ( trmSubscriptionProtocol != null ) && ( ! trmSubscriptionProtocol . equals ( "" ) ) ) { trmProperties . put ( SibTrmConstants . SUBSCRIPTION_PROTOCOL , trmSubscriptionProtocol ) ; } final String trmMulticastInterface = getMulticastInterface ( ) ; if ( ( trmMulticastInterface != null ) && ( ! trmMulticastInterface . equals ( "" ) ) ) { trmProperties . put ( SibTrmConstants . MULTICAST_INTERFACE , trmMulticastInterface ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . exit ( this , TRACE , "getTrmProperties" , trmProperties ) ; } return trmProperties ; |
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public EClass getIfcMemberStandardCase ( ) { } } | if ( ifcMemberStandardCaseEClass == null ) { ifcMemberStandardCaseEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 381 ) ; } return ifcMemberStandardCaseEClass ; |
public class ContinuedFraction { /** * Evaluates the continued fraction at the value x .
* The implementation of this method is based on the modified Lentz algorithm as described
* on page 18 ff . in :
* < ul >
* < li >
* I . J . Thompson , A . R . Barnett . " Coulomb and Bessel Functions of Complex Arguments and Order . "
* < a target = " _ blank " href = " http : / / www . fresco . org . uk / papers / Thompson - JCP64p490 . pdf " >
* http : / / www . fresco . org . uk / papers / Thompson - JCP64p490 . pdf < / a >
* < / li >
* < / ul >
* < b > Note : < / b > the implementation uses the terms a < sub > i < / sub > and b < sub > i < / sub > as defined in
* < a href = " http : / / mathworld . wolfram . com / ContinuedFraction . html " > Continued Fraction @ MathWorld < / a > .
* @ param x the evaluation point .
* @ param epsilon maximum error allowed .
* @ param maxIterations maximum number of convergents
* @ return the value of the continued fraction evaluated at x .
* @ throws IllegalStateException if the algorithm fails to converge .
* @ throws IllegalStateException if maximal number of iterations is reached */
public double evaluate ( double x , double epsilon , int maxIterations ) { } } | final double small = 1e-50 ; double hPrev = getA ( 0 , x ) ; // use the value of small as epsilon criteria for zero checks
if ( Precision . isEquals ( hPrev , 0.0 , small ) ) { hPrev = small ; } int n = 1 ; double dPrev = 0.0 ; double cPrev = hPrev ; double hN = hPrev ; while ( n < maxIterations ) { final double a = getA ( n , x ) ; final double b = getB ( n , x ) ; double dN = a + b * dPrev ; if ( Precision . isEquals ( dN , 0.0 , small ) ) { dN = small ; } double cN = a + b / cPrev ; if ( Precision . isEquals ( cN , 0.0 , small ) ) { cN = small ; } dN = 1 / dN ; final double deltaN = cN * dN ; hN = hPrev * deltaN ; if ( Double . isInfinite ( hN ) ) { throw new IllegalStateException ( "Continued fraction convergents diverged to +/- infinity for value " + x ) ; } if ( Double . isNaN ( hN ) ) { throw new IllegalStateException ( "Continued fraction diverged to NaN for value " + x ) ; } if ( Math . abs ( deltaN - 1.0 ) < epsilon ) { break ; } dPrev = dN ; cPrev = cN ; hPrev = hN ; n ++ ; } if ( n >= maxIterations ) { throw new IllegalStateException ( "Continued fraction convergents failed to converge (in less than " + maxIterations + " iterations) for value " + x ) ; } return hN ; |
public class BitReader { /** * Reads the next length - bits from the input .
* The maximum value of bits that could be read is 31 . ( Maximum value of a
* positive number that could be stored in an integer without any
* conversion . )
* @ param length
* number of bits to read
* @ return content as integer value or - 1 if the end of the stream has been
* reached
* @ throws DecodingException
* if the decoding failed */
public int read ( final int length ) throws DecodingException { } } | if ( length > 31 ) { throw ErrorFactory . createDecodingException ( ErrorKeys . DIFFTOOL_DECODING_VALUE_OUT_OF_RANGE , "more than maximum length: " + length ) ; } int v , b = 0 ; for ( int i = length - 1 ; i >= 0 ; i -- ) { v = readBit ( ) ; if ( v == - 1 ) { if ( i != length - 1 ) { throw ErrorFactory . createDecodingException ( ErrorKeys . DIFFTOOL_DECODING_UNEXPECTED_END_OF_STREAM ) ; } return - 1 ; } b |= v << i ; } return b ; |
public class HttpRequestBuilder { /** * How many times to retry if the intial attempt fails ? */
public HttpRequestBuilder withRetries ( int n ) { } } | Preconditions . checkArg ( n >= 0 , "number of retries must be >= 0" ) ; this . numAttempts = n + 1 ; entry . withMaxAttempts ( numAttempts ) ; return this ; |
public class CmsExplorerTypeSettings { /** * Sets the basic attributes of the type settings . < p >
* @ param name the name of the type setting
* @ param key the key name of the explorer type setting
* @ param icon the icon path and file name of the explorer type setting */
public void setTypeAttributes ( String name , String key , String icon ) { } } | setName ( name ) ; setKey ( key ) ; setIcon ( icon ) ; |
public class AppServiceCertificateOrdersInner { /** * Create or update a certificate purchase order .
* Create or update a certificate purchase order .
* @ param resourceGroupName Name of the resource group to which the resource belongs .
* @ param certificateOrderName Name of the certificate order .
* @ param certificateDistinguishedName Distinguished name to to use for the certificate order .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ throws DefaultErrorResponseException thrown if the request is rejected by server
* @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
* @ return the AppServiceCertificateOrderInner object if successful . */
public AppServiceCertificateOrderInner update ( String resourceGroupName , String certificateOrderName , AppServiceCertificateOrderPatchResource certificateDistinguishedName ) { } } | return updateWithServiceResponseAsync ( resourceGroupName , certificateOrderName , certificateDistinguishedName ) . toBlocking ( ) . single ( ) . body ( ) ; |
public class BindingsProcessor { /** * Create an explicit binding for the Ginjector . */
private void registerGinjectorBinding ( ) { } } | Key < ? extends Ginjector > ginjectorKey = Key . get ( ginjectorInterface ) ; rootGinjectorBindings . addBinding ( ginjectorKey , bindingFactory . getGinjectorBinding ( ) ) ; |
public class EditText { /** * < p > Sets the listener that will be notified when the user selects an item
* in the drop down list . < / p >
* < p > Only work when autoComplete mode is { @ link # AUTOCOMPLETE _ MODE _ SINGLE } or { @ link # AUTOCOMPLETE _ MODE _ MULTI } < / p >
* @ param l the item selected listener */
public void setOnItemSelectedListener ( AdapterView . OnItemSelectedListener l ) { } } | if ( mAutoCompleteMode == AUTOCOMPLETE_MODE_NONE ) return ; ( ( AutoCompleteTextView ) mInputView ) . setOnItemSelectedListener ( l ) ; |
public class Bindable { /** * Create a new { @ link Bindable } { @ link Set } of the specified element type .
* @ param < E > the element type
* @ param elementType the set element type
* @ return a { @ link Bindable } instance */
public static < E > Bindable < Set < E > > setOf ( Class < E > elementType ) { } } | return of ( ResolvableType . forClassWithGenerics ( Set . class , elementType ) ) ; |
public class PutLogEventsRequest { /** * The log events .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setLogEvents ( java . util . Collection ) } or { @ link # withLogEvents ( java . util . Collection ) } if you want to
* override the existing values .
* @ param logEvents
* The log events .
* @ return Returns a reference to this object so that method calls can be chained together . */
public PutLogEventsRequest withLogEvents ( InputLogEvent ... logEvents ) { } } | if ( this . logEvents == null ) { setLogEvents ( new com . amazonaws . internal . SdkInternalList < InputLogEvent > ( logEvents . length ) ) ; } for ( InputLogEvent ele : logEvents ) { this . logEvents . add ( ele ) ; } return this ; |
public class GeometryExpression { /** * Returns 1 ( TRUE ) if this geometric object “ spatially overlaps ” anotherGeometry .
* @ param geometry other geometry
* @ return true , if overlaps */
public BooleanExpression overlaps ( Expression < ? extends Geometry > geometry ) { } } | return Expressions . booleanOperation ( SpatialOps . OVERLAPS , mixin , geometry ) ; |
public class VirtualMachineScaleSetsInner { /** * Perform maintenance on one or more virtual machines in a VM scale set .
* @ param resourceGroupName The name of the resource group .
* @ param vmScaleSetName The name of the VM scale set .
* @ param instanceIds The virtual machine scale set instance ids . Omitting the virtual machine scale set instance ids will result in the operation being performed on all virtual machines in the virtual machine scale set .
* @ 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 < OperationStatusResponseInner > performMaintenanceAsync ( String resourceGroupName , String vmScaleSetName , List < String > instanceIds , final ServiceCallback < OperationStatusResponseInner > serviceCallback ) { } } | return ServiceFuture . fromResponse ( performMaintenanceWithServiceResponseAsync ( resourceGroupName , vmScaleSetName , instanceIds ) , serviceCallback ) ; |
public class TrackedTorrent { /** * Remove unfresh peers from this torrent .
* Collect and remove all non - fresh peers from this torrent . This is
* usually called by the periodic peer collector of the BitTorrent tracker . */
public void collectUnfreshPeers ( int expireTimeoutSec ) { } } | for ( TrackedPeer peer : this . peers . values ( ) ) { if ( ! peer . isFresh ( expireTimeoutSec ) ) { this . peers . remove ( new PeerUID ( peer . getAddress ( ) , this . getHexInfoHash ( ) ) ) ; } } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.