signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class BaseProfile { /** * generate resource adapter code * @ param def Definition */ void generateRaCode ( Definition def ) { } }
if ( def . isUseRa ( ) ) { generateClassCode ( def , "Ra" ) ; generateClassCode ( def , "RaMeta" ) ; } if ( def . isGenAdminObject ( ) ) { for ( int i = 0 ; i < def . getAdminObjects ( ) . size ( ) ; i ++ ) { generateMultiAdminObjectClassCode ( def , "AoImpl" , i ) ; generateMultiAdminObjectClassCode ( def , "AoInterfa...
public class KeyOnlyFilterAdapter { /** * { @ inheritDoc } */ @ Override public FilterSupportStatus isFilterSupported ( FilterAdapterContext context , KeyOnlyFilter filter ) { } }
// We don ' t support replacing the value of a stripped cell with // the its length ( 8 - byte - big - endian ) . The KeyOnlyFilter supports this // via a constructor parameter that is not exposed via a getLengthAsValue ( ) . // In order to find out if this constructor parameter was set , // we perform a test transform...
public class HeadendResultConverter { /** * Main conversion method . * @ param value */ @ Override public GetHeadendsResult convert ( Map < String , Headend > value ) { } }
GetHeadendsResult r = new GetHeadendsResult ( ) ; r . setHeadends ( value ) ; return r ;
public class PdfPageEventForwarder { /** * Called when the document is opened . * @ param writer * the < CODE > PdfWriter < / CODE > for this document * @ param document * the document */ public void onOpenDocument ( PdfWriter writer , Document document ) { } }
PdfPageEvent event ; for ( Iterator i = events . iterator ( ) ; i . hasNext ( ) ; ) { event = ( PdfPageEvent ) i . next ( ) ; event . onOpenDocument ( writer , document ) ; }
public class Conversions { /** * Tries conversion of any value to a time */ public static OffsetTime toTime ( Object value , EvaluationContext ctx ) { } }
if ( value instanceof String ) { OffsetTime time = ctx . getDateParser ( ) . time ( ( String ) value ) ; if ( time != null ) { return time ; } } else if ( value instanceof OffsetTime ) { return ( OffsetTime ) value ; } else if ( value instanceof ZonedDateTime ) { return ( ( ZonedDateTime ) value ) . toOffsetDateTime ( ...
public class JBBPUtils { /** * Split an integer value to bytes and returns as a byte array . * @ param value a value to be split * @ param valueInLittleEndian the flag shows that the integer is presented in * the little endian form * @ param buffer a buffer array to be used as a storage , if the array is null ...
final byte [ ] result ; if ( buffer == null || buffer . length < 4 ) { result = new byte [ 4 ] ; } else { result = buffer ; } int tmpvalue = value ; if ( valueInLittleEndian ) { for ( int i = 0 ; i < 4 ; i ++ ) { result [ i ] = ( byte ) tmpvalue ; tmpvalue >>>= 8 ; } } else { for ( int i = 3 ; i >= 0 ; i -- ) { result ...
public class Index { /** * compareAndSet right field . */ final boolean casRight ( Index < K , V > cmp , Index < K , V > val ) { } }
return U . compareAndSwapObject ( this , RIGHT , cmp , val ) ;
public class BoxMetadataFilter { /** * Set a filter to the filterList , example : key = documentNumber , gt : " " , lt : " " . * @ param key the key that the filter should be looking for . * @ param dateRange the date range that is start and end dates */ public void addDateRangeFilter ( String key , DateRange dateR...
JsonObject opObj = new JsonObject ( ) ; if ( dateRange . getFromDate ( ) != null ) { String dateGtString = BoxDateFormat . format ( dateRange . getFromDate ( ) ) ; // workaround replacing + and - 000 at the end with ' Z ' dateGtString = dateGtString . replaceAll ( "(\\+|-)(?!-\\|?!\\+)\\d+$" , "Z" ) ; opObj . add ( "gt...
public class UrlMapClient { /** * Returns the specified UrlMap resource . Gets a list of available URL maps by making a list ( ) * request . * < p > Sample code : * < pre > < code > * try ( UrlMapClient urlMapClient = UrlMapClient . create ( ) ) { * ProjectGlobalUrlMapName urlMap = ProjectGlobalUrlMapName . o...
GetUrlMapHttpRequest request = GetUrlMapHttpRequest . newBuilder ( ) . setUrlMap ( urlMap ) . build ( ) ; return getUrlMap ( request ) ;
public class SimpleJsonManager { @ Override public < BEAN > BEAN fromJson ( String json , Class < BEAN > beanType ) { } }
assertArgumentNotNull ( "json" , json ) ; assertArgumentNotNull ( "beanType" , beanType ) ; return realJsonEngine . fromJson ( json , beanType ) ;
public class DistributedLayoutManager { /** * Returns true if the node exists in the underlying DOM model and it does not contain a * ' deleteAllowed ' attribute with a value of ' false ' . */ protected boolean canDeleteNode ( IUserLayoutNodeDescription node ) throws PortalException { } }
if ( node == null ) return false ; // todo if isFragmentOwner should probably verify node is part of the // same layout fragment as the fragment owner to insure a misbehaving front - end doesn ' t // do an improper operation . return isFragmentOwner || node . isDeleteAllowed ( ) ;
public class DnsCacheManipulator { /** * Get dns cache . * @ return dns cache . return { @ code null } if no entry for host or dns cache is expired . * @ throws DnsCacheManipulatorException Operation fail */ @ Nullable public static DnsCacheEntry getDnsCache ( String host ) { } }
try { return InetAddressCacheUtil . getInetAddressCache ( host ) ; } catch ( Exception e ) { throw new DnsCacheManipulatorException ( "Fail to getDnsCache, cause: " + e . toString ( ) , e ) ; }
public class ObjToIntMap { /** * Get integer value assigned with key . * @ return key integer value * @ throws RuntimeException if key does not exist */ public int getExisting ( Object key ) { } }
if ( key == null ) { key = UniqueTag . NULL_VALUE ; } int index = findIndex ( key ) ; if ( 0 <= index ) { return values [ index ] ; } // Key must exist Kit . codeBug ( ) ; return 0 ;
public class DefaultGroovyMethods { /** * Returns the longest prefix of elements in this iterator where * each element passed to the given condition closure evaluates to true . * < pre class = " groovyTestCase " > * def a = 0 * def iter = [ hasNext : { true } , next : { a + + } ] as Iterator * assert [ ] . it...
return new TakeWhileIterator < T > ( self , condition ) ;
public class CommercePriceEntryLocalServiceBaseImpl { /** * 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 commercePriceEntryPersistence . findWithDynamicQuery ( dynamicQuery ) ;
public class Base64 { /** * Testing . Feel free - - in fact I encourage you - - to throw out * this entire " main " method when you actually deploy this code . */ public static void main ( String [ ] args ) { } }
try { // Test encoding / decoding byte arrays { byte [ ] bytes1 = { ( byte ) 2 , ( byte ) 2 , ( byte ) 3 , ( byte ) 0 , ( byte ) 9 } ; // My zip code byte [ ] bytes2 = { ( byte ) 99 , ( byte ) 2 , ( byte ) 2 , ( byte ) 3 , ( byte ) 0 , ( byte ) 9 } ; System . out . println ( "Bytes 2,2,3,0,9 as Base64: " + encodeBytes ...
public class SchedulerWsDelegate { /** * Creates or updates ascheduled job . * @ param jobId the job ' s ID ( null to create a new job ) * @ param jobName the job ' s name * @ param appName the application ' s name * @ param cmdName the name of the commands file to execute * @ param cron the CRON expression t...
if ( jobId == null ) this . logger . finer ( "Creating a new scheduled job." ) ; else this . logger . finer ( "Updating the following scheduled job: " + jobId ) ; WebResource path = this . resource . path ( UrlConstants . SCHEDULER ) ; if ( jobId != null ) path = path . queryParam ( "job-id" , jobId ) ; path = path . q...
public class DateHelper { /** * Create a Date instance representing a specific time . * @ param hour hour 0-23 * @ param minutes minutes 0-59 * @ return new Date instance */ public static Date getTime ( int hour , int minutes ) { } }
Calendar cal = popCalendar ( ) ; cal . set ( Calendar . HOUR_OF_DAY , hour ) ; cal . set ( Calendar . MINUTE , minutes ) ; cal . set ( Calendar . SECOND , 0 ) ; Date result = cal . getTime ( ) ; pushCalendar ( cal ) ; return result ;
public class PeopleApi { /** * Get information about a user . * < br > * This method does not require authentication . * @ param userId ( Required ) The user id of the user to fetch information about . * @ param sign if true , the request will be signed . * @ return object with information about the user . ...
JinxUtils . validateParams ( userId ) ; Map < String , String > params = new TreeMap < > ( ) ; params . put ( "method" , "flickr.people.getInfo" ) ; params . put ( "user_id" , userId ) ; return jinx . flickrGet ( params , Person . class , sign ) ;
public class DatabaseAccountsInner { /** * Lists the read - only access keys for the specified Azure Cosmos DB database account . * @ param resourceGroupName Name of an Azure resource group . * @ param accountName Cosmos DB database account name . * @ throws IllegalArgumentException thrown if parameters fail the ...
return getReadOnlyKeysWithServiceResponseAsync ( resourceGroupName , accountName ) . map ( new Func1 < ServiceResponse < DatabaseAccountListReadOnlyKeysResultInner > , DatabaseAccountListReadOnlyKeysResultInner > ( ) { @ Override public DatabaseAccountListReadOnlyKeysResultInner call ( ServiceResponse < DatabaseAccount...
public class PossibleMemoryBloat { /** * collects static fields that are likely bloatable objects and if found allows the visitor to proceed , at the end report all leftover fields * @ param classContext * the class context object of the currently parsed java class */ @ Override public void visitClassContext ( Clas...
try { bloatableCandidates = new HashMap < > ( ) ; bloatableFields = new HashMap < > ( ) ; threadLocalNonStaticFields = new HashSet < > ( ) ; userValues = new HashMap < > ( ) ; jaxbContextRegs = new HashMap < > ( ) ; parseFields ( classContext ) ; stack = new OpcodeStack ( ) ; super . visitClassContext ( classContext ) ...
public class JspContextWrapper { /** * Restores the values of any NESTED variables in the invoking JSP * context . */ private void restoreNestedVariables ( ) { } }
if ( nestedVars != null ) { Iterator iter = nestedVars . iterator ( ) ; while ( iter . hasNext ( ) ) { String varName = ( String ) iter . next ( ) ; varName = findAlias ( varName ) ; Object obj = originalNestedVars . get ( varName ) ; if ( obj != null ) { invokingJspCtxt . setAttribute ( varName , obj ) ; } else { invo...
public class AbstractXMPPConnection { /** * Sends out a notification that there was an error with the connection * and closes the connection . * @ param exception the exception that causes the connection close event . */ protected final void notifyConnectionError ( final Exception exception ) { } }
if ( ! isConnected ( ) ) { LOGGER . log ( Level . INFO , "Connection was already disconnected when attempting to handle " + exception , exception ) ; return ; } ASYNC_BUT_ORDERED . performAsyncButOrdered ( this , ( ) -> { currentConnectionException = exception ; for ( StanzaCollector collector : collectors ) { collecto...
public class InfluxDbConnectionFactory { /** * Write measurement point . * @ param point the point */ public void write ( final Point point ) { } }
this . influxDb . write ( influxDbProperties . getDatabase ( ) , influxDbProperties . getRetentionPolicy ( ) , point ) ;
public class CliOptions { /** * Attempts to load a configuration given a file or default files * and overrides with command line arguments * @ return A config object with user settings or defaults * @ throws IOException If there was an error opening any of the config files * @ throws FileNotFoundException If th...
// load configuration final Config config ; final String config_file = argp . get ( "--config" , "" ) ; if ( ! config_file . isEmpty ( ) ) config = new Config ( config_file ) ; else config = new Config ( true ) ; // load CLI overloads overloadConfig ( argp , config ) ; // the auto metric is recorded to a class boolean ...
public class TransactionOutPoint { /** * Returns the ECKey identified in the connected output , for either P2PKH , P2WPKH or P2PK scripts . * For P2SH scripts you can use { @ link # getConnectedRedeemData ( KeyBag ) } and then get the * key from RedeemData . * If the script form cannot be understood , throws Scri...
TransactionOutput connectedOutput = getConnectedOutput ( ) ; checkNotNull ( connectedOutput , "Input is not connected so cannot retrieve key" ) ; Script connectedScript = connectedOutput . getScriptPubKey ( ) ; if ( ScriptPattern . isP2PKH ( connectedScript ) ) { byte [ ] addressBytes = ScriptPattern . extractHashFromP...
public class HashtableEntry { /** * Before writing data to the disk , this method is used to create a HashtableEntry . * @ param key The object ' s key * @ param value The object * @ param tablesize number of objects in the table . * @ param tableid instance id of the hashtable . Used to support multiple * ht...
this . key = key ; this . value = value ; this . valuelen = valuelen ; this . previous = previous ; this . expiration = expirationTime ; this . validatorExpiration = validatorExpirationTime ; // LI4537-24 this . tableid = tableid ; this . first_created = System . currentTimeMillis ( ) ; this . hash = key . hashCode ( )...
public class Pool { private void stopPondLife ( int id ) { } }
PondLife pl = null ; synchronized ( this ) { pl = _pondLife [ id ] ; if ( pl != null ) { _pondLife [ id ] = null ; _index [ -- _size ] = id ; if ( _available > _size ) _available = _size ; } } if ( pl != null ) pl . leavePool ( ) ;
public class CmsMessageBundleEditorModel { /** * Saves the messages for all languages that were opened in the editor . * @ throws CmsException thrown if saving fails . */ public void save ( ) throws CmsException { } }
if ( hasChanges ( ) ) { switch ( m_bundleType ) { case PROPERTY : saveLocalization ( ) ; saveToPropertyVfsBundle ( ) ; break ; case XML : saveLocalization ( ) ; saveToXmlVfsBundle ( ) ; break ; case DESCRIPTOR : break ; default : throw new IllegalArgumentException ( ) ; } if ( null != m_descFile ) { saveToBundleDescrip...
public class AlertReader { /** * Retrieve the next page from the Twilio API . * @ param page current page * @ param client TwilioRestClient with which to make the request * @ return Next Page */ @ Override public Page < Alert > nextPage ( final Page < Alert > page , final TwilioRestClient client ) { } }
Request request = new Request ( HttpMethod . GET , page . getNextPageUrl ( Domains . MONITOR . toString ( ) , client . getRegion ( ) ) ) ; return pageForRequest ( client , request ) ;
public class Ifc2x3tc1FactoryImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public IfcSequenceEnum createIfcSequenceEnumFromString ( EDataType eDataType , String initialValue ) { } }
IfcSequenceEnum result = IfcSequenceEnum . get ( initialValue ) ; if ( result == null ) throw new IllegalArgumentException ( "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType . getName ( ) + "'" ) ; return result ;
public class BoundedSortedMap { /** * Adds the key - value mapping to this map , and if the total number of * mappings exceeds the bounds , removes either the currently lowest element , * or if reversed , the currently highest element . * @ param key { @ inheritDoc } * @ param value { @ inheritDoc } */ public V...
V old = super . put ( key , value ) ; if ( size ( ) > bound ) { remove ( firstKey ( ) ) ; } return old ;
public class CloseableUtils { /** * This method has been added because Guava has removed the * { @ code closeQuietly ( ) } method from { @ code Closeables } in v16.0 . It ' s * tempting simply to replace calls to { @ code closeQuietly ( closeable ) } * with calls to { @ code close ( closeable , true ) } to close ...
try { // Here we ' ve instructed Guava to swallow the IOException Closeables . close ( closeable , true ) ; } catch ( IOException e ) { // We instructed Guava to swallow the IOException , so this should // never happen . Since it did , log it . log . error ( "IOException should not have been thrown." , e ) ; }
public class ReadFileExtensions { /** * The Method reader2String ( ) reads the data from the Reader into a String . < br > * < br > * Note : Reader will not be closed . * @ param reader * The Reader from where we read . * @ return The String that we read from the Reader . * @ throws IOException * Signals ...
final StringBuffer stringBuffer = new StringBuffer ( ) ; final char [ ] charArray = new char [ FileConst . BLOCKSIZE ] ; int tmp ; while ( ( tmp = reader . read ( charArray ) ) > 0 ) { stringBuffer . append ( charArray , 0 , tmp ) ; } return stringBuffer . toString ( ) ;
public class JaxWsHttpServletRequestAdapter { /** * ( non - Javadoc ) * @ see javax . servlet . ServletRequest # getLocale ( ) */ @ Override public Locale getLocale ( ) { } }
try { collaborator . preInvoke ( componentMetaData ) ; return request . getLocale ( ) ; } finally { collaborator . postInvoke ( ) ; }
public class RedisStorage { /** * Pause the trigger with the given key * @ param triggerKey the key of the trigger to be paused * @ param jedis a thread - safe Redis connection * @ throws JobPersistenceException if the desired trigger does not exist */ @ Override public void pauseTrigger ( TriggerKey triggerKey ,...
final String triggerHashKey = redisSchema . triggerHashKey ( triggerKey ) ; Pipeline pipe = jedis . pipelined ( ) ; Response < Boolean > exists = pipe . exists ( triggerHashKey ) ; Response < Double > completedScore = pipe . zscore ( redisSchema . triggerStateKey ( RedisTriggerState . COMPLETED ) , triggerHashKey ) ; R...
public class JCacheManagerAdapter { /** * Return the JCache wrapper for a c2k cache . */ public Cache resolveCacheWrapper ( org . cache2k . Cache _c2kCache ) { } }
synchronized ( getLockObject ( ) ) { return c2k2jCache . get ( _c2kCache ) ; }
public class IfcIrregularTimeSeriesImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ SuppressWarnings ( "unchecked" ) @ Override public EList < IfcIrregularTimeSeriesValue > getValues ( ) { } }
return ( EList < IfcIrregularTimeSeriesValue > ) eGet ( Ifc4Package . Literals . IFC_IRREGULAR_TIME_SERIES__VALUES , true ) ;
public class RepositoryException { /** * Converts RepositoryException into an appropriate FetchException , prepending * the specified message . If message is null , original exception message is * preserved . * @ param message message to prepend , which may be null */ public final FetchException toFetchException ...
Throwable cause ; if ( this instanceof FetchException ) { cause = this ; } else { cause = getCause ( ) ; } if ( cause == null ) { cause = this ; } else if ( cause instanceof FetchException && message == null ) { return ( FetchException ) cause ; } String causeMessage = cause . getMessage ( ) ; if ( causeMessage == null...
public class ELParser { /** * Test if an id is a reserved word in EL */ private boolean isELReserved ( String id ) { } }
int i = 0 ; int j = reservedWords . length ; while ( i < j ) { int k = ( i + j ) / 2 ; int result = reservedWords [ k ] . compareTo ( id ) ; if ( result == 0 ) { return true ; } if ( result < 0 ) { i = k + 1 ; } else { j = k ; } } return false ;
public class ExecutableMethodWriter { /** * Write the method . * @ param declaringType The declaring type * @ param returnType The return type * @ param genericReturnType The generic return type * @ param returnTypeGenericTypes The return type generics * @ param methodName The method name * @ param argument...
Type declaringTypeObject = getTypeReference ( declaringType ) ; boolean hasArgs = ! argumentTypes . isEmpty ( ) ; Collection < Object > argumentTypeClasses = hasArgs ? argumentTypes . values ( ) : Collections . emptyList ( ) ; int modifiers = isStatic ? ACC_SYNTHETIC | ACC_STATIC : ACC_SYNTHETIC ; classWriter . visit (...
public class CmsObject { /** * Creates a new resource of the given resource type * with the provided content and properties . < p > * @ param resourcename the name of the resource to create ( full current site relative path ) * @ param type the type of the resource to create * @ param content the contents for t...
return createResource ( resourcename , getResourceType ( type ) , content , properties ) ;
public class NonGeometricData { /** * Morph the color from a string * @ param str The string to morph * @ return The new color string */ private String morphColor ( String str ) { } }
if ( str . equals ( "" ) ) { return "#000000" ; } if ( str . equals ( "white" ) ) { return "#ffffff" ; } if ( str . equals ( "black" ) ) { return "#000000" ; } return str ;
public class druidGLexer { /** * $ ANTLR start " AUTO _ ISO " */ public final void mAUTO_ISO ( ) throws RecognitionException { } }
try { int _type = AUTO_ISO ; int _channel = DEFAULT_TOKEN_CHANNEL ; // druidG . g : 603:10 : ( ( ' AUTO _ ISO ' ) ) // druidG . g : 603:11 : ( ' AUTO _ ISO ' ) { // druidG . g : 603:11 : ( ' AUTO _ ISO ' ) // druidG . g : 603:12 : ' AUTO _ ISO ' { match ( "AUTO_ISO" ) ; } } state . type = _type ; state . channel = _cha...
public class BindableAdapter { /** * Create a new instance of a drop - down view for the specified position . */ public View newDropDownView ( LayoutInflater inflater , int position , ViewGroup container ) { } }
return newView ( inflater , position , container ) ;
public class Fork { /** * Compare and set the state of this { @ link Fork } to a new state if and only if the current state * is equal to the expected state . Throw an exception if the state did not match . */ private void verifyAndSetForkState ( ForkState expectedState , ForkState newState ) { } }
if ( ! compareAndSetForkState ( expectedState , newState ) ) { throw new IllegalStateException ( String . format ( "Expected fork state %s; actual fork state %s" , expectedState . name ( ) , this . forkState . get ( ) . name ( ) ) ) ; }
public class RequestIdTable { /** * begin F174772 */ public synchronized boolean hasReceiveListeners ( ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "hasReceiveListeners" ) ; boolean returnValue = false ; if ( ! table . values ( ) . isEmpty ( ) ) { returnValue = receiveListenerIterator ( ) . hasNext ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isE...
public class GVRAsynchronousResourceLoader { /** * Load a compressed texture asynchronously . * This is the implementation of * { @ link GVRContext # loadCompressedTexture ( GVRAndroidResource . CompressedTextureCallback , GVRAndroidResource ) } * : it will usually be more convenient ( and more efficient ) to cal...
validateCallbackParameters ( gvrContext , callback , resource ) ; final GVRImage cached = textureCache == null ? null : textureCache . get ( resource ) ; if ( cached != null ) { Log . v ( "ASSET" , "Texture: %s loaded from cache" , cached . getFileName ( ) ) ; gvrContext . runOnGlThread ( new Runnable ( ) { @ Override ...
public class NotificationService { /** * Forward multiple notifications . * @ param notifications List of notifications to forward . * @ param recipients List of recipients . * @ param comment Comment to attach to forwarded notification . */ public void forwardNotifications ( Collection < Notification > notificat...
List < String > lst1 = new ArrayList < > ( ) ; for ( Notification notification : notifications ) { lst1 . add ( notification . getAlertId ( ) ) ; } List < Long > lst2 = prepareRecipients ( recipients ) ; if ( ! lst1 . isEmpty ( ) && ! lst2 . isEmpty ( ) ) { broker . callRPC ( "RGCWXQ FORWARD" , lst1 , lst2 , comment ) ...
public class LObjCharFunctionBuilder { /** * Adds full new case for the argument that are of specific classes ( matched by instanceOf , null is a wildcard ) . */ @ Nonnull public < V extends T > LObjCharFunctionBuilder < T , R > aCase ( Class < V > argC1 , LObjCharFunction < V , R > function ) { } }
PartialCaseWithProduct . The pc = partialCaseFactoryMethod ( ( a1 , a2 ) -> ( argC1 == null || argC1 . isInstance ( a1 ) ) ) ; pc . evaluate ( function ) ; return self ( ) ;
public class Calc { /** * Transforms a group object , given a Matrix4d ( i . e . the vecmath library * double - precision 4x4 rotation + translation matrix ) . The transformation * Matrix must be a post - multiplication Matrix . * @ param group * @ param m */ public static final void transform ( Group group , M...
for ( Atom atom : group . getAtoms ( ) ) { transform ( atom , m ) ; } for ( Group altG : group . getAltLocs ( ) ) { transform ( altG , m ) ; }
public class AbstractJSSEProvider { /** * Clear the contents of the SSLContext cache . */ public static void clearSSLContextCache ( ) { } }
if ( sslContextCacheJAVAX != null && sslContextCacheJAVAX . size ( ) > 0 ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Clearing standard javax.net.ssl.SSLContext cache." ) ; sslContextCacheJAVAX . clear ( ) ; }
public class InsnList { /** * Inserts the given instructions before the specified instruction . * @ param location * an instruction < i > of this list < / i > before which the * instructions must be inserted . * @ param insns * the instruction list to be inserted , which is cleared during * the process . Th...
if ( insns . size == 0 ) { return ; } size += insns . size ; AbstractInsnNode ifirst = insns . first ; AbstractInsnNode ilast = insns . last ; AbstractInsnNode prev = location . prev ; if ( prev == null ) { first = ifirst ; } else { prev . next = ifirst ; } location . prev = ilast ; ilast . next = location ; ifirst . p...
public class MolecularFormulaSetManipulator { /** * Remove all those IMolecularFormula which are not fit theirs IElement * occurrence into a limits . The limits are given from formulaMax and formulaMin . * In the minimal IMolecularFormula must contain all those IElement found in the * minimal IMolecularFormula . ...
// prove the correlation between maximum and minimum molecularFormula if ( ! validCorrelation ( formulaMin , formulaMax ) ) return null ; IMolecularFormulaSet newFormulaSet = formulaSet . getBuilder ( ) . newInstance ( IMolecularFormulaSet . class ) ; for ( IMolecularFormula formula : formulaSet . molecularFormulas ( )...
public class AbstractCollinsHeadFinder { /** * Called by determineHead and may be overridden in subclasses * if special treatment is necessary for particular categories . */ protected Tree determineNonTrivialHead ( Tree t , Tree parent ) { } }
Tree theHead = null ; String motherCat = tlp . basicCategory ( t . label ( ) . value ( ) ) ; if ( DEBUG ) { System . err . println ( "Looking for head of " + t . label ( ) + "; value is |" + t . label ( ) . value ( ) + "|, " + " baseCat is |" + motherCat + '|' ) ; } // We know we have nonterminals underneath // ( a bit...
public class KeyEncoder { /** * Encodes the given signed Integer object into exactly 1 or 5 bytes for * descending order . If the Integer object is never expected to be null , * consider encoding as an int primitive . * @ param value optional signed Integer value to encode * @ param dst destination for encoded ...
if ( value == null ) { dst [ dstOffset ] = NULL_BYTE_LOW ; return 1 ; } else { dst [ dstOffset ] = NOT_NULL_BYTE_LOW ; DataEncoder . encode ( ~ value . intValue ( ) , dst , dstOffset + 1 ) ; return 5 ; }
public class CmsStringUtil { /** * Concatenates multiple paths and separates them with ' / ' . < p > * Consecutive slashes will be reduced to a single slash in the resulting string . * For example , joinPaths ( " / foo / " , " / bar " , " baz " ) will return " / foo / bar / baz " . * @ param paths the list of pat...
String result = listAsString ( paths , "/" ) ; // result may now contain multiple consecutive slashes , so reduce them to single slashes result = PATTERN_SLASHES . matcher ( result ) . replaceAll ( "/" ) ; return result ;
public class BaseClusteringAlgorithm { /** * Initialize the * cluster centers at random */ protected void initClusters ( ) { } }
log . info ( "Generating initial clusters" ) ; List < Point > points = new ArrayList < > ( initialPoints ) ; // Initialize the ClusterSet with a single cluster center ( based on position of one of the points chosen randomly ) val random = Nd4j . getRandom ( ) ; Distance distanceFn = clusteringStrategy . getDistanceFunc...
public class CamelEndpointDeploymentSchedulerService { /** * Either schedules the given HTTP endpoint for deployment once { @ link # deployerService } becomes available or * deploys it instantly if the { @ link # deployerService } is available already . * @ param uri determines the path and protocol under which the...
synchronized ( scheduledHandlers ) { CamelLogger . LOGGER . debug ( "Scheduling a deployment of endpoint {} from {}" , uri , deploymentName ) ; if ( this . deployerService != null ) { this . deployerService . deploy ( uri , endpointHttpHandler ) ; } else { scheduledHandlers . put ( uri , endpointHttpHandler ) ; } }
public class SarlCompiler { /** * Replies if the generation is for Java version 8 at least . * @ param context the context . * @ return { @ code true } if Java 8 or newer . */ protected boolean isAtLeastJava8 ( EObject context ) { } }
return this . generatorConfigProvider . get ( EcoreUtil . getRootContainer ( context ) ) . getJavaSourceVersion ( ) . isAtLeast ( JavaVersion . JAVA8 ) ;
public class RingBuffer { /** * This method is called after some parameters like marked are updated . */ protected void updated ( ) { } }
if ( remaining < 0 && remaining > capacity ) { throw new IllegalArgumentException ( remaining + " illegal remaining at %s" + toString ( ) ) ; } if ( marked < 0 && marked > capacity ) { throw new IllegalArgumentException ( marked + " illegal marked at %s" + toString ( ) ) ; }
public class AntlrGrammarGenUtil { /** * Returns the first - set of the given abstractElement . That is , all keywords * with distinct values and all rule calls to distinct terminals . * @ since 2.6 */ public static List < AbstractElement > getFirstSet ( AbstractElement element ) { } }
return org . eclipse . xtext . xtext . generator . parser . antlr . AntlrGrammarGenUtil . getFirstSet ( element ) ;
public class WindowUtils { /** * Installs a { @ link WindowFocusListener } on the given { @ link JComponent } ' s * parent { @ link Window } . If the { @ code JComponent } doesn ' t yet have a * parent , then the listener will be installed when the component is added * to a container . * @ param component the c...
WindowListener weakFocusListener = createWeakWindowFocusListener ( focusListener ) ; AncestorListener ancestorListener = createAncestorListener ( component , weakFocusListener ) ; component . addAncestorListener ( ancestorListener ) ;
public class QuerySources { /** * Obtain a { @ link NodeSequence } that returns the ( queryable ) descendants of the node at the given path in the workspace , * where each descendant node is assigned the given score . * @ param ancestorPath the path of the ancestor of all descendants ; may not be null * @ param s...
String workspaceName = getWorkspaceName ( ancestorPath ) ; // Get an iterator over all acceptable nodes in the workspace . . . NodeCacheIterator iter = nodes ( workspaceName , ancestorPath ) ; if ( iter != null ) { if ( iter . hasNext ( ) ) { // Skip the node at our path , which is to be excluded . . . NodeKey key = it...
public class DHash { /** * Calculate the Hamming distance between two hashes * @ param h1 * @ param h2 * @ return */ public static Integer distance ( String h1 , String h2 ) { } }
HammingDistance distance = new HammingDistance ( ) ; return distance . apply ( h1 , h2 ) ;
public class ViewAware { /** * { @ inheritDoc } * Width is defined by target { @ link android . view . View view } parameters , configuration * parameters or device display dimensions . < br / > * Size computing algorithm ( go by steps until get non - zero value ) : < br / > * 1 ) Get the actual drawn < b > get...
View view = viewRef . get ( ) ; if ( view != null ) { final ViewGroup . LayoutParams params = view . getLayoutParams ( ) ; int width = 0 ; if ( checkActualViewSize && params != null && params . width != ViewGroup . LayoutParams . WRAP_CONTENT ) { width = view . getWidth ( ) ; // Get actual image width } if ( width <= 0...
public class RequestSizeWatchdog { /** * 2 MB */ @ Override public HttpResponse filterRequest ( HttpRequest request , HttpMessageContents contents , HttpMessageInfo messageInfo ) { } }
if ( contents . getBinaryContents ( ) . length > threshold ) { log . warning ( "Too large request " + messageInfo . getUrl ( ) + ": " + contents . getBinaryContents ( ) . length + " bytes" ) ; if ( log . isLoggable ( Level . FINEST ) ) { log . finest ( "Request content: " + contents . getTextContents ( ) ) ; } } return...
public class FilterRegex { /** * this remove the linebreak . * @ param input * the input * @ param patternStr * the pattern str * @ return the string */ public static String stringMatcherByPattern ( String input , String patternStr ) { } }
String output = PcConstants . SYSTEM_FAIL_MATCH_REGEX ; // 20140105 : fix the NPE issue if ( patternStr == null ) { logger . error ( "patternStr is NULL! (Expected when the aggregation rule is not defined at " + PcDateUtils . getNowDateTimeStrStandard ( ) ) ; return output ; } if ( input == null ) { logger . error ( "i...
public class RSS090Generator { /** * maxLen = = - 1 means unlimited . */ protected void checkLength ( final Element parent , final String childName , final int minLen , final int maxLen ) throws FeedException { } }
final Element child = parent . getChild ( childName , getFeedNamespace ( ) ) ; if ( child != null ) { if ( minLen > 0 && child . getText ( ) . length ( ) < minLen ) { throw new FeedException ( "Invalid " + getType ( ) + " feed, " + parent . getName ( ) + " " + childName + "short of " + minLen + " length" ) ; } if ( max...
public class IsoInterval { /** * / * [ deutsch ] * < p > L & auml ; & szlig ; t die angegebene Abfrage dieses Intervall auswerten . < / p > * @ param < R > generic type of result of query * @ param function interval query * @ return result of query or { @ code null } if undefined * @ throws net . time4j . eng...
return function . apply ( this ) ;
public class SwimMembershipProtocol { /** * Marks the given member suspect after all probes failing . */ private void failProbes ( ImmutableMember suspect ) { } }
SwimMember swimMember = new SwimMember ( suspect ) ; LOGGER . debug ( "{} - Failed all probes of {}" , localMember . id ( ) , swimMember ) ; swimMember . setState ( State . SUSPECT ) ; if ( updateState ( swimMember . copy ( ) ) && config . isBroadcastUpdates ( ) ) { broadcast ( swimMember . copy ( ) ) ; }
public class PreferencesFxUtils { /** * Returns a list of all the settings which are contained in a list of { @ code categories } * recursively . */ public static List < Setting > categoriesToSettings ( List < Category > categories ) { } }
return categories . stream ( ) . map ( Category :: getGroups ) // get groups from categories . filter ( Objects :: nonNull ) // remove all null . flatMap ( Collection :: stream ) // recursively flatten all categories . map ( Group :: getSettings ) // get settings from groups . filter ( Objects :: nonNull ) // remove al...
public class IntegrationAccountBatchConfigurationsInner { /** * Create or update a batch configuration for an integration account . * @ param resourceGroupName The resource group name . * @ param integrationAccountName The integration account name . * @ param batchConfigurationName The batch configuration name . ...
return createOrUpdateWithServiceResponseAsync ( resourceGroupName , integrationAccountName , batchConfigurationName , batchConfiguration ) . toBlocking ( ) . single ( ) . body ( ) ;
public class VideoPositionTarget { /** * Gets the videoPositionWithinPod value for this VideoPositionTarget . * @ return videoPositionWithinPod * The video position within a pod to target . To target a video * position or a bumper position , * this value must be null . To target a position within * a pod this v...
return videoPositionWithinPod ;
public class systemgroup { /** * Use this API to fetch all the systemgroup resources that are configured on netscaler . */ public static systemgroup [ ] get ( nitro_service service ) throws Exception { } }
systemgroup obj = new systemgroup ( ) ; systemgroup [ ] response = ( systemgroup [ ] ) obj . get_resources ( service ) ; return response ;
public class IndexerFactory { /** * Returns the { @ link Indexer } of the given implementation class . * @ param indexerClass * the implementation class of the Indexer interface * @ return the Indexer */ @ SuppressWarnings ( "unchecked" ) public < T extends Indexer > T getIndexer ( Class < T > indexerClass ) { } ...
Indexer indexer = cache . get ( indexerClass ) ; if ( indexer == null ) { indexer = createIndexer ( indexerClass ) ; } return ( T ) indexer ;
public class DataUtil { /** * little - endian or intel format . */ public static int readUnsignedShortLittleEndian ( InputStream io ) throws IOException { } }
int value = io . read ( ) ; if ( value < 0 ) throw new EOFException ( ) ; int i = io . read ( ) ; if ( i < 0 ) throw new EOFException ( ) ; return value | ( i << 8 ) ;
public class ColumnMajorSparseMatrix { /** * Creates a random symmetric { @ link ColumnMajorSparseMatrix } of the given { @ code size } . */ public static ColumnMajorSparseMatrix randomSymmetric ( int size , double density , Random random ) { } }
return CCSMatrix . randomSymmetric ( size , density , random ) ;
public class Searcher { /** * Adds controls of the given interactions recursively to the given set . * @ param inter interaction to add its controls * @ param set set to add to */ private static void addControlsRecursive ( Interaction inter , Set < Interaction > set ) { } }
for ( Control ctrl : inter . getControlledOf ( ) ) { set . add ( ctrl ) ; addControlsRecursive ( ctrl , set ) ; }
public class FilterContainer { /** * Removes a filter from this project file . * @ param filterName The name of the filter */ public void removeFilter ( String filterName ) { } }
Filter filter = getFilterByName ( filterName ) ; if ( filter != null ) { if ( filter . isTaskFilter ( ) ) { m_taskFilters . remove ( filter ) ; } if ( filter . isResourceFilter ( ) ) { m_resourceFilters . remove ( filter ) ; } m_filtersByName . remove ( filterName ) ; m_filtersByID . remove ( filter . getID ( ) ) ; }
public class BreakpointInterceptor { /** * Get the exactly content - length , on this method we assume the range is from 0. */ @ IntRange ( from = - 1 ) long getExactContentLengthRangeFrom0 ( @ NonNull DownloadConnection . Connected connected ) { } }
final String contentRangeField = connected . getResponseHeaderField ( CONTENT_RANGE ) ; long contentLength = - 1 ; if ( ! Util . isEmpty ( contentRangeField ) ) { final long rightRange = getRangeRightFromContentRange ( contentRangeField ) ; // for the range from 0 , the contentLength is just right - range + 1. if ( rig...
public class AmazonRoute53Waiters { /** * Builds a ResourceRecordSetsChanged waiter by using custom parameters waiterParameters and other parameters * defined in the waiters specification , and then polls until it determines whether the resource entered the desired * state or not , where polling criteria is bound b...
return new WaiterBuilder < GetChangeRequest , GetChangeResult > ( ) . withSdkFunction ( new GetChangeFunction ( client ) ) . withAcceptors ( new ResourceRecordSetsChanged . IsINSYNCMatcher ( ) ) . withDefaultPollingStrategy ( new PollingStrategy ( new MaxAttemptsRetryStrategy ( 60 ) , new FixedDelayStrategy ( 30 ) ) ) ...
public class SIAImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public boolean eIsSet ( int featureID ) { } }
switch ( featureID ) { case AfplibPackage . SIA__ADJSTMNT : return ADJSTMNT_EDEFAULT == null ? adjstmnt != null : ! ADJSTMNT_EDEFAULT . equals ( adjstmnt ) ; case AfplibPackage . SIA__DIRCTION : return DIRCTION_EDEFAULT == null ? dirction != null : ! DIRCTION_EDEFAULT . equals ( dirction ) ; } return super . eIsSet ( f...
public class ListNetworkProfilesResult { /** * A list of the available network profiles . * @ param networkProfiles * A list of the available network profiles . */ public void setNetworkProfiles ( java . util . Collection < NetworkProfile > networkProfiles ) { } }
if ( networkProfiles == null ) { this . networkProfiles = null ; return ; } this . networkProfiles = new java . util . ArrayList < NetworkProfile > ( networkProfiles ) ;
public class FilesystemSinkTopology { /** * All Heron topologies require a main function that defines the topology ' s behavior * at runtime */ public static void main ( String [ ] args ) throws Exception { } }
Builder processingGraphBuilder = Builder . newBuilder ( ) ; // Creates a temporary file to write output into . File file = File . createTempFile ( "filesystem-sink-example" , ".tmp" ) ; LOG . info ( String . format ( "Ready to write to file %s" , file . getAbsolutePath ( ) ) ) ; processingGraphBuilder . newSource ( ( )...
public class KeyUtils { /** * Gets the key string , without rootPrefix nor Alias * @ param query the query * @ param result the result * @ param typeNames the type names * @ return the key string */ public static String getKeyString ( Query query , Result result , List < String > typeNames ) { } }
StringBuilder sb = new StringBuilder ( ) ; addMBeanIdentifier ( query , result , sb ) ; addSeparator ( sb ) ; addTypeName ( query , result , typeNames , sb ) ; addKeyString ( query , result , sb ) ; return sb . toString ( ) ;
public class RetriableStream { /** * Calls commit ( ) and if successful runs the post commit task . */ private void commitAndRun ( Substream winningSubstream ) { } }
Runnable postCommitTask = commit ( winningSubstream ) ; if ( postCommitTask != null ) { postCommitTask . run ( ) ; }
public class ValRow { /** * Creates a new ValRow by selecting elements at the specified indices . * @ param cols array of indices to select . We do not check for AIOOB errors . * @ return new ValRow object */ public ValRow slice ( int [ ] cols ) { } }
double [ ] ds = new double [ cols . length ] ; String [ ] ns = new String [ cols . length ] ; for ( int i = 0 ; i < cols . length ; ++ i ) { ds [ i ] = _ds [ cols [ i ] ] ; ns [ i ] = _names [ cols [ i ] ] ; } return new ValRow ( ds , ns ) ;
public class PFCImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public void eUnset ( int featureID ) { } }
switch ( featureID ) { case AfplibPackage . PFC__PFC_FLGS : setPFCFlgs ( PFC_FLGS_EDEFAULT ) ; return ; case AfplibPackage . PFC__TRIPLETS : getTriplets ( ) . clear ( ) ; return ; } super . eUnset ( featureID ) ;
public class Array { /** * Gets a Dictionary at the given index . Return null if the value is not an dictionary . * @ param index the index . This value must not exceed the bounds of the array . * @ return the Dictionary object . */ @ Override public Dictionary getDictionary ( int index ) { } }
synchronized ( lock ) { final Object obj = getMValue ( internalArray , index ) . asNative ( internalArray ) ; return obj instanceof Dictionary ? ( Dictionary ) obj : null ; }
public class HeadCommand { /** * Webdav Head method implementation . * @ param session current session * @ param path resouce path * @ param baseURI base uri * @ return the instance of javax . ws . rs . core . Response */ public Response head ( Session session , String path , String baseURI ) { } }
try { Node node = ( Node ) session . getItem ( path ) ; WebDavNamespaceContext nsContext = new WebDavNamespaceContext ( session ) ; URI uri = new URI ( TextUtil . escape ( baseURI + node . getPath ( ) , '%' , true ) ) ; if ( ResourceUtil . isFile ( node ) ) { Resource resource = new FileResource ( uri , node , nsContex...
public class X509ProxyCertPathValidator { /** * COMMENT enable the checkers again when ProxyPathValidator starts working ! */ protected List < CertificateChecker > getCertificateCheckers ( ) { } }
List < CertificateChecker > checkers = new ArrayList < CertificateChecker > ( ) ; checkers . add ( new DateValidityChecker ( ) ) ; checkers . add ( new UnsupportedCriticalExtensionChecker ( ) ) ; checkers . add ( new IdentityChecker ( this ) ) ; // NOTE : the ( possible ) refresh of the CRLs happens when we call getDef...
public class BigQueryConfiguration { /** * Sets the Bigquery access related fields in the JobConf for output connector . * @ param config the job configuration . * @ param projectId the project containing the table to write the results to . * @ param datasetId the dataset to write the results to . * @ param tab...
// Check preconditions . Preconditions . checkArgument ( ! Strings . isNullOrEmpty ( datasetId ) , "datasetId must not be null or empty." ) ; Preconditions . checkArgument ( ! Strings . isNullOrEmpty ( tableId ) , "tableId must not be null or empty." ) ; Preconditions . checkArgument ( ! Strings . isNullOrEmpty ( table...
public class State { /** * Perform a For Comprehension over a State , accepting 3 generating function . * This results in a four level nested internal iteration over the provided States . * < pre > * { @ code * import static com . oath . cyclops . reactor . States . forEach4; * forEach4 ( State . just ( 1 ) ,...
return this . flatMap ( in -> { State < S , R1 > a = value2 . apply ( in ) ; return a . flatMap ( ina -> { State < S , R2 > b = value3 . apply ( in , ina ) ; return b . flatMap ( inb -> { State < S , R3 > c = value4 . apply ( in , ina , inb ) ; return c . map ( in2 -> { return yieldingFunction . apply ( in , ina , inb ...
public class CmsUserQueryBuilder { /** * Adds OU conditions to an SQL query . < p > * @ param select the query * @ param users the user table alias * @ param allowedOus the allowed ous */ protected void addAllowedOuCondition ( CmsSelectQuery select , TableAlias users , List < CmsOrganizationalUnit > allowedOus ) ...
if ( ( allowedOus != null ) && ! allowedOus . isEmpty ( ) ) { CmsCompositeQueryFragment ouCondition = new CmsCompositeQueryFragment ( ) ; ouCondition . setPrefix ( "(" ) ; ouCondition . setSuffix ( ")" ) ; ouCondition . setSeparator ( " OR " ) ; for ( CmsOrganizationalUnit ou : allowedOus ) { String ouName = CmsStringU...
public class SocketSystemJniTcp { /** * @ Override * public ServerSocketBar openUnixServerSocket ( PathImpl unixPath ) * throws IOException * ServerSocketBar ss = ServerSocketJni . createPath ( unixPath ) ; * return ss ; */ @ Override public SocketBar connect ( SocketBar socket , InetSocketAddress addressRemote...
try { JniSocketImpl jniSocket = null ; if ( socket instanceof JniSocketImpl ) { jniSocket = ( JniSocketImpl ) socket ; } if ( JniSocketImpl . isEnabled ( ) && ! isSSL ) { jniSocket = JniSocketImpl . connect ( jniSocket , addressRemote . getAddress ( ) . getHostAddress ( ) , addressRemote . getPort ( ) ) ; } if ( jniSoc...
public class Expressions { /** * Create a new Template expression * @ param cl type of expression * @ param template template * @ param args template parameters * @ return template expression */ public static < T extends Comparable < ? > > TimeTemplate < T > timeTemplate ( Class < ? extends T > cl , String temp...
return timeTemplate ( cl , createTemplate ( template ) , args ) ;
public class Utils { /** * Encode the given string by replacing characters not legal in URLs with the * appropriate escape sequences . For example " A B " becomes " A % 20B " . If a null string * is passed , the result is null . This method calls URLEncoder . decode ( " UTF - 8 " , strIn ) , * which converts non ...
// Null begets null . if ( strIn == null ) { return null ; } try { return URLEncoder . encode ( strIn , "UTF-8" ) ; } catch ( UnsupportedEncodingException e ) { // This should never happen since UTF - 8 always exists . throw new IllegalArgumentException ( "UTF-8" ) ; }
public class Builder { /** * Adds a dependency to the RPM package . This dependency version will be marked as the maximum * allowed , and the package will require the named dependency with this version or lower at * install time . * @ param name the name of the dependency . * @ param version the version identif...
int flag = LESS | EQUAL ; if ( name . toString ( ) . startsWith ( "rpmlib(" ) ) { flag = flag | RPMLIB ; } addDependency ( name , version , flag ) ;
public class ParallelEngine { /** * Sets the wait mode , the number of units and their scale before the wait * for the background activities times out . * @ param mode * the wait mode : whether it should wait for all background activities to * complete or it will exit as soon as one of them is complete . * @ ...
this . mode = mode ; this . timeout = timeout ; this . unit = unit ; return this ;