signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class ArrayUtils { /** * Sorts the elements in the given array . * @ param < T > { @ link Class } type of the elements in the array . * @ param array array of elements to sort . * @ param comparator { @ link Comparator } used to sort ( order ) the elements in the array . * @ return the given array sorted...
Arrays . sort ( array , comparator ) ; return array ;
public class SystemUtil { /** * Append a suffix to the string ( e . g . filename ) if it doesn ' t have it already . * @ param _ str string to check * @ param _ suffix suffix to append * @ return string with suffix or original if no suffix was appended */ public static String appendSuffixIfMissing ( String _str ,...
if ( _str == null ) { return null ; } if ( ! _str . endsWith ( _suffix ) ) { _str += _suffix ; } return _str ;
public class KeyVaultClientCustomImpl { /** * Creates a signature from a digest using the specified key . * @ param keyIdentifier * The full key identifier * @ param algorithm * algorithm identifier * @ param value * the content to be signed * @ return the KeyOperationResult if successful . */ public KeyO...
KeyIdentifier id = new KeyIdentifier ( keyIdentifier ) ; return sign ( id . vault ( ) , id . name ( ) , id . version ( ) == null ? "" : id . version ( ) , algorithm , value ) ;
public class XSParser { /** * Parse an XML Schema document from String specified * @ param schema String data to parse . If provided , this will always be treated as a * sequence of 16 - bit units ( UTF - 16 encoded characters ) . If an XML * declaration is present , the value of the encoding attribute * will b...
return xsLoader . load ( new DOMInputImpl ( null , null , baseURI , schema , null ) ) ;
public class Request { /** * 切分并设置url参数 < br > * 分隔符定义在HuluSetting中 * @ param urlParam url参数 */ protected static void splitAndSetParams ( String urlParam ) { } }
String [ ] urlParams = StrUtil . split ( urlParam , HuluSetting . urlParamSeparator ) ; urlParamsLocal . set ( urlParams ) ;
public class DefaultInputConnection { /** * Handles a group message . */ private void doGroupMessage ( final JsonObject message ) { } }
String groupID = message . getString ( "group" ) ; DefaultConnectionInputGroup group = groups . get ( groupID ) ; if ( group != null ) { Object value = deserializer . deserialize ( message ) ; if ( value != null ) { if ( log . isDebugEnabled ( ) ) { log . debug ( String . format ( "%s - Group received: Group[group=%s, ...
public class AbstractRslNode { /** * Adds a rsl parse tree to this node . * @ param node the rsl parse tree to add . */ public boolean add ( AbstractRslNode node ) { } }
if ( _specifications == null ) _specifications = new LinkedList ( ) ; return _specifications . add ( node ) ;
public class ListManagementTermsImpl { /** * Add a term to the term list with list Id equal to list Id passed . * @ param listId List Id of the image list . * @ param term Term to be deleted * @ param language Language of the terms . * @ throws IllegalArgumentException thrown if parameters fail the validation ...
return addTermWithServiceResponseAsync ( listId , term , language ) . map ( new Func1 < ServiceResponse < Object > , Object > ( ) { @ Override public Object call ( ServiceResponse < Object > response ) { return response . body ( ) ; } } ) ;
public class Base64EncodedSignerWithChooserByPrivateKeyIdImpl { /** * Signs a message . * @ param privateKeyId the logical name of the private key as configured in * the underlying mapping * @ param message the message to sign * @ return a base64 encoded version of the signature * @ see # setPrivateKeyMap ( j...
Base64EncodedSigner signer = cache . get ( privateKeyId ) ; if ( signer != null ) { return signer . sign ( message ) ; } Base64EncodedSignerImpl signerImpl = new Base64EncodedSignerImpl ( ) ; signerImpl . setAlgorithm ( algorithm ) ; signerImpl . setCharsetName ( charsetName ) ; signerImpl . setProvider ( provider ) ; ...
public class ClassFileMetaData { /** * Checks if the constant pool contains a reference to a given method . * @ param className must be provided JVM - style , such as { @ code java / lang / String } * @ param descriptor must be provided JVM - style , such as { @ code ( IZ ) Ljava / lang / String ; } */ public boole...
int classIndex = findClass ( className ) ; if ( classIndex == NOT_FOUND ) return false ; int nameAndTypeIndex = findNameAndType ( methodName , descriptor ) ; if ( nameAndTypeIndex == NOT_FOUND ) return false ; for ( int i = 1 ; i < maxPoolSize ; i ++ ) { if ( isMethod ( i ) && readValue ( offsets [ i ] ) == classIndex ...
public class LoglevelService { /** * 设置当前进程日志等级 * @ param level * @ return */ public boolean setLevel ( String level ) { } }
boolean isSucceed = true ; try { LoggerContext loggerContext = ( LoggerContext ) LoggerFactory . getILoggerFactory ( ) ; loggerContext . getLogger ( "root" ) . setLevel ( Level . valueOf ( level ) ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; isSucceed = false ; } return isSucceed ;
public class ChangesOnMyIssueNotificationHandler { /** * Is the author of the change the assignee of the specified issue ? * If not , it means the issue has been changed by a peer of the author of the change . */ private static boolean isPeerChanged ( Change change , ChangedIssue issue ) { } }
Optional < User > assignee = issue . getAssignee ( ) ; return ! assignee . isPresent ( ) || ! change . isAuthorLogin ( assignee . get ( ) . getLogin ( ) ) ;
public class DefaultGroovyMethods { /** * Iterates through the given array , passing in the initial value to * the closure along with the first item . The result is passed back ( injected ) into * the closure along with the second item . The new result is injected back into * the closure along with the third item...
Object [ ] params = new Object [ 2 ] ; T value = initialValue ; for ( Object next : self ) { params [ 0 ] = value ; params [ 1 ] = next ; value = closure . call ( params ) ; } return value ;
public class Spies { /** * Proxies a function spying for result and parameter . * @ param < T > the function parameter type * @ param < R > the function result type * @ param function the function to be spied * @ param result a box that will be containing spied result * @ param param a box that will be contai...
return new CapturingFunction < > ( function , result , param ) ;
public class BaseDesktopMenu { /** * Gets the help set . * @ return the help set */ public HelpSet getHelpSet ( ) { } }
HelpSet hs = null ; final String filename = "simple-hs.xml" ; final String path = "help/" + filename ; URL hsURL ; hsURL = ClassExtensions . getResource ( path ) ; try { if ( hsURL != null ) { hs = new HelpSet ( ClassExtensions . getClassLoader ( ) , hsURL ) ; } else { hs = new HelpSet ( ) ; } } catch ( final HelpSetEx...
public class Props { /** * Gets the class from the Props . If it doesn ' t exist , it will return the defaultClass */ public Class < ? > getClass ( final String key , final Class < ? > defaultClass ) { } }
if ( containsKey ( key ) ) { return getClass ( key ) ; } else { return defaultClass ; }
public class nspbr6 { /** * Use this API to renumber nspbr6. */ public static base_response renumber ( nitro_service client ) throws Exception { } }
nspbr6 renumberresource = new nspbr6 ( ) ; return renumberresource . perform_operation ( client , "renumber" ) ;
public class HttpBuilder { /** * Executes a TRACE request on the configured URI , with additional configuration provided by the configuration function . The result will be cast to * the specified ` type ` . * This method is generally used for Java - specific configuration . * [ source , groovy ] * HttpBuilder h...
return type . cast ( interceptors . get ( HttpVerb . TRACE ) . apply ( configureRequest ( type , HttpVerb . TRACE , configuration ) , this :: doTrace ) ) ;
public class GrailsClassUtils { /** * < p > Work out if the specified property is readable and static . Java introspection does not * recognize this concept of static properties but Groovy does . We also consider public static fields * as static properties with no getters / setters < / p > * @ param clazz The cla...
Method getter = BeanUtils . findDeclaredMethod ( clazz , getGetterName ( propertyName ) , ( Class [ ] ) null ) ; if ( getter != null ) { return isPublicStatic ( getter ) ; } try { Field f = clazz . getDeclaredField ( propertyName ) ; if ( f != null ) { return isPublicStatic ( f ) ; } } catch ( NoSuchFieldException igno...
public class Histogram3D { /** * Create a plot canvas with the histogram plot of given data . * @ param data a sample set . * @ param k the number of bins . * @ param palette the color palette . */ public static PlotCanvas plot ( double [ ] [ ] data , int k , Color [ ] palette ) { } }
return plot ( data , k , false , palette ) ;
public class CertificatesImpl { /** * Cancels a failed deletion of a certificate from the specified account . * If you try to delete a certificate that is being used by a pool or compute node , the status of the certificate changes to deleteFailed . If you decide that you want to continue using the certificate , you ...
cancelDeletionWithServiceResponseAsync ( thumbprintAlgorithm , thumbprint , certificateCancelDeletionOptions ) . toBlocking ( ) . single ( ) . body ( ) ;
public class ListPrincipalThingsResult { /** * The things . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setThings ( java . util . Collection ) } or { @ link # withThings ( java . util . Collection ) } if you want to override the * existing values . * ...
if ( this . things == null ) { setThings ( new java . util . ArrayList < String > ( things . length ) ) ; } for ( String ele : things ) { this . things . add ( ele ) ; } return this ;
public class AttributeType { /** * Returns for given parameter < i > _ id < / i > the instance of class * { @ link AttributeType } . * @ param _ id id to search in the cache * @ return instance of class { @ link AttributeType } * @ see # CACHE * @ throws CacheReloadException on error */ public static Attribut...
final Cache < Long , AttributeType > cache = InfinispanCache . get ( ) . < Long , AttributeType > getCache ( AttributeType . IDCACHE ) ; if ( ! cache . containsKey ( _id ) ) { AttributeType . getAttributeTypeFromDB ( AttributeType . SQL_ID , _id ) ; } return cache . get ( _id ) ;
public class Type { /** * Creates a new instance of { @ code GenericDeclaration } when the given declaration is not empty other wise it * returns { @ link GenericDeclaration # UNDEFINED } . * @ param declaration * declaration of a generic * @ return instance of { @ code GenericDeclaration } and never null */ @ ...
Check . notNull ( declaration , "declaration" ) ; return declaration . isEmpty ( ) ? GenericDeclaration . UNDEFINED : GenericDeclaration . of ( declaration ) ;
public class HealthMonitorTask { /** * Start the continuous health monitor . */ @ Scheduled ( fixedDelay = "${micronaut.health.monitor.interval:1m}" , initialDelay = "${micronaut.health.monitor.initial-delay:1m}" ) void monitor ( ) { } }
if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( "Starting health monitor check" ) ; } List < Publisher < HealthResult > > healthResults = healthIndicators . stream ( ) . map ( HealthIndicator :: getResult ) . collect ( Collectors . toList ( ) ) ; Flowable < HealthResult > resultFlowable = Flowable . merge ( healthResul...
public class Bus { /** * Get bus instance by object class name * @ param busName bus name * @ return event bus */ static public Bus getBy ( Object busName ) { } }
if ( busName == null ) return get ( ) ; return getBy ( busName . getClass ( ) ) ;
public class UnicodeDecompressor { /** * Decompress a byte array into a Unicode character array . * This function will either completely fill the output buffer , * or consume the entire input . * @ param byteBuffer The byte buffer to decompress . * @ param byteBufferStart The start of the byte run to decompress...
// the current position in the source byte buffer int bytePos = byteBufferStart ; // the current position in the target char buffer int ucPos = charBufferStart ; // the current byte from the source buffer int aByte = 0x00 ; // charBuffer must be at least 2 chars in size if ( charBuffer . length < 2 || ( charBufferLimit...
public class RendererFactory { /** * Gets the best suited { @ link Renderer } for the given { @ link Renderable } to * the given { @ link RenderingFormat } . * @ param < I > * @ param < O > * @ param renderable * @ param renderingFormat * @ return */ public < I extends Renderable , O > Renderer < ? super I ...
RendererSelection bestMatch = null ; final Collection < RendererBeanDescriptor < ? > > descriptors = _descriptorProvider . getRendererBeanDescriptorsForRenderingFormat ( renderingFormat ) ; for ( final RendererBeanDescriptor < ? > descriptor : descriptors ) { final RendererSelection rendererMatch = isRendererMatch ( de...
public class JaxWsSSLManager { /** * Get the SSLSocketFactory by sslRef , if could not get the configuration , try use the server ' s default * ssl configuration when fallbackOnDefault = true * @ param sslRef * @ param props the additional props to override the properties in SSLConfig * @ param fallbackOnDefaul...
SSLSupport sslSupportService = tryGetSSLSupport ( ) ; if ( null == sslSupportService ) { return null ; } JSSEHelper jsseHelper = sslSupportService . getJSSEHelper ( ) ; Properties sslConfig = null ; SSLConfig sslConfigCopy = null ; try { sslConfig = jsseHelper . getProperties ( sslRef ) ; if ( null != sslConfig ) { // ...
public class BDDMockito { /** * see original { @ link Mockito # doThrow ( Class ) } * @ since 1.9.0 */ public static BDDStubber willThrow ( Class < ? extends Throwable > toBeThrown , Class < ? extends Throwable > ... throwableTypes ) { } }
return new BDDStubberImpl ( Mockito . doThrow ( toBeThrown , throwableTypes ) ) ;
public class Unchecked { /** * Wrap a { @ link CheckedBiFunction } in a { @ link BiFunction } with a custom handler for checked exceptions . * Example : * < code > < pre > * map . computeIfPresent ( " key " , Unchecked . biFunction ( * ( k , v ) - > { * if ( k = = null | | v = = null ) * throw new Exception...
return ( t , u ) -> { try { return function . apply ( t , u ) ; } catch ( Throwable e ) { handler . accept ( e ) ; throw new IllegalStateException ( "Exception handler must throw a RuntimeException" , e ) ; } } ;
public class RSAUtils { /** * Verify a signature with RSA public key , using { @ link # DEFAULT _ SIGNATURE _ ALGORITHM } . * @ param keyData * RSA public key data ( value of { @ link RSAPublicKey # getEncoded ( ) } ) * @ param message * @ param signature * @ return * @ throws InvalidKeyException * @ thro...
return verifySignatureWithPublicKey ( keyData , message , signature , DEFAULT_SIGNATURE_ALGORITHM ) ;
public class PersonNatureAttr { /** * 设置 * @ param index * @ param freq */ public void addFreq ( int index , int freq ) { } }
switch ( index ) { case 11 : this . end += freq ; allFreq += freq ; break ; case 12 : this . end += freq ; this . begin += freq ; allFreq += freq ; break ; case 44 : this . split += freq ; allFreq += freq ; break ; }
public class StatusCmd { public Any execute ( DeviceImpl device , Any in_any ) throws DevFailed { } }
Util . out4 . println ( "Status::execute(): arrived" ) ; // return status string as CORBA _ Any Any out_any = Util . instance ( ) . get_orb ( ) . create_any ( ) ; String s = device . dev_status ( ) ; out_any . insert_string ( s ) ; Util . out4 . println ( "Leaving Status::execute()" ) ; return out_any ;
public class ISO9075 { /** * Encodes the local part of < code > name < / code > as specified in ISO 9075. * @ param name * the < code > QName < / code > to encode . * @ return the encoded < code > QName < / code > or < code > name < / code > if it does not need encoding . */ public static InternalQName encode ( I...
String encoded = encode ( name . getName ( ) ) ; if ( encoded . equals ( name . getName ( ) ) ) { return name ; } else { return new InternalQName ( name . getNamespace ( ) , encoded ) ; }
public class GroupService { /** * Find group based on config instance and parent group identifier * @ param config group hierarchy config * @ param parentGroupId parent group id * @ return GroupMetadata */ private GroupMetadata findGroup ( GroupHierarchyConfig config , String parentGroupId ) { } }
GroupMetadata parentGroup = findByRef ( Group . refById ( parentGroupId ) ) ; return parentGroup . getGroups ( ) . stream ( ) . filter ( group -> group . getName ( ) . equals ( config . getName ( ) ) ) . findFirst ( ) . orElse ( null ) ;
public class DateUtils { /** * Returns a < code > ZonedDateTime < / code > from the given epoch value . * Note that this implementation attempts to protect against caller providing timestamps in * different units . For example , Unix timestamps are the number of SECONDS since January 1, * 1970 , while Java Dates ...
final EpochUnits units = EpochUnits . valueOf ( epoch ) ; return toZonedDateTimeUtc ( epoch , units ) ;
public class EvaluateClustering { /** * Evaluate a clustering result . * @ param db Database * @ param c Clustering * @ param refc Reference clustering */ protected void evaluteResult ( Database db , Clustering < ? > c , Clustering < ? > refc ) { } }
ClusterContingencyTable contmat = new ClusterContingencyTable ( selfPairing , noiseSpecialHandling ) ; contmat . process ( refc , c ) ; ScoreResult sr = new ScoreResult ( contmat ) ; sr . addHeader ( c . getLongName ( ) ) ; db . getHierarchy ( ) . add ( c , sr ) ;
public class Client { /** * Performs all actions that have been configured . */ public void performActions ( ) { } }
if ( this . clientConfiguration . getActions ( ) . isEmpty ( ) ) { this . clientConfiguration . printHelp ( ) ; return ; } this . dumpProcessingController . setOfflineMode ( this . clientConfiguration . getOfflineMode ( ) ) ; if ( this . clientConfiguration . getDumpDirectoryLocation ( ) != null ) { try { this . dumpPr...
public class InstanceRegistry { /** * Remove a specific instance from services * @ param id the instances id to unregister * @ return the id of the unregistered instance */ public Mono < InstanceId > deregister ( InstanceId id ) { } }
return repository . computeIfPresent ( id , ( key , instance ) -> Mono . just ( instance . deregister ( ) ) ) . map ( Instance :: getId ) ;
public class OperaProxy { /** * Specifies which proxy to use for SOCKS . Currently only supported in { @ link * com . opera . core . systems . OperaDriver } . * @ param host the proxy host , expected format is < code > hostname . com : 1234 < / code > */ public void setSocksProxy ( String host ) { } }
assertNotMobile ( ) ; setProxyValue ( SOCKS_SERVER , host ) ; setProxyValue ( USE_SOCKS , host != null ) ;
public class CmsBrokenLinkRenderer { /** * Adds optional page information to the broken link bean . < p > * @ param bean the broken link bean * @ param extraTitle the optional page title * @ param extraPath the optional page path */ protected void addPageInfo ( CmsBrokenLinkBean bean , String extraTitle , String ...
if ( extraTitle != null ) { bean . addInfo ( messagePageTitle ( ) , "" + extraTitle ) ; } if ( extraPath != null ) { bean . addInfo ( messagePagePath ( ) , "" + extraPath ) ; }
public class ScanSpec { /** * Sort prefixes to ensure correct whitelist / blacklist evaluation ( see Issue # 167 ) . */ public void sortPrefixes ( ) { } }
for ( final Field field : ScanSpec . class . getDeclaredFields ( ) ) { if ( WhiteBlackList . class . isAssignableFrom ( field . getType ( ) ) ) { try { ( ( WhiteBlackList ) field . get ( this ) ) . sortPrefixes ( ) ; } catch ( final ReflectiveOperationException e ) { throw ClassGraphException . newClassGraphException (...
public class BaseBo { /** * Get a BO ' s attribute as a date . If the attribute value is a string , parse * it as a { @ link Date } using the specified date - time format . * @ param attrName * @ param dateTimeFormat * @ return * @ since 0.8.0 */ public Date getAttributeAsDate ( String attrName , String dateT...
Lock lock = lockForRead ( ) ; try { return MapUtils . getDate ( attributes , attrName , dateTimeFormat ) ; } finally { lock . unlock ( ) ; }
public class LogBuffer { /** * Return fix - length string from buffer without null - terminate checking . Fix * bug # 17 { @ link https : / / github . com / AlibabaTech / canal / issues / 17 } */ public final String getFullString ( final int pos , final int len , String charsetName ) { } }
if ( pos + len > limit || pos < 0 ) throw new IllegalArgumentException ( "limit excceed: " + ( pos < 0 ? pos : ( pos + len ) ) ) ; try { return new String ( buffer , origin + pos , len , charsetName ) ; } catch ( UnsupportedEncodingException e ) { throw new IllegalArgumentException ( "Unsupported encoding: " + charsetN...
public class FsParserAbstract { /** * Add to bulk an IndexRequest in JSon format */ private void esIndex ( String index , String id , String json , String pipeline ) { } }
logger . debug ( "Indexing {}/{}?pipeline={}" , index , id , pipeline ) ; logger . trace ( "JSon indexed : {}" , json ) ; if ( ! closed ) { esClient . index ( index , id , json , pipeline ) ; } else { logger . warn ( "trying to add new file while closing crawler. Document [{}]/[{}] has been ignored" , index , id ) ; }
public class JobScheduleUpdateOptions { /** * Set a timestamp indicating the last modified time of the resource known to the client . The operation will be performed only if the resource on the service has been modified since the specified time . * @ param ifModifiedSince the ifModifiedSince value to set * @ return...
if ( ifModifiedSince == null ) { this . ifModifiedSince = null ; } else { this . ifModifiedSince = new DateTimeRfc1123 ( ifModifiedSince ) ; } return this ;
public class DistBlockIntegrityMonitor { /** * Return true if succeed to start one job */ public static Job startOneJob ( Worker newWorker , Priority pri , Set < String > jobFiles , long detectTime , AtomicLong numFilesSubmitted , AtomicLong lastCheckingTime , long maxPendingJobs ) throws IOException , InterruptedExcep...
if ( lastCheckingTime != null ) { lastCheckingTime . set ( System . currentTimeMillis ( ) ) ; } String startTimeStr = dateFormat . format ( new Date ( ) ) ; String jobName = newWorker . JOB_NAME_PREFIX + "." + newWorker . jobCounter + "." + pri + "-pri" + "." + startTimeStr ; Job job = null ; synchronized ( jobFiles ) ...
public class CommerceTierPriceEntryLocalServiceBaseImpl { /** * Performs a dynamic query on the database and returns the matching rows . * @ param dynamicQuery the dynamic query * @ return the matching rows */ @ Override public < T > List < T > dynamicQuery ( DynamicQuery dynamicQuery ) { } }
return commerceTierPriceEntryPersistence . findWithDynamicQuery ( dynamicQuery ) ;
public class XPathBuilder { /** * < p > < b > Used for finding element process ( to generate xpath address ) < / b > < / p > * < p > Find element with < b > exact math < / b > of specified class ( equals ) < / p > * @ param cls class of element * @ param < T > the element which calls this method * @ return this...
this . cls = cls ; return ( T ) this ;
public class NamespaceSupport { /** * Declare a Namespace prefix . All prefixes must be declared * before they are referenced . For example , a SAX driver ( parser ) * would scan an element ' s attributes * in two passes : first for namespace declarations , * then a second pass using { @ link # processName proc...
if ( prefix . equals ( "xml" ) || prefix . equals ( "xmlns" ) ) { return false ; } else { currentContext . declarePrefix ( prefix , uri ) ; return true ; }
public class ZonalDateTime { /** * / * [ deutsch ] * < p > Vergleicht diese Instanz mit der angegebenen Instanz auf der globalen Zeitachse ( UTC ) . < / p > * < p > Die lokalen Zeitstempel werden genau dann in Betracht gezogen , wenn die UTC - Zeitpunkte gleich sind . * Beispiel : < / p > * < pre > * List & l...
int cmp = this . moment . compareTo ( zdt . moment ) ; if ( cmp == 0 ) { cmp = this . timestamp . compareTo ( zdt . timestamp ) ; } return cmp ;
public class J2EESecurityManager { /** * Determine if the user is authenticated . The default implementation is to use { @ code getUserPrincipal ( ) ! = null } * on the HttpServletRequest in the ActionBeanContext . * @ param bean the current action bean ; used for security decisions * @ param handler the current ...
return bean . getContext ( ) . getRequest ( ) . getUserPrincipal ( ) != null ;
public class InternalPureXbaseParser { /** * InternalPureXbase . g : 4075:1 : ruleXBasicForLoopExpression returns [ EObject current = null ] : ( ( ) otherlv _ 1 = ' for ' otherlv _ 2 = ' ( ' ( ( ( lv _ initExpressions _ 3_0 = ruleXExpressionOrVarDeclaration ) ) ( otherlv _ 4 = ' , ' ( ( lv _ initExpressions _ 5_0 = rul...
EObject current = null ; Token otherlv_1 = null ; Token otherlv_2 = null ; Token otherlv_4 = null ; Token otherlv_6 = null ; Token otherlv_8 = null ; Token otherlv_10 = null ; Token otherlv_12 = null ; EObject lv_initExpressions_3_0 = null ; EObject lv_initExpressions_5_0 = null ; EObject lv_expression_7_0 = null ; EOb...
public class PathUtil { /** * Obtains the parent of this Path , if exists , else null . For instance if the Path is " / my / path " , the parent will be * " / my " . Each call will result in a new object reference , though subsequent calls upon the same Path will be equal * by value . * @ return * @ param path ...
// Precondition checks assert path != null : "Path must be specified" ; // Get the last index of " / " final String resolvedContext = PathUtil . optionallyRemoveFollowingSlash ( path . get ( ) ) ; final int lastIndex = resolvedContext . lastIndexOf ( ArchivePath . SEPARATOR ) ; // If it either doesn ' t occur or is the...
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EClass getIfcPointOnCurve ( ) { } }
if ( ifcPointOnCurveEClass == null ) { ifcPointOnCurveEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 365 ) ; } return ifcPointOnCurveEClass ;
public class SameDiff { /** * Associate the current SameDiff instance with all ops and variables . * This is necessary to ensure that when dealing with shared state ( usually with a SameDiff function such * as " grad " - the backward function ) we have the correct SameDiff instance set for all ops / SDVariables . <...
for ( SDVariable var : variableMap ( ) . values ( ) ) { var . setSameDiff ( this ) ; } // for ( DifferentialFunction df : functionInstancesById . values ( ) ) { for ( SameDiffOp op : ops . values ( ) ) { DifferentialFunction df = op . getOp ( ) ; df . setSameDiff ( this ) ; // TODO : This is ugly but seemingly necessar...
public class SyncCommandAction { /** * Returns true if a git location object is null or all of its values are * empty or null . * @ param location the location object to test . * @ return true if the git location object is null or all of its values are empty or null , false otherwise . */ private static boolean i...
return location == null || ( StringUtils . isEmptyOrNull ( location . getRepository ( ) ) && StringUtils . isEmptyOrNull ( location . getBranch ( ) ) && StringUtils . isEmptyOrNull ( location . getRevision ( ) ) ) ;
public class ListUtil { /** * Replies the index of the given data in the given list according to a * dichotomic search algorithm . Order between objects * is given by { @ code comparator } . * < p > This function assumes that the given list is sorted * according to the given comparator . * A dichotomic algori...
try { assert comparator != null ; assert list != null ; if ( elt == null ) { return - 1 ; } int first = 0 ; int last = list . size ( ) - 1 ; while ( last >= first ) { int center = ( first + last ) / 2 ; final T indata = list . get ( center ) ; final int cmp = comparator . compare ( elt , indata ) ; if ( cmp == 0 ) { do...
public class TraceVehicleDataSource { /** * Using the startingTime as the relative starting point , sleep this thread * until the next timestamp would occur . * @ param startingTime the relative starting time in milliseconds * @ param timestamp the timestamp to wait for in milliseconds since the * epoch */ priv...
if ( mFirstTimestamp == 0 ) { mFirstTimestamp = timestamp ; Log . d ( TAG , "Storing " + timestamp + " as the first " + "timestamp of the trace file" ) ; } long targetTime = startingTime + ( timestamp - mFirstTimestamp ) ; long sleepDuration = Math . max ( targetTime - System . currentTimeMillis ( ) , 0 ) ; try { Threa...
public class DefaultMetadataService { /** * Creates an entity , instance of the type . * @ param entityInstanceDefinition json array of entity definitions * @ return guids - list of guids */ @ Override public CreateUpdateEntitiesResult createEntities ( String entityInstanceDefinition ) throws AtlasException { } }
entityInstanceDefinition = ParamChecker . notEmpty ( entityInstanceDefinition , "Entity instance definition" ) ; ITypedReferenceableInstance [ ] typedInstances = deserializeClassInstances ( entityInstanceDefinition ) ; return createEntities ( typedInstances ) ;
public class Output { /** * Write out string * @ param buf * Byte buffer to write to * @ param string * String to write */ public static void putString ( IoBuffer buf , String string ) { } }
final byte [ ] encoded = encodeString ( string ) ; if ( encoded . length < AMF . LONG_STRING_LENGTH ) { // write unsigned short buf . put ( ( byte ) ( ( encoded . length >> 8 ) & 0xff ) ) ; buf . put ( ( byte ) ( encoded . length & 0xff ) ) ; } else { buf . putInt ( encoded . length ) ; } buf . put ( encoded ) ;
public class PopulateFirstPartyAudienceSegments { /** * Runs the example . * @ param adManagerServices the services factory . * @ param session the session . * @ param audienceSegmentId the ID of the first party audience segment to populate . * @ throws ApiException if the API request failed with one or more se...
// Get the AudienceSegmentService . AudienceSegmentServiceInterface audienceSegmentService = adManagerServices . get ( session , AudienceSegmentServiceInterface . class ) ; // Create a statement to only select a specified first party audience // segment . StatementBuilder statementBuilder = new StatementBuilder ( ) . w...
public class UnXARMojo { /** * Unzip xar artifact and its dependencies . * @ throws ArchiverException error when unzip package . O * @ throws MojoExecutionException error when unzip package . */ private void performUnArchive ( ) throws MojoExecutionException { } }
Artifact artifact = findArtifact ( ) ; getLog ( ) . debug ( String . format ( "Source XAR = [%s]" , artifact . getFile ( ) ) ) ; unpack ( artifact . getFile ( ) , this . outputDirectory , "XAR Plugin" , true , getIncludes ( ) , getExcludes ( ) ) ; unpackDependentXars ( artifact ) ;
public class PreferenceFragment { /** * Handles the extra of the arguments , which have been passed to the fragment , that allows to * show the button , which allows to restore the preferences ' default values . * @ param arguments * The arguments , which have been passed to the fragment , as an instance of the c...
boolean showButton = arguments . getBoolean ( EXTRA_SHOW_RESTORE_DEFAULTS_BUTTON , false ) ; showRestoreDefaultsButton ( showButton ) ;
public class TiledMap { /** * Return the name of a specific object from a specific group . * @ param groupID * Index of a group * @ param objectID * Index of an object * @ return The name of an object or null , when error occurred */ public String getObjectName ( int groupID , int objectID ) { } }
if ( groupID >= 0 && groupID < objectGroups . size ( ) ) { ObjectGroup grp = ( ObjectGroup ) objectGroups . get ( groupID ) ; if ( objectID >= 0 && objectID < grp . objects . size ( ) ) { GroupObject object = ( GroupObject ) grp . objects . get ( objectID ) ; return object . name ; } } return null ;
public class PredicatedImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public void setPredicate ( RuleElement newPredicate ) { } }
if ( newPredicate != predicate ) { NotificationChain msgs = null ; if ( predicate != null ) msgs = ( ( InternalEObject ) predicate ) . eInverseRemove ( this , EOPPOSITE_FEATURE_BASE - SimpleAntlrPackage . PREDICATED__PREDICATE , null , msgs ) ; if ( newPredicate != null ) msgs = ( ( InternalEObject ) newPredicate ) . e...
public class NetworkManager { /** * Undeploys components that were removed from the network . */ private void undeployRemovedComponents ( final NetworkContext context , final NetworkContext runningContext , final Handler < AsyncResult < Void > > doneHandler ) { } }
// Undeploy any components that were removed from the network . final List < ComponentContext < ? > > removedComponents = new ArrayList < > ( ) ; for ( ComponentContext < ? > runningComponent : runningContext . components ( ) ) { if ( context . component ( runningComponent . name ( ) ) == null ) { removedComponents . a...
public class UpdateCommand { /** * { @ inheritDoc } * @ see jp . co . future . uroborosql . client . command . ReplCommand # execute ( org . jline . reader . LineReader , java . lang . String [ ] , jp . co . future . uroborosql . config . SqlConfig , java . util . Properties ) */ @ Override public boolean execute ( f...
PrintWriter writer = reader . getTerminal ( ) . writer ( ) ; if ( parts . length >= 2 ) { String sqlName = parts [ 1 ] . replaceAll ( "\\." , "/" ) ; if ( sqlConfig . getSqlManager ( ) . existSql ( sqlName ) ) { try ( SqlAgent agent = sqlConfig . agent ( ) ) { SqlContext ctx = agent . contextFrom ( sqlName ) ; ctx . se...
public class MessageUtils { /** * Retrieve the message from a specific bundle . It does not look on application message bundle * or default message bundle . If it is required to look on those bundles use getMessageFromBundle instead * @ param bundleBaseName baseName of ResourceBundle to load localized messages * ...
return getMessage ( bundleBaseName , getCurrentLocale ( ) , messageId , params ) ;
public class FieldsAndGetters { /** * Returns a { @ code Stream } of all public fields and getter methods which match { @ code predicate } and their values for the given object . * This method combines the results of { @ link # fields ( Object , Predicate ) } and { @ link # getters ( Object , Predicate ) } . The { @ ...
Stream < Map . Entry < String , Object > > fields = fields ( obj , field -> predicate . test ( field . getName ( ) ) ) . map ( entry -> createEntry ( entry . getKey ( ) . getName ( ) , entry . getValue ( ) ) ) ; Function < Method , String > methodName = method -> method . getName ( ) + "()" ; Stream < Map . Entry < Str...
public class TypeQualifierApplications { /** * Get the effective TypeQualifierAnnotation on given AnnotatedObject . Takes * into account inherited and default ( outer scope ) annotations . Also takes * exclusive qualifiers into account . * @ param o * an AnnotatedObject * @ param typeQualifierValue * a Type...
if ( o instanceof XMethod ) { XMethod m = ( XMethod ) o ; if ( m . getName ( ) . startsWith ( "access$" ) ) { InnerClassAccessMap icam = AnalysisContext . currentAnalysisContext ( ) . getInnerClassAccessMap ( ) ; try { InnerClassAccess ica = icam . getInnerClassAccess ( m . getClassName ( ) , m . getName ( ) ) ; if ( i...
public class ClassUtil { /** * 获得指定类过滤后的Public方法列表 * @ param clazz 查找方法的类 * @ param excludeMethodNames 不包括的方法名列表 * @ return 过滤后的方法列表 */ public static List < Method > getPublicMethods ( Class < ? > clazz , String ... excludeMethodNames ) { } }
return getPublicMethods ( clazz , excludeMethodNames ) ;
public class MorseDistance { /** * Shift . * @ param state the state */ private void _shift ( double [ ] [ ] state ) { } }
double [ ] tmpState = state [ 0 ] ; state [ 0 ] = state [ 1 ] ; state [ 1 ] = state [ 2 ] ; state [ 2 ] = tmpState ;
public class RedisClient { /** * add if not exists * @ param key * @ param value * @ param expiration * @ return false if redis did not execute the option * @ throws Exception */ public boolean add ( String key , Object value , Integer expiration ) throws Exception { } }
Jedis jedis = null ; try { jedis = this . jedisPool . getResource ( ) ; long begin = System . currentTimeMillis ( ) ; // 操作setnx与expire成功返回1 , 失败返回0 , 仅当均返回1时 , 实际操作成功 Long result = jedis . setnx ( SafeEncoder . encode ( key ) , serialize ( value ) ) ; if ( expiration > 0 ) { result = result & jedis . expire ( key , ex...
public class MappableJournalSegmentWriter { /** * Unmaps the mapped buffer . */ void unmap ( ) { } }
if ( writer instanceof MappedJournalSegmentWriter ) { JournalWriter < E > writer = this . writer ; this . writer = new FileChannelJournalSegmentWriter < > ( channel , segment , maxEntrySize , index , namespace ) ; writer . close ( ) ; }
public class JMSServices { /** * Uses the container - specific qualifier to look up a JMS queue . * @ param commonName * the vendor - neutral logical queue name * @ return javax . jms . Queue */ public Queue getQueue ( Session session , String commonName ) throws ServiceLocatorException { } }
Queue queue = ( Queue ) queueCache . get ( commonName ) ; if ( queue == null ) { try { String name = namingProvider . qualifyJmsQueueName ( commonName ) ; queue = jmsProvider . getQueue ( session , namingProvider , name ) ; if ( queue != null ) queueCache . put ( commonName , queue ) ; } catch ( Exception ex ) { throw ...
public class Event { /** * Returns the signature ID to which this event is associated . * @ return String * @ throws HelloSignException thrown if there is a problem parsing the * backing JSONObject . */ public String getRelatedSignatureId ( ) throws HelloSignException { } }
JSONObject metadata = ( JSONObject ) get ( EVENT_METADATA ) ; if ( metadata == null ) { return null ; } String id = null ; try { id = metadata . getString ( RELATED_SIGNATURE_ID ) ; } catch ( JSONException ex ) { // No related signature request with this event } return id ;
public class DataUtil { /** * little - endian or intel format . */ public static long readUnsignedIntegerLittleEndian ( byte [ ] buffer , int offset ) { } }
long value ; value = ( buffer [ offset ] & 0xFF ) ; value |= ( buffer [ offset + 1 ] & 0xFF ) << 8 ; value |= ( buffer [ offset + 2 ] & 0xFF ) << 16 ; value |= ( ( long ) ( buffer [ offset + 3 ] & 0xFF ) ) << 24 ; return value ;
public class DefaultGroovyMethods { /** * Create a new Collection composed of the elements of the first Iterable minus * every occurrence of elements of the given Iterable . * < pre class = " groovyTestCase " > * assert [ 1 , " a " , true , true , false , 5.3 ] - [ true , 5.3 ] = = [ 1 , " a " , false ] * < / p...
return minus ( asCollection ( self ) , asCollection ( removeMe ) ) ;
public class CmsEncoder { /** * Decodes a String in a way similar to the JavaScript " decodeURIcomponent " function . < p > * This method can decode Strings that have been encoded in JavaScript with " encodeURIcomponent " , * provided " UTF - 8 " is used as encoding . < p > * < b > Directly exposed for JSP EL < b...
if ( source == null ) { return null ; } int len = source . length ( ) ; // to use standard decoder we need to replace ' + ' with " % 20 " ( space ) StringBuffer preparedSource = new StringBuffer ( len ) ; for ( int i = 0 ; i < len ; i ++ ) { char c = source . charAt ( i ) ; if ( c == '+' ) { preparedSource . append ( "...
public class TrackedTorrent { /** * Count the number of leechers ( non - COMPLETED peers ) on this torrent . */ public int leechers ( ) { } }
int count = 0 ; for ( TrackedPeer peer : this . peers . values ( ) ) { if ( ! peer . isCompleted ( ) ) { count ++ ; } } return count ;
public class AutoScalingGroup { /** * The metrics enabled for the group . * @ param enabledMetrics * The metrics enabled for the group . */ public void setEnabledMetrics ( java . util . Collection < EnabledMetric > enabledMetrics ) { } }
if ( enabledMetrics == null ) { this . enabledMetrics = null ; return ; } this . enabledMetrics = new com . amazonaws . internal . SdkInternalList < EnabledMetric > ( enabledMetrics ) ;
public class BaseOp { /** * 根据APPID , BUCKET , COS _ PATH生成经过URL编码的URL * @ param request * 基本类型的请求 * @ return URL字符串 * @ throws AbstractCosException */ protected String buildUrl ( AbstractBaseRequest request ) throws AbstractCosException { } }
String endPoint = this . config . getCosEndPoint ( ) ; int appId = this . cred . getAppId ( ) ; String bucketName = request . getBucketName ( ) ; String cosPath = request . getCosPath ( ) ; cosPath = CommonPathUtils . encodeRemotePath ( cosPath ) ; return String . format ( "%s/%s/%s%s" , endPoint , appId , bucketName ,...
public class ClientBroadcastStream { /** * Pushes a message out to a consumer . * @ param msg * StatusMessage */ protected void pushMessage ( StatusMessage msg ) { } }
if ( connMsgOut != null ) { try { connMsgOut . pushMessage ( msg ) ; } catch ( IOException err ) { log . error ( "Error while pushing message: {}" , msg , err ) ; } } else { log . warn ( "Consumer message output is null" ) ; }
public class GrammarFile { /** * This method does the parsing and reacts appropriately to any exceptions . * @ param tokenStream * is the token stream to read the grammar from . * @ throws ParserException * is thrown in case of a parser issue . */ private void parse ( TokenStream tokenStream ) throws ParserExce...
try { Parser parser = new SLR1Parser ( uhuraGrammar ) ; parserTree = parser . parse ( tokenStream ) ; } catch ( GrammarException e ) { logger . error ( e . getMessage ( ) , e ) ; throw new RuntimeException ( "UhuraGrammar is broken!!!" ) ; }
public class YamlMappingNode { /** * Adds the specified { @ code key } / { @ code value } pair to this mapping . * @ param key the key * @ param value the value * @ return { @ code this } */ public T put ( YamlNode key , byte value ) { } }
return put ( key , getNodeFactory ( ) . byteNode ( value ) ) ;
public class Document { /** * Adds the producer to a Document . * @ return < CODE > true < / CODE > if successful , < CODE > false < / CODE > otherwise */ public boolean addProducer ( ) { } }
try { return add ( new Meta ( Element . PRODUCER , getVersion ( ) ) ) ; } catch ( DocumentException de ) { throw new ExceptionConverter ( de ) ; }
public class Instance { /** * The product codes attached to this instance , if applicable . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setProductCodes ( java . util . Collection ) } or { @ link # withProductCodes ( java . util . Collection ) } if you wan...
if ( this . productCodes == null ) { setProductCodes ( new com . amazonaws . internal . SdkInternalList < ProductCode > ( productCodes . length ) ) ; } for ( ProductCode ele : productCodes ) { this . productCodes . add ( ele ) ; } return this ;
public class JDBCRepository { /** * Returns the highest supported level for the given desired level . * @ return null if not supported */ private static IsolationLevel selectIsolationLevel ( DatabaseMetaData md , IsolationLevel desiredLevel ) throws SQLException , RepositoryException { } }
while ( ! md . supportsTransactionIsolationLevel ( mapIsolationLevelToJdbc ( desiredLevel ) ) ) { switch ( desiredLevel ) { case READ_UNCOMMITTED : desiredLevel = IsolationLevel . READ_COMMITTED ; break ; case READ_COMMITTED : desiredLevel = IsolationLevel . REPEATABLE_READ ; break ; case REPEATABLE_READ : desiredLevel...
public class CmsDefaultXmlContentHandler { /** * Initializes the folder containing the model file ( s ) for this content handler . < p > * @ param root the " modelfolder " element from the appinfo node of the XML content definition * @ param contentDefinition the content definition the model folder belongs to * @...
String master = root . attributeValue ( APPINFO_ATTR_URI ) ; if ( master == null ) { throw new CmsXmlException ( Messages . get ( ) . container ( Messages . ERR_XMLCONTENT_MISSING_MODELFOLDER_URI_2 , root . getName ( ) , contentDefinition . getSchemaLocation ( ) ) ) ; } m_modelFolder = master ;
public class GCBOXImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public boolean eIsSet ( int featureID ) { } }
switch ( featureID ) { case AfplibPackage . GCBOX__RES : return RES_EDEFAULT == null ? res != null : ! RES_EDEFAULT . equals ( res ) ; case AfplibPackage . GCBOX__XPOS1 : return XPOS1_EDEFAULT == null ? xpos1 != null : ! XPOS1_EDEFAULT . equals ( xpos1 ) ; case AfplibPackage . GCBOX__YPOS1 : return YPOS1_EDEFAULT == nu...
public class Configuration { /** * Check that the backdrop size is valid * @ param backdropSize * @ return */ public boolean isValidBackdropSize ( String backdropSize ) { } }
if ( StringUtils . isBlank ( backdropSize ) || backdropSizes . isEmpty ( ) ) { return false ; } return backdropSizes . contains ( backdropSize ) ;
public class ERTrees { /** * Measures the statistics of feature importance from the trees in this * forest . * @ param < Type > * @ param data the dataset to infer the feature importance from with respect * to the current model . * @ param imp the method of determing the feature importance that will be * ap...
OnLineStatistics [ ] importances = new OnLineStatistics [ data . getNumFeatures ( ) ] ; for ( int i = 0 ; i < importances . length ; i ++ ) importances [ i ] = new OnLineStatistics ( ) ; for ( ExtraTree tree : forrest ) { double [ ] feats = imp . getImportanceStats ( tree , data ) ; for ( int i = 0 ; i < importances . ...
public class JarClassLoader { /** * 加载Jar到ClassPath * @ param dir jar文件或所在目录 * @ return JarClassLoader */ public static JarClassLoader load ( File dir ) { } }
final JarClassLoader loader = new JarClassLoader ( ) ; loader . addJar ( dir ) ; // 查找加载所有jar loader . addURL ( dir ) ; // 查找加载所有class return loader ;
public class ApiOvhDedicatedserver { /** * Get this object properties * REST : GET / dedicated / server / { serviceName } / statistics / raid / { unit } * @ param serviceName [ required ] The internal name of your dedicated server * @ param unit [ required ] Raid unit */ public OvhRtmRaid serviceName_statistics_r...
String qPath = "/dedicated/server/{serviceName}/statistics/raid/{unit}" ; StringBuilder sb = path ( qPath , serviceName , unit ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , OvhRtmRaid . class ) ;
public class DataSet { /** * Initiates a Join transformation . * < p > A Join transformation joins the elements of two * { @ link DataSet DataSets } on key equality and provides multiple ways to combine * joining elements into one DataSet . * < p > This method returns a { @ link JoinOperatorSets } on which one ...
return new JoinOperatorSets < > ( this , other , strategy ) ;
public class SimpleBase { /** * Loads a new matrix from a serialized binary file . * @ see MatrixIO # loadBin ( String ) * @ param fileName File which is to be loaded . * @ return The matrix . * @ throws IOException */ public static SimpleMatrix loadBinary ( String fileName ) throws IOException { } }
DMatrix mat = MatrixIO . loadBin ( fileName ) ; // see if its a DMatrixRMaj if ( mat instanceof DMatrixRMaj ) { return SimpleMatrix . wrap ( ( DMatrixRMaj ) mat ) ; } else { // if not convert it into one and wrap it return SimpleMatrix . wrap ( new DMatrixRMaj ( mat ) ) ; }
public class ZaurusTableForm { /** * set all fields for primary keys to not editable */ private void disablePKFields ( ) { } }
for ( int i = 0 ; i < primaryKeys . length ; i ++ ) { komponente [ pkColIndex [ i ] ] . setEditable ( false ) ; } // end of for ( int i = 0 ; i < columns . length ; i + + )
public class ListContext { /** * Join the contents of the given list separated by the given separator . * For example , the list [ a , b , c ] with separator ' ' would result in : * < code > a b c < / code > . * @ param list The list to join * @ param separator The separator between values * @ return The resu...
int size = list . size ( ) ; StringBuilder buffer = new StringBuilder ( 512 ) ; for ( int i = 0 ; i < size ; i ++ ) { Object item = list . get ( i ) ; if ( i > 0 ) { buffer . append ( separator ) ; } buffer . append ( item . toString ( ) ) ; } return buffer . toString ( ) ;