signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class HistogramLikeValue { /** * adds a new value to the InApplicationMonitor , grouping it into the appropriate bin . * @ param newValue the value that should be added */ public void addValue ( long newValue ) { } }
// keep a " total " timer for all values InApplicationMonitor . getInstance ( ) . addTimerMeasurement ( timerName , newValue ) ; // keep track of the current maximum value if ( newValue > currentMaxValue ) { currentMaxValue = newValue ; } // select the bin to put this value in long binIndex ; if ( newValue > maxLimit )...
public class AbstractCli { /** * Creates a { @ code StochasticGradientTrainer } configured using the * provided options . In order to use this method , pass * { @ link CommonOptions # STOCHASTIC _ GRADIENT } to the constructor . * @ return a stochastic gradient trainer configured using any * command - line opti...
Preconditions . checkState ( opts . contains ( CommonOptions . STOCHASTIC_GRADIENT ) ) ; long iterationsOption = parsedOptions . valueOf ( sgdIterations ) ; int batchSize = numExamples ; if ( parsedOptions . has ( sgdBatchSize ) ) { batchSize = parsedOptions . valueOf ( sgdBatchSize ) ; } long numIterations = ( int ) M...
public class Difference { /** * field type changed */ private boolean matches6004 ( ApiDifference apiDiff ) { } }
throwIfMissing ( true , false , true , true ) ; if ( ! SelectorUtils . matchPath ( field , apiDiff . getAffectedField ( ) ) ) { return false ; } String [ ] args = getArgs ( apiDiff ) ; String diffFrom = args [ 0 ] ; String diffTo = args [ 1 ] ; return SelectorUtils . matchPath ( from , diffFrom ) && SelectorUtils . mat...
public class Logger { /** * Issue a formatted log message with a level of TRACE . * @ param format the format string as per { @ link String # format ( String , Object . . . ) } or resource bundle key therefor * @ param params the parameters */ public void tracef ( String format , Object ... params ) { } }
doLogf ( Level . TRACE , FQCN , format , params , null ) ;
public class XmlEscape { /** * Perform a ( configurable ) XML 1.1 < strong > escape < / strong > operation on a < tt > String < / tt > input , * writing results to a < tt > Writer < / tt > . * This method will perform an escape operation according to the specified * { @ link org . unbescape . xml . XmlEscapeType ...
escapeXml ( text , writer , XmlEscapeSymbols . XML11_SYMBOLS , type , level ) ;
public class XtextFactoryImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EObject create ( EClass eClass ) { } }
switch ( eClass . getClassifierID ( ) ) { case XtextPackage . GRAMMAR : return createGrammar ( ) ; case XtextPackage . ABSTRACT_RULE : return createAbstractRule ( ) ; case XtextPackage . ABSTRACT_METAMODEL_DECLARATION : return createAbstractMetamodelDeclaration ( ) ; case XtextPackage . GENERATED_METAMODEL : return cre...
public class AzureServiceFuture { /** * Creates a ServiceCall from a paging operation that returns a header response . * @ param first the observable to the first page * @ param next the observable to poll subsequent pages * @ param callback the client - side callback * @ param < E > the element type * @ para...
final AzureServiceFuture < List < E > > serviceCall = new AzureServiceFuture < > ( ) ; final PagingSubscriber < E > subscriber = new PagingSubscriber < > ( serviceCall , new Func1 < String , Observable < ServiceResponse < Page < E > > > > ( ) { @ Override public Observable < ServiceResponse < Page < E > > > call ( Stri...
public class FlowController { /** * Log out the current user . Goes through a custom { @ link LoginHandler } , if one has been configured in * beehive - netui - config . xml . * @ param invalidateSessions if true , the session is invalidated ( on all single - signon webapps ) ; * otherwise the session and its dat...
LoginHandler lh = Handlers . get ( getServletContext ( ) ) . getLoginHandler ( ) ; lh . logout ( getHandlerContext ( ) , invalidateSessions ) ;
public class AfplibFactoryImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public String convertFNDFtDsFlagsToString ( EDataType eDataType , Object instanceValue ) { } }
return instanceValue == null ? null : instanceValue . toString ( ) ;
public class PendingInvitation { /** * Gets the client value for this PendingInvitation . * @ return client */ public com . google . api . ads . adwords . axis . v201809 . mcm . ManagedCustomer getClient ( ) { } }
return client ;
public class SpillRecord { /** * Write this spill record to the location provided . */ public void writeToFile ( Path loc , JobConf job ) throws IOException { } }
writeToFile ( loc , job , new PureJavaCrc32 ( ) ) ;
public class FileDefinitionParser { /** * Parses the file and fills - in the resulting structure . * @ throws IOException */ private void fillIn ( ) throws IOException { } }
BufferedReader br = null ; InputStream in = null ; try { in = new FileInputStream ( this . definitionFile . getEditedFile ( ) ) ; br = new BufferedReader ( new InputStreamReader ( in , StandardCharsets . UTF_8 ) ) ; String line ; while ( ( line = nextLine ( br ) ) != null ) { int code = recognizeBlankLine ( line , this...
public class VisualStudioNETProjectWriter { /** * Get value of PreprocessorDefinitions property . * @ param compilerConfig * compiler configuration . * @ param isDebug * true if generating debug configuration . * @ return value of PreprocessorDefinitions property . */ private String getPreprocessorDefinitions...
final StringBuffer defines = new StringBuffer ( ) ; final String [ ] args = compilerConfig . getPreArguments ( ) ; for ( final String arg : args ) { if ( arg . startsWith ( "/D" ) ) { String macro = arg . substring ( 2 ) ; if ( isDebug ) { if ( macro . equals ( "NDEBUG" ) ) { macro = "_DEBUG" ; } } else { if ( macro . ...
public class Ed25519LittleEndianEncoding { /** * Decodes a given field element in its 10 byte $ 2 ^ { 25.5 } $ representation . * @ param in The 32 byte representation . * @ return The field element in its $ 2 ^ { 25.5 } $ bit representation . */ public FieldElement decode ( byte [ ] in ) { } }
long h0 = load_4 ( in , 0 ) ; long h1 = load_3 ( in , 4 ) << 6 ; long h2 = load_3 ( in , 7 ) << 5 ; long h3 = load_3 ( in , 10 ) << 3 ; long h4 = load_3 ( in , 13 ) << 2 ; long h5 = load_4 ( in , 16 ) ; long h6 = load_3 ( in , 20 ) << 7 ; long h7 = load_3 ( in , 23 ) << 5 ; long h8 = load_3 ( in , 26 ) << 4 ; long h9 =...
public class MapStoredSessionProviderService { /** * ( non - Javadoc ) * @ see * org . exoplatform . services . jcr . ext . app . SessionProviderService # removeSessionProvider ( java . lang * . Object ) */ public void removeSessionProvider ( Object key ) { } }
if ( providers . containsKey ( key ) ) { getSessionProvider ( key ) . close ( ) ; providers . remove ( key ) ; } if ( systemProviders . containsKey ( key ) ) { systemProviders . get ( key ) . close ( ) ; systemProviders . remove ( key ) ; }
public class AbstractLockedMessageEnumeration { /** * Method to unlock all messages which haven ' t been read * @ param incrementRedeliveryCount * @ throws SISessionDroppedException */ private void unlockAllUnread ( ) throws SIResourceException , SISessionDroppedException { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "unlockAllUnread" , new Object [ ] { new Integer ( hashCode ( ) ) , this } ) ; int unlockedMessages = 0 ; synchronized ( this ) { messageAvailable = false ; // Only unlock messages if we have reached the end of the list . if...
public class BitSieve { /** * Test probable primes in the sieve and return successful candidates . */ BigInteger retrieve ( BigInteger initValue , int certainty , java . util . Random random ) { } }
// Examine the sieve one long at a time to find possible primes int offset = 1 ; for ( int i = 0 ; i < bits . length ; i ++ ) { long nextLong = ~ bits [ i ] ; for ( int j = 0 ; j < 64 ; j ++ ) { if ( ( nextLong & 1 ) == 1 ) { BigInteger candidate = initValue . add ( BigInteger . valueOf ( offset ) ) ; if ( candidate . ...
public class ResourceGroovyMethods { /** * Creates a buffered input stream for this URL . * The default connection parameters can be modified by adding keys to the * < i > parameters map < / i > : * < ul > * < li > connectTimeout : the connection timeout < / li > * < li > readTimeout : the read timeout < / li...
return new BufferedInputStream ( configuredInputStream ( parameters , url ) ) ;
public class LinuxResourceCalculatorPlugin { /** * Test the { @ link LinuxResourceCalculatorPlugin } * @ param args */ public static void main ( String [ ] args ) { } }
LinuxResourceCalculatorPlugin plugin = new LinuxResourceCalculatorPlugin ( ) ; System . out . println ( "Physical memory Size (bytes) : " + plugin . getPhysicalMemorySize ( ) ) ; System . out . println ( "Total Virtual memory Size (bytes) : " + plugin . getVirtualMemorySize ( ) ) ; System . out . println ( "Available P...
public class ConnectivityPredicate { /** * Filter , which returns true if at least one given type occurred * @ param types int , which can have one or more types * @ return true if at least one given type occurred */ public static Predicate < Connectivity > hasType ( final int ... types ) { } }
final int [ ] extendedTypes = appendUnknownNetworkTypeToTypes ( types ) ; return new Predicate < Connectivity > ( ) { @ Override public boolean test ( @ NonNull Connectivity connectivity ) throws Exception { for ( int type : extendedTypes ) { if ( connectivity . type ( ) == type ) { return true ; } } return false ; } }...
public class BatchUpdateDaemon { /** * This allows a cache entry to be added to the BatchUpdateDaemon . * The cache entry will be added to all caches . * @ param cacheEntry The cache entry to be added . */ public synchronized void pushAliasEntry ( AliasEntry aliasEntry , DCache cache ) { } }
BatchUpdateList bul = getUpdateList ( cache ) ; bul . aliasEntryEvents . add ( aliasEntry ) ;
public class ApiOvhDomain { /** * DynHost ' logins * REST : GET / domain / zone / { zoneName } / dynHost / login * @ param login [ required ] Filter the value of login property ( like ) * @ param subDomain [ required ] Filter the value of subDomain property ( like ) * @ param zoneName [ required ] The internal ...
String qPath = "/domain/zone/{zoneName}/dynHost/login" ; StringBuilder sb = path ( qPath , zoneName ) ; query ( sb , "login" , login ) ; query ( sb , "subDomain" , subDomain ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , t2 ) ;
public class FunctionInjector { /** * Determine which , if any , of the supported types the call site is . * Constant vars are treated differently so that we don ' t break their * const - ness when we decompose the expression . Once the CONSTANT _ VAR * annotation is used everywhere instead of coding conventions ...
Node callNode = ref . callNode ; Node parent = callNode . getParent ( ) ; Node grandParent = parent . getParent ( ) ; // Verify the call site : if ( NodeUtil . isExprCall ( parent ) ) { // This is a simple call . Example : " foo ( ) ; " . return CallSiteType . SIMPLE_CALL ; } else if ( NodeUtil . isExprAssign ( grandPa...
public class CmsObject { /** * Deletes the versions from the history tables , keeping the given number of versions per resource . < p > * @ param versionsToKeep number of versions to keep , is ignored if negative * @ param versionsDeleted number of versions to keep for deleted resources , is ignored if negative *...
m_securityManager . deleteHistoricalVersions ( m_context , versionsToKeep , versionsDeleted , timeDeleted , report ) ;
public class DescribeSubscriptionFiltersResult { /** * The subscription filters . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setSubscriptionFilters ( java . util . Collection ) } or { @ link # withSubscriptionFilters ( java . util . Collection ) } * if...
if ( this . subscriptionFilters == null ) { setSubscriptionFilters ( new com . amazonaws . internal . SdkInternalList < SubscriptionFilter > ( subscriptionFilters . length ) ) ; } for ( SubscriptionFilter ele : subscriptionFilters ) { this . subscriptionFilters . add ( ele ) ; } return this ;
public class InternalInputStream { /** * This method sends Nacks for any ticks within the range * startstamp to endstamp which are in Unknown state * Those in Requested should already be being satisfied */ public void processNack ( ControlNack nm ) throws SIResourceException { } }
if ( tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "processNack" , nm ) ; long startstamp = nm . getStartTick ( ) ; long endstamp = nm . getEndTick ( ) ; synchronized ( this ) { // the following steps are performed : // (1 ) check ticks in Unknown // (2 ) create nacks when appropriate // (3 ) change Unknown ticks to R...
public class TypeUtils { /** * Sets one { @ link io . sundr . codegen . model . TypeDef } as a generic of an other . * @ param base The base type . * @ param parameters The parameter types . * @ return The generic type . */ public static TypeDef typeGenericOf ( TypeDef base , TypeParamDef ... parameters ) { } }
return new TypeDefBuilder ( base ) . withParameters ( parameters ) . build ( ) ;
public class HttpJsonSerializer { /** * Parses a timeseries data query * @ return A TSQuery with data ready to validate * @ throws JSONException if parsing failed * @ throws BadRequestException if the content was missing or parsing failed */ public TSQuery parseQueryV1 ( ) { } }
final String json = query . getContent ( ) ; if ( json == null || json . isEmpty ( ) ) { throw new BadRequestException ( HttpResponseStatus . BAD_REQUEST , "Missing message content" , "Supply valid JSON formatted data in the body of your request" ) ; } try { TSQuery data_query = JSON . parseToObject ( json , TSQuery . ...
public class ICECandidate { /** * Check if a transport candidate is usable . The transport resolver should * check if the transport candidate the other endpoint has provided is * usable . * ICE Candidate can check connectivity using UDP echo Test . */ @ Override public void check ( final List < TransportCandidate...
// TODO candidate is being checked trigger // candidatesChecking . add ( cand ) ; final ICECandidate checkingCandidate = this ; Thread checkThread = new Thread ( new Runnable ( ) { @ Override public void run ( ) { final TestResult result = new TestResult ( ) ; // Media Proxy don ' t have Echo features . // If its a rel...
public class ApplicationDefinition { /** * Parse the application definition rooted at given UNode tree and copy its contents * into this object . The root node is the " application " object , so its name is the * application name and its child nodes are definitions such as " key " , " options " , * " fields " , e...
assert appNode != null ; // Verify application name and save it . setAppName ( appNode . getName ( ) ) ; // Iterate through the application object ' s members . for ( String childName : appNode . getMemberNames ( ) ) { // See if we recognize this member . UNode childNode = appNode . getMember ( childName ) ; // " key "...
public class NNStorage { /** * Return the list of locations being used for a specific purpose . * i . e . Image or edit log storage . * @ param dirType Purpose of locations requested . * @ throws IOException */ Collection < File > getDirectories ( NameNodeDirType dirType ) throws IOException { } }
ArrayList < File > list = new ArrayList < File > ( ) ; Iterator < StorageDirectory > it = ( dirType == null ) ? dirIterator ( ) : dirIterator ( dirType ) ; for ( ; it . hasNext ( ) ; ) { StorageDirectory sd = it . next ( ) ; list . add ( sd . getRoot ( ) ) ; } return list ;
public class CommercePriceListUserSegmentEntryRelUtil { /** * Returns the first commerce price list user segment entry rel in the ordered set where commercePriceListId = & # 63 ; . * @ param commercePriceListId the commerce price list ID * @ param orderByComparator the comparator to order the set by ( optionally < ...
return getPersistence ( ) . fetchByCommercePriceListId_First ( commercePriceListId , orderByComparator ) ;
public class NetworkMonitor { /** * Get the type of network connection that the device is currently using * to connect to the internet . * @ return The type of network connection that the device is currently using . */ public NetworkConnectionType getCurrentConnectionType ( ) { } }
NetworkInfo activeNetworkInfo = getActiveNetworkInfo ( ) ; if ( activeNetworkInfo == null || ! isInternetAccessAvailable ( ) ) { return NetworkConnectionType . NO_CONNECTION ; } switch ( activeNetworkInfo . getType ( ) ) { case ConnectivityManager . TYPE_WIFI : return NetworkConnectionType . WIFI ; case ConnectivityMan...
public class GraphicsDeviceExtensions { /** * Gets the array index ( in the available { @ link GraphicsDevice } array ) of the given component is * showing on . * @ param component * the component * @ return the array index ( in the available { @ link GraphicsDevice } array ) of the given component * is showi...
final GraphicsDevice graphicsDevice = getGraphicsDeviceIsShowingOn ( component ) ; final GraphicsDevice [ ] graphicsDevices = getAvailableScreens ( ) ; for ( int i = 0 ; i < graphicsDevices . length ; i ++ ) { if ( graphicsDevices [ i ] . equals ( graphicsDevice ) ) { return i ; } } return 0 ;
public class WebUtils { /** * 执行HTTP POST请求 。 * @ param url 请求地址 * @ param ctype 请求类型 * @ param content 请求字节数组 * @ return 响应字符串 */ public static String doPost ( String url , String ctype , byte [ ] content , int connectTimeout , int readTimeout ) throws IOException { } }
return _doPost ( url , ctype , content , connectTimeout , readTimeout , null ) ;
public class AppServiceCertificateOrdersInner { /** * Retrieve the list of certificate actions . * Retrieve the list of certificate actions . * @ param resourceGroupName Name of the resource group to which the resource belongs . * @ param name Name of the certificate order . * @ throws IllegalArgumentException ...
return retrieveCertificateActionsWithServiceResponseAsync ( resourceGroupName , name ) . toBlocking ( ) . single ( ) . body ( ) ;
public class PolicyVersionMarshaller { /** * Marshall the given parameter object . */ public void marshall ( PolicyVersion policyVersion , ProtocolMarshaller protocolMarshaller ) { } }
if ( policyVersion == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( policyVersion . getVersionId ( ) , VERSIONID_BINDING ) ; protocolMarshaller . marshall ( policyVersion . getIsDefaultVersion ( ) , ISDEFAULTVERSION_BINDING ) ; protocolMar...
public class RadioChoicesListView { /** * Factory method for creating the new { @ link Label } . This method is invoked in the constructor * from the derived classes and can be overridden so users can provide their own version of a * new { @ link Label } . * @ param id * the id * @ param label * the string ...
return ComponentFactory . newLabel ( id , label ) ;
public class HeronClient { /** * Register the protobuf Message ' s name with protobuf Message */ public void registerOnMessage ( Message . Builder builder ) { } }
messageMap . put ( builder . getDescriptorForType ( ) . getFullName ( ) , builder ) ;
public class ZmqEventConsumer { @ Override protected synchronized void connect_event_channel ( ConnectionStructure cs ) throws DevFailed { } }
// Get a reference to an EventChannel for // this device server from the tango database DeviceProxy adminDevice = new DeviceProxy ( cs . channelName ) ; cs . channelName = adminDevice . fullName ( ) . toLowerCase ( ) ; // Update name with tango host DevVarLongStringArray lsa = cs . deviceData . extractLongStringArray (...
public class IntStreamEx { /** * Returns a sequential { @ code IntStreamEx } containing an * { @ link OptionalInt } value , if present , otherwise returns an empty * { @ code IntStreamEx } . * @ param optional the optional to create a stream of * @ return a stream with an { @ code OptionalInt } value if present...
return optional . isPresent ( ) ? of ( optional . getAsInt ( ) ) : empty ( ) ;
public class RequestMetadata { /** * < pre > * The IP address of the caller . * < / pre > * < code > string caller _ ip = 1 ; < / code > */ public com . google . protobuf . ByteString getCallerIpBytes ( ) { } }
java . lang . Object ref = callerIp_ ; if ( ref instanceof java . lang . String ) { com . google . protobuf . ByteString b = com . google . protobuf . ByteString . copyFromUtf8 ( ( java . lang . String ) ref ) ; callerIp_ = b ; return b ; } else { return ( com . google . protobuf . ByteString ) ref ; }
public class PICTUtil { /** * TODO : Refactor , don ' t need both readPattern methods */ public static Pattern readPattern ( final DataInput pStream , final Color fg , final Color bg ) throws IOException { } }
// Get the data ( 8 bytes ) byte [ ] data = new byte [ 8 ] ; pStream . readFully ( data ) ; return new BitMapPattern ( data , fg , bg ) ;
public class AbstractTreeNode { /** * Fire the event for the node child sets . * @ param event the event . */ void firePropertyChildAdded ( TreeNodeAddedEvent event ) { } }
if ( this . nodeListeners != null ) { for ( final TreeNodeListener listener : this . nodeListeners ) { if ( listener != null ) { listener . treeNodeChildAdded ( event ) ; } } } final N parentNode = getParentNode ( ) ; assert parentNode != this ; if ( parentNode != null ) { parentNode . firePropertyChildAdded ( event ) ...
public class EdifactEncoder { /** * Handle " end of data " situations * @ param context the encoder context * @ param buffer the buffer with the remaining encoded characters */ private static void handleEOD ( EncoderContext context , CharSequence buffer ) { } }
try { int count = buffer . length ( ) ; if ( count == 0 ) { return ; // Already finished } if ( count == 1 ) { // Only an unlatch at the end context . updateSymbolInfo ( ) ; int available = context . getSymbolInfo ( ) . getDataCapacity ( ) - context . getCodewordCount ( ) ; int remaining = context . getRemainingCharact...
public class Region { /** * Returns the 0 - indexed identifier * Note : IMPORTANT : to get id1 , you would call getIdentifier ( 0 ) ; * @ param i * @ return */ public Identifier getIdentifier ( int i ) { } }
return mIdentifiers . size ( ) > i ? mIdentifiers . get ( i ) : null ;
public class Navis { /** * Return longitude change after moving distance at bearing * @ param latitude * @ param distance * @ param bearing * @ return */ public static final double deltaLongitude ( double latitude , double distance , double bearing ) { } }
double departure = departure ( latitude ) ; double sin = Math . sin ( Math . toRadians ( bearing ) ) ; return ( sin * distance ) / ( 60 * departure ) ;
public class FacebookEndpoint { /** * Fetches the link settings from persisted storage . * @ return the { @ link com . groundupworks . wings . facebook . FacebookSettings } ; or null if unlinked . */ private FacebookSettings fetchSettings ( ) { } }
SharedPreferences preferences = PreferenceManager . getDefaultSharedPreferences ( mContext ) ; if ( ! preferences . getBoolean ( mContext . getString ( R . string . wings_facebook__link_key ) , false ) ) { return null ; } int destinationId = preferences . getInt ( mContext . getString ( R . string . wings_facebook__des...
public class AbstractAnsibleMojo { /** * Checks whether the given file is an absolute path or a classpath file * @ param path the relative path * @ return the absolute path to the extracted file * @ throws IOException if the path can not be determined */ protected String findClasspathFile ( final String path ) th...
if ( path == null ) { return null ; } final File file = new File ( path ) ; if ( file . exists ( ) ) { return file . getAbsolutePath ( ) ; } return createTmpFile ( path ) . getAbsolutePath ( ) ;
public class JavaParserModule { /** * Create an index containing all compilation units of Java files from * the source tree under the given root folder . * @ param rootFolder */ public void indexSourceTree ( final Folder rootFolder ) { } }
logger . info ( "Starting indexing of source tree " + rootFolder . getPath ( ) ) ; final SecurityContext securityContext = rootFolder . getSecurityContext ( ) ; app = StructrApp . getInstance ( securityContext ) ; structrTypeSolver . parseRoot ( rootFolder ) ; final CombinedTypeSolver typeSolver = new CombinedTypeSolve...
public class Provider { /** * Ensure all the legacy String properties are fully parsed into * service objects . */ private void ensureLegacyParsed ( ) { } }
if ( ( legacyChanged == false ) || ( legacyStrings == null ) ) { return ; } serviceSet = null ; if ( legacyMap == null ) { legacyMap = new LinkedHashMap < ServiceKey , Service > ( ) ; } else { legacyMap . clear ( ) ; } for ( Map . Entry < String , String > entry : legacyStrings . entrySet ( ) ) { parseLegacyPut ( entry...
public class AsyncContext31Impl { /** * A read listener has been set on the SRTInputStream and we will set it up to do its * first read on another thread . */ public void startReadListener ( ThreadContextManager tcm , SRTInputStream31 inputStream ) throws Exception { } }
try { ReadListenerRunnable rlRunnable = new ReadListenerRunnable ( tcm , inputStream , this ) ; this . setReadListenerRunning ( true ) ; com . ibm . ws . webcontainer . osgi . WebContainer . getExecutorService ( ) . execute ( rlRunnable ) ; // The read listener will now be invoked on another thread . Call pre - join to...
public class DataService { /** * verifies availability of an object in response * @ param intuitMessage * @ param idx * @ return */ private boolean isContainResponse ( IntuitMessage intuitMessage , int idx ) { } }
List < AttachableResponse > response = ( ( IntuitResponse ) intuitMessage . getResponseElements ( ) . getResponse ( ) ) . getAttachableResponse ( ) ; if ( null == response ) { return false ; } if ( 0 >= response . size ( ) ) { return false ; } if ( idx >= response . size ( ) ) { return false ; } return true ;
public class JvmBooleanAnnotationValueImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EList < Boolean > getValues ( ) { } }
if ( values == null ) { values = new EDataTypeEList < Boolean > ( Boolean . class , this , TypesPackage . JVM_BOOLEAN_ANNOTATION_VALUE__VALUES ) ; } return values ;
public class N { /** * Mostly it ' s designed for one - step operation to complete the operation in one step . * < code > java . util . stream . Stream < / code > is preferred for multiple phases operation . * @ param a * @ param fromIndex * @ param toIndex * @ param func * @ return */ public static < T , E...
checkFromToIndex ( fromIndex , toIndex , size ( c ) ) ; N . checkArgNotNull ( func ) ; if ( N . isNullOrEmpty ( c ) && fromIndex == 0 && toIndex == 0 ) { return new IntList ( ) ; } final IntList result = new IntList ( toIndex - fromIndex ) ; if ( c instanceof List && c instanceof RandomAccess ) { final List < T > list ...
public class HystrixMetricsPublisherFactory { /** * Get an instance of { @ link HystrixMetricsPublisherCommand } with the given factory { @ link HystrixMetricsPublisher } implementation for each { @ link HystrixCommand } instance . * @ param commandKey * Pass - thru to { @ link HystrixMetricsPublisher # getMetricsP...
return SINGLETON . getPublisherForCommand ( commandKey , commandOwner , metrics , circuitBreaker , properties ) ;
public class BTreeIndex { /** * Deletes the specified index record . The method first traverses the * directory to find the leaf page containing that record ; then it deletes * the record from the page . F * @ see Index # delete ( SearchKey , RecordId , boolean ) */ @ Override public void delete ( SearchKey key ,...
if ( tx . isReadOnly ( ) ) throw new UnsupportedOperationException ( ) ; search ( new SearchRange ( key ) , SearchPurpose . DELETE ) ; // log the logical operation starts if ( doLogicalLogging ) tx . recoveryMgr ( ) . logLogicalStart ( ) ; leaf . delete ( dataRecordId ) ; // log the logical operation ends if ( doLogica...
public class AbstractProtoRealization { /** * Method to indicate the destination is to be deleted . */ public void setToBeDeleted ( ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "setToBeDeleted" ) ; // Tell the remote code the destination is to be deleted if ( _remoteSupport != null ) _remoteSupport . setToBeDeleted ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Sib...
public class EnumTrianglesOpt { public static void main ( String [ ] args ) throws Exception { } }
if ( ! parseParameters ( args ) ) { return ; } // set up execution environment final ExecutionEnvironment env = ExecutionEnvironment . getExecutionEnvironment ( ) ; // read input data DataSet < Edge > edges = getEdgeDataSet ( env ) ; // annotate edges with degrees DataSet < EdgeWithDegrees > edgesWithDegrees = edges . ...
public class DescribeCodeRepositoryRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DescribeCodeRepositoryRequest describeCodeRepositoryRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( describeCodeRepositoryRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( describeCodeRepositoryRequest . getCodeRepositoryName ( ) , CODEREPOSITORYNAME_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable...
public class Miniball { /** * Adds a point to the list . < br > * Skip action on null parameter . < br > * @ param p The object to be added to the list */ public void check_in ( double [ ] p ) { } }
if ( p != null ) { L . add ( p ) ; } else { System . out . println ( "Miniball.check_in WARNING: Skipping null point" ) ; }
public class JOGLTypeConversions { /** * Convert primitives from GL constants . * @ param code The GL constant . * @ return The value . */ public static JCGLPrimitives primitiveFromGL ( final int code ) { } }
switch ( code ) { case GL . GL_LINES : return JCGLPrimitives . PRIMITIVE_LINES ; case GL . GL_LINE_LOOP : return JCGLPrimitives . PRIMITIVE_LINE_LOOP ; case GL . GL_POINTS : return JCGLPrimitives . PRIMITIVE_POINTS ; case GL . GL_TRIANGLES : return JCGLPrimitives . PRIMITIVE_TRIANGLES ; case GL . GL_TRIANGLE_STRIP : re...
public class ClusterTemplet { /** * { @ inheritDoc } */ public int generateAt ( Instance instance , IFeatureAlphabet features , int pos , int ... numLabels ) throws Exception { } }
String feaOri = getFeaString ( instance , pos , numLabels ) ; if ( feaOri == null ) return - 1 ; int index = - 1 ; if ( keymap . containsKey ( feaOri ) ) index = features . lookupIndex ( keymap . get ( feaOri ) , ( int ) Math . pow ( numLabels [ 0 ] , order + 1 ) ) ; return index ;
public class ValuesFileFixture { /** * Saves content of a key ' s value as file in the files section . * @ param basename filename to use . * @ param key key to get value from . * @ return file created . */ public String createContainingBase64Value ( String basename , String key ) { } }
String file ; Object value = value ( key ) ; if ( value == null ) { throw new SlimFixtureException ( false , "No value for key: " + key ) ; } else if ( value instanceof String ) { file = createFileFromBase64 ( basename , ( String ) value ) ; } else { throw new SlimFixtureException ( false , "Value for key: " + key + " ...
public class TitlePaneCloseButtonWindowModifiedState { /** * { @ inheritDoc } */ public boolean isInState ( JComponent c ) { } }
Component parent = c ; while ( parent . getParent ( ) != null ) { if ( parent instanceof JFrame ) { break ; } parent = parent . getParent ( ) ; } if ( parent instanceof JFrame ) { return ( ( JFrame ) parent ) . getRootPane ( ) . getClientProperty ( WINDOW_DOCUMENT_MODIFIED ) == Boolean . TRUE ; } return false ;
public class NFVORequestor { /** * Returns a NetworkServiceDescriptorAgent with which requests regarding NetworkServiceDescriptors * can be sent to the NFVO . * @ return a NetworkServiceDescriptorAgent */ public synchronized NetworkServiceDescriptorAgent getNetworkServiceDescriptorAgent ( ) { } }
if ( this . networkServiceDescriptorAgent == null ) { if ( isService ) { this . networkServiceDescriptorAgent = new NetworkServiceDescriptorAgent ( this . serviceName , this . projectId , this . sslEnabled , this . nfvoIp , this . nfvoPort , this . version , this . serviceKey ) ; } else { this . networkServiceDescripto...
public class BudgetOrder { /** * Gets the totalAdjustments value for this BudgetOrder . * @ return totalAdjustments * The adjustments amount in micros . Adjustments from Google come * in the form of credits or * debits to your budget order . This amount is the net * sum of adjustments since the creation * of ...
return totalAdjustments ;
public class Word { /** * Retrieves a " flattened " version of this word , i . e . , without any hierarchical structure attached . This can be * helpful if { @ link Word } is subclassed to allow representing , e . g . , a concatenation dynamically , but due to * performance concerns not too many levels of indirecti...
int len = length ( ) ; Object [ ] array = new Object [ len ] ; writeToArray ( 0 , array , 0 , len ) ; return new SharedWord < > ( array ) ;
public class MoreCollectors { /** * Returns a { @ code Collector } which collects only the last stream element * if any . * @ param < T > the type of the input elements * @ return a collector which returns an { @ link Optional } which describes the * last element of the stream . For empty stream an empty * { ...
return Collectors . reducing ( ( u , v ) -> v ) ;
public class ServerSecurityAlertPoliciesInner { /** * Get a server ' s security alert policy . * @ param resourceGroupName The name of the resource group that contains the resource . You can obtain this value from the Azure Resource Manager API or the portal . * @ param serverName The name of the server . * @ thr...
return getWithServiceResponseAsync ( resourceGroupName , serverName ) . map ( new Func1 < ServiceResponse < ServerSecurityAlertPolicyInner > , ServerSecurityAlertPolicyInner > ( ) { @ Override public ServerSecurityAlertPolicyInner call ( ServiceResponse < ServerSecurityAlertPolicyInner > response ) { return response . ...
public class TriggerWorkflowExternalConditionRequests { /** * Runs the example . * @ param adManagerServices the services factory . * @ param session the session . * @ param proposalId the ID of the proposal to trigger workflow external conditions for . * @ throws ApiException if the API request failed with one...
// Get the WorkflowRequestService . WorkflowRequestServiceInterface workflowRequestService = adManagerServices . get ( session , WorkflowRequestServiceInterface . class ) ; // Create a statement to select workflow external condition requests for a proposal . StatementBuilder statementBuilder = new StatementBuilder ( ) ...
public class InnerClasses { /** * Registers this factory as an inner class on the given class writer . * < p > Registering an inner class is confusing . The inner class needs to call this and so does the * outer class . Confirmed by running ASMIfier . Also , failure to call visitInnerClass on both * classes eithe...
checkRegistered ( innerClass ) ; doRegister ( visitor , innerClass ) ;
public class CPDAvailabilityEstimateUtil { /** * Returns the cpd availability estimate where uuid = & # 63 ; and groupId = & # 63 ; or throws a { @ link NoSuchCPDAvailabilityEstimateException } if it could not be found . * @ param uuid the uuid * @ param groupId the group ID * @ return the matching cpd availabili...
return getPersistence ( ) . findByUUID_G ( uuid , groupId ) ;
public class ServerKeysInner { /** * Gets a server key . * @ param resourceGroupName The name of the resource group that contains the resource . You can obtain this value from the Azure Resource Manager API or the portal . * @ param serverName The name of the server . * @ param keyName The name of the server key ...
return ServiceFuture . fromResponse ( getWithServiceResponseAsync ( resourceGroupName , serverName , keyName ) , serviceCallback ) ;
public class CommerceAvailabilityEstimateModelImpl { /** * Converts the soap model instances into normal model instances . * @ param soapModels the soap model instances to convert * @ return the normal model instances */ public static List < CommerceAvailabilityEstimate > toModels ( CommerceAvailabilityEstimateSoap...
if ( soapModels == null ) { return null ; } List < CommerceAvailabilityEstimate > models = new ArrayList < CommerceAvailabilityEstimate > ( soapModels . length ) ; for ( CommerceAvailabilityEstimateSoap soapModel : soapModels ) { models . add ( toModel ( soapModel ) ) ; } return models ;
public class TraceWebAspect { /** * NOSONAR */ @ Around ( "anyControllerOrRestControllerWithPublicAsyncMethod()" ) @ SuppressWarnings ( "unchecked" ) public Object wrapWithCorrelationId ( ProceedingJoinPoint pjp ) throws Throwable { } }
Callable < Object > callable = ( Callable < Object > ) pjp . proceed ( ) ; TraceContext currentSpan = this . tracing . currentTraceContext ( ) . get ( ) ; if ( currentSpan == null ) { return callable ; } if ( log . isDebugEnabled ( ) ) { log . debug ( "Wrapping callable with span [" + currentSpan + "]" ) ; } return new...
public class CliShell { /** * Provide assistance for the given command line . Assistance means 2 things : * < ol > * < li > Auto complete the command line < / li > * < li > Print information that is specific to the context of the command line ( if the command line indicates * that we are parsing a command , ass...
try { return doAssist ( commandLine ) ; } catch ( ParseException e ) { handleParseException ( e ) ; } catch ( Exception e ) { err . printThrowable ( e ) ; } return Opt . absent ( ) ;
public class Context { /** * Report a warning using the error reporter for the current thread . * @ param message the warning message to report * @ param sourceName a string describing the source , such as a filename * @ param lineno the starting line number * @ param lineSource the text of the line ( may be nu...
Context cx = Context . getContext ( ) ; if ( cx . hasFeature ( FEATURE_WARNING_AS_ERROR ) ) reportError ( message , sourceName , lineno , lineSource , lineOffset ) ; else cx . getErrorReporter ( ) . warning ( message , sourceName , lineno , lineSource , lineOffset ) ;
public class PostExecutionInterceptorContext { /** * Requests that the call tree should not be added to the current { @ link Span } * @ param reason the reason why the call tree should be excluded ( debug message ) * @ return < code > this < / code > for chaining */ public PostExecutionInterceptorContext excludeCal...
if ( ! mustPreserveCallTree ) { logger . debug ( "Excluding call tree because {}" , reason ) ; excludeCallTree = true ; } return this ;
public class Results { /** * Creates a new result with the status { @ literal 200 - OK } building a JSONP response . * @ param padding the callback name * @ param node the json object ( JSON array or JSON object ) * @ return the JSONP response built as follows : padding ( node ) */ public static Result ok ( Strin...
return status ( Result . OK ) . render ( padding , node ) ;
public class OpenPgpPubSubUtil { /** * Consult the public key metadata node of { @ code contact } to fetch the list of their published OpenPGP public keys . * @ see < a href = " https : / / xmpp . org / extensions / xep - 0373 . html # discover - pubkey - list " > * XEP - 0373 § 4.3 : Discovering Public Keys of a U...
PubSubManager pm = PubSubManager . getInstanceFor ( connection , contact ) ; LeafNode node = getLeafNode ( pm , PEP_NODE_PUBLIC_KEYS ) ; List < PayloadItem < PublicKeysListElement > > list = node . getItems ( 1 ) ; if ( list . isEmpty ( ) ) { return null ; } return list . get ( 0 ) . getPayload ( ) ;
public class GetSchemaCreationStatusRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( GetSchemaCreationStatusRequest getSchemaCreationStatusRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( getSchemaCreationStatusRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( getSchemaCreationStatusRequest . getApiId ( ) , APIID_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to ...
public class ExecutionEngine { /** * Finalize collected statistics ( stops timer and supplies cache statistics ) . * @ param cacheSize size of cache * @ param cacheUse where the plan came from */ protected void endStatsCollection ( long cacheSize , CacheUse cacheUse ) { } }
if ( m_plannerStats != null ) { m_plannerStats . endStatsCollection ( cacheSize , 0 , cacheUse , m_partitionId ) ; }
public class WebSocket { /** * Create a new { @ code WebSocket } instance that has the same settings * as this instance . Note that , however , settings you made on the raw * socket are not copied . * The { @ link WebSocketFactory } instance that you used to create this * { @ code WebSocket } instance is used a...
if ( timeout < 0 ) { throw new IllegalArgumentException ( "The given timeout value is negative." ) ; } WebSocket instance = mWebSocketFactory . createSocket ( getURI ( ) , timeout ) ; // Copy the settings . instance . mHandshakeBuilder = new HandshakeBuilder ( mHandshakeBuilder ) ; instance . setPingInterval ( getPingI...
public class CleverTapAPI { /** * Event */ private void queueEventToDB ( final Context context , final JSONObject event , final int type ) { } }
DBAdapter . Table table = ( type == Constants . PROFILE_EVENT ) ? DBAdapter . Table . PROFILE_EVENTS : DBAdapter . Table . EVENTS ; queueEventInternal ( context , event , table ) ;
public class DialogUtil { /** * Creates and shows an internal dialog with the specified panel . */ public static JInternalDialog createDialog ( JFrame frame , JPanel content ) { } }
return createDialog ( frame , null , content ) ;
public class Section { /** * Checks if the section contains the given value and fires an event * in case the value " entered " or " left " the section . With this one * can react if a value enters / leaves a specific region in a gauge . * @ param VALUE */ public void checkForValue ( final double VALUE ) { } }
boolean wasInSection = contains ( checkedValue ) ; boolean isInSection = contains ( VALUE ) ; if ( ! wasInSection && isInSection ) { fireSectionEvent ( ENTERED_EVENT ) ; } else if ( wasInSection && ! isInSection ) { fireSectionEvent ( LEFT_EVENT ) ; } checkedValue = VALUE ;
public class DocumentBuilder { /** * Parse the content of the given < code > InputStream < / code > as an XML * document and return a new DOM { @ link Document } object . * An < code > IllegalArgumentException < / code > is thrown if the * < code > InputStream < / code > is null . * @ param is InputStream conta...
if ( is == null ) { throw new IllegalArgumentException ( "InputStream cannot be null" ) ; } InputSource in = new InputSource ( is ) ; return parse ( in ) ;
public class XPath { /** * Returns a lenient / not lenient version of this { @ code XPath } expression . * @ param lenient * the requested lenient mode * @ return an { @ code XPath } expression with the same xpath string of this expression but the * requested lenient mode ; note that this { @ code XPath } insta...
if ( lenient == isLenient ( ) ) { return this ; } else if ( ! lenient ) { return new StrictXPath ( this . support ) ; } else { return new LenientXPath ( this . support ) ; }
public class PeerManager { /** * Reloads the list of peer nodes from our table and refreshes each with a call to { @ link * # refreshPeer } . */ protected void refreshPeers ( ) { } }
if ( _adHoc ) { return ; } // load up information on our nodes _invoker . postUnit ( new RepositoryUnit ( "refreshPeers" ) { @ Override public void invokePersist ( ) throws Exception { // let the world know that we ' re alive _noderepo . heartbeatNode ( _nodeName ) ; // then load up all the peer records _nodes = Maps ....
public class ReportUtil { /** * Read data from input stream * @ param is * input stream * @ return string content read from input stream * @ throws IOException * if cannot read from input stream */ public static String readAsString ( InputStream is ) throws IOException { } }
try { // Scanner iterates over tokens in the stream , and in this case // we separate tokens using " beginning of the input boundary " ( \ A ) // thus giving us only one token for the entire contents of the // stream return new Scanner ( is , "UTF-8" ) . useDelimiter ( "\\A" ) . next ( ) ; } catch ( java . util . NoSuc...
public class RoundedMoney { /** * ( non - Javadoc ) * @ see MonetaryAmount # divideToIntegralValue ( Number ) ) D */ @ Override public RoundedMoney divideToIntegralValue ( Number divisor ) { } }
MathContext mc = monetaryContext . get ( MathContext . class ) ; if ( mc == null ) { mc = MathContext . DECIMAL64 ; } BigDecimal dec = number . divideToIntegralValue ( MoneyUtils . getBigDecimal ( divisor ) , mc ) ; return new RoundedMoney ( dec , currency , rounding ) ;
public class CamelHbaseStoreBolt { /** * { @ inheritDoc } */ @ SuppressWarnings ( "unchecked" ) @ Override public void onMessage ( StreamMessage message ) { } }
Map < String , Object > values ; try { values = this . converter . toMap ( message ) ; } catch ( ConvertFailException ex ) { String logFormat = "Fail convert to hbase record. Dispose received message. : Message={0}" ; logger . warn ( MessageFormat . format ( logFormat , message ) , ex ) ; ack ( ) ; return ; } // rowidを...
public class ModelsImpl { /** * Create an entity role for an entity in the application . * @ param appId The application ID . * @ param versionId The version ID . * @ param entityId The entity model ID . * @ param name The entity role name . * @ throws IllegalArgumentException thrown if parameters fail the va...
if ( this . client . endpoint ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.endpoint() is required and cannot be null." ) ; } if ( appId == null ) { throw new IllegalArgumentException ( "Parameter appId is required and cannot be null." ) ; } if ( versionId == null ) { throw new IllegalArgu...
public class VirtualNetworkGatewaysInner { /** * Gets all the connections in a virtual network gateway . * @ param nextPageLink The NextLink from the previous successful call to List operation . * @ param serviceFuture the ServiceFuture object tracking the Retrofit calls * @ param serviceCallback the async Servic...
return AzureServiceFuture . fromPageResponse ( listConnectionsNextSinglePageAsync ( nextPageLink ) , new Func1 < String , Observable < ServiceResponse < Page < VirtualNetworkGatewayConnectionListEntityInner > > > > ( ) { @ Override public Observable < ServiceResponse < Page < VirtualNetworkGatewayConnectionListEntityIn...
public class FloatStyle { /** * Append the number : number tag * @ param util an util * @ param appendable the destination * @ throws IOException if an I / O error occurs */ public void appendNumberTag ( final XMLUtil util , final Appendable appendable ) throws IOException { } }
appendable . append ( "<number:number" ) ; this . appendXMLAttributes ( util , appendable ) ; appendable . append ( "/>" ) ;
public class AdapterDelegatesManager { /** * Must be called from { @ link RecyclerView . Adapter # getItemViewType ( int ) } . Internally it scans all * the registered { @ link AdapterDelegate } and picks the right one to return the ViewType integer . * @ param items Adapter ' s data source * @ param position the...
if ( items == null ) { throw new NullPointerException ( "Items datasource is null!" ) ; } int delegatesCount = delegates . size ( ) ; for ( int i = 0 ; i < delegatesCount ; i ++ ) { AdapterDelegate < T > delegate = delegates . valueAt ( i ) ; if ( delegate . isForViewType ( items , position ) ) { return delegates . key...
public class ApplicationScoreService { /** * Generate criteria settings for each widget type * @ param scoreCriteriaSettings Score Criteria Settings * @ return Map of settings by each widget name */ private Map < String , ScoreComponentSettings > generateWidgetSettings ( ScoreCriteriaSettings scoreCriteriaSettings ...
Map < String , ScoreComponentSettings > scoreParamSettingsMap = new HashMap < > ( ) ; addSettingsToMap ( scoreParamSettingsMap , Constants . WIDGET_BUILD , getSettingsIfEnabled ( scoreCriteriaSettings . getBuild ( ) ) ) ; addSettingsToMap ( scoreParamSettingsMap , Constants . WIDGET_DEPLOY , getSettingsIfEnabled ( scor...
public class Task { /** * Set a text value . * @ param index text index ( 1-30) * @ param value text value */ public void setText ( int index , String value ) { } }
set ( selectField ( TaskFieldLists . CUSTOM_TEXT , index ) , value ) ;
public class BigDecimal { /** * Divides { @ code long } by { @ code long } and do rounding based on the * passed in roundingMode . */ private static long divideAndRound ( long ldividend , long ldivisor , int roundingMode ) { } }
int qsign ; // quotient sign long q = ldividend / ldivisor ; // store quotient in long if ( roundingMode == ROUND_DOWN ) return q ; long r = ldividend % ldivisor ; // store remainder in long qsign = ( ( ldividend < 0 ) == ( ldivisor < 0 ) ) ? 1 : - 1 ; if ( r != 0 ) { boolean increment = needIncrement ( ldivisor , roun...