signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class TelURLImpl { /** * ( non - Javadoc ) * @ see javax . servlet . sip . TelURL # setPhoneNumber ( java . lang . String ) */ public void setPhoneNumber ( String number ) { } }
String phoneNumber = number ; if ( number . startsWith ( "+" ) ) { phoneNumber = phoneNumber . substring ( 1 ) ; } try { basePhoneNumber ( phoneNumber ) ; telUrl . setPhoneNumber ( phoneNumber ) ; } catch ( ParseException ex ) { logger . error ( "Error setting phone number " + number ) ; throw new java . lang . Illegal...
public class JDBC4PreparedStatement { /** * Sets the designated parameter to the given input stream . */ @ Override public void setAsciiStream ( int parameterIndex , InputStream x ) throws SQLException { } }
checkParameterBounds ( parameterIndex ) ; throw SQLError . noSupport ( ) ;
public class XMLDocumentCache { /** * Cache a parse failure for this document . */ public static void cacheParseFailure ( XmlFileModel key ) { } }
map . put ( getKey ( key ) , new CacheDocument ( true , null ) ) ;
public class AWSMigrationHubClient { /** * Lists progress update streams associated with the user account making this call . * @ param listProgressUpdateStreamsRequest * @ return Result of the ListProgressUpdateStreams operation returned by the service . * @ throws AccessDeniedException * You do not have suffic...
request = beforeClientExecution ( request ) ; return executeListProgressUpdateStreams ( request ) ;
public class AlluxioRemoteLogFilter { /** * @ deprecated Sets option value use key = value format . The log4j . properties file uses this * to set options . See the log4j . properties for more details . * @ param key key ( name ) of the option * @ param value value of the option */ @ Deprecated public void setOpt...
if ( key . equalsIgnoreCase ( PROCESS_TYPE_OPTION ) ) { mProcessType = value ; }
public class InternalXbaseWithAnnotationsParser { /** * $ ANTLR start synpred41 _ InternalXbaseWithAnnotations */ public final void synpred41_InternalXbaseWithAnnotations_fragment ( ) throws RecognitionException { } }
// InternalXbaseWithAnnotations . g : 5032:6 : ( ( ( ) ( ( ( ruleJvmFormalParameter ) ) ( ' , ' ( ( ruleJvmFormalParameter ) ) ) * ) ? ( ( ' | ' ) ) ) ) // InternalXbaseWithAnnotations . g : 5032:7 : ( ( ) ( ( ( ruleJvmFormalParameter ) ) ( ' , ' ( ( ruleJvmFormalParameter ) ) ) * ) ? ( ( ' | ' ) ) ) { // InternalXbase...
public class LinearClassifierFactory { /** * Train a classifier with a sigma tuned on a validation set . * @ return The constructed classifier */ public LinearClassifier < L , F > trainClassifierV ( GeneralDataset < L , F > train , GeneralDataset < L , F > validation , double min , double max , boolean accuracy ) { }...
labelIndex = train . labelIndex ( ) ; featureIndex = train . featureIndex ( ) ; this . min = min ; this . max = max ; heldOutSetSigma ( train , validation ) ; double [ ] [ ] weights = trainWeights ( train ) ; return new LinearClassifier < L , F > ( weights , train . featureIndex ( ) , train . labelIndex ( ) ) ;
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link Object } { @ code > } * @ param value * Java instance representing xml element ' s value . * @ return * the new instance of { @ link JAXBElement } { @ code < } { @ link Object } { @ code > } */ @ XmlElementDecl...
return new JAXBElement < Object > ( __GenericApplicationPropertyOfAbstractBuilding_QNAME , Object . class , null , value ) ;
public class SubWriterHolderWriter { /** * Add the inherited summary header . * @ param mw the writer for the member being documented * @ param cd the classdoc to be documented * @ param inheritedTree the content tree to which the inherited summary header will be added */ public void addInheritedSummaryHeader ( A...
mw . addInheritedSummaryAnchor ( cd , inheritedTree ) ; mw . addInheritedSummaryLabel ( cd , inheritedTree ) ;
public class BlockHouseHolder_DDRB { /** * Sets W to its initial value using the first column of ' y ' and the value of ' b ' : * < br > * W = - & beta ; v < br > * < br > * where v = Y ( : , 0 ) . * @ param blockLength size of the inner block * @ param W Submatrix being initialized . * @ param Y Contains...
final double dataW [ ] = W . original . data ; final double dataY [ ] = Y . original . data ; for ( int i = W . row0 ; i < W . row1 ; i += blockLength ) { int heightW = Math . min ( blockLength , W . row1 - i ) ; int indexW = i * W . original . numCols + heightW * W . col0 ; int indexY = i * Y . original . numCols + he...
public class DatabaseSpec { /** * Connect to ElasticSearch using custom parameters * @ param host ES host * @ param foo regex needed to match method * @ param nativePort ES port * @ param bar regex needed to match method * @ param clusterName ES clustername * @ throws DBException exception * @ throws Unkn...
LinkedHashMap < String , Object > settings_map = new LinkedHashMap < String , Object > ( ) ; if ( clusterName != null ) { settings_map . put ( "cluster.name" , clusterName ) ; } else { settings_map . put ( "cluster.name" , ES_DEFAULT_CLUSTER_NAME ) ; } commonspec . getElasticSearchClient ( ) . setSettings ( settings_ma...
public class ExtraLanguageTypeConverter { /** * Indicates if the given name has a mapping to the extra language . * @ param type the type to convert . * @ return { @ code true } if the mapping exists . */ public boolean hasConversion ( String type ) { } }
if ( ( isImplicitSarlTypes ( ) && type . startsWith ( IMPLICIT_PACKAGE ) ) || isImplicitJvmTypes ( ) ) { return true ; } if ( this . mapping == null ) { this . mapping = initMapping ( ) ; } return this . mapping . containsKey ( type ) ;
public class TemplateDelegateNode { /** * Calculate a DeltemplateKey for the variant . * < p > This is done lazily so that global references can be resolved . This is not ideal since * nothing guarantees that resolution happens before access . * < p > Note we don ' t do validation of the variant values since that...
if ( delTemplateVariantExpr == null ) { delTemplateKey = DelTemplateKey . create ( delTemplateName , "" ) ; return delTemplateKey ; } ExprNode exprNode = delTemplateVariantExpr . getRoot ( ) ; if ( exprNode instanceof GlobalNode ) { GlobalNode globalNode = ( GlobalNode ) exprNode ; if ( globalNode . isResolved ( ) ) { ...
public class OptionUtil { /** * If split size option is true , returns thread number . If false , returns split size . * @ return If true , local mode . */ public long getSplitSize ( ) { } }
if ( cli . hasOption ( SPLIT_SIZE ) ) { return Long . valueOf ( cli . getOptionValue ( SPLIT_SIZE ) ) ; } return DEFAULT_SPLIT_SIZE ;
public class GitHubCollectorTask { /** * Clean up unused deployment collector items * @ param collector the { @ link Collector } */ @ SuppressWarnings ( "PMD.AvoidDeeplyNestedIfStmts" ) // agreed , fixme private void clean ( Collector collector ) { } }
Set < ObjectId > uniqueIDs = new HashSet < > ( ) ; /* Logic : For each component , retrieve the collector item list of the type SCM . Store their IDs in a unique set ONLY if their collector IDs match with GitHub collectors ID . */ for ( com . capitalone . dashboard . model . Component comp : dbComponentRepository . f...
public class CallbackSerializer { /** * { @ inheritDoc } */ @ Override public void serialize ( Callback value , JsonGenerator jgen , SerializerProvider provider ) throws IOException { } }
if ( StringUtils . isBlank ( value . getRef ( ) ) ) { jgen . writeStartObject ( ) ; for ( Entry < String , PathItem > entry : value . entrySet ( ) ) { jgen . writeObjectField ( entry . getKey ( ) , entry . getValue ( ) ) ; } jgen . writeEndObject ( ) ; } else { jgen . writeStartObject ( ) ; jgen . writeStringField ( "$...
public class OpCompareEqual { /** * { @ inheritDoc } */ @ Override public void resolve ( final ValueStack values ) throws Exception { } }
if ( values . size ( ) < 2 ) throw new Exception ( "missing operands for " + toString ( ) ) ; try { final Object [ ] ops = values . ensureSameTypes ( ) ; values . push ( new Boolean ( ops [ 1 ] . equals ( ops [ 0 ] ) ) ) ; } catch ( final ParseException e ) { e . fillInStackTrace ( ) ; throw new Exception ( toString ( ...
public class DataBindingUtils { /** * Binds the given source object to the given target object performing type conversion if necessary * @ param entity The PersistentEntity instance * @ param object The object to bind to * @ param source The source object * @ param include The list of properties to include * ...
BindingResult bindingResult = null ; GrailsApplication grailsApplication = Holders . findApplication ( ) ; try { final DataBindingSource bindingSource = createDataBindingSource ( grailsApplication , object . getClass ( ) , source ) ; final DataBinder grailsWebDataBinder = getGrailsWebDataBinder ( grailsApplication ) ; ...
public class Models { /** * Summarize fields which are specific to hex . deeplearning . DeepLearningModel . */ private static void summarizeDeepLearningModel ( ModelSummary summary , hex . deeplearning . DeepLearningModel model ) { } }
// add generic fields such as column names summarizeModelCommonFields ( summary , model ) ; summary . model_algorithm = "DeepLearning" ; JsonObject all_params = ( model . get_params ( ) ) . toJSON ( ) ; summary . critical_parameters = whitelistJsonObject ( all_params , DL_critical_params ) ; summary . secondary_paramet...
public class AbstractBridgeService { /** * wtb closures */ protected T newSession ( IoSessionInitializer < ? extends IoFuture > initializer , IoFuture future , Callable < T > sessionCreator ) throws Exception { } }
T session ; IoProcessorEx < T > processor = getProcessor ( ) ; synchronized ( processor ) { session = sessionCreator . call ( ) ; processor . add ( session ) ; } initSession ( session , future , initializer ) ; IoFilterChain filterChain = session . getFilterChain ( ) ; try { this . getFilterChainBuilder ( ) . buildFilt...
public class ResourceProcessor { /** * Creates a Reference for a binding from a registered ObjectFactory . * @ param extensionFactory the object factory info * @ param resourceBinding the resource binding * @ return the reference */ private Reference createExtensionFactoryReference ( ObjectFactoryInfo extensionFa...
String className = extensionFactory . getObjectFactoryClass ( ) . getName ( ) ; Reference ref = new Reference ( resourceBinding . getInjectionClassTypeName ( ) , className , null ) ; if ( extensionFactory . isRefAddrNeeded ( ) ) // F48603 { ref . add ( new ResourceInfoRefAddr ( createResourceInfo ( resourceBinding ) ) ...
public class AbstractNodeMonitorDescriptor { /** * Performs monitoring across the board . * @ return * For all the computers , report the monitored values . */ protected Map < Computer , T > monitor ( ) throws InterruptedException { } }
Map < Computer , T > data = new HashMap < > ( ) ; for ( Computer c : Jenkins . getInstance ( ) . getComputers ( ) ) { try { Thread . currentThread ( ) . setName ( "Monitoring " + c . getDisplayName ( ) + " for " + getDisplayName ( ) ) ; if ( c . getChannel ( ) == null ) data . put ( c , null ) ; else data . put ( c , m...
public class StAXEncoder { /** * Write text to the output * ( non - Javadoc ) * @ see javax . xml . stream . XMLStreamWriter # writeCharacters ( char [ ] , int , int ) */ public void writeCharacters ( char [ ] text , int start , int len ) throws XMLStreamException { } }
this . writeCharacters ( new String ( text , start , len ) ) ;
public class Promises { /** * Gets { @ code Promise } from provided { @ code AsyncSupplier } , * waits until it completes and than returns a { @ code Promise < Void > } */ @ NotNull public static Promise < Void > sequence ( @ NotNull AsyncSupplier < Void > promise ) { } }
return promise . get ( ) . toVoid ( ) ;
public class XMLComparator { /** * Check that all the rows and elements defined in the doc1 are included in doc2 * @ param doc1 The source document * @ param doc2 The checked document * @ param primaryKeyFields A String array containing all the field names composing the primary key * @ return True if all the el...
// Remove errors of previous calls errorsList . clear ( ) ; // Iterator all the Row List < HashMap < String , String > > doc1Hash = createRowsHashMap ( doc1 , tableName ) ; List < HashMap < String , String > > doc2Hash = createRowsHashMap ( doc2 , tableName ) ; for ( HashMap < String , String > hash1 : doc1Hash ) { // ...
public class NumberFormat { /** * Formats a number and appends the resulting text to the given string buffer . * < strong > [ icu ] Note : < / strong > recognizes < code > BigInteger < / code > * and < code > BigDecimal < / code > objects . * @ see java . text . Format # format ( Object , StringBuffer , FieldPosi...
if ( number instanceof Long ) { return format ( ( ( Long ) number ) . longValue ( ) , toAppendTo , pos ) ; } else if ( number instanceof BigInteger ) { return format ( ( BigInteger ) number , toAppendTo , pos ) ; } else if ( number instanceof java . math . BigDecimal ) { return format ( ( java . math . BigDecimal ) num...
public class SimplePathEnumerator { /** * Enumerate the simple paths . * @ return this object */ public SimplePathEnumerator enumerate ( ) { } }
Iterator < Edge > entryOut = cfg . outgoingEdgeIterator ( cfg . getEntry ( ) ) ; if ( ! entryOut . hasNext ( ) ) { throw new IllegalStateException ( ) ; } Edge entryEdge = entryOut . next ( ) ; LinkedList < Edge > init = new LinkedList < > ( ) ; init . add ( entryEdge ) ; work ( init ) ; if ( DEBUG && work == maxWork )...
public class RuleBasedNumberFormat { /** * Reads this object in from a stream . * @ param in The stream to read from . */ private void readObject ( java . io . ObjectInputStream in ) throws java . io . IOException { } }
// read the description in from the stream String description = in . readUTF ( ) ; ULocale loc ; try { loc = ( ULocale ) in . readObject ( ) ; } catch ( Exception e ) { loc = ULocale . getDefault ( Category . FORMAT ) ; } try { roundingMode = in . readInt ( ) ; } catch ( Exception ignored ) { } // build a brand - new R...
public class RestletUtilSesameRealm { /** * Builds a SPARQL query to retrieve details of a RestletUtilUser . This method could be * overridden to search for other information regarding a user . * @ param userIdentifier * The unique identifier of the User to search for . * @ param findAllUsers True to find all u...
if ( ! findAllUsers && userIdentifier == null ) { throw new NullPointerException ( "User identifier was null" ) ; } final StringBuilder query = new StringBuilder ( ) ; query . append ( " SELECT ?userIdentifier ?userUri ?userSecret ?userFirstName ?userLastName ?userEmail " ) ; query . append ( " WHERE " ) ; query . appe...
public class RebalanceUtils { /** * Print log to the following logger ( Info level ) * @ param batchId Task id * @ param logger Logger class * @ param message The message to print */ public static void printBatchLog ( int batchId , Logger logger , String message ) { } }
logger . info ( "[Rebalance batch id " + batchId + "] " + message ) ;
public class EventPublisherApplicationAdapter { /** * { @ inheritDoc } */ @ Override public void fromAdmin ( Message message , SessionID sessionId ) { } }
publishEvent ( FromAdmin . of ( message , sessionId ) ) ;
public class VaultsInner { /** * Update access policies in a key vault in the specified subscription . * @ param resourceGroupName The name of the Resource Group to which the vault belongs . * @ param vaultName Name of the vault * @ param operationKind Name of the operation . Possible values include : ' add ' , '...
return updateAccessPolicyWithServiceResponseAsync ( resourceGroupName , vaultName , operationKind , properties ) . toBlocking ( ) . single ( ) . body ( ) ;
public class CmsCategoryService { /** * Creates a new category . < p > * Will use the same category repository as the parent if specified , * or the closest category repository to the reference path if specified , * or the centralized category repository in all other cases . < p > * @ param cms the current cms ...
List < CmsProperty > properties = new ArrayList < CmsProperty > ( ) ; if ( CmsStringUtil . isNotEmptyOrWhitespaceOnly ( title ) ) { properties . add ( new CmsProperty ( CmsPropertyDefinition . PROPERTY_TITLE , title , null ) ) ; } if ( CmsStringUtil . isNotEmptyOrWhitespaceOnly ( description ) ) { properties . add ( ne...
public class GetAdUnitHierarchy { /** * Runs the example . * @ param adManagerServices 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 s...
// Get the InventoryService . InventoryServiceInterface inventoryService = adManagerServices . get ( session , InventoryServiceInterface . class ) ; // Get the NetworkService . NetworkServiceInterface networkService = adManagerServices . get ( session , NetworkServiceInterface . class ) ; // Get the effective root ad u...
public class BehaviorHistoryInfo { /** * 对应insertCount的数据统计平均值 */ public Long getInsertCountAvg ( ) { } }
Long insertCountAvg = 0L ; if ( items . size ( ) != 0 ) { for ( TableStat item : items ) { if ( item . getEndTime ( ) . equals ( item . getStartTime ( ) ) ) { insertCountAvg += item . getInsertCount ( ) ; } else { insertCountAvg += item . getInsertCount ( ) * 1000 / ( item . getEndTime ( ) . getTime ( ) - item . getSta...
public class ArtifactHelpers { /** * Exclusive can be specified by wildcard : * - - groupId : artifactId : * : * * - - groupId : * : * : * * And in general , to require a strict match up to the version and the classifier is not necessary * TODO : the correct fix would be to rewrite { @ link Exclusion # equals (...
return Optional . ofNullable ( exclusions ) . orElse ( Collections . emptyList ( ) ) . stream ( ) . anyMatch ( selectedExclusion -> null != exclusion && selectedExclusion . getGroupId ( ) . equals ( exclusion . getGroupId ( ) ) && ( selectedExclusion . getArtifactId ( ) . equals ( exclusion . getArtifactId ( ) ) || ( s...
public class CPDefinitionLinkLocalServiceBaseImpl { /** * Returns the cp definition link matching the UUID and group . * @ param uuid the cp definition link ' s UUID * @ param groupId the primary key of the group * @ return the matching cp definition link * @ throws PortalException if a matching cp definition l...
return cpDefinitionLinkPersistence . findByUUID_G ( uuid , groupId ) ;
public class JobReceiver { /** * 添加Repeat 任务 */ private void addRepeatJob ( JobPo jobPo ) throws DupEntryException { } }
if ( appContext . getCronJobQueue ( ) . getJob ( jobPo . getTaskTrackerNodeGroup ( ) , jobPo . getTaskId ( ) ) != null ) { // 这种情况是 由cron 任务变为了 repeat 任务 throw new DupEntryException ( ) ; } // 1 . add to repeat job queue appContext . getRepeatJobQueue ( ) . add ( jobPo ) ; if ( JobUtils . isRelyOnPrevCycle ( jobPo ) ) ...
public class AnalyticsServiceElasticsearch { /** * This method adds node information to the communication summary nodes constructed based on the * communication details . * @ param stats The map of endpoint ( uri [ op ] ) to communication summary stat nodes * @ param index The index * @ param criteria The query...
BoolQueryBuilder query = buildQuery ( criteria , ElasticsearchUtil . TRANSACTION_FIELD , null ) ; // Obtain information about the fragments StatsBuilder durationBuilder = AggregationBuilders . stats ( "elapsed" ) . field ( ElasticsearchUtil . ELAPSED_FIELD ) ; TermsBuilder serviceTerm = AggregationBuilders . terms ( "s...
public class Person { /** * Returns for given parameter < i > _ name < / i > the instance of class * { @ link Person } . * @ param _ name name to search in the cache * @ throws EFapsException on error * @ return instance of class { @ link Person } * @ see # CACHE * @ see # getFromDB */ public static Person ...
final Cache < String , Person > cache = InfinispanCache . get ( ) . < String , Person > getCache ( Person . NAMECACHE ) ; if ( ! cache . containsKey ( _name ) ) { Person . getPersonFromDB ( Person . SQL_NAME , _name ) ; } return cache . get ( _name ) ;
public class RelationalOperations { /** * Returns true if polyline _ a is disjoint from polyline _ b . */ private static boolean polylineDisjointPolyline_ ( Polyline polyline_a , Polyline polyline_b , double tolerance , ProgressTracker progress_tracker ) { } }
// Quick rasterize test to see whether the the geometries are disjoint . if ( tryRasterizedContainsOrDisjoint_ ( polyline_a , polyline_b , tolerance , false ) == Relation . disjoint ) return true ; MultiPathImpl multi_path_impl_a = ( MultiPathImpl ) polyline_a . _getImpl ( ) ; MultiPathImpl multi_path_impl_b = ( MultiP...
public class UpdateClientCertificateRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( UpdateClientCertificateRequest updateClientCertificateRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( updateClientCertificateRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( updateClientCertificateRequest . getClientCertificateId ( ) , CLIENTCERTIFICATEID_BINDING ) ; protocolMarshaller . marshall ( updateClientCertificateReque...
public class AwsSecurityFindingFilters { /** * The text of a note . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setNoteText ( java . util . Collection ) } or { @ link # withNoteText ( java . util . Collection ) } if you want to override * the existing v...
if ( this . noteText == null ) { setNoteText ( new java . util . ArrayList < StringFilter > ( noteText . length ) ) ; } for ( StringFilter ele : noteText ) { this . noteText . add ( ele ) ; } return this ;
public class ST_RemoveRepeatedPoints { /** * Removes duplicated coordinates within a GeometryCollection * @ param geometryCollection * @ param tolerance to delete the coordinates * @ return * @ throws java . sql . SQLException */ public static GeometryCollection removeDuplicateCoordinates ( GeometryCollection g...
ArrayList < Geometry > geoms = new ArrayList < > ( ) ; for ( int i = 0 ; i < geometryCollection . getNumGeometries ( ) ; i ++ ) { Geometry geom = geometryCollection . getGeometryN ( i ) ; geoms . add ( removeDuplicateCoordinates ( geom , tolerance ) ) ; } return FACTORY . createGeometryCollection ( GeometryFactory . to...
public class GitlabAPI { /** * Delete a group . * @ param groupId the group id * @ throws IOException on gitlab api call error */ public void deleteGroup ( Integer groupId ) throws IOException { } }
String tailUrl = GitlabGroup . URL + "/" + groupId ; retrieve ( ) . method ( DELETE ) . to ( tailUrl , Void . class ) ;
public class Session { /** * Run some code in session * @ param id session id * @ return */ public static String start ( String id ) { } }
if ( idLocal . get ( ) != null ) { return null ; } else { MDC . put ( "sessionId" , id ) ; if ( LOG . isDebugEnabled ( ) ) LOG . debug ( "Initialize session id = " + id ) ; idLocal . set ( id ) ; return id ; }
public class CPDAvailabilityEstimatePersistenceImpl { /** * Returns the last cpd availability estimate in the ordered set where uuid = & # 63 ; . * @ param uuid the uuid * @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > ) * @ return the last matching cpd availabi...
CPDAvailabilityEstimate cpdAvailabilityEstimate = fetchByUuid_Last ( uuid , orderByComparator ) ; if ( cpdAvailabilityEstimate != null ) { return cpdAvailabilityEstimate ; } StringBundler msg = new StringBundler ( 4 ) ; msg . append ( _NO_SUCH_ENTITY_WITH_KEY ) ; msg . append ( "uuid=" ) ; msg . append ( uuid ) ; msg ....
public class SequenceMixin { /** * Performs a linear search of the given Sequence for the given compound . * Once we find the compound we return the position . */ public static < C extends Compound > int indexOf ( Sequence < C > sequence , C compound ) { } }
int index = 1 ; for ( C currentCompound : sequence ) { if ( currentCompound . equals ( compound ) ) { return index ; } index ++ ; } return 0 ;
public class PdfGraphics2D { /** * Sets the current font . */ public void setFont ( Font f ) { } }
if ( f == null ) return ; if ( onlyShapes ) { font = f ; return ; } if ( f == font ) return ; font = f ; fontSize = f . getSize2D ( ) ; baseFont = getCachedBaseFont ( f ) ;
public class PlanNodeTree { /** * Load plan nodes from the " PLAN _ NODE " array . All the nodes are from * a substatement with the id = stmtId * @ param stmtId * @ param jArray - PLAN _ NODES * @ param db * @ throws JSONException */ private void loadPlanNodesFromJSONArrays ( int stmtId , JSONArray jArray , D...
List < AbstractPlanNode > planNodes = new ArrayList < > ( ) ; int size = jArray . length ( ) ; try { for ( int i = 0 ; i < size ; i ++ ) { JSONObject jobj = jArray . getJSONObject ( i ) ; String nodeTypeStr = jobj . getString ( "PLAN_NODE_TYPE" ) ; PlanNodeType nodeType = PlanNodeType . get ( nodeTypeStr ) ; AbstractPl...
public class LineNumberPanel { /** * Get the JscrollPane that contains an editor pane , or null if none . * @ param editorPane an editor pane * @ return the JscrollPane that contains the editor pane , or null if none */ public JScrollPane getScrollPane ( JTextComponent editorPane ) { } }
Container p = editorPane . getParent ( ) ; while ( p != null ) { if ( p instanceof JScrollPane ) { return ( JScrollPane ) p ; } p = p . getParent ( ) ; } return null ;
public class GBSNode { /** * Find the insert point for a new key . * < p > Find the insert point for a new key . This method finds the point * AFTER which the new key should be inserted . The key does not * need to be bounded by the node value and duplicates are allowed . * If the new key is less than the lowes...
int nkeys = numKeys ( lower , upper ) ; if ( nkeys < 4 ) sequentialFindIndex ( lower , upper , new1 , point ) ; else binaryFindIndex ( lower , upper , new1 , point ) ;
public class PersistentMessageStoreImpl { /** * Stops the Persistent Message Store . * @ param mode specifies the type of stop operation which is to * be performed . */ public void stop ( int mode ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "stop" , "Mode=" + mode ) ; // Defect 363755 // Stop any new work coming in as soon as we start stopping . // This way we make sure nothing is attempted during the // ( possibly long ) time it takes for the OM to shut...
public class BaseProcessRecords { /** * Kind of convert file filter to regex . */ public String patternToRegex ( String string ) { } }
if ( string != null ) if ( ! string . contains ( "[" ) ) if ( ! string . contains ( "{" ) ) // If it has one of these , it probably is a regex already . if ( ! string . contains ( "\\." ) ) { string = string . replace ( "." , "\\." ) ; string = string . replace ( "*" , ".*" ) ; } return string ;
public class Plane { /** * Sets the parameters of the plane . * @ return a reference to this plane ( for chaining ) . */ public Plane set ( float a , float b , float c , float d ) { } }
_normal . set ( a , b , c ) ; constant = d ; return this ;
public class Interval { /** * Utility method to get the local start date time . This method combines the * start date and the start time to create a date time object . * @ return the start local date time * @ see # getStartDate ( ) * @ see # getStartTime ( ) */ public LocalDateTime getStartDateTime ( ) { } }
if ( startDateTime == null ) { startDateTime = LocalDateTime . of ( getStartDate ( ) , getStartTime ( ) ) ; } return startDateTime ;
public class TreeCoreset { /** * computes the cost of point p with the centre of treenode node */ double treeNodeCostOfPoint ( treeNode node , Point p ) { } }
if ( p . weight == 0.0 ) { return 0.0 ; } // stores the distance between centre and p double distance = 0.0 ; // loop counter variable int l ; for ( l = 0 ; l < p . dimension ; l ++ ) { // centroid coordinate of the point double centroidCoordinatePoint ; if ( p . weight != 0.0 ) { centroidCoordinatePoint = p . coordina...
public class ReceiveListenerDispatcher { /** * Allocates an error occurred object from an object pool . */ private ConversationReceiveListenerErrorOccurredInvocation allocateErrorOccurredInvocation ( Connection connection , ConversationReceiveListener listener , SIConnectionLostException exception , int segmentType , i...
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "allocateErrorOccurredInvocation" , new Object [ ] { connection , listener , exception , "" + segmentType , "" + requestNumber , "" + priority , conversation } ) ; ConversationReceiveListenerErrorOccurredInvocation re...
public class VAlarm { /** * { @ inheritDoc } */ public final void validate ( final boolean recurse ) throws ValidationException { } }
/* * ; ' action ' and ' trigger ' are both REQUIRED , ; but MUST NOT occur more than once action / trigger / */ PropertyValidator . getInstance ( ) . assertOne ( Property . ACTION , getProperties ( ) ) ; PropertyValidator . getInstance ( ) . assertOne ( Property . TRIGGER , getProperties ( ) ) ; /* * ; ' duration ' and...
public class RaftServiceContext { /** * Unregister the given session . * @ param index The index of the unregister . * @ param timestamp The timestamp of the unregister . * @ param session The session to unregister . * @ param expired Whether the session was expired by the leader . */ public void closeSession (...
log . debug ( "Closing session {}" , session . sessionId ( ) ) ; // Update the session ' s timestamp to prevent it from being expired . session . setLastUpdated ( timestamp ) ; // Update the state machine index / timestamp . tick ( index , timestamp ) ; // Expire sessions that have timed out . expireSessions ( currentT...
public class DataProviderContext { /** * Adds more triggers to the validator . * @ param triggers Triggers to be added . * @ return Same data provider context . */ public DataProviderContext on ( final Trigger ... triggers ) { } }
if ( triggers != null ) { Collections . addAll ( registeredTriggers , triggers ) ; } return this ;
public class FileSystemDeploymentService { /** * Perform a post - boot scan to remove any deployments added during boot that failed to deploy properly . * This method isn ' t private solely to allow a unit test in the same package to call it . */ void forcedUndeployScan ( ) { } }
if ( acquireScanLock ( ) ) { try { ROOT_LOGGER . tracef ( "Performing a post-boot forced undeploy scan for scan directory %s" , deploymentDir . getAbsolutePath ( ) ) ; ScanContext scanContext = new ScanContext ( deploymentOperations ) ; // Add remove actions to the plan for anything we count as // deployed that we didn...
public class BeanDefinitionWriter { /** * Visits a pre - destroy method injection point . * @ param declaringType The declaring type of the method . Either a Class or a string representing the name of the type * @ param returnType The return type of the method * @ param methodName The method name */ public void v...
visitPreDestroyMethodDefinition ( ) ; final MethodVisitData methodVisitData = new MethodVisitData ( declaringType , false , returnType , methodName , Collections . emptyMap ( ) , Collections . emptyMap ( ) , Collections . emptyMap ( ) , AnnotationMetadata . EMPTY_METADATA ) ; preDestroyMethodVisits . add ( methodVisitD...
public class ProtocolDataUnit { /** * Deserializes a array ( starting from the given offset ) and store the informations to the * < code > AdditionalHeaderSegment < / code > object . * @ param pdu The < code > ByteBuffer < / code > to read from . * @ param offset The offset to start from . * @ return The length...
// parsing Additional Header Segment int off = offset ; int ahsLength = basicHeaderSegment . getTotalAHSLength ( ) ; while ( ahsLength != 0 ) { final AdditionalHeaderSegment tmpAHS = new AdditionalHeaderSegment ( ) ; tmpAHS . deserialize ( pdu , off ) ; additionalHeaderSegments . add ( tmpAHS ) ; ahsLength -= tmpAHS . ...
public class CmsScheduledJobInfo { /** * Updates the request time in the internal context information of the user with the current system time . < p > * This is required before executing the job , otherwise the context information request time would be the time * the context object was initially created . < p > */ ...
CmsContextInfo context = ( CmsContextInfo ) m_context . clone ( ) ; context . setRequestTime ( System . currentTimeMillis ( ) ) ; context . freeze ( ) ; m_context = context ;
public class FinalizeMigrationOperation { /** * Notifies all { @ link MigrationAwareService } s that the migration finished . The services can then execute the commit or * rollback logic . If this node was the source and backup replica for a partition , the services will first be notified that * the migration is st...
PartitionMigrationEvent event = getPartitionMigrationEvent ( ) ; Collection < MigrationAwareService > migrationAwareServices = getMigrationAwareServices ( ) ; // Old backup owner is not notified about migration until migration // is committed on destination . This is the only place on backup owner // knows replica is m...
public class LinearClassifier { /** * Given a datum ' s features , returns a counter mapping from each * class name to the log probability of that class . * Looking at the the sum of e ^ v for each count v , should be 1. */ public Counter < L > logProbabilityOf ( int [ ] features ) { } }
Counter < L > scores = scoresOf ( features ) ; Counters . logNormalizeInPlace ( scores ) ; return scores ;
public class IamCredentialsClient { /** * Exchange a JWT signed by third party identity provider to an OAuth 2.0 access token * < p > Sample code : * < pre > < code > * try ( IamCredentialsClient iamCredentialsClient = IamCredentialsClient . create ( ) ) { * ServiceAccountName name = ServiceAccountName . of ( "...
GenerateIdentityBindingAccessTokenRequest request = GenerateIdentityBindingAccessTokenRequest . newBuilder ( ) . setName ( name == null ? null : name . toString ( ) ) . addAllScope ( scope ) . setJwt ( jwt ) . build ( ) ; return generateIdentityBindingAccessToken ( request ) ;
public class RequestUtils { /** * Reconstructs the current location ( URL ) from the request and * servlet configuration ( which is the only way to know which server * we ' re on because that ' s not provided in the request ) and returns * it . * @ return The URL that represents our current location . */ public...
StringBuffer rurl = req . getRequestURL ( ) ; String qs = req . getQueryString ( ) ; if ( qs != null ) { rurl . append ( "?" ) . append ( qs ) ; } return rurl . toString ( ) ;
public class AbstractTreebankParserParams { /** * Takes a Tree and a collinizer and returns a Collection of labeled * { @ link Constituent } s for PARSEVAL . * @ param t The tree to extract constituents from * @ param collinizer The TreeTransformer used to normalize the tree for * evaluation * @ return The ba...
return parsevalObjectify ( t , collinizer , true ) ;
public class ProteinPocketFinder { /** * Method performs the clustering , is called by findPockets ( ) . */ public List < Point3d > clusterPSPPocket ( Point3d root , List < Point3d > subPocket , int [ ] dim ) { } }
// logger . debug ( " * * * * * New Root * * * * * : " + root . x + " " + root . y + " // " + root . z ) ; visited . put ( ( int ) root . x + "." + ( int ) root . y + "." + ( int ) root . z , 1 ) ; int [ ] minMax = { 0 , 0 , 0 , 0 , 0 , 0 } ; minMax [ 0 ] = ( int ) ( root . x - linkageRadius ) ; minMax [ 1 ] = ( int ) ...
public class MessageStreams { /** * Read a file containing entries of a given type . Tries to detect the * entry format of the file based on file magic . If not detected will try * to use the default binary serializer format . * @ param file The file to read . * @ param serializer The serializer to use . * @ ...
return file ( file . toFile ( ) , serializer , descriptor ) ;
public class Source { /** * Sets the maximum distance for attenuation . */ public void setMaxDistance ( float distance ) { } }
if ( _maxDistance != distance ) { AL10 . alSourcef ( _id , AL10 . AL_MAX_DISTANCE , _maxDistance = distance ) ; }
public class Description { /** * Emits the line that starts at { @ code start } position , and ends at a newline or the { @ code end } position . * @ return the start position of the next line ( the { @ code end } position */ private static int emitLine ( StringBuilder target , char [ ] buffer , int start , int end ,...
int last = start ; for ( int pos = start , cp ; pos < end ; pos += charCount ( cp ) ) { cp = codePointAt ( buffer , pos ) ; if ( cp == '\n' ) { end = pos + 1 ; } if ( indentation > 0 ) { if ( -- indentation == 0 ) { start = pos + 1 ; } last = pos ; } else if ( ! isWhitespace ( cp ) ) { last = pos + 1 ; } } target . app...
public class MPJwtBadMPConfigAsSystemProperties { /** * The server will be started with all mp - config properties incorrectly configured in the jvm . options file . * The server . xml has NO mp _ jwt config specified . * The config settings should come from the system properties ( defined in jvm . options ) . * ...
standardTestFlow ( resourceServer , MpJwtFatConstants . NO_MP_CONFIG_IN_APP_ROOT_CONTEXT , MpJwtFatConstants . NO_MP_CONFIG_IN_APP_APP , MpJwtFatConstants . MPJWT_APP_CLASS_NO_MP_CONFIG_IN_APP , setBadIssuerExpectations ( resourceServer ) ) ;
public class AccessUrlIfFunction { /** * 获取到当前登录用户凭证 , 如果不存在 , 返回一个匿名凭证 * @ param securityContext * 当前安全上下文 * @ return 当前登录用户凭证 , 如果不存在 , 返回一个匿名凭证 */ private Authentication getAuthentication ( SecurityContext securityContext ) { } }
// 用户未登录 Authentication authentication = securityContext . getAuthentication ( ) ; if ( authentication == null ) { authentication = new AnonymousAuthenticationToken ( UUID . randomUUID ( ) . toString ( ) , "anonymous" , Collections . < GrantedAuthority > singletonList ( new SimpleGrantedAuthority ( "ROLE_ANONYMOUS" ) )...
public class UDPConnLink { /** * Common connect logic between sync and async connect requests . * @ param _ udpRequestContextObject * @ throws IOException */ private void connectCommon ( Object _udpRequestContextObject ) throws IOException { } }
String localAddress = "*" ; int localPort = 0 ; Map < Object , Object > vcStateMap = getVirtualConnection ( ) . getStateMap ( ) ; if ( vcStateMap != null ) { // Size of the buffer the channel should use to read . String value = ( String ) vcStateMap . get ( UDPConfigConstants . CHANNEL_RCV_BUFF_SIZE ) ; if ( value != n...
public class MediaModuleGenerator { /** * Generation of embed tag . * @ param m source * @ param e element to attach new element to */ private void generateEmbed ( final Metadata m , final Element e ) { } }
if ( m . getEmbed ( ) == null ) { return ; } final Element embedElement = new Element ( "embed" , NS ) ; addNotNullAttribute ( embedElement , "url" , m . getEmbed ( ) . getUrl ( ) ) ; addNotNullAttribute ( embedElement , "width" , m . getEmbed ( ) . getWidth ( ) ) ; addNotNullAttribute ( embedElement , "height" , m . g...
public class ToXMLStream { /** * From XSLTC * Declare a prefix to point to a namespace URI . Inform SAX handler * if this is a new prefix mapping . */ protected boolean pushNamespace ( String prefix , String uri ) { } }
try { if ( m_prefixMap . pushNamespace ( prefix , uri , m_elemContext . m_currentElemDepth ) ) { startPrefixMapping ( prefix , uri ) ; return true ; } } catch ( SAXException e ) { // falls through } return false ;
public class Context { /** * 判断全局变量是否存在 * @ param i * @ return */ protected boolean exist ( int i ) { } }
if ( i >= this . tempVarStartIndex ) { return true ; } else { Object object = vars [ i ] ; return object != NOT_EXIST_OBJECT ; }
public class Client { /** * Returns a list of bindings where provided queue is the destination . * @ param vhost vhost of the exchange * @ param queue destination queue name * @ return list of bindings */ public List < BindingInfo > getQueueBindings ( String vhost , String queue ) { } }
final URI uri = uriWithPath ( "./queues/" + encodePathSegment ( vhost ) + "/" + encodePathSegment ( queue ) + "/bindings" ) ; final BindingInfo [ ] result = this . rt . getForObject ( uri , BindingInfo [ ] . class ) ; return asListOrNull ( result ) ;
public class BarData { /** * Gets the size of the data . * @ return the data */ public int size ( ) { } }
int ret = 0 ; for ( Collection < T > series : data ) { if ( series . size ( ) > 0 ) ++ ret ; } return ret ;
public class CFSA2Serializer { /** * Write a v - int to a byte array . */ static int writeVInt ( byte [ ] array , int offset , int value ) { } }
assert value >= 0 : "Can't v-code negative ints." ; while ( value > 0x7F ) { array [ offset ++ ] = ( byte ) ( 0x80 | ( value & 0x7F ) ) ; value >>= 7 ; } array [ offset ++ ] = ( byte ) value ; return offset ;
public class AbstractHeaderDialogBuilder { /** * Obtains , whether the dialog ' s header should be shown , or not , from a specific theme . * @ param themeResourceId * The resource id of the theme , the visibility should be obtained from , as an { @ link * Integer } value */ private void obtainShowHeader ( @ Styl...
TypedArray typedArray = getContext ( ) . getTheme ( ) . obtainStyledAttributes ( themeResourceId , new int [ ] { R . attr . materialDialogShowHeader } ) ; showHeader ( typedArray . getBoolean ( 0 , false ) ) ;
public class TouchState { /** * Copies the contents of this state object to another . * @ param target The TouchState to which to copy this state ' s data . */ void copyTo ( TouchState target ) { } }
target . clear ( ) ; for ( int i = 0 ; i < pointCount ; i ++ ) { target . addPoint ( points [ i ] ) ; } target . primaryID = primaryID ; target . window = window ;
public class SystemFunctionSet { /** * Map keys * @ param m * @ return */ @ MapMethod public List < String > keys ( Map < String , Object > m ) { } }
List < String > l = Objects . newArrayList ( ) ; for ( String k : m . keySet ( ) ) { l . add ( k ) ; } return l ;
public class CmsWorkplace { /** * Sets site and project in the workplace settings with the request values of parameters * < code > { @ link CmsWorkplace # PARAM _ WP _ SITE } < / code > and < code > { @ link CmsWorkplace # PARAM _ WP _ PROJECT } < / code > . < p > * @ param settings the workplace settings * @ par...
// check if the user requested a project change String project = request . getParameter ( PARAM_WP_PROJECT ) ; boolean reloadRequired = false ; if ( project != null ) { reloadRequired = true ; try { getCms ( ) . readProject ( new CmsUUID ( project ) ) ; } catch ( Exception e ) { // project not found , set online projec...
public class CollectionUtility { /** * 分割数组为两个数组 * @ param src 原数组 * @ param rate 第一个数组所占的比例 * @ return 两个数组 */ public static String [ ] [ ] spiltArray ( String [ ] src , double rate ) { } }
assert 0 <= rate && rate <= 1 ; String [ ] [ ] output = new String [ 2 ] [ ] ; output [ 0 ] = new String [ ( int ) ( src . length * rate ) ] ; output [ 1 ] = new String [ src . length - output [ 0 ] . length ] ; System . arraycopy ( src , 0 , output [ 0 ] , 0 , output [ 0 ] . length ) ; System . arraycopy ( src , outpu...
public class Identifiers { /** * Create an extended { @ link Identity } identifier . * @ param extendedIdentifier the extended identifier XML * @ param c charset used for encoding the string * @ return the new extended identity instance * @ throws IfmapException */ public static Identity createExtendedIdentity ...
return createExtendedIdentity ( DomHelpers . toDocument ( extendedIdentifier , c ) ) ;
public class Clicker { /** * Clicks on a given coordinate on the screen . * @ param x the x coordinate * @ param y the y coordinate */ public void clickOnScreen ( float x , float y , View view ) { } }
boolean successfull = false ; int retry = 0 ; SecurityException ex = null ; while ( ! successfull && retry < 20 ) { long downTime = SystemClock . uptimeMillis ( ) ; long eventTime = SystemClock . uptimeMillis ( ) ; MotionEvent event = MotionEvent . obtain ( downTime , eventTime , MotionEvent . ACTION_DOWN , x , y , 0 )...
public class PropertyFilterList { /** * Searches list for given PropertyFilter . */ public boolean contains ( PropertyFilter < S > propFilter ) { } }
if ( mPropFilter == propFilter ) { return true ; } if ( mNext == null ) { return false ; } // Tail recursion . return mNext . contains ( propFilter ) ;
public class ApproximateHistogram { /** * Combines two sets of histogram bins using merge - sort and computes the delta between consecutive bin positions . * Duplicate bins are merged together . * @ param leftBinCount * @ param leftPositions * @ param leftBins * @ param rightBinCount * @ param rightPosition...
int i = 0 ; int j = 0 ; int k = 0 ; while ( j < leftBinCount || k < rightBinCount ) { if ( j < leftBinCount && ( k == rightBinCount || leftPositions [ j ] < rightPositions [ k ] ) ) { mergedPositions [ i ] = leftPositions [ j ] ; mergedBins [ i ] = leftBins [ j ] ; ++ j ; } else if ( k < rightBinCount && ( j == leftBin...
public class MSPDIReader { /** * This method extracts calendar data from an MSPDI file . * @ param project Root node of the MSPDI file * @ param map Map of calendar UIDs to names */ private void readCalendars ( Project project , HashMap < BigInteger , ProjectCalendar > map ) { } }
Project . Calendars calendars = project . getCalendars ( ) ; if ( calendars != null ) { LinkedList < Pair < ProjectCalendar , BigInteger > > baseCalendars = new LinkedList < Pair < ProjectCalendar , BigInteger > > ( ) ; for ( Project . Calendars . Calendar cal : calendars . getCalendar ( ) ) { readCalendar ( cal , map ...
public class CompareFileExtensions { /** * Completes the compare from the files encapsulated in the FileCompareResultBean . * @ param fileCompareResultBean * the FileCompareResultBean . */ public static void completeCompare ( final IFileCompareResultBean fileCompareResultBean ) { } }
compare ( fileCompareResultBean , false , false , false , false , false ) ;
public class AjaxWRadioButtonSelectExample { /** * Set the content of the text field depending on the selected option in the radio button select . * @ param request the request being processed */ @ Override protected void preparePaintComponent ( final Request request ) { } }
if ( OPTION_CONTENT1 . equals ( rbSelect . getSelected ( ) ) ) { content . setText ( "This is content 1" ) ; } else if ( OPTION_CONTENT2 . equals ( rbSelect . getSelected ( ) ) ) { content . setText ( "This is content 2" ) ; } else if ( OPTION_CONTENT3 . equals ( rbSelect . getSelected ( ) ) ) { content . setText ( "Th...
public class ExpiryPolicyBuilder { /** * Set TTI since last access . * Note : Calling this method on a builder with an existing TTI since last access will override the previous value or function . * @ param access TTI since last access * @ return a new builder with the TTI since last access */ public ExpiryPolicy...
if ( access != null && access . isNegative ( ) ) { throw new IllegalArgumentException ( "Access duration must be positive" ) ; } return access ( ( a , b ) -> access ) ;
public class RouteHandler { /** * Routes the request specified by the given request URI and HTTP method . * @ param requestURI the given request URI * @ param httpMethod the given HTTP method * @ return MatchResult , returns { @ code null } if not found */ public static MatchResult doMatch ( final String requestU...
MatchResult ret ; final int segs = StringUtils . countMatches ( requestURI , "/" ) ; ContextHandlerMeta contextHandlerMeta ; String concreteKey = httpMethod + "." + requestURI ; switch ( segs ) { case 1 : contextHandlerMeta = ONE_SEG_CONCRETE_CTX_HANDLER_METAS . get ( concreteKey ) ; if ( null != contextHandlerMeta ) {...
public class WebContext { /** * Get application environment information . * @ param key environment key * @ param defaultValue default value , if value is null * @ return environment optional value */ public String env ( String key , String defaultValue ) { } }
return blade ( ) . env ( key , defaultValue ) ;
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link ElementaryFunctionsType } { @ code > } } */ @ XmlElementDecl ( namespace = "http://www.w3.org/1998/Math/MathML" , name = "arcsech" ) public JAXBElement < ElementaryFunctionsType > createArcsech ( ElementaryFunctionsTyp...
return new JAXBElement < ElementaryFunctionsType > ( _Arcsech_QNAME , ElementaryFunctionsType . class , null , value ) ;
public class AbstractAdminObject { /** * Adds a new event to this AdminObject . * @ param _ eventtype Eventtype class name to add * @ param _ eventdef EventDefinition to add * @ see # events * @ throws CacheReloadException on error */ public void addEvent ( final EventType _eventtype , final EventDefinition _ev...
List < EventDefinition > evenList = this . events . get ( _eventtype ) ; if ( evenList == null ) { evenList = new ArrayList < > ( ) ; this . events . put ( _eventtype , evenList ) ; } if ( ! evenList . contains ( _eventdef ) ) { evenList . add ( _eventdef ) ; } // if there are more than one event they must be sorted by...