signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class AbstractFilter { /** * Convert an array of < code > AbstractFilter < / code > objects to a chain of * filters by calling the { @ link # setAnd } the method of each filter object . * @ param filterArray An array of AbstractFilter objects having length * greater than zero . * @ return The first filte...
for ( int i = 0 ; i < ( filterArray . length - 1 ) ; i ++ ) { AbstractFilter thisFilter = ( AbstractFilter ) filterArray [ i ] ; thisFilter . setAnd ( filterArray [ i + 1 ] ) ; } AbstractFilter lastFilter = ( AbstractFilter ) filterArray [ filterArray . length - 1 ] ; lastFilter . setAnd ( null ) ; return filterArray [...
public class BasicChronology { /** * Gets the maximum number of days in the month specified by the instant . * @ param instant millis from 1970-01-01T00:00:00Z * @ return the maximum number of days in the month */ int getDaysInMonthMax ( long instant ) { } }
int thisYear = getYear ( instant ) ; int thisMonth = getMonthOfYear ( instant , thisYear ) ; return getDaysInYearMonth ( thisYear , thisMonth ) ;
public class DBObject { /** * Return the names of all scalar fields for which new or " remove " values have been * assigned for this object . The given { @ link TableDefinition } is used to determine * which field names are scalars . * @ param tableDef { @ link TableDefinition } of a table . * @ return Set of a...
Set < String > fieldNames = new HashSet < String > ( ) ; for ( String fieldName : m_valueMap . keySet ( ) ) { if ( tableDef . isScalarField ( fieldName ) ) { fieldNames . add ( fieldName ) ; } } for ( String fieldName : m_valueRemoveMap . keySet ( ) ) { if ( tableDef . isScalarField ( fieldName ) ) { fieldNames . add (...
public class Fat16BootSector { /** * Sets the volume label that is stored in this boot sector . * @ param label the new volume label * @ throws IllegalArgumentException if the specified label is longer * than { @ link # MAX _ VOLUME _ LABEL _ LENGTH } */ public void setVolumeLabel ( String label ) throws IllegalA...
if ( label . length ( ) > MAX_VOLUME_LABEL_LENGTH ) throw new IllegalArgumentException ( "volume label too long" ) ; for ( int i = 0 ; i < MAX_VOLUME_LABEL_LENGTH ; i ++ ) { set8 ( VOLUME_LABEL_OFFSET + i , i < label . length ( ) ? label . charAt ( i ) : 0 ) ; }
public class AttributesUtils { /** * returns whether the pc is at a line number that also appears for a another byte code offset later on in the method . If this occurs we are in a jdk6 * finally replicated block , and so don ' t report this . If the code has no line number table , then just report it . * @ param o...
LineNumberTable lnt = obj . getLineNumberTable ( ) ; if ( lnt == null ) return true ; LineNumber [ ] lineNumbers = lnt . getLineNumberTable ( ) ; if ( lineNumbers == null ) return true ; int lo = 0 ; int hi = lineNumbers . length - 1 ; int mid = 0 ; int linePC = 0 ; while ( lo <= hi ) { mid = ( lo + hi ) >>> 1 ; linePC...
public class NodeSequence { /** * Create a sequence of nodes that iterates over the supplied node keys . Note that the supplied iterator is accessed lazily as * the resulting sequence ' s { @ link # nextBatch ( ) first batch } is { @ link Batch # nextRow ( ) used } . * @ param keys the iterator over the keys of the...
if ( keys == null || keys . isEmpty ( ) ) return emptySequence ( 1 ) ; return withNodeKeys ( keys . iterator ( ) , keys . size ( ) , score , workspaceName , repository ) ;
public class JestClientFactory { /** * Extension point */ protected RequestConfig getRequestConfig ( ) { } }
return RequestConfig . custom ( ) . setConnectTimeout ( httpClientConfig . getConnTimeout ( ) ) . setSocketTimeout ( httpClientConfig . getReadTimeout ( ) ) . build ( ) ;
public class LSTMHelpers { /** * Returns FwdPassReturn object with activations / INDArrays . Allows activateHelper to be used for forward pass , backward pass * and rnnTimeStep whilst being reasonably efficient for all */ static public FwdPassReturn activateHelper ( final BaseLayer layer , final NeuralNetConfiguratio...
// Mini - batch data format : for mini - batch size m , nIn inputs , and T time series length // Data has shape [ m , nIn , T ] . Layer activations / output has shape [ m , nHiddenUnits , T ] if ( input == null || input . length ( ) == 0 ) throw new IllegalArgumentException ( "Invalid input: not set or 0 length" ) ; IN...
public class FeatureCollectorTask { /** * Checks if epic information on a feature needs update */ private static boolean isEpicChanged ( Feature feature , Epic epic ) { } }
if ( ! feature . getsEpicAssetState ( ) . equalsIgnoreCase ( epic . getStatus ( ) ) ) { return true ; } if ( ! feature . getsEpicName ( ) . equalsIgnoreCase ( epic . getName ( ) ) || ! feature . getsEpicNumber ( ) . equalsIgnoreCase ( epic . getNumber ( ) ) ) { return true ; } if ( ! StringUtils . isEmpty ( feature . g...
public class A_CmsResourceType { /** * Returns a list of property objects that are attached to the resource on creation . < p > * It ' s possible to use OpenCms macros for the property values . * Please see { @ link CmsMacroResolver } for allowed macro values . < p > * @ param properties the ( optional ) properti...
if ( ( m_defaultProperties == null ) || ( m_defaultProperties . size ( ) == 0 ) ) { // no default properties are defined return properties ; } // the properties must be copied since the macros could contain macros that are // resolved differently for every user / context ArrayList < CmsProperty > result = new ArrayList...
public class Util { /** * Compose two enumerations into one . * @ param e1 an enumeration * @ param e2 another enumeration * @ return an enumeration containing every element from < code > e1 < / code > and < code > e2 < / code > */ static < T > Enumeration < T > compose ( Enumeration < T > e1 , Enumeration < T > ...
// return the composite of e1 and e2 , or whichever is non - empty return isEmpty ( e1 ) ? e2 : isEmpty ( e2 ) ? e1 : new CompositeEnumeration < T > ( e1 ) . add ( e2 ) ;
public class ForkJoinPool { /** * Returns an estimate of the number of worker threads that are * not blocked waiting to join tasks or for other managed * synchronization . This method may overestimate the * number of running threads . * @ return the number of worker threads */ public int getRunningThreadCount (...
int rc = 0 ; WorkQueue [ ] ws ; WorkQueue w ; if ( ( ws = workQueues ) != null ) { for ( int i = 1 ; i < ws . length ; i += 2 ) { if ( ( w = ws [ i ] ) != null && w . isApparentlyUnblocked ( ) ) ++ rc ; } } return rc ;
public class CmsLock { /** * Determines whether to show the lock dialog depending on the users settings and the dilaog type . < p > * In case of locking a folder , a confirmation dialog is needed if any sub resources are already locked . < p > * @ return true if dialogs should be shown , otherwise false */ public b...
boolean showConfirmation = getSettings ( ) . getUserSettings ( ) . getDialogShowLock ( ) ; if ( DIALOG_TYPE_LOCK . equals ( getParamDialogtype ( ) ) ) { // in case of locking resources , check if there are locked sub resources in the selected folder ( s ) showConfirmation = showConfirmation || ( getLockedResources ( ) ...
public class FeedbackWindowTinyLfuPolicy { /** * Evicts from the admission window into the probation space . If the size exceeds the maximum , * then the admission candidate and probation ' s victim are evaluated and one is evicted . */ private void evict ( ) { } }
if ( sizeWindow <= maxWindow ) { return ; } Node candidate = headWindow . next ; sizeWindow -- ; candidate . remove ( ) ; candidate . status = Status . PROBATION ; candidate . appendToTail ( headProbation ) ; if ( data . size ( ) > maximumSize ) { Node evict ; Node victim = headProbation . next ; if ( admittor . admit ...
public class LineDocRecordReader { /** * / * ( non - Javadoc ) * @ see org . apache . hadoop . mapred . RecordReader # next ( java . lang . Object , java . lang . Object ) */ public synchronized boolean next ( DocumentID key , LineDocTextAndOp value ) throws IOException { } }
if ( pos >= end ) { return false ; } // key is document id , which are bytes until first space if ( ! readInto ( key . getText ( ) , SPACE ) ) { return false ; } // read operation : i / d / u , or ins / del / upd , or insert / delete / update Text opText = new Text ( ) ; if ( ! readInto ( opText , SPACE ) ) { return fa...
public class RebondTool { /** * Rebonding using a Binary Space Partition Tree . Note , that any bonds * defined will be deleted first . It assumes the unit of 3D space to * be 1 Å . */ public void rebond ( IAtomContainer container ) throws CDKException { } }
container . removeAllBonds ( ) ; maxCovalentRadius = 0.0 ; // construct a new binary space partition tree bspt = new Bspt ( 3 ) ; Iterator < IAtom > atoms = container . atoms ( ) . iterator ( ) ; while ( atoms . hasNext ( ) ) { IAtom atom = atoms . next ( ) ; double myCovalentRadius = atom . getCovalentRadius ( ) ; if ...
public class DefaultPlaceholderStrategy { /** * Add a placeholder to the strategy * @ param placeholder name of the placholder * @ param value value of the placeholder */ @ Override public void addPlaceholder ( String placeholder , String value ) { } }
placeholderMap . put ( placeholder , value ) ;
public class RuleMatchAsXmlSerializer { /** * Get an XML representation of the given rule matches . * @ param text the original text that was checked , used to get the context of the matches * @ param contextSize the desired context size in characters * @ param unknownWords unknown words to be printed in a separa...
String xmlSnippet = ruleMatchesToXmlSnippet ( ruleMatches , text , contextSize ) ; switch ( xmlMode ) { case START_API : return getXmlStart ( lang , null ) + xmlSnippet ; case CONTINUE_API : return xmlSnippet ; case END_API : return xmlSnippet + getXmlUnknownWords ( unknownWords ) + getXmlEnd ( ) ; case NORMAL_API : re...
public class AmazonWorkLinkClient { /** * Provides information about the certificate authority . * @ param describeWebsiteCertificateAuthorityRequest * @ return Result of the DescribeWebsiteCertificateAuthority operation returned by the service . * @ throws UnauthorizedException * You are not authorized to perf...
request = beforeClientExecution ( request ) ; return executeDescribeWebsiteCertificateAuthority ( request ) ;
public class DescribeConfigurationAggregatorSourcesStatusResult { /** * Returns an AggregatedSourceStatus object . * @ param aggregatedSourceStatusList * Returns an AggregatedSourceStatus object . */ public void setAggregatedSourceStatusList ( java . util . Collection < AggregatedSourceStatus > aggregatedSourceStat...
if ( aggregatedSourceStatusList == null ) { this . aggregatedSourceStatusList = null ; return ; } this . aggregatedSourceStatusList = new com . amazonaws . internal . SdkInternalList < AggregatedSourceStatus > ( aggregatedSourceStatusList ) ;
public class FactoryFiducial { /** * Wrapper around chessboard calibration detector . Refine with lines is set to true automatically . This * isn ' t being used for calibration and its better to use the whole line . * @ param config Description of the chessboard . * @ param imageType Type of image it ' s processi...
return new CalibrationFiducialDetector < > ( config , dimen , imageType ) ;
public class XMLUtil { /** * Replies the value that corresponds to the specified attribute ' s path . * < p > The path is an ordered list of tag ' s names and ended by the name of * the attribute . * @ param document is the XML document to explore . * @ param casesSensitive indicates of the { @ code path } ' s ...
assert document != null : AssertMessages . notNullParameter ( 0 ) ; return getAttributeValue ( document , casesSensitive , 0 , path ) ;
public class MapOfLists { /** * This add the element value at the end of the list pointed by key */ public List < V > get ( K key ) { } }
return ( List < V > ) map . get ( key ) ;
public class StandardMessageResolver { /** * Format a message , merging it with its parameters , before returning . * This is meant to be overridden by subclasses if necessary . The default mechanism will simply * use a standard { @ link java . text . MessageFormat } instance . * @ param locale the locale * @ p...
return StandardMessageResolutionUtils . formatMessage ( locale , message , messageParameters ) ;
public class GenericDocumentComplexConverter { /** * Restore all the dots in the keys where { @ link # TO _ REPLACE _ DOTS } is found . * @ param document Document to modify * @ return Restored document */ public static Document restoreDots ( Document document ) { } }
return modifyKeys ( document , key -> key . replace ( TO_REPLACE_DOTS , "." ) , TO_REPLACE_DOTS ) ;
public class AbstractSearch { /** * aligns all performances in the space and prints those tables to the log * file . * @ param spacethe current space to align the performances to * @ param performancesthe performances to align */ protected void logPerformances ( Space space , Vector < Performance > performances )...
m_Owner . logPerformances ( space , performances ) ;
public class HtmlTree { /** * Generates an HTML anchor tag . * @ param ref reference url for the anchor tag * @ param body content for the anchor tag * @ return an HtmlTree object */ public static HtmlTree A ( String ref , Content body ) { } }
HtmlTree htmltree = new HtmlTree ( HtmlTag . A , nullCheck ( body ) ) ; htmltree . addAttr ( HtmlAttr . HREF , encodeURL ( ref ) ) ; return htmltree ;
public class FactoryAccAppBeansSqlite { /** * < p > Initialize inner factories after clear beans or on startup . < / p > * @ throws Exception - an exception */ @ Override public final synchronized void init ( ) throws Exception { } }
FactoryBldAccServices < ResultSet > factoryBldAccServices = new FactoryBldAccServices < ResultSet > ( ) ; factoryBldAccServices . setFactoryAppBeans ( this ) ; setFactoryBldServices ( factoryBldAccServices ) ; FactoryAccServices < ResultSet > factoryAccServices = new FactoryAccServices < ResultSet > ( ) ; factoryAccSer...
public class CmsDocumentTypeAddList { /** * Returns the systems configured document types that are not assigned * to the current indexsource ( those that may be added ) . < p > * @ return the systems configured document types that are not assigned * to the current indexsource ( those that may be added ) */ privat...
CmsSearchManager manager = OpenCms . getSearchManager ( ) ; CmsSearchIndexSource indexsource = manager . getIndexSource ( getParamIndexsource ( ) ) ; List < CmsSearchDocumentType > result ; if ( indexsource != null ) { List < String > systemDoctypeNames = new ArrayList < String > ( ) ; Iterator < CmsSearchDocumentType ...
public class CmsCollectionsGenericWrapper { /** * Provides a wrapper to create a { @ link LRUMap } with the given size that avoids warnings with Java 1.5 generic code . < p > * @ param < K > the type of keys maintained by the returned map * @ param < V > the type of mapped values * @ param size the initial size o...
return new LRUMap ( size ) ;
public class RawPacket { /** * Read a byte region from specified offset in the RTP packet and with * specified length into a given buffer * @ param off * start offset in the RTP packet of the region to be read * @ param len * length of the region to be read * @ param outBuff * output buffer */ public void...
assert off >= 0 ; assert len > 0 ; assert outBuff != null ; assert outBuff . length >= len ; assert buffer . limit ( ) >= off + len ; buffer . position ( off ) ; buffer . get ( outBuff , 0 , len ) ;
public class DOM2DTM { /** * Given a node handle , return the XPath node name . This should be * the name as described by the XPath data model , NOT the DOM - style * name . * @ param nodeHandle the id of the node . * @ return String Name of this node , which may be an empty string . */ public String getNodeNam...
String name ; short type = getNodeType ( nodeHandle ) ; switch ( type ) { case DTM . NAMESPACE_NODE : { Node node = getNode ( nodeHandle ) ; // assume not null . name = node . getNodeName ( ) ; if ( name . startsWith ( "xmlns:" ) ) { name = QName . getLocalPart ( name ) ; } else if ( name . equals ( "xmlns" ) ) { name ...
public class CollectedStatistics { /** * Returns the variance of all StopWatches recorded . NB : This * call causes all of the StopWatches to be traversed , which makes it fairly slow . * @ return The variance . */ public synchronized double variance ( ) { } }
long n = 0 ; double mean = 0 ; double s = 0.0 ; for ( double x : m_times . m_values ) { n ++ ; double delta = x - mean ; mean += delta / n ; s += delta * ( x - mean ) ; } return ( s / n ) ;
public class AutoElasticsearch { /** * { @ inheritDoc } * @ deprecated This is available for any storm cluster that operates against the older method of obtaining credentials */ @ Override public void populateCredentials ( Map < String , String > credentials , Map topologyConfiguration ) { } }
populateCredentials ( credentials , topologyConfiguration , null ) ;
public class IPv6AddressSection { /** * This produces a string with no compressed segments and all segments of full length , * which is 4 characters for IPv6 segments and 3 characters for IPv4 segments . */ @ Override public String toFullString ( ) { } }
String result ; if ( hasNoStringCache ( ) || ( result = getStringCache ( ) . fullString ) == null ) { getStringCache ( ) . fullString = result = toNormalizedString ( IPv6StringCache . fullParams ) ; } return result ;
public class JDBCUtil { /** * Adds a column ( with name ' cname ' and definition ' cdef ' ) to the specified table . * @ param afterCname ( optional ) the name of the column after which to add the new column . * @ return true if the column was added , false if it already existed . */ public static boolean addColumn...
if ( tableContainsColumn ( conn , table , cname ) ) { // Log . info ( " Database table ' " + table + " ' already has column ' " + cname + " ' . " ) ; return false ; } String update = "ALTER TABLE " + table + " ADD COLUMN " + cname + " " + cdef ; if ( afterCname != null ) { update += " AFTER " + afterCname ; } PreparedS...
public class AbstractPartial { /** * Gets the index of the specified field , or - 1 if the field is unsupported . * @ param type the type to check , may be null which returns - 1 * @ return the index of the field , - 1 if unsupported */ public int indexOf ( DateTimeFieldType type ) { } }
for ( int i = 0 , isize = size ( ) ; i < isize ; i ++ ) { if ( getFieldType ( i ) == type ) { return i ; } } return - 1 ;
public class Template { /** * 为模板绑定变量 , 此变量在模板编译的时候 , 根据infer标记来决定是否要推测期类型 , 如果dynamic为true , * 则表示模板引擎优化不需要推测其类型 , 默认总是false , 即变量总是对应同一个类型 。 如果为true , 则认为 : 因为变量可能能对应不同java类型 , * 或者变量是容器 , 但容器里的元素是不同类型 * @ param varName * @ param o */ public void binding ( String varName , Object o , boolean dynamic ) { } }
ctx . set ( varName , o , dynamic ) ; // ctx . globalVar . put ( varName , o ) ; if ( dynamic ) { ctx . objectKeys . add ( varName ) ; }
public class CommandOutputResolverSupport { /** * Overridable hook to check whether { @ code selector } can be assigned from the provider type { @ code provider } . * This method descends the component type hierarchy and considers primitive / wrapper type conversion . * @ param selector must not be { @ literal null...
ResolvableType selectorType = selector . getOutputType ( ) ; ResolvableType resolvableType = provider . withCodec ( selector . getRedisCodec ( ) ) ; return selectorType . isAssignableFrom ( resolvableType ) ;
public class ChangesOnMyIssueNotificationHandler { /** * Creates the { @ link EmailDeliveryRequest } for the specified { @ code recipient } with issues from the * specified { @ code notification } it is the assignee of . * @ return { @ code null } when the recipient is the assignee of no issue in { @ code notificat...
Set < ChangedIssue > recipientIssuesByProject = notification . getIssues ( ) . stream ( ) . filter ( issue -> issue . getAssignee ( ) . filter ( assignee -> recipient . getLogin ( ) . equals ( assignee . getLogin ( ) ) ) . isPresent ( ) ) . filter ( issue -> subscribedProjectKeys . contains ( issue . getProject ( ) . g...
public class TreeNode { /** * Removes the child at the specified index from this node ' s children and * sets that node ' s parent to { @ code null } . * @ param index the index in this node ' s child array of the child to remove * @ return { @ code this } tree - node , for method chaining * @ throws ArrayIndex...
if ( _children == null ) { throw new ArrayIndexOutOfBoundsException ( format ( "Child index is out of bounds: %s" , index ) ) ; } final TreeNode < T > child = _children . remove ( index ) ; assert child . _parent == this ; child . setParent ( null ) ; if ( _children . isEmpty ( ) ) { _children = null ; } return this ;
public class LoadedFieldSet { /** * Add a load of given field at given instruction . * @ param handle * the instruction * @ param field * the field */ public void addLoad ( InstructionHandle handle , XField field ) { } }
getLoadStoreCount ( field ) . loadCount ++ ; handleToFieldMap . put ( handle , field ) ; loadHandleSet . set ( handle . getPosition ( ) ) ;
public class Weld { /** * Define the set of extensions . * @ param extensions * @ return self */ public Weld extensions ( Extension ... extensions ) { } }
this . extensions . clear ( ) ; for ( Extension extension : extensions ) { addExtension ( extension ) ; } return this ;
public class DestinationManager { /** * starts DeletePubSubMsgsThread */ private void startDeletePubSubMsgsThread ( ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "startDeletePubSubMsgsThread" ) ; // every time create DeletePubSubMsgsThread as this is called from // a new DestinationManager . Thread delThread = new Thread ( ( new DeletePubSubMsgsThread ( messageProcessor ) ) , "startD...
public class RecordMarkerFailedEventAttributesMarshaller { /** * Marshall the given parameter object . */ public void marshall ( RecordMarkerFailedEventAttributes recordMarkerFailedEventAttributes , ProtocolMarshaller protocolMarshaller ) { } }
if ( recordMarkerFailedEventAttributes == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( recordMarkerFailedEventAttributes . getMarkerName ( ) , MARKERNAME_BINDING ) ; protocolMarshaller . marshall ( recordMarkerFailedEventAttributes . getC...
public class CalculatorApp { /** * A simple adder of request parameters { @ code t1 } and { @ code t2} * @ param request The request to handle the addition for * @ return A response of an integer representing the sum */ static Response < Integer > add ( Request request ) { } }
Optional < String > t1 = request . parameter ( "t1" ) ; Optional < String > t2 = request . parameter ( "t2" ) ; if ( t1 . isPresent ( ) && t2 . isPresent ( ) ) { int result = Integer . valueOf ( t1 . get ( ) ) + Integer . valueOf ( t2 . get ( ) ) ; return Response . forPayload ( result ) ; } else { return Response . fo...
public class SpringReader { /** * Read the single Spring XML configuration file located at the specified * path , performing PropertyPlaceHolder interpolation , extracting all beans * which implement the RequestHandler interface , and construct a * RequestMapper for those RequestHandlers , on the specified Servle...
LOGGER . info ( "Loading from config file " + configPath ) ; currentContext = new FileSystemXmlApplicationContext ( "file:" + configPath ) ; Map < String , RequestHandler > beans = currentContext . getBeansOfType ( RequestHandler . class , false , false ) ; return new RequestMapper ( beans . values ( ) , servletContext...
public class SraReader { /** * Read a run set from the specified file . * @ param file file , must not be null * @ return a run set read from the specified file * @ throws IOException if an I / O error occurs */ public static RunSet readRunSet ( final File file ) throws IOException { } }
checkNotNull ( file ) ; try ( BufferedReader reader = new BufferedReader ( new FileReader ( file ) ) ) { return readRunSet ( reader ) ; }
public class WCOutputStream { /** * @ see javax . servlet . ServletOutputStream # print ( double ) */ public void print ( double d ) throws IOException { } }
String value = Double . toString ( d ) ; this . output . write ( value . getBytes ( ) , 0 , value . length ( ) ) ;
public class BosClient { /** * Deletes the specified bucket . All objects in the bucket must be deleted before the bucket itself * can be deleted . * Only the owner of a bucket can delete it , regardless of the bucket ' s access control policy . * @ param request The request object containing all options for dele...
checkNotNull ( request , "request should not be null." ) ; this . invokeHttpClient ( this . createRequest ( request , HttpMethodName . DELETE ) , BosResponse . class ) ;
public class forwardingsession { /** * Use this API to add forwardingsession . */ public static base_response add ( nitro_service client , forwardingsession resource ) throws Exception { } }
forwardingsession addresource = new forwardingsession ( ) ; addresource . name = resource . name ; addresource . network = resource . network ; addresource . netmask = resource . netmask ; addresource . acl6name = resource . acl6name ; addresource . aclname = resource . aclname ; addresource . connfailover = resource ....
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link LowlimitType } { @ code > } } */ @ XmlElementDecl ( namespace = "http://www.w3.org/1998/Math/MathML" , name = "lowlimit" ) public JAXBElement < LowlimitType > createLowlimit ( LowlimitType value ) { } }
return new JAXBElement < LowlimitType > ( _Lowlimit_QNAME , LowlimitType . class , null , value ) ;
public class Camera { /** * Draw the camera field of view according to a grid . * @ param g The graphic output . * @ param x The horizontal location . * @ param y The vertical location . * @ param gridH The horizontal grid . * @ param gridV The vertical grid . * @ param surface The surface referential ( min...
final int h = x + ( int ) Math . floor ( ( getX ( ) + getViewX ( ) ) / gridH ) ; final int v = y + ( int ) - Math . floor ( ( getY ( ) + getHeight ( ) ) / gridV ) ; final int tileWidth = getWidth ( ) / gridH ; final int tileHeight = getHeight ( ) / gridV ; g . drawRect ( h , v + surface . getHeight ( ) , tileWidth , ti...
public class ParameterUtil { /** * Fetches the supplied parameter from the request and converts it to a date . The value of the * parameter should be a date formatted like so : 2001-12-25 . If the parameter does not exist , * null is returned . If the parameter is not a well - formed date , a data validation except...
String value = getParameter ( req , name , false ) ; if ( StringUtil . isBlank ( value ) || DATE_TEMPLATE . equalsIgnoreCase ( value ) ) { return null ; } return parseDateParameter ( value , invalidDataMessage ) ;
public class JavaHelper { /** * Removes the package from the type name from the given type */ public static String removeJavaPackageName ( String className ) { } }
int idx = className . lastIndexOf ( '.' ) ; if ( idx >= 0 ) { return className . substring ( idx + 1 ) ; } else { return className ; }
public class FilesystemContentWriter { /** * This method implements the ContentWriter interface for writing content * to a DataStore . In this case , the DataStore is a local filesystem . * The arg spaceId is the path to the destination directory . * @ param spaceId destination where arg chunk content will be wri...
AddContentResult result = writeContent ( spaceId , chunk . getChunkId ( ) , chunk , chunk . getChunkSize ( ) , properties ) ; String finalChecksum = chunk . getMD5 ( ) ; if ( chunkChecksum != null && chunk . md5Preserved ( ) ) { if ( ! chunkChecksum . equals ( finalChecksum ) ) { result . setState ( AddContentResult . ...
public class CmsLinkManager { /** * Calculates the absolute URI for the " relativeUri " with the given absolute " baseUri " as start . < p > * If " relativeUri " is already absolute , it is returned unchanged . * This method also returns " relativeUri " unchanged if it is not well - formed . < p > * @ param relat...
if ( isAbsoluteUri ( relativeUri ) ) { // URI is null or already absolute return relativeUri ; } try { URL url = new URL ( new URL ( m_baseUrl , baseUri ) , relativeUri ) ; StringBuffer result = new StringBuffer ( 100 ) ; result . append ( url . getPath ( ) ) ; if ( url . getQuery ( ) != null ) { result . append ( '?' ...
public class TorqueModelDef { /** * Generates a column for the given field and adds it to the table . * @ param fieldDef The field * @ param tableDef The table * @ return The column def */ private ColumnDef addColumnFor ( FieldDescriptorDef fieldDef , TableDef tableDef ) { } }
String name = fieldDef . getProperty ( PropertyHelper . OJB_PROPERTY_COLUMN ) ; ColumnDef columnDef = tableDef . getColumn ( name ) ; if ( columnDef == null ) { columnDef = new ColumnDef ( name ) ; tableDef . addColumn ( columnDef ) ; } if ( ! fieldDef . isNested ( ) ) { columnDef . setProperty ( PropertyHelper . TORQU...
public class ModuleWriterImpl { /** * Get the module header . * @ param heading the heading for the section */ @ Override public Content getModuleHeader ( String heading ) { } }
HtmlTree bodyTree = getBody ( true , getWindowTitle ( mdle . getQualifiedName ( ) . toString ( ) ) ) ; HtmlTree htmlTree = ( configuration . allowTag ( HtmlTag . HEADER ) ) ? HtmlTree . HEADER ( ) : bodyTree ; addTop ( htmlTree ) ; addNavLinks ( true , htmlTree ) ; if ( configuration . allowTag ( HtmlTag . HEADER ) ) {...
public class CommerceShippingFixedOptionLocalServiceBaseImpl { /** * Returns a range of all the commerce shipping fixed options . * Useful when paginating results . Returns a maximum of < code > end - start < / code > instances . < code > start < / code > and < code > end < / code > are not primary keys , they are in...
return commerceShippingFixedOptionPersistence . findAll ( start , end ) ;
public class AbstractFax4JClientSpi { /** * This function polls the new statues for the provided fax jobs . * @ param faxJobs * The fax jobs to poll * @ return The fax job statues */ protected FaxJobStatus [ ] pollForFaxJobStatuesImpl ( FaxJob [ ] faxJobs ) { } }
// get amount int amount = faxJobs . length ; // init array FaxJobStatus [ ] faxJobStatuses = new FaxJobStatus [ amount ] ; FaxJob faxJob = null ; FaxJobStatus faxJobStatus = null ; for ( int index = 0 ; index < amount ; index ++ ) { // get next fax job faxJob = faxJobs [ index ] ; // set default faxJobStatus = FaxJobS...
public class SiteMap { /** * Find the closest parent for the uri - no new nodes will be created */ public synchronized SiteNode findClosestParent ( URI uri ) { } }
if ( uri == null ) { return null ; } SiteNode lastParent = null ; SiteNode parent = getRoot ( ) ; String folder = "" ; try { String host = getHostName ( uri ) ; // no host yet parent = findChild ( parent , host ) ; if ( parent == null ) { return null ; } lastParent = parent ; List < String > path = model . getSession (...
public class Restful { /** * Gets the next step ( element ) to be executed on the model . An element can * be either a vertex or an edge , * @ return The label of the next step as a plain or a JSON formatted string . If the label is empty or * non - existent , the label of the step is an empty string . */ @ GET @...
logger . debug ( "Received getNext" ) ; JSONObject resultJson ; try { machine . getNextStep ( ) ; resultJson = Util . getStepAsJSON ( machine , verbose , unvisited ) ; resultJson . put ( "result" , "ok" ) ; } catch ( Exception e ) { resultJson = new JSONObject ( ) ; resultJson . put ( "result" , "nok" ) ; resultJson . ...
public class DefaultTableModel { /** * Adds a new column definition to the table */ public void addColumn ( DefaultTableColumn column ) { } }
column . setModelIndex ( columnModel . getColumnCount ( ) ) ; columnModel . addColumn ( column ) ;
public class DefaultGroovyMethods { /** * Avoids doing unnecessary work when sorting an already sorted set * @ param self an already sorted set * @ return an ordered copy of the sorted set * @ since 2.4.0 */ public static < T > Set < T > toSorted ( SortedSet < T > self ) { } }
return new LinkedHashSet < T > ( self ) ;
public class AbstractRStarTreeNode { /** * Reads the id of this node , the numEntries and the entries array from the * specified stream . * @ param in the stream to read data from in order to restore the object * @ throws java . io . IOException if I / O errors occur * @ throws ClassNotFoundException If the cla...
super . readExternal ( in ) ; // TODO : do we need to write / read the capacity ? final int capacity = in . readInt ( ) ; if ( isLeaf ( ) ) { entries = ( E [ ] ) new SpatialPointLeafEntry [ capacity ] ; for ( int i = 0 ; i < numEntries ; i ++ ) { SpatialPointLeafEntry s = new SpatialPointLeafEntry ( ) ; s . readExterna...
public class GeneratedDOAuth2UserDaoImpl { /** * query - by method for field updatedBy * @ param updatedBy the specified attribute * @ return an Iterable of DOAuth2Users for the specified updatedBy */ public Iterable < DOAuth2User > queryByUpdatedBy ( java . lang . String updatedBy ) { } }
return queryByField ( null , DOAuth2UserMapper . Field . UPDATEDBY . getFieldName ( ) , updatedBy ) ;
public class AmazonHttpClient { /** * Shuts down this HTTP client object , releasing any resources that might be held open . This is * an optional method , and callers are not expected to call it , but can if they want to * explicitly release any open resources . Once a client has been shutdown , it cannot be used ...
clientExecutionTimer . shutdown ( ) ; httpRequestTimer . shutdown ( ) ; IdleConnectionReaper . removeConnectionManager ( httpClient . getHttpClientConnectionManager ( ) ) ; httpClient . getHttpClientConnectionManager ( ) . shutdown ( ) ;
public class Streams { /** * Fills ' dst ' with bytes from ' in ' , throwing EOFException if insufficient bytes are available . */ public static void readFully ( InputStream in , byte [ ] dst ) throws IOException { } }
readFully ( in , dst , 0 , dst . length ) ;
public class XMLOutputter { /** * Returns a copy of the element stack . The returned array will be a new * array . The size of the array will be equal to the element stack size * ( see { @ link # getElementStackSize ( ) } . * @ return a newly constructed array that contains all the element types * currently on ...
if ( _elementStackSize == 0 ) { return null ; } else { String [ ] newStack = new String [ _elementStackSize ] ; System . arraycopy ( _elementStack , 0 , newStack , 0 , _elementStackSize ) ; return newStack ; }
public class Common { /** * Serialize the given object into the given stream */ public static void serialize ( Serializable obj , ByteArrayOutputStream bout ) { } }
try { ObjectOutputStream out = new ObjectOutputStream ( bout ) ; out . writeObject ( obj ) ; out . close ( ) ; } catch ( IOException e ) { throw new IllegalStateException ( "Could not serialize " + obj , e ) ; }
public class ConfigurationBuilder { /** * add class loader , might be used for resolving methods / fields */ public ConfigurationBuilder addClassLoaders ( Collection < ClassLoader > classLoaders ) { } }
return addClassLoaders ( classLoaders . toArray ( new ClassLoader [ classLoaders . size ( ) ] ) ) ;
public class BloatedAssignmentScope { /** * creates a scope block to describe this branch location . * @ param seen * the currently parsed opcode * @ param pc * the current program counter */ private void sawBranch ( int seen , int pc ) { } }
int target = getBranchTarget ( ) ; if ( target > pc ) { if ( ( seen == Const . GOTO ) || ( seen == Const . GOTO_W ) ) { int nextPC = getNextPC ( ) ; if ( ! switchTargets . get ( nextPC ) ) { ScopeBlock sb = findScopeBlockWithTarget ( rootScopeBlock , pc , nextPC ) ; if ( sb == null ) { sb = new ScopeBlock ( pc , target...
public class JSON { /** * Encodes a object into a JSON string . * @ param source A object to encode . * @ return A JSON string . */ public String encode ( Object source ) { } }
return net . arnx . jsonic . JSON . encode ( source , true ) ;
public class FactoryKernel { /** * Create an integer table convolution kernel . All the elements are equal to one . * See { @ link boofcv . alg . filter . convolve . ConvolveImageBox } for faster ways to convolve these kernels . * @ param radius kernel ' s radius . * @ return table kernel . */ public static Kerne...
Kernel1D_S32 ret = new Kernel1D_S32 ( radius * 2 + 1 ) ; for ( int i = 0 ; i < ret . data . length ; i ++ ) { ret . data [ i ] = 1 ; } return ret ;
public class SiteTool { /** * Fixes the Failsafe report page . * @ param root * root element for the report page to fix */ private final void fixReportFailsafe ( final Element root ) { } }
final Collection < Element > elements ; // Found elements final Element heading ; // First h2 heading elements = root . getElementsByTag ( "h2" ) ; if ( ! elements . isEmpty ( ) ) { heading = elements . iterator ( ) . next ( ) ; heading . tagName ( "h1" ) ; heading . text ( "Failsafe Report" ) ; }
public class AccReplicatedSessionDataFactory { /** * ( non - Javadoc ) * @ see org . jdiameter . common . api . app . IAppSessionDataFactory # getAppSessionData ( java . lang . Class , java . lang . String ) */ @ Override public IAccSessionData getAppSessionData ( Class < ? extends AppSession > clazz , String session...
if ( clazz . equals ( ClientAccSession . class ) ) { ClientAccSessionDataReplicatedImpl data = new ClientAccSessionDataReplicatedImpl ( sessionId , this . mobicentsCluster , this . replicatedSessionDataSource . getContainer ( ) ) ; return data ; } else if ( clazz . equals ( ServerAccSession . class ) ) { ServerAccSessi...
public class ServiceApiWrapper { /** * Returns observable to remove list of participants from a conversation . * @ param token Comapi access token . * @ param conversationId ID of a conversation to delete . * @ param ids List of participant ids to be removed . * @ return Observable to remove list of participant...
return wrapObservable ( service . deleteParticipants ( AuthManager . addAuthPrefix ( token ) , apiSpaceId , conversationId , ids ) . map ( mapToComapiResult ( ) ) , log , "Removing participants from " + conversationId ) ;
public class ZipFileArtifactNotifier { /** * Notification API : Remove all registrations of a listener . * See { @ link ArtifactNotifier # removeListener ( ArtifactListener ) } . * @ param listenerToRemove The listener which is to be removed . * @ return True or false telling if removal of the listener * caused...
synchronized ( listenersLock ) { ArtifactListenerSelector listenerSelectorToRemove = new ArtifactListenerSelector ( listenerToRemove ) ; List < String > pathsToRemove = new ArrayList < String > ( 1 ) ; for ( Map . Entry < String , Collection < ArtifactListenerSelector > > listenersEntry : listeners . entrySet ( ) ) { f...
public class SynonymsEntry { /** * add a new synonyms word * and the newly added word will extends the part of speech and the entity * from the base word if there are not set * @ param word */ public void add ( IWord word ) { } }
// check and extends the entity from the base word if ( word . getEntity ( ) == null ) { word . setEntity ( rootWord . getEntity ( ) ) ; } // check and extends the part of speech from the base word if ( word . getPartSpeech ( ) == null ) { word . setPartSpeech ( rootWord . getPartSpeech ( ) ) ; } word . setSyn ( this )...
public class AWSMediaConnectClient { /** * Displays the details of a flow . The response includes the flow ARN , name , and Availability Zone , as well as * details about the source , outputs , and entitlements . * @ param describeFlowRequest * @ return Result of the DescribeFlow operation returned by the service...
request = beforeClientExecution ( request ) ; return executeDescribeFlow ( request ) ;
public class AbstractTaggingProcessor { /** * Tags the item adding the new field with the specified values . * @ param item * @ param values */ protected void addNewField ( Item item , String values ) { } }
if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Tagging item with field: " + newField + " and value: " + values ) ; } Document document = item . getDescriptorDom ( ) ; if ( document != null ) { Element root = document . getRootElement ( ) ; if ( root != null ) { for ( String value : values . split ( "," ) ) { El...
public class IdentityMatMulStart { /** * Generate a matrix with random values . * @ param nRows number of matrix ' s rows . * @ param nColumns number of matrix ' s columns . * @ return Matrix that consists of random values . */ private Matrix < Double > generateRandomMatrix ( final int nRows , final int nColumns ...
final List < List < Double > > rows = new ArrayList < > ( nRows ) ; final Random random = new Random ( ) ; for ( int i = 0 ; i < nRows ; i ++ ) { final List < Double > row = new ArrayList < > ( nColumns ) ; for ( int j = 0 ; j < nColumns ; j ++ ) { row . add ( random . nextDouble ( ) ) ; } rows . add ( row ) ; } return...
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link BigInteger } { @ code > } * @ param value * Java instance representing xml element ' s value . * @ return * the new instance of { @ link JAXBElement } { @ code < } { @ link BigInteger } { @ code > } */ @ XmlEle...
return new JAXBElement < BigInteger > ( _MinimumOccurs_QNAME , BigInteger . class , null , value ) ;
public class SQLEnum { /** * Hay un problema se puede llamar a este metodo antes de cargar la clase hija por lo que habria un proiblema * @ param clazz * @ param value * @ return */ protected static SQLEnum value ( Class < ? extends SQLEnum > clazz , String value ) { } }
if ( value == null ) { return null ; } value = value . trim ( ) ; if ( valuesCache . containsKey ( clazz ) ) { Map < String , SQLEnum > map2 = valuesCache . get ( clazz ) ; if ( map2 . containsKey ( value ) ) { return map2 . get ( value ) ; } } return null ;
public class PrometheusController { /** * CHECKSTYLE : OFF */ private void reportOnCacheInformations ( ) { } }
// NOPMD // CHECKSTYLE : ON final List < CacheInformations > cacheInformationsList = javaInformations . getCacheInformationsList ( ) ; final Map < String , CacheInformations > cacheInfos = new LinkedHashMap < String , CacheInformations > ( cacheInformationsList . size ( ) ) ; for ( final CacheInformations cacheInfo : c...
public class NetServerEnumIterator { /** * { @ inheritDoc } * @ see java . util . Iterator # next ( ) */ @ Override public FileEntry next ( ) { } }
FileEntry n = this . next ; try { FileEntry ne = advance ( ) ; if ( ne == null ) { doClose ( ) ; return n ; } this . next = ne ; } catch ( CIFSException e ) { log . warn ( "Enumeration failed" , e ) ; this . next = null ; } return n ;
public class StringUtil { /** * < code > true < / code > is returned if the specified < code > str < / code > only * includes characters ( ' 0 ' ~ ' 9 ' , ' - ' , ' + ' ) . * < code > false < / code > is return if the specified String is null / empty , or contains empty chars . * " - 123 " = > true * " + 123 " ...
if ( N . isNullOrEmpty ( str ) ) { return false ; } final char [ ] chs = getCharsForReadOnly ( str ) ; int i = 0 , num = 0 ; if ( chs [ i ] == '+' || chs [ i ] == '-' ) { i ++ ; } for ( ; i < chs . length && ( chs [ i ] >= '0' && chs [ i ] <= '9' ) ; i ++ ) { num ++ ; } if ( num == 0 ) { return false ; } return i == ch...
public class AmazonCloudFormationWaiters { /** * Builds a StackUpdateComplete waiter by using custom parameters waiterParameters and other parameters defined in * the waiters specification , and then polls until it determines whether the resource entered the desired state or * not , where polling criteria is bound ...
return new WaiterBuilder < DescribeStacksRequest , DescribeStacksResult > ( ) . withSdkFunction ( new DescribeStacksFunction ( client ) ) . withAcceptors ( new StackUpdateComplete . IsUPDATE_COMPLETEMatcher ( ) , new StackUpdateComplete . IsUPDATE_FAILEDMatcher ( ) , new StackUpdateComplete . IsUPDATE_ROLLBACK_FAILEDMa...
public class ManagementClientAsync { /** * Checks whether a given queue exists or not . * @ param path - Path of the entity to check * @ return - True if the entity exists . False otherwise . * @ throws IllegalArgumentException - path is not null / empty / too long / invalid . */ public CompletableFuture < Boolea...
EntityNameHelper . checkValidQueueName ( path ) ; CompletableFuture < Boolean > existsFuture = new CompletableFuture < > ( ) ; this . getQueueAsync ( path ) . handleAsync ( ( qd , ex ) -> { if ( ex != null ) { if ( ex instanceof MessagingEntityNotFoundException ) { existsFuture . complete ( Boolean . FALSE ) ; return f...
public class BlackBoxExplanationGenerator { /** * This is a recursive method that builds a hitting set tree to obtain all * justifications for an unsatisfiable class . * @ param justification The current justification for the current entailment . This * corresponds to a node in the hitting set tree . * @ param ...
// dumpHSTNodeDiagnostics ( entailment , justification , allJustifications , currentPathContents ) ; // We go through the current justifications , checker by checker , and extend the tree // with edges for each checker List < OWLAxiom > orderedJustification = getOrderedJustifications ( new ArrayList < OWLAxiom > ( just...
public class VdmModel { /** * ( non - Javadoc ) * @ see org . overture . ide . core . ast . IVdmElement # isParseCorrect ( ) */ public synchronized boolean isParseCorrect ( ) { } }
boolean isParseCorrect = true ; for ( IVdmSourceUnit source : vdmSourceUnits ) { if ( source . hasParseErrors ( ) ) { isParseCorrect = false ; break ; } } return isParseCorrect ;
public class FourierTransform { /** * Computes the circular convolution of the given real vectors . Each vector ' s length must be the same . */ private static void convolve ( double [ ] x , double [ ] y , double [ ] out ) { } }
// if ( x . length ! = y . length | | x . length ! = out . length ) // throw new IllegalArgumentException ( " Mismatched lengths " ) ; int n = x . length ; convolve ( x , new double [ n ] , y , new double [ n ] , out , new double [ n ] ) ;
public class PhotosInterface { /** * Returns the list of people who have favorited a given photo . * This method does not require authentication . * @ param photoId * @ param perPage * @ param page * @ return List of { @ link com . flickr4java . flickr . people . User } */ public Collection < User > getFavori...
Map < String , Object > parameters = new HashMap < String , Object > ( ) ; parameters . put ( "method" , METHOD_GET_FAVORITES ) ; parameters . put ( "photo_id" , photoId ) ; if ( perPage > 0 ) { parameters . put ( "per_page" , Integer . toString ( perPage ) ) ; } if ( page > 0 ) { parameters . put ( "page" , Integer . ...
public class CmsSecurityManager { /** * Performs a blocking permission check on a resource . < p > * If the required permissions are not satisfied by the permissions the user has on the resource , * an exception is thrown . < p > * @ param dbc the current database context * @ param resource the resource on whic...
// get the permissions I_CmsPermissionHandler . CmsPermissionCheckResult permissions = hasPermissions ( dbc , resource , requiredPermissions , checkLock , filter ) ; if ( ! permissions . isAllowed ( ) ) { checkPermissions ( dbc . getRequestContext ( ) , resource , requiredPermissions , permissions ) ; }
public class AbstractMappableValidator { /** * Disposes all triggers and data providers that are mapped to each other . */ private void disposeTriggersAndDataProviders ( ) { } }
for ( final Map . Entry < T , List < DP > > entry : triggersToDataProviders . entrySet ( ) ) { // Disconnect from trigger unhookFromTrigger ( entry . getKey ( ) ) ; // Dispose trigger itself final T trigger = entry . getKey ( ) ; if ( trigger instanceof Disposable ) { ( ( Disposable ) trigger ) . dispose ( ) ; } // Dis...
public class Job { /** * Get or create FileInfo for given path . * @ param file relative URI to temporary directory * @ return created or existing file info object */ public FileInfo getOrCreateFileInfo ( final URI file ) { } }
assert file . getFragment ( ) == null ; URI f = file . normalize ( ) ; if ( f . isAbsolute ( ) ) { f = tempDirURI . relativize ( f ) ; } FileInfo i = getFileInfo ( file ) ; if ( i == null ) { i = new FileInfo ( f ) ; add ( i ) ; } return i ;
public class TwoPhaseCommitSinkFunction { /** * This method must be the only place to call { @ link # recoverAndCommit ( Object ) } to ensure that * the configuration parameters { @ link # transactionTimeout } and * { @ link # ignoreFailuresAfterTransactionTimeout } are respected . */ private void recoverAndCommitI...
try { logWarningIfTimeoutAlmostReached ( transactionHolder ) ; recoverAndCommit ( transactionHolder . handle ) ; } catch ( final Exception e ) { final long elapsedTime = clock . millis ( ) - transactionHolder . transactionStartTime ; if ( ignoreFailuresAfterTransactionTimeout && elapsedTime > transactionTimeout ) { LOG...
public class Group { /** * Reduce the group set by eliminating redundant elements . These * transformations applied are : * ( ( a & b ) | b ) = > b * ( ( a | b ) & b ) = > b */ void reduce ( ) { } }
// Note that the scanner choice is opposite of our type . This is // because a group of ' and ' s has children which are ' or ' s and vice // versa . Scanner < S > scanner = mForAnd ? OrChildScanner . THE : AndChildScanner . THE ; Iterator < Filter < S > > it = mElements . iterator ( ) ; aLoop : while ( it . hasNext ( ...
public class TaskTable { /** * 如果时间匹配则执行相应的Task , 无锁 * @ param millis 时间毫秒 * @ since 3.1.1 */ protected void executeTaskIfMatchInternal ( long millis ) { } }
for ( int i = 0 ; i < size ; i ++ ) { if ( patterns . get ( i ) . match ( timezone , millis , this . scheduler . matchSecond ) ) { this . scheduler . taskExecutorManager . spawnExecutor ( tasks . get ( i ) ) ; } }