signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class NFVORequestor { /** * Returns a ConfigurationAgent with which requests regarding Configurations can be sent to the * NFVO . * @ return a ConfigurationAgent */ public synchronized ConfigurationAgent getConfigurationAgent ( ) { } }
if ( this . configurationAgent == null ) { if ( isService ) { this . configurationAgent = new ConfigurationAgent ( this . serviceName , this . projectId , this . sslEnabled , this . nfvoIp , this . nfvoPort , this . version , this . serviceKey ) ; } else { this . configurationAgent = new ConfigurationAgent ( this . use...
public class JoltUtils { /** * Navigate a JSON tree ( made up of Maps and Lists ) to " lookup " the value * at a particular path , but will return the supplied default value if * there are any problems . * @ param source the source JSON object ( Map , List , String , Number ) * @ param paths varargs path you wa...
Object destination = source ; for ( Object path : paths ) { if ( path == null || destination == null ) { return defaultValue ; } if ( destination instanceof Map ) { Map destinationMap = ( Map ) destination ; if ( ! destinationMap . containsKey ( path ) ) { return defaultValue ; } else { destination = destinationMap . g...
public class LeaderRole { /** * Appends an entry to the Raft log and compacts logs if necessary . * @ param entry the entry to append * @ param < E > the entry type * @ return a completable future to be completed once the entry has been appended */ private < E extends RaftLogEntry > CompletableFuture < Indexed < ...
return appendAndCompact ( entry , 0 ) ;
public class IndexingTagHandler { /** * All fields that were not seen until the end of this message are missing and will be indexed with their default * value or null if none was declared . The null value is replaced with a special null token placeholder because * Lucene cannot index nulls . */ private void indexMi...
for ( FieldDescriptor fieldDescriptor : messageContext . getMessageDescriptor ( ) . getFields ( ) ) { if ( ! messageContext . isFieldMarked ( fieldDescriptor . getNumber ( ) ) ) { Object defaultValue = fieldDescriptor . getJavaType ( ) == JavaType . MESSAGE || fieldDescriptor . hasDefaultValue ( ) ? fieldDescriptor . g...
public class NNStorageDirectoryRetentionManager { /** * Check if we have not exceeded the maximum number of backups . */ static void cleanUpAndCheckBackup ( Configuration conf , File origin ) throws IOException { } }
// get all backups String [ ] backups = getBackups ( origin ) ; File root = origin . getParentFile ( ) ; // maximum total number of backups int copiesToKeep = conf . getInt ( NN_IMAGE_COPIES_TOKEEP , NN_IMAGE_COPIES_TOKEEP_DEFAULT ) ; // days to keep , if set to 0 than keep only last backup int daysToKeep = conf . getI...
public class Environment { /** * And Set the same * @ param key key * @ param value value * @ return return Environment instance */ public Environment add ( @ NonNull String key , @ NonNull Object value ) { } }
return set ( key , value ) ;
public class Stopwatch { /** * Stop the stopwatch and record the statistics for the latest run . This method does nothing if the stopwatch is not currently * { @ link # isRunning ( ) running } * @ see # isRunning ( ) */ public void stop ( ) { } }
if ( this . isRunning ( ) ) { long duration = System . nanoTime ( ) - this . lastStarted ; this . lastStarted = 0l ; this . stats . add ( new Duration ( duration ) ) ; }
public class SleeSipProviderImpl { /** * ( non - Javadoc ) * @ see * javax . sip . SipProvider # getNewClientTransaction ( javax . sip . message . Request ) */ public ClientTransaction getNewClientTransaction ( Request request ) throws TransactionUnavailableException { } }
checkState ( ) ; final SIPClientTransaction ct = ( SIPClientTransaction ) provider . getNewClientTransaction ( request ) ; final ClientTransactionWrapper ctw = new ClientTransactionWrapper ( ct , ra ) ; ctw . setActivity ( true ) ; final DialogWrapper dw = ctw . getDialogWrapper ( ) ; if ( dw != null ) { dw . addOngoin...
public class JarHash { /** * Given a path name ( without preceding and appending " / " ) , * return the names of all file and directory names contained * in the path location ( not recursive ) . * @ param path - name of resource path * @ return - list of resource names at that path */ public static List < Strin...
Set < String > resList = new HashSet < > ( ) ; // subdirectories can cause duplicate entries try { // Java doesn ' t allow simple exploration of resources as directories // when the resources are inside a jar file . This searches the contents // of the jar to get the list URL classUrl = JarHash . class . getResource ( ...
public class V1JsExprTranslator { /** * Helper function to translate a variable or data reference . * < p > Examples : * < pre > * $ boo - - > opt _ data . boo ( var ref ) * < / pre > * @ param variableMappings The current replacement JS expressions for the local variables ( and * foreach - loop special fun...
Preconditions . checkArgument ( matcher . matches ( ) ) ; String firstPart = matcher . group ( 1 ) ; StringBuilder exprTextSb = new StringBuilder ( ) ; // - - - - - Translate the first key , which may be a variable or a data key - - - - - String translation = getLocalVarTranslation ( firstPart , variableMappings ) ; if...
public class ProbeHandlerThread { /** * If the probe yields responses from the handler , then send this method will * send the responses to the given respondTo addresses . * @ param respondToURL - address to send the response to * @ param payloadType - JSON or XML * @ param payload - the actual service records ...
// This method will likely need some thought and care in the error handling // and error reporting // It ' s a had job at the moment . String responseStr = null ; String contentType = null ; // MIME type boolean success = true ; switch ( payloadType ) { case "XML" : { responseStr = payload . toXML ( ) ; contentType = "...
public class xen_nsvpx_image { /** * < pre > * Use this operation to get NetScaler XVA file . * < / pre > */ public static xen_nsvpx_image [ ] get ( nitro_service client ) throws Exception { } }
xen_nsvpx_image resource = new xen_nsvpx_image ( ) ; resource . validate ( "get" ) ; return ( xen_nsvpx_image [ ] ) resource . get_resources ( client ) ;
public class PdfPageLabels { /** * Adds or replaces a page label . */ public void addPageLabel ( PdfPageLabelFormat format ) { } }
addPageLabel ( format . physicalPage , format . numberStyle , format . prefix , format . logicalPage ) ;
public class LinkedList { /** * Find the previous link before the start link , visible to a transaction , before the unlockPoint . * Caller must be synchronized on LinkedList . * @ param start * the link where the search for the next link is to start , * null implies the tail of the list . * @ param transacti...
if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , "previousLink" , new Object [ ] { start , transaction , new Long ( transactionUnlockPoint ) } ) ; Token previousToken = null ; Link previousLink = null ; // The link to return . if ( start == null ) { // Start at the ...
public class BaseOsgiServlet { /** * process an HTML get or post . * @ exception ServletException From inherited class . * @ exception IOException From inherited class . */ public void service ( HttpServletRequest req , HttpServletResponse resp ) throws ServletException , IOException { } }
boolean fileFound = sendResourceFile ( req , resp ) ; if ( ! fileFound ) resp . sendError ( HttpServletResponse . SC_NOT_FOUND , "File not found" ) ; // super . service ( req , resp ) ;
public class Precedence { /** * Instantiate discrete constraints to force a single VM to migrate after a set of VMs . * @ param vmsBefore the VMs to migrate before the other one { @ see vmAfter } * @ param vmAfter the ( single ) VM to migrate after the others { @ see vmsBefore } * @ return the associated list of ...
return newPrecedence ( vmsBefore , Collections . singleton ( vmAfter ) ) ;
public class Transformation2D { /** * Sets the transformation to be a flip around the Y axis . Flips the Y * coordinates so that the y0 becomes y1 and vice verse . * @ param y0 * The Y coordinate to flip . * @ param y1 * The Y coordinate to flip to . */ public void setFlipY ( double y0 , double y1 ) { } }
xx = 1 ; xy = 0 ; xd = 0 ; yx = 0 ; yy = - 1 ; yd = y0 + y1 ;
public class CmsResourceInfoTable { /** * Initializes the table . < p > * @ param resources List of resources * @ param user List user */ private void init ( Set < CmsResource > resources , List < CmsUser > user ) { } }
addStyleName ( "o-no-padding" ) ; m_container = new IndexedContainer ( ) ; m_container . addContainerProperty ( PROP_ELEMENT , CmsResourceInfo . class , null ) ; for ( CmsResource res : resources ) { Item item = m_container . addItem ( res ) ; if ( item != null ) { // Item is null if resource is dependency of multiple ...
public class FactoryBackgroundModel { /** * Creates an instance of { @ link BackgroundStationaryGaussian } . * @ param config Configures the background model * @ param imageType Type of input image * @ return new instance of the background model */ public static < T extends ImageBase < T > > BackgroundStationaryG...
config . checkValidity ( ) ; BackgroundStationaryGaussian < T > ret ; switch ( imageType . getFamily ( ) ) { case GRAY : ret = new BackgroundStationaryGaussian_SB ( config . learnRate , config . threshold , imageType . getImageClass ( ) ) ; break ; case PLANAR : ret = new BackgroundStationaryGaussian_PL ( config . lear...
public class Solo { /** * Clears edit text for the specified widget * @ param editText - Identifier for the correct widget ( ex : android . widget . EditText @ 409af0b0 ) - Can be found using getViews */ public static void clearEditText ( String editText ) throws Exception { } }
Client . getInstance ( ) . map ( Constants . ROBOTIUM_SOLO , "clearEditText" , editText ) ;
public class LogUniform { /** * Sets the minimum and maximum values for this distribution * @ param min the minimum value , must be positive * @ param max the maximum value , must be larger than { @ code min } */ public void setMinMax ( double min , double max ) { } }
if ( min <= 0 || Double . isNaN ( min ) || Double . isInfinite ( min ) ) throw new IllegalArgumentException ( "min value must be positive, not " + min ) ; else if ( min >= max || Double . isNaN ( max ) || Double . isInfinite ( max ) ) throw new IllegalArgumentException ( "max (" + max + ") must be larger than min (" + ...
public class HelpViewerProxy { /** * Sends a request to the remote viewer . * @ param helpRequest The request to send . * @ param startRemoteViewer If true and the remote viewer is not running , start it . */ private void sendRequest ( InvocationRequest helpRequest , boolean startRemoteViewer ) { } }
this . helpRequest = helpRequest ; if ( helpRequest != null ) { if ( remoteViewerActive ( ) ) { remoteQueue . sendRequest ( helpRequest ) ; this . helpRequest = null ; } else if ( startRemoteViewer ) { startRemoteViewer ( ) ; } else { this . helpRequest = null ; } }
public class ActiveDirectory { private Hashtable < String , Object > setupBasicProperties ( Hashtable < String , Object > env , String providerUrl ) throws NamingException { } }
// set the tracing level if ( tracing ) env . put ( "com.sun.jndi.ldap.trace.ber" , System . err ) ; // always use ldap v3 env . put ( "java.naming.ldap.version" , "3" ) ; // use jndi provider if ( env . get ( Context . INITIAL_CONTEXT_FACTORY ) == null ) env . put ( Context . INITIAL_CONTEXT_FACTORY , DEFAULT_CTX ) ; ...
public class UrlsInterface { /** * Lookup the username for the specified User URL . * @ param url * The user profile URL * @ return The username * @ throws FlickrException */ public String lookupUser ( String url ) throws FlickrException { } }
Map < String , Object > parameters = new HashMap < String , Object > ( ) ; parameters . put ( "method" , METHOD_LOOKUP_USER ) ; parameters . put ( "url" , url ) ; Response response = transport . get ( transport . getPath ( ) , parameters , apiKey , sharedSecret ) ; if ( response . isError ( ) ) { throw new FlickrExcept...
public class appfwjsoncontenttype { /** * Use this API to fetch appfwjsoncontenttype resources of given names . */ public static appfwjsoncontenttype [ ] get ( nitro_service service , String jsoncontenttypevalue [ ] ) throws Exception { } }
if ( jsoncontenttypevalue != null && jsoncontenttypevalue . length > 0 ) { appfwjsoncontenttype response [ ] = new appfwjsoncontenttype [ jsoncontenttypevalue . length ] ; appfwjsoncontenttype obj [ ] = new appfwjsoncontenttype [ jsoncontenttypevalue . length ] ; for ( int i = 0 ; i < jsoncontenttypevalue . length ; i ...
public class diff_match_patch { /** * Crush the diff into an encoded string which describes the operations * required to transform text1 into text2 . E . g . = 3 \ t - 2 \ t + ing - > Keep 3 * chars , delete 2 chars , insert ' ing ' . Operations are tab - separated . * Inserted text is escaped using % xx notation...
StringBuilder text = new StringBuilder ( ) ; for ( Diff aDiff : diffs ) { switch ( aDiff . operation ) { case INSERT : try { text . append ( "+" ) . append ( URLEncoder . encode ( aDiff . text , "UTF-8" ) . replace ( '+' , ' ' ) ) . append ( "\t" ) ; } catch ( UnsupportedEncodingException e ) { // Not likely on modern ...
public class LogUtils { /** * Logs a string to the console using the source object ' s name as the log tag at the verbose * level . If the source object is null , the default tag ( see { @ link LogUtils # TAG } ) is used . * @ param source The object that generated the log event . * @ param format A format string...
log ( source , Log . VERBOSE , format , args ) ;
public class AbstractTraceRegion { /** * Produces trees from a sorted list of locations . If the locations overlap , they ' ll be splitted automatically to * fulfill the contract of invariant of trace regions . */ protected List < AbstractTraceRegion > toInvertedTraceRegions ( List < Pair < ILocationData , AbstractTr...
List < AbstractTraceRegion > result = Lists . newArrayListWithCapacity ( 2 ) ; TraceRegion current = null ; int currentEndOffset = 0 ; outer : for ( int i = 0 ; i < locations . size ( ) ; i ++ ) { // avoid concurrent modification exceptions Pair < ILocationData , AbstractTraceRegion > nextPair = locations . get ( i ) ;...
public class ImageArchiveUtil { /** * Read the ( possibly compressed ) image archive stream provided and return the archive manifest . * If there is no manifest found , then null is returned . Incomplete manifests are returned * with as much information parsed as possible . * @ param inputStream * @ return the ...
Map < String , JsonParseException > parseExceptions = new LinkedHashMap < > ( ) ; Map < String , JsonElement > parsedEntries = new LinkedHashMap < > ( ) ; try ( TarArchiveInputStream tarStream = new TarArchiveInputStream ( createUncompressedStream ( inputStream ) ) ) { TarArchiveEntry tarEntry ; Gson gson = new Gson ( ...
public class NavigableTextPane { /** * scroll the specified line into view , with a margin of ' margin ' pixels * above and below */ public void scrollLineToVisible ( int line , int margin ) { } }
int maxMargin = ( parentHeight ( ) - 20 ) / 2 ; if ( margin > maxMargin ) { margin = Math . max ( 0 , maxMargin ) ; } scrollLineToVisibleImpl ( line , margin ) ;
public class DataSourceConnectionSupplierImpl { /** * dataSourceNameで指定したデータソースに対するReadOnlyオプションの指定 * @ param dataSourceName データソース名 * @ param readOnly readOnlyを指定する場合は < code > true < / code > */ public void setReadOnly ( final String dataSourceName , final boolean readOnly ) { } }
Map < String , String > props = getConnPropsByDataSourceName ( dataSourceName ) ; props . put ( PROPS_READ_ONLY , Boolean . toString ( readOnly ) ) ;
public class StandardsSubscription { /** * @ param standardsInput * @ return Returns a reference to this object so that method calls can be chained together . */ public StandardsSubscription withStandardsInput ( java . util . Map < String , String > standardsInput ) { } }
setStandardsInput ( standardsInput ) ; return this ;
public class PooledExecutionServiceConfiguration { /** * Adds a new default pool with the provided minimum and maximum . * The default pool will be used by any service requiring threads but not specifying a pool alias . * It is not mandatory to have a default pool . * But without one < i > ALL < / i > services ha...
if ( alias == null ) { throw new NullPointerException ( "Pool alias cannot be null" ) ; } if ( defaultAlias == null ) { addPool ( alias , minSize , maxSize ) ; defaultAlias = alias ; } else { throw new IllegalArgumentException ( "'" + defaultAlias + "' is already configured as the default pool" ) ; }
public class KiteConnect { /** * Get the profile details of the use . * @ return Profile is a POJO which contains profile related data . * @ throws IOException is thrown when there is connection error . * @ throws KiteException is thrown for all Kite trade related errors . */ public Profile getProfile ( ) throws ...
String url = routes . get ( "user.profile" ) ; JSONObject response = new KiteRequestHandler ( proxy ) . getRequest ( url , apiKey , accessToken ) ; return gson . fromJson ( String . valueOf ( response . get ( "data" ) ) , Profile . class ) ;
public class ContinuousDistributions { /** * Calculates probability pi , ai under dirichlet distribution * @ param pi The vector with probabilities . * @ param ai The vector with pseudocounts . * @ return The probability */ public static double dirichletPdf ( double [ ] pi , double [ ] ai ) { } }
double probability = 1.0 ; double sumAi = 0.0 ; double productGammaAi = 1.0 ; double tmp ; int piLength = pi . length ; for ( int i = 0 ; i < piLength ; ++ i ) { tmp = ai [ i ] ; sumAi += tmp ; productGammaAi *= gamma ( tmp ) ; probability *= Math . pow ( pi [ i ] , tmp - 1 ) ; } probability *= gamma ( sumAi ) / produc...
public class SCSICommandParser { /** * { @ inheritDoc } */ @ Override protected final int serializeBytes1to3 ( ) { } }
int line = 0 ; line |= taskAttributes . value ( ) << Constants . TWO_BYTES_SHIFT ; if ( writeExpectedFlag ) { line |= WRITE_EXPECTED_FLAG_MASK ; } if ( readExpectedFlag ) { line |= READ_EXPECTED_FLAG_MASK ; } return line ;
public class BetaDistribution { /** * Returns the regularized incomplete beta function I _ x ( a , b ) by quadrature , * based on the book " Numerical Recipes " . * @ param alpha Parameter a * @ param beta Parameter b * @ param x Parameter x * @ return result */ protected static double regularizedIncBetaQuadr...
final double alphapbeta = alpha + beta ; final double a1 = alpha - 1.0 ; final double b1 = beta - 1.0 ; final double mu = alpha / alphapbeta ; final double lnmu = FastMath . log ( mu ) ; final double lnmuc = FastMath . log1p ( - mu ) ; double t = FastMath . sqrt ( alpha * beta / ( alphapbeta * alphapbeta * ( alphapbeta...
public class JsMessageImpl { /** * Provide the contribution of this part to the estimated encoded length * Subclasses that wish to contribute to a quick guess at the length of a * flattened / encoded message should override this method , invoke their * superclass and add on their own contribution . * @ return i...
// Make a guess at the contribution of the header . The header size is // reasonably constant , with the exception of the forward / reverse routing // paths . int total = 400 ; // Approx 400 bytes in normal use header fields int size = 0 ; // Only get the FRP list out of the message if it is NOT the singleton empty lis...
public class QueryRpc { /** * Parses the " rate " section of the query string and returns an instance * of the RateOptions class that contains the values found . * The format of the rate specification is rate [ { counter [ , # [ , # ] ] } ] . * @ param rate If true , then the query is set as a rate query and the ...
if ( ! rate || spec . length ( ) == 4 ) { return new RateOptions ( false , Long . MAX_VALUE , RateOptions . DEFAULT_RESET_VALUE ) ; } if ( spec . length ( ) < 6 ) { throw new BadRequestException ( "Invalid rate options specification: " + spec ) ; } String [ ] parts = Tags . splitString ( spec . substring ( 5 , spec . l...
public class MonitoringProxyActivator { /** * Create a jar file that contains the proxy code that will live in the * boot delegation package . * @ return the jar file containing the proxy code to append to the boot * class path * @ throws IOException if a file I / O error occurs */ JarFile createBootProxyJar ( ...
File dataFile = bundleContext . getDataFile ( "boot-proxy.jar" ) ; // Create the file if it doesn ' t already exist if ( ! dataFile . exists ( ) ) { dataFile . createNewFile ( ) ; } // Generate a manifest Manifest manifest = createBootJarManifest ( ) ; // Create the file FileOutputStream fileOutputStream = new FileOutp...
public class SessionDataManager { /** * Returns true if the item with < code > identifier < / code > was deleted in this session . Within a transaction , * isDelete on an Item may return false ( because the item has been saved ) even if that Item is not in * persistent storage ( because the transaction has not yet ...
ItemState lastState = changesLog . getItemState ( identifier ) ; if ( lastState != null && lastState . isDeleted ( ) ) { return true ; } return false ;
public class TransactionOutput { /** * Returns a copy of the output detached from its containing transaction , if need be . */ public TransactionOutput duplicateDetached ( ) { } }
return new TransactionOutput ( params , null , Coin . valueOf ( value ) , Arrays . copyOf ( scriptBytes , scriptBytes . length ) ) ;
public class AtomContainerDiscretePartitionRefinerImpl { /** * Gets the automorphism group of the atom container . By default it uses an * initial partition based on the element symbols ( so all the carbons are in * one cell , all the nitrogens in another , etc ) . If this behaviour is not * desired , then use th...
setup ( atomContainer ) ; super . refine ( refinable . getInitialPartition ( ) ) ; return super . getAutomorphismGroup ( ) ;
public class MessageServiceConfigProcessor { /** * Tries to find a sensible default AMF channel for the default MessageService * If a application - level default is set on the MessageBroker , that will be used . Otherwise will use the first * AMFEndpoint from services - config . xml that it finds with polling enabl...
if ( ! CollectionUtils . isEmpty ( broker . getDefaultChannels ( ) ) ) { return ; } Iterator < String > channels = broker . getChannelIds ( ) . iterator ( ) ; while ( channels . hasNext ( ) ) { Endpoint endpoint = broker . getEndpoint ( channels . next ( ) ) ; if ( endpoint instanceof AMFEndpoint && isPollingEnabled ( ...
public class ParameterValueImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public boolean eIsSet ( int featureID ) { } }
switch ( featureID ) { case BpsimPackage . PARAMETER_VALUE__INSTANCE : return INSTANCE_EDEFAULT == null ? instance != null : ! INSTANCE_EDEFAULT . equals ( instance ) ; case BpsimPackage . PARAMETER_VALUE__RESULT : return isSetResult ( ) ; case BpsimPackage . PARAMETER_VALUE__VALID_FOR : return VALID_FOR_EDEFAULT == nu...
public class InstanceFleetStateChangeReasonMarshaller { /** * Marshall the given parameter object . */ public void marshall ( InstanceFleetStateChangeReason instanceFleetStateChangeReason , ProtocolMarshaller protocolMarshaller ) { } }
if ( instanceFleetStateChangeReason == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( instanceFleetStateChangeReason . getCode ( ) , CODE_BINDING ) ; protocolMarshaller . marshall ( instanceFleetStateChangeReason . getMessage ( ) , MESSAGE_...
public class QueryFactory { /** * Method declaration * @ param classToSearchFrom * @ param criteria * @ param distinct * @ return QueryByCriteria */ public static QueryByCriteria newQuery ( Class classToSearchFrom , Criteria criteria , boolean distinct ) { } }
criteria = addCriteriaForOjbConcreteClasses ( getRepository ( ) . getDescriptorFor ( classToSearchFrom ) , criteria ) ; return new QueryByCriteria ( classToSearchFrom , criteria , distinct ) ;
public class Bootstrap { /** * Delegate method for { @ link ServiceProvider # getServices ( Class ) } . * @ param serviceType the service type . * @ return the service found , or { @ code null } . * @ see ServiceProvider # getServices ( Class ) */ public static < T > T getService ( Class < T > serviceType ) { } }
List < T > services = getServiceProvider ( ) . getServices ( serviceType ) ; return services . stream ( ) . findFirst ( ) . orElse ( null ) ;
public class TypicalLoginAssist { /** * Save login info as user bean to session . * @ param userEntity The entity of the found user . ( NotNull ) * @ return The user bean saved in session . ( NotNull ) */ protected USER_BEAN saveLoginInfoToSession ( USER_ENTITY userEntity ) { } }
regenerateSessionId ( ) ; logger . debug ( "...Saving login info to session" ) ; final USER_BEAN userBean = createUserBean ( userEntity ) ; sessionManager . setAttribute ( getUserBeanKey ( ) , userBean ) ; return userBean ;
public class PerformanceCollector { /** * Start measurement of user and cpu time . * @ param label description of code block between startTiming and * stopTiming , used to label output */ public void startTiming ( String label ) { } }
if ( mPerfWriter != null ) mPerfWriter . writeStartTiming ( label ) ; mPerfMeasurement = new Bundle ( ) ; mPerfMeasurement . putParcelableArrayList ( METRIC_KEY_ITERATIONS , new ArrayList < Parcelable > ( ) ) ; mExecTime = SystemClock . uptimeMillis ( ) ; mCpuTime = Process . getElapsedCpuTime ( ) ;
public class DeviceAppearanceImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public Object eGet ( int featureID , boolean resolve , boolean coreType ) { } }
switch ( featureID ) { case AfplibPackage . DEVICE_APPEARANCE__DEV_APP : return getDevApp ( ) ; case AfplibPackage . DEVICE_APPEARANCE__RESERVED : return getReserved ( ) ; } return super . eGet ( featureID , resolve , coreType ) ;
public class Gen { /** * Derived visitor method : check whether CharacterRangeTable * should be emitted , if so , put a new entry into CRTable * and call method to generate bytecode . * If not , just call method to generate bytecode . * @ see # genStat ( JCTree , Env ) * @ param tree The tree to be visited . ...
if ( ! genCrt ) { genStat ( tree , env ) ; return ; } int startpc = code . curCP ( ) ; genStat ( tree , env ) ; if ( tree . hasTag ( Tag . BLOCK ) ) crtFlags |= CRT_BLOCK ; code . crt . put ( tree , crtFlags , startpc , code . curCP ( ) ) ;
public class AbstractDirector { /** * Checks if installResources contains any resources * @ param installResources the list of lists containing Install Resources * @ return true if all lists are empty */ boolean isEmpty ( List < List < RepositoryResource > > installResources ) { } }
if ( installResources == null ) return true ; for ( List < RepositoryResource > mrList : installResources ) { if ( ! mrList . isEmpty ( ) ) return false ; } return true ;
public class AbstractMinMaxTextBox { /** * set distance value should be increased / decreased when using up / down buttons . * @ param pstep step distance */ public void setStep ( final String pstep ) { } }
try { this . setStep ( Integer . valueOf ( pstep ) ) ; } catch ( final NumberFormatException e ) { this . setStep ( ( Integer ) null ) ; }
public class PortComponentType { /** * { @ inheritDoc } */ @ Override public boolean handleChild ( DDParser parser , String localName ) throws ParseException { } }
if ( "description" . equals ( localName ) ) { DescriptionType description = new DescriptionType ( ) ; parser . parse ( description ) ; this . description = description ; return true ; } if ( "display-name" . equals ( localName ) ) { DisplayNameType display_name = new DisplayNameType ( ) ; parser . parse ( display_name ...
public class HttpMethodBase { /** * Returns the specified request header . Note that header - name matching is * case insensitive . < tt > null < / tt > will be returned if either * < i > headerName < / i > is < tt > null < / tt > or there is no matching header for * < i > headerName < / i > . * @ param headerN...
if ( headerName == null ) { return null ; } else { return getRequestHeaderGroup ( ) . getCondensedHeader ( headerName ) ; }
public class GroupVersionMarshaller { /** * Marshall the given parameter object . */ public void marshall ( GroupVersion groupVersion , ProtocolMarshaller protocolMarshaller ) { } }
if ( groupVersion == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( groupVersion . getConnectorDefinitionVersionArn ( ) , CONNECTORDEFINITIONVERSIONARN_BINDING ) ; protocolMarshaller . marshall ( groupVersion . getCoreDefinitionVersionArn (...
public class GraphObjectModificationState { /** * Update * node * changelog for Verb . link */ public void updateChangeLog ( final Principal user , final Verb verb , final String linkType , final String linkId , final String object , final Direction direction ) { } }
if ( Settings . ChangelogEnabled . getValue ( ) ) { final JsonObject obj = new JsonObject ( ) ; obj . add ( "time" , toElement ( System . currentTimeMillis ( ) ) ) ; obj . add ( "userId" , toElement ( user . getUuid ( ) ) ) ; obj . add ( "userName" , toElement ( user . getName ( ) ) ) ; obj . add ( "verb" , toElement (...
public class DatabasesInner { /** * Renames a database . * @ 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 databaseName The name of the databa...
if ( resourceGroupName == null ) { throw new IllegalArgumentException ( "Parameter resourceGroupName is required and cannot be null." ) ; } if ( serverName == null ) { throw new IllegalArgumentException ( "Parameter serverName is required and cannot be null." ) ; } if ( databaseName == null ) { throw new IllegalArgumen...
public class ResolveStageBaseImpl { /** * { @ inheritDoc } * @ see org . jboss . shrinkwrap . resolver . api . ResolveStage # addDependencies ( Coordinate [ ] ) */ @ Override public final RESOLVESTAGETYPE addDependencies ( final MavenDependency ... dependencies ) throws IllegalArgumentException { } }
if ( dependencies == null || dependencies . length == 0 ) { throw new IllegalArgumentException ( "At least one coordinate must be specified" ) ; } for ( final MavenDependency dependency : dependencies ) { if ( dependency == null ) { throw new IllegalArgumentException ( "null dependency not permitted" ) ; } final MavenD...
public class AbstractModelControllerClient { /** * Execute a request . * @ param executionContext the execution context * @ return the future result * @ throws IOException */ private AsyncFuture < OperationResponse > execute ( final OperationExecutionContext executionContext ) throws IOException { } }
return executeRequest ( new AbstractManagementRequest < OperationResponse , OperationExecutionContext > ( ) { @ Override public byte getOperationType ( ) { return ModelControllerProtocol . EXECUTE_ASYNC_CLIENT_REQUEST ; } @ Override protected void sendRequest ( final ActiveOperation . ResultHandler < OperationResponse ...
public class JSDocInfoBuilder { /** * Records a visibility . * @ return { @ code true } if the visibility was recorded and { @ code false } * if it was already defined */ public boolean recordVisibility ( Visibility visibility ) { } }
if ( currentInfo . getVisibility ( ) == null ) { populated = true ; currentInfo . setVisibility ( visibility ) ; return true ; } else { return false ; }
public class BFNImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public void eUnset ( int featureID ) { } }
switch ( featureID ) { case AfplibPackage . BFN__RS_NAME : setRSName ( RS_NAME_EDEFAULT ) ; return ; case AfplibPackage . BFN__TRIPLETS : getTriplets ( ) . clear ( ) ; return ; } super . eUnset ( featureID ) ;
public class Parser { private void assembleDissectorPhases ( ) throws InvalidDissectorException { } }
for ( final Dissector dissector : allDissectors ) { final String inputType = dissector . getInputType ( ) ; if ( inputType == null ) { throw new InvalidDissectorException ( "Dissector returns null on getInputType(): [" + dissector . getClass ( ) . getCanonicalName ( ) + "]" ) ; } final List < String > outputs = dissect...
public class WriteRequestCommand { /** * < pre > * Cancel , close and error will be handled by standard gRPC stream APIs . * < / pre > * < code > optional . alluxio . proto . dataserver . CreateUfsFileOptions create _ ufs _ file _ options = 6 ; < / code > */ public alluxio . proto . dataserver . Protocol . Create...
return createUfsFileOptions_ == null ? alluxio . proto . dataserver . Protocol . CreateUfsFileOptions . getDefaultInstance ( ) : createUfsFileOptions_ ;
public class RestRepository { /** * consume the scroll */ Scroll scroll ( String scrollId , ScrollReader reader ) throws IOException { } }
InputStream scroll = client . scroll ( scrollId ) ; try { return reader . read ( scroll ) ; } finally { if ( scroll instanceof StatsAware ) { stats . aggregate ( ( ( StatsAware ) scroll ) . stats ( ) ) ; } }
public class ClusterTierManagerClientEntityFactory { /** * Attempts to create and configure the { @ code EhcacheActiveEntity } in the Ehcache clustered server . * @ param identifier the instance identifier for the { @ code EhcacheActiveEntity } * @ param config the { @ code EhcacheActiveEntity } configuration to us...
Hold existingMaintenance = maintenanceHolds . get ( identifier ) ; try ( Hold localMaintenance = ( existingMaintenance == null ? createAccessLockFor ( identifier ) . tryWriteLock ( ) : null ) ) { if ( localMaintenance == null && existingMaintenance == null ) { throw new EntityBusyException ( "Unable to obtain maintenan...
public class ServiceEngine { /** * Note : The caller must lock the specified ServiceContext ! */ protected Object internalSearchAndInvokeWithBlocking ( AbstractServiceContext context , String mName , String mDescriptor , Object [ ] arguments ) throws Exception { } }
// FIXME : reuse providers already looked - up ! long timeout = context . getTimeout ( ) ; long searchStart = System . currentTimeMillis ( ) ; Synchroniser sync = new Synchroniser ( ) ; final String serviceName = context . serviceClass . getName ( ) ; synchronized ( sync ) { // wait at most one third of the timeout for...
public class BeliefPropagation { /** * Computes the product of all messages being sent to a node , optionally excluding messages sent * from another node or two . * Upon completion , prod will be multiplied by the product of all incoming messages to node , * except for the message from exclNode1 / exclNode2 if sp...
for ( int nb = 0 ; nb < bg . numNbsT1 ( v ) ; nb ++ ) { if ( nb == excl1 || nb == excl2 ) { // Don ' t include messages to these neighbors . continue ; } // Get message from neighbor to this node . VarTensor nbMsg = msgs [ bg . opposingT1 ( v , nb ) ] ; // Since the node is a variable , this is an element - wise produc...
public class ProxyTask { /** * Get the next ( String ) param . * @ param strName The param name ( in most implementations this is optional ) . * @ param properties The temporary remote session properties * @ return The next param as a string . */ public Object getNextObjectParam ( InputStream in , String strName ...
String strParam = this . getNextStringParam ( in , strName , properties ) ; strParam = Base64 . decode ( strParam ) ; return org . jbundle . thin . base . remote . proxy . transport . BaseTransport . convertStringToObject ( strParam ) ;
public class ConfigureForm { /** * Sets the node type . * @ param type The node type */ public void setNodeType ( NodeType type ) { } }
addField ( ConfigureNodeFields . node_type , FormField . Type . list_single ) ; setAnswer ( ConfigureNodeFields . node_type . getFieldName ( ) , getListSingle ( type . toString ( ) ) ) ;
public class Parser { /** * Decides if it ' s possible to format provided Strings into calculated number of columns while the output will not exceed * terminal width * @ param displayList * @ param numRows * @ param terminalWidth * @ return true if it ' s possible to format strings to columns and false otherw...
int numColumns = displayList . size ( ) / numRows ; if ( displayList . size ( ) % numRows > 0 ) { numColumns ++ ; } int [ ] columnSizes = calculateColumnSizes ( displayList , numColumns , numRows , terminalWidth ) ; int totalSize = 0 ; for ( int columnSize : columnSizes ) { totalSize += columnSize ; } return totalSize ...
public class NotifierImpl { /** * { @ inheritDoc } */ @ Override public boolean removeListener ( NotificationListener listenerToRemove ) { } }
// Get the listener that is registered with the delegate and remove it ArtifactListener delegateListener = this . listenerDelegates . remove ( listenerToRemove ) ; return this . delegateNotifier . removeListener ( delegateListener ) ;
public class ModifyFpgaImageAttributeRequest { /** * The AWS account IDs . This parameter is valid only when modifying the < code > loadPermission < / code > attribute . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setUserIds ( java . util . Collection ) }...
if ( this . userIds == null ) { setUserIds ( new com . amazonaws . internal . SdkInternalList < String > ( userIds . length ) ) ; } for ( String ele : userIds ) { this . userIds . add ( ele ) ; } return this ;
public class ArrayMatrix { /** * { @ inheritDoc } */ public void setColumn ( int column , DoubleVector values ) { } }
checkIndices ( values . length ( ) - 1 , column ) ; for ( int row = 0 ; row < rows ; ++ row ) matrix [ getIndex ( row , column ) ] = values . get ( row ) ;
public class Options { /** * Returns the JavaScript statement corresponding to options . */ public CharSequence getJavaScriptOptions ( ) { } }
StringBuilder sb = new StringBuilder ( ) ; this . optionsRenderer . renderBefore ( sb ) ; int count = 0 ; for ( Entry < String , Object > entry : options . entrySet ( ) ) { String key = entry . getKey ( ) ; Object value = entry . getValue ( ) ; if ( value instanceof IModelOption < ? > ) value = ( ( IModelOption < ? > )...
public class LeafNode { /** * Purges the node of all items . * < p > Note : Some implementations may keep the last item * sent . * @ throws XMPPErrorException * @ throws NoResponseException if there was no response from the server . * @ throws NotConnectedException * @ throws InterruptedException */ public ...
PubSub request = createPubsubPacket ( Type . set , new NodeExtension ( PubSubElementType . PURGE_OWNER , getId ( ) ) ) ; pubSubManager . getConnection ( ) . createStanzaCollectorAndSend ( request ) . nextResultOrThrow ( ) ;
public class ItemsSketch { /** * Returns an array of Rows that include frequent items , estimates , upper and lower bounds * given a threshold and an ErrorCondition . If the threshold is lower than getMaximumError ( ) , * then getMaximumError ( ) will be used instead . * < p > The method first examines all active...
return sortItems ( threshold > getMaximumError ( ) ? threshold : getMaximumError ( ) , errorType ) ;
public class Expression { /** * Checks if the provided value matches the variable pattern , if one is defined . Always true if no * pattern is defined . * @ param value to check . * @ return true if it matches . */ boolean matches ( String value ) { } }
if ( pattern == null ) { return true ; } return pattern . matcher ( value ) . matches ( ) ;
public class DToA { /** * / * Return the number ( 0 through 32 ) of most significant zero bits in x . */ private static int hi0bits ( int x ) { } }
int k = 0 ; if ( ( x & 0xffff0000 ) == 0 ) { k = 16 ; x <<= 16 ; } if ( ( x & 0xff000000 ) == 0 ) { k += 8 ; x <<= 8 ; } if ( ( x & 0xf0000000 ) == 0 ) { k += 4 ; x <<= 4 ; } if ( ( x & 0xc0000000 ) == 0 ) { k += 2 ; x <<= 2 ; } if ( ( x & 0x80000000 ) == 0 ) { k ++ ; if ( ( x & 0x40000000 ) == 0 ) return 32 ; } return...
public class BaseAbilityBot { /** * Gets the user with the specified username . * @ param username the username of the required user * @ return the user */ protected User getUser ( String username ) { } }
Integer id = userIds ( ) . get ( username . toLowerCase ( ) ) ; if ( id == null ) { throw new IllegalStateException ( format ( "Could not find ID corresponding to username [%s]" , username ) ) ; } return getUser ( id ) ;
public class AWSWAFRegionalClient { /** * Permanently deletes a < a > RuleGroup < / a > . You can ' t delete a < code > RuleGroup < / code > if it ' s still used in any * < code > WebACL < / code > objects or if it still includes any rules . * If you just want to remove a < code > RuleGroup < / code > from a < code...
request = beforeClientExecution ( request ) ; return executeDeleteRuleGroup ( request ) ;
public class SchemaStoreItemStream { /** * Override addItem ( ) to ensure we maintain our index */ public void addItem ( Item item , Transaction tran ) throws OutOfCacheSpace , StreamIsFull , ProtocolException , TransactionException , PersistenceException , SevereMessageStoreException { } }
super . addItem ( item , tran ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "addItem" ) ; if ( item instanceof SchemaStoreItem ) { addToIndex ( ( SchemaStoreItem ) item ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . deb...
public class TransactionLock { /** * Releases the lock on the transaction . * @ param objectManagerState within which the transaction is unlocked . */ protected final void unLock ( ObjectManagerState objectManagerState ) { } }
synchronized ( objectManagerState . transactionUnlockSequenceLock ) { unlockSequence = objectManagerState . getNewGlobalTransactionUnlockSequence ( ) ; lockingTransaction = null ; } // synchronized .
public class FileUtils { /** * Ensure writeable directory . * If doesn ' t exist , we attempt creation . * @ param dir Directory to test for exitence and is writeable . * @ return The passed < code > dir < / code > . * @ exception IOException If passed directory does not exist and is not * createable , or dir...
if ( ! dir . exists ( ) ) { boolean success = dir . mkdirs ( ) ; if ( ! success ) { throw new IOException ( "Failed to create directory: " + dir ) ; } } else { if ( ! dir . canWrite ( ) ) { throw new IOException ( "Dir " + dir . getAbsolutePath ( ) + " not writeable." ) ; } else if ( ! dir . isDirectory ( ) ) { throw n...
public class URLParser { /** * Breaks down a standard query string ( ie " param1 = foo & param2 = bar " ) * @ return an empty map if the query is empty or null */ public static Map < String , String > parseQuery ( String query ) { } }
Map < String , String > result = new LinkedHashMap < String , String > ( ) ; if ( query != null ) { for ( String keyValue : query . split ( "&" ) ) { String [ ] pair = keyValue . split ( "=" ) ; result . put ( StringUtils . urlDecode ( pair [ 0 ] ) , StringUtils . urlDecode ( pair [ 1 ] ) ) ; } } return result ;
public class SocketExtensions { /** * Writes the given Object . * @ param serverName * The Name from the receiver ( Server ) . * @ param port * The port who listen the receiver . * @ param objectToSend * The Object to send . * @ throws IOException * Signals that an I / O exception has occurred . */ publ...
final InetAddress inetAddress = InetAddress . getByName ( serverName ) ; writeObject ( inetAddress , port , objectToSend ) ;
public class GlobalVarReferenceMap { /** * Resets global var reference map with the new provide map . * @ param globalRefMap The reference map result of a * { @ link ReferenceCollectingCallback } pass collected from the whole AST . */ private void resetGlobalVarReferences ( Map < Var , ReferenceCollection > globalR...
refMap = new LinkedHashMap < > ( ) ; for ( Entry < Var , ReferenceCollection > entry : globalRefMap . entrySet ( ) ) { Var var = entry . getKey ( ) ; if ( var . isGlobal ( ) ) { refMap . put ( var . getName ( ) , entry . getValue ( ) ) ; } }
public class ApiOvhCore { /** * Connect to the OVH API using a consumerKey contains in your ovh config file * or environment variable * @ return an ApiOvhCore authenticate by consumerKey */ public static ApiOvhCore getInstance ( ) { } }
ApiOvhCore core = new ApiOvhCore ( ) ; // core . _ consumerKey = core . config . getConsumerKey ( ) ; core . _consumerKey = core . getConsumerKeyOrNull ( ) ; // config . getConsumerKey ( ) ; if ( core . _consumerKey == null ) { File file = ApiOvhConfigBasic . getOvhConfig ( ) ; String location = ApiOvhConfigBasic . con...
public class Matrix4f { /** * Apply rotation of < code > angles . z < / code > radians about the Z axis , followed by a rotation of < code > angles . y < / code > radians about the Y axis and * followed by a rotation of < code > angles . x < / code > radians about the X axis . * When used with a right - handed coor...
return rotateZYX ( angles . z , angles . y , angles . x ) ;
public class MultidimensionalReward { /** * Merge in another multidimensional reward structure . * @ param other * the other multidimensional reward structure . */ public void add ( MultidimensionalReward other ) { } }
for ( Map . Entry < Integer , Float > entry : other . map . entrySet ( ) ) { Integer dimension = entry . getKey ( ) ; Float reward_value = entry . getValue ( ) ; this . add ( dimension . intValue ( ) , reward_value . floatValue ( ) ) ; }
public class TableLayout { /** * Adds a new cell to the current grid * @ param cell the td component */ public void addCell ( TableLayoutCell cell ) { } }
GridBagConstraints constraints = cell . getConstraints ( ) ; constraints . insets = new Insets ( cellpadding , cellpadding , cellpadding , cellpadding ) ; add ( cell . getComponent ( ) , constraints ) ;
public class HttpSender { /** * Send and receive a HttpMessage . * @ param msg * @ param isFollowRedirect * @ throws HttpException * @ throws IOException * @ see # sendAndReceive ( HttpMessage , HttpRequestConfig ) */ public void sendAndReceive ( HttpMessage msg , boolean isFollowRedirect ) throws IOException...
log . debug ( "sendAndReceive " + msg . getRequestHeader ( ) . getMethod ( ) + " " + msg . getRequestHeader ( ) . getURI ( ) + " start" ) ; msg . setTimeSentMillis ( System . currentTimeMillis ( ) ) ; try { notifyRequestListeners ( msg ) ; if ( ! isFollowRedirect || ! ( msg . getRequestHeader ( ) . getMethod ( ) . equa...
public class CircularImageView { /** * Checkable */ @ Override public void setChecked ( final boolean checked ) { } }
if ( mChecked == checked ) return ; if ( mAllowCheckStateAnimation ) { final int duration = 150 ; final Interpolator interpolator = new DecelerateInterpolator ( ) ; ObjectAnimator animation = ObjectAnimator . ofFloat ( this , "scaleX" , 1f , 0f ) ; animation . setDuration ( duration ) ; animation . setInterpolator ( in...
public class Mac { /** * Processes the given array of bytes and finishes the MAC operation . * < p > A call to this method resets this < code > Mac < / code > object to the * state it was in when previously initialized via a call to * < code > init ( Key ) < / code > or * < code > init ( Key , AlgorithmParamete...
chooseFirstProvider ( ) ; if ( initialized == false ) { throw new IllegalStateException ( "MAC not initialized" ) ; } update ( input ) ; return doFinal ( ) ;
public class NodeDataIndexing { /** * Property data . * @ return PropertyData */ public PropertyData getProperty ( String name ) { } }
return properties == null ? null : properties . get ( name ) ;
public class UICommands { /** * Uses the given converter to convert to a nicer UI value and return the JSON safe version */ public static Object convertValueToSafeJson ( Converter converter , Object value ) { } }
value = Proxies . unwrap ( value ) ; if ( isJsonObject ( value ) ) { return value ; } if ( converter != null ) { // TODO converters ususally go from String - > CustomType ? try { Object converted = converter . convert ( value ) ; if ( converted != null ) { value = converted ; } } catch ( Exception e ) { // ignore - inv...
public class XLogPDescriptor { /** * Gets the carbonsCount attribute of the XLogPDescriptor object . * @ param ac Description of the Parameter * @ param atom Description of the Parameter * @ return The carbonsCount value */ private int getCarbonsCount ( IAtomContainer ac , IAtom atom ) { } }
List < IAtom > neighbours = ac . getConnectedAtomsList ( atom ) ; int ccounter = 0 ; for ( IAtom neighbour : neighbours ) { if ( neighbour . getSymbol ( ) . equals ( "C" ) ) { if ( ! neighbour . getFlag ( CDKConstants . ISAROMATIC ) ) { ccounter += 1 ; } } } return ccounter ;
public class UploadApi { /** * Method to upload an attachment to Facebook ' s server in order to use it * later . Requires the pages _ messaging permission . * @ param attachmentType * the type of attachment to upload to Facebook . Please notice * that currently Facebook supports only image , audio , video and ...
AttachmentPayload payload = new AttachmentPayload ( attachmentUrl , true ) ; Attachment attachment = new Attachment ( attachmentType , payload ) ; AttachmentMessage message = new AttachmentMessage ( attachment ) ; FbBotMillMessageResponse toSend = new FbBotMillMessageResponse ( null , message ) ; return FbBotMillNetwor...
public class ImplOrientationAverageGradientIntegral { /** * Compute the gradient while checking for border conditions */ protected double computeWeighted ( double tl_x , double tl_y , double samplePeriod , SparseImageGradient < T , G > g ) { } }
// add 0.5 to c _ x and c _ y to have it round tl_x += 0.5 ; tl_y += 0.5 ; double Dx = 0 , Dy = 0 ; int i = 0 ; for ( int y = 0 ; y < sampleWidth ; y ++ ) { int pixelsY = ( int ) ( tl_y + y * samplePeriod ) ; for ( int x = 0 ; x < sampleWidth ; x ++ , i ++ ) { int pixelsX = ( int ) ( tl_x + x * samplePeriod ) ; double ...