signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class ReflectionUtils { /** * Returns this element ' s annotation for the specified type if * such an annotation is < em > present < / em > , else null . * @ param < T > the type of the annotation to query for and return if present * @ param clazz Class to get annotation from * @ param annotationClass th...
assertReflectionAccessor ( ) ; return accessor . getAnnotation ( clazz , annotationClass ) ;
public class Criteria { /** * The < code > in < / code > operator is analogous to the SQL IN modifier , allowing you * to specify an array of possible matches . * @ param c the collection containing the values to match against * @ return the criteria */ public Criteria in ( Collection < ? > c ) { } }
notNull ( c , "collection can not be null" ) ; this . criteriaType = RelationalOperator . IN ; this . right = new ValueListNode ( c ) ; return this ;
public class UserVerificationService { /** * Verifies the identity of the given user via the Duo multi - factor * authentication service . If a signed response from Duo has not already * been provided , a signed response from Duo is requested in the * form of additional expected credentials . Any provided signed ...
// Pull the original HTTP request used to authenticate Credentials credentials = authenticatedUser . getCredentials ( ) ; HttpServletRequest request = credentials . getRequest ( ) ; // Ignore anonymous users if ( authenticatedUser . getIdentifier ( ) . equals ( AuthenticatedUser . ANONYMOUS_IDENTIFIER ) ) return ; // R...
public class PanelGridRenderer { /** * Read the colSpans attribute . * @ return a integer array * @ throws FacesException * if the attribute is missing or invalid . */ protected int [ ] getColSpanArray ( PanelGrid panelGrid ) { } }
String columnsCSV = panelGrid . getColSpans ( ) ; if ( null == columnsCSV || columnsCSV . trim ( ) . length ( ) == 0 ) { columnsCSV = panelGrid . getColumns ( ) ; if ( "1" . equals ( columnsCSV ) ) { columnsCSV = "12" ; } else if ( "2" . equals ( columnsCSV ) ) { columnsCSV = "6,6" ; } else if ( "3" . equals ( columnsC...
public class NumberMap { /** * Creates a NumberMap for Floats . * @ param < K > * @ return NumberMap & lt ; K , Float & gt ; */ public static < K > NumberMap < K , Float > newFloatMap ( ) { } }
return new NumberMap < K , Float > ( ) { @ Override public void add ( K key , Float addend ) { put ( key , containsKey ( key ) ? ( get ( key ) + addend ) : addend ) ; } @ Override public void sub ( K key , Float subtrahend ) { put ( key , ( containsKey ( key ) ? get ( key ) : 0f ) - subtrahend ) ; } } ;
public class Graphics { /** * Get raster buffer from data . * @ param img The image buffer ( must not be < code > null < / code > ) . * @ param fr The first red . * @ param fg The first green . * @ param fb The first blue . * @ return The rastered image . * @ throws LionEngineException If invalid arguments ...
return factoryGraphic . getRasterBuffer ( img , fr , fg , fb ) ;
public class HdfsTaskLogs { /** * Due to https : / / issues . apache . org / jira / browse / HDFS - 13 " : " are not allowed in * path names . So we format paths differently for HDFS . */ private Path getTaskReportsFileFromId ( String taskId ) { } }
return new Path ( mergePaths ( config . getDirectory ( ) , taskId . replace ( ':' , '_' ) + ".reports.json" ) ) ;
public class HtmlDataTable { /** * < p > Set the value of the < code > summary < / code > property . < / p > */ public void setSummary ( java . lang . String summary ) { } }
getStateHelper ( ) . put ( PropertyKeys . summary , summary ) ; handleAttribute ( "summary" , summary ) ;
public class Utils { /** * Load a string from the given buffer , reading first the two bytes of len * and then the UTF - 8 bytes of the string . * @ return the decoded string or null if NEED _ DATA */ static String decodeString ( ByteBuf in ) throws UnsupportedEncodingException { } }
if ( in . readableBytes ( ) < 2 ) { return null ; } // int strLen = Utils . readWord ( in ) ; int strLen = in . readUnsignedShort ( ) ; if ( in . readableBytes ( ) < strLen ) { return null ; } byte [ ] strRaw = new byte [ strLen ] ; in . readBytes ( strRaw ) ; return new String ( strRaw , "UTF-8" ) ;
public class QDate { /** * Prints the time in ISO 8601 */ public String printISO8601 ( ) { } }
StringBuilder sb = new StringBuilder ( ) ; if ( _year > 0 ) { sb . append ( ( _year / 1000 ) % 10 ) ; sb . append ( ( _year / 100 ) % 10 ) ; sb . append ( ( _year / 10 ) % 10 ) ; sb . append ( _year % 10 ) ; sb . append ( '-' ) ; sb . append ( ( ( _month + 1 ) / 10 ) % 10 ) ; sb . append ( ( _month + 1 ) % 10 ) ; sb . ...
public class UScript { /** * Sets code point c ' s Script _ Extensions as script code integers into the output BitSet . * < ul > * < li > If c does have Script _ Extensions , then the return value is * the negative number of Script _ Extensions codes ( = - set . cardinality ( ) ) ; * in this case , the Script p...
set . clear ( ) ; int scriptX = UCharacterProperty . INSTANCE . getAdditional ( c , 0 ) & UCharacterProperty . SCRIPT_X_MASK ; if ( scriptX < UCharacterProperty . SCRIPT_X_WITH_COMMON ) { set . set ( scriptX ) ; return scriptX ; } char [ ] scriptExtensions = UCharacterProperty . INSTANCE . m_scriptExtensions_ ; int scx...
public class CPDefinitionGroupedEntryUtil { /** * Returns the first cp definition grouped entry in the ordered set where uuid = & # 63 ; and companyId = & # 63 ; . * @ param uuid the uuid * @ param companyId the company ID * @ param orderByComparator the comparator to order the set by ( optionally < code > null <...
return getPersistence ( ) . fetchByUuid_C_First ( uuid , companyId , orderByComparator ) ;
public class MoreCollectors { /** * Returns a { @ code Collector } which collects at most specified number of * the least stream elements according to the natural order into the * { @ link List } . The resulting { @ code List } is sorted in natural order * ( least element is the first ) . The order of equal eleme...
return least ( Comparator . < T > naturalOrder ( ) , n ) ;
public class PortMapping { /** * First check system properties , then the variables given */ private Integer getPortFromProjectOrSystemProperty ( String var ) { } }
String sysProp = System . getProperty ( var ) ; if ( sysProp != null ) { return getAsIntOrNull ( sysProp ) ; } if ( projProperties . containsKey ( var ) ) { return getAsIntOrNull ( projProperties . getProperty ( var ) ) ; } return null ;
public class StringUtils { /** * < p > Compares two Strings , and returns the portion where they differ . * ( More precisely , return the remainder of the second String , * starting from where it ' s different from the first . ) < / p > * < p > For example , * < code > difference ( " i am a machine " , " i am a...
if ( str1 == null ) { return str2 ; } if ( str2 == null ) { return str1 ; } int at = indexOfDifference ( str1 , str2 ) ; if ( at == INDEX_NOT_FOUND ) { return EMPTY ; } return str2 . substring ( at ) ;
public class ClaimValueInjectionEndpoint { /** * Verify that values exist and that types match the corresponding Claims enum * @ return a series of pass / fail statements regarding the check for each injected claim */ @ GET @ Path ( "/verifyInjectedOptionalCustomMissing" ) @ Produces ( MediaType . APPLICATION_JSON ) ...
boolean pass = false ; String msg ; // custom - missing Optional < Long > customValue = custom . getValue ( ) ; if ( customValue == null ) { msg = "custom-missing value is null, FAIL" ; } else if ( ! customValue . isPresent ( ) ) { msg = "custom-missing PASS" ; pass = true ; } else { msg = String . format ( "custom: %s...
public class AWSDatabaseMigrationServiceClient { /** * Deletes an AWS DMS event subscription . * @ param deleteEventSubscriptionRequest * @ return Result of the DeleteEventSubscription operation returned by the service . * @ throws ResourceNotFoundException * The resource could not be found . * @ throws Inval...
request = beforeClientExecution ( request ) ; return executeDeleteEventSubscription ( request ) ;
public class CmsOUHandler { /** * Gets List of managable OU names for the current user . < p > * @ param cms CmsObject * @ return List of String */ public static List < String > getManagableOUs ( CmsObject cms ) { } }
List < String > ous = new ArrayList < String > ( ) ; try { for ( CmsRole role : OpenCms . getRoleManager ( ) . getRolesOfUser ( cms , cms . getRequestContext ( ) . getCurrentUser ( ) . getName ( ) , "" , true , false , true ) ) { if ( role . getRoleName ( ) . equals ( CmsRole . ACCOUNT_MANAGER . getRoleName ( ) ) ) { i...
public class ListVocabulariesResult { /** * A list of objects that describe the vocabularies that match the search criteria in the request . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setVocabularies ( java . util . Collection ) } or { @ link # withVocab...
if ( this . vocabularies == null ) { setVocabularies ( new java . util . ArrayList < VocabularyInfo > ( vocabularies . length ) ) ; } for ( VocabularyInfo ele : vocabularies ) { this . vocabularies . add ( ele ) ; } return this ;
public class CPDefinitionSpecificationOptionValuePersistenceImpl { /** * Returns all the cp definition specification option values where CPDefinitionId = & # 63 ; and CPSpecificationOptionId = & # 63 ; . * @ param CPDefinitionId the cp definition ID * @ param CPSpecificationOptionId the cp specification option ID ...
return findByC_CSO ( CPDefinitionId , CPSpecificationOptionId , QueryUtil . ALL_POS , QueryUtil . ALL_POS , null ) ;
public class CommerceShippingMethodPersistenceImpl { /** * Returns the commerce shipping method with the primary key or throws a { @ link com . liferay . portal . kernel . exception . NoSuchModelException } if it could not be found . * @ param primaryKey the primary key of the commerce shipping method * @ return th...
CommerceShippingMethod commerceShippingMethod = fetchByPrimaryKey ( primaryKey ) ; if ( commerceShippingMethod == null ) { if ( _log . isDebugEnabled ( ) ) { _log . debug ( _NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey ) ; } throw new NoSuchShippingMethodException ( _NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey ) ; } r...
public class SparkExport { /** * Quick and dirty CSV export : one file per sequence , with shuffling of the order of sequences */ public static void exportCSVSequenceLocal ( File baseDir , JavaRDD < List < List < Writable > > > sequences , long seed ) throws Exception { } }
baseDir . mkdirs ( ) ; if ( ! baseDir . isDirectory ( ) ) throw new IllegalArgumentException ( "File is not a directory: " + baseDir . toString ( ) ) ; String baseDirStr = baseDir . toString ( ) ; List < String > fileContents = sequences . map ( new SequenceToStringFunction ( "," ) ) . collect ( ) ; if ( ! ( fileConten...
public class CasEntryPoint { /** * Constructs a service url from the HttpServletRequest or from the given * serviceUrl . Prefers the serviceUrl provided if both a serviceUrl and a * serviceName . * @ param request the HttpServletRequest * @ param response the HttpServletResponse * @ param service the configur...
if ( Strings . isNotBlank ( service ) ) { return response . encodeURL ( service ) ; } final StringBuilder buffer = new StringBuilder ( ) ; if ( ! serverName . startsWith ( "https://" ) && ! serverName . startsWith ( "http://" ) ) { buffer . append ( request . isSecure ( ) ? "https://" : "http://" ) ; } buffer . append ...
public class ComponentBorder { /** * The complimentary edges of the Border may need to be adjusted to allow * the component to fit completely in the bounds of the parent component . */ private void adjustBorderInsets ( ) { } }
Insets parentInsets = parent . getInsets ( ) ; // May need to adust the height of the parent component to fit // the component in the Border if ( edge == Edge . RIGHT || edge == Edge . LEFT ) { int parentHeight = parent . getPreferredSize ( ) . height - parentInsets . top - parentInsets . bottom ; int diff = component ...
public class DivSufSort { /** * Binary partition for substrings . */ private int ssPartition ( int PA , int first , int last , int depth ) { } }
int a , b ; // SA pointer int t ; for ( a = first - 1 , b = last ; ; ) { for ( ; ( ++ a < b ) && ( ( SA [ PA + SA [ a ] ] + depth ) >= ( SA [ PA + SA [ a ] + 1 ] + 1 ) ) ; ) { SA [ a ] = ~ SA [ a ] ; } for ( ; ( a < -- b ) && ( ( SA [ PA + SA [ b ] ] + depth ) < ( SA [ PA + SA [ b ] + 1 ] + 1 ) ) ; ) { } if ( b <= a ) ...
public class ServerHandshakeHandler { /** * Determine if this request represents a web - socket upgrade request . * @ param request The request to inspect . * @ return < code > true < / code > if this request is indeed a web - socket upgrade * request , otherwise < code > false < / code > . */ protected boolean i...
String connectionHeader = request . getHeader ( Names . CONNECTION ) ; String upgradeHeader = request . getHeader ( Names . UPGRADE ) ; if ( connectionHeader == null || upgradeHeader == null ) { return false ; } if ( connectionHeader . trim ( ) . toLowerCase ( ) . contains ( Values . UPGRADE . toLowerCase ( ) ) ) { if ...
public class AWSAppSyncClient { /** * Retrieves a < code > GraphqlApi < / code > object . * @ param getGraphqlApiRequest * @ return Result of the GetGraphqlApi operation returned by the service . * @ throws BadRequestException * The request is not well formed . For example , a value is invalid or a required fie...
request = beforeClientExecution ( request ) ; return executeGetGraphqlApi ( request ) ;
public class Artefact { /** * Adds an attribute value . If the attribute doesn ' t exist it will be created . * @ param attributeName the name of the attribute . * @ param attributeValue the value of the attribute in the given environment . * @ param in the environment in which the attribute value applies */ publ...
if ( in == null ) in = GlobalEnvironment . INSTANCE ; Attribute attr = attributes . get ( attributeName ) ; if ( attr == null ) { attr = new Attribute ( attributeName ) ; attributes . put ( attr . getName ( ) , attr ) ; } attr . addValue ( attributeValue , in ) ; Map < String , Object > valueMap = contentMap . get ( in...
public class BsonUtils { /** * The BSON specification ( or rather the < a href = " http : / / www . mongodb . org / display / DOCS / Object + IDs " > MongoDB * documentation < / a > ) defines the structure of this data : * < quote > " A BSON ObjectID is a 12 - byte value consisting of a 4 - byte timestamp ( seconds...
// Compute the values in big - endian . . . int time = ( ( bytes [ 0 ] & 0xff ) << 24 ) + ( ( bytes [ 1 ] & 0xff ) << 16 ) + ( ( bytes [ 2 ] & 0xff ) << 8 ) + ( ( bytes [ 3 ] & 0xff ) << 0 ) ; int machine = ( ( bytes [ 4 ] & 0xff ) << 16 ) + ( ( bytes [ 5 ] & 0xff ) << 8 ) + ( ( bytes [ 6 ] & 0xff ) << 0 ) ; int proces...
public class ApplicationHealthIndicator { /** * { @ inheritDoc } */ @ Override public final Health health ( ) { } }
logger . debug ( "Health" ) ; final Builder builder = Health . up ( ) ; logger . debug ( " " + appInfo . getVersion ( ) ) ; builder . withDetail ( "version" , appInfo . getVersion ( ) ) ; final List < Map < String , Object > > details = loader . details ( ) ; logger . debug ( " " + details . size ( ) + " datasets...
public class Group { /** * Method to initialize the Cache of this CacheObjectInterface . * @ see # CACHE */ public static void initialize ( ) { } }
if ( InfinispanCache . get ( ) . exists ( Group . IDCACHE ) ) { InfinispanCache . get ( ) . < Long , Group > getCache ( Group . IDCACHE ) . clear ( ) ; } else { InfinispanCache . get ( ) . < Long , Group > getCache ( Group . IDCACHE ) . addListener ( new CacheLogListener ( Group . LOG ) ) ; } if ( InfinispanCache . get...
public class PrimitiveCases { /** * Matches a short . * < p > If matched , the short value is extracted . */ public static DecomposableMatchBuilder1 < Short , Short > caseShort ( MatchesAny s ) { } }
List < Matcher < Object > > matchers = new ArrayList < > ( ) ; matchers . add ( any ( ) ) ; return new DecomposableMatchBuilder1 < > ( matchers , 0 , new PrimitiveFieldExtractor < > ( Short . class ) ) ;
public class AJP13OutputStream { public void writeHeader ( HttpMessage httpMessage ) throws IOException { } }
HttpResponse response = ( HttpResponse ) httpMessage ; response . setState ( HttpMessage . __MSG_SENDING ) ; _ajpResponse . resetData ( ) ; _ajpResponse . addByte ( AJP13ResponsePacket . __SEND_HEADERS ) ; _ajpResponse . addInt ( response . getStatus ( ) ) ; _ajpResponse . addString ( response . getReason ( ) ) ; int m...
public class AbstractRemoteTransport { /** * localUpdateLongRunningFree * @ param logicalAddress the logical address * @ param freeCount the free count */ public void localUpdateLongRunningFree ( Address logicalAddress , Long freeCount ) { } }
if ( trace ) log . tracef ( "LOCAL_UPDATE_LONGRUNNING_FREE(%s, %d)" , logicalAddress , freeCount ) ; DistributedWorkManager dwm = workManagerCoordinator . resolveDistributedWorkManager ( logicalAddress ) ; if ( dwm != null ) { Collection < NotificationListener > copy = new ArrayList < NotificationListener > ( dwm . get...
public class BusItinerary { /** * Replies the list of the road segments of the bus itinerary . * @ return a list of road segments */ @ Pure public Iterable < RoadSegment > roadSegments ( ) { } }
return new Iterable < RoadSegment > ( ) { @ Override public Iterator < RoadSegment > iterator ( ) { return roadSegmentsIterator ( ) ; } } ;
public class ArrayUtil { /** * Allocate a new array of the same type as another array . * @ param oldElements on which the new array is based . * @ param length of the new array . * @ param < T > type of the array . * @ return the new array of requested length . */ @ SuppressWarnings ( "unchecked" ) public stat...
return ( T [ ] ) Array . newInstance ( oldElements . getClass ( ) . getComponentType ( ) , length ) ;
public class JamaEIG { /** * Return the block diagonal eigenvalue matrix * @ return D */ public Matrix getD ( ) { } }
Matrix X = MatrixFactory . createMatrix ( n , n ) ; for ( int i = 0 ; i < n ; i ++ ) { X . set ( i , i , d [ i ] ) ; if ( e [ i ] > 0 ) { X . set ( i , i + 1 , e [ i ] ) ; } else if ( e [ i ] < 0 ) { X . set ( i , i - 1 , e [ i ] ) ; } } return X ;
public class EncodeTask { /** * Handle encoding of the plaintext provided . Capture any * Exceptions and print the stack trace . * @ param plaintext * @ param encodingType * @ param encodingKey * @ return ciphertext * @ throws InvalidPasswordEncodingException * @ throws UnsupportedCryptoAlgorithmException...
String ret = null ; try { ret = PasswordUtil . encode ( plaintext , encodingType == null ? PasswordUtil . getDefaultEncoding ( ) : encodingType , properties ) ; } catch ( InvalidPasswordEncodingException e ) { e . printStackTrace ( stderr ) ; throw e ; } catch ( UnsupportedCryptoAlgorithmException e ) { e . printStackT...
public class SparseIntegerVectorView { /** * { @ inheritDoc } */ @ SuppressWarnings ( "unchecked" ) @ Override public double magnitude ( ) { } }
// Check whether the current magnitude is valid and if not , recompute it if ( magnitude < 0 ) { double m = 0 ; // Special case if we can iterate in time linear to the number of // non - zero values if ( sparseVector instanceof Iterable ) { for ( IntegerEntry e : ( Iterable < IntegerEntry > ) sparseVector ) { int idx =...
public class Covers { /** * Computes an incremental structural cover for a given automaton , i . e . a cover that only contains the missing * sequences for obtaining a complete structural cover . * @ param automaton * the automaton for which the cover should be computed * @ param inputs * the set of input sym...
final int oldCoverSize = newCover . size ( ) ; incrementalCover ( automaton , inputs , oldCover , Collections . emptySet ( ) , newCover :: add , newCover :: add ) ; return oldCoverSize < newCover . size ( ) ;
public class KerasBatchNormalization { /** * Get BatchNormalization momentum parameter from Keras layer configuration . * @ param layerConfig dictionary containing Keras layer configuration * @ return momentum * @ throws InvalidKerasConfigurationException Invalid Keras config */ private double getMomentumFromConf...
Map < String , Object > innerConfig = KerasLayerUtils . getInnerLayerConfigFromConfig ( layerConfig , conf ) ; if ( ! innerConfig . containsKey ( LAYER_FIELD_MOMENTUM ) ) throw new InvalidKerasConfigurationException ( "Keras BatchNorm layer config missing " + LAYER_FIELD_MOMENTUM + " field" ) ; return ( double ) innerC...
public class JavaTokenizer { /** * Report an error at the given position using the provided arguments . */ protected void lexError ( int pos , String key , Object ... args ) { } }
log . error ( pos , key , args ) ; tk = TokenKind . ERROR ; errPos = pos ;
public class SimpleTemplate { /** * Replace string in the template text * @ param varMap variable map * @ return replaced string */ public String replace ( Map < String , String > varMap ) { } }
StringBuilder newString = new StringBuilder ( ) ; int p = 0 ; int p0 = 0 ; while ( true ) { p = templateText . indexOf ( "${" , p ) ; if ( p == - 1 ) { newString . append ( templateText . substring ( p0 , templateText . length ( ) ) ) ; break ; } else { newString . append ( templateText . substring ( p0 , p ) ) ; } p0 ...
public class SnapshotClient { /** * Gets the access control policy for a resource . May be empty if no such policy or resource * exists . * < p > Sample code : * < pre > < code > * try ( SnapshotClient snapshotClient = SnapshotClient . create ( ) ) { * ProjectGlobalSnapshotResourceName resource = ProjectGloba...
GetIamPolicySnapshotHttpRequest request = GetIamPolicySnapshotHttpRequest . newBuilder ( ) . setResource ( resource ) . build ( ) ; return getIamPolicySnapshot ( request ) ;
public class ConverterRegistry { /** * 登记自定义转换器 * @ param type 转换的目标类型 * @ param converterClass 转换器类 , 必须有默认构造方法 * @ return { @ link ConverterRegistry } */ public ConverterRegistry putCustom ( Type type , Class < ? extends Converter < ? > > converterClass ) { } }
return putCustom ( type , ReflectUtil . newInstance ( converterClass ) ) ;
public class Token { /** * Creates a token that represents a symbol , using a library for the text . */ public static Token newSymbol ( int type , int startLine , int startColumn ) { } }
return new Token ( type , Types . getText ( type ) , startLine , startColumn ) ;
public class KafkaAvroSchemaRegistry { /** * Fetch schema by key . */ @ Override protected Schema fetchSchemaByKey ( String key ) throws SchemaRegistryException { } }
String schemaUrl = KafkaAvroSchemaRegistry . this . url + GET_RESOURCE_BY_ID + key ; GetMethod get = new GetMethod ( schemaUrl ) ; int statusCode ; String schemaString ; HttpClient httpClient = this . borrowClient ( ) ; try { statusCode = httpClient . executeMethod ( get ) ; schemaString = get . getResponseBodyAsString...
public class TransmittableThreadLocal { /** * see { @ link InheritableThreadLocal # get ( ) } */ @ Override public final T get ( ) { } }
T value = super . get ( ) ; if ( null != value ) addValue ( ) ; return value ;
public class OSKL { /** * Updates the average model to reflect the current time average */ private void updateAverage ( ) { } }
if ( t == last_t || t < burnIn ) return ; else if ( last_t < burnIn ) // first update since done burning { for ( int i = 0 ; i < alphaAveraged . size ( ) ; i ++ ) alphaAveraged . set ( i , alphas . get ( i ) ) ; } double w = t - last_t ; // time elapsed for ( int i = 0 ; i < alphaAveraged . size ( ) ; i ++ ) { double d...
public class XSequentialEventBuffer { /** * Retrieves the event recorded at the specified position * @ param eventIndex * Position of the requested event , defined to be within * < code > [ 0 , size ( ) - 1 ] < / code > . * @ return The requested event . */ public synchronized XEvent get ( int eventIndex ) thro...
// check for index sanity if ( eventIndex < 0 || eventIndex >= size ) { throw new IndexOutOfBoundsException ( ) ; } // determine and set appropriate file pointer position navigateToIndex ( eventIndex ) ; // read and return requested audit trail entry return read ( ) ;
public class AbstractDestinationDescriptor { /** * ( non - Javadoc ) * @ see net . timewalker . ffmq4 . utils . Checkable # check ( ) */ @ Override public void check ( ) throws JMSException { } }
if ( StringTools . isEmpty ( name ) ) throw new InvalidDescriptorException ( "Missing descriptor property : name" ) ; checkMinValue ( maxNonPersistentMessages , 0 , "maximum non persistent messages" ) ; checkMinValue ( initialBlockCount , 0 , "initial block count" ) ; checkMinValue ( maxBlockCount , 0 , "maximum block ...
public class Postconditions { /** * An { @ code int } specialized version of { @ link # checkPostcondition ( Object , * ContractConditionType ) } . * @ param value The value * @ param condition The predicate * @ return value * @ throws PostconditionViolationException If the predicate is false */ public static...
return checkPostconditionI ( value , condition . predicate ( ) , condition . describer ( ) ) ;
public class MonitoringConfigurationUpdateMarshaller { /** * Marshall the given parameter object . */ public void marshall ( MonitoringConfigurationUpdate monitoringConfigurationUpdate , ProtocolMarshaller protocolMarshaller ) { } }
if ( monitoringConfigurationUpdate == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( monitoringConfigurationUpdate . getConfigurationTypeUpdate ( ) , CONFIGURATIONTYPEUPDATE_BINDING ) ; protocolMarshaller . marshall ( monitoringConfiguratio...
public class LoginAccount { /** * Sets the value of provided property to null . * @ param propName * allowed object is { @ link String } */ @ Override public void unset ( String propName ) { } }
if ( propName . equals ( PROP_CERTIFICATE ) ) { unsetCertificate ( ) ; } super . unset ( propName ) ;
public class CategoryRoute { /** * Returns the LEX types * @ return the LEX types */ public List < TypeCategory > getLEXTypes ( ) { } }
ClientResource resource = new ClientResource ( Route . LEX_TYPE . url ( ) ) ; try { Representation repr = resource . get ( ) ; return mapper . readValue ( repr . getText ( ) , new TypeReference < List < TypeCategory > > ( ) { } ) ; } catch ( IOException ex ) { LEX4JLogger . log ( Level . WARNING , "Could not retrieve L...
public class KickUserImpl { /** * / * ( non - Javadoc ) * @ see com . lagente . core . command . BaseCommand # execute ( ) */ @ SuppressWarnings ( "unchecked" ) @ Override public String execute ( ) { } }
User sfsUser = CommandUtil . getSfsUser ( userToKick , api ) ; User sfsMod = ( modUser != null ) ? CommandUtil . getSfsUser ( modUser , api ) : null ; api . kickUser ( sfsUser , sfsMod , kickMessage , delaySeconds ) ; return userToKick ;
public class SQLSupport { /** * Map a { @ link FilterOperationHint } to a SQL - specific { @ link FilterOperation } . When using SQL as a query * language , all of the operations defined in { @ link FilterOperationHint } should be supported . * @ param hint the hint * @ return the { @ link FilterOperation } match...
for ( int i = 0 ; i < FILTER_OPERATIONS . length ; i ++ ) { FilterOperation op = FILTER_OPERATIONS [ i ] ; if ( op . getOperationHint ( ) . equals ( hint ) ) return op ; } return null ;
public class CloudFoundryCustomContextPathExample { /** * tag : : configuration [ ] */ @ Bean public TomcatServletWebServerFactory servletWebServerFactory ( ) { } }
return new TomcatServletWebServerFactory ( ) { @ Override protected void prepareContext ( Host host , ServletContextInitializer [ ] initializers ) { super . prepareContext ( host , initializers ) ; StandardContext child = new StandardContext ( ) ; child . addLifecycleListener ( new Tomcat . FixContextListener ( ) ) ; c...
public class BundleRepositoryRegistry { /** * Add the default repositories for the product * @ param processName If set to a processName , a cache will be created in that process ' s workarea . A null value disables caching . * @ param useMsgs This setting is passed on to the held ContentLocalBundleRepositories . ...
BundleRepositoryRegistry . isClient = isClient ; BundleRepositoryRegistry . initializeDefaults ( processName , useMsgs ) ;
public class IntSequenceIDSource { /** * { @ inheritDoc } */ public Integer nextID ( ) { } }
lock . lock ( ) ; try { if ( lastID == Integer . MAX_VALUE ) { long hours = ( System . currentTimeMillis ( ) - startTime ) / SECONDS_IN_HOUR ; throw new IDSourceExhaustedException ( "32-bit ID source exhausted after " + hours + " hours." ) ; } ++ lastID ; return lastID ; } finally { lock . unlock ( ) ; }
public class ExcelFunctions { /** * Repeats text a given number of times */ public static String rept ( EvaluationContext ctx , Object text , Object numberTimes ) { } }
int _numberTimes = Conversions . toInteger ( numberTimes , ctx ) ; if ( _numberTimes < 0 ) { throw new RuntimeException ( "Number of times can't be negative" ) ; } return StringUtils . repeat ( Conversions . toString ( text , ctx ) , _numberTimes ) ;
public class AbstractMedia { /** * Add the specified observer to this media element . */ protected void addObserver ( Object obs ) { } }
if ( _observers == null ) { _observers = ObserverList . newFastUnsafe ( ) ; } _observers . add ( obs ) ;
public class GenerateInverseFromMinor { /** * Put the core auto - code algorithm here so an external class can call it */ public void printMinors ( int matrix [ ] , int N , PrintStream stream ) { } }
this . N = N ; this . stream = stream ; // compute all the minors int index = 0 ; for ( int i = 1 ; i <= N ; i ++ ) { for ( int j = 1 ; j <= N ; j ++ , index ++ ) { stream . print ( " double m" + i + "" + j + " = " ) ; if ( ( i + j ) % 2 == 1 ) stream . print ( "-( " ) ; printTopMinor ( matrix , i - 1 , j - 1 , ...
public class Logger { /** * Log an INFO message . * If the logger is currently enabled for the INFO message * level then the given message is forwarded to all the * registered output Handler objects . * @ param msg The string message ( or a key in the message catalog ) */ public void info ( String msg ) { } }
if ( Level . INFO . intValue ( ) < levelValue ) { return ; } log ( Level . INFO , msg ) ;
public class MoleculerError { /** * - - - LOCAL / REMOTE STACK TRACE - - - */ public String getStack ( ) { } }
if ( stackTrace == null ) { if ( stack == null ) { StringWriter sw = new StringWriter ( 512 ) ; PrintWriter pw = new PrintWriter ( sw , true ) ; super . printStackTrace ( pw ) ; stackTrace = sw . toString ( ) . trim ( ) ; } else { stackTrace = stack . trim ( ) ; } } return stackTrace ;
public class ClassNameDataUpdater { /** * The update method is overridden here directly since the usual extraction method * is not needed * { @ inheritDoc } */ @ Override void update ( JSONObject pJSONObject , MBeanInfo pMBeanInfo , Stack < String > pPathStack ) { } }
verifyThatPathIsEmpty ( pPathStack ) ; pJSONObject . put ( getKey ( ) , pMBeanInfo . getClassName ( ) ) ;
public class ReferSubscriber { /** * This method is the same as refresh ( duration , eventId , timeout ) except that instead of creating * the SUBSCRIBE request from parameters passed in , the given request message parameter is used * for sending out the SUBSCRIBE message . * The Request parameter passed into thi...
return refreshSubscription ( req , timeout , parent . getProxyHost ( ) != null ) ;
public class AtomContainer { /** * { @ inheritDoc } */ @ Override public ILonePair removeLonePair ( int position ) { } }
ILonePair lp = lonePairs [ position ] ; lp . removeListener ( this ) ; for ( int i = position ; i < lonePairCount - 1 ; i ++ ) { lonePairs [ i ] = lonePairs [ i + 1 ] ; } lonePairs [ lonePairCount - 1 ] = null ; lonePairCount -- ; notifyChanged ( ) ; return lp ;
public class CmsFloatDecoratedPanel { /** * Updates the vertical margin of the float box such that its vertical middle point coincides * with the vertical middle point of the primary panel . < p > */ private void updateVerticalMargin ( ) { } }
int floatHeight = m_floatBox . getOffsetHeight ( ) ; int primaryHeight = m_primary . getOffsetHeight ( ) ; int verticalOffset = ( primaryHeight - floatHeight ) / 2 ; m_floatBox . getElement ( ) . getStyle ( ) . setMarginTop ( verticalOffset , Unit . PX ) ;
public class Filter { /** * Checks that second clone contains first one . * Clone A is contained in another clone B , if every part pA from A has part pB in B , * which satisfy the conditions : * < pre > * ( pA . resourceId = = pB . resourceId ) and ( pB . unitStart < = pA . unitStart ) and ( pA . unitEnd < = p...
if ( first . getCloneUnitLength ( ) > second . getCloneUnitLength ( ) ) { return false ; } List < ClonePart > firstParts = first . getCloneParts ( ) ; List < ClonePart > secondParts = second . getCloneParts ( ) ; return SortedListsUtils . contains ( secondParts , firstParts , new ContainsInComparator ( second . getClon...
public class Predicate { /** * A list of the conditions that determine when the trigger will fire . * @ param conditions * A list of the conditions that determine when the trigger will fire . */ public void setConditions ( java . util . Collection < Condition > conditions ) { } }
if ( conditions == null ) { this . conditions = null ; return ; } this . conditions = new java . util . ArrayList < Condition > ( conditions ) ;
public class FactoryFinder { /** * Create an instance of a class using the specified ClassLoader and optionally fall back to the * current ClassLoader if not found . * @ param className Name of the concrete class corresponding to the service provider * @ param cl ClassLoader to use to load the class , null means ...
try { Class < ? > providerClass ; if ( cl == null ) { // If classloader is null Use the bootstrap ClassLoader . // Thus Class . forName ( String ) will use the current // ClassLoader which will be the bootstrap ClassLoader . providerClass = Class . forName ( className ) ; } else { try { providerClass = cl . loadClass (...
public class MagickUtil { /** * Converts a gray { @ code MagickImage } to a { @ code BufferedImage } , of * type { @ code TYPE _ USHORT _ GRAY } or { @ code TYPE _ BYTE _ GRAY } . * @ param pImage the original { @ code MagickImage } * @ param pAlpha keep alpha channel * @ return a new { @ code BufferedImage } ...
Dimension size = pImage . getDimension ( ) ; int length = size . width * size . height ; int bands = pAlpha ? 2 : 1 ; byte [ ] pixels = new byte [ length * bands ] ; // TODO : Make a fix for 16 bit TYPE _ USHORT _ GRAY ? ! // Note : The ordering AI or I corresponds to BufferedImage // TYPE _ CUSTOM and TYPE _ BYTE _ GR...
public class InMemoryWordNetBinaryArray { /** * Create caches of WordNet to speed up matching . * @ param componentKey a key to the component in the configuration * @ param properties configuration * @ throws SMatchException SMatchException */ public static void createWordNetCaches ( String componentKey , Propert...
properties = getComponentProperties ( makeComponentPrefix ( componentKey , InMemoryWordNetBinaryArray . class . getSimpleName ( ) ) , properties ) ; if ( properties . containsKey ( JWNL_PROPERTIES_PATH_KEY ) ) { // initialize JWNL ( this must be done before JWNL library can be used ) try { final String configPath = pro...
public class MessageHeaderUtils { /** * Check if given header name belongs to Spring Integration internal headers . * This is given if header name starts with internal header prefix or * matches one of Spring ' s internal header names . * @ param headerName * @ return */ public static boolean isSpringInternalHe...
// " springintegration _ " makes Citrus work with Spring Integration 1 . x release if ( headerName . startsWith ( "springintegration_" ) ) { return true ; } else if ( headerName . equals ( MessageHeaders . ID ) ) { return true ; } else if ( headerName . equals ( MessageHeaders . TIMESTAMP ) ) { return true ; } else if ...
public class ClientSocketFactory { /** * Returns a valid recycled stream from the idle pool to the backend . * If the stream has been in the pool for too long ( > live _ time ) , * close it instead . * @ return the socket ' s read / write pair . */ private ClientSocket openRecycle ( ) { } }
long now = CurrentTime . currentTime ( ) ; ClientSocket stream = null ; synchronized ( this ) { if ( _idleHead != _idleTail ) { stream = _idle [ _idleHead ] ; long freeTime = stream . getIdleStartTime ( ) ; _idle [ _idleHead ] = null ; _idleHead = ( _idleHead + _idle . length - 1 ) % _idle . length ; // System . out . ...
public class AuthleteApiImpl { /** * Call an API with HTTP DELETE method and Service Owner credentials . */ private < TResponse > void callServiceOwnerDeleteApi ( String path , Map < String , String > queryParams ) throws AuthleteApiException { } }
callDeleteApi ( mServiceOwnerCredentials , path , queryParams ) ;
public class ServiceGraphModule { /** * Creates the new { @ code ServiceGraph } without circular dependencies and * intermediary nodes * @ param injector injector for building the graphs of objects * @ return created ServiceGraph */ @ Provides @ Singleton synchronized ServiceGraph serviceGraph ( Injector injector...
serviceGraphModuleOptionalInitializer . accept ( this ) ; if ( serviceGraph == null ) { serviceGraph = ServiceGraph . create ( ) . withStartCallback ( ( ) -> { createGuiceGraph ( injector , serviceGraph ) ; serviceGraph . removeIntermediateNodes ( ) ; } ) . withNodeSuffixes ( key -> { List < ? > list = injector . getIn...
public class RandomProjectedNeighborsAndDensities { /** * Split the data set by distances . * @ param ind Object index * @ param begin Interval begin * @ param end Interval end * @ param tpro Projection * @ param rand Random generator * @ return Splitting point */ public int splitByDistance ( ArrayModifiabl...
DBIDArrayIter it = ind . iter ( ) ; // pick random splitting point based on distance double rmin = Double . MAX_VALUE * .5 , rmax = - Double . MAX_VALUE * .5 ; int minInd = begin , maxInd = end - 1 ; for ( it . seek ( begin ) ; it . getOffset ( ) < end ; it . advance ( ) ) { double currEle = tpro . doubleValue ( it ) ;...
public class SheetFilterResourcesImpl { /** * Get all filters . * It mirrors to the following Smartsheet REST API method : GET / sheets / { sheetId } / filters * Exceptions : * IllegalArgumentException : if any argument is null * InvalidRequestException : if there is any problem with the REST API request * Au...
String path = "sheets/" + sheetId + "/filters" ; HashMap < String , Object > parameters = new HashMap < String , Object > ( ) ; if ( pagination != null ) { parameters = pagination . toHashMap ( ) ; } path += QueryUtil . generateUrl ( null , parameters ) ; return this . listResourcesWithWrapper ( path , SheetFilter . cl...
public class StringConvert { /** * Checks if a suitable converter exists for the type . * This performs the same checks as the { @ code findConverter } methods . * Calling this before { @ code findConverter } will cache the converter . * Note that all exceptions , including developer errors are caught and hidden ...
try { return cls != null && findConverterQuiet ( cls ) != null ; } catch ( RuntimeException ex ) { return false ; }
public class FieldSet { /** * Like { @ link # writeTo } but uses MessageSet wire format . */ public void writeMessageSetTo ( final CodedOutputStream output ) throws IOException { } }
for ( int i = 0 ; i < fields . getNumArrayEntries ( ) ; i ++ ) { writeMessageSetTo ( fields . getArrayEntryAt ( i ) , output ) ; } for ( final Map . Entry < FieldDescriptorType , Object > entry : fields . getOverflowEntries ( ) ) { writeMessageSetTo ( entry , output ) ; }
public class MessageStore { /** * ( non - Javadoc ) * @ see com . ibm . ws . sib . msgstore . MessageStoreInterface # add ( com . ibm . ws . sib . msgstore . ItemStream , com . ibm . ws . sib . msgstore . transactions . Transaction ) */ @ Override public void add ( ItemStream itemStream , Transaction transaction ) th...
add ( itemStream , AbstractItem . NO_LOCK_ID , transaction ) ;
public class KubernetesClient { /** * Makes a REST call to Kubernetes API and returns the result JSON . * @ param urlString Kubernetes API REST endpoint * @ return parsed JSON * @ throws KubernetesClientException if Kubernetes API didn ' t respond with 200 and a valid JSON content */ private JsonObject callGet ( ...
return RetryUtils . retry ( new Callable < JsonObject > ( ) { @ Override public JsonObject call ( ) { return Json . parse ( RestClient . create ( urlString ) . withHeader ( "Authorization" , String . format ( "Bearer %s" , apiToken ) ) . withCaCertificate ( caCertificate ) . get ( ) ) . asObject ( ) ; } } , retries , N...
public class BSHMethodDeclaration { /** * Evaluate the declaration of the method . That is , determine the * structure of the method and install it into the caller ' s namespace . */ public Object eval ( CallStack callstack , Interpreter interpreter ) throws EvalError { } }
returnType = evalReturnType ( callstack , interpreter ) ; evalNodes ( callstack , interpreter ) ; // Install an * instance * of this method in the namespace . // See notes in BshMethod // This is not good . . . // need a way to update eval without re - installing . . . // so that we can re - eval params , etc . when cl...
public class BootstrapMojo { /** * Return the celerio template packs found on the classpath . */ protected List < TemplatePackInfo > getBootstrapPacksInfo ( ) { } }
if ( bootstrapPacksInfo == null ) { bootstrapPacksInfo = getCelerioApplicationContext ( ) . getBean ( ClasspathTemplatePackInfoLoader . class ) . resolveTopLevelPacks ( ) ; } return bootstrapPacksInfo ;
public class Javalin { /** * Adds a OPTIONS request handler for the specified path to the instance . * @ see < a href = " https : / / javalin . io / documentation # handlers " > Handlers in docs < / a > */ public Javalin options ( @ NotNull String path , @ NotNull Handler handler ) { } }
return addHandler ( HandlerType . OPTIONS , path , handler ) ;
public class Stream { /** * Zip together the " a " and " b " iterators until all of them runs out of values . * Each pair of values is combined into a single value using the supplied zipFunction function . * @ param a * @ param b * @ param valueForNoneA value to fill if " a " runs out of values first . * @ pa...
return zip ( LongIteratorEx . of ( a ) , LongIteratorEx . of ( b ) , valueForNoneA , valueForNoneB , zipFunction ) ;
public class NetworkConfig { /** * Returns the specified JsonValue as a String , or null if it ' s not a string */ private static String getJsonValueAsNumberString ( JsonValue value ) { } }
return ( value != null && value . getValueType ( ) == ValueType . NUMBER ) ? value . toString ( ) : null ;
public class RemoveTagsRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( RemoveTagsRequest removeTagsRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( removeTagsRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( removeTagsRequest . getResourceId ( ) , RESOURCEID_BINDING ) ; protocolMarshaller . marshall ( removeTagsRequest . getTagKeys ( ) , TAGKEYS_BINDING ) ; } catch ( Excep...
public class CardInputWidget { /** * Gets a { @ link Card } object from the user input , if all fields are valid . If not , returns * { @ code null } . * @ return a valid { @ link Card } object based on user input , or { @ code null } if any field is * invalid */ @ Nullable public Card getCard ( ) { } }
String cardNumber = mCardNumberEditText . getCardNumber ( ) ; int [ ] cardDate = mExpiryDateEditText . getValidDateFields ( ) ; if ( cardNumber == null || cardDate == null || cardDate . length != 2 ) { return null ; } // CVC / CVV is the only field not validated by the entry control itself , so we check here . String c...
public class GVRFloatAnimation { /** * Resize the key data area . * This function will truncate the keys if the * initial setting was too large . * @ oaran numKeys the desired number of keys */ public void resizeKeys ( int numKeys ) { } }
int n = numKeys * mFloatsPerKey ; if ( mKeys . length == n ) { return ; } float [ ] newKeys = new float [ n ] ; n = Math . min ( n , mKeys . length ) ; System . arraycopy ( mKeys , 0 , newKeys , 0 , n ) ; mKeys = newKeys ; mFloatInterpolator . setKeyData ( mKeys ) ;
public class FontDescriptorSpecificationImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public void setFtUsFlags ( Integer newFtUsFlags ) { } }
Integer oldFtUsFlags = ftUsFlags ; ftUsFlags = newFtUsFlags ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , AfplibPackage . FONT_DESCRIPTOR_SPECIFICATION__FT_US_FLAGS , oldFtUsFlags , ftUsFlags ) ) ;
public class FontBuilder { /** * Load the font file . * @ param fontParams the name of the font to load */ private void checkFontStatus ( final FontParams fontParams ) { } }
// Try to load system fonts final List < String > fonts = Font . getFontNames ( transformFontName ( fontParams . name ( ) . name ( ) ) ) ; Font font = null ; String fontName = null ; if ( fonts . isEmpty ( ) ) { final List < String > fontPaths = fontParams instanceof RealFont && ( ( RealFont ) fontParams ) . skipFontsF...
public class Application { /** * Performs initializations common to all applications . Applications should override { @ link * # willInit } to perform initializations that need to take place before the common * initialization ( which includes the creation of the site identifier and message manager ) and * should ...
// keep this around for later _context = context ; // stick ourselves into an application attribute so that we can be accessed by Velocity // plugins Velocity . setApplicationAttribute ( VELOCITY_ATTR_KEY , this ) ; // let the derived application do pre - init stuff willInit ( config ) ; // remove any trailing dot if (...
public class ArrayExpressionSatisfies { /** * Creates a complete quantified operator with the given satisfies expression . * @ param expression Parameter expression : The satisfies expression used for evaluating each item in the array . * @ return The quantified expression . */ @ NonNull public Expression satisfies...
if ( expression == null ) { throw new IllegalArgumentException ( "expression cannot be null." ) ; } return new QuantifiedExpression ( type , variable , inExpression , expression ) ;
public class SLF4JLog { /** * Converts the first input parameter to String and then delegates to the * wrapped < code > org . slf4j . Logger < / code > instance . * @ param message * the message to log . Converted to { @ link String } * @ param t * the exception to log */ public void error ( Object message , ...
logger . error ( String . valueOf ( message ) , t ) ;
public class Fat { /** * Reads a { @ code Fat } as specified by a { @ code BootSector } . * @ param bs the boot sector specifying the { @ code Fat } layout * @ param fatNr the number of the { @ code Fat } to read * @ return the { @ code Fat } that was read * @ throws IOException on read error * @ throws Illeg...
if ( fatNr > bs . getNrFats ( ) ) { throw new IllegalArgumentException ( "boot sector says there are only " + bs . getNrFats ( ) + " FATs when reading FAT #" + fatNr ) ; } final long fatOffset = bs . getFatOffset ( fatNr ) ; final Fat result = new Fat ( bs , fatOffset ) ; result . read ( ) ; return result ;
public class Pair { /** * Counts the number of elements in an isomorphic list . * @ param < T > the type of the elements in the isomorphic list * @ param list - a list represented by the first Pair object isomorphic to the elements , or an element when the list is trivial * @ return the number of elements discove...
if ( list == null ) { return 0 ; } else if ( list instanceof Pair ) { return 1 + count ( ( ( Pair < T , T > ) list ) . second ) ; } else { return 1 ; }
public class PersistenceStrategy { /** * Returns the " per - table " persistence strategy , i . e . one dedicated cache will be used for each * entity / association / id source table . */ private static PersistenceStrategy < ? , ? , ? > getPerTableStrategy ( EmbeddedCacheManager externalCacheManager , URL configUrl ,...
PerTableKeyProvider keyProvider = new PerTableKeyProvider ( ) ; PerTableCacheManager cacheManager = externalCacheManager != null ? new PerTableCacheManager ( externalCacheManager , entityTypes , associationTypes , idSourceTypes ) : new PerTableCacheManager ( configUrl , platform , entityTypes , associationTypes , idSou...