signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class SkinConfigTool { /** * Default accessor for config properties . Instead of using { @ code $ config . get ( " myproperty " ) } , * one can utilise Velocity fallback onto the default getter and use { @ code $ config . myproperty } . * @ param property * the property of interest * @ return configurati...
// first try page properties Xpp3Dom propNode = getChild ( pageProperties , property ) ; if ( propNode == null ) { // try global propNode = getChild ( globalProperties , property ) ; } return propNode ;
public class BoneCPConfig { /** * Sets the number of ms to wait before attempting to obtain a connection again after a failure . * @ param acquireRetryDelay the acquireRetryDelay to set * @ param timeUnit time granularity */ public void setAcquireRetryDelay ( long acquireRetryDelay , TimeUnit timeUnit ) { } }
this . acquireRetryDelayInMs = TimeUnit . MILLISECONDS . convert ( acquireRetryDelay , timeUnit ) ;
public class J2clClinitPrunerPass { /** * Returns the qualifed name { @ code function } is being assigned to . * < p > This implementation abstracts over the various ways of naming a function . ASSIGN need not be * involved and there may not be a sequence of GETPROPs representing the name . * < p > TODO ( b / 123...
checkArgument ( function . isFunction ( ) , function ) ; // The node representing the name ( e . g . GETPROP , MEMBER _ FUNCTION _ DEF , etc . ) . Node lValue = NodeUtil . getBestLValue ( function ) ; return NodeUtil . getBestLValueName ( lValue ) ;
public class AbstractColumn { /** * Builder methods used to set the { @ link Object default value } used when a { @ link Object value } * is not specified for this { @ link Column } . * @ param < S > { @ link Class Sub - type } of this { @ link Column } . * @ param defaultValue { @ link Object default value } use...
setDefaultValue ( defaultValue ) ; return ( S ) this ;
public class MetricsUtils { /** * Creates the body of a POST request encoding the metric report for a single { @ link Event } . * @ param event The event to report . * @ param analyticsId the Google Analytics ID to receive the report . * @ param random Random number generator to use for cache busting . * @ retu...
checkNotNull ( event ) ; checkNotNull ( analyticsId ) ; checkNotNull ( random ) ; String virtualPageName = buildVirtualPageName ( event . type ( ) , event . objectType ( ) , event . name ( ) ) ; String virtualPageTitle = buildVirtualPageTitle ( event . metadata ( ) ) ; String combinedEventType = buildCombinedType ( eve...
public class ComponentUuidFactoryImpl { /** * Get UUID from database if it exists , otherwise generate a new one . */ @ Override public String getOrCreateForKey ( String key ) { } }
return uuidsByKey . computeIfAbsent ( key , k -> Uuids . create ( ) ) ;
public class PoolInfo { /** * Returns whether or not the given pool name is legal . * Legal pool names are of nonzero length and are formed only of alphanumeric * characters , underscores ( _ ) , and hyphens ( - ) . * @ param poolInfo the name of the pool to check * @ return true if the name is a valid pool nam...
if ( poolInfo == null || poolInfo . getPoolGroupName ( ) == null || poolInfo . getPoolName ( ) == null ) { return false ; } if ( INVALID_REGEX_PATTERN . matcher ( poolInfo . getPoolGroupName ( ) ) . matches ( ) || poolInfo . getPoolGroupName ( ) . isEmpty ( ) ) { return false ; } if ( INVALID_REGEX_PATTERN . matcher ( ...
public class AfplibFactoryImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public String convertFontDescriptorSpecificationFtUsFlagsToString ( EDataType eDataType , Object instanceValue ) { } }
return instanceValue == null ? null : instanceValue . toString ( ) ;
public class Auth { /** * Set up table from given CREATE TABLE statement under system _ auth keyspace , if not already done so . * @ param name name of the table * @ param cql CREATE TABLE statement */ public static void setupTable ( String name , String cql ) { } }
if ( Schema . instance . getCFMetaData ( AUTH_KS , name ) == null ) { try { CFStatement parsed = ( CFStatement ) QueryProcessor . parseStatement ( cql ) ; parsed . prepareKeyspace ( AUTH_KS ) ; CreateTableStatement statement = ( CreateTableStatement ) parsed . prepare ( ) . statement ; CFMetaData cfm = statement . getC...
public class TimeZoneFormat { /** * Parses the input text using the default format patterns ( e . g . " UTC { 0 } " ) . * @ param text the input text * @ param start the start index * @ param parsedLen the parsed length , or 0 on failure * @ return the parsed offset in milliseconds . */ private int parseOffsetD...
int idx = start ; int offset = 0 ; int parsed = 0 ; do { // check global default GMT alternatives int gmtLen = 0 ; for ( String gmt : ALT_GMT_STRINGS ) { int len = gmt . length ( ) ; if ( text . regionMatches ( true , idx , gmt , 0 , len ) ) { gmtLen = len ; break ; } } if ( gmtLen == 0 ) { break ; } idx += gmtLen ; //...
public class SocketFactoryHelper { /** * Attempt a socket bind to the input address with the given re - use option * flag . * @ param address * @ param reuseflag * @ throws IOException */ private void attemptSocketBind ( ServerSocket serverSocket , SocketAddress address , boolean reuseflag , int backlog ) throw...
serverSocket . setReuseAddress ( reuseflag ) ; serverSocket . bind ( address , backlog ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "ServerSocket bind worked, reuse=" + serverSocket . getReuseAddress ( ) ) ; }
public class TableFactor { /** * Super basic in - place array normalization * @ param arr the array to normalize */ private void normalizeLogArr ( double [ ] arr ) { } }
// Find the log - scale normalization value double max = Double . NEGATIVE_INFINITY ; for ( double d : arr ) { if ( d > max ) max = d ; } double expSum = 0.0 ; for ( double d : arr ) { expSum += Math . exp ( d - max ) ; } double logSumExp = max + Math . log ( expSum ) ; if ( Double . isInfinite ( logSumExp ) ) { // Jus...
public class LogPackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EClass getNewObjectIDMUploaded ( ) { } }
if ( newObjectIDMUploadedEClass == null ) { newObjectIDMUploadedEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( LogPackage . eNS_URI ) . getEClassifiers ( ) . get ( 14 ) ; } return newObjectIDMUploadedEClass ;
public class SelenideProxyServer { /** * Start the server * It automatically adds one response filter " download " that can intercept downloaded files . */ public void start ( ) { } }
proxy . setTrustAllServers ( true ) ; if ( outsideProxy != null ) { proxy . setChainedProxy ( getProxyAddress ( outsideProxy ) ) ; } addRequestFilter ( "authentication" , new AuthenticationFilter ( ) ) ; addRequestFilter ( "requestSizeWatchdog" , new RequestSizeWatchdog ( ) ) ; addResponseFilter ( "responseSizeWatchdog...
public class SQLParser { /** * Parse a date string . We parse the documented forms , which are : * < ul > * < li > YYYY - MM - DD < / li > * < li > YYYY - MM - DD HH : MM : SS < / li > * < li > YYYY - MM - DD HH : MM : SS . SSSSS < / li > * < / ul > * As it turns out , TimestampType takes string parameters ...
// Remove any quotes around the timestamp value . ENG - 2623 String dateRepled = dateIn . replaceAll ( "^\"|\"$" , "" ) . replaceAll ( "^'|'$" , "" ) ; return new TimestampType ( dateRepled ) ;
public class FT12Connection { /** * Attempts to gets the available serial communication ports on the host . * At first , the Java system property " microedition . commports " is queried . If there is * no property with that key , and Calimero itself has access to serial ports , * the lowest 10 ports numbers are e...
String ports = null ; try { ports = System . getProperty ( "microedition.commports" ) ; } catch ( final SecurityException e ) { } if ( ports != null ) { final StringTokenizer st = new StringTokenizer ( ports , "," ) ; final String [ ] portIDs = new String [ st . countTokens ( ) ] ; for ( int i = 0 ; i < portIDs . lengt...
public class CommerceWarehousePersistenceImpl { /** * Clears the cache for all commerce warehouses . * The { @ link EntityCache } and { @ link FinderCache } are both cleared by this method . */ @ Override public void clearCache ( ) { } }
entityCache . clearCache ( CommerceWarehouseImpl . class ) ; finderCache . clearCache ( FINDER_CLASS_NAME_ENTITY ) ; finderCache . clearCache ( FINDER_CLASS_NAME_LIST_WITH_PAGINATION ) ; finderCache . clearCache ( FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION ) ;
public class JSONCompare { /** * Compares JSON string provided to the expected JSON string using provided comparator , and returns the results of * the comparison . * @ param expectedStr Expected JSON string * @ param actualStr JSON string to compare * @ param comparator Comparator to use * @ return result of...
Object expected = JSONParser . parseJSON ( expectedStr ) ; Object actual = JSONParser . parseJSON ( actualStr ) ; if ( ( expected instanceof JSONObject ) && ( actual instanceof JSONObject ) ) { return compareJSON ( ( JSONObject ) expected , ( JSONObject ) actual , comparator ) ; } else if ( ( expected instanceof JSONAr...
public class DictionariesNERTagger { /** * { @ link Dictionaries } based Named Entity Detection and Classification . * @ param tokens * the tokenized sentence * @ return a list of detected { @ link SequenceLabel } objects */ public final List < SequenceLabel > getNames ( final String [ ] tokens ) { } }
final Span [ ] origSpans = nercToSpans ( tokens ) ; final Span [ ] neSpans = SequenceLabelerME . dropOverlappingSpans ( origSpans ) ; final List < SequenceLabel > names = getNamesFromSpans ( neSpans , tokens ) ; return names ;
public class PagerDuty { /** * Create a new instance using the specified API key . */ public static PagerDuty create ( String apiKey ) { } }
Retrofit retrofit = new Retrofit . Builder ( ) . baseUrl ( HOST ) . addConverterFactory ( GsonConverterFactory . create ( ) ) . build ( ) ; return create ( apiKey , retrofit ) ;
public class JobClientManager { /** * 得到 可用的 客户端节点 */ public JobClientNode getAvailableJobClient ( String nodeGroup ) { } }
Set < JobClientNode > jobClientNodes = NODE_MAP . get ( nodeGroup ) ; if ( CollectionUtils . isEmpty ( jobClientNodes ) ) { return null ; } List < JobClientNode > list = new ArrayList < JobClientNode > ( jobClientNodes ) ; while ( list . size ( ) > 0 ) { JobClientNode jobClientNode = loadBalance . select ( list , null ...
public class DefaultConfigMethod { /** * Returns the configuration options for this configuration method . * @ return array of configuration options * @ throws IllegalAccessException - Re - thrown , from invoking the configuration method via reflection * @ throws InvocationTargetException - Re - thrown , from inv...
if ( options == null ) { List < Option > options = new ArrayList < Option > ( ) ; Configuration config = getMethod ( ) . getAnnotation ( Configuration . class ) ; for ( Class < ? extends CompositeOption > option : config . extend ( ) ) { options . addAll ( Arrays . asList ( option . newInstance ( ) . getOptions ( ) ) )...
public class ConfigProto { /** * < pre > * Map from device type name ( e . g . , " CPU " or " GPU " ) to maximum * number of devices of that type to use . If a particular device * type is not found in the map , the system picks an appropriate * number . * < / pre > * < code > map & lt ; string , int32 & gt ...
return internalGetDeviceCount ( ) . getMap ( ) ;
public class TimelineModel { /** * Merge the given one event with the given collection of events with UI update . Only events within one group can be merged . * Note : after merging , the merged event will get the same properties as the given one event except start and end dates . * @ param event given event to be ...
if ( event == null ) { // nothing to merge return null ; } if ( events == null || events . isEmpty ( ) ) { // nothing to merge return event ; } // check whether all events within the same group String group = event . getGroup ( ) ; for ( TimelineEvent e : events ) { if ( ( group == null && e . getGroup ( ) != null ) ||...
public class QueryParser { /** * : not ( selector ) */ private void not ( ) { } }
tq . consume ( ":not" ) ; String subQuery = tq . chompBalanced ( '(' , ')' ) ; Validate . notEmpty ( subQuery , ":not(selector) subselect must not be empty" ) ; evals . add ( new StructuralEvaluator . Not ( parse ( subQuery ) ) ) ;
public class ConfigAccessorImpl { /** * must be called within synchronized ( this ) block */ private boolean checkCache ( ) { } }
if ( this . cacheValid ) { long now = System . nanoTime ( ) ; if ( ( now - this . cacheExpiryTime ) > 0 ) { this . cacheValid = false ; } } return this . cacheValid ;
public class MacOsWatchServiceFactory { /** * The default { @ link WatchService } . * @ return The watch service to use . * @ throws IOException if an error occurs creating the watch service */ @ Bean ( preDestroy = "close" ) @ Prototype @ Requires ( classes = { } }
MacOSXListeningWatchService . class , Library . class } ) @ Requires ( property = FileWatchConfiguration . ENABLED , value = StringUtils . TRUE , defaultValue = StringUtils . TRUE ) @ Requires ( property = FileWatchConfiguration . PATHS ) @ Primary protected WatchService macWatchService ( ) throws IOException { try { r...
public class CorsFilters { /** * Apply CORS filter on request * @ param requestContext request context * @ param predicate must return { @ code true } if the input origin is allowed , else { @ code false } . */ public static void filterRequest ( ContainerRequestContext requestContext , Predicate < String > predicat...
// NOT a CORS request String requestOrigin = requestContext . getHeaderString ( Headers . ORIGIN ) ; if ( requestOrigin == null ) { return ; } if ( ! predicate . test ( requestOrigin ) ) { requestContext . abortWith ( Response . status ( Response . Status . BAD_REQUEST ) . build ( ) ) ; return ; } // It is a CORS pre -...
public class ServicesInner { /** * Stop service . * The services resource is the top - level resource that represents the Data Migration Service . This action stops the service and the service cannot be used for data migration . The service owner won ' t be billed when the service is stopped . * @ param groupName N...
return beginStopWithServiceResponseAsync ( groupName , serviceName ) . map ( new Func1 < ServiceResponse < Void > , Void > ( ) { @ Override public Void call ( ServiceResponse < Void > response ) { return response . body ( ) ; } } ) ;
public class CmsContextMenu { /** * Creates the context menu . < p > * @ param entries a list with all entries for the context menu */ private void createContextMenu ( List < I_CmsContextMenuEntry > entries ) { } }
Iterator < I_CmsContextMenuEntry > it = entries . iterator ( ) ; while ( it . hasNext ( ) ) { I_CmsContextMenuEntry entry = it . next ( ) ; if ( ! entry . isVisible ( ) ) { continue ; } if ( entry . isSeparator ( ) ) { addSeparator ( ) ; } else { A_CmsContextMenuItem item = entry . generateMenuItem ( ) ; if ( entry . h...
public class BackupClientImpl { /** * getState . * @ param state * value of state * @ return String sate */ private String getRepositoryBackupToFullState ( int state ) { } }
String st = "" ; switch ( state ) { case RepositoryBackupChain . FINISHED : st = "finished" ; break ; case RepositoryBackupChain . WORKING : st = "working" ; break ; case RepositoryBackupChain . INITIALIZED : st = "initialized" ; break ; case RepositoryBackupChain . FULL_BACKUP_FINISHED_INCREMENTAL_BACKUP_WORKING : st ...
public class CertStore { /** * Returns the default { @ code CertStore } type as specified by the * { @ code certstore . type } security property , or the string * { @ literal " LDAP " } if no such property exists . * < p > The default { @ code CertStore } type can be used by applications * that do not want to u...
String cstype ; cstype = AccessController . doPrivileged ( new PrivilegedAction < String > ( ) { public String run ( ) { return Security . getProperty ( CERTSTORE_TYPE ) ; } } ) ; if ( cstype == null ) { cstype = "LDAP" ; } return cstype ;
public class PinView { /** * Save current attributes in { @ link PinView # mPinViewSettings } */ private void saveSettings ( ) { } }
mPinViewSettings = new PinViewSettings . Builder ( ) . withColorSplit ( mColorSplit ) . withColorTextPinBox ( mColorTextPinBoxes ) . withColorTextTitles ( mColorTextTitles ) . withCustomDrawablePinBox ( mCustomDrawablePinBox ) . withDeleteOnClick ( isDeleteOnClick ( ) ) . withNativePinBox ( isNativePinBox ( ) ) . withS...
public class PolicyConstraintsExtension { /** * Return an enumeration of names of attributes existing within this * attribute . */ public Enumeration < String > getElements ( ) { } }
AttributeNameEnumeration elements = new AttributeNameEnumeration ( ) ; elements . addElement ( REQUIRE ) ; elements . addElement ( INHIBIT ) ; return ( elements . elements ( ) ) ;
public class Symmetry454Chronology { /** * Obtains a local date in Symmetry454 calendar system from the * era , year - of - era and day - of - year fields . * @ param era the Symmetry454 era , not null * @ param yearOfEra the year - of - era * @ param dayOfYear the day - of - year * @ return the Symmetry454 l...
return dateYearDay ( prolepticYear ( era , yearOfEra ) , dayOfYear ) ;
public class ArchiveTransferManager { /** * Calculates the part size to use when uploading an archive of the * specified size using Glacier ' s multipart upload APIs . Because of the tree * hashing algorithm , part sizes must be aligned on 2 ^ n MB boundaries ( ex : * 1MB , 2MB , 4MB , 8MB , etc ) . All parts mus...
long partSize = MINIMUM_PART_SIZE ; int approxNumParts = 1 ; while ( partSize * approxNumParts < fileSize && partSize * 2 <= MAXIMUM_UPLOAD_PART_SIZE ) { partSize *= 2 ; approxNumParts *= 2 ; } return partSize ;
public class AbstractAmazonDynamoDBAsync { /** * Simplified method form for invoking the UpdateTable operation with an AsyncHandler . * @ see # updateTableAsync ( UpdateTableRequest , com . amazonaws . handlers . AsyncHandler ) */ @ Override public java . util . concurrent . Future < UpdateTableResult > updateTableAs...
return updateTableAsync ( new UpdateTableRequest ( ) . withTableName ( tableName ) . withProvisionedThroughput ( provisionedThroughput ) , asyncHandler ) ;
public class SocketStream { /** * Reads bytes from the socket . * @ param buf byte buffer receiving the bytes * @ param offset offset into the buffer * @ param length number of bytes to read * @ return number of bytes read or - 1 * @ exception throws ClientDisconnectException if the connection is dropped */ @...
try { if ( _is == null ) { if ( _s == null ) { return - 1 ; } _is = _s . getInputStream ( ) ; } int readLength = _is . read ( buf , offset , length ) ; if ( readLength >= 0 ) { _totalReadBytes += readLength ; } return readLength ; } catch ( InterruptedIOException e ) { e . printStackTrace ( ) ; if ( _throwReadInterrupt...
public class QueryBuilder { /** * Provides a type hint for an expression , as in { @ code WHERE k = ( double ) 1/3 } . * < p > To create the data type , use the constants and static methods in { @ link DataTypes } , or * { @ link # udt ( CqlIdentifier ) } . */ @ NonNull public static Term typeHint ( @ NonNull Term ...
return new TypeHintTerm ( term , targetType ) ;
public class CmsImagePreviewHandler { /** * Returns image tag attributes to set for editor plugins . < p > * @ param callback the callback to execute */ public void getImageAttributes ( I_CmsSimpleCallback < Map < String , String > > callback ) { } }
Map < String , String > result = new HashMap < String , String > ( ) ; result . put ( Attribute . hash . name ( ) , String . valueOf ( getImageIdHash ( ) ) ) ; m_formatHandler . getImageAttributes ( result ) ; m_previewDialog . getImageAttributes ( result , callback ) ;
public class AllChemCompProvider { /** * Load all { @ link ChemComp } definitions into memory . */ private void loadAllChemComps ( ) throws IOException { } }
String fileName = getLocalFileName ( ) ; logger . debug ( "Loading " + fileName ) ; InputStreamProvider isp = new InputStreamProvider ( ) ; InputStream inStream = isp . getInputStream ( fileName ) ; MMcifParser parser = new SimpleMMcifParser ( ) ; ChemCompConsumer consumer = new ChemCompConsumer ( ) ; // The Consumer b...
public class FactoryBriefDefinition { /** * Creates a descriptor by randomly selecting points inside a square region using a Gaussian distribution * with a sigma of ( 5/2 ) * radius . This is done exactly as is described in the paper where twice * as many points are sampled as are compared . . * @ param rand Rand...
BinaryCompareDefinition_I32 ret = new BinaryCompareDefinition_I32 ( radius , numPairs * 2 , numPairs ) ; double sigma = ( 2.0 * radius + 1.0 ) / 5.0 ; for ( int i = 0 ; i < numPairs ; i ++ ) { randomGaussian ( rand , sigma , radius , ret . samplePoints [ i ] ) ; randomGaussian ( rand , sigma , radius , ret . samplePoin...
public class JacksonDBCollection { /** * Performs an update operation . * @ param query search query for old object to update * @ param object object with which to update < tt > query < / tt > * @ param upsert if the database should create the element if it does not exist * @ param multi if the update should be...
return update ( convertToBasicDbObject ( query ) , convertToBasicDbObject ( object ) , upsert , multi , concern ) ;
public class PropertiesUtil { /** * Loads properties from the file identified by the given { @ code fileString } , * which can be a regular file ( path ) , a classpath resource or a URL . * @ param fileString identifies the file * @ return the properties * @ throws IOException on errors reading the file / URL *...
final File file = new File ( fileString ) ; // first try : regular file if ( file . exists ( ) ) { return loadProperties ( file ) ; } // second try : classpath resource final InputStream resourceStream = Thread . currentThread ( ) . getContextClassLoader ( ) . getResourceAsStream ( fileString ) ; if ( resourceStream !=...
public class GVRSceneObject { /** * Visits all the components of the specified type attached to * the descendants of this scene object . * The ComponentVisitor . visit function is called for every * eligible component of each descendant until it returns false . * This allows you to traverse the scene graph safe...
synchronized ( mComponents ) { GVRComponent comp = getComponent ( componentType ) ; if ( ( comp != null ) && ! visitor . visit ( comp ) ) { return ; } } synchronized ( mChildren ) { for ( int i = 0 ; i < mChildren . size ( ) ; ++ i ) { GVRSceneObject child = mChildren . get ( i ) ; child . forAllComponents ( visitor , ...
public class PaymentActivity { /** * Cleaning up all Rx subscriptions in onDestroy . */ @ Override protected void onDestroy ( ) { } }
mCompositeDisposable . dispose ( ) ; LocalBroadcastManager . getInstance ( this ) . unregisterReceiver ( mBroadcastReceiver ) ; mPaymentSession . onDestroy ( ) ; super . onDestroy ( ) ;
public class GrailsASTUtils { /** * Returns true if the given class name is a parent class of the given class * @ param classNode The class node * @ param parentClassName the parent class name * @ return True if it is a subclass */ public static boolean isSubclassOf ( ClassNode classNode , String parentClassName ...
ClassNode currentSuper = classNode . getSuperClass ( ) ; while ( currentSuper != null && ! currentSuper . getName ( ) . equals ( OBJECT_CLASS ) ) { if ( currentSuper . getName ( ) . equals ( parentClassName ) ) return true ; currentSuper = currentSuper . getSuperClass ( ) ; } return false ;
public class TextChunk { /** * Splits a TextChunk in two , at the position of the i - th TextElement */ public TextChunk [ ] splitAt ( int i ) { } }
if ( i < 1 || i >= this . getTextElements ( ) . size ( ) ) { throw new IllegalArgumentException ( ) ; } TextChunk [ ] rv = new TextChunk [ ] { new TextChunk ( this . getTextElements ( ) . subList ( 0 , i ) ) , new TextChunk ( this . getTextElements ( ) . subList ( i , this . getTextElements ( ) . size ( ) ) ) } ; retur...
public class CommerceCurrencyLocalServiceBaseImpl { /** * Adds the commerce currency to the database . Also notifies the appropriate model listeners . * @ param commerceCurrency the commerce currency * @ return the commerce currency that was added */ @ Indexable ( type = IndexableType . REINDEX ) @ Override public ...
commerceCurrency . setNew ( true ) ; return commerceCurrencyPersistence . update ( commerceCurrency ) ;
public class ProviderResourceInfo { /** * put anything here , such as J2EEName * @ param key * @ param obj */ public void putCustomizedProperty ( String key , Object obj ) { } }
if ( key == null || obj == null ) return ; customizedProperties . put ( key , obj ) ;
public class AttributeMarshaller { /** * Sorts attributes so that xsd : attribute ones come first */ private static Set < AttributeDefinition > sortAttributes ( AttributeDefinition [ ] attributes ) { } }
Set < AttributeDefinition > sortedAttrs = new LinkedHashSet < > ( attributes . length ) ; List < AttributeDefinition > elementAds = null ; for ( AttributeDefinition ad : attributes ) { if ( ad . getParser ( ) . isParseAsElement ( ) ) { if ( elementAds == null ) { elementAds = new ArrayList < > ( ) ; } elementAds . add ...
public class GCLINERGImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public boolean eIsSet ( int featureID ) { } }
switch ( featureID ) { case AfplibPackage . GCLINERG__XPOS : return XPOS_EDEFAULT == null ? xpos != null : ! XPOS_EDEFAULT . equals ( xpos ) ; case AfplibPackage . GCLINERG__YPOS : return YPOS_EDEFAULT == null ? ypos != null : ! YPOS_EDEFAULT . equals ( ypos ) ; } return super . eIsSet ( featureID ) ;
public class FileStandardInfo { /** * { @ inheritDoc } * @ see jcifs . Encodable # encode ( byte [ ] , int ) */ @ Override public int encode ( byte [ ] dst , int dstIndex ) { } }
int start = dstIndex ; SMBUtil . writeInt8 ( this . allocationSize , dst , dstIndex ) ; dstIndex += 8 ; SMBUtil . writeInt8 ( this . endOfFile , dst , dstIndex ) ; dstIndex += 8 ; SMBUtil . writeInt4 ( this . numberOfLinks , dst , dstIndex ) ; dstIndex += 4 ; dst [ dstIndex ++ ] = ( byte ) ( this . deletePending ? 1 : ...
public class ImageRetinaApiImpl { /** * { @ inheritDoc } */ @ Override public ByteArrayInputStream compare ( ImagePlotShape shape , ImageEncoding imageEncoding , Model model1 , Model model2 ) throws JsonProcessingException , ApiException { } }
return compare ( null , shape , imageEncoding , model1 , model2 ) ;
public class StringUtil { /** * returns true if the input string has letters and they are all UPPERCASE * @ param str * @ return */ public static boolean isAllUpperCase ( String str ) { } }
if ( str == null ) return false ; boolean hasLetters = false ; char c ; for ( int i = str . length ( ) - 1 ; i >= 0 ; i -- ) { c = str . charAt ( i ) ; if ( Character . isLetter ( c ) ) { if ( ! Character . isUpperCase ( c ) ) return false ; hasLetters = true ; } } return hasLetters ;
public class MathUtils { /** * Checks whether two { @ link RectF } have the same aspect ratio . * @ param r1 the first rect . * @ param r2 the second rect . * @ return { @ code true } if both rectangles have the same aspect ratio , * { @ code false } otherwise . */ protected static boolean haveSameAspectRatio (...
// Reduces precision to avoid problems when comparing aspect ratios . float srcRectRatio = MathUtils . truncate ( MathUtils . getRectRatio ( r1 ) , 3 ) ; float dstRectRatio = MathUtils . truncate ( MathUtils . getRectRatio ( r2 ) , 3 ) ; // Compares aspect ratios that allows for a tolerance range of [ 0 , 0.01] return ...
public class LogWriter { /** * Sets the log format for writing process traces ( e . g . MXML ) . * @ param logFormat The log format to set . * @ throws PerspectiveException if the log format does not support the writers ' log perspective . * @ throws CompatibilityException if the charset of the log writer is not ...
if ( ! logFormat . supportsCharset ( charset ) ) throw new CompatibilityException ( "Log format \"" + logFormat . getName ( ) + "\" does not support charset \"" + charset . name ( ) + "\"" ) ; if ( ! logFormat . supportsLogPerspective ( logPerspective ) ) throw new PerspectiveException ( PerspectiveError . INCOMPATIBLE...
public class DeletionTaskFailureReasonType { /** * A list of objects that contains details about the service - linked role deletion failure , if that information is * returned by the service . If the service - linked role has active sessions or if any resources that were used by the * role have not been deleted fro...
if ( this . roleUsageList == null ) { setRoleUsageList ( new com . amazonaws . internal . SdkInternalList < RoleUsageType > ( roleUsageList . length ) ) ; } for ( RoleUsageType ele : roleUsageList ) { this . roleUsageList . add ( ele ) ; } return this ;
public class TransitionInflater { /** * Loads a { @ link TransitionManager } object from a resource * @ param resource The resource id of the transition manager to load * @ return The loaded TransitionManager object * @ throws android . content . res . Resources . NotFoundException when the * transition manager...
XmlResourceParser parser = mContext . getResources ( ) . getXml ( resource ) ; try { return createTransitionManagerFromXml ( parser , Xml . asAttributeSet ( parser ) , sceneRoot ) ; } catch ( XmlPullParserException e ) { InflateException ex = new InflateException ( e . getMessage ( ) ) ; ex . initCause ( e ) ; throw ex...
public class ResourceLoader { /** * Returns an instance of inputStream if resource exists , null otherwise . * @ param resource resource to load * @ return an inputStream of resource if exists , null otherwise * @ throws MalformedURLException if url is malformed * @ throws IOException if is impossible to open t...
String content = resource . trim ( ) ; // if resource is a content and not a path if ( ! isPath ( content ) ) return new ByteArrayInputStream ( content . getBytes ( "UTF-8" ) ) ; URL url = Thread . currentThread ( ) . getContextClassLoader ( ) . getResource ( content ) ; // Could not find resource . Try with the classl...
public class AttributeListImpl { public void addNamespaceDeclaration ( String uri , String pfx ) { } }
// Canonical EXI defines that namespace declarations MUST be sorted // lexicographically according to the NS prefix if ( this . nsDecls . size ( ) == 0 || ! this . isCanonical ) { this . nsDecls . add ( new NamespaceDeclaration ( uri , pfx ) ) ; } else { // sort int i = this . getNumberOfNamespaceDeclarations ( ) ; // ...
public class HtmlForm { /** * < p > Set the value of the < code > acceptcharset < / code > property . < / p > */ public void setAcceptcharset ( java . lang . String acceptcharset ) { } }
getStateHelper ( ) . put ( PropertyKeys . acceptcharset , acceptcharset ) ;
public class AWSCloud9Client { /** * Changes the settings of an existing AWS Cloud9 development environment . * @ param updateEnvironmentRequest * @ return Result of the UpdateEnvironment operation returned by the service . * @ throws BadRequestException * The target request is invalid . * @ throws ConflictEx...
request = beforeClientExecution ( request ) ; return executeUpdateEnvironment ( request ) ;
public class TransTypes { /** * Lookup the method as a member of the type . Compare the * erasures . * @ param type the class where to look for the method * @ param method the method to look for in class * @ param erasure the erasure of method */ private boolean isSameMemberWhenErased ( Type type , MethodSymbol...
return types . isSameType ( erasure ( types . memberType ( type , method ) ) , erasure ) ;
public class JsonWriter { /** * Generates a mapping between attribute names and data types . * @ param name name of the map * @ param types types to write */ private void writeAttributeTypes ( String name , FieldType [ ] types ) throws IOException { } }
m_writer . writeStartObject ( name ) ; for ( FieldType field : types ) { m_writer . writeNameValuePair ( field . name ( ) . toLowerCase ( ) , field . getDataType ( ) . getValue ( ) ) ; } m_writer . writeEndObject ( ) ;
public class FtRemote { /** * Make a random socket . * @ return Socket * @ throws IOException If fails */ private static ServerSocket random ( ) throws IOException { } }
final ServerSocket skt = new ServerSocket ( 0 ) ; skt . setReuseAddress ( true ) ; return skt ;
public class FutureTask { /** * Sets the result of this future to the given value unless * this future has already been set or has been cancelled . * < p > This method is invoked internally by the { @ link # run } method * upon successful completion of the computation . * @ param v the value */ protected void s...
if ( U . compareAndSwapInt ( this , STATE , NEW , COMPLETING ) ) { outcome = v ; U . putOrderedInt ( this , STATE , NORMAL ) ; // final state finishCompletion ( ) ; }
public class AJP13InputStream { public int read ( ) throws IOException { } }
if ( _closed ) return - 1 ; if ( _packet . unconsumedData ( ) <= 0 ) { fillPacket ( ) ; if ( _packet . unconsumedData ( ) <= 0 ) { _closed = true ; return - 1 ; } } return _packet . getByte ( ) ;
public class ByteArray { /** * Add data at the current position . * @ param source * Source data . */ public void put ( byte [ ] source ) { } }
// If the buffer is small . if ( mBuffer . capacity ( ) < ( mLength + source . length ) ) { expandBuffer ( mLength + source . length + ADDITIONAL_BUFFER_SIZE ) ; } mBuffer . put ( source ) ; mLength += source . length ;
public class CmsSerialDateValue { /** * Check , if all values used for calculating the series for a specific pattern are valid . * @ return < code > null < / code > if the pattern is valid , a suitable error message otherwise . */ private String validatePattern ( ) { } }
String error = null ; switch ( getPatternType ( ) ) { case DAILY : error = isEveryWorkingDay ( ) ? null : validateInterval ( ) ; break ; case WEEKLY : error = validateInterval ( ) ; if ( null == error ) { error = validateWeekDaySet ( ) ; } break ; case MONTHLY : error = validateInterval ( ) ; if ( null == error ) { err...
public class DescribeMovingAddressesResult { /** * The status for each Elastic IP address . * @ param movingAddressStatuses * The status for each Elastic IP address . */ public void setMovingAddressStatuses ( java . util . Collection < MovingAddressStatus > movingAddressStatuses ) { } }
if ( movingAddressStatuses == null ) { this . movingAddressStatuses = null ; return ; } this . movingAddressStatuses = new com . amazonaws . internal . SdkInternalList < MovingAddressStatus > ( movingAddressStatuses ) ;
public class ImageStatistics { /** * Computes the variance of pixel intensity values inside the image . * @ param img Input image . Not modified . * @ param mean Mean pixel intensity value . * @ return Pixel variance */ public static double variance ( GrayS16 img , double mean ) { } }
if ( BoofConcurrency . USE_CONCURRENT ) { return ImplImageStatistics_MT . variance ( img , mean ) ; } else { return ImplImageStatistics . variance ( img , mean ) ; }
public class RouteUtils { /** * Given a { @ link RouteProgress } , this method will calculate the remaining waypoint names * along the given route based on route option waypoint names and the progress remaining coordinates . * If the waypoint names are empty , this method will return null . * @ param routeProgres...
RouteOptions routeOptions = routeProgress . directionsRoute ( ) . routeOptions ( ) ; if ( routeOptions == null || TextUtils . isEmpty ( routeOptions . waypointNames ( ) ) ) { return null ; } String allWaypointNames = routeOptions . waypointNames ( ) ; String [ ] names = allWaypointNames . split ( SEMICOLON ) ; int coor...
public class Applications { /** * Add the < em > application < / em > to the list . * @ param app * the < em > application < / em > to be added . */ public void addApplication ( Application app ) { } }
appNameApplicationMap . put ( app . getName ( ) . toUpperCase ( Locale . ROOT ) , app ) ; addInstancesToVIPMaps ( app , this . virtualHostNameAppMap , this . secureVirtualHostNameAppMap ) ; applications . add ( app ) ;
public class XmlSerializer { /** * Deserializes a XML ( default XStream representation ) representation of an * object . */ public Object deserialize ( String string ) { } }
XStream xstream = new XStream ( ) ; return xstream . fromXML ( string ) ;
public class UtilDenoiseWavelet { /** * Robust median estimator of the noise standard deviation . Typically applied to the HH < sub > 1 < / sub > subband . * & sigma ; = Median ( | Y < sub > ij < / sub > | ) / 0.6745 < br > * where & sigma ; is the estimated noise standard deviation , and Median ( | Y < sub > ij < ...
storage = subbandAbsVal ( subband , storage ) ; int N = subband . width * subband . height ; return QuickSelect . select ( storage , N / 2 , N ) / 0.6745f ;
public class SignalRsInner { /** * Create a new SignalR service and update an exiting SignalR service . * @ param resourceGroupName The name of the resource group that contains the resource . You can obtain this value from the Azure Resource Manager API or the portal . * @ param resourceName The name of the SignalR...
return createOrUpdateWithServiceResponseAsync ( resourceGroupName , resourceName , parameters ) . map ( new Func1 < ServiceResponse < SignalRResourceInner > , SignalRResourceInner > ( ) { @ Override public SignalRResourceInner call ( ServiceResponse < SignalRResourceInner > response ) { return response . body ( ) ; } }...
public class ListT { /** * / * ( non - Javadoc ) * @ see cyclops2 . monads . transformers . values . ListT # cycleUntil ( java . util . function . Predicate ) */ @ Override public ListT < W , T > cycleUntil ( final Predicate < ? super T > predicate ) { } }
return ( ListT < W , T > ) FoldableTransformerSeq . super . cycleUntil ( predicate ) ;
public class AmazonWebServiceRequest { /** * Sets the optional progress listener for receiving updates about the progress of the request , * and returns a reference to this object so that method calls can be chained together . * @ param progressListener * The new progress listener . * @ return A reference to th...
setGeneralProgressListener ( progressListener ) ; @ SuppressWarnings ( "unchecked" ) T t = ( T ) this ; return t ;
public class DeviceImpl { /** * Get device info . * Invoked when the client request the info CORBA operation . It updates the * black box and returns a DevInfo object with miscellaneous device info * @ return A DevInfo object */ public DevInfo info ( ) { } }
Util . out4 . println ( "DeviceImpl.info() arrived" ) ; final DevInfo back = new DevInfo ( ) ; // Retrieve server host final Util tg = Util . instance ( ) ; back . server_host = tg . get_host_name ( ) ; // Fill - in remaining structure fields back . dev_class = device_class . get_name ( ) ; back . server_id = tg . get_...
public class ChannelServiceImpl { /** * < pre > * 切换Channel状态 * 1 . 首先判断Channel是否为空或状态位是否正确 * 2 . 通知总裁器 , 更新节点 * 3 . 数据库数据库更新状态 * 4 . 调用远程方法 , 推送Channel到node节点 * < / pre > */ private void switchChannelStatus ( final Long channelId , final ChannelStatus channelStatus ) { } }
transactionTemplate . execute ( new TransactionCallbackWithoutResult ( ) { @ Override protected void doInTransactionWithoutResult ( TransactionStatus status ) { try { final ChannelDO channelDo = channelDao . findById ( channelId ) ; if ( null == channelDo ) { String exceptionCause = "query channelId:" + channelId + " r...
public class CopyBroadcastReceiver { /** * Receive one message from the broadcast buffer . * @ param handler to be called for each message received . * @ return the number of messages that have been received . */ public int receive ( final MessageHandler handler ) { } }
int messagesReceived = 0 ; final BroadcastReceiver receiver = this . receiver ; final long lastSeenLappedCount = receiver . lappedCount ( ) ; if ( receiver . receiveNext ( ) ) { if ( lastSeenLappedCount != receiver . lappedCount ( ) ) { throw new IllegalStateException ( "unable to keep up with broadcast" ) ; } final in...
public class CustomErrorPages { /** * Returns the default error page for a given status code . * Guaranteed to never be null . * @ param status * @ return String representation of the default error page . */ public String getDefaultFor ( int status ) { } }
String defaultPage = defaultPages . get ( status ) ; return ( defaultPage != null ) ? defaultPage : "<html><body><h2>HTTP Status " + status + "</h2></body></html>" ;
public class StructrMethodDefinition { /** * - - - - - static methods - - - - - */ static StructrMethodDefinition deserialize ( final StructrTypeDefinition parent , final String name , final Map < String , Object > source ) { } }
final StructrMethodDefinition newMethod = new StructrMethodDefinition ( parent , name ) ; newMethod . deserialize ( source ) ; return newMethod ;
public class JsiiRuntime { /** * Reads the next response from STDOUT of the child process . * @ return The parsed JSON response . * @ throws JsiiException if we couldn ' t parse the response . */ JsonNode readNextResponse ( ) { } }
try { String responseLine = this . stdout . readLine ( ) ; if ( responseLine == null ) { String error = this . stderr . lines ( ) . collect ( Collectors . joining ( "\n\t" ) ) ; throw new JsiiException ( "Child process exited unexpectedly: " + error ) ; } return JsiiObjectMapper . INSTANCE . readTree ( responseLine ) ;...
public class StatisticsJDBCStorageConnection { /** * { @ inheritDoc } */ public ItemData getItemData ( String identifier ) throws RepositoryException , IllegalStateException { } }
Statistics s = ALL_STATISTICS . get ( GET_ITEM_DATA_BY_ID_DESCR ) ; try { s . begin ( ) ; return wcs . getItemData ( identifier ) ; } finally { s . end ( ) ; }
public class CmsUploadButton { /** * Updates the CSS classes according to the button state . < p > * @ param styleDependent the dependent style name */ private void updateState ( String styleDependent ) { } }
if ( CmsStringUtil . isEmptyOrWhitespaceOnly ( styleDependent ) ) { // reseting to cmsState - up styleDependent = "up" ; } if ( ! styleDependent . equals ( m_styleDependent ) ) { m_main . removeStyleDependentName ( m_styleDependent ) ; m_main . setStyleDependentName ( styleDependent , true ) ; m_styleDependent = styleD...
public class AbstractDataStore { /** * ( non - Javadoc ) * @ see net . timewalker . ffmq4 . utils . store . LinkedDataStore # lock ( int ) */ @ Override public final void lock ( int handle ) throws DataStoreException { } }
if ( SAFE_MODE ) checkHandle ( handle ) ; if ( ! locks . flip ( handle ) ) { locks . flip ( handle ) ; // Restore state throw new DataStoreException ( "Handle already locked : " + handle ) ; }
public class RemoteInputChannel { /** * Assigns exclusive buffers to this input channel , and this method should be called only once * after this input channel is created . */ void assignExclusiveSegments ( List < MemorySegment > segments ) { } }
checkState ( this . initialCredit == 0 , "Bug in input channel setup logic: exclusive buffers have " + "already been set for this input channel." ) ; checkNotNull ( segments ) ; checkArgument ( segments . size ( ) > 0 , "The number of exclusive buffers per channel should be larger than 0." ) ; this . initialCredit = se...
public class ScaledIcon { /** * documentation inherited from interface Icon */ public void paintIcon ( Component c , Graphics g , int x , int y ) { } }
Graphics2D gfx = ( Graphics2D ) g ; AffineTransform otrans = gfx . getTransform ( ) ; RenderingHints ohints = gfx . getRenderingHints ( ) ; gfx . setRenderingHint ( RenderingHints . KEY_INTERPOLATION , RenderingHints . VALUE_INTERPOLATION_BILINEAR ) ; gfx . scale ( _scale , _scale ) ; _icon . paintIcon ( c , g , x , y ...
public class Connection { /** * These key - value pairs define parameters for the connection : * < ul > * < li > * < code > HOST < / code > - The host URI : either the fully qualified domain name ( FQDN ) or the IPv4 address of the * database host . * < / li > * < li > * < code > PORT < / code > - The por...
setConnectionProperties ( connectionProperties ) ; return this ;
public class ClassHelper { /** * Check if the passed classes are convertible . Includes conversion checks * between primitive types and primitive wrapper types . * @ param aSrcClass * First class . May not be < code > null < / code > . * @ param aDstClass * Second class . May not be < code > null < / code > ....
ValueEnforcer . notNull ( aSrcClass , "SrcClass" ) ; ValueEnforcer . notNull ( aDstClass , "DstClass" ) ; // Same class ? if ( aDstClass . equals ( aSrcClass ) ) return true ; // Default assignable if ( aDstClass . isAssignableFrom ( aSrcClass ) ) return true ; // Special handling for " int . class " = = " Integer . cl...
public class TcpIpConfig { /** * Adds a ' well known ' member . * Each HazelcastInstance will try to connect to at least one of the members , to find all other members , * and create a cluster . * A member can be a comma separated string , e . . g ' 10.11.12.1,10.11.12.2 ' which indicates multiple members * are...
String memberText = checkHasText ( member , "member must contain text" ) ; StringTokenizer tokenizer = new StringTokenizer ( memberText , "," ) ; while ( tokenizer . hasMoreTokens ( ) ) { String s = tokenizer . nextToken ( ) ; this . members . add ( s . trim ( ) ) ; } return this ;
public class AsteriskVersion { /** * Determine the Asterisk version from the string returned by Asterisk . The * string should contain " Asterisk " followed by a version number . * @ param coreLine * @ return the detected version , or null if unknown */ public static AsteriskVersion getDetermineVersionFromString ...
for ( AsteriskVersion version : knownVersions ) { for ( Pattern pattern : version . patterns ) { if ( pattern . matcher ( coreLine ) . matches ( ) ) { return version ; } } } return null ;
public class AbstractFramedChannel { /** * Called when a source sub channel fails to fulfil its contract , and leaves the channel in an inconsistent state . * The underlying read side will be forcibly closed . * @ param cause The possibly null cause */ @ SuppressWarnings ( { } }
"unchecked" , "rawtypes" } ) protected void markReadsBroken ( Throwable cause ) { if ( readsBrokenUpdater . compareAndSet ( this , 0 , 1 ) ) { if ( UndertowLogger . REQUEST_IO_LOGGER . isDebugEnabled ( ) ) { UndertowLogger . REQUEST_IO_LOGGER . debugf ( new ClosedChannelException ( ) , "Marking reads broken on channel ...
public class MediaType { /** * Return a replica of this instance with the quality value of the given MediaType . * @ return the same instance if the given MediaType doesn ' t have a quality value , or a new one otherwise */ public MediaType copyQualityValue ( MediaType mediaType ) { } }
if ( ! mediaType . parameters . containsKey ( PARAM_QUALITY_FACTOR ) ) { return this ; } Map < String , String > params = new LinkedHashMap < String , String > ( this . parameters ) ; params . put ( PARAM_QUALITY_FACTOR , mediaType . parameters . get ( PARAM_QUALITY_FACTOR ) ) ; return new MediaType ( this , params ) ;
public class AnimaCache { /** * Get the column mapping based on the model Class type * Generated and stored in the Map when no column mapping exists * @ param modelType model class type * @ return model column mapping */ public static Map < String , String > computeModelColumnMappings ( Class < ? > modelType ) { ...
return MODEL_COLUMN_MAPPINGS . computeIfAbsent ( modelType , model -> { List < Field > fields = computeModelFields ( model ) ; return fields . stream ( ) . collect ( toMap ( AnimaCache :: getColumnName , Field :: getName ) ) ; } ) ;
public class AmazonIdentityManagementClient { /** * Deletes the permissions boundary for the specified IAM role . * < important > * Deleting the permissions boundary for a role might increase its permissions . For example , it might allow anyone * who assumes the role to perform all the actions granted in its per...
request = beforeClientExecution ( request ) ; return executeDeleteRolePermissionsBoundary ( request ) ;
public class HmacSignatureBuilder { /** * 仅包含请求头的数据运算 */ private void updateOnlyHeaderBuildDigest ( Mac digest ) throws IllegalStateException , UnsupportedEncodingException { } }
digest . update ( Validator . notNull ( apiKey , "apiKey not null" ) . getBytes ( charset ) ) ; digest . update ( delimiter ) ; digest . update ( Validator . notNull ( contentType , "contentType not null" ) . getBytes ( charset ) ) ; digest . update ( delimiter ) ; digest . update ( Validator . notNull ( date , "date n...
public class FSDatasetAsyncDiskService { /** * Execute the task sometime in the future , using ThreadPools . */ synchronized void execute ( File root , Runnable task ) { } }
if ( executors == null ) { throw new RuntimeException ( "AsyncDiskService is already shutdown" ) ; } ThreadPoolExecutor executor = executors . get ( root ) ; if ( executor == null ) { throw new RuntimeException ( "Cannot find root " + root + " for execution of task " + task ) ; } else { executor . execute ( task ) ; }