signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class RetryPolicy { /** * Resets the internal counter . This should be called whenever a new record is added , and whenever all
* { @ link ShareRequest } completed successfully .
* @ param context the { @ link Context } . */
static void reset ( Context context ) { } } | Context appContext = context . getApplicationContext ( ) ; String key = appContext . getString ( R . string . wings__retry_policy_consecutive_fails ) ; // Synchronously reset consecutive fail count .
SharedPreferences preferences = PreferenceManager . getDefaultSharedPreferences ( appContext ) ; Editor editor = prefere... |
public class JFinalConfigExt { /** * = = = = = Override */
@ Override public String getProperty ( String key ) { } } | String p = super . getProperty ( key ) ; if ( StrKit . isBlank ( p ) ) { new IllegalArgumentException ( "`" + key + "` Cannot be empty, set `" + key + "` in " + cfg + " file" ) ; } return p ; |
public class XStringForFSB { /** * Returns a new string that is a substring of this string . The
* substring begins with the character at the specified index and
* extends to the end of this string . < p >
* Examples :
* < blockquote > < pre >
* " unhappy " . substring ( 2 ) returns " happy "
* " Harbison "... | int len = m_length - beginIndex ; if ( len <= 0 ) return XString . EMPTYSTRING ; else { int start = m_start + beginIndex ; return new XStringForFSB ( fsb ( ) , start , len ) ; } |
public class DiscussionCommentResourcesImpl { /** * Update the specified comment
* It mirrors to the following Smartsheet REST API method : PUT / sheets / { sheetId } / comments / { commentId }
* @ param sheetId the sheet id
* @ param comment the new comment object
* @ return the updated comment
* @ throws Il... | return this . updateResource ( "sheets/" + sheetId + "/comments/" + comment . getId ( ) , Comment . class , comment ) ; |
public class ApiOvhHostingweb { /** * Alter this object properties
* REST : PUT / hosting / web / { serviceName } / ownLogs / { id } / userLogs / { login }
* @ param body [ required ] New object properties
* @ param serviceName [ required ] The internal name of your hosting
* @ param id [ required ] Id of the o... | String qPath = "/hosting/web/{serviceName}/ownLogs/{id}/userLogs/{login}" ; StringBuilder sb = path ( qPath , serviceName , id , login ) ; exec ( qPath , "PUT" , sb . toString ( ) , body ) ; |
public class SccpFlowControl { /** * IT , DT2 , AK */
public void initializeMessageNumbering ( SccpConnDt2MessageImpl msg ) { } } | sendSequenceNumber = getNextSequenceNumber ( ) ; msg . setSequencing ( sendSequenceNumber , sendSequenceNumberExpectedAtInput ) ; inputWindow . setLowerEdge ( sendSequenceNumberExpectedAtInput ) ; |
public class AbstractFsCheckpointStorage { /** * Takes the given string ( representing a pointer to a checkpoint ) and resolves it to a file
* status for the checkpoint ' s metadata file .
* @ param checkpointPointer The pointer to resolve .
* @ return A state handle to checkpoint / savepoint ' s metadata .
* @... | checkNotNull ( checkpointPointer , "checkpointPointer" ) ; checkArgument ( ! checkpointPointer . isEmpty ( ) , "empty checkpoint pointer" ) ; // check if the pointer is in fact a valid file path
final Path path ; try { path = new Path ( checkpointPointer ) ; } catch ( Exception e ) { throw new IOException ( "Checkpoint... |
public class TextComponentUtil { /** * Returns the start of the previous line if that line is only whitespace . Returns - 1 otherwise . */
public static int getWhiteSpaceLineStartBefore ( String script , int start ) { } } | int startLine = getLineStart ( script , start ) ; if ( startLine > 0 ) { int nextLineEnd = startLine - 1 ; int previousLineStart = getLineStart ( script , nextLineEnd ) ; boolean whitespace = GosuStringUtil . isWhitespace ( script . substring ( previousLineStart , nextLineEnd ) ) ; if ( whitespace ) { return previousLi... |
public class OAuth2ConnectionFactory { /** * Create a OAuth2 - based { @ link Connection } from the connection data .
* @ param data connection data from which to create the connection */
public Connection < S > createConnection ( ConnectionData data ) { } } | return new OAuth2Connection < S > ( data , getOAuth2ServiceProvider ( ) , getApiAdapter ( ) ) ; |
public class DeferredAttr { /** * Routine that performs speculative type - checking ; the input AST node is
* cloned ( to avoid side - effects cause by Attr ) and compiler state is
* restored after type - checking . All diagnostics ( but critical ones ) are
* disabled during speculative type - checking . */
JCTre... | return attribSpeculative ( tree , env , resultInfo , treeCopier , ( newTree ) -> new DeferredAttrDiagHandler ( log , newTree ) , null ) ; |
public class MtasFieldsProducer { /** * Adds the index input to list .
* @ param name the name
* @ param in the in
* @ param postingsFormatName the postings format name
* @ return the string
* @ throws IOException Signals that an I / O exception has occurred . */
private String addIndexInputToList ( String na... | if ( indexInputList . get ( name ) != null ) { indexInputList . get ( name ) . close ( ) ; } if ( in != null ) { String localPostingsFormatName = postingsFormatName ; if ( localPostingsFormatName == null ) { localPostingsFormatName = in . readString ( ) ; } else if ( ! in . readString ( ) . equals ( localPostingsFormat... |
public class ServerService { /** * Create snapshot of a single server or group of servers
* @ param expirationDays expiration days ( must be between 1 and 10)
* @ param serverFilter search servers criteria
* @ return OperationFuture wrapper for BaseServerResponse list */
public OperationFuture < List < Server > >... | List < Server > serverList = findServers ( serverFilter ) ; return powerOperationResponse ( serverList , "Create Snapshot" , client . createSnapshot ( new CreateSnapshotRequest ( ) . snapshotExpirationDays ( expirationDays ) . serverIds ( ids ( serverList ) ) ) ) ; |
public class AsyncFacebookRunner { /** * Make a request to the Facebook Graph API without any parameters .
* See http : / / developers . facebook . com / docs / api
* Note that this method is asynchronous and the callback will be invoked
* in a background thread ; operations that affect the UI will need to be
*... | request ( graphPath , new Bundle ( ) , "GET" , listener , state ) ; |
public class PinyinUtil { /** * 转换List < Pinyin > pinyinList到List < String > , 其中的String为带声调符号形式
* @ param pinyinList
* @ return */
public static List < String > convertPinyinList2TonePinyinList ( List < Pinyin > pinyinList ) { } } | List < String > tonePinyinList = new ArrayList < String > ( pinyinList . size ( ) ) ; for ( Pinyin pinyin : pinyinList ) { tonePinyinList . add ( pinyin . getPinyinWithToneMark ( ) ) ; } return tonePinyinList ; |
public class Logger { /** * Issue a log message with a level of INFO using { @ link java . text . MessageFormat } - style formatting .
* @ param t the throwable
* @ param format the message format string
* @ param params the parameters */
public void infov ( Throwable t , String format , Object ... params ) { } } | doLog ( Level . INFO , FQCN , format , params , t ) ; |
public class RsXembly { /** * Render source as XML .
* @ param dom DOM node to build upon
* @ param src Source
* @ return XML
* @ throws IOException If fails */
private static InputStream render ( final Node dom , final XeSource src ) throws IOException { } } | final Node copy = cloneNode ( dom ) ; final ByteArrayOutputStream baos = new ByteArrayOutputStream ( ) ; final Node node = new Xembler ( src . toXembly ( ) ) . applyQuietly ( copy ) ; try { TransformerFactory . newInstance ( ) . newTransformer ( ) . transform ( new DOMSource ( node ) , new StreamResult ( new Utf8Output... |
public class MetaDataService { /** * Retrieve series list of the specified metric
* @ param metricName metric name
* @ param entityName entity name ' s filter
* @ return list of series */
public List < Series > retrieveMetricSeries ( String metricName , String entityName ) { } } | return retrieveMetricSeries ( metricName , Collections . singletonMap ( "entity" , entityName ) ) ; |
public class TrainingsImpl { /** * Associate a set of images with a set of tags .
* @ param projectId The project id
* @ param createImageTagsOptionalParameter the object representing the optional parameters to be set before calling this API
* @ param serviceCallback the async ServiceCallback to handle successful... | return ServiceFuture . fromResponse ( createImageTagsWithServiceResponseAsync ( projectId , createImageTagsOptionalParameter ) , serviceCallback ) ; |
public class ListCommandInvocationsResult { /** * ( Optional ) A list of all invocations .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setCommandInvocations ( java . util . Collection ) } or { @ link # withCommandInvocations ( java . util . Collection ) }... | if ( this . commandInvocations == null ) { setCommandInvocations ( new com . amazonaws . internal . SdkInternalList < CommandInvocation > ( commandInvocations . length ) ) ; } for ( CommandInvocation ele : commandInvocations ) { this . commandInvocations . add ( ele ) ; } return this ; |
public class StringUtils { /** * Concatenate the given String arrays into one , with overlapping array
* elements included twice .
* The order of elements in the original arrays is preserved .
* @ param array1 the first array ( can be < code > null < / code > )
* @ param array2 the second array ( can be < code ... | if ( isEmpty ( array1 ) ) { return array2 ; } if ( isEmpty ( array2 ) ) { return array1 ; } String [ ] newArr = new String [ array1 . length + array2 . length ] ; System . arraycopy ( array1 , 0 , newArr , 0 , array1 . length ) ; System . arraycopy ( array2 , 0 , newArr , array1 . length , array2 . length ) ; return ne... |
public class DatabaseContentReader { /** * / * in case of failover , use init ( ) instead of initialize ( ) for retry */
private void init ( ) throws IOException , InterruptedException { } } | nakedDone = false ; // initialize the total length
float recToFragRatio = conf . getFloat ( RECORD_TO_FRAGMENT_RATIO , getDefaultRatio ( ) ) ; length = mlSplit . getLength ( ) * recToFragRatio ; // generate the query
String queryText ; long start = mlSplit . getStart ( ) + 1 + count ; long end = mlSplit . isLastSplit (... |
public class LTieSrtConsumerBuilder { /** * One of ways of creating builder . This is possibly the least verbose way where compiler should be able to guess the generic parameters . */
@ Nonnull public static < T > LTieSrtConsumer < T > tieSrtConsumerFrom ( Consumer < LTieSrtConsumerBuilder < T > > buildingFunction ) { ... | LTieSrtConsumerBuilder builder = new LTieSrtConsumerBuilder ( ) ; buildingFunction . accept ( builder ) ; return builder . build ( ) ; |
public class ControlCreateDurableImpl { /** * / * ( non - Javadoc )
* @ see com . ibm . ws . sib . mfp . control . ControlCreateDurable # isNoLocal ( ) */
public final boolean isNoLocal ( ) { } } | boolean result = false ; // if the value is unset then it has come from an environment with back level schema
if ( jmo . getChoiceField ( ControlAccess . BODY_CREATEDURABLE_NOLOCAL ) != ControlAccess . IS_BODY_CREATEDURABLE_NOLOCAL_UNSET ) { result = jmo . getBooleanField ( ControlAccess . BODY_CREATEDURABLE_NOLOCAL_VA... |
public class RiakIndex { /** * Return the values in this index .
* The returned { @ code Set } is unmodifiable .
* @ return an unmodifiable view of the values in this index . */
public final Set < T > values ( ) { } } | Set < T > convertedValues = new HashSet < > ( ) ; for ( BinaryValue baw : values ) { convertedValues . add ( convert ( baw ) ) ; } return Collections . unmodifiableSet ( convertedValues ) ; |
public class VertexDescription { /** * Checks if the given value is the default one . The simple equality test
* with GetDefaultValue does not work due to the use of NaNs as default
* value for some parameters . */
public static boolean isDefaultValue ( int semantics , double v ) { } } | return NumberUtils . doubleToInt64Bits ( _defaultValues [ semantics ] ) == NumberUtils . doubleToInt64Bits ( v ) ; |
public class JobsModule { /** * Allows { @ code Job } scheduling , delegating Guice create the { @ code Job } instance
* and inject members .
* If given { @ code Job } class is annotated with { @ link Scheduled } , then { @ code Job }
* and related { @ code Trigger } values will be extracted from it .
* @ param... | checkNotNull ( jobClass , "Argument 'jobClass' must be not null." ) ; if ( ! RequireUtil . allowClass ( getSettings ( ) , jobClass ) ) { return null ; } JobSchedulerBuilder builder = new JobSchedulerBuilder ( jobClass ) ; if ( jobClass . isAnnotationPresent ( Scheduled . class ) ) { Scheduled scheduled = jobClass . get... |
public class ConnectionManagerImpl { /** * Call rollback on the underlying connection . */
public void localRollback ( ) { } } | log . info ( "Rollback was called, do rollback on current connection " + con ) ; if ( ! this . isInLocalTransaction ) { throw new PersistenceBrokerException ( "Not in transaction, cannot abort" ) ; } try { // truncate the local transaction
this . isInLocalTransaction = false ; if ( ! broker . isManaged ( ) ) { if ( bat... |
public class SimpleFormatter { /** * / * [ deutsch ]
* < p > Konstruiert einen Formatierer f & uuml ; r einfache Zeitstempelobjekte . < / p >
* @ param dateStyle format style for the date component
* @ param timeStyle format style for the time component
* @ param locale format locale
* @ return new { @ code S... | DateFormat df = DateFormat . getDateTimeInstance ( dateStyle . getStyleValue ( ) , timeStyle . getStyleValue ( ) , locale ) ; String pattern = FormatUtils . removeZones ( getFormatPattern ( df ) ) ; return SimpleFormatter . ofTimestampPattern ( pattern , locale ) ; |
public class Task { /** * Registers the executor type . DO NOT USE THIS METHOD UNLESS YOU ARE
* DEVELOPING A NEW TASK EXECUTOR .
* @ param executionType
* the executor type */
public final void registerExecutionType ( ExecutionType executionType ) { } } | if ( executionType == null ) { throw new TaskExeception ( ExecutionType . class . getSimpleName ( ) + " NULL" ) ; } this . executionType = executionType ; |
public class DateContext { /** * Check if all values in the given data are valid and that the result will
* be a valid date .
* @ param month The month ( 1-12)
* @ param day The day ( 1-31)
* @ param year The year ( 4 - digit )
* @ param hour The hour ( 0-23)
* @ param minute The minutes ( 0-59)
* @ param... | boolean valid = true ; if ( month < 1 || month > 12 ) { valid = false ; } else if ( validDay ( month , day , year ) == false ) { valid = false ; } else if ( hour < 0 || hour > 23 ) { valid = false ; } else if ( minute < 0 || minute > 59 ) { valid = false ; } else if ( second < 0 || second > 59 ) { valid = false ; } els... |
public class FastSet { /** * { @ inheritDoc } */
@ Override public boolean removeAll ( IntSet c ) { } } | if ( c == null || c . isEmpty ( ) || isEmpty ( ) ) { return false ; } if ( c == this ) { clear ( ) ; return true ; } final FastSet other = convert ( c ) ; final int [ ] localWords = words ; // faster
final int [ ] localOtherWords = other . words ; // faster
// Perform logical ( a & ! b ) on words in common
boolean modi... |
public class EscapeDirective { /** * TODO 挪到 StrKit 中 */
private String escape ( String str ) { } } | if ( str == null || str . length ( ) == 0 ) { return str ; } int len = str . length ( ) ; StringBuilder ret = new StringBuilder ( len * 2 ) ; for ( int i = 0 ; i < len ; i ++ ) { char cur = str . charAt ( i ) ; switch ( cur ) { case '<' : ret . append ( "<" ) ; break ; case '>' : ret . append ( ">" ) ; break ; ca... |
public class CombinationManagementPermission { /** * Adds a permission .
* This method should not be called after the instance has been made visible to another thread
* than the one that constructed it .
* @ param permissionName name of the permission to add . Cannot be { @ code null }
* @ param underlyingPermi... | assert underlyingPermission . getActionEffect ( ) == getActionEffect ( ) : "incompatible ActionEffect" ; if ( combinationPolicy == CombinationPolicy . REJECTING && underlyingPermissions . size ( ) > 0 ) { throw ControllerLogger . ROOT_LOGGER . illegalMultipleRoles ( ) ; } underlyingPermissions . put ( permissionName , ... |
public class AsynchronousRequest { /** * For more info on achievements categories API go < a href = " https : / / wiki . guildwars2 . com / wiki / API : 2 / achievements / categories " > here < / a > < br / >
* Give user the access to { @ link Callback # onResponse ( Call , Response ) } and { @ link Callback # onFail... | isParamValid ( new ParamChecker ( ids ) ) ; gw2API . getAchievementCategoryInfo ( processIds ( ids ) , GuildWars2 . lang . getValue ( ) ) . enqueue ( callback ) ; |
public class MemoryFileManager { /** * Returns a { @ linkplain JavaFileObject file object } for input
* representing the specified class of the specified kind in the
* given location .
* @ param location a location
* @ param className the name of a class
* @ param kind the kind of file , must be one of { @ li... | return stdFileManager . getJavaFileForInput ( location , className , kind ) ; |
public class Predicates { /** * Returns a predicate that evaluates to { @ code true } if each of its
* components evaluates to { @ code true } . The components are evaluated in
* order , and evaluation will be " short - circuited " as soon as a false
* predicate is found . It defensively copies the array passed i... | return new AndPredicate < T > ( ImmutableList . of ( components ) ) ; |
public class GenderRatioProcessor { /** * Helper method that extracts the list of all { @ link ItemIdValue } objects
* that are used as values in the given statement group .
* @ param statementGroup
* the { @ link StatementGroup } to extract the data from
* @ return the list of values */
private List < EntityId... | List < EntityIdValue > result = new ArrayList < > ( statementGroup . size ( ) ) ; for ( Statement s : statementGroup ) { Value v = s . getValue ( ) ; if ( v instanceof EntityIdValue ) { result . add ( ( EntityIdValue ) v ) ; } } return result ; |
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link TextType }
* { @ code > } */
@ XmlElementDecl ( namespace = "http://www.w3.org/2005/Atom" , name = "subtitle" , scope = SourceType . class ) public JAXBElement < TextType > createSourceTypeSubtitle ( TextType value )... | return new JAXBElement < TextType > ( FEED_TYPE_SUBTITLE_QNAME , TextType . class , SourceType . class , value ) ; |
public class AbstractSupervisedProjectionVectorFilter { /** * Get the output type from the input type after conversion .
* @ param in input type restriction
* @ param factory Vector factory
* @ return output type restriction */
protected SimpleTypeInformation < ? > convertedType ( SimpleTypeInformation < ? > in ,... | return new VectorFieldTypeInformation < > ( factory , tdim ) ; |
public class DialogPreference { /** * Obtains the left and right margin of the divider , which is located above the buttons of the
* dialog , which shown by the preference , from a specific typed array .
* @ param typedArray
* The typed array , the margin should be obtained from , as an instance of the class
* ... | setDialogDividerMargin ( typedArray . getDimensionPixelSize ( R . styleable . DialogPreference_dialogDividerMargin , 0 ) ) ; |
public class AbstractAmazonRDSAsync { /** * Simplified method form for invoking the DescribeDBSnapshots operation with an AsyncHandler .
* @ see # describeDBSnapshotsAsync ( DescribeDBSnapshotsRequest , com . amazonaws . handlers . AsyncHandler ) */
@ Override public java . util . concurrent . Future < DescribeDBSnap... | return describeDBSnapshotsAsync ( new DescribeDBSnapshotsRequest ( ) , asyncHandler ) ; |
public class ForkJoinTask { /** * Blocks a non - worker - thread until completion .
* @ return status upon completion */
private int externalAwaitDone ( ) { } } | boolean interrupted = false ; int s ; while ( ( s = status ) >= 0 ) { if ( U . compareAndSwapInt ( this , STATUS , s , s | SIGNAL ) ) { synchronized ( this ) { if ( status >= 0 ) { try { wait ( ) ; } catch ( InterruptedException ie ) { interrupted = true ; } } else notifyAll ( ) ; } } } if ( interrupted ) Thread . curr... |
public class StmtUtil { /** * Issue get - result call to get query result given an in progress response .
* @ param queryId id of query to get results for
* @ param session the current session
* @ return results in JSON
* @ throws SFException exception raised from Snowflake components
* @ throws SnowflakeSQLE... | String getResultPath = String . format ( SF_PATH_QUERY_RESULT , queryId ) ; StmtInput stmtInput = new StmtInput ( ) . setServerUrl ( session . getServerUrl ( ) ) . setSessionToken ( session . getSessionToken ( ) ) . setNetworkTimeoutInMillis ( session . getNetworkTimeoutInMilli ( ) ) . setMediaType ( SF_MEDIA_TYPE ) . ... |
public class InMemoryCacheEntry { /** * / * ( non - Javadoc )
* @ see com . gistlabs . mechanize . cache . InMemoryCacheEntry # head ( ) */
@ Override public HttpResponse head ( ) { } } | BasicHttpResponse response = new BasicHttpResponse ( this . response . getStatusLine ( ) ) ; Header [ ] allHeaders = this . response . getAllHeaders ( ) ; for ( Header allHeader : allHeaders ) response . addHeader ( allHeader ) ; response . setEntity ( new ByteArrayEntity ( new byte [ ] { } ) ) ; return response ; |
public class RuleWrapper { /** * Getter for the used { @ link TextSymbolizerWrapper } .
* < p > Currently only one { @ link TextSymbolizer } is supported in editing , so just the first is used . < / p >
* @ return the used { @ link TextSymbolizer } . */
public TextSymbolizerWrapper getTextSymbolizersWrapper ( ) { }... | for ( SymbolizerWrapper symbolizerWrapper : symbolizersWrapperList ) { if ( symbolizerWrapper . isTextSymbolizer ( ) ) { return ( TextSymbolizerWrapper ) symbolizerWrapper ; } } return null ; |
public class AWSDynamoUtils { /** * Converts a { @ link ParaObject } to DynamoDB row .
* @ param < P > type of object
* @ param so an object
* @ param filter used to filter out fields on update .
* @ return a row representation of the given object . */
protected static < P extends ParaObject > Map < String , At... | HashMap < String , AttributeValue > row = new HashMap < > ( ) ; if ( so == null ) { return row ; } for ( Map . Entry < String , Object > entry : ParaObjectUtils . getAnnotatedFields ( so , filter ) . entrySet ( ) ) { Object value = entry . getValue ( ) ; if ( value != null && ! StringUtils . isBlank ( value . toString ... |
public class CreateMLModelRequest { /** * A list of the training parameters in the < code > MLModel < / code > . The list is implemented as a map of key - value
* pairs .
* The following is the current set of training parameters :
* < ul >
* < li >
* < code > sgd . maxMLModelSizeInBytes < / code > - The maxim... | setParameters ( parameters ) ; return this ; |
public class SymbolTable { /** * This function uses = = to compare types to be exact same instances . */
@ SuppressWarnings ( "ReferenceEquality" ) private void createPropertyScopeFor ( Symbol s ) { } } | // In order to build a property scope for s , we will need to build
// a property scope for all its implicit prototypes first . This means
// that sometimes we will already have built its property scope
// for a previous symbol .
if ( s . propertyScope != null ) { return ; } ObjectType type = getType ( s ) == null ? nu... |
public class MetaGraphDef { /** * < pre >
* SaverDef .
* < / pre >
* < code > optional . tensorflow . SaverDef saver _ def = 3 ; < / code > */
public org . tensorflow . util . SaverDef getSaverDef ( ) { } } | return saverDef_ == null ? org . tensorflow . util . SaverDef . getDefaultInstance ( ) : saverDef_ ; |
public class CmsContainerpageService { /** * Returns the no - edit reason for the given resource . < p >
* @ param cms the current cms object
* @ param containerPage the resource
* @ return the no - edit reason , empty if editing is allowed
* @ throws CmsException is something goes wrong */
private String getNo... | return new CmsResourceUtil ( cms , containerPage ) . getNoEditReason ( OpenCms . getWorkplaceManager ( ) . getWorkplaceLocale ( cms ) ) ; |
public class CSVFile { /** * Extracts the language of the " master language value " and " value "
* column heading in the first line of the trema CSV file .
* @ param columnHeading the column heading . The expected format is :
* < code > master ( & lt ; lang & gt ; ) < / code > or < code > value ( & lt ; lang & g... | int start = columnHeading . indexOf ( '(' ) ; int end = columnHeading . indexOf ( ')' ) ; if ( start == - 1 || end == - 1 || start >= end ) { throwWrongHeaderException ( ) ; } return columnHeading . substring ( start + 1 , end ) ; |
public class TableBuilder { /** * Set a border on the outline of the whole table , around the first row and draw vertical lines
* around each column .
* @ param style the style to apply
* @ return this , for method chaining */
public TableBuilder addHeaderAndVerticalsBorders ( BorderStyle style ) { } } | this . addBorder ( 0 , 0 , 1 , model . getColumnCount ( ) , OUTLINE , style ) ; this . addBorder ( 0 , 0 , model . getRowCount ( ) , model . getColumnCount ( ) , OUTLINE | INNER_VERTICAL , style ) ; return this ; |
public class BMStatefulBeanO { /** * d671368 */
@ Override boolean eligibleForLock ( EJSDeployedSupport methodContext , ContainerTx tx ) // d671368
{ } } | // If the bean is enlisted in a global transaction , and was in a
// method on a concurrent thread at the time this thread attempted
// to call a method . . . then the current thread was unaware of the
// global transaction and started a local transaction . For this
// scenario , the local tran should be ignored when d... |
public class LongToDoubleFunctionBuilder { /** * One of ways of creating builder . This is possibly the least verbose way where compiler should be able to guess the generic parameters . */
@ Nonnull public static LongToDoubleFunction longToDblFunctionFrom ( Consumer < LongToDoubleFunctionBuilder > buildingFunction ) { ... | LongToDoubleFunctionBuilder builder = new LongToDoubleFunctionBuilder ( ) ; buildingFunction . accept ( builder ) ; return builder . build ( ) ; |
public class vpnvserver_vpnsessionpolicy_binding { /** * Use this API to fetch vpnvserver _ vpnsessionpolicy _ binding resources of given name . */
public static vpnvserver_vpnsessionpolicy_binding [ ] get ( nitro_service service , String name ) throws Exception { } } | vpnvserver_vpnsessionpolicy_binding obj = new vpnvserver_vpnsessionpolicy_binding ( ) ; obj . set_name ( name ) ; vpnvserver_vpnsessionpolicy_binding response [ ] = ( vpnvserver_vpnsessionpolicy_binding [ ] ) obj . get_resources ( service ) ; return response ; |
public class Mappings { /** * Returns a mapping that maps objects to a supertype representation .
* @ return the " upcast " mapping */
@ SuppressWarnings ( "unchecked" ) public static < S , T extends S > Mapping < T , S > upcast ( ) { } } | return ( Mapping < T , S > ) IDENTITY_MAPPING ; |
public class OAuthUtils { /** * Generate a Principal from a webid claim .
* @ param claims the JWT claims
* @ return a Principal , if one can be generated from a webid claim */
public static Optional < Principal > withWebIdClaim ( final Claims claims ) { } } | final String webid = claims . get ( WEBID , String . class ) ; if ( webid == null ) return empty ( ) ; LOGGER . debug ( "Using JWT claim with webid: {}" , webid ) ; return of ( new OAuthPrincipal ( webid ) ) ; |
public class Axis { /** * Remove a label from the axis . */
public Axis removeLabel ( String label ) { } } | if ( labels == null ) { throw new IllegalStateException ( ) ; } labels . remove ( label ) ; setSlice ( ) ; initGridLabels ( ) ; return this ; |
public class LogRef { /** * * Log an info level message . * *
* @ param msg
* Log message *
* @ param sr
* The < code > ServiceReference < / code > of the service * that this
* message is associated with . *
* @ param e
* The exception that reflects the condition . */
public void info ( String msg , Servi... | doLog ( msg , LOG_INFO , sr , e ) ; |
public class TTTLearnerVPDA { /** * Finalize a discriminator . Given a block root and a { @ link Splitter } , replace the discriminator at the block root
* by the one derived from the splitter , and update the discrimination tree accordingly .
* @ param blockRoot
* the block root whose discriminator to finalize
... | assert blockRoot . isBlockRoot ( ) ; ContextPair < I > newDiscr = splitter . getNewDiscriminator ( ) ; if ( ! blockRoot . getDiscriminator ( ) . equals ( newDiscr ) ) { ContextPair < I > finalDiscriminator = prepareSplit ( blockRoot , splitter ) ; Map < Boolean , DTNode < I > > repChildren = new HashMap < > ( ) ; for (... |
public class HadoopConfigurationInjector { /** * Loads an Azkaban property into the Hadoop configuration .
* @ param props The Azkaban properties
* @ param conf The Hadoop configuration
* @ param name The property name to load from the Azkaban properties into the Hadoop configuration */
public static void loadPro... | String prop = props . get ( name ) ; if ( prop != null ) { conf . set ( name , prop ) ; } |
public class ParameterBuilder { /** * Adds all parameter from a map
* @ param parameters map with parameters to add . Null values will be skipped .
* @ return itself */
public ParameterBuilder addAll ( Map < String , Object > parameters ) { } } | if ( parameters != null ) { for ( String k : parameters . keySet ( ) ) { if ( parameters . get ( k ) != null ) { this . parameters . put ( k , parameters . get ( k ) ) ; } } } return this ; |
public class ExecuteMojo { /** * Allow the script to work with every JAR dependency of both the project and plugin , including
* optional and provided dependencies . Runtime classpath elements are loaded first , so that
* legacy behavior is not modified . Additional elements are added first in the order of
* proj... | Set results = new LinkedHashSet ( ) ; Set includes = getClasspathIncludes ( ) ; if ( includes . contains ( CLASSPATH_INCLUDE_ALL ) || includes . contains ( CLASSPATH_INCLUDE_RUNTIME ) ) { for ( Iterator i = project . getRuntimeClasspathElements ( ) . iterator ( ) ; i . hasNext ( ) ; ) { String fileName = ( String ) i .... |
public class CommandParser { /** * Reads an argument of type " astring " from the request . */
public String astring ( ImapRequestLineReader request ) throws ProtocolException { } } | char next = request . nextWordChar ( ) ; switch ( next ) { case '"' : return consumeQuoted ( request ) ; case '{' : return consumeLiteral ( request ) ; default : return atom ( request ) ; } |
public class DeployService2Impl { /** * Returns true if the entry is modified . */
public boolean isModified ( ) { } } | I instance = _instance ; if ( instance == null ) { return true ; } if ( DeployMode . MANUAL . equals ( _strategy . redeployMode ( ) ) ) { return false ; } return instance . isModified ( ) ; |
public class QuickSortAlgorithm { /** * Sorts an array of float values and moves with the sort a second array .
* @ param values the array to sort .
* @ param valuesToFollow the array that should be sorted following the
* indexes of the first array . Can be null . */
public void sort ( float [ ] values , float [ ... | this . valuesToSortFloat = values ; this . valuesToFollowFloat = valuesToFollow ; number = values . length ; monitor . beginTask ( "Sorting..." , - 1 ) ; monitor . worked ( 1 ) ; quicksortFloat ( 0 , number - 1 ) ; monitor . done ( ) ; |
public class MOEADD { /** * find the subregion of the ' idx ' th solution in the population */
public int findRegion ( int idx ) { } } | for ( int i = 0 ; i < populationSize ; i ++ ) { if ( subregionIdx [ i ] [ idx ] == 1 ) { return i ; } } return - 1 ; |
public class CmsListOpenResourceAction { /** * Returns the most possible right resource name . < p >
* @ return the most possible right resource name */
protected String getResourceName ( ) { } } | String resource = getItem ( ) . get ( m_resColumnPathId ) . toString ( ) ; if ( ! getWp ( ) . getCms ( ) . existsResource ( resource , CmsResourceFilter . DEFAULT ) ) { String siteRoot = OpenCms . getSiteManager ( ) . getSiteRoot ( resource ) ; if ( CmsStringUtil . isNotEmptyOrWhitespaceOnly ( siteRoot ) ) { resource =... |
public class HldSeSelEntityProcNms { /** * < p > Get processor name for Entity with file save . < / p >
* @ param pClass a Class
* @ return a thing */
protected final String getForFSave ( final Class < ? > pClass ) { } } | if ( SeGoodsSpecifics . class == pClass || SeServiceSpecifics . class == pClass ) { return PrcEntityFSave . class . getSimpleName ( ) ; } return null ; |
public class SwapLeg { /** * Returns the constant spread , , if the spread of this leg is constant . Otherwise an < code > UnsupportedOperationException < / code > is thrown .
* @ return The constant spread . */
public double getSpread ( ) { } } | // Checking spread array for constant spreads
double spread = spreads [ 0 ] ; for ( int i = 1 ; i < spreads . length ; i ++ ) { if ( spreads [ i ] != spread ) { throw new UnsupportedOperationException ( "The method getSpread() is only supported for swap legs with constant spreads." ) ; } } return spread ; |
public class ServerManager { /** * Idem as start but throw exceptions . @ see ServerManager # start ( String [ ] ,
* String )
* @ param args
* @ param execName
* @ throws DevFailed */
public synchronized void startError ( final String [ ] args , final String execName ) throws DevFailed { } } | if ( isStarted . get ( ) ) { throw DevFailedUtils . newDevFailed ( "this server is already started" ) ; } init ( args , execName ) ; |
public class QRDecomposition { /** * Least squares solution of A * X = B
* @ param B A Matrix with as many rows as A and any number of columns .
* @ return X that minimizes the two norm of Q * R * X - B .
* @ throws IllegalArgumentException Matrix row dimensions must agree .
* @ throws RuntimeException Matrix i... | if ( B . length != m ) { throw new IllegalArgumentException ( "Matrix row dimensions must agree." ) ; } if ( ! this . isFullRank ( ) ) { throw new RuntimeException ( "Matrix is rank deficient." ) ; } // Copy right hand side
int nx = B [ 0 ] . length ; double [ ] [ ] X = B . clone ( ) ; // compute Y = transpose ( Q ) * ... |
public class CmsContentCheckDialog { /** * Initializes the content check object or takes an exiting one which is stored in the sesstion . < p > */
protected void initContentCheck ( ) { } } | Object o ; if ( CmsStringUtil . isEmpty ( getParamAction ( ) ) || CmsDialog . DIALOG_INITIAL . equals ( getParamAction ( ) ) ) { // this is the initial dialog call
o = null ; } else { // this is not the initial call , get module from session
o = getDialogObject ( ) ; } if ( ! ( o instanceof CmsContentCheck ) ) { // cre... |
public class StringBuilderFutureAppendable { /** * ( non - Javadoc )
* @ see java . util . concurrent . Future # get ( long , java . util . concurrent . TimeUnit ) */
@ Override public CharSequence get ( long timeout , TimeUnit unit ) throws ExecutionException { } } | try { this . futureBuilder . performAppends ( ) ; } catch ( IOException | HttpErrorPage e ) { throw new ExecutionException ( e ) ; } return this . builder . toString ( ) ; |
public class EulerSchemeFromProcessModel { /** * This method returns the realization of the process at a certain time index .
* @ param timeIndex Time index at which the process should be observed
* @ return A vector of process realizations ( on path ) */
@ Override public RandomVariable getProcessValue ( int timeI... | // Thread safe lazy initialization
synchronized ( this ) { if ( discreteProcess == null || discreteProcess . length == 0 ) { doPrecalculateProcess ( ) ; } } if ( discreteProcess [ timeIndex ] [ componentIndex ] == null ) { throw new NullPointerException ( "Generation of process component " + componentIndex + " at time ... |
public class CmsDriverManager { /** * Returns all direct users of the given organizational unit . < p >
* @ param dbc the current db context
* @ param orgUnit the organizational unit to get all users for
* @ param recursive if all groups of sub - organizational units should be retrieved too
* @ return all < cod... | return getUserDriver ( dbc ) . getUsers ( dbc , orgUnit , recursive ) ; |
public class DefaultFunctionMapper { /** * ( non - Javadoc )
* @ see java . io . Externalizable # readExternal ( java . io . ObjectInput ) */
@ SuppressWarnings ( "unchecked" ) public void readExternal ( ObjectInput in ) throws IOException , ClassNotFoundException { } } | _functions = ( Map < String , Function > ) in . readObject ( ) ; |
public class JaegerTracerFactory { /** * The Jaeger Tracer builder bean .
* @ param configuration The configuration
* @ return The builder */
@ Singleton @ Primary @ Requires ( classes = JaegerTracer . Builder . class ) JaegerTracer . Builder jaegerTracerBuilder ( Configuration configuration ) { } } | JaegerTracer . Builder tracerBuilder = resolveBuilder ( configuration ) ; if ( this . configuration . isExpandExceptionLogs ( ) ) { tracerBuilder . withExpandExceptionLogs ( ) ; } if ( this . configuration . isZipkinSharedRpcSpan ( ) ) { tracerBuilder . withZipkinSharedRpcSpan ( ) ; } if ( reporter != null ) { tracerBu... |
public class PartTreeConverter { /** * Convert a { @ link PartTree } into a where query alike to the one present in the
* { @ link Query } ' s where property . */
public static String toIndexedQuery ( final PartTree tree ) { } } | final StringBuilder result = new StringBuilder ( ) ; final Iterator < OrPart > orIt = tree . iterator ( ) ; while ( orIt . hasNext ( ) ) { final OrPart orPart = orIt . next ( ) ; final Iterator < Part > partIt = orPart . iterator ( ) ; while ( partIt . hasNext ( ) ) { final Part part = partIt . next ( ) ; result . appe... |
public class SingleThreadRadixOrder { /** * Hot loop , pulled out from the main run code */
private static void runCopy ( final long start , final long len , final int keySize , final int batchSize , final long otmp [ ] [ ] , final byte xtmp [ ] [ ] , final long o [ ] [ ] , final byte x [ ] [ ] ) { } } | // now copy _ otmp and _ xtmp back over _ o and _ x from the start position , allowing for boundaries
// _ o , _ x , _ otmp and _ xtmp all have the same _ batchsize
// Would be really nice if Java had 64bit indexing to save programmer time .
long numRowsToCopy = len ; int sourceBatch = 0 , sourceOffset = 0 ; int target... |
public class VersionListener { /** * ( non - Javadoc )
* @ see net . ossindex . version . parser . VersionBaseListener # exitUnion _ range ( net . ossindex . version . parser . VersionParser . Union _ rangeContext ) */
@ Override public void exitUnion_range ( VersionParser . Union_rangeContext ctx ) { } } | Object o1 = stack . pop ( ) ; Object o2 = stack . pop ( ) ; IVersionRange r1 = null ; IVersionRange r2 = null ; if ( o1 instanceof IVersion ) { r1 = new VersionSet ( ( IVersion ) o1 ) ; } else { r1 = ( IVersionRange ) o1 ; } if ( o2 instanceof IVersion ) { r2 = new VersionSet ( ( IVersion ) o2 ) ; } else { r2 = ( IVers... |
public class EditText { /** * Returns the start padding of the view , plus space for the start
* Drawable if any . */
@ TargetApi ( Build . VERSION_CODES . JELLY_BEAN_MR1 ) public int getCompoundPaddingStart ( ) { } } | if ( Build . VERSION . SDK_INT >= Build . VERSION_CODES . JELLY_BEAN_MR1 ) return mInputView . getCompoundPaddingStart ( ) ; return mInputView . getCompoundPaddingLeft ( ) ; |
public class Expressions { /** * Create a new Path expression
* @ param arrayType array type
* @ param variable variable name
* @ param < A > array type
* @ param < E > element type
* @ return path expression */
public static < A , E > ArrayPath < A , E > arrayPath ( Class < A > arrayType , String variable ) ... | return new ArrayPath < A , E > ( arrayType , variable ) ; |
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public EClass getIfcValue ( ) { } } | if ( ifcValueEClass == null ) { ifcValueEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 980 ) ; } return ifcValueEClass ; |
public class CloudTasksClient { /** * Acknowledges a pull task .
* < p > The worker , that is , the entity that
* [ leased ] [ google . cloud . tasks . v2beta2 . CloudTasks . LeaseTasks ] this task must call this method to
* indicate that the work associated with the task has finished .
* < p > The worker must ... | AcknowledgeTaskRequest request = AcknowledgeTaskRequest . newBuilder ( ) . setName ( name == null ? null : name . toString ( ) ) . setScheduleTime ( scheduleTime ) . build ( ) ; acknowledgeTask ( request ) ; |
public class SSTableIndexIndex { /** * Create and write an index index based on the input Cassandra Index . db file . Read the Index . db and generate chunks
* ( splits ) based on the configured chunk size .
* @ param fileSystem Hadoop file system .
* @ param sstablePath SSTable Index . db .
* @ throws IOExcept... | final Configuration configuration = fileSystem . getConf ( ) ; final long splitSize = configuration . getLong ( HadoopSSTableConstants . HADOOP_SSTABLE_SPLIT_MB , HadoopSSTableConstants . DEFAULT_SPLIT_MB ) * 1024 * 1024 ; final Closer closer = Closer . create ( ) ; final Path outputPath = sstablePath . suffix ( SSTABL... |
public class XPathHelper { /** * Returns the XPaths of all nodes retrieved by xpathExpression . Example : / / DIV [ @ id = ' foo ' ]
* returns / HTM [ 1 ] / BODY [ 1 ] / DIV [ 2]
* @ param dom The dom .
* @ param xpathExpression The expression to find the element .
* @ return list of XPaths retrieved by xpathEx... | NodeList nodeList = XPathHelper . evaluateXpathExpression ( dom , xpathExpression ) ; Builder < String > result = ImmutableList . builder ( ) ; if ( nodeList . getLength ( ) > 0 ) { for ( int i = 0 ; i < nodeList . getLength ( ) ; i ++ ) { Node n = nodeList . item ( i ) ; result . add ( getXPathExpression ( n ) ) ; } }... |
public class LdaptiveAuthenticatorBuilder { /** * From the LdapAuthenticationConfiguration class : */
public static Authenticator getAuthenticator ( final LdapAuthenticationProperties l ) { } } | if ( l . getType ( ) == LdapAuthenticationProperties . AuthenticationTypes . AD ) { LOGGER . debug ( "Creating active directory authenticator for {}" , l . getLdapUrl ( ) ) ; return getActiveDirectoryAuthenticator ( l ) ; } if ( l . getType ( ) == LdapAuthenticationProperties . AuthenticationTypes . DIRECT ) { LOGGER .... |
public class MP3Header { /** * Calculate the size of a MP3 frame for this header .
* @ return size of the frame including the header */
public int frameSize ( ) { } } | switch ( layerDescription ) { case 3 : // Layer 1
return ( 12 * getBitRate ( ) / getSampleRate ( ) + ( paddingBit ? 1 : 0 ) ) * 4 ; case 2 : case 1 : // Layer 2 and 3
if ( audioVersionId == 3 ) { // MPEG 1
return 144 * getBitRate ( ) / getSampleRate ( ) + ( paddingBit ? 1 : 0 ) ; } else { // MPEG 2 or 2.5
return 72 * g... |
public class GreenPepperXmlRpcClient { /** * { @ inheritDoc } */
@ SuppressWarnings ( "unchecked" ) public Set < Project > getAllProjects ( String identifier ) throws GreenPepperServerException { } } | log . debug ( "Retrieving All Projects" ) ; Vector < Object > projectsParams = ( Vector < Object > ) execute ( XmlRpcMethodName . getAllProjects , identifier ) ; return XmlRpcDataMarshaller . toProjectList ( projectsParams ) ; |
public class ExpressionUtils { /** * Create a distinct list of the given args
* @ param args elements
* @ return list with distinct elements */
public static ImmutableList < Expression < ? > > distinctList ( Expression < ? > ... args ) { } } | final ImmutableList . Builder < Expression < ? > > builder = ImmutableList . builder ( ) ; final Set < Expression < ? > > set = new HashSet < Expression < ? > > ( args . length ) ; for ( Expression < ? > arg : args ) { if ( set . add ( arg ) ) { builder . add ( arg ) ; } } return builder . build ( ) ; |
public class NetworkClient { /** * Deletes the specified network .
* < p > Sample code :
* < pre > < code >
* try ( NetworkClient networkClient = NetworkClient . create ( ) ) {
* ProjectGlobalNetworkName network = ProjectGlobalNetworkName . of ( " [ PROJECT ] " , " [ NETWORK ] " ) ;
* Operation response = net... | DeleteNetworkHttpRequest request = DeleteNetworkHttpRequest . newBuilder ( ) . setNetwork ( network ) . build ( ) ; return deleteNetwork ( request ) ; |
public class ALPNHackClientHelloExplorer { /** * struct {
* uint8 major ;
* uint8 minor ;
* } ProtocolVersion ;
* enum {
* change _ cipher _ spec ( 20 ) , alert ( 21 ) , handshake ( 22 ) ,
* application _ data ( 23 ) , ( 255)
* } ContentType ;
* struct {
* ContentType type ;
* ProtocolVersion versio... | // Is it a handshake message ?
if ( firstByte != 22 ) { // 22 : handshake record
throw UndertowMessages . MESSAGES . notHandshakeRecord ( ) ; } // Is there enough data for a full record ?
int recordLength = getInt16 ( input ) ; if ( recordLength > input . remaining ( ) ) { throw new BufferUnderflowException ( ) ; } if ... |
public class Cache { /** * Tells the cache to store under the given resource name the contents
* that will be written to the output stream ; the method creates a new
* resource entry and opens an output stream to it , then returns the
* stream to the caller so this can copy its data into it . It is up to
* the ... | if ( Strings . isValid ( resource ) ) { return storage . store ( resource ) ; } return null ; |
public class StringFixture { /** * Determines integer value of String ( so relative checks can be done ) .
* @ param value string to convert to integer .
* @ return integer value . */
public Integer convertToInt ( String value ) { } } | Integer result = null ; if ( value != null ) { result = Integer . valueOf ( value ) ; } return result ; |
public class LocalTaskQueue { /** * / * ( non - Javadoc )
* @ see org . duracloud . queue . TaskQueue # take ( ) */
@ Override public synchronized Task take ( ) throws TimeoutException { } } | try { Task task = queue . remove ( ) ; inprocess . add ( task ) ; return task ; } catch ( NoSuchElementException ex ) { throw new TimeoutException ( ex ) ; } |
public class EnumParameterTypeImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public boolean eIsSet ( int featureID ) { } } | switch ( featureID ) { case BpsimPackage . ENUM_PARAMETER_TYPE__GROUP : return group != null && ! group . isEmpty ( ) ; case BpsimPackage . ENUM_PARAMETER_TYPE__PARAMETER_VALUE_GROUP : return ! getParameterValueGroup ( ) . isEmpty ( ) ; case BpsimPackage . ENUM_PARAMETER_TYPE__PARAMETER_VALUE : return ! getParameterVal... |
public class ChronoFormatter { /** * / * [ deutsch ]
* < p > Konstruiert einen Formatierer f & uuml ; r Uhrzeitobjekte . < / p >
* @ param pattern format pattern
* @ param type the type of the pattern to be used
* @ param locale format locale
* @ return new { @ code ChronoFormatter } - instance
* @ throws I... | Builder < PlainTime > builder = new Builder < > ( PlainTime . axis ( ) , locale ) ; addPattern ( builder , pattern , type ) ; try { return builder . build ( ) ; } catch ( IllegalStateException ise ) { throw new IllegalArgumentException ( ise ) ; } |
public class SqlEntityQueryImpl { /** * { @ inheritDoc }
* @ see jp . co . future . uroborosql . fluent . SqlEntityQuery # exists ( java . lang . Runnable ) */
@ Override public void exists ( final Runnable runnable ) { } } | StringBuilder sql = new StringBuilder ( "select 1 from (" ) . append ( System . lineSeparator ( ) ) . append ( aggregationSourceSql ( ) ) . append ( System . lineSeparator ( ) ) . append ( ") t_" ) ; context ( ) . setSql ( sql . toString ( ) ) ; try ( ResultSet rs = agent ( ) . query ( context ( ) ) ) { if ( rs . next ... |
public class PtoPOutputHandler { /** * Reallocates messages from the sourcestream to alternative localisations
* Called when TRM informs us that this localistaion has become unreachable .
* Called when TRM informs us that this localisation has become reachable .
* Called when TRM informs us that another localisat... | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "reallocateMsgs" , new Object [ ] { this . toString ( ) , destination , new Boolean ( allMsgs ) , new Boolean ( forceRemove ) } ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.