signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class WebUtils { /** * Put initial http request post parameters . * @ param context the context */ public static void putInitialHttpRequestPostParameters ( final RequestContext context ) { } }
val request = getHttpServletRequestFromExternalWebflowContext ( context ) ; context . getFlashScope ( ) . put ( "httpRequestInitialPostParameters" , request . getParameterMap ( ) ) ;
public class MMDCfgPanel { /** * GEN - LAST : event _ buttonResetSettingsActionPerformed */ private void buttonExportSettingsActionPerformed ( java . awt . event . ActionEvent evt ) { } }
// GEN - FIRST : event _ buttonExportSettingsActionPerformed File file = DialogProviderManager . getInstance ( ) . getDialogProvider ( ) . msgSaveFileDialog ( null , "exportSettings" , "Export settings" , lastExportedSettingsFile , true , new PropertiesFileFilter ( ) , "Save" ) ; if ( file != null ) { lastExportedSetti...
public class SizeLimitableBlockingQueue { /** * / * ( non - Javadoc ) * @ see java . util . Collection # retainAll ( java . util . Collection ) */ @ Override public boolean retainAll ( Collection < ? > c ) { } }
boolean b = queue . retainAll ( c ) ; if ( b ) { signalSizeReduced ( ) ; } return b ;
public class BasicRecordStoreLoader { /** * Loads the provided keys from the underlying map store * and transforms them to a list of alternating serialised key - value pairs . * @ param keys the keys for which values are loaded * @ return the list of loaded key - values * @ see com . hazelcast . core . MapLoade...
try { Map entries = mapDataStore . loadAll ( keys ) ; return getKeyValueSequence ( entries ) ; } catch ( Throwable t ) { logger . warning ( "Could not load keys from map store" , t ) ; throw ExceptionUtil . rethrow ( t ) ; }
public class LessParser { /** * Concatenate 2 expressions to one expression . * @ param left * the left , can be null * @ param operator * the expression operation * @ param right * the right , can not be null * @ return the resulting expression */ private Expression concat ( Expression left , char operat...
if ( left == null ) { return right ; } Operation op ; if ( left . getClass ( ) == Operation . class && ( ( Operation ) left ) . getOperator ( ) == operator ) { op = ( Operation ) left ; } else if ( right != null && right . getClass ( ) == Operation . class && ( ( Operation ) right ) . getOperator ( ) == operator ) { op...
public class PTSaxton2006 { /** * Equation 15 for calculating Slope of logarithmic tension - moisture curve * @ param slsnd Sand weight percentage by layer ( [ 0,100 ] % ) * @ param slcly Clay weight percentage by layer ( [ 0,100 ] % ) * @ param omPct Organic matter weight percentage by layer ( [ 0,100 ] % ) , ( ...
String mt33 = divide ( calcMoisture33Kpa ( slsnd , slcly , omPct ) , "100" ) ; String mt1500 = divide ( calcMoisture1500Kpa ( slsnd , slcly , omPct ) , "100" ) ; String ret = divide ( substract ( log ( mt33 ) , log ( mt1500 ) ) , CONST_LN1500_LN33 ) ; LOG . debug ( "Calculate result for Slope of logarithmic tension-moi...
public class JSON { /** * Parse a string of JSON text into a JSONArtifact . * @ param str The String to read from . * @ param order Boolean flag indicating if the order of the JSON data should be preserved . This parameter only has an effect if the stream is JSON Object { . . . } formatted data . * @ return Retur...
if ( str != null ) { return parse ( new StringReader ( str ) , order ) ; } else { throw new NullPointerException ( "str cannot be null" ) ; }
public class ApiOvhOrder { /** * Create order * REST : POST / order / dedicated / server / { serviceName } / traffic / { duration } * @ param traffic [ required ] amount of traffic to allocate * @ param serviceName [ required ] The internal name of your dedicated server * @ param duration [ required ] Duration ...
String qPath = "/order/dedicated/server/{serviceName}/traffic/{duration}" ; StringBuilder sb = path ( qPath , serviceName , duration ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "traffic" , traffic ) ; String resp = exec ( qPath , "POST" , sb . toString ( ) , o ) ; return conv...
public class CloudhopperBuilder { /** * The SMPP server host ( IP or address ) . * You can specify a direct value . For example : * < pre > * . host ( " localhost " ) ; * < / pre > * You can also specify one or several property keys . For example : * < pre > * . host ( " $ { custom . property . high - pri...
for ( String h : host ) { if ( h != null ) { hosts . add ( h ) ; } } return this ;
public class FileUtils { /** * Returns the path of the file in the same manner as { @ link java . io . File # getPath ( ) } . * @ param file The file * @ return The path or null if the file is null or empty */ public static String path ( String file ) { } }
if ( StringUtils . isNullOrBlank ( file ) ) { return StringUtils . EMPTY ; } file = StringUtils . trim ( file ) ; int pos = indexOfLastSeparator ( file ) ; return pos == file . length ( ) - 1 ? file . substring ( 0 , file . length ( ) - 1 ) : file ;
public class Settings { /** * Public API . */ public static Settings load ( Map < String , String > config ) { } }
Map < Entry , String > rslt = new HashMap < Entry , String > ( ) ; Log log = null ; for ( Entry y : Entry . values ( ) ) { // Explicitly defined values trump defaults . . . String specValue = config . get ( y . getName ( ) ) ; if ( specValue != null ) { if ( log == null ) { log = LogFactory . getLog ( Settings . class ...
public class Reflection { /** * Sets the value of a field of an object instance via reflection * @ param instance to inspect * @ param fieldName name of field to set * @ param value the value to set */ public static void setValue ( Object instance , String fieldName , Object value ) { } }
try { Field f = findFieldRecursively ( instance . getClass ( ) , fieldName ) ; if ( f == null ) throw new NoSuchMethodException ( "Cannot find field " + fieldName + " on " + instance . getClass ( ) + " or superclasses" ) ; f . setAccessible ( true ) ; f . set ( instance , value ) ; } catch ( Exception e ) { throw new R...
public class DatabaseUtil { /** * Find object by matching their labels . * @ param database Database to search in * @ param name _ pattern Name to match against class or object label * @ return found cluster or it throws an exception . */ public static ArrayModifiableDBIDs getObjectsByLabelMatch ( Database databa...
Relation < String > relation = guessLabelRepresentation ( database ) ; if ( name_pattern == null ) { return DBIDUtil . newArray ( ) ; } ArrayModifiableDBIDs ret = DBIDUtil . newArray ( ) ; for ( DBIDIter iditer = relation . iterDBIDs ( ) ; iditer . valid ( ) ; iditer . advance ( ) ) { if ( name_pattern . matcher ( rela...
public class Scope { /** * Return scope handler or parent ' s scope handler if this scope doesn ' t have one . * @ return Scope handler ( or parent ' s one ) */ public IScopeHandler getHandler ( ) { } }
log . trace ( "getHandler from {}" , name ) ; if ( handler != null ) { return handler ; } else if ( hasParent ( ) ) { return getParent ( ) . getHandler ( ) ; } else { return null ; }
public class OperaDesktopDriver { /** * Waits until the menu item is pressed and then returns the text of the menu item pressed * @ param menuItemText - window to wait for shown event on * @ return text of the menu item */ public String waitForMenuItemPressed ( String menuItemText ) { } }
if ( getScopeServices ( ) . getConnection ( ) == null ) { throw new CommunicationException ( "waiting for a menu item to be pressed failed because Opera is not connected." ) ; } return getScopeServices ( ) . waitForMenuItemPressed ( menuItemText , OperaIntervals . MENU_EVENT_TIMEOUT . getMs ( ) ) ;
public class JFAPCommunicator { /** * Works out the capabilities that will be sent to the peer as part of the initial handshake . * This also takes into account any overrides from the SIB properties file . * @ return Returns the capabilities . */ private short getClientCapabilities ( ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getClientCapabilities" ) ; short capabilities = CommsConstants . CAPABILITIES_DEFAULT ; // Allow the use of a runtime property to alter the capability that we require a non - java // bootstrap to locate an ME boolean...
public class RawLocalFileSystem { /** * Use the command chmod to set permission . */ @ Override public void setPermission ( Path p , FsPermission permission ) throws IOException { } }
FsAction user = permission . getUserAction ( ) ; FsAction group = permission . getGroupAction ( ) ; FsAction other = permission . getOtherAction ( ) ; File f = pathToFile ( p ) ; // Fork chmod if group and other permissions are different . . . if ( group != other ) { execSetPermission ( f , permission ) ; return ; } bo...
public class TypedCollections { /** * Dynamically check that the members of the list are all instances of * the given type ( or null ) . * @ param < E > * the list ' s element type * @ param list * the list to cast * @ param type * the class of the list ' s element type . * @ return the dynamically - ty...
return dynamicallyCastCollection ( list , type , List . class ) ;
public class AbstractJSSEProvider { /** * this provides the SSL context instance */ private void getKeyTrustManagers ( Map < String , Object > connectionInfo , SSLConfig sslConfig , List < KeyManager > kmHolder , List < TrustManager > tmHolder ) throws Exception { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "getKeyTrustManagers" , new Object [ ] { connectionInfo , sslConfig } ) ; TrustManagerFactory trustManagerFactory = null ; KeyManagerFactory keyManagerFactory = null ; KeyStore keyStore = null ; KeyStore trustStore = null ; boo...
public class Part { /** * Create a file multi - part field , from byte array data . * This return a part equivalent to & lt ; input type = " file " / & gt ; field in multi part form . */ public static Part < byte [ ] > file ( String name , String fileName , byte [ ] bytes ) { } }
return new Part < > ( name , fileName , bytes , CONTENT_TYPE_BINARY , null , ( body , out , charset ) -> out . write ( body ) ) ;
public class CleverTapAPI { /** * For Google Play Store / Android Studio analytics */ private static boolean checkForExoPlayer ( ) { } }
boolean exoPlayerPresent = false ; Class className = null ; try { className = Class . forName ( "com.google.android.exoplayer2.ExoPlayerFactory" ) ; className = Class . forName ( "com.google.android.exoplayer2.source.hls.HlsMediaSource" ) ; className = Class . forName ( "com.google.android.exoplayer2.ui.PlayerView" ) ;...
public class AmazonEC2Client { /** * Launches the specified Scheduled Instances . * Before you can launch a Scheduled Instance , you must purchase it and obtain an identifier using * < a > PurchaseScheduledInstances < / a > . * You must launch a Scheduled Instance during its scheduled time period . You can ' t st...
request = beforeClientExecution ( request ) ; return executeRunScheduledInstances ( request ) ;
public class LocalTimeCLA { /** * { @ inheritDoc } */ @ Override public LocalTime [ ] getValueAsLocalTimeArray ( ) throws ParseException { } }
final LocalTime [ ] result = new LocalTime [ size ( ) ] ; for ( int r = 0 ; r < size ( ) ; r ++ ) result [ r ] = getValue ( r ) ; return result ;
public class DirectoryServiceClient { /** * Close the DirectoryServiceClient . */ public void close ( ) { } }
if ( connection != null ) { try { connection . close ( ) ; } catch ( IOException e ) { LOGGER . warn ( "Close the DirectoryConnection get exception - " + e . getMessage ( ) ) ; } connection = null ; } if ( watcherManager != null ) { watcherManager . cleanup ( ) ; watcherManager = null ; }
public class PojoSerializerSnapshotData { /** * Creates a { @ link PojoSerializerSnapshotData } from configuration of a { @ link PojoSerializer } . * < p > This factory method is meant to be used in regular write paths , i . e . when taking a snapshot * of the { @ link PojoSerializer } . All registered subclass cla...
final LinkedOptionalMap < Field , TypeSerializerSnapshot < ? > > fieldSerializerSnapshots = new LinkedOptionalMap < > ( fields . length ) ; for ( int i = 0 ; i < fields . length ; i ++ ) { Field field = fields [ i ] ; String fieldName = ( field == null ) ? getDummyNameForMissingField ( i ) : field . getName ( ) ; field...
public class ContactsInterface { /** * Get the collection of contacts for the calling user . * @ return The Collection of Contact objects */ public Collection < Contact > getList ( ) throws FlickrException { } }
ContactList < Contact > contacts = new ContactList < Contact > ( ) ; Map < String , Object > parameters = new HashMap < String , Object > ( ) ; parameters . put ( "method" , METHOD_GET_LIST ) ; Response response = transportAPI . get ( transportAPI . getPath ( ) , parameters , apiKey , sharedSecret ) ; if ( response . i...
public class Classes { /** * Get named field of requested class class or its super - classes package hierarchy , with checked exception . Tries to * get requested field from given class ; if not found try with super - classes hierarchy but limited to requested class * package . If field still not found throw { @ li...
try { Field field = clazz . getDeclaredField ( fieldName ) ; field . setAccessible ( true ) ; return field ; } catch ( NoSuchFieldException e ) { Class < ? > superclass = clazz . getSuperclass ( ) ; if ( superclass != null && clazz . getPackage ( ) . equals ( superclass . getPackage ( ) ) ) { return getFieldEx ( superc...
public class CmsSchedulerThreadPool { /** * Terminate all threads in this thread group . < p > * @ param waitForJobsToComplete if true , , all current jobs will be allowed to complete */ public void shutdown ( boolean waitForJobsToComplete ) { } }
m_isShutdown = true ; // signal each scheduler thread to shut down for ( int i = 0 ; i < m_currentThreadCount ; i ++ ) { if ( m_workers [ i ] != null ) { m_workers [ i ] . shutdown ( ) ; } } // give waiting ( wait ( 1000 ) ) worker threads a chance to shut down // active worker threads will shut down after finishing th...
public class XMLUnit { /** * Compare two XML documents provided as strings * @ param control Control document * @ param test Document to test * @ return Diff object describing differences in documents * @ throws SAXException * @ throws IOException */ public static Diff compareXML ( String control , String tes...
return new Diff ( control , test ) ;
public class ApplicationGatewaysInner { /** * Lists all SSL predefined policies for configuring Ssl policy . * ServiceResponse < PageImpl < ApplicationGatewaySslPredefinedPolicyInner > > * @ param nextPageLink The NextLink from the previous successful call to List operation . * @ throws IllegalArgumentException thr...
if ( nextPageLink == null ) { throw new IllegalArgumentException ( "Parameter nextPageLink is required and cannot be null." ) ; } String nextUrl = String . format ( "%s" , nextPageLink ) ; return service . listAvailableSslPredefinedPoliciesNext ( nextUrl , this . client . acceptLanguage ( ) , this . client . userAgent ...
public class ModelsImpl { /** * Get All Entity Roles for a given entity . * @ param appId The application ID . * @ param versionId The version ID . * @ param hEntityId The hierarchical entity extractor ID . * @ param serviceCallback the async ServiceCallback to handle successful and failed responses . * @ thr...
return ServiceFuture . fromResponse ( getHierarchicalEntityRolesWithServiceResponseAsync ( appId , versionId , hEntityId ) , serviceCallback ) ;
public class MountPointInfo { /** * < code > optional string ufsUri = 1 ; < / code > */ public java . lang . String getUfsUri ( ) { } }
java . lang . Object ref = ufsUri_ ; if ( ref instanceof java . lang . String ) { return ( java . lang . String ) ref ; } else { com . google . protobuf . ByteString bs = ( com . google . protobuf . ByteString ) ref ; java . lang . String s = bs . toStringUtf8 ( ) ; if ( bs . isValidUtf8 ( ) ) { ufsUri_ = s ; } return ...
public class DecimalFormat { /** * Sets the decimal format symbols used by this format . The format uses a copy of the * provided symbols . * @ param newSymbols desired DecimalFormatSymbols * @ see DecimalFormatSymbols */ public void setDecimalFormatSymbols ( DecimalFormatSymbols newSymbols ) { } }
symbols = ( DecimalFormatSymbols ) newSymbols . clone ( ) ; setCurrencyForSymbols ( ) ; expandAffixes ( null ) ;
public class ServiceRegistryLoader { /** * / * ( non - Javadoc ) * @ see org . jboss . arquillian . core . spi . ServiceLoader # onlyOne ( java . lang . Class , java . lang . Class ) */ @ Override public < T > T onlyOne ( Class < T > serviceClass , Class < ? extends T > defaultServiceClass ) { } }
T one = null ; try { one = onlyOne ( serviceClass ) ; } catch ( Exception e ) { } if ( one == null ) { one = createServiceInstance ( defaultServiceClass ) ; } return one ;
public class CommerceShipmentLocalServiceWrapper { /** * Creates a new commerce shipment with the primary key . Does not add the commerce shipment to the database . * @ param commerceShipmentId the primary key for the new commerce shipment * @ return the new commerce shipment */ @ Override public com . liferay . co...
return _commerceShipmentLocalService . createCommerceShipment ( commerceShipmentId ) ;
public class KeepAliveManager { /** * Transport has active streams . Start sending keepalives if necessary . */ public synchronized void onTransportActive ( ) { } }
if ( state == State . IDLE ) { // When the transport goes active , we do not reset the nextKeepaliveTime . This allows us to // quickly check whether the connection is still working . state = State . PING_SCHEDULED ; if ( pingFuture == null ) { pingFuture = scheduler . schedule ( sendPing , keepAliveTimeInNanos - stopw...
public class SgUtils { /** * $ { env . MY _ ENV _ VAR : - default } */ private static String resolveEnvVar ( String envVarName , String mode , boolean bc ) { } }
final String envVarValue = System . getenv ( envVarName ) ; if ( envVarValue == null || envVarValue . isEmpty ( ) ) { if ( mode != null && mode . startsWith ( ":-" ) && mode . length ( ) > 2 ) { return bc ? Hasher . hash ( mode . substring ( 2 ) . toCharArray ( ) ) : mode . substring ( 2 ) ; } else { return null ; } } ...
public class CachedObject { /** * Add the given object as user of this cached data . */ public synchronized void use ( Object user ) { } }
usage ++ ; lastUsage = System . currentTimeMillis ( ) ; if ( users != null ) users . add ( user ) ;
public class JShell { /** * Get the current value of a variable . * @ param snippet the variable Snippet whose value is queried . * @ return the current value of the variable referenced by snippet . * @ throws IllegalStateException if this { @ code JShell } instance is closed . * @ throws IllegalArgumentExcepti...
checkIfAlive ( ) ; checkValidSnippet ( snippet ) ; if ( snippet . status ( ) != Status . VALID ) { throw new IllegalArgumentException ( messageFormat ( "jshell.exc.var.not.valid" , snippet , snippet . status ( ) ) ) ; } String value ; try { value = executionControl ( ) . varValue ( snippet . classFullName ( ) , snippet...
public class ScalableStatistics { /** * Serializes the data structure into a byte array */ public byte [ ] asBytes ( ) { } }
byte [ ] className = tdigest . getClass ( ) . getName ( ) . getBytes ( Charsets . UTF_8 ) ; int vlen = exactValues == null ? 0 : numExactValues ; ByteBuffer buf = ByteBuffer . allocate ( 4 + 8 * 5 + 4 + 4 + 8 * vlen + 4 + className . length + tdigest . byteSize ( ) + 4 ) ; buf . putInt ( MAGIC_CODE ) ; // for sanity ch...
public class DeferredService { /** * Unregister information provided after class loader was created */ public void deregisterDeferredService ( ) { } }
Object obj = serviceReg . get ( ) ; if ( obj == null ) { // already deregistered so there is nothing to be done return ; } if ( obj instanceof CountDownLatch ) { // If someone else has the latch , then let them do whatever they are doing and we pretend // we ' ve already done the deregister . return ; } else if ( obj i...
public class ConnectorDescriptorImpl { /** * If not already created , a new < code > license < / code > element with the given value will be created . * Otherwise , the existing < code > license < / code > element will be returned . * @ return a new or existing instance of < code > LicenseType < ConnectorDescriptor...
Node node = model . getOrCreate ( "license" ) ; LicenseType < ConnectorDescriptor > license = new LicenseTypeImpl < ConnectorDescriptor > ( this , "license" , model , node ) ; return license ;
public class Association { /** * Returns for given parameter < i > _ id < / i > the instance of class * { @ link Association } . * @ param _ id id to search in the cache * @ return instance of class { @ link Association } * @ throws CacheReloadException on error */ public static Association get ( final long _id...
final Cache < Long , Association > cache = InfinispanCache . get ( ) . < Long , Association > getCache ( Association . IDCACHE ) ; if ( ! cache . containsKey ( _id ) && ! Association . getAssociationFromDB ( Association . SQL_ID , _id ) ) { cache . put ( _id , Association . NULL , 100 , TimeUnit . SECONDS ) ; } final A...
public class PaxExamRuntime { /** * Creates and starts a test container using options from a configuration class . * @ param configurationClassName * fully qualified class name of a configuration class . * @ return started test container * @ throws Exception when options cannot be parsed */ public static TestCo...
Option [ ] options = getConfigurationOptions ( configurationClassName ) ; ExamSystem system = DefaultExamSystem . create ( options ) ; TestContainer testContainer = PaxExamRuntime . createContainer ( system ) ; testContainer . start ( ) ; return testContainer ;
public class NodeManager { /** * Resolve a host name . * @ param host The host . * @ param type The resource type . * @ return The resolved form . */ public RequestedNode resolve ( String host , ResourceType type ) { } }
RunnableIndices indices = typeToIndices . get ( type ) ; return indices . getOrCreateRequestedNode ( host ) ;
public class FastMath { /** * Compute least significant bit ( Unit in Last Position ) for a number . * @ param x number from which ulp is requested * @ return ulp ( x ) */ public static float ulp ( float x ) { } }
if ( Float . isInfinite ( x ) ) { return Float . POSITIVE_INFINITY ; } return abs ( x - Float . intBitsToFloat ( Float . floatToIntBits ( x ) ^ 1 ) ) ;
public class FaultTolerantScheduler { /** * Schedules the specified task . * @ param task */ public void schedule ( TimerTask task , boolean checkIfAlreadyPresent ) { } }
final TimerTaskData taskData = task . getData ( ) ; final Serializable taskID = taskData . getTaskID ( ) ; task . setScheduler ( this ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Scheduling task with id " + taskID ) ; } // store the task and data final TimerTaskCacheData timerTaskCacheData = new TimerTask...
public class VMMService { /** * ( non - Javadoc ) * @ see com . ibm . websphere . security . wim . ProfileServiceLite # get ( com . ibm . wsspi . security . wim . model . Root ) */ @ Override public Root get ( Root root ) throws WIMException { } }
final String METHODNAME = "get" ; Root result = null ; if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , METHODNAME + " " + WIMTraceHelper . trace ( root ) ) ; } result = profileManager . get ( root ) ; if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , METHODNAME + " " + WIMTraceHelper . trace ( result ) ) ; } return...
public class H2O { /** * Submit to the correct priority queue */ public static < T extends H2OCountedCompleter > T submitTask ( T task ) { } }
int priority = task . priority ( ) ; if ( priority < LOW_PRIORITY_API_WORK ) LOW_PRIORITY_API_WORK_CLASS = task . getClass ( ) . toString ( ) ; assert MIN_PRIORITY <= priority && priority <= MAX_PRIORITY : "priority " + priority + " is out of range, expected range is < " + MIN_PRIORITY + "," + MAX_PRIORITY + ">" ; if (...
public class SqlContextImpl { /** * { @ inheritDoc } * @ see jp . co . future . uroborosql . fluent . SqlFluent # outParam ( java . lang . String , java . sql . SQLType ) */ @ Override public SqlContext outParam ( final String parameterName , final SQLType sqlType ) { } }
return param ( new OutParameter ( parameterName , sqlType ) ) ;
public class JDBCBlob { /** * Retrieves the byte position at which the specified byte array * < code > pattern < / code > begins within the < code > BLOB < / code > * value that this < code > Blob < / code > object represents . The * search for < code > pattern < / code > begins at position * < code > start < /...
final byte [ ] ldata = data ; checkValid ( ldata ) ; final int dlen = ldata . length ; if ( start < MIN_POS ) { throw Util . outOfRangeArgument ( "start: " + start ) ; } else if ( start > dlen || pattern == null ) { return - 1L ; } else { start -- ; } final int plen = pattern . length ; if ( plen == 0 || start > dlen -...
public class ZDT1 { /** * Returns the value of the ZDT1 function H . * @ param f First argument of the function H . * @ param g Second argument of the function H . */ protected double evalH ( double f , double g ) { } }
double h ; h = 1.0 - Math . sqrt ( f / g ) ; return h ;
public class NumberSelectorServiceImpl { /** * The main logic is : - Find a perfect match in DB using different formats . * - If not matched , use available Regexes in the organization . - If not * matched , try with the special * match . * @ param phone * @ param sourceOrganizationSid * @ param destinationOr...
if ( logger . isDebugEnabled ( ) ) { logger . debug ( "getMostOptimalIncomingPhoneNumber: " + phone + ",srcOrg:" + sourceOrganizationSid + ",destOrg:" + destinationOrganizationSid ) ; } List < String > numberQueries = createPhoneQuery ( phone ) ; NumberSelectionResult numberfound = findByNumber ( numberQueries , source...
public class AacSettingsMarshaller { /** * Marshall the given parameter object . */ public void marshall ( AacSettings aacSettings , ProtocolMarshaller protocolMarshaller ) { } }
if ( aacSettings == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( aacSettings . getBitrate ( ) , BITRATE_BINDING ) ; protocolMarshaller . marshall ( aacSettings . getCodingMode ( ) , CODINGMODE_BINDING ) ; protocolMarshaller . marshall ( a...
public class FileManagerImpl { /** * Main deallocation routine exposed in public interface . This routine * performs a disk read to read the size and then a disk write to mark * the size tag allocated . An optimization to avoid doing the read would * be to store the size of all allocated blocks in a hash table . ...
int size ; if ( readOnly ) { throw ( new FileManagerException ( "Attempt to deallocate in read only mode" ) ) ; } block = block - HDR_SIZE ; if ( block < FIRST_TAIL ) { throw ( new FileManagerException ( "Illegal block address passed to deallocate" ) ) ; } size = get_block_size ( block ) ; if ( size >= 0 ) { throw ( ne...
public class SDBaseOps { /** * Variance array reduction operation , optionally along specified dimensions < br > * Note that if keepDims = true , the output variable has the same rank as the input variable , * with the reduced dimensions having size 1 . This can be useful for later broadcast operations ( such as su...
validateNumerical ( "variance" , x ) ; SDVariable result = f ( ) . variance ( x , biasCorrected , keepDims , dimensions ) ; return updateVariableNameAndReference ( result , name ) ;
public class DomConfigurationWriter { /** * Gets the XML element that represents the { @ link DatastoreCatalog } . * @ return */ public Element getDatastoreCatalogElement ( ) { } }
final Element configurationFileDocumentElement = getDocumentElement ( ) ; final Element datastoreCatalogElement = getOrCreateChildElementByTagName ( configurationFileDocumentElement , "datastore-catalog" ) ; if ( datastoreCatalogElement == null ) { throw new IllegalStateException ( "Could not find <datastore-catalog> e...
public class CommonOps_DDF3 { /** * Returns the absolute value of the element in the matrix that has the smallest absolute value . < br > * < br > * Min { | a < sub > ij < / sub > | } for all i and j < br > * @ param a A matrix . Not modified . * @ return The max element value of the matrix . */ public static d...
double min = Math . abs ( a . a11 ) ; double tmp = Math . abs ( a . a12 ) ; if ( tmp < min ) min = tmp ; tmp = Math . abs ( a . a13 ) ; if ( tmp < min ) min = tmp ; tmp = Math . abs ( a . a21 ) ; if ( tmp < min ) min = tmp ; tmp = Math . abs ( a . a22 ) ; if ( tmp < min ) min = tmp ; tmp = Math . abs ( a . a23 ) ; if (...
public class Global { /** * Attributes to include in mapping . * @ param includedAttributes names of the attributes to include in the mapping * @ return this instance of JMapperGlobal */ public Global includedAttributes ( String ... includedAttributes ) { } }
for ( String attribute : includedAttributes ) global . attributes . add ( new LocalAttribute ( attribute ) . toXStream ( ) ) ; return this ;
public class ScreenInGridScreen { /** * SetupSFields Method . */ public void setupSFields ( ) { } }
this . getRecord ( ScreenIn . SCREEN_IN_FILE ) . getField ( ScreenIn . SCREEN_ITEM_NUMBER ) . setupDefaultView ( this . getNextLocation ( ScreenConstants . NEXT_LOGICAL , ScreenConstants . ANCHOR_DEFAULT ) , this , ScreenConstants . DEFAULT_DISPLAY ) ; this . getRecord ( ScreenIn . SCREEN_IN_FILE ) . getField ( ScreenI...
public class AmazonSQSExtendedClient { /** * Deletes the specified message from the specified queue and deletes the * message payload from Amazon S3 when necessary . You specify the message by * using the message ' s < code > receipt handle < / code > and not the * < code > message ID < / code > you received when...
if ( deleteMessageRequest == null ) { String errorMessage = "deleteMessageRequest cannot be null." ; LOG . error ( errorMessage ) ; throw new AmazonClientException ( errorMessage ) ; } deleteMessageRequest . getRequestClientOptions ( ) . appendUserAgent ( SQSExtendedClientConstants . USER_AGENT_HEADER ) ; if ( ! client...
public class CommandLine { /** * Delegates to the implementation of { @ link # executeHelpRequest ( ParseResult ) } . * @ deprecated use { @ link # executeHelpRequest ( ParseResult ) } instead * @ param parsedCommands the list of { @ code CommandLine } objects to check if help was requested * @ param out the { @ ...
// for backwards compatibility for ( CommandLine cmd : parsedCommands ) { cmd . setOut ( new PrintWriter ( out , true ) ) . setErr ( new PrintWriter ( err , true ) ) . setColorScheme ( colorScheme ) ; } return executeHelpRequest ( parsedCommands ) != null ;
public class AppUtil { /** * Starts the camera app in order to capture a picture . If an error occurs while starting the * camera app , an { @ link ActivityNotFoundException } will be thrown . * @ param activity * The activity , the captured picture should be passed to by calling its * < code > onActivityResult...
Condition . INSTANCE . ensureNotNull ( file , "The file may not be null" ) ; Condition . INSTANCE . ensureFileIsNoDirectory ( file , "The file must exist and must not be a directory" ) ; startCameraApp ( activity , requestCode , Uri . fromFile ( file ) ) ;
public class CarouselControlRenderer { /** * This methods receives and processes input made by the user . More * specifically , it checks whether the user has interacted with the current * b : carouselControl . The default implementation simply stores the input * value in the list of submitted values . If the val...
CarouselControl carouselControl = ( CarouselControl ) component ; if ( carouselControl . isDisabled ( ) ) { return ; } new AJAXRenderer ( ) . decode ( context , component ) ;
public class StoreRoutingPlan { /** * TODO : add unit test . */ public int getZoneNaryForNodesPartition ( int zoneId , int nodeId , int partitionId ) { } }
if ( cluster . getNodeById ( nodeId ) . getZoneId ( ) != zoneId ) { throw new VoldemortException ( "Node " + nodeId + " is not in zone " + zoneId + "! The node is in zone " + cluster . getNodeById ( nodeId ) . getZoneId ( ) ) ; } List < Integer > replicatingNodeIds = getReplicationNodeList ( partitionId ) ; int zoneNAr...
public class Level { /** * Adds a Content Specification Topic to the Level . If the Topic already has a parent , then it is removed from that parent * and added to this level . * @ param specTopic The Content Specification Topic to be added to the level . */ public void appendSpecTopic ( final SpecTopic specTopic )...
topics . add ( specTopic ) ; nodes . add ( specTopic ) ; if ( specTopic . getParent ( ) != null && specTopic . getParent ( ) instanceof Level ) { ( ( Level ) specTopic . getParent ( ) ) . removeSpecTopic ( specTopic ) ; } specTopic . setParent ( this ) ;
public class Document { /** * Returns all annotations contained within the document . * @ return List of annotations , which may be empty */ public List < Annotation > getAllAnnotations ( ) { } }
List < Annotation > ret = new ArrayList < Annotation > ( ) ; for ( StatementGroup sg : statementGroups ) { ret . addAll ( sg . getAllAnnotations ( ) ) ; } return ret ;
public class BaasUser { /** * Asynchronously requests to unfollow the user * @ param flags { @ link RequestOptions } * @ param handler an handler to be invoked when the request completes * @ return a { @ link com . baasbox . android . RequestToken } to manage the request */ public RequestToken unfollow ( int flag...
BaasBox box = BaasBox . getDefaultChecked ( ) ; Follow follow = new Follow ( box , false , this , flags , handler ) ; return box . submitAsync ( follow ) ;
public class AnalysisScreen { /** * This is field a potential index for analysis . * ( Override this to allow number fields to be keys ) . * @ param field The field to check . * @ return True if this is a potential key field . */ public boolean isKeyField ( BaseField field , int iSourceFieldSeq ) { } }
if ( field instanceof DateTimeField ) return true ; if ( field instanceof NumberField ) return false ; if ( iSourceFieldSeq == 0 ) return false ; // You must have at least one key field . return true ; // Typically any non - number is a key .
public class JsonNominatimClient { /** * { @ inheritDoc } * @ see fr . dudie . nominatim . client . NominatimClient # lookupAddress ( java . util . List ) */ @ Override public List < Address > lookupAddress ( final List < String > typeId ) throws IOException { } }
final NominatimLookupRequest q = new NominatimLookupRequest ( ) ; q . setQuery ( typeId ) ; return this . lookupAddress ( q ) ;
public class DefaultExamSystem { /** * Create a new system based on * this * . The forked System remembers the forked instances in * order to clear resources up ( if desired ) . */ @ Override public ExamSystem fork ( Option [ ] options ) { } }
try { ExamSystem sys = new DefaultExamSystem ( combine ( combinedOptions , options ) ) ; subsystems . add ( sys ) ; return sys ; } catch ( IOException exc ) { throw new TestContainerException ( exc ) ; }
public class ReaderInputStream { /** * Resets the StringReader . * @ exception IOException * if the StringReader fails to be reset */ @ Override public synchronized void reset ( ) throws IOException { } }
if ( in == null ) { throw new IOException ( "Stream Closed" ) ; } slack = null ; in . reset ( ) ;
public class UserGroupInformation { /** * Run the given action as the user . * @ param < T > the return type of the run method * @ param action the method to execute * @ return the value from the run method */ public < T > T doAs ( PrivilegedAction < T > action ) { } }
return Subject . doAs ( null , action ) ;
public class PortablePathCursor { /** * Sets the index to the given index without validating . If the index is out of bound the consecutive token ( ) call * will throw a runtime exception . * @ param indexToNavigateTo value to set the cursor ' s index to . */ void index ( int indexToNavigateTo ) { } }
this . index = 0 ; this . offset = 0 ; this . nextSplit = StringUtil . indexOf ( path , '.' , 0 ) ; this . token = null ; for ( int i = 1 ; i <= indexToNavigateTo ; i ++ ) { if ( ! advanceToNextToken ( ) ) { throw new IndexOutOfBoundsException ( "Index out of bound " + indexToNavigateTo + " in " + path ) ; } }
public class IterativeDataSet { /** * Closes the iteration . This method defines the end of the iterative program part . * @ param iterationResult The data set that will be fed back to the next iteration . * @ return The DataSet that represents the result of the iteration , after the computation has terminated . ...
return new BulkIterationResultSet < T > ( getExecutionEnvironment ( ) , getType ( ) , this , iterationResult ) ;
public class NotionalTokenizer { /** * 分词 * @ param text 文本 * @ return 分词结果 */ public static List < Term > segment ( char [ ] text ) { } }
List < Term > resultList = SEGMENT . seg ( text ) ; ListIterator < Term > listIterator = resultList . listIterator ( ) ; while ( listIterator . hasNext ( ) ) { if ( ! CoreStopWordDictionary . shouldInclude ( listIterator . next ( ) ) ) { listIterator . remove ( ) ; } } return resultList ;
public class Evaluator { /** * Add subscriptions for a given group . * @ param group * Name of the group . At Netflix this is typically the cluster that includes * the instance reporting data . * @ param subs * Set of subscriptions for the group . * @ return * This instance for chaining of update operatio...
List < Subscription > oldSubs = subscriptions . put ( group , subs ) ; if ( oldSubs == null ) { LOGGER . debug ( "added group {} with {} subscriptions" , group , subs . size ( ) ) ; } else { LOGGER . debug ( "updated group {}, {} subscriptions before, {} subscriptions now" , group , oldSubs . size ( ) , subs . size ( )...
public class RtfParser { /** * Handles control word tokens . Depending on the current * state a control word can lead to a state change . When * parsing the actual document contents , certain tabled * values are remapped . i . e . colors , fonts , styles , etc . * @ param ctrlWordData The control word to handle...
int result = errOK ; this . ctrlWordCount ++ ; // stats if ( debugParser ) { RtfParser . outputDebug ( this . rtfDoc , groupLevel , "DEBUG: handleCtrlWord=" + ctrlWordData . ctrlWord + " param=[" + ctrlWordData . param + "]" ) ; } if ( this . getTokeniserState ( ) == TOKENISER_SKIP_GROUP ) { this . ctrlWordSkippedCount...
public class EncodingUtils { /** * Get the JVM Converter for the specified encoding . * @ param encoding The encoding . * @ return The converter if it exists , otherwise return the encoding . */ public static String getJvmConverter ( String encoding ) { } }
init ( ) ; // String converter = ( String ) _ converterMap . get ( encoding . toLowerCase ( ) ) ; String converter = null ; com . ibm . wsspi . http . EncodingUtils encodingUtils = com . ibm . ws . webcontainer . osgi . WebContainer . getEncodingUtils ( ) ; if ( encodingUtils != null ) { converter = encodingUtils . get...
public class netbridge { /** * Use this API to fetch filtered set of netbridge resources . * filter string should be in JSON format . eg : " port : 80 , servicetype : HTTP " . */ public static netbridge [ ] get_filtered ( nitro_service service , String filter ) throws Exception { } }
netbridge obj = new netbridge ( ) ; options option = new options ( ) ; option . set_filter ( filter ) ; netbridge [ ] response = ( netbridge [ ] ) obj . getfiltered ( service , option ) ; return response ;
public class InternalXtextParser { /** * InternalXtext . g : 350:1 : ruleAbstractMetamodelDeclaration returns [ EObject current = null ] : ( this _ GeneratedMetamodel _ 0 = ruleGeneratedMetamodel | this _ ReferencedMetamodel _ 1 = ruleReferencedMetamodel ) ; */ public final EObject ruleAbstractMetamodelDeclaration ( ) ...
EObject current = null ; EObject this_GeneratedMetamodel_0 = null ; EObject this_ReferencedMetamodel_1 = null ; enterRule ( ) ; try { // InternalXtext . g : 356:2 : ( ( this _ GeneratedMetamodel _ 0 = ruleGeneratedMetamodel | this _ ReferencedMetamodel _ 1 = ruleReferencedMetamodel ) ) // InternalXtext . g : 357:2 : ( ...
public class HttpMethodBase { /** * Generates all the required request { @ link Header header } s * to be submitted via the given { @ link HttpConnection connection } . * This implementation adds < tt > User - Agent < / tt > , < tt > Host < / tt > , * < tt > Cookie < / tt > , < tt > Authorization < / tt > , < tt ...
LOG . trace ( "enter HttpMethodBase.addRequestHeaders(HttpState, " + "HttpConnection)" ) ; addHostRequestHeader ( state , conn ) ; addCookieRequestHeader ( state , conn ) ; addProxyConnectionHeader ( state , conn ) ;
public class ControlConnection { /** * Initializes the control connection . If it is already initialized , this is a no - op and all * parameters are ignored . * @ param listenToClusterEvents whether to register for TOPOLOGY _ CHANGE and STATUS _ CHANGE events . * If the control connection has already initialized...
RunOrSchedule . on ( adminExecutor , ( ) -> singleThreaded . init ( listenToClusterEvents , reconnectOnFailure , useInitialReconnectionSchedule ) ) ; return singleThreaded . initFuture ;
public class AbstractControllerServer { /** * { @ inheritDoc } * @ throws InterruptedException { @ inheritDoc } * @ throws CouldNotPerformException { @ inheritDoc } */ @ Override public synchronized void deactivate ( ) throws InterruptedException , CouldNotPerformException { } }
manageLock . lockWrite ( this ) ; try { try { validateInitialization ( ) ; } catch ( InvalidStateException ex ) { // was never initialized ! return ; } // skip initial data sync if still running if ( initialDataSyncFuture != null && ! initialDataSyncFuture . isDone ( ) ) { initialDataSyncFuture . cancel ( true ) ; } lo...
public class BaseRedisQueue { /** * Name of the Redis sorted - set to store ephemeral message ids . * @ param redisSortedSetName * @ return */ public BaseRedisQueue < ID , DATA > setRedisSortedSetName ( String redisSortedSetName ) { } }
_redisSortedSetName = redisSortedSetName ; this . redisSortedSetName = _redisSortedSetName . getBytes ( QueueUtils . UTF8 ) ; return this ;
public class LocalQueuePoint { /** * / * The method returns the iterator containing the items stored on the queue point in messagestore . It retrieves * the messages starting from position at fromIndex in the subcursor holding the linkedlist of all items , and * ending at toIndex in the subcursor . The total retrie...
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getQueuedMessageIterator(int fromIndex= " + fromIndex + ", int toIndex= " + toIndex + ", int totalNumberOfMsgsPerPage= " + totalNumberOfMsgsPerPage ) ; List < ControlAdapter > messages = new ArrayList < ControlAdapter > ( )...
public class FileBasedSource { /** * Initialize the logger . * @ param state Source state */ protected void initLogger ( SourceState state ) { } }
StringBuilder sb = new StringBuilder ( ) ; sb . append ( "[" ) ; sb . append ( Strings . nullToEmpty ( state . getProp ( ConfigurationKeys . SOURCE_ENTITY ) ) ) ; sb . append ( "]" ) ; MDC . put ( "sourceInfo" , sb . toString ( ) ) ;
public class EnvironmentLogger { /** * True if the level is loggable */ @ Override public final boolean isLoggable ( Level level ) { } }
if ( level == null ) return false ; int intValue = level . intValue ( ) ; if ( intValue < _finestEffectiveLevelValue ) return false ; else if ( ! _hasLocalEffectiveLevel ) { return true ; } else { Integer localValue = _localEffectiveLevel . get ( ) ; if ( localValue != null ) { int localIntValue = localValue . intValue...
public class CommerceAddressRestrictionUtil { /** * Returns the commerce address restriction with the primary key or throws a { @ link NoSuchAddressRestrictionException } if it could not be found . * @ param commerceAddressRestrictionId the primary key of the commerce address restriction * @ return the commerce add...
return getPersistence ( ) . findByPrimaryKey ( commerceAddressRestrictionId ) ;
public class ComboButton { /** * a simple test app */ public static void main ( final String [ ] args ) { } }
LookAndFeelManager . get ( ) . init ( ) ; final ComboButton comboButton1 = new ComboButton ( ) ; comboButton1 . addButton ( "Foo!" , IconUtils . ACTION_ADD_DARK , true ) ; comboButton1 . addButton ( "Boo!" , IconUtils . ACTION_REMOVE_DARK , true ) ; final ComboButton comboButton2 = new ComboButton ( ) ; comboButton2 . ...
public class DefaultTypeCache { /** * ( non - Javadoc ) * @ see * org . apache . atlas . typesystem . types . cache . TypeCache # putAll ( java * . util . Collection ) */ @ Override public void putAll ( Collection < IDataType > types ) throws AtlasException { } }
for ( IDataType type : types ) { assertValidType ( type ) ; types_ . put ( type . getName ( ) , type ) ; }
public class StreamExecutionEnvironment { /** * Adds a new Kryo default serializer to the Runtime . * @ param type * The class of the types serialized with the given serializer . * @ param serializerClass * The class of the serializer to use . */ public void addDefaultKryoSerializer ( Class < ? > type , Class <...
config . addDefaultKryoSerializer ( type , serializerClass ) ;
public class HtmlDocletWriter { /** * Adds the summary content . * @ param element the Element for which the summary will be generated * @ param htmltree the documentation tree to which the summary will be added */ public void addSummaryComment ( Element element , Content htmltree ) { } }
addSummaryComment ( element , utils . getFirstSentenceTrees ( element ) , htmltree ) ;
public class XPathParser { /** * The value of the Literal is the sequence of characters inside * the " or ' characters > . * Literal : : = ' " ' [ ^ " ] * ' " ' * @ throws javax . xml . transform . TransformerException */ protected void Literal ( ) throws javax . xml . transform . TransformerException { } }
int last = m_token . length ( ) - 1 ; char c0 = m_tokenChar ; char cX = m_token . charAt ( last ) ; if ( ( ( c0 == '\"' ) && ( cX == '\"' ) ) || ( ( c0 == '\'' ) && ( cX == '\'' ) ) ) { // Mutate the token to remove the quotes and have the XString object // already made . int tokenQueuePos = m_queueMark - 1 ; m_ops . m...
public class LeafNode { /** * Publishes multiple events to the node . Same rules apply as in { @ link # publish ( Item ) } . * In addition , if { @ link ConfigureForm # isPersistItems ( ) } = false , only the last item in the input * list will get stored on the node , assuming it stores the last sent item . * @ p...
publish ( items ) ;
public class SpecializedOps_ZDRM { /** * Returns the magnitude squared of the complex element along the diagonal with the largest magnitude < br > * < br > * Max { | a < sub > ij < / sub > | ^ 2 } for all i and j < br > * @ param a A matrix . Not modified . * @ return The max magnitude squared */ public static ...
final int size = Math . min ( a . numRows , a . numCols ) ; int rowStride = a . getRowStride ( ) ; double max = 0 ; for ( int i = 0 ; i < size ; i ++ ) { int index = i * rowStride + i * 2 ; double real = a . data [ index ] ; double imaginary = a . data [ index + 1 ] ; double m = real * real + imaginary * imaginary ; if...
public class Model { /** * Generates a XML document from content of this model . * @ param pretty pretty format ( human readable ) , or one line text . * @ param declaration true to include XML declaration at the top * @ param attributeNames list of attributes to include . No arguments = = include all attributes ...
StringBuilder sb = new StringBuilder ( ) ; if ( declaration ) { sb . append ( "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" ) ; if ( pretty ) { sb . append ( '\n' ) ; } } toXmlP ( sb , pretty , "" , attributeNames ) ; return sb . toString ( ) ;
public class CommandFaceDescriptor { /** * { @ inheritDoc } */ public void setLabelInfo ( CommandButtonLabelInfo labelInfo ) { } }
if ( labelInfo == null ) { labelInfo = CommandButtonLabelInfo . BLANK_BUTTON_LABEL ; } CommandButtonLabelInfo old = this . labelInfo ; this . labelInfo = labelInfo ; firePropertyChange ( LABEL_INFO_PROPERTY , old , this . labelInfo ) ;
public class Guid { /** * Returns the 6 byte pseudo IEEE 802 Media Access Control ( MAC ) address . * Since the IEEE 802 Media Access Control ( MAC ) address of the local Network * Interface Card ( NIC ) cannot be retrieved in Java , a pseudo IEEE 802 MAC address * is required . The pseudo IEEE 802 MAC address is...
byte [ ] ieee802Addr = new byte [ 6 ] ; byte [ ] currentTime = String . valueOf ( uniqueTimeStamp ) . getBytes ( ) ; byte [ ] localHostAddress = null ; try { localHostAddress = InetAddress . getLocalHost ( ) . getAddress ( ) ; } catch ( UnknownHostException u ) { localHostAddress = new byte [ ] { 127 , 0 , 0 , 1 } ; } ...
public class SoapServerFaultResponseActionBuilder { /** * Sets the charset name for this send action builder ' s attachment . * @ param charsetName * @ return */ public SoapServerFaultResponseActionBuilder charset ( String charsetName ) { } }
if ( ! getAction ( ) . getAttachments ( ) . isEmpty ( ) ) { getAction ( ) . getAttachments ( ) . get ( getAction ( ) . getAttachments ( ) . size ( ) - 1 ) . setCharsetName ( charsetName ) ; } return this ;