signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class Instance { /** * Gets the instance ' s id . */ @ SuppressWarnings ( "WeakerAccess" ) public String getId ( ) { } }
// Constructor ensures that name is not null InstanceName fullName = Verify . verifyNotNull ( InstanceName . parse ( proto . getName ( ) ) , "Name can never be null" ) ; // noinspection ConstantConditions return fullName . getInstance ( ) ;
public class CmsADEConfigDataInternal { /** * Handle the ordering from the module configurations . < p > */ protected void processModuleOrdering ( ) { } }
Collections . sort ( m_ownResourceTypes , new Comparator < CmsResourceTypeConfig > ( ) { public int compare ( CmsResourceTypeConfig a , CmsResourceTypeConfig b ) { return ComparisonChain . start ( ) . compare ( a . getOrder ( ) , b . getOrder ( ) ) . compare ( a . getTypeName ( ) , b . getTypeName ( ) ) . result ( ) ; ...
public class CmsSecurityManager { /** * Returns all resources associated to a given principal via an ACE with the given permissions . < p > * If the < code > includeAttr < / code > flag is set it returns also all resources associated to * a given principal through some of following attributes . < p > * < ul > *...
Set < CmsResource > dependencies ; CmsDbContext dbc = m_dbContextFactory . getDbContext ( context ) ; try { dependencies = m_driverManager . getResourcesForPrincipal ( dbc , dbc . currentProject ( ) , principalId , permissions , includeAttr ) ; } catch ( Exception e ) { dbc . report ( null , Messages . get ( ) . contai...
public class RestorableMeter { /** * Mark the occurrence of a given number of events . * @ param n the number of events */ public void mark ( long n ) { } }
tickIfNecessary ( ) ; count . addAndGet ( n ) ; m15Rate . update ( n ) ; m120Rate . update ( n ) ;
public class SystemKeyspace { /** * This method is used to update the System Keyspace with the new tokens for this node */ public static synchronized void updateTokens ( Collection < Token > tokens ) { } }
assert ! tokens . isEmpty ( ) : "removeEndpoint should be used instead" ; String req = "INSERT INTO system.%s (key, tokens) VALUES ('%s', ?)" ; executeInternal ( String . format ( req , LOCAL_CF , LOCAL_KEY ) , tokensAsSet ( tokens ) ) ; forceBlockingFlush ( LOCAL_CF ) ;
public class ImageMiscOps { /** * Inserts a single band into a multi - band image overwriting the original band * @ param input Single band image * @ param band Which band the image is to be inserted into * @ param output The multi - band image which the input image is to be inserted into */ public static void in...
final int numBands = output . numBands ; for ( int y = 0 ; y < input . height ; y ++ ) { int indexIn = input . getStartIndex ( ) + y * input . getStride ( ) ; int indexOut = output . getStartIndex ( ) + y * output . getStride ( ) + band ; int end = indexOut + output . width * numBands - band ; for ( ; indexOut < end ; ...
public class Node { /** * Get the affiliations of this node . * { @ code additionalExtensions } can be used e . g . to add a " Result Set Management " extension . * { @ code returnedExtensions } will be filled with the stanza extensions found in the answer . * @ param additionalExtensions additional { @ code Pack...
return getAffiliations ( AffiliationNamespace . basic , additionalExtensions , returnedExtensions ) ;
public class AbstractFFmpegStreamBuilder { /** * Add metadata on output streams . Which keys are possible depends on the used codec . * @ param key Metadata key , e . g . " comment " * @ param value Value to set for key * @ return this */ public T addMetaTag ( String key , String value ) { } }
checkValidKey ( key ) ; checkNotEmpty ( value , "value must not be empty" ) ; meta_tags . add ( "-metadata" ) ; meta_tags . add ( key + "=" + value ) ; return getThis ( ) ;
public class StringUtils { /** * 判断字符串是否为空 * @ param str 待判断的字符串 * @ return 是否是空字符串 , true : 空字符串 ; false : 非空字符串 */ public static boolean isEmpty ( String str ) { } }
if ( str == null ) return true ; if ( "" . equals ( str . trim ( ) ) ) return true ; return str . isEmpty ( ) ;
public class ObjectUtils { /** * Gets the value of a given property into a given bean . * @ param < T > * the property type . * @ param < Q > * the bean type . * @ param bean * the bean itself . * @ param propertyName * the property name . * @ param propertyType * the property type . * @ return th...
Assert . notNull ( bean , "bean" ) ; Assert . notNull ( propertyName , "propertyName" ) ; final PropertyAccessor propertyAccessor = PropertyAccessorFactory . forDirectFieldAccess ( bean ) ; try { Assert . isAssignable ( propertyType , propertyAccessor . getPropertyType ( propertyName ) ) ; } catch ( InvalidPropertyExce...
public class Timecode { /** * Goes through the system and sanitizes badly formed values : 00:00:60:00 will become * 00:01:00:00 , etc . */ @ SuppressWarnings ( "all" ) public void normalize ( ) { } }
// Start on samples int samplesPerFrame = ( int ) ( ( float ) getSamplesPerSecond ( ) / ( float ) getFramesPerSecond ( ) ) ; setFrames ( getFrames ( ) + ( int ) ( getSamples ( ) * ( 1.0f / samplesPerFrame ) ) ) ; setSamples ( getSamples ( ) % samplesPerFrame ) ; setSeconds ( getSeconds ( ) + ( int ) ( ( float ) getFram...
public class Stream { /** * Terminal operation storing the elements of this Stream in the supplied map as * { @ code < key , value > } pairs computed using the supplied Functions . The supplied key and * value Functions are called for each element , producing the keys and values to store in the * Map . If a null ...
Preconditions . checkNotNull ( keyFunction ) ; Preconditions . checkNotNull ( valueFunction ) ; Preconditions . checkNotNull ( map ) ; toHandler ( new Handler < T > ( ) { @ Override public void handle ( final T element ) { if ( element != null ) { final K key = keyFunction . apply ( element ) ; final V value = valueFun...
public class MapRow { /** * Retrieve a timestamp field . * @ param dateName field containing the date component * @ param timeName field containing the time component * @ return Date instance */ public Date getTimestamp ( FastTrackField dateName , FastTrackField timeName ) { } }
Date result = null ; Date date = getDate ( dateName ) ; if ( date != null ) { Calendar dateCal = DateHelper . popCalendar ( date ) ; Date time = getDate ( timeName ) ; if ( time != null ) { Calendar timeCal = DateHelper . popCalendar ( time ) ; dateCal . set ( Calendar . HOUR_OF_DAY , timeCal . get ( Calendar . HOUR_OF...
public class ESHttpMarshaller { /** * Creates a single " application / vnd . eventstore . events + xml " entry . * @ param registry * Registry with known serializers . * @ param targetContentType * Type of content that will be created later on . * @ param commonEvent * Event to marshal . * @ return Single...
Contract . requireArgNotNull ( "registry" , registry ) ; Contract . requireArgNotNull ( "targetContentType" , targetContentType ) ; Contract . requireArgNotNull ( "commonEvent" , commonEvent ) ; final EscMeta meta = EscSpiUtils . createEscMeta ( registry , targetContentType , commonEvent ) ; final String dataType = com...
public class ProxyFactory { /** * Returns an instance of a proxy class for the specified interfaces * that dispatches method invocations to the specified invocation * handler . * @ paramloader the class loader to define the proxy class * @ paramintf the interface for the proxy to implement * @ param h the inv...
return ( T ) Proxy . newProxyInstance ( loader , new Class [ ] { intf } , h ) ;
public class JaxWsUtils { /** * Check whether the regQName matches the targetQName * Only the localPart of the regQName supports the * match , it means only the name space and prefix is all matched , then * the localPart will be compared considering the * * When the ignorePrefix is true , the prefix will be ignor...
if ( regQName == null || targetQName == null ) { return false ; } if ( "*" . equals ( getQNameString ( regQName ) ) ) { return true ; } // if the name space or the prefix is not equal , just return false ; if ( ! ( regQName . getNamespaceURI ( ) . equals ( targetQName . getNamespaceURI ( ) ) ) || ! ( ignorePrefix || re...
public class ReferenceResolvingVisitor { /** * Takes the MethodInvocation , and attempts to resolve the types of objects passed into the method invocation . */ public boolean visit ( MethodInvocation node ) { } }
if ( ! StringUtils . contains ( node . toString ( ) , "." ) ) { // it must be a local method . ignore . return true ; } List < String > qualifiedInstances = new ArrayList < > ( ) ; List < String > argumentsQualified = new ArrayList < > ( ) ; // get qualified arguments of the method IMethodBinding resolveTypeBinding = n...
public class PluginManager { /** * This method will initialize all the loaded plugins * @ throws PluginException */ public void initAllLoadedPlugins ( ) throws PluginException { } }
LOGGER . debug ( "Initializig all loaded plugins" ) ; for ( Class < ? extends Plugin > pluginClass : implementations . keySet ( ) ) { Set < PluginContext > set = implementations . get ( pluginClass ) ; for ( PluginContext pluginContext : set ) { try { pluginContext . initialize ( pluginContext . getSystemSettings ( ) )...
public class UniformDataGenerator { /** * generates randomly N distinct integers from 0 to Max . * @ param N * number of integers to generate * @ param Max * bound on the value of integers * @ return an array containing randomly selected integers */ public int [ ] generateUniform ( int N , int Max ) { } }
if ( N * 2 > Max ) { return negate ( generateUniform ( Max - N , Max ) , Max ) ; } if ( 2048 * N > Max ) return generateUniformBitmap ( N , Max ) ; return generateUniformHash ( N , Max ) ;
public class MetaLocale { /** * Constructs a MetaLocale from a language tag string . */ public static MetaLocale fromLanguageTag ( String tag ) { } }
if ( tag . indexOf ( '_' ) != - 1 ) { tag = tag . replace ( '_' , SEP ) ; } return fromJavaLocale ( java . util . Locale . forLanguageTag ( tag ) ) ;
public class HttpURLFeedFetcher { /** * Retrieve a feed over HTTP * @ param feedUrl A non - null URL of a RSS / Atom feed to retrieve * @ return A { @ link com . rometools . rome . feed . synd . SyndFeed } object * @ throws IllegalArgumentException if the URL is null ; * @ throws IOException if a TCP error occu...
if ( feedUrl == null ) { throw new IllegalArgumentException ( "null is not a valid URL" ) ; } final URLConnection connection = feedUrl . openConnection ( ) ; if ( ! ( connection instanceof HttpURLConnection ) ) { throw new IllegalArgumentException ( feedUrl . toExternalForm ( ) + " is not a valid HTTP Url" ) ; } final ...
public class BooleanConverter { /** * { @ inheritDoc } */ @ Override public Boolean convert ( String v ) { } }
if ( v == null ) { return null ; } if ( v . equalsIgnoreCase ( "true" ) || v . equalsIgnoreCase ( "yes" ) || v . equalsIgnoreCase ( "y" ) || v . equalsIgnoreCase ( "on" ) || v . equalsIgnoreCase ( "1" ) ) { return Boolean . TRUE ; } else { return Boolean . FALSE ; }
public class WxCryptUtil { /** * 4个字节的网络字节序bytes数组还原成一个数字 * @ param bytesInNetworkOrder */ private int bytesNetworkOrder2Number ( byte [ ] bytesInNetworkOrder ) { } }
int sourceNumber = 0 ; for ( int i = 0 ; i < 4 ; i ++ ) { sourceNumber <<= 8 ; sourceNumber |= bytesInNetworkOrder [ i ] & 0xff ; } return sourceNumber ;
public class StringUtility { /** * Splits a < code > String < / code > into a < code > String [ ] < / code > . */ public static int splitString ( String line , char [ ] [ ] [ ] buff ) { } }
int len = line . length ( ) ; int wordCount = 0 ; int pos = 0 ; while ( pos < len ) { // Skip past blank space while ( pos < len && line . charAt ( pos ) <= ' ' ) pos ++ ; int start = pos ; // Skip to the next blank space while ( pos < len && line . charAt ( pos ) > ' ' ) pos ++ ; if ( pos > start ) wordCount ++ ; } ch...
public class ConstraintExceptionMapper { /** * Creates a constrainedBy link header with the appropriate RDF URL for the exception . * @ param e ConstraintViolationException Exception which implements the buildContraintUri method . * @ param context ServletContext ServletContext that we ' re running in . * @ param...
String path = context . getContextPath ( ) ; if ( path . equals ( "/" ) ) { path = "" ; } final String constraintURI = uriInfo == null ? "" : String . format ( "%s://%s%s%s%s.rdf" , uriInfo . getBaseUri ( ) . getScheme ( ) , uriInfo . getBaseUri ( ) . getAuthority ( ) , path , CONSTRAINT_DIR , e . getClass ( ) . toStri...
public class SelectOption { /** * Release any acquired resources . */ protected void localRelease ( ) { } }
super . localRelease ( ) ; _state . clear ( ) ; _text = null ; _disabled = false ; _value = null ; _hasError = false ;
public class CardAPI { /** * 核查code * @ param accessToken accessToken * @ param codeCheck codeCheck * @ return result */ public static CodeCheckCodeResult codeCheckCode ( String accessToken , CodeCheckCode codeCheck ) { } }
return codeCheckCode ( accessToken , JsonUtil . toJSONString ( codeCheck ) ) ;
public class PropertiesEscape { /** * Perform a ( configurable ) Java Properties Key < strong > escape < / strong > operation on a < tt > char [ ] < / tt > input . * This method will perform an escape operation according to the specified * { @ link org . unbescape . properties . PropertiesKeyEscapeLevel } argument ...
if ( writer == null ) { throw new IllegalArgumentException ( "Argument 'writer' cannot be null" ) ; } if ( level == null ) { throw new IllegalArgumentException ( "The 'level' argument cannot be null" ) ; } final int textLen = ( text == null ? 0 : text . length ) ; if ( offset < 0 || offset > textLen ) { throw new Illeg...
public class ClusTree { /** * XXX : Document the insertion when the final implementation is done . */ private Entry insertHere ( Entry newEntry , Node currentNode , Entry parentEntry , ClusKernel carriedBuffer , Budget budget , long timestamp ) { } }
int numFreeEntries = currentNode . numFreeEntries ( ) ; // Insert the buffer that we carry . if ( ! carriedBuffer . isEmpty ( ) ) { Entry bufferEntry = new Entry ( this . numberDimensions , carriedBuffer , timestamp , parentEntry , currentNode ) ; if ( numFreeEntries <= 1 ) { // Distance from buffer to entries . Entry ...
public class LookupManagerImpl { /** * { @ inheritDoc } */ @ Override public List < ServiceInstance > lookupInstances ( String serviceName ) throws ServiceException { } }
if ( ! isStarted ) { ServiceDirectoryError error = new ServiceDirectoryError ( ErrorCode . SERVICE_DIRECTORY_MANAGER_FACTORY_CLOSED ) ; throw new ServiceException ( error ) ; } List < ModelServiceInstance > modelSvc = getLookupService ( ) . getUPModelInstances ( serviceName ) ; if ( modelSvc == null || modelSvc . isEmp...
public class AFactoryAppBeans { /** * < p > Get SrvNumberToString in lazy mode . < / p > * @ return SrvNumberToString - SrvNumberToString * @ throws Exception - an exception */ public final SrvNumberToString lazyGetSrvNumberToString ( ) throws Exception { } }
String beanName = getSrvNumberToStringName ( ) ; SrvNumberToString srvDate = ( SrvNumberToString ) this . beansMap . get ( beanName ) ; if ( srvDate == null ) { srvDate = new SrvNumberToString ( ) ; this . beansMap . put ( beanName , srvDate ) ; lazyGetLogger ( ) . info ( null , AFactoryAppBeans . class , beanName + " ...
public class CmsXmlContentEditor { /** * Returns the HTML for the element operation buttons add , move , remove . < p > * @ param value the value for which the buttons are generated * @ param addElement if true , the button to add an element is shown * @ param removeElement if true , the button to remove an eleme...
StringBuffer jsCall = new StringBuffer ( 512 ) ; String elementName = CmsXmlUtils . removeXpathIndex ( value . getPath ( ) ) ; // indicates if at least one button is active boolean buttonPresent = false ; int index = value . getIndex ( ) ; jsCall . append ( "showElementButtons('" ) ; jsCall . append ( elementName ) ; j...
public class RTMPConnection { /** * { @ inheritDoc } */ public void ping ( ) { } }
long newPingTime = System . currentTimeMillis ( ) ; if ( log . isDebugEnabled ( ) ) { log . debug ( "Send Ping: session=[{}], currentTime=[{}], lastPingTime=[{}]" , new Object [ ] { getSessionId ( ) , newPingTime , lastPingSentOn . get ( ) } ) ; } if ( lastPingSentOn . get ( ) == 0 ) { lastPongReceivedOn . set ( newPin...
public class Grefenstette { /** * { @ inheritDoc } */ public Vector getVector ( String word ) { } }
word = word . toLowerCase ( ) ; if ( objectTable . containsKey ( word ) ) { int wordIndex = objectTable . get ( word ) ; if ( wordIndex < syntacticCooccurrence . rows ( ) ) { return syntacticCooccurrence . getRowVector ( wordIndex ) ; } // At this section , several exception handlers were removed . These // may have be...
public class LazyUserTransaction { public static List < IndependentProcessor > getLazyProcessList ( ) { } }
// not null , empty allowed final String lazyKey = generateLazyProcessListKey ( ) ; final List < IndependentProcessor > lazyList = ThreadCacheContext . getObject ( lazyKey ) ; return lazyList != null ? lazyList : Collections . emptyList ( ) ;
public class DefaultObjectCreator { /** * 根据XML构造体在对象中填入属性 */ @ SuppressWarnings ( { } }
"rawtypes" , "unchecked" } ) private void setAttribute ( NodeConfig nodeConfig , Object targetObject ) throws UnmarshalException { Class targetClass = targetObject . getClass ( ) ; List attributes = nodeConfig . getAttribute ( ) ; if ( attributes != null && attributes . size ( ) > 0 ) { for ( Iterator iterAttr = attrib...
public class JsonParserLax { /** * Decodes a number from a JSON value . If at any point it is determined that * the value is not a valid number the value is treated as a { @ code String } . * @ param minus indicate whether the number is negative * @ return a number , or { @ code String } if not a valid number */ ...
char [ ] array = charArray ; final int startIndex = __index ; int index = __index ; char currentChar ; boolean doubleFloat = false ; boolean foundDot = false ; boolean foundSign = false ; boolean foundExp = false ; if ( minus && index + 1 < array . length ) { index ++ ; } while ( true ) { currentChar = array [ index ] ...
public class SunburstChart { /** * Defines if tthe color of all chart segments in one group should be filled with the color * of the groups root node or by the color defined in the chart data elements * @ param USE */ public void setUseColorFromParent ( final boolean USE ) { } }
if ( null == useColorFromParent ) { _useColorFromParent = USE ; redraw ( ) ; } else { useColorFromParent . set ( USE ) ; }
public class LogChannel { /** * This method will only be called AFTER affirming that we should be logging */ void log ( SessionLogEntry entry , String formattedMessage ) { } }
int level = entry . getLevel ( ) ; Throwable loggedException = entry . getException ( ) ; String msgParm ; if ( ( formattedMessage == null || formattedMessage . equals ( "" ) ) && loggedException != null ) { msgParm = loggedException . toString ( ) ; } else { msgParm = formattedMessage ; } switch ( level ) { case 8 : r...
public class PolymerClassRewriter { /** * For any strings returned in the array from the Polymer static observers property , parse the * method call and path arguments and replace them with property reflection calls . * < p > Returns a list of property sink statements to guard against dead code elimination since th...
List < Node > propertySinkStatements = new ArrayList < > ( ) ; Node classMembers = NodeUtil . getClassMembers ( cls . definition ) ; Node getter = NodeUtil . getFirstGetterMatchingKey ( classMembers , "observers" ) ; if ( getter != null ) { Node complexObservers = null ; for ( Node child : NodeUtil . getFunctionBody ( ...
public class xen_hotfix { /** * Use this operation to apply new xen hotfixes . */ public static xen_hotfix apply ( nitro_service client , xen_hotfix resource ) throws Exception { } }
return ( ( xen_hotfix [ ] ) resource . perform_operation ( client , "apply" ) ) [ 0 ] ;
public class AlphabetFactory { /** * 构造特征词典 * @ param name 词典名称 * @ return 特征词典 */ public IFeatureAlphabet buildFeatureAlphabet ( String name , Type type ) { } }
IAlphabet alphabet = null ; if ( ! maps . containsKey ( name ) ) { IFeatureAlphabet fa ; if ( type == Type . String ) fa = new StringFeatureAlphabet ( ) ; else if ( type == Type . Integer ) fa = new HashFeatureAlphabet ( ) ; else return null ; maps . put ( name , fa ) ; alphabet = maps . get ( name ) ; } else { alphabe...
public class WxPayApi { /** * 分账请求 * @ param params * 请求参数 * @ param certPath * 证书文件目录 * @ param certPass * 证书密码 * @ return { String } */ public static String profitsharing ( Map < String , String > params , String certPath , String certPassword ) { } }
return doPostSSL ( PROFITSHARING_URL , params , certPath , certPassword ) ;
public class StaticTypeCheckingVisitor { /** * Stores the inferred return type of a closure or a method . We are using a separate key to store * inferred return type because the inferred type of a closure is { @ link Closure } , which is different * from the inferred type of the code of the closure . * @ param no...
if ( ! ( node instanceof ClosureExpression ) ) { throw new IllegalArgumentException ( "Storing inferred return type is only allowed on closures but found " + node . getClass ( ) ) ; } return ( ClassNode ) node . putNodeMetaData ( StaticTypesMarker . INFERRED_RETURN_TYPE , type ) ;
public class Streams { /** * Group a Stream until the supplied predicate holds * @ see ReactiveSeq # groupedUntil ( Predicate ) * @ param stream Stream to group * @ param predicate Predicate to determine grouping * @ return Stream grouped into Lists determined by predicate */ public final static < T > Stream < ...
return groupedWhile ( stream , predicate . negate ( ) ) ;
public class GZIPArchiveWriter { /** * Returns an object that can be used to write an entry in the GZIP archive . * In order to write the actual entry , one must write the entry content on the { @ link GZIPArchive . WriteEntry # deflater } and , * at the end , call its < code > close ( ) < / code > method ( to actu...
crc . reset ( ) ; deflater . reset ( ) ; deflaterStream . reset ( ) ; final GZIPArchive . WriteEntry entry = new GZIPArchive . WriteEntry ( ) ; entry . setName ( name ) ; entry . setComment ( comment ) ; entry . deflater = new FilterOutputStream ( new DeflaterOutputStream ( deflaterStream , deflater ) ) { private final...
public class URBridge { /** * Get the information about Users and Groups from the underlying User Registry * @ param root Input object containing set identifiers of objects to be fetched , * and optionally control objects . * @ throws WIMException improper control objects are in the input datagraph , * invalid ...
Root returnRoot = new Root ( ) ; String uniqueName = null ; String auditName = null ; AuditManager auditManager = new AuditManager ( ) ; try { List < String > attrList = null ; List < String > grpMbrAttrs = null ; List < String > grpMbrshipAttrs = null ; // Retrieve control objects Map < String , Control > ctrlMap = Co...
public class SftpClient { /** * Sets the transfer mode for current operations . The valid modes are : < br > * < br > * { @ link # MODE _ BINARY } - Files are transferred in binary mode and no * processing of text files is performed ( default mode ) . < br > * < br > * { @ link # MODE _ TEXT } - For servers s...
if ( transferMode != MODE_BINARY && transferMode != MODE_TEXT ) throw new IllegalArgumentException ( "Mode can only be either binary or text" ) ; this . transferMode = transferMode ; if ( Log . isDebugEnabled ( ) ) { Log . debug ( this , "Transfer mode set to " + ( transferMode == MODE_BINARY ? "binary" : "text" ) ) ; ...
public class StrBuffer { /** * Get the next field and fill it with data from this buffer . * You must override this method . * @ param field The field to set . * @ param bDisplayOption The display option for setting the field . * @ param iMoveMove The move mode for setting the field . * @ return The error cod...
String string = this . getNextString ( ) ; if ( string == null ) return Constants . ERROR_RETURN ; if ( string == DATA_SKIP ) return Constants . NORMAL_RETURN ; // Don ' t set this field return field . setString ( string , bDisplayOption , iMoveMode ) ;
public class ItemUtils { /** * Gets the { @ link ItemStack } matching the specified { @ link IBlockState } * @ param state the state * @ return the item stack from state */ public static ItemStack getItemStackFromState ( IBlockState state ) { } }
if ( state == null ) return null ; Item item = Item . getItemFromBlock ( state . getBlock ( ) ) ; if ( item == null ) return ItemStack . EMPTY ; return new ItemStack ( item , 1 , state . getBlock ( ) . damageDropped ( state ) ) ;
public class JSModuleGraph { /** * If a weak module doesn ' t already exist , creates a weak module depending on every other module . * < p > Does not move any sources into the weak module . * @ return a new list of modules that includes the weak module , if it was newly created , or the * same list if the weak m...
boolean hasWeakModule = false ; for ( JSModule module : modulesInDepOrder ) { if ( module . getName ( ) . equals ( JSModule . WEAK_MODULE_NAME ) ) { hasWeakModule = true ; Set < JSModule > allOtherModules = new HashSet < > ( modulesInDepOrder ) ; allOtherModules . remove ( module ) ; checkState ( module . getAllDepende...
public class TemplateSubPatternAssociation { /** * Return the mode associated with the template . * @ param xctxt XPath context to use with this template * @ param targetNode Target node * @ param mode reference , which may be null , to the < a href = " http : / / www . w3 . org / TR / xslt # modes " > current mo...
double score = m_stepPattern . getMatchScore ( xctxt , targetNode ) ; return ( XPath . MATCH_SCORE_NONE != score ) && matchModes ( mode , m_template . getMode ( ) ) ;
public class LayerImpl { /** * / * ( non - Javadoc ) * @ see com . ibm . jaggr . service . layer . ILayer # getLastModified ( javax . servlet . http . HttpServletRequest ) */ @ SuppressWarnings ( "unchecked" ) @ Override public long getLastModified ( HttpServletRequest request ) throws IOException { } }
long lastModified = _lastModified ; IAggregator aggregator = ( IAggregator ) request . getAttribute ( IAggregator . AGGREGATOR_REQATTRNAME ) ; IOptions options = aggregator . getOptions ( ) ; // Don ' t check last modified dates of source files on every request in production mode // for performance reasons . _ validate...
public class AbstractSecurityService { /** * Logout out the current page instance . * @ param force If true , force logout without user interaction . * @ param target Optional target url for next login . * @ param message Optional message to indicate reason for logout . */ @ Override public void logout ( boolean ...
log . trace ( "Logging Out" ) ; IContextManager contextManager = ContextManager . getInstance ( ) ; if ( contextManager == null ) { logout ( target , message ) ; } else { contextManager . reset ( force , ( response ) -> { if ( force || ! response . rejected ( ) ) { logout ( target , message ) ; } } ) ;
public class ZWaveController { /** * Handles the response of the SerialApiGetInitData request . * @ param incomingMlivessage the response message to process . */ private void handleSerialApiGetInitDataResponse ( SerialMessage incomingMessage ) { } }
logger . debug ( String . format ( "Got MessageSerialApiGetInitData response." ) ) ; this . isConnected = true ; int nodeBytes = incomingMessage . getMessagePayloadByte ( 2 ) ; if ( nodeBytes != NODE_BYTES ) { logger . error ( "Invalid number of node bytes = {}" , nodeBytes ) ; return ; } int nodeId = 1 ; // loop bytes...
public class BeansDescriptorImpl { /** * Returns all < code > scan < / code > elements * @ return list of < code > scan < / code > */ public List < Scan < BeansDescriptor > > getAllScan ( ) { } }
List < Scan < BeansDescriptor > > list = new ArrayList < Scan < BeansDescriptor > > ( ) ; List < Node > nodeList = model . get ( "scan" ) ; for ( Node node : nodeList ) { Scan < BeansDescriptor > type = new ScanImpl < BeansDescriptor > ( this , "scan" , model , node ) ; list . add ( type ) ; } return list ;
public class ViewPropertyAnimatorPreHC { /** * Utility function , called by animateProperty ( ) and animatePropertyBy ( ) , which handles the * details of adding a pending animation and posting the request to start the animation . * @ param constantName The specifier for the property being animated * @ param star...
// First , cancel any existing animations on this property if ( mAnimatorMap . size ( ) > 0 ) { Animator animatorToCancel = null ; Set < Animator > animatorSet = mAnimatorMap . keySet ( ) ; for ( Animator runningAnim : animatorSet ) { PropertyBundle bundle = mAnimatorMap . get ( runningAnim ) ; if ( bundle . cancel ( c...
public class LdapConnection { /** * Check the attributes cache for the attributes on the distinguished name . * If any of the attributes are missing , a call to the LDAP server will be made to retrieve them . * @ param name The distinguished name to look up the attributes in the cache for . * @ param attrIds The ...
final String METHODNAME = "checkAttributesCache" ; Attributes attributes = null ; // If attribute cache is available , look up cache first if ( getAttributesCache ( ) != null ) { String key = toKey ( name ) ; Object cached = getAttributesCache ( ) . get ( key ) ; // Cache entry found if ( cached != null && ( cached ins...
public class LoggerFactory { /** * 获取日志输出器 * @ param key 分类键 * @ return 日志输出器 , 后验条件 : 不返回null . */ public static Logger getLogger ( Class < ? > key ) { } }
FailsafeLogger logger = LOGGERS . get ( key . getName ( ) ) ; if ( logger == null ) { LOGGERS . putIfAbsent ( key . getName ( ) , new FailsafeLogger ( LOGGER_ADAPTER . getLogger ( key ) ) ) ; logger = LOGGERS . get ( key . getName ( ) ) ; } return logger ;
public class CmsListItemWidget { /** * Sets the extra info text , and hides or displays the extra info label depending on whether * the text is null or not null . < p > * @ param text the text to put into the subtitle suffix */ public void setExtraInfo ( String text ) { } }
if ( text == null ) { if ( m_shortExtraInfoLabel . getParent ( ) != null ) { m_shortExtraInfoLabel . removeFromParent ( ) ; } } else { if ( m_shortExtraInfoLabel . getParent ( ) == null ) { m_titleBox . add ( m_shortExtraInfoLabel ) ; } m_shortExtraInfoLabel . setText ( text ) ; } updateTruncation ( ) ;
public class CounterAspect { /** * Implementation for the @ Count pointcut . * @ param pjp ProceedingJoinPoint . * @ param aProducerId producerId from annotation . * @ param aSubsystem subsystem configured by annotation - * @ param aCategory category configured by annotation . * @ return * @ throws Throwabl...
return perform ( false , getMethodStatName ( pjp . getSignature ( ) ) , pjp , aProducerId , aCategory , aSubsystem ) ;
public class Types { /** * Does t have a result that is a subtype of the result type of s , * suitable for covariant returns ? It is assumed that both types * are ( possibly polymorphic ) method types . Monomorphic method * types are handled in the obvious way . Polymorphic method types * require renaming all t...
List < Type > tvars = t . getTypeArguments ( ) ; List < Type > svars = s . getTypeArguments ( ) ; Type tres = t . getReturnType ( ) ; Type sres = subst ( s . getReturnType ( ) , svars , tvars ) ; return covariantReturnType ( tres , sres , warner ) ;
public class Gram { /** * Performs ping operation on the gatekeeper with * specified user credentials . * Verifies if the user is authorized to submit a job * to that gatekeeper . * @ throws GramException if an error occurs or user in unauthorized * @ param cred user credentials * @ param resourceManagerCon...
ResourceManagerContact rmc = new ResourceManagerContact ( resourceManagerContact ) ; Socket socket = gatekeeperConnect ( cred , rmc , false , false ) ; HttpResponse hd = null ; try { OutputStream out = socket . getOutputStream ( ) ; InputStream in = socket . getInputStream ( ) ; String msg = GRAMProtocol . PING ( rmc ....
public class XCostExtension { /** * Assigns ( to the given event ) multiple cost types given their keys . * Note that as a side effect this method * creates attributes when it does not find an attribute with the proper * key . * @ see # assignAmounts ( XEvent , Map ) * @ param event * Event to assign the co...
XCostType . instance ( ) . assignNestedValues ( event , types ) ;
public class HtmlRendererUtils { /** * Render an attribute taking into account the passed event , * the component property and the passed attribute value for the component * property . The event will be rendered on the selected htmlAttrName . * @ param facesContext * @ param writer * @ param componentProperty...
return renderBehaviorizedAttribute ( facesContext , writer , componentProperty , component , component . getClientId ( facesContext ) , eventName , eventParameters , clientBehaviors , htmlAttrName , attributeValue ) ;
public class QueryParameters { /** * Returns value by searching key assigned to that position * @ param position Position which would be searched * @ return Value * @ throws NoSuchFieldException */ public Object getValueByPosition ( Integer position ) throws NoSuchFieldException { } }
String name = null ; Object value = null ; name = this . getNameByPosition ( position ) ; if ( name != null ) { value = this . getValue ( name ) ; } else { throw new NoSuchFieldException ( ) ; } return value ;
public class HierarchicalTable { /** * Make the record represented by this DataRecord current . * @ param dataRecord tour . db . DataRecord The datarecord to try to recreate . * @ return true if successful . */ public boolean setDataRecord ( DataRecord dataRecord ) { } }
boolean success = super . setDataRecord ( dataRecord ) ; if ( this . getCurrentTable ( ) != this . getNextTable ( ) ) this . syncRecordToBase ( this . getRecord ( ) , this . getCurrentTable ( ) . getRecord ( ) , false ) ; return success ;
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link MovingObjectStatusType } { @ code > } * @ param value * Java instance representing xml element ' s value . * @ return * the new instance of { @ link JAXBElement } { @ code < } { @ link MovingObjectStatusType } ...
return new JAXBElement < MovingObjectStatusType > ( _MovingObjectStatus_QNAME , MovingObjectStatusType . class , null , value ) ;
public class DOM2DTM { /** * Given a node handle , return its XPath - style localname . * ( As defined in Namespaces , this is the portion of the name after any * colon character ) . * @ param nodeHandle the id of the node . * @ return String Local name of this node . */ public String getLocalName ( int nodeHan...
if ( JJK_NEWCODE ) { int id = makeNodeIdentity ( nodeHandle ) ; if ( NULL == id ) return null ; Node newnode = ( Node ) m_nodes . elementAt ( id ) ; String newname = newnode . getLocalName ( ) ; if ( null == newname ) { // XSLT treats PIs , and possibly other things , as having QNames . String qname = newnode . getNode...
public class SignerInfo { /** * Copied from com . sun . crypto . provider . OAEPParameters . */ private static String convertToStandardName ( String internalName ) { } }
if ( internalName . equals ( "SHA" ) ) { return "SHA-1" ; } else if ( internalName . equals ( "SHA224" ) ) { return "SHA-224" ; } else if ( internalName . equals ( "SHA256" ) ) { return "SHA-256" ; } else if ( internalName . equals ( "SHA384" ) ) { return "SHA-384" ; } else if ( internalName . equals ( "SHA512" ) ) { r...
public class DataExportUtility { /** * Command line entry point . * @ param argv command line arguments */ public static void main ( String [ ] argv ) { } }
if ( argv . length != 2 ) { System . out . println ( "DataExport <filename> <output directory>" ) ; } else { Connection connection = null ; try { Class . forName ( "sun.jdbc.odbc.JdbcOdbcDriver" ) ; String url = "jdbc:odbc:DRIVER=Microsoft Access Driver (*.mdb);DBQ=" + argv [ 0 ] ; connection = DriverManager . getConne...
public class JsonAttributeMappings { /** * Re - expands a flattened json representation from a collection of attributes back into a raw * nested json string . */ public static String toJsonString ( Collection < Attribute > attributeCollection , ObjectMapper objectMapper ) throws JsonProcessingException { } }
return objectMapper . writeValueAsString ( toObject ( attributeCollection ) ) ;
public class BatchCSVRecord { /** * Return a batch record based on a dataset * @ param dataSet the dataset to get the batch record for * @ return the batch record */ public static BatchCSVRecord fromDataSet ( DataSet dataSet ) { } }
BatchCSVRecord batchCSVRecord = new BatchCSVRecord ( ) ; for ( int i = 0 ; i < dataSet . numExamples ( ) ; i ++ ) { batchCSVRecord . add ( SingleCSVRecord . fromRow ( dataSet . get ( i ) ) ) ; } return batchCSVRecord ;
public class EmailAddressValidator { /** * Checks if a value is a valid e - mail address . Depending on the global value * for the MX record check the check is performed incl . the MX record check or * without . * @ param sEmail * The value validation is being performed on . A < code > null < / code > * value...
return s_aPerformMXRecordCheck . get ( ) ? isValidWithMXCheck ( sEmail ) : EmailAddressHelper . isValid ( sEmail ) ;
public class TargetStreamManager { /** * Handle a filtered message by inserting it in to the * appropriate target stream as Silence . * Since we only need to do this on exisiting TargetStreams , if the * streamSet or stream are null we give up * @ param msgItem * @ throws SIResourceException */ public void ha...
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "handleSilence" , new Object [ ] { msgItem } ) ; JsMessage jsMsg = msgItem . getMessage ( ) ; int priority = jsMsg . getPriority ( ) . intValue ( ) ; Reliability reliability = jsMsg . getReliability ( ) ; StreamSet st...
public class Configuration { /** * Set the value of the < code > name < / code > property to the name of a * < code > theClass < / code > implementing the given interface < code > xface < / code > . * An exception is thrown if < code > theClass < / code > does not implement the * interface < code > xface < / code...
if ( ! xface . isAssignableFrom ( theClass ) ) throw new RuntimeException ( theClass + " does not implement " + xface . getName ( ) ) ; set ( name , theClass . getName ( ) ) ;
public class BinaryFormatImplBenchmark { /** * This benchmark attempts to measure performance of { @ link BinaryFormat # fromBinaryValue ( byte [ ] ) } . */ @ Benchmark @ BenchmarkMode ( Mode . SampleTime ) @ OutputTimeUnit ( TimeUnit . NANOSECONDS ) public SpanContext fromBinarySpanContext ( Data data ) throws SpanCon...
return data . binaryFormat . fromByteArray ( data . spanContextBinary ) ;
public class VariableImpl { /** * outputs a empty Variable , only scope Example : pc . formScope ( ) ; * @ param adapter * @ throws TemplateException */ private Type _writeOutEmpty ( BytecodeContext bc ) throws TransformerException { } }
if ( ignoredFirstMember && ( scope == Scope . SCOPE_LOCAL || scope == Scope . SCOPE_VAR ) ) return Types . VOID ; GeneratorAdapter adapter = bc . getAdapter ( ) ; adapter . loadArg ( 0 ) ; Method m ; Type t = Types . PAGE_CONTEXT ; if ( scope == Scope . SCOPE_ARGUMENTS ) { getFactory ( ) . TRUE ( ) . writeOut ( bc , MO...
public class AnyValueMap { /** * Appends new elements to this map . * @ param map a map with elements to be added . */ public void append ( Map < ? , ? > map ) { } }
if ( map == null || map . size ( ) == 0 ) return ; for ( Map . Entry < ? , ? > entry : map . entrySet ( ) ) { String key = StringConverter . toString ( entry . getKey ( ) ) ; Object value = entry . getValue ( ) ; super . put ( key , value ) ; }
public class Any { /** * Optional string encoded content for non - binary media types . If this is filled * in , then the & # 39 ; bin & # 39 ; field is not needed . * @ return Optional of the < code > text < / code > field value . */ @ javax . annotation . Nonnull public java . util . Optional < String > optionalT...
return java . util . Optional . ofNullable ( mText ) ;
public class XMLHelper { /** * Helper program : Extracts the specified XPATH expression * from an XML - String . * @ param node the node * @ param xPath the x path * @ return NodeList * @ throws XPathExpressionException the x path expression exception */ public static Node getElementB ( Node node , XPathExpre...
return getElementsB ( node , xPath ) . item ( 0 ) ;
public class Queue { /** * Add a single data point to the queue * If the queue is a bounded queue and is full , will return false * @ param data Data to add * @ return true if successfully added . */ public boolean add ( final T data ) { } }
try { final boolean result = queue . add ( ( T ) nullSafe ( data ) ) ; if ( result ) { if ( sizeSignal != null ) this . sizeSignal . set ( queue . size ( ) ) ; } return result ; } catch ( final IllegalStateException e ) { return false ; }
public class SecStrucCalc { /** * Calculate HBond energy of two groups in cal / mol * see Creighton page 147 f * Jeffrey , George A . , An introduction to hydrogen bonding , * Oxford University Press , 1997. * categorizes hbonds with donor - acceptor distances of * 2.2-2.5 & aring ; as " strong , mostly coval...
Atom N = one . getN ( ) ; Atom H = one . getH ( ) ; Atom O = two . getO ( ) ; Atom C = two . getC ( ) ; double dno = Calc . getDistance ( O , N ) ; double dhc = Calc . getDistance ( C , H ) ; double dho = Calc . getDistance ( O , H ) ; double dnc = Calc . getDistance ( C , N ) ; logger . debug ( " cccc: {} {} {} {} O (...
public class TouchImageView { /** * When transitioning from zooming from focus to zoom from center ( or vice versa ) * the image can become unaligned within the view . This is apparent when zooming * quickly . When the content size is less than the view size , the content will often * be centered incorrectly with...
fixTrans ( ) ; matrix . getValues ( m ) ; if ( getImageWidth ( ) < viewWidth ) { m [ Matrix . MTRANS_X ] = ( viewWidth - getImageWidth ( ) ) / 2 ; } if ( getImageHeight ( ) < viewHeight ) { m [ Matrix . MTRANS_Y ] = ( viewHeight - getImageHeight ( ) ) / 2 ; } matrix . setValues ( m ) ;
public class AIStream { /** * A ControlRequestAck message tells the RME to slow down its get repetition timeout since we now know that the * DME has received the request . */ public void processRequestAck ( long tick , long dmeVersion ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "processRequestAck" , new Object [ ] { Long . valueOf ( tick ) , Long . valueOf ( dmeVersion ) } ) ; // Only consider non - stale request acks if ( dmeVersion >= _latestDMEVersion ) { _targetStream . setCursor ( tick ) ; Tic...
public class IPSettings { /** * returns the cumulative settings for a given address * @ param addr * @ return */ public Map getSettings ( String addr ) { } }
try { return this . getSettings ( InetAddress . getByName ( addr ) ) ; } catch ( Throwable t ) { ExceptionUtil . rethrowIfNecessary ( t ) ; } return EMPTY ;
public class HiveSource { /** * Convert createTime from seconds to milliseconds */ protected static long getCreateTime ( Table table ) { } }
return TimeUnit . MILLISECONDS . convert ( table . getTTable ( ) . getCreateTime ( ) , TimeUnit . SECONDS ) ;
public class LogImpl { /** * / * ( non - Javadoc ) * @ see org . apache . commons . logging . Log # fatal ( java . lang . Object , java . lang . Throwable ) */ public void fatal ( Object arg0 , Throwable arg1 ) { } }
message ( FAIL , new Object [ ] { arg0 , arg1 } , new Frame ( 1 ) ) ;
public class LocalDateIMMDateCalculator { private LocalDate calculateIMMMonth ( final boolean requestNextIMM , final LocalDate startDate , final int month ) { } }
int monthOffset ; LocalDate date = startDate ; switch ( month ) { case MARCH : case JUNE : case SEPTEMBER : case DECEMBER : final LocalDate immDate = calculate3rdWednesday ( date ) ; if ( requestNextIMM && ! date . isBefore ( immDate ) ) { date = date . plusMonths ( MONTHS_IN_QUARTER ) ; } else if ( ! requestNextIMM &&...
public class HystrixMetricsPublisherFactory { /** * / * package */ HystrixMetricsPublisherThreadPool getPublisherForThreadPool ( HystrixThreadPoolKey threadPoolKey , HystrixThreadPoolMetrics metrics , HystrixThreadPoolProperties properties ) { } }
// attempt to retrieve from cache first HystrixMetricsPublisherThreadPool publisher = threadPoolPublishers . get ( threadPoolKey . name ( ) ) ; if ( publisher != null ) { return publisher ; } // it doesn ' t exist so we need to create it publisher = HystrixPlugins . getInstance ( ) . getMetricsPublisher ( ) . getMetric...
public class TransformMojo { /** * Called by Maven to run the plugin . */ public void execute ( ) throws MojoExecutionException , MojoFailureException { } }
if ( isSkipping ( ) ) { getLog ( ) . debug ( "Skipping execution, as demanded by user." ) ; return ; } if ( transformationSets == null || transformationSets . length == 0 ) { throw new MojoFailureException ( "No TransformationSets configured." ) ; } checkCatalogHandling ( ) ; Object oldProxySettings = activateProxy ( )...
public class JspFactory { /** * Returns the default factory for this implementation . * @ return the default factory for this implementation */ public static synchronized JspFactory getDefaultFactory ( ) { } }
if ( deflt == null ) { try { Class factory = Class . forName ( "org.apache.jasper.runtime.JspFactoryImpl" ) ; if ( factory != null ) { deflt = ( JspFactory ) factory . newInstance ( ) ; } } catch ( Exception ex ) { } } return deflt ;
public class GeoServiceBounds { /** * Build a bounding box feature . * In this case , it has a name but is empty . * @ param id the ID string * @ return the Feature for the new bounds */ public static Feature createBounds ( final String id ) { } }
final Feature feature = new Feature ( ) ; feature . setId ( id ) ; feature . setGeometry ( new Polygon ( ) ) ; return feature ;
public class BridgeHeadTypeRegistry { /** * Registers the given bridge factory and its bridge head types . * @ param bridgeFactory The bridge factory to register */ public void register ( BridgeFactory bridgeFactory ) { } }
Class < ? > nearType = bridgeFactory . getNearType ( ) ; Class < ? > farType = bridgeFactory . getFarType ( ) ; logger . trace ( display ( nearType ) + ": " + display ( farType ) ) ; nearToFarType . put ( nearType , farType ) ; farToNearType . put ( farType , nearType ) ; nearTypeToFactory . put ( nearType , bridgeFact...
public class GeoPackageManager { /** * Open a GeoPackage * @ param name * GeoPackage name * @ param file * GeoPackage file * @ return GeoPackage * @ since 3.0.2 */ public static GeoPackage open ( String name , File file ) { } }
// Validate or add the file extension if ( GeoPackageIOUtils . hasFileExtension ( file ) ) { GeoPackageValidate . validateGeoPackageExtension ( file ) ; } else { file = GeoPackageIOUtils . addFileExtension ( file , GeoPackageConstants . GEOPACKAGE_EXTENSION ) ; } // Create the GeoPackage Connection and table creator Ge...
public class FieldAccess { /** * called in ' in ' access */ @ Override public void setData ( FieldContent data ) { } }
// allow setting in field once only . // cannot have multiple sources for one @ In ! if ( this . data != null ) { throw new ComponentException ( "Attempt to set @In field twice: " + comp + "." + field . getName ( ) ) ; } this . data = data ;
public class KeyManager { /** * Returns the decrypted Data Protection Key ( DPK ) from the { @ link SharedPreferences } . * @ param password Password used to decrypt the DPK * @ return The DPK */ public EncryptionKey loadKeyUsingPassword ( String password ) { } }
if ( password == null || password . equals ( "" ) ) { throw new IllegalArgumentException ( "password is required to be a non-null/non-empty " + "string" ) ; } KeyData data = this . storage . getEncryptionKeyData ( ) ; if ( data == null || ! validateEncryptionKeyData ( data ) ) { return null ; } EncryptionKey dpk = null...
public class WrapSeekable { /** * A helper for the common use case . */ public static WrapSeekable < FSDataInputStream > openPath ( FileSystem fs , Path p ) throws IOException { } }
return new WrapSeekable < FSDataInputStream > ( fs . open ( p ) , fs . getFileStatus ( p ) . getLen ( ) , p ) ;
public class FileSystemState { /** * Registers the given resource to be closed when the file system is closed . Should be called when * the resource is opened . */ public < C extends Closeable > C register ( C resource ) { } }
// Initial open check to avoid incrementing registering if we already know it ' s closed . // This is to prevent any possibility of a weird pathalogical situation where the do / while // loop in close ( ) keeps looping as register ( ) is called repeatedly from multiple threads . checkOpen ( ) ; registering . incrementA...
public class SRTServletRequest { /** * Begin 256836 */ public void removeQSFromList ( ) { } }
// 321485 if ( TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { // 306998.15 logger . logp ( Level . FINE , CLASS_NAME , "removeQSFromList" , "entry" ) ; } if ( WCCustomProperties . CHECK_REQUEST_OBJECT_IN_USE ) { checkRequestObjectInUse ( ) ; } SRTServletRequestThreadData reqData = ...