signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class AccessibilityNodeInfoUtils { /** * Gets the text of a < code > node < / code > by returning the content description * ( if available ) or by returning the text . * @ param node The node . * @ return The node text . */ public static CharSequence getNodeText ( AccessibilityNodeInfoCompat node ) { } }
if ( node == null ) { return null ; } // Prefer content description over text . // TODO : Why are we checking the trimmed length ? final CharSequence contentDescription = node . getContentDescription ( ) ; if ( ! TextUtils . isEmpty ( contentDescription ) && ( TextUtils . getTrimmedLength ( contentDescription ) > 0 ) )...
public class CRFClassifier { /** * Makes a CRFDatum by producing features and a label from input data at a * specific position , using the provided factory . * @ param info * The input data * @ param loc * The position to build a datum at * @ param featureFactory * The FeatureFactory to use to extract fea...
pad . set ( AnswerAnnotation . class , flags . backgroundSymbol ) ; PaddedList < IN > pInfo = new PaddedList < IN > ( info , pad ) ; ArrayList < List < String > > features = new ArrayList < List < String > > ( ) ; // for ( int i = 0 ; i < windowSize ; i + + ) { // List featuresC = new ArrayList ( ) ; // for ( int j = 0...
public class DraweeHolder { /** * Sets a new controller . */ public void setController ( @ Nullable DraweeController draweeController ) { } }
boolean wasAttached = mIsControllerAttached ; if ( wasAttached ) { detachController ( ) ; } // Clear the old controller if ( isControllerValid ( ) ) { mEventTracker . recordEvent ( Event . ON_CLEAR_OLD_CONTROLLER ) ; mController . setHierarchy ( null ) ; } mController = draweeController ; if ( mController != null ) { m...
public class HeightSpec { /** * Get the effective height based on the passed available height . This may not * be called for star or auto height elements . * @ param fAvailableHeight * The available height . * @ return The effective height to use . */ @ Nonnegative public float getEffectiveValue ( final float f...
switch ( m_eType ) { case ABSOLUTE : return Math . min ( m_fValue , fAvailableHeight ) ; case PERCENTAGE : return fAvailableHeight * m_fValue / 100 ; default : throw new IllegalStateException ( "Unsupported: " + m_eType + " - must be calculated outside!" ) ; }
public class DefaultGrailsControllerClass { /** * Invokes the controller action for the given name on the given controller instance * @ param controller The controller instance * @ param action The action name * @ return The result of the action * @ throws Throwable */ @ Override public Object invoke ( Object c...
if ( action == null ) action = this . defaultActionName ; ActionInvoker handle = actions . get ( action ) ; if ( handle == null ) throw new IllegalArgumentException ( "Invalid action name: " + action ) ; return handle . invoke ( controller ) ;
public class RebalanceController { /** * Executes the rebalance plan . Does so batch - by - batch . Between each batch , * status is dumped to logger . info . * @ param rebalancePlan */ private void executePlan ( RebalancePlan rebalancePlan ) { } }
logger . info ( "Starting to execute rebalance Plan!" ) ; int batchCount = 0 ; int partitionStoreCount = 0 ; long totalTimeMs = 0 ; List < RebalanceBatchPlan > entirePlan = rebalancePlan . getPlan ( ) ; int numBatches = entirePlan . size ( ) ; int numPartitionStores = rebalancePlan . getPartitionStoresMoved ( ) ; for (...
public class BNFHeadersImpl { /** * This method is used to skip leading CRLF characters . It will stop when * it finds a non - CRLF character , runs out of data , or finds too many CRLFs * @ param buffer * @ return TokenCodes - - MOREDATA means it ran out of buffer information , * DELIM means it found a non - C...
int maxCRLFs = 33 ; // limit is the max number of CRLFs to skip if ( this . bytePosition >= this . byteLimit ) { if ( ! fillByteCache ( buffer ) ) { // no more data return TokenCodes . TOKEN_RC_MOREDATA ; } } byte b = this . byteCache [ this . bytePosition ++ ] ; for ( int i = 0 ; i < maxCRLFs ; i ++ ) { if ( - 1 == b ...
public class ServerChannelUpdater { /** * Removes a permission overwrite for the given entity . * @ param < T > The type of entity to hold the permission , usually < code > User < / code > or < code > Role < / code > * @ param permissionable The entity which permission overwrite should be removed . * @ return The...
delegate . removePermissionOverwrite ( permissionable ) ; return this ;
public class ComputerVisionImpl { /** * This operation extracts a rich set of visual features based on the image content . * @ param image An image stream . * @ param visualFeatures A string indicating what visual feature types to return . Multiple values should be comma - separated . Valid visual feature types inc...
if ( this . client . endpoint ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.endpoint() is required and cannot be null." ) ; } if ( image == null ) { throw new IllegalArgumentException ( "Parameter image is required and cannot be null." ) ; } Validator . validate ( visualFeatures ) ; String...
public class JvmTypesBuilder { /** * / * @ Nullable */ @ Deprecated public JvmAnnotationReference toAnnotation ( /* @ Nullable */ EObject sourceElement , /* @ Nullable */ Class < ? > annotationType ) { } }
return toAnnotation ( sourceElement , annotationType , null ) ;
public class NodeCache { /** * NOTE : this is a BLOCKING method . Completely rebuild the internal cache by querying * for all needed data WITHOUT generating any events to send to listeners . * @ throws Exception errors */ public void rebuild ( ) throws Exception { } }
Preconditions . checkState ( state . get ( ) == State . STARTED , "Not started" ) ; internalRebuild ( ) ; reset ( ) ;
public class NetworkBuffer { /** * Creates a new configuration for the network buffer identified by the installation * ID . * The configuration is added to the network buffer specified by the installation ID . * If a network buffer with the supplied installation ID does not exist , it will be * created . If < c...
NetworkBuffer b = getBuffer ( installationID ) ; if ( b == null ) b = createBuffer ( installationID ) ; return b . createConfiguration ( link ) ;
public class HttpSupport { /** * Parses name from hash syntax . * @ param param something like this : < code > person [ account ] < / code > * @ return name of hash key : < code > account < / code > */ private static String parseHashName ( String param ) { } }
Matcher matcher = hashPattern . matcher ( param ) ; String name = null ; while ( matcher . find ( ) ) { name = matcher . group ( 0 ) ; } return name == null ? null : name . substring ( 1 , name . length ( ) - 1 ) ;
public class CRLExtensions { /** * Get the extension with this alias . * @ param alias the identifier string for the extension to retrieve . */ public Extension get ( String alias ) { } }
X509AttributeName attr = new X509AttributeName ( alias ) ; String name ; String id = attr . getPrefix ( ) ; if ( id . equalsIgnoreCase ( X509CertImpl . NAME ) ) { // fully qualified int index = alias . lastIndexOf ( "." ) ; name = alias . substring ( index + 1 ) ; } else name = alias ; return map . get ( name ) ;
public class UrlSyntaxProviderImpl { /** * Determine the { @ link UrlState } to use for the targeted portlet window */ protected UrlState determineUrlState ( final IPortletWindow portletWindow , final IPortletUrlBuilder targetedPortletUrlBuilder ) { } }
final WindowState requestedWindowState ; if ( targetedPortletUrlBuilder == null ) { requestedWindowState = null ; } else { requestedWindowState = targetedPortletUrlBuilder . getWindowState ( ) ; } return determineUrlState ( portletWindow , requestedWindowState ) ;
public class VirtualNetworkGatewaysInner { /** * Creates or updates a virtual network gateway in the specified resource group . * @ param resourceGroupName The name of the resource group . * @ param virtualNetworkGatewayName The name of the virtual network gateway . * @ param parameters Parameters supplied to cre...
return beginCreateOrUpdateWithServiceResponseAsync ( resourceGroupName , virtualNetworkGatewayName , parameters ) . map ( new Func1 < ServiceResponse < VirtualNetworkGatewayInner > , VirtualNetworkGatewayInner > ( ) { @ Override public VirtualNetworkGatewayInner call ( ServiceResponse < VirtualNetworkGatewayInner > res...
public class WsHandshakeValidator { /** * Allow subclasses to register themselves as validators for specific versions of * the wire protocol . * @ param wireProtocolVersion the version of the protocol * @ param validator the validator */ private void register ( WebSocketWireProtocol wireProtocolVersion , WsHandsh...
if ( wireProtocolVersion == null ) { throw new NullPointerException ( "wireProtocolVersion" ) ; } if ( validator == null ) { throw new NullPointerException ( "validator" ) ; } WsHandshakeValidator existingValidator = handshakeValidatorsByWireProtocolVersion . put ( wireProtocolVersion , validator ) ; logger . trace ( "...
public class VarExporter { /** * Write all variables , one per line , to the given writer , in the format " name = value " . * Will escape values for compatibility with loading into { @ link java . util . Properties } . * @ param out writer * @ param includeDoc true if documentation comments should be included */...
visitVariables ( new Visitor ( ) { public void visit ( Variable var ) { var . write ( out , includeDoc ) ; } } ) ;
public class AbstractInstallPlanJob { /** * Install provided extension . * @ param targetDependency used to search the extension to install in remote repositories * @ param dependency indicate if the extension is installed as a dependency * @ param namespace the namespace where to install the extension * @ para...
this . progressManager . pushLevelProgress ( 2 , this ) ; try { this . progressManager . startStep ( this ) ; // Check if the extension is already in local repository Extension extension = resolveExtension ( targetDependency ) ; // Rewrite the extension Extension rewrittenExtension ; if ( getRequest ( ) . getRewriter (...
public class SwaptionSingleCurve { /** * This method returns the value random variable of the product within the specified model , evaluated at a given evalutationTime . * Note : For a lattice this is often the value conditional to evalutationTime , for a Monte - Carlo simulation this is the ( sum of ) value discount...
/* * Calculate value of the swap at exercise date on each path ( beware of perfect foresight - all rates are simulationTime = exerciseDate ) */ RandomVariable valueOfSwapAtExerciseDate = model . getRandomVariableForConstant ( /* fixingDates [ fixingDates . length - 1 ] , */ 0.0 ) ; // Calculate the value of the swap by...
public class StatusConsoleListener { /** * Writes status messages to the console . * @ param data The StatusData . */ @ Override public void log ( final StatusData data ) { } }
if ( ! filtered ( data ) ) { stream . println ( data . getFormattedStatus ( ) ) ; }
public class QueryChemObject { /** * This should be triggered by an method that changes the content of an object * to that the registered listeners can react to it . This is a version of * notifyChanged ( ) which allows to propagate a change event while preserving * the original origin . * @ param evt A ChemObj...
if ( getNotification ( ) && getListenerCount ( ) > 0 ) { List < IChemObjectListener > listeners = lazyChemObjectListeners ( ) ; for ( Object listener : listeners ) { ( ( IChemObjectListener ) listener ) . stateChanged ( evt ) ; } }
public class SwapAnnuity { /** * Function to calculate an ( idealized ) swap annuity for a given schedule and discount curve . * Note that , the value returned is divided by the discount factor at evaluation . * This matters , if the discount factor at evaluationTime is not equal to 1.0. * @ param evaluationTime ...
double value = 0.0 ; for ( int periodIndex = 0 ; periodIndex < schedule . getNumberOfPeriods ( ) ; periodIndex ++ ) { double paymentDate = schedule . getPayment ( periodIndex ) ; if ( paymentDate <= evaluationTime ) { continue ; } double periodLength = schedule . getPeriodLength ( periodIndex ) ; double discountFactor ...
public class CoordinationTransformer { /** * Transforms t if it contains a coordination in a flat structure ( CCtransform ) * and transforms UCP ( UCPtransform ) . * @ param t a tree to be transformed * @ return t transformed */ public Tree transformTree ( Tree t ) { } }
if ( VERBOSE ) { System . err . println ( "Input to CoordinationTransformer: " + t ) ; } Tree tx = tn . transformTree ( t ) ; if ( VERBOSE ) { System . err . println ( "After DependencyTreeTransformer: " + tx ) ; } if ( tx == null ) { return tx ; } Tree tt = UCPtransform ( tx ) ; if ( VERBOSE ) { System . err . printl...
public class ScriptingUtils { /** * Execute groovy script t . * @ param < T > the type parameter * @ param groovyScript the groovy script * @ param methodName the method name * @ param args the args * @ param clazz the clazz * @ param failOnError the fail on error * @ return the t */ @ SneakyThrows public...
if ( groovyScript == null || StringUtils . isBlank ( methodName ) ) { return null ; } try { return AccessController . doPrivileged ( ( PrivilegedAction < T > ) ( ) -> getGroovyResult ( groovyScript , methodName , args , clazz , failOnError ) ) ; } catch ( final Exception e ) { var cause = ( Throwable ) null ; if ( e in...
public class OptimizerOptions { /** * < code > optional . tensorflow . OptimizerOptions . GlobalJitLevel global _ jit _ level = 5 ; < / code > */ public org . tensorflow . framework . OptimizerOptions . GlobalJitLevel getGlobalJitLevel ( ) { } }
org . tensorflow . framework . OptimizerOptions . GlobalJitLevel result = org . tensorflow . framework . OptimizerOptions . GlobalJitLevel . valueOf ( globalJitLevel_ ) ; return result == null ? org . tensorflow . framework . OptimizerOptions . GlobalJitLevel . UNRECOGNIZED : result ;
public class Ifc2x3tc1FactoryImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public IfcThermalLoadSourceEnum createIfcThermalLoadSourceEnumFromString ( EDataType eDataType , String initialValue ) { } }
IfcThermalLoadSourceEnum result = IfcThermalLoadSourceEnum . get ( initialValue ) ; if ( result == null ) throw new IllegalArgumentException ( "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType . getName ( ) + "'" ) ; return result ;
public class Apptentive { /** * This method takes a unique event string , stores a record of that event having been visited , * determines if there is an interaction that is able to run for this event , and then runs it . If * more than one interaction can run , then the most appropriate interaction takes precedenc...
engage ( context , event , callback , null , ( ExtendedData [ ] ) null ) ;
public class VirtualMachineScaleSetsInner { /** * Upgrades one or more virtual machines to the latest SKU set in the VM scale set model . * @ param resourceGroupName The name of the resource group . * @ param vmScaleSetName The name of the VM scale set . * @ param instanceIds The virtual machine scale set instanc...
return ServiceFuture . fromResponse ( beginUpdateInstancesWithServiceResponseAsync ( resourceGroupName , vmScaleSetName , instanceIds ) , serviceCallback ) ;
public class nstimer { /** * Use this API to unset the properties of nstimer resource . * Properties that need to be unset are specified in args array . */ public static base_response unset ( nitro_service client , nstimer resource , String [ ] args ) throws Exception { } }
nstimer unsetresource = new nstimer ( ) ; unsetresource . name = resource . name ; unsetresource . interval = resource . interval ; unsetresource . unit = resource . unit ; unsetresource . comment = resource . comment ; return unsetresource . unset_resource ( client , args ) ;
public class EventSourceImpl { /** * Removes the given EventSource listener from the listener list . * @ param listener * EventSourceListener to be unregistered */ public void removeEventSourceListener ( EventSourceListener listener ) { } }
LOG . entering ( CLASS_NAME , "removeEventSourceListener" , listener ) ; if ( listener == null ) { throw new NullPointerException ( "listener" ) ; } listeners . remove ( listener ) ;
public class ZoneMeta { /** * Returns an immutable set of canonical system time zone IDs that * are associated with actual locations . * The result set is a subset of { @ link # getCanonicalSystemZIDs ( ) } , but not * including IDs , such as " Etc / GTM + 5 " . * @ return An immutable set of canonical system t...
Set < String > canonicalSystemLocationZones = null ; if ( REF_CANONICAL_SYSTEM_LOCATION_ZONES != null ) { canonicalSystemLocationZones = REF_CANONICAL_SYSTEM_LOCATION_ZONES . get ( ) ; } if ( canonicalSystemLocationZones == null ) { Set < String > canonicalSystemLocationIDs = new TreeSet < String > ( ) ; String [ ] all...
public class FLVWriter { /** * Create the stream output file ; the flv itself . * @ throws IOException */ private void createOutputFile ( ) throws IOException { } }
this . fileChannel = Files . newByteChannel ( Paths . get ( filePath ) , StandardOpenOption . CREATE , StandardOpenOption . WRITE , StandardOpenOption . TRUNCATE_EXISTING ) ;
public class Database { /** * Sends a text message ( which will probably create a write access ) to the Neo4j cluster . * @ param message binary json message ( usually json format ) * @ param server server that shall be used to send the message * @ throws ConnectionNotAvailableException no connection to server ex...
DataConnection connection = server . getConnection ( ) ; if ( connection == null ) { throw new ConnectionNotAvailableException ( server ) ; } connection . send ( message ) ; server . returnConnection ( connection ) ;
public class DomainTransformers { /** * Initialize the domain registry . * @ param registry the domain registry */ public static void initializeDomainRegistry ( final TransformerRegistry registry ) { } }
// The chains for transforming will be as follows // For JBoss EAP : 8.0.0 - > 5.0.0 - > 4.0.0 - > 1.8.0 - > 1.7.0 - > 1.6.0 - > 1.5.0 registerRootTransformers ( registry ) ; registerChainedManagementTransformers ( registry ) ; registerChainedServerGroupTransformers ( registry ) ; registerProfileTransformers ( registry...
public class SibRaEndpointActivation { /** * Returns a connection to the given messaging engine . * @ param messagingEngine * the messaging engine for which a connection is required * @ return the connection * @ throws IllegalStateException * if the endpoint is no longer active * @ throws ResourceException ...
final String methodName = "getConnection" ; if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . entry ( this , TRACE , methodName , messagingEngine ) ; } SibRaMessagingEngineConnection connection ; if ( _active ) { synchronized ( _connections ) { /* * Do we already have a connection ...
public class SessionDataManager { /** * Return item data by internal < b > qpath < / b > in this transient storage then in workspace * container . * @ param path * - absolute path * @ return existed item data or null if not found * @ throws RepositoryException * @ see org . exoplatform . services . jcr . da...
NodeData parent = ( NodeData ) getItemData ( Constants . ROOT_UUID ) ; if ( path . equals ( Constants . ROOT_PATH ) ) { return parent ; } QPathEntry [ ] relPathEntries = path . getRelPath ( path . getDepth ( ) ) ; return getItemData ( parent , relPathEntries , ItemType . UNKNOWN ) ;
public class JsonStreamWriter { /** * Write a string attribute . * @ param name attribute name * @ param value attribute value */ public void writeNameValuePair ( String name , String value ) throws IOException { } }
internalWriteNameValuePair ( name , escapeString ( value ) ) ;
public class Properties { /** * Loads all of the properties represented by the XML document on the * specified input stream into this properties table . * < p > The XML document must have the following DOCTYPE declaration : * < pre > * & lt ; ! DOCTYPE properties SYSTEM " http : / / java . sun . com / dtd / pro...
if ( in == null ) throw new NullPointerException ( ) ; XMLUtils . load ( this , in ) ; in . close ( ) ;
public class Strings { /** * XML - escapes all the elements in the target list . * @ param target the list of Strings to be escaped . * If non - String objects , toString ( ) will be called . * @ return a List with the result of each * each element of the target . * @ since 2.0.9 */ public List < String > lis...
if ( target == null ) { return null ; } final List < String > result = new ArrayList < String > ( target . size ( ) + 2 ) ; for ( final Object element : target ) { result . add ( escapeXml ( element ) ) ; } return result ;
public class CleverTapAPI { /** * Session */ private void clearIJ ( Context context ) { } }
final SharedPreferences prefs = StorageHelper . getPreferences ( context , Constants . NAMESPACE_IJ ) ; final SharedPreferences . Editor editor = prefs . edit ( ) ; editor . clear ( ) ; StorageHelper . persist ( editor ) ;
public class CmsUserOverviewDialog { /** * Calls the switch user method of the SessionManager . < p > * @ return the direct edit patch * @ throws CmsException if something goes wrong */ public String actionSwitchUser ( ) throws CmsException { } }
try { CmsSessionManager sessionManager = OpenCms . getSessionManager ( ) ; CmsUser user = getCms ( ) . readUser ( new CmsUUID ( getJsp ( ) . getRequest ( ) . getParameter ( "userid" ) ) ) ; return sessionManager . switchUser ( getCms ( ) , getJsp ( ) . getRequest ( ) , user ) ; } catch ( CmsException e ) { String toolP...
public class DescribeTargetHealthResult { /** * Information about the health of the targets . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setTargetHealthDescriptions ( java . util . Collection ) } or * { @ link # withTargetHealthDescriptions ( java . ut...
if ( this . targetHealthDescriptions == null ) { setTargetHealthDescriptions ( new java . util . ArrayList < TargetHealthDescription > ( targetHealthDescriptions . length ) ) ; } for ( TargetHealthDescription ele : targetHealthDescriptions ) { this . targetHealthDescriptions . add ( ele ) ; } return this ;
public class Rule { /** * If there are only properties that should be inlined . * @ param formatter current formatter * @ return true , if only inline */ boolean hasOnlyInlineProperties ( CssFormatter formatter ) { } }
for ( Formattable prop : properties ) { if ( prop instanceof Mixin ) { return false ; } } for ( Rule rule : subrules ) { if ( rule . isValidCSS ( formatter ) && rule . isInlineRule ( formatter ) ) { return false ; } } return true ;
public class AltsHandshakerClient { /** * Processes the next bytes in a handshake . A GeneralSecurityException is thrown if the handshaker * service is interrupted or fails . Note that isFinished ( ) must be false before this function is * called . * @ param inBytes the bytes received from the peer . * @ return...
Preconditions . checkState ( ! isFinished ( ) , "Handshake has already finished." ) ; HandshakerReq . Builder req = HandshakerReq . newBuilder ( ) . setNext ( NextHandshakeMessageReq . newBuilder ( ) . setInBytes ( ByteString . copyFrom ( inBytes . duplicate ( ) ) ) . build ( ) ) ; HandshakerResp resp ; try { resp = ha...
public class FileUtils { /** * Create temp file file . * @ param context the context * @ return the file */ @ SuppressWarnings ( "ResultOfMethodCallIgnored, unused" ) public static File createTempFile ( Context context ) { } }
String timeStamp = new SimpleDateFormat ( "yyyyMMdd_HHmmssSSS" , Locale . US ) . format ( new Date ( ) ) ; String tempFileName = PREFIX + timeStamp + "_" ; File cacheDir = context . getCacheDir ( ) ; if ( ! cacheDir . exists ( ) ) { cacheDir . mkdir ( ) ; } return new File ( cacheDir , tempFileName + EXTENSION ) ;
public class WeightedReservoirSampler { /** * Returns an integer at random , weighted according to its index * @ param weights weights to sample from * @ return index chosen according to the weight supplied */ public int randomIndexChoice ( List < Integer > weights ) { } }
int result = 0 , index ; double maxKey = 0.0 ; double u , key ; int weight ; for ( ListIterator < Integer > it = weights . listIterator ( ) ; it . hasNext ( ) ; ) { index = it . nextIndex ( ) ; weight = it . next ( ) ; u = random . nextDouble ( ) ; key = Math . pow ( u , ( 1.0 / weight ) ) ; // Protect from zero divisi...
public class DateType { /** * The value that can be set is a Date , a DateTime or a String * yyyy - MM - dd ' T ' HH : mm : ss . SSSZZ . It will be normalized to ISO Calender with * TimeZone from SystemAttribute Admin _ Common _ DataBaseTimeZone . In case that * the SystemAttribute is missing UTC will be used . ...
final Timestamp ret ; if ( _value == null || _value . length == 0 || _value [ 0 ] == null ) { ret = null ; } else { DateTime dateTime = new DateTime ( ) ; if ( _value [ 0 ] instanceof Date ) { dateTime = new DateTime ( _value [ 0 ] ) ; } else if ( _value [ 0 ] instanceof DateTime ) { dateTime = ( DateTime ) _value [ 0 ...
public class JDBCClob { /** * Writes the given Java < code > String < / code > to the < code > CLOB < / code > * value that this < code > Clob < / code > object designates at the position * < code > pos < / code > . The string will overwrite the existing characters * in the < code > Clob < / code > object startin...
if ( str == null ) { throw Util . nullArgument ( "str" ) ; } return setString ( pos , str , 0 , str . length ( ) ) ;
public class Http { /** * The output format for your data : * json _ meta - The current default format , where each payload contains a full JSON document . It contains metadata * and an " interactions " property that has an array of interactions . * json _ array - The payload is a full JSON document , but just ha...
String strFormat ; switch ( format ) { case JSON_ARRAY : strFormat = "json_array" ; break ; case JSON_NEW_LINE : strFormat = "json_new_line" ; break ; default : case JSON_META : strFormat = "json_meta" ; break ; } return setParam ( "format" , strFormat ) ;
public class AbstractScriptProvider { /** * 加载所有的脚本类 * @ param jarFiles * @ throws IOException * @ throws ClassNotFoundException * @ throws IllegalAccessException * @ throws InstantiationException */ protected final void loadScirptClass ( ) throws Exception { } }
if ( state == State . loading ) { return ; } rwLock . writeLock ( ) . lock ( ) ; try { state = State . loading ; ScriptClassLoader loader = loadClassByLoader ( ) ; Set < Class < ? > > allClass = loader . findedClass ; Set < Class < ? extends T > > scriptClass = findScriptClass ( allClass ) ; Map < Integer , Class < ? e...
public class WDTimerImpl { /** * Ping a watchdog . * @ throws IOException */ @ Override public void heartbeat ( ) throws IOException { } }
isOpen ( ) ; int ret = WDT . ping ( fd ) ; if ( ret < 0 ) { throw new IOException ( "Heartbeat error. File " + filename + " got " + ret + " back." ) ; }
public class ReactionSet { /** * Adds an reaction to this container . * @ param reaction The reaction to be added to this container */ @ Override public void addReaction ( IReaction reaction ) { } }
if ( reactionCount + 1 >= reactions . length ) growReactionArray ( ) ; reactions [ reactionCount ] = reaction ; reactionCount ++ ;
public class PairSet { /** * Gets the set of transactions in { @ link # allTransactions ( ) } that contains * at least one item * @ return the set of transactions in { @ link # allTransactions ( ) } that * contains at least one item */ public IndexedSet < T > involvedTransactions ( ) { } }
IndexedSet < T > res = allTransactions . empty ( ) ; res . indices ( ) . addAll ( matrix . involvedRows ( ) ) ; return res ;
public class GobblinAWSUtils { /** * Initiates an orderly shutdown in which previously submitted * tasks are executed , but no new tasks are accepted . * Invocation has no additional effect if already shut down . * This also blocks until all tasks have completed execution * request , or the timeout occurs , or ...
executorService . shutdown ( ) ; if ( ! executorService . awaitTermination ( DEFAULT_EXECUTOR_SERVICE_SHUTDOWN_TIME_IN_MINUTES , TimeUnit . MINUTES ) ) { logger . warn ( "Executor service shutdown timed out." ) ; List < Runnable > pendingTasks = executorService . shutdownNow ( ) ; logger . warn ( String . format ( "%s ...
public class MtasSolrSearchComponent { /** * ( non - Javadoc ) * @ see * org . apache . solr . handler . component . SearchComponent # process ( org . apache . solr . * handler . component . ResponseBuilder ) */ @ Override public void process ( ResponseBuilder rb ) throws IOException { } }
// System . out // . println ( System . nanoTime ( ) + " - " + Thread . currentThread ( ) . getId ( ) // + " - " + rb . req . getParams ( ) . getBool ( ShardParams . IS _ SHARD , false ) // + " PROCESS " + rb . stage + " " + rb . req . getParamString ( ) ) ; MtasSolrStatus solrStatus = Objects . requireNonNull ( ( Mtas...
public class IOUtil { /** * Parse the specified Reader line by line . * @ param reader * @ param lineOffset * @ param count * @ param processThreadNum new threads started to parse / process the lines / records * @ param queueSize size of queue to save the processing records / lines loaded from source data . D...
Iterables . parse ( new LineIterator ( reader ) , lineOffset , count , processThreadNum , queueSize , lineParser , onComplete ) ;
public class HttpConnectionUtil { /** * Logs details about the request error . * @ param response * http response * @ throws IOException * on IO error * @ throws ParseException * on parse error */ public static void handleError ( HttpResponse response ) throws ParseException , IOException { } }
log . debug ( "{}" , response . getStatusLine ( ) . toString ( ) ) ; HttpEntity entity = response . getEntity ( ) ; if ( entity != null ) { log . debug ( "{}" , EntityUtils . toString ( entity ) ) ; }
public class CPSpecificationOptionWrapper { /** * Returns the localized description of this cp specification option in the language , optionally using the default language if no localization exists for the requested language . * @ param languageId the ID of the language * @ param useDefault whether to use the defau...
return _cpSpecificationOption . getDescription ( languageId , useDefault ) ;
public class GalleryWidgetPresenter { /** * - It ' s refresh rate is greater than 60 seconds ( avoid tons of notifications in " real - time " scenarios ) */ private void onDataSetModifiedEvent ( @ Observes DataSetModifiedEvent event ) { } }
checkNotNull ( "event" , event ) ; DataSetDef def = event . getDataSetDef ( ) ; String targetUUID = event . getDataSetDef ( ) . getUUID ( ) ; TimeAmount timeFrame = def . getRefreshTimeAmount ( ) ; boolean noRealTime = timeFrame == null || timeFrame . toMillis ( ) > 60000 ; if ( ( ! def . isRefreshAlways ( ) || noRealT...
public class StreamHelpers { /** * Reads at most ' maxLength ' bytes from the given input stream , as long as the stream still has data to serve . * @ param stream The InputStream to read from . * @ param target The target array to write data to . * @ param startOffset The offset within the target array to start ...
Preconditions . checkNotNull ( stream , "stream" ) ; Preconditions . checkNotNull ( stream , "target" ) ; Preconditions . checkElementIndex ( startOffset , target . length , "startOffset" ) ; Exceptions . checkArgument ( maxLength >= 0 , "maxLength" , "maxLength must be a non-negative number." ) ; int totalBytesRead = ...
public class ApiOvhHorizonView { /** * Link your Active Directory to your CDI Active Directory * REST : POST / horizonView / { serviceName } / domainTrust * @ param activeDirectoryIP [ required ] IP of your Active Directory * @ param domain [ required ] Domain of your active directory ( for example domain . local...
String qPath = "/horizonView/{serviceName}/domainTrust" ; StringBuilder sb = path ( qPath , serviceName ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "activeDirectoryIP" , activeDirectoryIP ) ; addBody ( o , "dns1" , dns1 ) ; addBody ( o , "dns2" , dns2 ) ; addBody ( o , "domai...
public class MetadataReferenceDao { /** * { @ inheritDoc } * Update using the foreign key columns */ @ Override public int update ( MetadataReference metadataReference ) throws SQLException { } }
UpdateBuilder < MetadataReference , Void > ub = updateBuilder ( ) ; ub . updateColumnValue ( MetadataReference . COLUMN_REFERENCE_SCOPE , metadataReference . getReferenceScope ( ) . getValue ( ) ) ; ub . updateColumnValue ( MetadataReference . COLUMN_TABLE_NAME , metadataReference . getTableName ( ) ) ; ub . updateColu...
public class MultiChoiceListPreference { /** * Creates and returns a listener , which allows to observe when list items are selected or * unselected by the user . * @ return The listener , which has been created , as an instance of the type { @ link * OnMultiChoiceClickListener } */ private OnMultiChoiceClickList...
return new OnMultiChoiceClickListener ( ) { @ Override public void onClick ( final DialogInterface dialog , final int which , final boolean isChecked ) { if ( isChecked ) { selectedIndices . add ( which ) ; } else { selectedIndices . remove ( which ) ; } } } ;
public class DocumentUrl { /** * Get Resource Url for GetDocument * @ param documentId Unique identifier for a document , used by content and document calls . Document IDs are associated with document types , document type lists , sites , and tenants . * @ param documentListName Name of content documentListName to ...
UrlFormatter formatter = new UrlFormatter ( "/api/content/documentlists/{documentListName}/documents/{documentId}?includeInactive={includeInactive}&responseFields={responseFields}" ) ; formatter . formatUrl ( "documentId" , documentId ) ; formatter . formatUrl ( "documentListName" , documentListName ) ; formatter . for...
public class State { /** * { @ inheritDoc } */ @ Override public < B > State < S , B > pure ( B b ) { } }
return state ( s -> tuple ( b , s ) ) ;
public class GraphLoader { /** * Method for loading a weighted graph from an edge list file , where each edge ( inc . weight ) is represented by a * single line . Graph may be directed or undirected < br > * This method assumes that edges are of the format : { @ code fromIndex < delim > toIndex < delim > edgeWeight...
Graph < String , Double > graph = new Graph < > ( numVertices , allowMultipleEdges , new StringVertexFactory ( ) ) ; EdgeLineProcessor < Double > lineProcessor = new WeightedEdgeLineProcessor ( delim , directed , ignoreLinesStartingWith ) ; try ( BufferedReader br = new BufferedReader ( new FileReader ( new File ( path...
public class Event { /** * A list of resources referenced by the event returned . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setResources ( java . util . Collection ) } or { @ link # withResources ( java . util . Collection ) } if you want to * overrid...
if ( this . resources == null ) { setResources ( new com . amazonaws . internal . SdkInternalList < Resource > ( resources . length ) ) ; } for ( Resource ele : resources ) { this . resources . add ( ele ) ; } return this ;
public class CSVLoader { /** * Load schema contents from m _ config . schema file . */ private String getSchema ( ) { } }
if ( Utils . isEmpty ( m_config . schema ) ) { m_config . schema = m_config . root + m_config . app + ".xml" ; } File schemaFile = new File ( m_config . schema ) ; if ( ! schemaFile . exists ( ) ) { logErrorThrow ( "Schema file not found: {}" , m_config . schema ) ; } StringBuilder schemaBuffer = new StringBuilder ( ) ...
public class MapModel { /** * Count the total number of raster layers in this model . * @ return number of raster layers */ private int rasterLayerCount ( ) { } }
int rasterLayerCount = 0 ; for ( int index = 0 ; index < mapInfo . getLayers ( ) . size ( ) ; index ++ ) { if ( layers . get ( index ) instanceof RasterLayer ) { rasterLayerCount ++ ; } } return rasterLayerCount ;
public class MoneyFormatterBuilder { /** * Appends the specified formatters , one used when the amount is positive , * and one when the amount is negative . * When printing , the amount is queried and the appropriate formatter is used . * When parsing , each formatter is tried , with the longest successful match ...
return appendSigned ( whenPositiveOrZero , whenPositiveOrZero , whenNegative ) ;
public class ReverseBinaryEncoder { /** * Copies the current contents of the Ion binary - encoded byte array into a * new byte array . The allocates an array of the size needed to exactly hold * the output and copies the entire byte array to it . * This makes an unchecked assumption that { { @ link # serialize ( ...
int length = myBuffer . length - myOffset ; byte [ ] bytes = new byte [ length ] ; System . arraycopy ( myBuffer , myOffset , bytes , 0 , length ) ; return bytes ;
public class MMapGraphStructure { /** * Add a new edge into the graph . * @ param e the edge that will be added into the graph . */ @ Override public void addEdge ( Edge e ) { } }
addDirectionalEdge ( e ) ; if ( e . isBidirectional ( ) ) addDirectionalEdge ( new Edge ( e . getToNodeId ( ) , e . getFromNodeId ( ) , e . getWeight ( ) ) ) ;
public class ListViewActivity { /** * Initialize RendererAdapter */ private void initAdapter ( ) { } }
RandomVideoCollectionGenerator randomVideoCollectionGenerator = new RandomVideoCollectionGenerator ( ) ; AdapteeCollection < Video > videoCollection = randomVideoCollectionGenerator . generateListAdapteeVideoCollection ( VIDEO_COUNT ) ; adapter = new RendererAdapter < Video > ( new VideoRendererBuilder ( ) , videoColle...
public class OpenAPIModelFilterAdapter { /** * { @ inheritDoc } */ @ Override public RequestBody visitRequestBody ( Context context , String key , RequestBody rb ) { } }
visitor . visitRequestBody ( context , key , rb ) ; return rb ;
public class ConfigParseOptions { /** * Set the file format . If set to null , assume { @ link ConfigSyntax # CONF } . * @ param filename * a configuration file name * @ return options with the syntax set */ public ConfigParseOptions setSyntaxFromFilename ( String filename ) { } }
ConfigSyntax syntax = ConfigImplUtil . syntaxFromExtension ( filename ) ; return setSyntax ( syntax ) ;
public class MtasSpanIntersectingQuery { /** * ( non - Javadoc ) * @ see mtas . search . spans . util . MtasSpanQuery # rewrite ( org . apache . lucene . index . * IndexReader ) */ @ Override public MtasSpanQuery rewrite ( IndexReader reader ) throws IOException { } }
MtasSpanQuery newQ1 = ( MtasSpanQuery ) q1 . rewrite ( reader ) ; MtasSpanQuery newQ2 = ( MtasSpanQuery ) q2 . rewrite ( reader ) ; if ( ! newQ1 . equals ( q1 ) || ! newQ2 . equals ( q2 ) ) { return new MtasSpanIntersectingQuery ( newQ1 , newQ2 ) . rewrite ( reader ) ; } else if ( newQ1 . equals ( newQ2 ) ) { return ne...
public class MessageCreators { /** * Adds new message creator POJO instance from type . * @ param type */ public void addType ( String type ) { } }
try { messageCreators . add ( Class . forName ( type ) . newInstance ( ) ) ; } catch ( ClassNotFoundException | IllegalAccessException e ) { throw new CitrusRuntimeException ( "Unable to access message creator type: " + type , e ) ; } catch ( InstantiationException e ) { throw new CitrusRuntimeException ( "Unable to cr...
public class V1LoggersModel { /** * { @ inheritDoc } */ @ Override public LoggersModel addLogger ( LoggerModel logger ) { } }
addChildModel ( logger ) ; _loggers . add ( logger ) ; return this ;
public class AbstractProcessor { /** * Determines the identification of a command line processor by capture the * first line of its output for a specific command . * @ param command * array of command line arguments starting with executable * name . For example , { " cl " } * @ param fallback * start of ide...
String identifier = fallback ; try { final String [ ] cmdout = CaptureStreamHandler . run ( command ) ; if ( cmdout . length > 0 ) { identifier = cmdout [ 0 ] ; } } catch ( final Throwable ex ) { identifier = fallback + ":" + ex . toString ( ) ; } return identifier ;
public class AmazonEC2Client { /** * Describes available services to which you can create a VPC endpoint . * @ param describeVpcEndpointServicesRequest * Contains the parameters for DescribeVpcEndpointServices . * @ return Result of the DescribeVpcEndpointServices operation returned by the service . * @ sample ...
request = beforeClientExecution ( request ) ; return executeDescribeVpcEndpointServices ( request ) ;
public class BlockingClient { /** * Closes the connection to the server , triggering the { @ link StreamConnection # connectionClosed ( ) } * event on the network - handling thread where all callbacks occur . */ @ Override public void closeConnection ( ) { } }
// Closes the channel , triggering an exception in the network - handling thread triggering connectionClosed ( ) try { vCloseRequested = true ; socket . close ( ) ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; }
public class ConvertBufferedImage { /** * Copies the original image into the output image . If it can ' t do a copy a new image is created and returned * @ param original Original image * @ param output ( Optional ) Storage for copy . * @ return The copied image . May be a new instance */ public static BufferedIm...
ColorModel cm = original . getColorModel ( ) ; boolean isAlphaPremultiplied = cm . isAlphaPremultiplied ( ) ; if ( output == null || original . getWidth ( ) != output . getWidth ( ) || original . getHeight ( ) != output . getHeight ( ) || original . getType ( ) != output . getType ( ) ) { WritableRaster raster = origin...
public class TimelineModel { /** * Updates all given events in the model with UI update . * @ param events collection of events to be updated * @ param timelineUpdater TimelineUpdater instance to update the events in UI */ public void updateAll ( Collection < TimelineEvent > events , TimelineUpdater timelineUpdater...
if ( events != null && ! events . isEmpty ( ) ) { for ( TimelineEvent event : events ) { update ( event , timelineUpdater ) ; } }
public class MappingServiceController { /** * Schedules a { @ link MappingJobExecution } . * @ param mappingProjectId ID of the mapping project * @ param targetEntityTypeId ID of the target entity to create or update * @ param label label of the target entity to create * @ param rawPackageId ID of the package t...
mappingProjectId = mappingProjectId . trim ( ) ; targetEntityTypeId = targetEntityTypeId . trim ( ) ; label = trim ( label ) ; String packageId = trim ( rawPackageId ) ; try { validateEntityName ( targetEntityTypeId ) ; if ( mappingService . getMappingProject ( mappingProjectId ) == null ) { throw new MolgenisDataExcep...
public class JobClient { /** * Display the stats of the cluster with per tracker details * @ throws IOException */ private void listTrackers ( ) throws IOException { } }
ClusterStatus fullStatus = jobSubmitClient . getClusterStatus ( true ) ; Collection < TaskTrackerStatus > trackers = fullStatus . getTaskTrackersDetails ( ) ; Set < String > activeTrackers = new HashSet < String > ( fullStatus . getActiveTrackerNames ( ) ) ; List < Float > mapsProgress = new ArrayList < Float > ( ) ; L...
public class GA4GHPicardRunner { /** * Starts the Picard tool process based on constructed command . * @ throws IOException */ private void startProcess ( ) throws IOException { } }
LOG . info ( "Building process" ) ; ProcessBuilder processBuilder = new ProcessBuilder ( command ) ; processBuilder . redirectError ( ProcessBuilder . Redirect . INHERIT ) ; processBuilder . redirectOutput ( ProcessBuilder . Redirect . INHERIT ) ; LOG . info ( "Starting process" ) ; process = processBuilder . start ( )...
public class CookieApplication { /** * Creates a context for the templates . * @ param request The user ' s http request * @ param response The user ' s http response * @ return the context for the templates */ public Object createContext ( ApplicationRequest request , ApplicationResponse response ) { } }
return new CookieContext ( request , response , mDomain , mPath , mIsSecure ) ;
public class RowKey { /** * Extracts the name of the metric ID contained in a row key . * @ param tsdb The TSDB to use . * @ param row The actual row key . * @ return A deferred to wait on that will return the name of the metric . * @ throws IllegalArgumentException if the row key is too short due to missing ...
if ( row == null || row . length < 1 ) { throw new IllegalArgumentException ( "Row key cannot be null or empty" ) ; } if ( row . length < Const . SALT_WIDTH ( ) + tsdb . metrics . width ( ) ) { throw new IllegalArgumentException ( "Row key is too short" ) ; } final byte [ ] id = Arrays . copyOfRange ( row , Const . SAL...
public class JmsEventTransportImpl { /** * Initialise the thread pool to have the requested number of threads available , life span of threads ( set to 0 ) not used as threads will never be eligible to die as coreSize = maxSize */ public void initThreadPool ( ) { } }
CustomizableThreadFactory ctf = new CustomizableThreadFactory ( ) ; ctf . setDaemon ( true ) ; ctf . setThreadNamePrefix ( getTransportName ( ) + "-Publisher-" ) ; threadPool = new JMXReportingThreadPoolExecutor ( threadPoolSize , threadPoolSize , 0 , TimeUnit . SECONDS , new LinkedBlockingQueue < Runnable > ( ) , ctf ...
public class WebFragmentTypeImpl { /** * Returns all < code > data - source < / code > elements * @ return list of < code > data - source < / code > */ public List < DataSourceType < WebFragmentType < T > > > getAllDataSource ( ) { } }
List < DataSourceType < WebFragmentType < T > > > list = new ArrayList < DataSourceType < WebFragmentType < T > > > ( ) ; List < Node > nodeList = childNode . get ( "data-source" ) ; for ( Node node : nodeList ) { DataSourceType < WebFragmentType < T > > type = new DataSourceTypeImpl < WebFragmentType < T > > ( this , ...
public class ExpandableExtension { /** * opens the expandable item at the given position * @ param position the global position * @ param notifyItemChanged true if we need to call notifyItemChanged . DEFAULT : false */ public void expand ( int position , boolean notifyItemChanged ) { } }
Item item = mFastAdapter . getItem ( position ) ; if ( item != null && item instanceof IExpandable ) { IExpandable expandable = ( IExpandable ) item ; // if this item is not already expanded and has sub items we go on if ( ! expandable . isExpanded ( ) && expandable . getSubItems ( ) != null && expandable . getSubItems...
public class Monitoring { /** * < pre > * Monitoring configurations for sending metrics to the producer project . * There can be multiple producer destinations . A monitored resouce type may * appear in multiple monitoring destinations if different aggregations are * needed for different sets of metrics associa...
return producerDestinations_ ;
public class SingletonCacheWriter { /** * Called when the SingletonStore discovers that the cache has become the coordinator and push in memory state has * been enabled . It might not actually push the state if there ' s an ongoing push task running , in which case will * wait for the push task to finish . */ priva...
if ( pushStateFuture == null || pushStateFuture . isDone ( ) ) { Callable < ? > task = createPushStateTask ( ) ; pushStateFuture = executor . submit ( task ) ; try { waitForTaskToFinish ( pushStateFuture , singletonConfiguration . pushStateTimeout ( ) , TimeUnit . MILLISECONDS ) ; } catch ( Exception e ) { throw new Pu...
public class AppsImpl { /** * Returns the available endpoint deployment regions and URLs . * @ param appId The application ID . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the Map & lt ; String , String & gt ; object */ public Observable < Map < String...
return listEndpointsWithServiceResponseAsync ( appId ) . map ( new Func1 < ServiceResponse < Map < String , String > > , Map < String , String > > ( ) { @ Override public Map < String , String > call ( ServiceResponse < Map < String , String > > response ) { return response . body ( ) ; } } ) ;
public class KXmlParser { /** * Read an element content spec . This is a regular expression - like pattern * of names or other content specs . The following operators are supported : * sequence : ( a , b , c ) * choice : ( a | b | c ) * optional : a ? * one or more : a + * any number : a * * The special n...
// this implementation is very lenient ; it scans for balanced parens only skip ( ) ; int c = peekCharacter ( ) ; if ( c == '(' ) { int depth = 0 ; do { if ( c == '(' ) { depth ++ ; } else if ( c == ')' ) { depth -- ; } else if ( c == - 1 ) { throw new XmlPullParserException ( "Unterminated element content spec" , this...
public class TraceOptions { /** * Returns a { @ code TraceOption } built from a lowercase base16 representation . * @ param src the lowercase base16 representation . * @ param srcOffset the offset in the buffer where the representation of the { @ code TraceOptions } * begins . * @ return a { @ code TraceOption ...
return new TraceOptions ( BigendianEncoding . byteFromBase16String ( src , srcOffset ) ) ;
public class EphemeralKey { /** * Creates an ephemeral API key for a given resource . * @ param params request parameters * @ param options request options . { @ code stripeVersion } is required when creating ephemeral * keys . it must have non - null { @ link RequestOptions # getStripeVersionOverride ( ) } . *...
if ( options . getStripeVersionOverride ( ) == null ) { throw new IllegalArgumentException ( "`stripeVersionOverride` must be specified in " + "RequestOptions with stripe version of your mobile client." ) ; } return request ( RequestMethod . POST , classUrl ( EphemeralKey . class ) , params , EphemeralKey . class , opt...
public class LibraryUtils { /** * A wrapper function of handling exceptions that have a known root cause , such as { @ link AmazonServiceException } . * @ param exceptionHandler the { @ link ExceptionHandler } to handle exceptions . * @ param progressStatus the current progress status { @ link ProgressStatus } . ...
ProcessingLibraryException exception = new ProcessingLibraryException ( message , e , progressStatus ) ; exceptionHandler . handleException ( exception ) ;
public class SslPolicy { /** * The ciphers . * @ param ciphers * The ciphers . */ public void setCiphers ( java . util . Collection < Cipher > ciphers ) { } }
if ( ciphers == null ) { this . ciphers = null ; return ; } this . ciphers = new java . util . ArrayList < Cipher > ( ciphers ) ;