signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class Topic { /** * Gets all change - patchset pairs related to this topic . * After first call data is cached . * @ param gerritQueryHandler the query handler , responsible for the queries to gerrit . * @ return the map of pairs change - patchset related to this topic . */ public Map < Change , PatchSet >...
if ( StringUtils . isEmpty ( name ) ) { logger . error ( "Topic name can not be empty" ) ; return Collections . emptyMap ( ) ; } if ( changes == null ) { Map < Change , PatchSet > temp = new HashMap < Change , PatchSet > ( ) ; try { List < JSONObject > jsonList = gerritQueryHandler . queryCurrentPatchSets ( "topic:{" +...
public class MongodbClientOpsDemo { /** * 分页 */ private static void findPage ( ) { } }
MongoCollection < Person > collection = Mongo . getCollection ( "dianping-collection" , Person . class ) ; Mongo . Page < Person > page = Mongo . findPageByPageNumber ( collection , gt ( "age" , 0 ) , 1 , 10 ) ; System . out . println ( page ) ;
public class RAExpression { /** * CROSS JOIN ( also denoted by , in SQL ) * @ param re1 a { @ link RAExpression } * @ param re2 a { @ link RAExpression } * @ return a { @ link RAExpression } * @ throws IllegalJoinException if the same alias occurs in both arguments */ public static RAExpression crossJoin ( RAEx...
RAExpressionAttributes attributes = RAExpressionAttributes . crossJoin ( re1 . attributes , re2 . attributes ) ; return new RAExpression ( union ( re1 . dataAtoms , re2 . dataAtoms ) , union ( re1 . filterAtoms , re2 . filterAtoms ) , attributes , termFactory ) ;
public class AbstractDataEditorWidget { /** * Set the local text filter field value * @ param queryString filterText . */ public void setSearchString ( String queryString ) { } }
this . searchString = queryString ; if ( this . textFilterField != null ) { this . textFilterField . setText ( this . searchString ) ; }
public class AttributeVector { /** * Returns statistic summary . */ public AttributeVector summary ( ) { } }
Attribute attr = new NumericAttribute ( attribute . getName ( ) + " Summary" ) ; String [ ] names = { "min" , "q1" , "median" , "mean" , "q3" , "max" } ; double [ ] stat = new double [ 6 ] ; stat [ 0 ] = Math . min ( vector ) ; stat [ 1 ] = Math . q1 ( vector ) ; stat [ 2 ] = Math . median ( vector ) ; stat [ 3 ] = Mat...
public class AWSSecurityHubClient { /** * Updates the AWS Security Hub - aggregated findings specified by the filter attributes . * @ param updateFindingsRequest * @ return Result of the UpdateFindings operation returned by the service . * @ throws InternalException * Internal server error . * @ throws Invali...
request = beforeClientExecution ( request ) ; return executeUpdateFindings ( request ) ;
public class InfoList { /** * Get the names of all items in this list , by calling { @ code getName ( ) } on each item in the list . * @ return The names of all items in this list , by calling { @ code getName ( ) } on each item in the list . */ public List < String > getNames ( ) { } }
if ( this . isEmpty ( ) ) { return Collections . emptyList ( ) ; } else { final List < String > names = new ArrayList < > ( this . size ( ) ) ; for ( final T i : this ) { names . add ( i . getName ( ) ) ; } return names ; }
public class Dependency { /** * Get the unmodifiable list of vulnerabilities ; optionally sorted . * @ param sorted if true the list will be sorted * @ return the unmodifiable list set of vulnerabilities */ public synchronized Set < Vulnerability > getVulnerabilities ( boolean sorted ) { } }
final Set < Vulnerability > vulnerabilitySet ; if ( sorted ) { vulnerabilitySet = new TreeSet < > ( vulnerabilities ) ; } else { vulnerabilitySet = vulnerabilities ; } return Collections . unmodifiableSet ( vulnerabilitySet ) ;
public class AbstractNpmAnalyzer { /** * Construct a dependency object . * @ param dependency the parent dependency * @ param name the name of the dependency to create * @ param version the version of the dependency to create * @ param scope the scope of the dependency being created * @ return the generated d...
final Dependency nodeModule = new Dependency ( new File ( dependency . getActualFile ( ) + "?" + name ) , true ) ; nodeModule . setEcosystem ( NPM_DEPENDENCY_ECOSYSTEM ) ; // this is virtual - the sha1 is purely for the hyperlink in the final html report nodeModule . setSha1sum ( Checksum . getSHA1Checksum ( String . f...
public class LocalDateTime { /** * Returns a copy of this datetime minus the specified number of millis . * This LocalDateTime instance is immutable and unaffected by this method call . * The following three lines are identical in effect : * < pre > * LocalDateTime subtracted = dt . minusMillis ( 6 ) ; * Loca...
if ( millis == 0 ) { return this ; } long instant = getChronology ( ) . millis ( ) . subtract ( getLocalMillis ( ) , millis ) ; return withLocalMillis ( instant ) ;
public class SleUtility { /** * This method will take a SyndFeed object with a SimpleListExtension on it and populate the * entries with current SleEntry values for sorting and grouping . < b > NB < / b > : This basically does * this by re - generating the XML for all the entries then re - parsing them into the SLE...
// TODO : the null parameter below will break delegating parsers and generators // final ModuleGenerators g = new ModuleGenerators ( feed . getFeedType ( ) + // ITEM _ MODULE _ GENERATORS _ POSFIX _ KEY , null ) ; final SyndFeedOutput output = new SyndFeedOutput ( ) ; final Document document = output . outputJDom ( fee...
public class CmsPathTree { /** * Sets the value for the sub - path given , starting from this node . < p > * @ param path the path * @ param value the value to set */ public void setValue ( List < P > path , V value ) { } }
ensureNode ( path ) . setValue ( value ) ;
public class ClosureRewriteModule { /** * Record the provided script as the current script at top of the script stack and add it as a * child of the previous current script if there was one . * < p > Keeping track of the current script facilitates aggregation of accurate script state so that * rewriting can run p...
currentScript = newCurrentScript ; if ( ! scriptStack . isEmpty ( ) ) { ScriptDescription parentScript = scriptStack . peek ( ) ; parentScript . addChildScript ( currentScript ) ; } scriptStack . addFirst ( currentScript ) ;
public class ReflectUtil { /** * 获取指定对象中指定字段名对应的字段的值 * @ param obj 对象 , 如果要获取的字段是静态字段那么需要传入Class * @ param fieldName 字段名 * @ param < T > 字段类型 * @ return 指定对象中指定字段名对应字段的值 */ public static < T extends Object > T getFieldValue ( Object obj , String fieldName ) { } }
Assert . notNull ( obj , "obj不能为空" ) ; Assert . notNull ( fieldName , "fieldName不能为空" ) ; Field field ; if ( obj instanceof Class ) { field = getField ( ( Class ) obj , fieldName ) ; } else { field = getField ( obj . getClass ( ) , fieldName ) ; } return getFieldValue ( obj , field ) ;
public class KnowledgeJtaPlatform { /** * { @ inheritDoc } */ @ Override protected UserTransaction locateUserTransaction ( ) { } }
try { return TransactionManagerLocator . INSTANCE . getUserTransaction ( ) ; } catch ( Exception e ) { throw new HibernateException ( e ) ; }
public class FactoryBackgroundModel { /** * Creates an instance of { @ link BackgroundMovingBasic } . * @ param config Configures the background model * @ param imageType Type of input image * @ return new instance of the background model */ public static < T extends ImageBase < T > , Motion extends InvertibleTra...
config . checkValidity ( ) ; BackgroundMovingBasic < T , Motion > ret ; switch ( imageType . getFamily ( ) ) { case GRAY : ret = new BackgroundMovingBasic_SB ( config . learnRate , config . threshold , transform , config . interpolation , imageType . getImageClass ( ) ) ; break ; case PLANAR : ret = new BackgroundMovin...
public class AbstractGauge { /** * Sets the buffered image that represents the custom layer . * It will automaticaly scale the given image to the bounds . * The custom layer ( which is a buffered image ) will be * drawn on the background of the gauge and could be used * to display logos or icons . * @ param C...
if ( CUSTOM_LAYER == null ) { model . setCustomLayerVisible ( false ) ; return ; } model . setCustomLayer ( CUSTOM_LAYER ) ; if ( model . isCustomLayerVisible ( ) ) { reInitialize ( ) ; }
public class EvernoteUtil { /** * Returns an MD5 checksum of the provided array of bytes . */ public static byte [ ] hash ( byte [ ] body ) { } }
if ( HASH_DIGEST != null ) { return HASH_DIGEST . digest ( body ) ; } else { throw new EvernoteUtilException ( EDAM_HASH_ALGORITHM + " not supported" , new NoSuchAlgorithmException ( EDAM_HASH_ALGORITHM ) ) ; }
public class Component { /** * Adds a metric to the set of metrics . * @ param < T > The type parameter used for the timeslice * @ param name The name of the metric * @ param timeslice The values representing the metric timeslice */ public < T > void addMetric ( String name , MetricTimeslice < T > timeslice ) { }...
metrics . put ( name , timeslice ) ;
public class Rollbar { /** * Toggle whether to include logcat output in items . * @ param includeLogcat whether or not to include logcat output . */ public void setIncludeLogcat ( final boolean includeLogcat ) { } }
final int versionCode = this . versionCode ; final String versionName = this . versionName ; this . rollbar . configure ( new ConfigProvider ( ) { @ Override public Config provide ( ConfigBuilder builder ) { ClientProvider clientProvider = new ClientProvider . Builder ( ) . versionCode ( versionCode ) . versionName ( v...
public class MessageProcessor { /** * Add an item to the Message Processor ItemStream . * @ throws SIResourceException * @ see com . ibm . ws . sib . msgstore . AbstractItem # add ( Item , Transaction ) */ public void add ( Item item , TransactionCommon transaction ) throws MessageStoreException , SIResourceExcepti...
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "add" , new Object [ ] { item , transaction } ) ; Transaction msTran = resolveAndEnlistMsgStoreTransaction ( transaction ) ; _persistentStore . addItem ( item , msTran ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc ...
public class TaskQueueImpl { /** * 取消所有的Runnable对应的任务 */ private void cancelAllInQueue ( ) { } }
if ( Config . DEBUG ) { Log . v ( TAG , "cancelAllInQueue()" ) ; } long start = SystemClock . elapsedRealtime ( ) ; final Collection < ITaskRunnable > tasks = mTasks . values ( ) ; for ( ITaskRunnable task : tasks ) { if ( task != null ) { task . cancel ( ) ; } } synchronized ( mLock ) { mTasks . clear ( ) ; mGroups . ...
public class AtomDiff { /** * Compare two { @ link IChemObject } classes and return the difference as a { @ link String } . * @ param first the first of the two classes to compare * @ param second the second of the two classes to compare * @ return a { @ link String } representation of the difference between the ...
IDifference diff = difference ( first , second ) ; if ( diff == null ) { return "" ; } else { return diff . toString ( ) ; }
public class URI { /** * Get the raw - escaped basename of the path . * @ return the raw - escaped basename */ public char [ ] getRawName ( ) { } }
if ( _path == null ) { return null ; } int at = 0 ; for ( int i = _path . length - 1 ; i >= 0 ; i -- ) { if ( _path [ i ] == '/' ) { at = i + 1 ; break ; } } int len = _path . length - at ; char [ ] basename = new char [ len ] ; System . arraycopy ( _path , at , basename , 0 , len ) ; return basename ;
public class InternalDocumentRevision { /** * < p > Returns the JSON body of the document revision as a { @ code Map } * object . < / p > * < p > This Map includes reserved fields such as { @ code _ id } and * { @ code _ rev } . Changing the byte array may affect the { @ code DocumentRevision } , * as only a sh...
Map < String , Object > map = getBody ( ) . asMap ( ) ; // add meta properties : ID , rev , deleted map . put ( "_id" , id ) ; if ( revision != null ) { map . put ( "_rev" , revision ) ; } if ( this . isDeleted ( ) ) { map . put ( "_deleted" , true ) ; } return map ;
public class CastInt { /** * Create a String expression from a Expression * @ param expr * @ return String expression * @ throws TemplateException */ public static ExprInt toExprInt ( Expression expr ) { } }
if ( expr instanceof ExprInt ) return ( ExprInt ) expr ; if ( expr instanceof Literal ) { Double dbl = ( ( Literal ) expr ) . getDouble ( null ) ; if ( dbl != null ) return expr . getFactory ( ) . createLitInteger ( ( int ) dbl . doubleValue ( ) , expr . getStart ( ) , expr . getEnd ( ) ) ; } return new CastInt ( expr ...
public class AuditEvent { /** * Set the reason keys / values . The provided Map will completely replace * the existing reason , i . e . all current reason keys / values will be removed * and the new reason keys / values will be added . * @ param reason */ public void setReason ( Map < String , Object > reason ) {...
removeEntriesStartingWith ( REASON ) ; eventMap . putAll ( reason ) ;
public class JDBC4ResultSetMetaData { /** * Retrieves the designated column ' s database - specific type name . */ public String getColumnTypeName ( int column ) throws SQLException { } }
sourceResultSet . checkColumnBounds ( column ) ; VoltType type = sourceResultSet . table . getColumnType ( column - 1 ) ; String result = type . toSQLString ( ) . toUpperCase ( ) ; if ( result == null ) { // Types unknown to JDBC will return null , no other good // answer to give throw SQLError . get ( SQLError . TRANS...
public class ReportBuilder { /** * Parses provided files and generates the report . When generating process fails * report with information about error is provided . * @ return stats for the generated report */ public Reportable generateReports ( ) { } }
Trends trends = null ; try { // first copy static resources so ErrorPage is displayed properly copyStaticResources ( ) ; // create directory for embeddings before files are generated createEmbeddingsDirectory ( ) ; // add metadata info sourced from files reportParser . parseClassificationsFiles ( configuration . getCla...
public class BFS { /** * Labels equivalent nodes recursively . * @ param node Node to label equivalents * @ param up Traversing direction . Up means towards parents , if false then towards children * @ param dist The label * @ param enqueue Whether to enqueue equivalents * @ param head Where to enqueue . Head...
if ( node == null ) { LOG . error ( "labelEquivRecursive: null (Node)" ) ; return ; } for ( Node equiv : up ? node . getUpperEquivalent ( ) : node . getLowerEquivalent ( ) ) { if ( getColor ( equiv ) == WHITE ) { setLabel ( equiv , dist ) ; if ( enqueue ) { setColor ( equiv , GRAY ) ; if ( head ) queue . addFirst ( equ...
public class FXML { /** * { @ inheritDoc } */ @ Override public String getBundlePath ( ) { } }
final StringBuilder sb = new StringBuilder ( ) ; if ( bundleName ( ) . isEmpty ( ) ) { // Get the fxml path to build the bundle one sb . append ( getFxmlPath ( ) ) ; } else { if ( ! absoluteBundlePath ( ) . isEmpty ( ) ) { sb . append ( absoluteBundlePath ( ) ) . append ( Resources . PATH_SEP ) ; } sb . append ( bundle...
public class JsJmsMessageFactoryImpl { /** * Create a new , empty JMS StreamMessage . * To be called by the API component . * @ return The new JsJmsStreamMessage * @ exception MessageCreateFailedException Thrown if such a message can not be created */ public JsJmsStreamMessage createJmsStreamMessage ( ) throws Me...
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "createJmsStreamMessage" ) ; JsJmsStreamMessage msg = null ; try { msg = new JsJmsStreamMessageImpl ( MfpConstants . CONSTRUCTOR_NO_OP ) ; } catch ( MessageDecodeFailedException e ) { /* No need to FFDC this as JsMsgObject w...
public class Router { /** * Will match a restful route . * @ param uri request URI * @ param controllerPathObject contains controller name and package * @ param method http method of a request . * @ return instance of a < code > Route < / code > if one is found , null if not . */ private Route matchRestful ( St...
String theUri = uri . endsWith ( "/" ) ? uri . substring ( 0 , uri . length ( ) - 1 ) : uri ; String controllerPath = ( controllerPathObject . getControllerPackage ( ) != null ? "/" + controllerPathObject . getControllerPackage ( ) . replace ( "." , "/" ) : "" ) + "/" + controllerPathObject . getControllerName ( ) ; St...
public class BaseUnitConverter { /** * Temperature conversions . */ private static UnitValue temperature ( UnitValue value , Unit target ) { } }
BigDecimal n = value . amount ( ) ; if ( target == Unit . TEMPERATURE_GENERIC ) { return new UnitValue ( n , Unit . TEMPERATURE_GENERIC ) ; } switch ( value . unit ( ) ) { case FAHRENHEIT : if ( target == Unit . CELSIUS ) { n = n . subtract ( THIRTY_TWO ) ; n = new Rational ( n , BigDecimal . ONE ) . multiply ( FIVE_NI...
public class JavaLexer { /** * $ ANTLR start " LINE _ COMMENT " */ public final void mLINE_COMMENT ( ) throws RecognitionException { } }
try { int _type = LINE_COMMENT ; int _channel = DEFAULT_TOKEN_CHANNEL ; // src / main / resources / org / drools / compiler / semantics / java / parser / Java . g : 1403:5 : ( ' / / ' ( ~ ( ' \ \ n ' | ' \ \ r ' ) ) * ( ' \ \ r ' ) ? ' \ \ n ' ) // src / main / resources / org / drools / compiler / semantics / java / p...
public class DatastoreEmulator { /** * Send an empty request using a standard HTTP connection . */ private void sendEmptyRequest ( String path , String method ) throws DatastoreEmulatorException { } }
HttpURLConnection connection = null ; try { URL url = new URL ( this . host + path ) ; connection = ( HttpURLConnection ) url . openConnection ( ) ; connection . setDoOutput ( true ) ; connection . setRequestMethod ( method ) ; connection . getOutputStream ( ) . close ( ) ; if ( connection . getResponseCode ( ) != Http...
public class ApiUtils { /** * Returns the { @ code Context } with the given name . * @ param contextName the name of the context * @ return the { @ code Context } with the given name * @ throws ApiException If the context with the given name does not exist * @ since 2.4.3 * @ see # getContextByName ( JSONObje...
Context context = Model . getSingleton ( ) . getSession ( ) . getContext ( contextName ) ; if ( context == null ) { throw new ApiException ( ApiException . Type . DOES_NOT_EXIST , contextName ) ; } return context ;
public class ControlFilter { /** * A template method for constructing clients . * < strong > Intended Usage < / strong > * Subclasses of may override this method to customize how the client get ' s built . Note that this * method is intended to be invoked by { @ link ControlFilter # init ( FilterConfig ) } when t...
return new Client . Builder ( configServiceName ) . setStatsLogFrequency ( statsLogFrequency ( ) ) . setHttpTransport ( new NetHttpTransport ( ) ) . build ( ) ;
public class ConstantsSummaryBuilder { /** * Build the list of packages . * @ param node the XML element that specifies which components to document * @ param contentTree the content tree to which the content list will be added */ public void buildContents ( XMLNode node , Content contentTree ) { } }
Content contentListTree = writer . getContentsHeader ( ) ; PackageDoc [ ] packages = configuration . packages ; printedPackageHeaders = new HashSet < String > ( ) ; for ( int i = 0 ; i < packages . length ; i ++ ) { if ( hasConstantField ( packages [ i ] ) && ! hasPrintedPackageIndex ( packages [ i ] . name ( ) ) ) { w...
public class CollectionUtils { /** * Provides a { @ link com . google . common . base . Function } which will create a set containing the same * elements as the supplied collection . */ public static < T > Function < Collection < T > , ImmutableSet < T > > asSetFunction ( ) { } }
return new Function < Collection < T > , ImmutableSet < T > > ( ) { @ Override public ImmutableSet < T > apply ( Collection < T > input ) { return ImmutableSet . copyOf ( input ) ; } } ;
public class RepositoryServiceImpl { /** * - - - - - Startable - - - - - */ public ManageableRepository getRepository ( String name ) throws RepositoryException { } }
RepositoryContainer repositoryContainer = repositoryContainers . get ( name ) ; log . debug ( "RepositoryServiceimpl() getRepository " + name ) ; if ( repositoryContainer == null ) { throw new RepositoryException ( "Repository '" + name + "' not found." ) ; } return ( ManageableRepository ) repositoryContainer . getCom...
public class JFXTooltip { /** * updates the visible duration for { @ link JFXTooltip } behavior * @ param duration */ public static void setVisibleDuration ( Duration duration ) { } }
BEHAVIOR . setVisibleDuration ( duration == null ? Duration . millis ( 1500 ) : duration ) ;
public class UStats { /** * Represent this UStats as a name / value JSON structure . * @ return this data as a JSON - formatted string . */ public String toJSONString ( ) { } }
return TIME_PULLER . entrySet ( ) . stream ( ) . map ( me -> String . format ( "%s: %d" , me . getKey ( ) , me . getValue ( ) . applyAsLong ( this ) ) ) . collect ( Collectors . joining ( ", " , "{" , "}" ) ) ;
public class MemoryFileUpload { /** * Gets a { @ link java . io . File } object for this uploaded file . This file is a < strong > temporary < / strong > file . * Depending on how is handled the file upload , the file may already exist , or not ( in - memory ) and then is created . * @ return a file object * @ th...
File temp = File . createTempFile ( "wisdom-fup" , name ( ) ) ; FileUtils . writeByteArrayToFile ( temp , bytes ( ) ) ; return temp ;
public class Decompose { /** * Compute LU Decomposition of a general matrix . * Computes the LU decomposition using GETRF . Returns three matrices L , U , P , * where L is lower diagonal , U is upper diagonal , and P is a permutation * matrix such that A = P * L * U . * @ param A general matrix * @ return An ...
int [ ] ipiv = new int [ min ( A . rows , A . columns ) ] ; FloatMatrix result = A . dup ( ) ; NativeBlas . sgetrf ( A . rows , A . columns , result . data , 0 , A . rows , ipiv , 0 ) ; // collect result FloatMatrix l = new FloatMatrix ( A . rows , min ( A . rows , A . columns ) ) ; FloatMatrix u = new FloatMatrix ( mi...
public class ChorusAssert { /** * Asserts that two shorts are equal . If they are not * an AssertionFailedError is thrown with the given message . */ static public void assertEquals ( String message , short expected , short actual ) { } }
assertEquals ( message , new Short ( expected ) , new Short ( actual ) ) ;
public class AmazonAppStreamClient { /** * Updates the specified fleet . * If the fleet is in the < code > STOPPED < / code > state , you can update any attribute except the fleet name . If the * fleet is in the < code > RUNNING < / code > state , you can update the < code > DisplayName < / code > and * < code > ...
request = beforeClientExecution ( request ) ; return executeUpdateFleet ( request ) ;
public class ThumbnailThread { /** * Queue a thumbnail task in a global thumbnail thread . * @ param callback Callback */ public synchronized static Task queue ( Listener callback ) { } }
final Task task = new Task ( callback ) ; // TODO : synchronization ? if ( THREAD != null && THREAD . isAlive ( ) ) { THREAD . queue . add ( task ) ; return task ; } THREAD = new ThumbnailThread ( ) ; THREAD . queue . add ( task ) ; THREAD . start ( ) ; return task ;
public class AbstractComparator { /** * { @ inheritDoc } */ @ Override public int compare ( final Object obj1 , final Object obj2 ) { } }
Comparable < ? > comparable1 = getComparable ( obj1 ) ; Comparable < ? > comparable2 = getComparable ( obj2 ) ; return Util . compareAllowNull ( comparable1 , comparable2 ) ;
public class ModelInterceptor { /** * apply query parameters to select / fetch * < br > * ? fields = id , name , filed1 ( p1 , p2 , p3) * < br > * ? fields = ( id , name , filed1 ( p1 , p2 , p3 ) ) * @ param query query * @ param queryParams a { @ link javax . ws . rs . core . MultivaluedMap } object . */ p...
List < String > selectables = queryParams . get ( FIELDS_PARAM_NAME ) ; if ( selectables != null ) { StringBuilder selectBuilder = new StringBuilder ( ) ; OrmQueryDetail detail = ( ( SpiQuery ) query ) . getDetail ( ) ; OrmQueryProperties base = detail . getChunk ( null , false ) ; if ( base != null && StringUtils . is...
public class SimpleSipServlet { /** * { @ inheritDoc } */ protected void doBye ( SipServletRequest request ) throws ServletException , IOException { } }
if ( logger . isInfoEnabled ( ) ) { logger . info ( "SimpleProxyServlet: Got BYE request:\n" + request ) ; } SipServletResponse sipServletResponse = request . createResponse ( 200 ) ; sipServletResponse . send ( ) ; SipApplicationSession sipApplicationSession = sipServletResponse . getApplicationSession ( false ) ; if ...
public class BoxLegalHoldPolicy { /** * Returns iterable containing assignments for this single legal hold policy . * @ param fields the fields to retrieve . * @ return an iterable containing assignments for this single legal hold policy . */ public Iterable < BoxLegalHoldAssignment . Info > getAssignments ( String...
return this . getAssignments ( null , null , DEFAULT_LIMIT , fields ) ;
public class LibertyTracePreprocessInstrumentation { /** * Find the described annotation in the list of { @ code AnnotationNode } s . * @ param desc the annotation descriptor * @ param annotations the list of annotations * @ return the annotation that matches the provided descriptor or null * if no matching ann...
if ( annotations == null ) { return null ; } for ( AnnotationNode an : annotations ) { if ( desc . equals ( an . desc ) ) { return an ; } } return null ;
public class OjbMemberTagsHandler { /** * The < code > forAllMembers < / code > method iterates through all fields of the current class . In contrast to the < code > FieldTagsHandler . forAllFields < / code > * method , this method operates on both fields and accessors ( get / set / is - methods ) . In addition , the...
if ( getCurrentClass ( ) == null ) { return ; } String className = attributes . getProperty ( "class" ) ; XClass type = null ; if ( ( className == null ) || ( className . length ( ) == 0 ) ) { type = getCurrentClass ( ) ; } else { XClass curType ; for ( Iterator it = ClassTagsHandler . getAllClasses ( ) . iterator ( ) ...
public class QrCodeEncoder { /** * Creates a QR - Code which encodes data in the byte format . * @ param data Data to be encoded * @ return The QR - Code */ public QrCodeEncoder addBytes ( byte [ ] data ) { } }
StringBuilder builder = new StringBuilder ( data . length ) ; for ( int i = 0 ; i < data . length ; i ++ ) { builder . append ( ( char ) data [ i ] ) ; } MessageSegment segment = new MessageSegment ( ) ; segment . message = builder . toString ( ) ; segment . data = data ; segment . length = data . length ; segment . mo...
public class Spinner { /** * Obtains all attributes , which are defined by an { @ link android . widget . Spinner } widget , from a * specific typed array . * @ param typedArray * The typed array , the attributes should be obtained from , as an instance of the class * { @ link TypedArray } . The typed array may...
for ( int i = 0 ; i < typedArray . getIndexCount ( ) ; i ++ ) { int index = typedArray . getIndex ( i ) ; if ( index == R . styleable . Spinner_android_dropDownHorizontalOffset ) { if ( Build . VERSION . SDK_INT >= Build . VERSION_CODES . JELLY_BEAN ) { setDropDownHorizontalOffset ( typedArray . getDimensionPixelSize (...
public class SqlQueryStatement { /** * Build the tree of joins for the given criteria */ private void buildJoinTree ( Criteria crit ) { } }
Enumeration e = crit . getElements ( ) ; while ( e . hasMoreElements ( ) ) { Object o = e . nextElement ( ) ; if ( o instanceof Criteria ) { buildJoinTree ( ( Criteria ) o ) ; } else { SelectionCriteria c = ( SelectionCriteria ) o ; // BRJ skip SqlCriteria if ( c instanceof SqlCriteria ) { continue ; } // BRJ : Outer j...
public class IPv6AddressSection { /** * Produces an IPv4 address section from any sequence of bytes in this IPv6 address section * @ param startIndex the byte index in this section to start from * @ param endIndex the byte index in this section to end at * @ throws IndexOutOfBoundsException * @ return * @ see...
if ( startIndex == ( ( IPv6Address . MIXED_ORIGINAL_SEGMENT_COUNT - this . addressSegmentIndex ) << 1 ) && endIndex == ( getSegmentCount ( ) << 1 ) ) { return getEmbeddedIPv4AddressSection ( ) ; } IPv4AddressCreator creator = getIPv4Network ( ) . getAddressCreator ( ) ; IPv4AddressSegment [ ] segments = creator . creat...
public class N { /** * Returns consecutive sub lists of a collection , each of the same size ( the final list may be smaller ) . * or an empty List if the specified collection is null or empty . The order of elements in the original collection is kept * @ param c * @ param fromIndex * @ param toIndex * @ para...
checkFromToIndex ( fromIndex , toIndex , size ( c ) ) ; if ( size < 1 ) { throw new IllegalArgumentException ( "The parameter 'size' can not be zero or less than zero" ) ; } if ( N . isNullOrEmpty ( c ) ) { return new ArrayList < > ( ) ; } final int len = toIndex - fromIndex ; final List < List < T > > res = new ArrayL...
public class TileBoundingBoxUtils { /** * Get the Projected tile bounding box from the Google Maps API tile * tileGrid and zoom level * @ param authority * projection authority * @ param code * projection code * @ param tileGrid * tile grid * @ param zoom * zoom level * @ return bounding box * @ s...
BoundingBox boundingBox = getWebMercatorBoundingBox ( tileGrid , zoom ) ; if ( code != null ) { ProjectionTransform transform = webMercator . getTransformation ( authority , code ) ; boundingBox = boundingBox . transform ( transform ) ; } return boundingBox ;
public class AbstractConnectionListener { /** * { @ inheritDoc } */ public boolean addConnection ( Object c ) { } }
if ( Tracer . isEnabled ( ) ) Tracer . getConnection ( cm . getPool ( ) . getConfiguration ( ) . getId ( ) , mcp , this , c ) ; if ( connectionTraces != null ) connectionTraces . put ( c , new Exception ( ) ) ; return connectionHandles . add ( c ) ;
public class Failsafe { /** * Creates and returns a new { @ link FailsafeExecutor } instance that will handle failures according to the given { @ code * policies } . The { @ code policies } are composed around an execution and will handle execution results in reverse , with * the last policy being applied first . F...
return new FailsafeExecutor < > ( Arrays . asList ( Assert . notNull ( policies , "policies" ) ) ) ;
public class TileSystem { /** * Converts a " X01 " value into longitude * " X01 " is a double between 0 and 1 for the whole longitude range * MinLongitude : 0 . . . MaxLongitude : 1 * @ since 6.0.0 */ public double getLongitudeFromX01 ( final double pX01 , boolean wrapEnabled ) { } }
final double longitude = getLongitudeFromX01 ( wrapEnabled ? Clip ( pX01 , 0 , 1 ) : pX01 ) ; return wrapEnabled ? Clip ( longitude , getMinLongitude ( ) , getMaxLongitude ( ) ) : longitude ;
public class GroupApi { /** * Syncs the group with its linked LDAP group . Only available to group owners and administrators . * < pre > < code > GitLab Endpoint : POST / groups / : id / ldap _ sync < / code > < / pre > * @ param groupIdOrPath the group ID , path of the group , or a Group instance holding the group...
post ( Response . Status . NO_CONTENT , ( Form ) null , "groups" , getGroupIdOrPath ( groupIdOrPath ) , "ldap_sync" ) ;
public class AzureBatchTaskStatusAlarmHandler { /** * This method is periodically invoked by the Runtime Clock . It will call Azure Batch APIs to determine * the status of tasks running inside the job and notify REEF of tasks statuses that correspond to running * evaluators . * @ param alarm alarm object . */ @ O...
String jobId = this . azureBatchHelper . getAzureBatchJobId ( ) ; List < CloudTask > allTasks = this . azureBatchHelper . getTaskStatusForJob ( jobId ) ; // Report status if the task has an associated active container . LOG . log ( Level . FINER , "Found {0} tasks from job id {1}" , new Object [ ] { allTasks . size ( )...
public class ListT { /** * / * ( non - Javadoc ) * @ see cyclops2 . monads . transformers . values . ListT # sorted ( java . util . Comparator ) */ @ Override public ListT < W , T > sorted ( final Comparator < ? super T > c ) { } }
return ( ListT < W , T > ) FoldableTransformerSeq . super . sorted ( c ) ;
public class ItemTouchHelper { /** * Returns the animation type or 0 if cannot be found . */ int endRecoverAnimation ( ViewHolder viewHolder , boolean override ) { } }
final int recoverAnimSize = mRecoverAnimations . size ( ) ; for ( int i = recoverAnimSize - 1 ; i >= 0 ; i -- ) { final RecoverAnimation anim = mRecoverAnimations . get ( i ) ; if ( anim . mViewHolder == viewHolder ) { anim . mOverridden |= override ; if ( ! anim . mEnded ) { anim . cancel ( ) ; } mRecoverAnimations . ...
public class AbstractLmlParser { /** * LmlBefore + LmlAfter support : */ protected < View > void invokeAnnotatedViewMethods ( final View view , final Class < ? extends Annotation > annotation ) { } }
Class < ? > handledClass = view . getClass ( ) ; try { while ( handledClass != null && ! handledClass . equals ( Object . class ) ) { for ( final Method method : ClassReflection . getDeclaredMethods ( handledClass ) ) { if ( Reflection . isAnnotationPresent ( method , annotation ) ) { invokeAnnotatedViewMethod ( view ,...
public class AbstractAttributeDefinitionBuilder { /** * Records that this attribute ' s value represents a reference to an instance of a * { @ link org . jboss . as . controller . capability . RuntimeCapability # isDynamicallyNamed ( ) dynamic capability } . * This method is a convenience method equivalent to calli...
// noinspection deprecation referenceRecorder = new CapabilityReferenceRecorder . DefaultCapabilityReferenceRecorder ( referencedCapability , dependentCapability , dynamicDependent ) ; return ( BUILDER ) this ;
public class DocumentReference { /** * Overwrites the document referred to by this DocumentReference . If no document exists yet , it * will be created . If a document already exists , it will be overwritten . * @ param pojo The POJO that will be used to populate the document contents . * @ return An ApiFuture th...
WriteBatch writeBatch = firestore . batch ( ) ; return extractFirst ( writeBatch . set ( this , pojo ) . commit ( ) ) ;
public class DescribeInstancesResult { /** * Information about the reservations . * @ return Information about the reservations . */ public java . util . List < Reservation > getReservations ( ) { } }
if ( reservations == null ) { reservations = new com . amazonaws . internal . SdkInternalList < Reservation > ( ) ; } return reservations ;
public class WorkbookReader { /** * Converts the spreadsheet to CSV by a String Iterable . * @ return String Iterable */ public Iterable < String > toCSV ( ) { } }
checkState ( ! isClosed , WORKBOOK_CLOSED ) ; Joiner joiner = Joiner . on ( "," ) . useForNull ( "" ) ; Iterable < String > CSVIterable = Iterables . transform ( sheet , item -> joiner . join ( rowToList ( item , true ) ) ) ; return hasHeader ? Iterables . skip ( CSVIterable , 1 ) : CSVIterable ;
public class ConstraintViolationImpl_CustomFieldSerializer { /** * instantiate a ConstraintViolationImpl . * @ param streamReader serialized stream reader to take data from * @ return ConstraintViolationImpl * @ throws SerializationException if deserialization fails */ public static ConstraintViolationImpl < Obje...
final String messageTemplate = null ; final String interpolatedMessage = streamReader . readString ( ) ; final Class < Object > rootBeanClass = null ; final Object rootBean = null ; final Object leafBeanInstance = null ; final Object value = null ; final Path propertyPath = ( Path ) streamReader . readObject ( ) ; fina...
public class Window { /** * Creates an ordered snapshot of the requests in this window . The entries * will be sorted by the natural ascending order of the key . A new map * is allocated when calling this method , so be careful about calling it * once . * @ return A new map instance representing all requests so...
Map < K , WindowFuture < K , R , P > > sortedRequests = new TreeMap < K , WindowFuture < K , R , P > > ( ) ; sortedRequests . putAll ( this . futures ) ; return sortedRequests ;
public class StreamEngine { /** * of error or orderly shutdown by the other peer - 1 is returned . */ private int write ( ByteBuffer outbuf ) { } }
int nbytes ; try { nbytes = fd . write ( outbuf ) ; if ( nbytes == 0 ) { errno . set ( ZError . EAGAIN ) ; } } catch ( IOException e ) { errno . set ( ZError . ENOTCONN ) ; nbytes = - 1 ; } return nbytes ;
public class JBBPToken { /** * Get numeric representation of the array size . * @ return the parsed numeric representation of the array size value or null if it can ' t be parsed * @ throws NullPointerException will be thrown if the array size value is null */ public Integer getArraySizeAsInt ( ) { } }
if ( this . arraySize == null ) { throw new NullPointerException ( "Array size is not defined" ) ; } try { return Integer . valueOf ( this . arraySize . trim ( ) ) ; } catch ( NumberFormatException ex ) { return null ; }
public class MtasSolrCollectionResult { /** * Sets the post . * @ param now the now * @ param status the status * @ throws IOException Signals that an I / O exception has occurred . */ public void setPost ( long now , SimpleOrderedMap < Object > status ) throws IOException { } }
if ( action . equals ( ComponentCollection . ACTION_POST ) ) { this . now = now ; this . status = status ; } else { throw new IOException ( "not allowed with action '" + action + "'" ) ; }
public class CPOptionLocalServiceBaseImpl { /** * Returns a range of cp options matching the UUID and company . * @ param uuid the UUID of the cp options * @ param companyId the primary key of the company * @ param start the lower bound of the range of cp options * @ param end the upper bound of the range of cp...
return cpOptionPersistence . findByUuid_C ( uuid , companyId , start , end , orderByComparator ) ;
public class SRVRecord { /** * Converts rdata to a String */ String rrToString ( ) { } }
StringBuffer sb = new StringBuffer ( ) ; sb . append ( priority + " " ) ; sb . append ( weight + " " ) ; sb . append ( port + " " ) ; sb . append ( target ) ; return sb . toString ( ) ;
public class VariableNumMap { /** * Returns { @ code true } if { @ code other } contains a subset of the * variable numbers in { @ code this } , and those variables have the * same names . * @ param other * @ return */ public final boolean containsAllNames ( VariableNumMap other ) { } }
int [ ] otherNums = other . nums ; String [ ] otherNames = other . names ; for ( int i = 0 ; i < otherNums . length ; i ++ ) { int index = getVariableIndex ( otherNums [ i ] ) ; if ( index < 0 || ! otherNames [ i ] . equals ( names [ index ] ) ) { return false ; } } return true ;
public class MongoDBSchemaDefiner { /** * Validates a String to be a valid name to be used in MongoDB for a collection name . * @ param collectionName */ private static void validateAsMongoDBCollectionName ( String collectionName ) { } }
Contracts . assertStringParameterNotEmpty ( collectionName , "requestedName" ) ; // Yes it has some strange requirements . if ( collectionName . startsWith ( "system." ) ) { throw log . collectionNameHasInvalidSystemPrefix ( collectionName ) ; } else if ( collectionName . contains ( "\u0000" ) ) { throw log . collectio...
public class MOEADD { /** * Initialize the population */ public void initPopulation ( ) { } }
for ( int i = 0 ; i < populationSize ; i ++ ) { S newSolution = problem . createSolution ( ) ; problem . evaluate ( newSolution ) ; evaluations ++ ; population . add ( newSolution ) ; subregionIdx [ i ] [ i ] = 1 ; }
public class ThrowsTaglet { /** * { @ inheritDoc } */ public void inherit ( DocFinder . Input input , DocFinder . Output output ) { } }
ClassDoc exception ; if ( input . tagId == null ) { ThrowsTag throwsTag = ( ThrowsTag ) input . tag ; exception = throwsTag . exception ( ) ; input . tagId = exception == null ? throwsTag . exceptionName ( ) : throwsTag . exception ( ) . qualifiedName ( ) ; } else { exception = input . element . containingClass ( ) . f...
public class GVRMesh { /** * Constructs a { @ link GVRMesh mesh } that contains this mesh . * This is primarily useful with the { @ link GVRPicker } , which does * " ray casting " to detect which scene object you ' re pointing to . Ray * casting is computationally expensive , and you generally want to limit the ...
GVRMesh meshbox = new GVRMesh ( getGVRContext ( ) , "float3 " + KEY_POSITION ) ; float [ ] bbox = new float [ 6 ] ; getBoxBound ( bbox ) ; float min_x = bbox [ 0 ] ; float min_y = bbox [ 1 ] ; float min_z = bbox [ 2 ] ; float max_x = bbox [ 3 ] ; float max_y = bbox [ 4 ] ; float max_z = bbox [ 5 ] ; float [ ] positions...
public class AbstractCompare { /** * Get the value for the trigger . * If no request is passed in , the current value of the trigger is used . * It will return the same " value " the client would have used in its subordinate logic . * The trigger value will either be ( i ) a date formatted String for WDateFields ...
// Date Compare ( Use Date Formatted String - YYYY - MM - DD ) if ( trigger instanceof WDateField ) { final WDateField input = ( WDateField ) trigger ; Date date ; if ( request == null ) { date = input . getValue ( ) ; } else { date = input . getRequestValue ( request ) ; } return date == null ? null : new SimpleDateFo...
public class DefaultConfigurationProvider { /** * Remove a bucket config ( closing it ) . * @ param name the name of the bucket . */ private void removeBucketConfig ( final String name ) { } }
LOGGER . debug ( "Removing bucket {} configuration from known configs." , name ) ; ClusterConfig cluster = currentConfig ; cluster . deleteBucketConfig ( name ) ; currentConfig = cluster ; configObservable . onNext ( currentConfig ) ;
public class DoubleMapper { /** * { @ inheritDoc } */ @ Override public Optional < Field > indexedField ( String name , Double value ) { } }
DoubleField doubleField = new DoubleField ( name , value , STORE ) ; doubleField . setBoost ( boost ) ; return Optional . of ( doubleField ) ;
public class LogInputReader { /** * Retrieve the next RequestLog */ @ Override public RequestLogs next ( ) throws NoSuchElementException { } }
Preconditions . checkNotNull ( logIterator , "Reader was not initialized via beginSlice()" ) ; if ( logIterator . hasNext ( ) ) { lastLog = logIterator . next ( ) ; return lastLog ; } else { log . fine ( "Shard completed: " + shardLogQuery . getStartTimeUsec ( ) + "-" + shardLogQuery . getEndTimeUsec ( ) ) ; throw new ...
public class DirectoryBasedOverlayNotifier { /** * convert paths starting with prefix into notificatons */ private ArtifactNotification collectNotificationsForPrefix ( String prefix , Collection < String > paths ) { } }
Set < String > gatheredPaths = new HashSet < String > ( ) ; boolean notRecurse = prefix . startsWith ( "!" ) ; if ( notRecurse ) { prefix = prefix . substring ( 1 ) ; } if ( "/" . equals ( prefix ) ) { gatheredPaths . addAll ( paths ) ; } else { for ( String path : paths ) { if ( path . startsWith ( prefix + "/" ) || p...
public class ViewCollections { /** * Apply { @ code actions } to { @ code view } . */ @ UiThread @ SafeVarargs public static < T extends View > void run ( @ NonNull T view , @ NonNull Action < ? super T > ... actions ) { } }
for ( Action < ? super T > action : actions ) { action . apply ( view , 0 ) ; }
public class ElementFilter { /** * Returns a list of methods in { @ code elements } . * @ return a list of methods in { @ code elements } * @ param elements the elements to filter */ public static List < ExecutableElement > methodsIn ( Iterable < ? extends Element > elements ) { } }
return listFilter ( elements , METHOD_KIND , ExecutableElement . class ) ;
public class WorkflowExecutor { /** * Reschedule a task * @ param task failed or cancelled task * @ return new instance of a task with " SCHEDULED " status */ private Task taskToBeRescheduled ( Task task ) { } }
Task taskToBeRetried = task . copy ( ) ; taskToBeRetried . setTaskId ( IDGenerator . generate ( ) ) ; taskToBeRetried . setRetriedTaskId ( task . getTaskId ( ) ) ; taskToBeRetried . setStatus ( SCHEDULED ) ; taskToBeRetried . setRetryCount ( task . getRetryCount ( ) + 1 ) ; taskToBeRetried . setRetried ( false ) ; task...
public class NonPeriodBreaker { /** * This function implements exceptions for periods as sentence breakers . It * decides when a period induces a new sentence or not . * @ param line * the text to be processed * @ return segmented text ( with newlines included ) */ private String segmenterNonBreaker ( String li...
// these are fine because they do not affect offsets line = line . trim ( ) ; line = RuleBasedTokenizer . doubleSpaces . matcher ( line ) . replaceAll ( " " ) ; final StringBuilder sb = new StringBuilder ( ) ; String segmentedText = "" ; int i ; final String [ ] words = line . split ( " " ) ; // iterate over the words ...
public class RemoteInputChannel { /** * Exclusive buffer is recycled to this input channel directly and it may trigger return extra * floating buffer and notify increased credit to the producer . * @ param segment The exclusive segment of this channel . */ @ Override public void recycle ( MemorySegment segment ) { ...
int numAddedBuffers ; synchronized ( bufferQueue ) { // Similar to notifyBufferAvailable ( ) , make sure that we never add a buffer // after releaseAllResources ( ) released all buffers ( see below for details ) . if ( isReleased . get ( ) ) { try { inputGate . returnExclusiveSegments ( Collections . singletonList ( se...
public class AndroidSpeechPlayer { /** * Plays the given voice instruction using TTS * @ param speechAnnouncement with voice instruction to be synthesized and played */ @ Override public void play ( SpeechAnnouncement speechAnnouncement ) { } }
boolean isValidAnnouncement = speechAnnouncement != null && ! TextUtils . isEmpty ( speechAnnouncement . announcement ( ) ) ; boolean canPlay = isValidAnnouncement && languageSupported && ! isMuted ; if ( ! canPlay ) { return ; } fireInstructionListenerIfApi14 ( ) ; HashMap < String , String > params = new HashMap < > ...
public class ISO8601 { /** * Get a ISO8601formatted string for the current date and time . * @ param withMsec flag indicating whether to include milliseconds * @ return a ISO8601 formatted string for the current date and time */ public static String getTimestamp ( boolean withMsec ) { } }
return ( withMsec ? SafeDateFormatter . getDateFormat ( PATTERN_MSEC ) . format ( new Date ( ) ) : SafeDateFormatter . getDateFormat ( PATTERN ) . format ( new Date ( ) ) ) ;
public class CassandraKdWideColumnStorage { /** * { @ inheritDoc } */ @ Override public Map < String , Object > get ( String table , String key ) { } }
String CQL = MessageFormat . format ( CQL_SELECT , calcTableName ( table ) ) ; ResultSet rs = getSessionManager ( ) . execute ( CQL , getConsistencyLevelGet ( ) , key ) ; if ( rs != null ) { Map < String , byte [ ] > data = new HashMap < > ( ) ; rs . forEach ( row -> { String field = row . getString ( columnField ) ; B...
public class StaticContentHandler { /** * Visible for testing */ public static InputStream getResourceAsStream ( String fileName ) throws FileNotFoundException { } }
String localPath = UI_DIR + fileName ; String altLocalPath = INTERNAL_BUILD_UI_DIR + fileName ; InputStream in = StaticContentHandler . class . getResourceAsStream ( localPath ) ; if ( in == null ) { in = StaticContentHandler . class . getResourceAsStream ( altLocalPath ) ; } if ( in == null ) { throw new FileNotFoundE...
public class GenTask { /** * Performs the actual work of the task . */ @ Override public void execute ( ) { } }
if ( _checking ) { log ( "Only checking if generation would change files" , Project . MSG_VERBOSE ) ; } for ( FileSet fs : _filesets ) { DirectoryScanner ds = fs . getDirectoryScanner ( getProject ( ) ) ; File fromDir = fs . getDir ( getProject ( ) ) ; String [ ] srcFiles = ds . getIncludedFiles ( ) ; for ( String srcF...
public class Selection { /** * Sort the byte array in ascending order using this algorithm . * @ param byteArray the array of bytes that we want to sort */ public static void sort ( byte [ ] byteArray ) { } }
int index = 0 ; byte value = 0 ; for ( int i = 1 ; i < byteArray . length ; i ++ ) { index = i ; value = byteArray [ index ] ; while ( index > 0 && value < byteArray [ index - 1 ] ) { byteArray [ index ] = byteArray [ index - 1 ] ; index -- ; } byteArray [ index ] = value ; }