signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class RunnerBuilder { /** * Always returns a runner for the given test class . * < p > In case of an exception a runner will be returned that prints an error instead of running * tests . * < p > Note that some of the internal JUnit implementations of RunnerBuilder will return * { @ code null } from this ...
try { Runner runner = runnerForClass ( testClass ) ; if ( runner != null ) { configureRunner ( runner ) ; } return runner ; } catch ( Throwable e ) { return new ErrorReportingRunner ( testClass , e ) ; }
public class XMLResourceBundle { /** * Return a message value with the supplied values integrated into it . * @ param aMessage A message in which to include the supplied string values * @ param aArray The string values to insert into the supplied message * @ return A message with the supplied values integrated in...
return StringUtils . format ( super . getString ( aMessage ) , aArray ) ;
public class ResponseMessage { /** * Initialize this response message with the input connection . * @ param conn * @ param req */ public void init ( HttpInboundConnection conn , RequestMessage req ) { } }
this . request = req ; this . response = conn . getResponse ( ) ; this . connection = conn ; this . outStream = new ResponseBody ( this . response . getBody ( ) ) ; this . locale = Locale . getDefault ( ) ;
public class InjectorImpl { /** * Create a program for method arguments . */ @ Override public Provider < ? > [ ] program ( Parameter [ ] params ) { } }
Provider < ? > [ ] program = new Provider < ? > [ params . length ] ; for ( int i = 0 ; i < program . length ; i ++ ) { // Key < ? > key = Key . of ( params [ i ] ) ; program [ i ] = provider ( InjectionPoint . of ( params [ i ] ) ) ; } return program ;
public class StringFunctions { /** * Returned expression results in the string with all leading and trailing chars removed * ( any char in the characters string ) . */ public static Expression trim ( Expression expression , String characters ) { } }
return x ( "TRIM(" + expression . toString ( ) + ", \"" + characters + "\")" ) ;
public class SQLiteModelMethod { /** * ( non - Javadoc ) * @ see com . abubusoft . kripton . processor . sqlite . grammars . jql . JQLContext # * getContextDescription ( ) */ @ Override public String getContextDescription ( ) { } }
String msg = String . format ( "In method '%s.%s'" , getParent ( ) . getElement ( ) . getSimpleName ( ) . toString ( ) , getElement ( ) . getSimpleName ( ) . toString ( ) ) ; return msg ;
public class ExclusionRandomizerRegistry { /** * { @ inheritDoc } */ @ Override public void init ( EasyRandomParameters parameters ) { } }
fieldPredicates . add ( FieldPredicates . isAnnotatedWith ( Exclude . class ) ) ; typePredicates . add ( TypePredicates . isAnnotatedWith ( Exclude . class ) ) ;
public class WebhookMessage { /** * Creates a new WebhookMessage instance with the provided { @ link net . dv8tion . jda . core . entities . Message Message } * as layout for copying . * < br > < b > This does not copy the attachments of the provided message ! < / b > * @ param message * The message to copy *...
Checks . notNull ( message , "Message" ) ; final String content = message . getContentRaw ( ) ; final List < MessageEmbed > embeds = message . getEmbeds ( ) ; final boolean isTTS = message . isTTS ( ) ; return new WebhookMessage ( null , null , content , embeds , isTTS , null ) ;
public class InternalXtextParser { /** * InternalXtext . g : 2231:1 : entryRulePredicatedRuleCall returns [ EObject current = null ] : iv _ rulePredicatedRuleCall = rulePredicatedRuleCall EOF ; */ public final EObject entryRulePredicatedRuleCall ( ) throws RecognitionException { } }
EObject current = null ; EObject iv_rulePredicatedRuleCall = null ; try { // InternalXtext . g : 2231:59 : ( iv _ rulePredicatedRuleCall = rulePredicatedRuleCall EOF ) // InternalXtext . g : 2232:2 : iv _ rulePredicatedRuleCall = rulePredicatedRuleCall EOF { newCompositeNode ( grammarAccess . getPredicatedRuleCallRule ...
public class BugsnagAppender { /** * Calculates the severity based on the logging event * @ param event the event * @ return The Bugsnag severity */ private Severity calculateSeverity ( ILoggingEvent event ) { } }
if ( event . getLevel ( ) . equals ( Level . ERROR ) ) { return Severity . ERROR ; } else if ( event . getLevel ( ) . equals ( Level . WARN ) ) { return Severity . WARNING ; } return Severity . INFO ;
public class Geometry { /** * Create geometry . * @ param geometryType * geometry type * @ param srid * srid * @ param precision * precision */ @ ExportConstructor public static org . geomajas . geometry . Geometry constructor ( String geometryType , int srid , int precision ) { } }
return new org . geomajas . geometry . Geometry ( geometryType , srid , precision ) ;
public class ExcelItemReader { /** * readTitle . * @ return an array of { @ link java . lang . String } objects . */ public String [ ] readTitle ( ) { } }
if ( workbook . getNumberOfSheets ( ) < 1 ) { return new String [ 0 ] ; } else { HSSFSheet sheet = workbook . getSheetAt ( 0 ) ; String [ ] attrs = readComments ( sheet , headIndex ) ; attrCount = attrs . length ; return attrs ; }
public class A_CmsSelectBox { /** * Positions the select popup . < p > */ void positionPopup ( ) { } }
if ( m_popup . isShowing ( ) ) { int width = m_popup . getOffsetWidth ( ) ; int openerHeight = CmsDomUtil . getCurrentStyleInt ( m_opener . getElement ( ) , CmsDomUtil . Style . height ) ; int popupHeight = getPopupHeight ( ) ; int dx = 0 ; if ( width > ( m_opener . getOffsetWidth ( ) ) ) { int spaceOnTheRight = ( Wind...
public class GifHeaderParser { /** * Reads GIF file header information . */ private void readHeader ( ) { } }
String id = "" ; for ( int i = 0 ; i < 6 ; i ++ ) { id += ( char ) read ( ) ; } if ( ! id . startsWith ( "GIF" ) ) { header . status = GifDecoder . STATUS_FORMAT_ERROR ; return ; } readLSD ( ) ; if ( header . gctFlag && ! err ( ) ) { header . gct = readColorTable ( header . gctSize ) ; header . bgColor = header . gct [...
public class URLConnection { /** * Return the key for the nth header field . Returns null if * there are fewer than n fields . This can be used to iterate * through all the headers in the message . */ public String getHeaderFieldKey ( int n ) { } }
try { getInputStream ( ) ; } catch ( Exception e ) { return null ; } MessageHeader props = properties ; return props == null ? null : props . getKey ( n ) ;
public class AmazonWebServiceClient { /** * Convenient method to end the client execution without logging the * awsRequestMetrics . */ protected final void endClientExecution ( AWSRequestMetrics awsRequestMetrics , Request < ? > request , Response < ? > response ) { } }
this . endClientExecution ( awsRequestMetrics , request , response , ! LOGGING_AWS_REQUEST_METRIC ) ;
public class URLNormalizer { /** * < p > Removes a URL - based session id . It removes PHP ( PHPSESSID ) , * ASP ( ASPSESSIONID ) , and Java EE ( jsessionid ) session ids . < / p > * < code > http : / / www . example . com / servlet ; jsessionid = 1E6FEC0D14D044541DD84D2D013D29ED ? a = b * & rarr ; http : / / www...
if ( StringUtils . containsIgnoreCase ( url , ";jsessionid=" ) ) { url = url . replaceFirst ( "(;jsessionid=([A-F0-9]+)((\\.\\w+)*))" , "" ) ; } else { String u = StringUtils . substringBefore ( url , "?" ) ; String q = StringUtils . substringAfter ( url , "?" ) ; if ( StringUtils . containsIgnoreCase ( url , "PHPSESSI...
public class Sample { /** * Return the index of the next free { @ code double } < i > slot < / i > . If all * < i > slots < / i > are occupied , { @ code - 1 } is returned . * @ return the index of the next free { @ code double } < i > slot < / i > , or * { @ code - 1 } if all < i > slots < / i > are occupied */ ...
int index = - 1 ; for ( int i = 0 ; i < _values . length && index == - 1 ; ++ i ) { if ( Double . isNaN ( _values [ i ] ) ) { index = i ; } } return index ;
public class SimpleWorkQueue { /** * Clean - up the worker thread when all the tasks are done */ private void doInterruptAllWaitingThreads ( ) { } }
// Interrupt all the threads for ( int i = 0 ; i < nThreads ; i ++ ) { threads [ i ] . interrupt ( ) ; } synchronized ( lock ) { lock . notify ( ) ; }
public class ReflectionUtils { /** * Get all inner classes and interfaces declared by the given class . * @ param clazz Class to reflect inner classes from . * @ return An { @ code Array } of inner classes and interfaces declared by the given class . * @ throws RuntimeException If any error occurs . */ public sta...
assertReflectionAccessor ( ) ; try { return accessor . getDeclaredClasses ( clazz ) ; } catch ( Exception e ) { throw SneakyException . sneakyThrow ( e ) ; }
public class MetaMethod { /** * Returns the signature of this method * @ return The signature of this method */ public synchronized String getSignature ( ) { } }
if ( signature == null ) { CachedClass [ ] parameters = getParameterTypes ( ) ; final String name = getName ( ) ; StringBuilder buf = new StringBuilder ( name . length ( ) + parameters . length * 10 ) ; buf . append ( getReturnType ( ) . getName ( ) ) ; buf . append ( ' ' ) ; buf . append ( name ) ; buf . append ( '(' ...
public class Proto { /** * Returns the package name that was configured in the proto . Note that { @ link # getPackageName ( ) } will have the same * value as this , if the compiler options did not have entries that override it . */ public String getOriginalPackageName ( ) { } }
if ( packageName == null ) return null ; String original = packageName . getLast ( ) ; return original != null ? original : packageName . getValue ( ) ;
public class Matrix3f { /** * Apply a model transformation to this matrix for a right - handed coordinate system , * that aligns the local < code > + Z < / code > axis with < code > direction < / code > * and store the result in < code > dest < / code > . * If < code > M < / code > is < code > this < / code > mat...
return rotateTowards ( direction . x ( ) , direction . y ( ) , direction . z ( ) , up . x ( ) , up . y ( ) , up . z ( ) , dest ) ;
public class GetFaceDetectionResult { /** * An array of faces detected in the video . Each element contains a detected face ' s details and the time , in * milliseconds from the start of the video , the face was detected . * @ param faces * An array of faces detected in the video . Each element contains a detecte...
if ( faces == null ) { this . faces = null ; return ; } this . faces = new java . util . ArrayList < FaceDetection > ( faces ) ;
public class CoreRemoteMongoCollectionImpl { /** * Update all documents in the collection according to the specified arguments . * @ param filter a document describing the query filter , which may not be null . * @ param update a document describing the update , which may not be null . The update to * apply must ...
return executeUpdate ( filter , update , updateOptions , true ) ;
public class Classfile { /** * Get a field constant from the constant pool . * @ param tag * the tag * @ param fieldTypeDescriptorFirstChar * the first char of the field type descriptor * @ param cpIdx * the constant pool index * @ return the field constant pool value * @ throws ClassfileFormatException...
switch ( tag ) { case 1 : // Modified UTF8 case 7 : // Class - - N . B . Unused ? Class references do not seem to actually be stored as constant initalizers case 8 : // String // Forward or backward indirect reference to a modified UTF8 entry return getConstantPoolString ( cpIdx ) ; case 3 : // int , short , char , byt...
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EClass getIfcEnergyConversionDeviceType ( ) { } }
if ( ifcEnergyConversionDeviceTypeEClass == null ) { ifcEnergyConversionDeviceTypeEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 232 ) ; } return ifcEnergyConversionDeviceTypeEClass ;
public class RemoteDatastoreEntityManager { /** * Initializes all relation properties of the given node state with empty * collections . * @ param types * The types . * @ param nodeState * The state of the entity . */ private void initializeEntity ( Collection < ? extends TypeMetadata > types , NodeState node...
for ( TypeMetadata type : types ) { Collection < TypeMetadata > superTypes = type . getSuperTypes ( ) ; initializeEntity ( superTypes , nodeState ) ; for ( MethodMetadata < ? , ? > methodMetadata : type . getProperties ( ) ) { if ( methodMetadata instanceof AbstractRelationPropertyMethodMetadata ) { AbstractRelationPro...
public class JQMColumnToggle { /** * Swatch header color " ui - bar - " + value will be used */ public void setHeaderTheme ( String value ) { } }
headerTheme = value ; ComplexPanel r = findHeadRow ( ) ; if ( r != null ) setEltHeaderTheme ( r . getElement ( ) , value ) ; r = findHeadGroupsRow ( ) ; if ( r != null ) setEltHeaderTheme ( r . getElement ( ) , value ) ;
public class TokenExpression { /** * This method will cast { @ code Set < ? > } to { @ code List < T > } * assuming { @ code ? } is castable to { @ code T } . * @ param < T > the generic type * @ param list a { @ code List } object * @ return a casted { @ code List } object */ @ SuppressWarnings ( "unchecked" )...
return ( List < T > ) list ;
public class ConverterHelper { /** * Find one field in a list of fields . * @ param domainFields list of fields in domain object * @ param fieldName field to search * @ param path list of intermediate fields for transitive fields * @ param type type of object to find fields in * @ param readOnlyField is the r...
List < SyntheticField > fields = domainFields ; SyntheticField [ ] result = new SyntheticField [ path . length + 1 ] ; int index = 0 ; Class < ? > currentType = type ; for ( ; index < path . length ; index ++ ) { boolean found = false ; for ( SyntheticField field : fields ) { if ( field . getName ( ) . equals ( path [ ...
public class QueueFile { /** * If necessary , expands the file to accommodate an additional element of the given length . * @ param dataLength length of data being added */ private void expandIfNecessary ( long dataLength ) throws IOException { } }
long elementLength = Element . HEADER_LENGTH + dataLength ; long remainingBytes = remainingBytes ( ) ; if ( remainingBytes >= elementLength ) return ; // Expand . long previousLength = fileLength ; long newLength ; // Double the length until we can fit the new data . do { remainingBytes += previousLength ; newLength = ...
public class LocalityPreservingProjection { /** * Invokes Octave to run the LPP script */ private static void invokeOctave ( File dataMatrixFile , File affMatrixFile , int dimensions , File outputFile ) throws IOException { } }
// Create the octave file for executing File octaveFile = File . createTempFile ( "octave-LPP" , ".m" ) ; // Create the Matlab - specified output code for the saving the matrix String outputStr = "save(\"-ascii\", \"" + outputFile . getAbsolutePath ( ) + "\", \"projection\");\n" ; String octaveProgram = null ; try { //...
public class ParametersFactory { /** * StartMain passes in the command line args here . * @ param args The command line arguments . If null is given then an empty * array will be used instead . */ public void setArgs ( String [ ] args ) { } }
if ( args == null ) { args = new String [ ] { } ; } this . args = args ; this . argsList = Collections . unmodifiableList ( new ArrayList < String > ( Arrays . asList ( args ) ) ) ;
public class TraceNLS { /** * Retrieve the localized text corresponding to the specified key from the * ResourceBundle that this instance wrappers . If the text cannot be found * for any reason , an appropriate error message is returned instead . * @ param key * the key to use in the ResourceBundle lookup . Nul...
return resolver . getMessage ( caller , null , ivBundleName , key , null , null , false , null , false ) ;
public class DirectClient { /** * If there is a job with an updated { @ link DirectJobStatus status } , the returned object contains * necessary information to act on the status change . The returned object can be queried using * { @ link DirectJobStatusResponse # is ( DirectJobStatus ) . is ( } { @ link DirectJobS...
JobStatusResponse < XMLDirectSignatureJobStatusResponse > statusChangeResponse = client . getDirectStatusChange ( Optional . ofNullable ( sender ) ) ; if ( statusChangeResponse . gotStatusChange ( ) ) { return fromJaxb ( statusChangeResponse . getStatusResponse ( ) , statusChangeResponse . getNextPermittedPollTime ( ) ...
public class AbstractJcrNode { /** * Removes an existing property with the supplied name . Note that if a property with the given name does not exist , then this * method returns null and does not throw an exception . * @ param name the name of the property ; may not be null * @ return the property that was remov...
AbstractJcrProperty existing = getProperty ( name ) ; if ( existing != null ) { existing . remove ( ) ; return existing ; } // Return without throwing an exception to match behavior of the reference implementation . // This is also in conformance with the spec . See MODE - 956 for details . return null ;
public class CPAttachmentFileEntryLocalServiceBaseImpl { /** * Returns the number of rows matching the dynamic query . * @ param dynamicQuery the dynamic query * @ param projection the projection to apply to the query * @ return the number of rows matching the dynamic query */ @ Override public long dynamicQueryC...
return cpAttachmentFileEntryPersistence . countWithDynamicQuery ( dynamicQuery , projection ) ;
public class CollectUtils { /** * newLinkedHashMap . * @ param size a int . * @ param < K > a K object . * @ param < V > a V object . * @ return a { @ link java . util . Map } object . */ public static < K , V > Map < K , V > newLinkedHashMap ( int size ) { } }
return new LinkedHashMap < K , V > ( size ) ;
public class SymmetryTools { /** * Converts a self alignment into a directed jGraphT of aligned residues , * where each vertex is a residue and each edge means the equivalence * between the two residues in the self - alignment . * @ param selfAlignment * AFPChain * @ return alignment Graph */ public static Gr...
Graph < Integer , DefaultEdge > graph = new SimpleGraph < Integer , DefaultEdge > ( DefaultEdge . class ) ; for ( int i = 0 ; i < selfAlignment . getOptAln ( ) . length ; i ++ ) { for ( int j = 0 ; j < selfAlignment . getOptAln ( ) [ i ] [ 0 ] . length ; j ++ ) { Integer res1 = selfAlignment . getOptAln ( ) [ i ] [ 0 ]...
public class Items { /** * Returns all the registered { @ link TopLevelItemDescriptor } s . */ public static DescriptorExtensionList < TopLevelItem , TopLevelItemDescriptor > all ( ) { } }
return Jenkins . getInstance ( ) . < TopLevelItem , TopLevelItemDescriptor > getDescriptorList ( TopLevelItem . class ) ;
public class Histogram3D { /** * Create a plot canvas with the histogram plot of given data . * @ param data a sample set . * @ param k the number of bins . * @ param prob if true , the z - axis will be in the probability scale . * @ param palette the color palette . */ public static PlotCanvas plot ( double [ ...
return plot ( data , k , k , prob , palette ) ;
public class InstanceClient { /** * Performs a reset on the instance . This is a hard reset the VM does not do a graceful shutdown . * For more information , see Resetting an instance . * < p > Sample code : * < pre > < code > * try ( InstanceClient instanceClient = InstanceClient . create ( ) ) { * ProjectZo...
ResetInstanceHttpRequest request = ResetInstanceHttpRequest . newBuilder ( ) . setInstance ( instance == null ? null : instance . toString ( ) ) . build ( ) ; return resetInstance ( request ) ;
public class ConvergedServletInitialHandler { /** * FIXME : kakonyii : This method is copied form the base class : */ private void dispatchRequest ( final HttpServerExchange exchange , final ServletRequestContext servletRequestContext , final ServletChain servletChain , final DispatcherType dispatcherType ) throws Exce...
HttpHandler next = null ; try { // lets get access of superclass private fields using reflection : Field nextField = ServletInitialHandler . class . getDeclaredField ( "next" ) ; nextField . setAccessible ( true ) ; next = ( HttpHandler ) nextField . get ( this ) ; nextField . setAccessible ( false ) ; } catch ( NoSuch...
public class SliderBar { /** * Stop sliding the knob . * @ param unhighlight * true to change the style * @ param fireEvent * true to fire the event */ private void stopSliding ( boolean unhighlight , boolean fireEvent ) { } }
if ( unhighlight ) { DOM . setElementProperty ( lineElement , "className" , SLIDER_LINE ) ; DOM . setElementProperty ( knobImage . getElement ( ) , "className" , SLIDER_KNOB ) ; }
public class LoggingUtil { /** * Expensive logging function that is convenient , but should only be used in * rare conditions . * For ' frequent ' logging , use more efficient techniques , such as explained in * the { @ link de . lmu . ifi . dbs . elki . logging logging package documentation } . * @ param level...
LogRecord rec = new ELKILogRecord ( level , message ) ; String [ ] caller = inferCaller ( ) ; if ( caller != null ) { rec . setSourceClassName ( caller [ 0 ] ) ; rec . setSourceMethodName ( caller [ 1 ] ) ; Logger logger = Logger . getLogger ( caller [ 0 ] ) ; logger . log ( rec ) ; } else { Logger . getAnonymousLogger...
public class FessMessages { /** * Add the created action message for the key ' errors . invalid _ query _ unsupported _ sort _ field ' with parameters . * < pre > * message : The given sort ( { 0 } ) is not supported . * < / pre > * @ param property The property name for the message . ( NotNull ) * @ param ar...
assertPropertyNotNull ( property ) ; add ( property , new UserMessage ( ERRORS_invalid_query_unsupported_sort_field , arg0 ) ) ; return this ;
public class ProtoUtils { /** * not an api */ public static boolean computeUpdate ( String channelId , Configtx . Config original , Configtx . Config update , Configtx . ConfigUpdate . Builder configUpdateBuilder ) { } }
Configtx . ConfigGroup . Builder readSetBuilder = Configtx . ConfigGroup . newBuilder ( ) ; Configtx . ConfigGroup . Builder writeSetBuilder = Configtx . ConfigGroup . newBuilder ( ) ; if ( computeGroupUpdate ( original . getChannelGroup ( ) , update . getChannelGroup ( ) , readSetBuilder , writeSetBuilder ) ) { config...
public class X509NameEntryConverter { /** * return true if the passed in String can be represented without * loss as a PrintableString , false otherwise . */ protected boolean canBePrintable ( String str ) { } }
for ( int i = str . length ( ) - 1 ; i >= 0 ; i -- ) { char ch = str . charAt ( i ) ; if ( str . charAt ( i ) > 0x007f ) { return false ; } if ( 'a' <= ch && ch <= 'z' ) { continue ; } if ( 'A' <= ch && ch <= 'Z' ) { continue ; } if ( '0' <= ch && ch <= '9' ) { continue ; } switch ( ch ) { case ' ' : case '\'' : case '...
public class CommerceWishListUtil { /** * Returns all the commerce wish lists where uuid = & # 63 ; and companyId = & # 63 ; . * @ param uuid the uuid * @ param companyId the company ID * @ return the matching commerce wish lists */ public static List < CommerceWishList > findByUuid_C ( String uuid , long company...
return getPersistence ( ) . findByUuid_C ( uuid , companyId ) ;
public class GraphPath { /** * Split this path and retains the first part of the * part in this object and reply the second part . * The first occurrence of this specified element * will be in the second part . * < p > This function removes until the < i > last occurence < / i > * of the given object . * @ ...
return splitAt ( indexOf ( obj , startPoint ) , true ) ;
public class StreamService { /** * Send NetStream . Status to the client . * @ param conn * connection * @ param statusCode * NetStream status code * @ param description * description * @ param name * name * @ param status * The status - error , warning , or status * @ param streamId * stream id...
if ( conn instanceof RTMPConnection ) { Status s = new Status ( statusCode ) ; s . setClientid ( streamId ) ; s . setDesciption ( description ) ; s . setDetails ( name ) ; s . setLevel ( status ) ; // get the channel RTMPConnection rtmpConn = ( RTMPConnection ) conn ; Channel channel = rtmpConn . getChannel ( rtmpConn ...
public class CmsGalleryController { /** * Remove the type from the search object . < p > * @ param resourceType the resource type as id */ public void removeType ( String resourceType ) { } }
m_searchObject . removeType ( resourceType ) ; m_searchObjectChanged = true ; ValueChangeEvent . fire ( this , m_searchObject ) ;
public class UserManagedCacheBuilder { /** * Adds { @ link ExpiryPolicy } configuration to the returned builder . * @ param expiry the expiry to use * @ return a new builer with the added expiry */ public final UserManagedCacheBuilder < K , V , T > withExpiry ( ExpiryPolicy < ? super K , ? super V > expiry ) { } }
if ( expiry == null ) { throw new NullPointerException ( "Null expiry" ) ; } UserManagedCacheBuilder < K , V , T > otherBuilder = new UserManagedCacheBuilder < > ( this ) ; otherBuilder . expiry = expiry ; return otherBuilder ;
public class ExtractionResult { /** * Returns all entities . * @ return all entities . */ public List < Object > getEntities ( ) { } }
List < Object > entitiesList = new LinkedList < Object > ( ) ; for ( Result result : results ) { entitiesList . add ( result . getObject ( ) ) ; } return entitiesList ;
public class Record { /** * Add sort key * @ param object Java primitive sort key * @ param sort sort type SORT _ NON or SORT _ LOWER or SORT _ UPPER * @ param priority sort order */ public void addSort ( Object object , int sort , int priority ) { } }
key . addPrimitiveValue ( String . format ( SORT_LABEL , priority ) , object , sort , priority ) ;
public class Counters { /** * Returns a string representation of a Counter , displaying the keys and their * counts in decreasing order of count . At most k keys are displayed . * Note that this method subsumes many of the other toString methods , e . g . : * toString ( c , k ) and toBiggestValuesFirstString ( c ...
PriorityQueue < T > queue = toPriorityQueue ( counter ) ; List < String > strings = new ArrayList < String > ( ) ; for ( int rank = 0 ; rank < k && ! queue . isEmpty ( ) ; ++ rank ) { T key = queue . removeFirst ( ) ; double value = counter . getCount ( key ) ; strings . add ( String . format ( itemFormat , key , value...
public class RepositoryBrowser { /** * Normalize the URL so that it ends with ' / ' . * An attention is paid to preserve the query parameters in URL if any . */ protected static URL normalizeToEndWithSlash ( URL url ) { } }
if ( url . getPath ( ) . endsWith ( "/" ) ) return url ; // normalize String q = url . getQuery ( ) ; q = q != null ? ( '?' + q ) : "" ; try { return new URL ( url , url . getPath ( ) + '/' + q ) ; } catch ( MalformedURLException e ) { // impossible throw new Error ( e ) ; }
public class DeleteAggregationAuthorizationRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DeleteAggregationAuthorizationRequest deleteAggregationAuthorizationRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( deleteAggregationAuthorizationRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( deleteAggregationAuthorizationRequest . getAuthorizedAccountId ( ) , AUTHORIZEDACCOUNTID_BINDING ) ; protocolMarshaller . marshall ( deleteAggregat...
public class MolecularFormulaManipulator { /** * Simplify the molecular formula . E . g the dot ' . ' character convention is * used when dividing a formula into parts . In this case any numeral following a dot refers * to all the elements within that part of the formula that follow it . * @ param formula The mol...
String newFormula = formula ; char thisChar ; if ( formula . contains ( " " ) ) { newFormula = newFormula . replace ( " " , "" ) ; } if ( ! formula . contains ( "." ) ) return breakExtractor ( formula ) ; List < String > listMF = new ArrayList < String > ( ) ; while ( newFormula . contains ( "." ) ) { int pos = newForm...
public class StringUtils { /** * < p > Checks if the CharSequence contains only uppercase characters . < / p > * < p > { @ code null } will return { @ code false } . * An empty String ( length ( ) = 0 ) will return { @ code false } . < / p > * < pre > * StringUtils . isAllUpperCase ( null ) = false * StringUt...
if ( cs == null || isEmpty ( cs ) ) { return false ; } final int sz = cs . length ( ) ; for ( int i = 0 ; i < sz ; i ++ ) { if ( ! Character . isUpperCase ( cs . charAt ( i ) ) ) { return false ; } } return true ;
public class SeLionGridLauncherV3 { /** * Shutdown the instance * @ throws Exception */ public void shutdown ( ) throws Exception { } }
if ( type == null ) { return ; } if ( type instanceof Hub ) { ( ( Hub ) type ) . stop ( ) ; } if ( type instanceof SelfRegisteringRemote ) { ( ( SelfRegisteringRemote ) type ) . stopRemoteServer ( ) ; } if ( type instanceof SeleniumServer ) { ( ( SeleniumServer ) type ) . stop ( ) ; } LOGGER . info ( "Selenium is shut ...
public class DefaultOrphanResponseReporter { /** * Reports the given { @ link CouchbaseRequest } as a orphan response . * @ param request the request that shpuld be reported . */ @ Override public void report ( final CouchbaseResponse request ) { } }
if ( ! queue . offer ( request ) ) { LOGGER . debug ( "Could not enqueue CouchbaseRequest {} for orphan reporting, discarding." , request ) ; }
public class PartialResponseWriter { /** * < p class = " changed _ added _ 2_0 " > Write an attribute update operation . < / p > * @ param targetId ID of the node to be updated * @ param attributes Map of attribute name / value pairs to be updated * @ throws IOException if an input / output error occurs * @ sin...
startChangesIfNecessary ( ) ; ResponseWriter writer = getWrapped ( ) ; writer . startElement ( "attributes" , null ) ; writer . writeAttribute ( "id" , targetId , null ) ; for ( Map . Entry < String , String > entry : attributes . entrySet ( ) ) { writer . startElement ( "attribute" , null ) ; writer . writeAttribute (...
public class InputStreamProvider { /** * Get an InputStream for the file . * The caller is responsible for closing the stream or otherwise * a resource leak can occur . * @ param f a File * @ return an InputStream for the file * @ throws IOException */ public InputStream getInputStream ( File f ) throws IOExc...
// use the magic numbers to determine the compression type , // use file extension only as 2nd choice int magic = 0 ; InputStream test = getInputStreamFromFile ( f ) ; magic = getMagicNumber ( test ) ; test . close ( ) ; InputStream inputStream = null ; String fileName = f . getName ( ) ; if ( magic == UncompressInputS...
public class Prefser { /** * Removes value defined by a given key . * @ param key key of the preference to be removed */ public void remove ( @ NonNull String key ) { } }
Preconditions . checkNotNull ( key , KEY_IS_NULL ) ; if ( ! contains ( key ) ) { return ; } editor . remove ( key ) . apply ( ) ;
public class ServiceCreator { /** * Add the requested post parameters to the Request . * @ param request Request to add post params to */ private void addPostParams ( final Request request ) { } }
if ( uniqueName != null ) { request . addPostParam ( "UniqueName" , uniqueName ) ; } if ( defaultTtl != null ) { request . addPostParam ( "DefaultTtl" , defaultTtl . toString ( ) ) ; } if ( callbackUrl != null ) { request . addPostParam ( "CallbackUrl" , callbackUrl . toString ( ) ) ; } if ( geoMatchLevel != null ) { r...
public class WorkerInfo { /** * < code > map & lt ; string , int64 & gt ; capacityBytesOnTiers = 8 ; < / code > */ public java . util . Map < java . lang . String , java . lang . Long > getCapacityBytesOnTiersMap ( ) { } }
return internalGetCapacityBytesOnTiers ( ) . getMap ( ) ;
public class CreateRouteResponseRequest { /** * The response models for the route response . * @ param responseModels * The response models for the route response . * @ return Returns a reference to this object so that method calls can be chained together . */ public CreateRouteResponseRequest withResponseModels ...
setResponseModels ( responseModels ) ; return this ;
public class N { /** * Adds all the elements of the given arrays into a new array . * @ param a * the first array whose elements are added to the new array . * @ param b * the second array whose elements are added to the new array . * @ return A new array containing the elements from a and b */ @ SafeVarargs ...
if ( N . isNullOrEmpty ( a ) ) { return N . isNullOrEmpty ( b ) ? N . EMPTY_BOOLEAN_ARRAY : b . clone ( ) ; } final boolean [ ] newArray = new boolean [ a . length + b . length ] ; copy ( a , 0 , newArray , 0 , a . length ) ; copy ( b , 0 , newArray , a . length , b . length ) ; return newArray ;
public class FhirValidator { /** * Validates a resource instance , throwing a { @ link ValidationFailureException } if the validation fails * @ param theResource * The resource to validate * @ throws ValidationFailureException * If the validation fails * @ deprecated use { @ link # validateWithResult ( IBaseR...
applyDefaultValidators ( ) ; ValidationResult validationResult = validateWithResult ( theResource ) ; if ( ! validationResult . isSuccessful ( ) ) { throw new ValidationFailureException ( myContext , validationResult . toOperationOutcome ( ) ) ; }
public class Trie { /** * The child corresponding to the given character . * @ return null if no such trie . */ public Trie lookup ( char ch ) { } }
int i = Arrays . binarySearch ( childMap , ch ) ; return i >= 0 ? children [ i ] : null ;
public class AbstractFindBugsTask { /** * Set the classpath to use . * @ param src * classpath to use */ public void setClasspath ( Path src ) { } }
if ( classpath == null ) { classpath = src ; } else { classpath . append ( src ) ; }
public class RangeUtils { /** * Gets a calendar using the default time zone and locale . The Calendar * returned is based on the given time in the default time zone with the * default locale . * @ return an calendar instance . */ private static Calendar buildCalendar ( final Date date ) { } }
Calendar calendar = buildCalendar ( ) ; calendar . setTime ( date ) ; return calendar ;
public class AmazonPinpointClient { /** * Delete an Voice channel * @ param deleteVoiceChannelRequest * @ return Result of the DeleteVoiceChannel operation returned by the service . * @ throws BadRequestException * 400 response * @ throws InternalServerErrorException * 500 response * @ throws ForbiddenExc...
request = beforeClientExecution ( request ) ; return executeDeleteVoiceChannel ( request ) ;
public class StepExecution { /** * Strategies used when step fails , we support Continue and Abort . Abort will fail the automation when the step * fails . Continue will ignore the failure of current step and allow automation to run the next step . With * conditional branching , we add step : stepName to support th...
if ( this . validNextSteps == null ) { setValidNextSteps ( new com . amazonaws . internal . SdkInternalList < String > ( validNextSteps . length ) ) ; } for ( String ele : validNextSteps ) { this . validNextSteps . add ( ele ) ; } return this ;
public class Scope { /** * 获取全局变量 * 全局作用域是指本次请求的整个 template */ public Object getGlobal ( Object key ) { } }
for ( Scope cur = this ; true ; cur = cur . parent ) { if ( cur . parent == null ) { return cur . data . get ( key ) ; } }
public class AzureVPNSupport { /** * Create local network for connecting VPN ? */ @ Override public VpnGateway createVpnGateway ( String endpoint , String name , String description , VpnProtocol protocol , String bgpAsn ) throws CloudException , InternalException { } }
if ( logger . isTraceEnabled ( ) ) { logger . trace ( "ENTER: " + AzureVPNSupport . class . getName ( ) + ".createVPNGateway()" ) ; } try { ProviderContext ctx = provider . getContext ( ) ; if ( ctx == null ) { throw new AzureConfigException ( "No context was specified for this request" ) ; } AzureMethod method = new A...
public class CommandLineTools { /** * Check the given text and print results to System . out . * @ param contents a text to check ( may be more than one sentence ) * @ param lt Initialized LanguageTool * @ param isXmlFormat whether to print the result in XML format * @ param isJsonFormat whether to print the re...
if ( contextSize == - 1 ) { contextSize = DEFAULT_CONTEXT_SIZE ; } long startTime = System . currentTimeMillis ( ) ; List < RuleMatch > ruleMatches = lt . check ( contents ) ; // adjust line numbers for ( RuleMatch r : ruleMatches ) { r . setLine ( r . getLine ( ) + lineOffset ) ; r . setEndLine ( r . getEndLine ( ) + ...
public class JulianMath { /** * / * [ deutsch ] * < p > Berechnet das gepackte Datum auf Basis des angegebenen * modifizierten julianischen Datums . < / p > * < p > Mit Hilfe von { @ code readYear ( ) } , { @ code readMonth ( ) } und * { @ code readDayOfMonth ( ) } k & ouml ; nnen aus dem Ergebnis die einzelnen...
long y ; int m ; int d ; long days = MathUtils . safeAdd ( mjd , OFFSET ) ; long q4 = MathUtils . floorDivide ( days , 1461 ) ; int r4 = MathUtils . floorModulo ( days , 1461 ) ; if ( r4 == 1460 ) { y = ( q4 + 1 ) * 4 ; m = 2 ; d = 29 ; } else { int q1 = ( r4 / 365 ) ; int r1 = ( r4 % 365 ) ; y = q4 * 4 + q1 ; m = ( ( ...
public class DynamicMessage { /** * Returns a map of option names as keys and option values as values . . */ public Map < String , Object > toMap ( ) { } }
Map < String , Object > result = new HashMap < > ( ) ; for ( Entry < Key , Value > keyValueEntry : fields . entrySet ( ) ) { Key key = keyValueEntry . getKey ( ) ; Value value = keyValueEntry . getValue ( ) ; if ( ! key . isExtension ( ) ) { result . put ( key . getName ( ) , transformValueToObject ( value ) ) ; } else...
public class bit { /** * Convert a string which was created with the { @ link # toByteString ( byte . . . ) } * method back to an byte array . * @ see # toByteString ( byte . . . ) * @ param data the string to convert . * @ return the byte array . * @ throws IllegalArgumentException if the given data string c...
final String [ ] parts = data . split ( "\\|" ) ; final byte [ ] bytes = new byte [ parts . length ] ; for ( int i = 0 ; i < parts . length ; ++ i ) { if ( parts [ i ] . length ( ) != Byte . SIZE ) { throw new IllegalArgumentException ( "Byte value doesn't contain 8 bit: " + parts [ i ] ) ; } try { bytes [ parts . leng...
public class ContactsApi { /** * Get contacts Return contacts of a character - - - This route is cached for * up to 300 seconds SSO Scope : esi - characters . read _ contacts . v1 * @ param characterId * An EVE character ID ( required ) * @ param datasource * The server name you would like data from ( optiona...
com . squareup . okhttp . Call call = getCharactersCharacterIdContactsValidateBeforeCall ( characterId , datasource , ifNoneMatch , page , token , null ) ; Type localVarReturnType = new TypeToken < List < ContactsResponse > > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnType ) ;
public class StrTokenizer { /** * Gets a new tokenizer instance which parses Comma Separated Value strings * initializing it with the given input . The default for CSV processing * will be trim whitespace from both ends ( which can be overridden with * the setTrimmer method ) . * @ param input the text to parse...
final StrTokenizer tok = getCSVClone ( ) ; tok . reset ( input ) ; return tok ;
public class NodeSequence { /** * Add the node into a vector of nodes where it should occur in * document order . * @ param node The node to be added . * @ return insertIndex . * @ throws RuntimeException thrown if this NodeSetDTM is not of * a mutable type . */ protected int addNodeInDocOrder ( int node ) { ...
assertion ( hasCache ( ) , "addNodeInDocOrder must be done on a mutable sequence!" ) ; int insertIndex = - 1 ; NodeVector vec = getVector ( ) ; // This needs to do a binary search , but a binary search // is somewhat tough because the sequence test involves // two nodes . int size = vec . size ( ) , i ; for ( i = size ...
public class X509CRLImpl { /** * Gets the raw Signature bits from the CRL . * @ return the signature . */ public byte [ ] getSignature ( ) { } }
if ( signature == null ) return null ; byte [ ] dup = new byte [ signature . length ] ; System . arraycopy ( signature , 0 , dup , 0 , dup . length ) ; return dup ;
public class ValueFilterAdapter { /** * { @ inheritDoc } */ @ Override public FilterSupportStatus isFilterSupported ( FilterAdapterContext context , ValueFilter filter ) { } }
if ( filter . getComparator ( ) instanceof BinaryComparator || ( filter . getComparator ( ) instanceof RegexStringComparator && filter . getOperator ( ) == CompareOp . EQUAL ) ) { return FilterSupportStatus . SUPPORTED ; } return FilterSupportStatus . newNotSupported ( String . format ( "ValueFilter must have either a ...
public class CommerceRegionLocalServiceWrapper { /** * Deletes the commerce region from the database . Also notifies the appropriate model listeners . * @ param commerceRegion the commerce region * @ return the commerce region that was removed * @ throws PortalException */ @ Override public com . liferay . commer...
return _commerceRegionLocalService . deleteCommerceRegion ( commerceRegion ) ;
public class Try { /** * Tries to run the given ThrowingRunnable and throws a RuntimeException with the given message in case it fails . * If the given ThrowingRunnable throws a RuntimeException it is not rethrown but wrapped in a new RuntimeException * with the given message ( just like a checked Exception ) . *...
Objects . requireNonNull ( message , "message must not be null" ) ; Objects . requireNonNull ( runnable , "runnable must not be null" ) ; try { runnable . run ( ) ; } catch ( final Exception exc ) { throw new RuntimeException ( message , exc ) ; }
public class JoblogUtil { /** * logs the message to joblog and trace . * If Level > FINE , this method will reduce the level to FINE while logging to trace . log * to prevent the message to be logged in console . log and messages . log file * Joblog messages will be logged as per supplied logging level * Use th...
if ( level . intValue ( ) > Level . FINE . intValue ( ) ) { traceLogger . log ( Level . FINE , msg ) ; logToJoblogIfNotTraceLoggable ( Level . FINE , msg , traceLogger ) ; } else { traceLogger . log ( level , msg ) ; logToJoblogIfNotTraceLoggable ( level , msg , traceLogger ) ; }
public class StaticMethodInjectionPoint { /** * Helper method for getting the current parameter values from a list of annotated parameters . * @ param parameters The list of annotated parameter to look up * @ param manager The Bean manager * @ return The object array of looked up values */ protected Object [ ] ge...
if ( getInjectionPoints ( ) . isEmpty ( ) ) { if ( specialInjectionPointIndex == - 1 ) { return Arrays2 . EMPTY_ARRAY ; } else { return new Object [ ] { specialVal } ; } } Object [ ] parameterValues = new Object [ getParameterInjectionPoints ( ) . size ( ) ] ; List < ParameterInjectionPoint < ? , X > > parameters = get...
public class DefaultIOUtil { /** * { @ inheritDoc } */ public void createArchive ( File directory , File archive ) throws MojoExecutionException { } }
// package the zip . Note this is very simple . Look at the JarMojo which does more things . // we should perhaps package as a war when inside a project with war packaging ? makeDirectoryIfNecessary ( archive . getParentFile ( ) ) ; deleteFile ( archive ) ; zipArchiver . addDirectory ( directory ) ; zipArchiver . setDe...
public class GVRSkeletonAnimation { /** * Create a skeleton from the target hierarchy which has the given bones . * The structure of the target hierarchy is used to determine bone parentage . * The skeleton will have only the bones designated in the list . * The hierarchy is expected to be connected with no gaps ...
int numBones = boneNames . size ( ) ; GVRSceneObject root = ( GVRSceneObject ) mTarget ; mSkeleton = new GVRSkeleton ( root , boneNames ) ; for ( int boneId = 0 ; boneId < numBones ; ++ boneId ) { mSkeleton . setBoneOptions ( boneId , GVRSkeleton . BONE_ANIMATE ) ; } mBoneChannels = new GVRAnimationChannel [ numBones ]...
public class Localizable { /** * Adds or overrides a value to the internal hash . * @ param value * If set to null , removes the value from the internal hash ( the local will no longer * show up in { @ link # getAllLocales ( ) } * @ throws NullPointerException * if locale is null . * @ return The value prev...
if ( defaultLocale == null ) defaultLocale = locale ; if ( value != null ) return values . put ( locale , value ) ; values . remove ( locale ) ; return null ;
public class SurtPrefixSet { /** * Changes all prefixes so that they enforce an exact host . For * prefixes that already include a ' ) ' , this means discarding * anything after ' ) ' ( path info ) . For prefixes that don ' t include * a ' ) ' - - domain prefixes open to subdomains - - add the closing * ' ) ' (...
SurtPrefixSet iterCopy = ( SurtPrefixSet ) this . clone ( ) ; Iterator < String > iter = iterCopy . iterator ( ) ; while ( iter . hasNext ( ) ) { String prefix = ( String ) iter . next ( ) ; String convPrefix = convertPrefixToHost ( prefix ) ; if ( prefix != convPrefix ) { // if returned value not unchanged , update se...
public class Source { /** * Sets whether or not the position , velocity , etc . , of the source are relative to the * listener . */ public void setSourceRelative ( boolean relative ) { } }
if ( _sourceRelative != relative ) { _sourceRelative = relative ; AL10 . alSourcei ( _id , AL10 . AL_SOURCE_RELATIVE , relative ? AL10 . AL_TRUE : AL10 . AL_FALSE ) ; }
public class WColumnLayout { /** * Sets the content of the given column and updates the column widths and visibilities . * @ param column the column being updated . * @ param heading the column heading . * @ param content the content . */ private void setContent ( final WColumn column , final WHeading heading , f...
column . removeAll ( ) ; if ( heading != null ) { column . add ( heading ) ; } if ( content != null ) { column . add ( content ) ; } // Update column widths & visibility if ( hasLeftContent ( ) && hasRightContent ( ) ) { // Set columns 50% leftColumn . setWidth ( 50 ) ; rightColumn . setWidth ( 50 ) ; // Set both visib...
public class Branch { /** * Check for forced session restart . The Branch session is restarted if the incoming intent has branch _ force _ new _ session set to true . * This is for supporting opening a deep link path while app is already running in the foreground . Such as clicking push notification while app in fore...
boolean isRestartSessionRequested = false ; if ( intent != null ) { try { // Force new session parameters if ( intent . getBooleanExtra ( Defines . Jsonkey . ForceNewBranchSession . getKey ( ) , false ) ) { isRestartSessionRequested = true ; intent . putExtra ( Defines . Jsonkey . ForceNewBranchSession . getKey ( ) , f...
public class WebApp { /** * Process any annotation which could not be managed by an update * to the the descriptor based configuration . * @ param servletConfig The servlet configuration embedding a class * which is to be processed for annotations . */ private void initializeNonDDRepresentableAnnotation ( IServle...
if ( com . ibm . ws . webcontainer . osgi . WebContainer . isServerStopping ( ) ) return ; String methodName = "initializeNonDDRepresentableAnnotation" ; String configClassName = servletConfig . getClassName ( ) ; if ( configClassName == null ) { return ; // Strange ; but impossible to process ; ignore . } if ( ! accep...
public class ServiceDiscoveryManager { /** * Add discover info response data . * @ see < a href = " http : / / xmpp . org / extensions / xep - 0030 . html # info - basic " > XEP - 30 Basic Protocol ; Example 2 < / a > * @ param response the discover info response packet */ public synchronized void addDiscoverInfoTo...
// First add the identities of the connection response . addIdentities ( getIdentities ( ) ) ; // Add the registered features to the response for ( String feature : getFeatures ( ) ) { response . addFeature ( feature ) ; } response . addExtension ( extendedInfo ) ;