signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class JavaUtils { /** * Returns the annotation or { @ code null } if the element is not annotated with that type .
* < b > Note : < / b > This step is necessary due to issues with external class loaders ( e . g . Maven ) .
* The classes may not be identical and are therefore compared by FQ class name . */
pu... | final Optional < Annotation > annotation = Stream . of ( annotatedElement . getAnnotations ( ) ) . filter ( a -> a . annotationType ( ) . getName ( ) . equals ( annotationClass . getName ( ) ) ) . findAny ( ) ; return ( A ) annotation . orElse ( null ) ; |
public class TransportLayerImpl { /** * / * ( non - Javadoc )
* @ see tuwien . auto . calimero . mgmt . TransportLayer # destroyDestination
* ( tuwien . auto . calimero . mgmt . Destination ) */
public void destroyDestination ( Destination d ) { } } | // method invocation is idempotent
synchronized ( proxies ) { final AggregatorProxy p = ( AggregatorProxy ) proxies . get ( d . getAddress ( ) ) ; if ( p == null ) return ; if ( p . getDestination ( ) == d ) { proxies . remove ( d . getAddress ( ) ) ; d . destroy ( ) ; } else logger . warn ( "not owner of " + d . getAd... |
public class SpiderController { /** * Clears the previous process . */
public void reset ( ) { } } | visitedGet . clear ( ) ; visitedPost . clear ( ) ; for ( SpiderParser parser : parsers ) { parser . removeSpiderParserListener ( this ) ; } |
public class ProtocolProcessor { /** * Second phase of a publish QoS2 protocol , sent by publisher to the broker . Search the stored message and publish
* to all interested subscribers . */
void processPubRel ( String clientID , int messageID ) { } } | Log . trace ( "PUB --PUBREL--> SRV processPubRel invoked for clientID {} ad messageID {}" , clientID , messageID ) ; String publishKey = String . format ( "%s%d" , clientID , messageID ) ; PublishEvent evt = m_storageService . retrieveQoS2Message ( publishKey ) ; final String topic = evt . getTopic ( ) ; final Abstract... |
public class Mapper { /** * Gets the mapped collection for an object instance or Class reference .
* @ param object the object to process
* @ return the collection name
* @ morphia . internal
* @ deprecated no replacement is planned */
@ Deprecated public String getCollectionName ( final Object object ) { } } | if ( object == null ) { throw new IllegalArgumentException ( ) ; } final MappedClass mc = getMappedClass ( object ) ; return mc . getCollectionName ( ) ; |
public class MatlabSparseMatrixBuilder { /** * { @ inheritDoc } */
public synchronized int addColumn ( Vector col ) { } } | DoubleVector column = Vectors . asDouble ( col ) ; if ( isFinished ) throw new IllegalStateException ( "Cannot add columns to a MatrixBuilder that is finished" ) ; if ( column instanceof SparseVector ) { SparseVector s = ( SparseVector ) column ; for ( int r : s . getNonZeroIndices ( ) ) { // NB : Matlab sparse format ... |
public class AbstractNode { /** * Adds a new leaf entry to this node ' s children and returns the index of the
* entry in this node ' s children array . An UnsupportedOperationException will
* be thrown if the entry is not a leaf entry or this node is not a leaf node .
* @ param entry the leaf entry to be added
... | // entry is not a leaf entry
if ( ! ( entry instanceof LeafEntry ) ) { throw new UnsupportedOperationException ( "Entry is not a leaf entry!" ) ; } // this is a not a leaf node
if ( ! isLeaf ( ) ) { throw new UnsupportedOperationException ( "Node is not a leaf node!" ) ; } // leaf node
return addEntry ( entry ) ; |
public class EventSubscriptionsInner { /** * List all regional event subscriptions under an Azure subscription for a topic type .
* List all event subscriptions from the given location under a specific Azure subscription and topic type .
* @ param location Name of the location
* @ param topicTypeName Name of the ... | return listRegionalBySubscriptionForTopicTypeWithServiceResponseAsync ( location , topicTypeName ) . map ( new Func1 < ServiceResponse < List < EventSubscriptionInner > > , List < EventSubscriptionInner > > ( ) { @ Override public List < EventSubscriptionInner > call ( ServiceResponse < List < EventSubscriptionInner > ... |
public class LongDecode { /** * Decodes the ordinal fixed bit value to actual fixed bit width value . */
public static int decodeBitWidth ( int n ) { } } | if ( n >= ONE . ordinal ( ) && n <= TWENTY_FOUR . ordinal ( ) ) { return n + 1 ; } else if ( n == TWENTY_SIX . ordinal ( ) ) { return 26 ; } else if ( n == TWENTY_EIGHT . ordinal ( ) ) { return 28 ; } else if ( n == THIRTY . ordinal ( ) ) { return 30 ; } else if ( n == THIRTY_TWO . ordinal ( ) ) { return 32 ; } else if... |
public class MercatorUtils { /** * Returns bounds of the given tile in EPSG : 3857 coordinates
* @ param tx tile x .
* @ param ty tile y .
* @ param zoom zoomlevel .
* @ param tileSize tile size .
* @ return [ minx , miny , maxx , maxy ] */
public static double [ ] tileBounds3857 ( int tx , int ty , int zoom ... | double [ ] min = pixelsToMeters ( tx * tileSize , ty * tileSize , zoom , tileSize ) ; double minx = min [ 0 ] , miny = min [ 1 ] ; double [ ] max = pixelsToMeters ( ( tx + 1 ) * tileSize , ( ty + 1 ) * tileSize , zoom , tileSize ) ; double maxx = max [ 0 ] , maxy = max [ 1 ] ; return new double [ ] { minx , miny , maxx... |
public class ClasspathHelper { /** * Returns a distinct collection of URLs from a single URL based on the Manifest information .
* The { @ code MANIFEST . MF } file can contain a { @ code Class - Path } entry that defines additional
* jar files to be included on the classpath . This method takes a single URL , trie... | final Collection < URL > result = new ArrayList < URL > ( ) ; result . add ( url ) ; try { final String part = cleanPath ( url ) ; File jarFile = new File ( part ) ; JarFile myJar = new JarFile ( part ) ; URL validUrl = tryToGetValidUrl ( jarFile . getPath ( ) , new File ( part ) . getParent ( ) , part ) ; if ( validUr... |
public class DefaultVersionedCatalog { /** * Note that the PlanSpecifier billing period must refer here to the recurring phase one when a plan name isn ' t specified */
private StaticCatalog getStaticCatalog ( final PlanSpecifier spec , final DateTime requestedDate , final DateTime subscriptionChangePlanDate ) throws C... | final CatalogPlanEntry entry = findCatalogPlanEntry ( new PlanRequestWrapper ( spec ) , requestedDate , subscriptionChangePlanDate ) ; return entry . getStaticCatalog ( ) ; |
public class DateUtil { /** * 标准化日期 , 默认处理以空格区分的日期时间格式 , 空格前为日期 , 空格后为时间 : < br >
* 将以下字符替换为 " - "
* < pre >
* < / pre >
* 将以下字符去除
* < pre >
* < / pre >
* 将以下字符替换为 " : "
* < pre >
* < / pre >
* 当末位是 " : " 时去除之 ( 不存在毫秒时 )
* @ param dateStr 日期时间字符串
* @ return 格式化后的日期字符串 */
private static String no... | if ( StrUtil . isBlank ( dateStr ) ) { return dateStr ; } // 日期时间分开处理
final List < String > dateAndTime = StrUtil . splitTrim ( dateStr , ' ' ) ; final int size = dateAndTime . size ( ) ; if ( size < 1 || size > 2 ) { // 非可被标准处理的格式
return dateStr ; } final StringBuilder builder = StrUtil . builder ( ) ; // 日期部分 ( " \ "... |
public class Choice2 { /** * Static factory method for wrapping a value of type < code > A < / code > in a { @ link Choice2 } .
* @ param a the value
* @ param < A > the first possible type
* @ param < B > the second possible type
* @ return the wrapped value as a { @ link Choice2 } & lt ; A , B & gt ; */
publi... | return new _A < > ( a ) ; |
public class Activator { /** * { @ inheritDoc } */
public void stop ( BundleContext bundleContext ) throws Exception { } } | LOG . debug ( "Unbinding " + RemoteBundleContext . class . getSimpleName ( ) ) ; m_registry . unbind ( RemoteBundleContext . class . getName ( ) ) ; UnicastRemoteObject . unexportObject ( m_remoteBundleContext , true ) ; m_registry = null ; m_remoteBundleContext = null ; LOG . info ( "Remote Bundle Context stopped" ) ; |
public class FilePermissionHelper { /** * Checks whether a private key file has the ' right ' permissions
* @ param privateKeyFile
* the file to be checked
* @ throws IOException
* if an error occurs checking file attributes
* @ throws FilePermissionError
* if the permissions are not correct */
public stati... | for ( PosixFilePermission p : PRIVATE_KEY_PERMS ) { try { matchesFilePermissions ( privateKeyFile , p ) ; return ; } catch ( FilePermissionError e ) { } } final String errorMessage = String . format ( "Wrong file permissions on file %s. Required permissions are: %s " , privateKeyFile , PRIVATE_KEY_PERMS_STR ) ; throw n... |
public class Bson { /** * Write to the supplied stream the binary BSON representation of the supplied in - memory { @ link Document } .
* @ param bson the BSON object or BSON value ; may not be null
* @ param stream the output stream ; may not be null
* @ throws IOException if there was a problem writing to the s... | getBsonWriter ( ) . write ( bson , stream ) ; |
public class DetachDiskRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( DetachDiskRequest detachDiskRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( detachDiskRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( detachDiskRequest . getDiskName ( ) , DISKNAME_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMes... |
public class GVRCamera { /** * Set the background color .
* If you don ' t set the background color , the default is an opaque black :
* { @ link Color # BLACK } , 0xff00000.
* @ param color
* An Android 32 - bit ( ARGB ) { @ link Color } , such as you get from
* { @ link Resources # getColor ( int ) } */
pub... | setBackgroundColorR ( Colors . byteToGl ( Color . red ( color ) ) ) ; setBackgroundColorG ( Colors . byteToGl ( Color . green ( color ) ) ) ; setBackgroundColorB ( Colors . byteToGl ( Color . blue ( color ) ) ) ; setBackgroundColorA ( Colors . byteToGl ( Color . alpha ( color ) ) ) ; |
public class JmsSyncProducer { /** * Destroy method closing JMS session and connection */
public void destroy ( ) { } } | JmsUtils . closeSession ( session ) ; if ( connection != null ) { ConnectionFactoryUtils . releaseConnection ( connection , endpointConfiguration . getConnectionFactory ( ) , true ) ; } |
public class Gather { /** * Returns a map whose values are the delegate items and
* whose keys are the result of applying < code > keyMaker < / code > to each value . */
public < K > Map < K , T > asMap ( Function < T , K > keyMaker ) { } } | Map < K , T > map = Maps . newHashMap ( ) ; foreach ( Funcs . addTo ( map , keyMaker ) ) ; return map ; |
public class JobSchedulesImpl { /** * Lists all of the job schedules in the specified account .
* @ param nextPageLink The NextLink from the previous successful call to List operation .
* @ param jobScheduleListNextOptions Additional parameters for the operation
* @ throws IllegalArgumentException thrown if param... | return listNextSinglePageAsync ( nextPageLink , jobScheduleListNextOptions ) . concatMap ( new Func1 < ServiceResponseWithHeaders < Page < CloudJobSchedule > , JobScheduleListHeaders > , Observable < ServiceResponseWithHeaders < Page < CloudJobSchedule > , JobScheduleListHeaders > > > ( ) { @ Override public Observable... |
public class XMLConfigProvider { /** * { @ inheritDoc }
* @ see org . audit4j . core . ConfigProvider # readConfig ( java . io . InputStream ) */
@ SuppressWarnings ( "unchecked" ) @ Override public T readConfig ( InputStream fileAsStream ) throws ConfigurationException { } } | XStream xstream = new XStream ( new StaxDriver ( ) ) ; xstream . alias ( "configuration" , clazz ) ; return ( T ) xstream . fromXML ( fileAsStream ) ; |
public class Annotate { /** * Attribute annotation elements creating a list of pairs of the Symbol representing that
* element and the value of that element as an Attribute . */
private List < Pair < MethodSymbol , Attribute > > attributeAnnotationValues ( JCAnnotation a , Type expected , Env < AttrContext > env ) { ... | // The annotation might have had its type attributed ( but not
// checked ) by attr . attribAnnotationTypes during MemberEnter ,
// in which case we do not need to do it again .
Type at = ( a . annotationType . type != null ? a . annotationType . type : attr . attribType ( a . annotationType , env ) ) ; a . type = chk ... |
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public EEnum getIfcChillerTypeEnum ( ) { } } | if ( ifcChillerTypeEnumEEnum == null ) { ifcChillerTypeEnumEEnum = ( EEnum ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 933 ) ; } return ifcChillerTypeEnumEEnum ; |
public class PeriodCounterFactory { /** * compteur des 366 derniers jours */
Counter getYearCounter ( ) throws IOException { } } | final Counter yearCounter = createPeriodCounter ( "yyyy" , currentDayCounter . getStartDate ( ) ) ; yearCounter . addRequestsAndErrors ( currentDayCounter ) ; final Calendar dayCalendar = Calendar . getInstance ( ) ; final int currentMonth = dayCalendar . get ( Calendar . MONTH ) ; dayCalendar . setTime ( currentDayCou... |
public class FreightStreamer { /** * run */
public int run ( String argv [ ] ) throws Exception { } } | if ( argv . length < 1 ) { return - 1 ; } int exitCode = - 1 ; int i = 0 ; String cmd = argv [ i ++ ] ; // verify that we have enough command line parameters
if ( "-put" . equals ( cmd ) || "-test" . equals ( cmd ) || "-copyFromLocal" . equals ( cmd ) || "-moveFromLocal" . equals ( cmd ) ) { if ( argv . length < 3 ) { ... |
public class ConcurrencyUtil { /** * Atomically sets the max value .
* If the current value is larger than the provided value , the call is ignored .
* So it will not happen that a smaller value will overwrite a larger value . */
public static < E > void setMax ( E obj , AtomicLongFieldUpdater < E > updater , long ... | for ( ; ; ) { long current = updater . get ( obj ) ; if ( current >= value ) { return ; } if ( updater . compareAndSet ( obj , current , value ) ) { return ; } } |
public class NestedWriter { /** * Set the value on the source entity . If at any point the chaining results in a null value . The chaining
* should end .
* @ param toEntity
* the entity on which the getter should operate .
* @ param newValue
* the value to set . */
public void setValue ( Object toEntity , Obj... | Object propertyValue = getter . invoke ( toEntity ) ; if ( propertyValue != null ) nestedWriter . setValue ( propertyValue , newValue ) ; |
public class Cql2ElmVisitor { /** * Test an < code > And < / code > expression and determine if it contains any operands ( first - level or nested deeper )
* than are < code > IncludedIn < / code > expressions that can be refactored into a < code > Retrieve < / code > . If so ,
* adjust the < code > Retrieve < / co... | if ( retrieve . getDateProperty ( ) != null || retrieve . getDateRange ( ) != null ) { return false ; } for ( int i = 0 ; i < and . getOperand ( ) . size ( ) ; i ++ ) { Expression operand = and . getOperand ( ) . get ( i ) ; if ( ( operand instanceof IncludedIn || operand instanceof In ) && attemptDateRangeOptimization... |
public class ModelArtifactsMarshaller { /** * Marshall the given parameter object . */
public void marshall ( ModelArtifacts modelArtifacts , ProtocolMarshaller protocolMarshaller ) { } } | if ( modelArtifacts == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( modelArtifacts . getS3ModelArtifacts ( ) , S3MODELARTIFACTS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + ... |
public class FsStateBackend { /** * Creates a copy of this state backend that uses the values defined in the configuration
* for fields where that were not specified in this state backend .
* @ param config the configuration
* @ return The re - configured variant of the state backend */
@ Override public FsStateB... | return new FsStateBackend ( this , config , classLoader ) ; |
public class JFreeChartExporter { /** * take care if no function is set : every value is in a differnet category ( we use an incremental integer : serie ) */
private void addValue ( Object chartSerie , Number x , String lastXValue , Number y , HashMap < String , String > formatValues , int chartsNo ) { } } | if ( chart . getType ( ) . isLine ( ) ) { ( ( XYSeries ) chartSerie ) . add ( x , y ) ; } else if ( isLineCombo ) { lineBarDataset . addValue ( y , ( String ) chartSerie , lastXValue ) ; } else if ( ! chart . getType ( ) . isPie ( ) ) { GFunction function = FunctionFactory . getFunction ( chart . getYFunction ( ) ) ; i... |
public class Cache { /** * Adds an RRset to the Cache .
* @ param rrset The RRset to be added
* @ param cred The credibility of these records
* @ see RRset */
public synchronized void addRRset ( RRset rrset , int cred ) { } } | long ttl = rrset . getTTL ( ) ; Name name = rrset . getName ( ) ; int type = rrset . getType ( ) ; Element element = findElement ( name , type , 0 ) ; if ( ttl == 0 ) { if ( element != null && element . compareCredibility ( cred ) <= 0 ) removeElement ( name , type ) ; } else { if ( element != null && element . compare... |
public class PreferenceFragment { /** * Returns the number of items , which should be shown per divider , depending on the app ' s
* settings .
* @ return The number of items , which should be shown per divider , as an { @ link Integer } value */
private int getItemCount ( ) { } } | SharedPreferences sharedPreferences = PreferenceManager . getDefaultSharedPreferences ( getActivity ( ) ) ; String key = getString ( R . string . item_count_preference_key ) ; String defaultValue = getString ( R . string . item_count_preference_default_value ) ; return Integer . valueOf ( sharedPreferences . getString ... |
public class SqlBuilder { /** * newFrom .
* @ param from a { @ link java . lang . String } object .
* @ return a { @ link org . beangle . commons . dao . query . builder . SqlBuilder } object . */
public SqlBuilder newFrom ( final String from ) { } } | if ( null == from ) { this . from = null ; } else { if ( Strings . contains ( from . toLowerCase ( ) , "from" ) ) { this . from = from ; } else { this . from = " from " + from ; } } return this ; |
public class TileBoundingBoxUtils { /** * Get the tile grid starting from the tile grid and current zoom to the new
* zoom level
* @ param tileGrid
* current tile grid
* @ param fromZoom
* current zoom level
* @ param toZoom
* new zoom level
* @ return tile grid at new zoom level
* @ since 2.0.1 */
pu... | TileGrid newTileGrid = null ; int zoomChange = toZoom - fromZoom ; if ( zoomChange > 0 ) { newTileGrid = tileGridZoomIncrease ( tileGrid , zoomChange ) ; } else if ( zoomChange < 0 ) { zoomChange = Math . abs ( zoomChange ) ; newTileGrid = tileGridZoomDecrease ( tileGrid , zoomChange ) ; } else { newTileGrid = tileGrid... |
public class DhtSampleInfohashesAlert { /** * This is the set of more DHT nodes returned by the request .
* The information is included so that indexing nodes can perform
* a keyspace traversal with a single RPC per node by adjusting
* the target value for each RPC .
* @ return the set of more DHT nodes returne... | sha1_hash_udp_endpoint_pair_vector v = alert . nodes ( ) ; int size = ( int ) v . size ( ) ; ArrayList < Pair < Sha1Hash , UdpEndpoint > > nodes = new ArrayList < > ( size ) ; for ( int i = 0 ; i < size ; i ++ ) { sha1_hash_udp_endpoint_pair p = v . get ( i ) ; Sha1Hash h = new Sha1Hash ( p . getFirst ( ) ) . clone ( )... |
public class ByteCodeParser { /** * Parses a name and type pool entry . */
private NameAndTypeConstant parseNameAndTypeConstant ( int index ) throws IOException { } } | int nameIndex = readShort ( ) ; int descriptorIndex = readShort ( ) ; return new NameAndTypeConstant ( _class . getConstantPool ( ) , index , nameIndex , descriptorIndex ) ; |
public class InternalXbaseParser { /** * InternalXbase . g : 117:1 : ruleOpSingleAssign : ( ' = ' ) ; */
public final void ruleOpSingleAssign ( ) throws RecognitionException { } } | int stackSize = keepStackSize ( ) ; try { // InternalXbase . g : 121:2 : ( ( ' = ' ) )
// InternalXbase . g : 122:2 : ( ' = ' )
{ // InternalXbase . g : 122:2 : ( ' = ' )
// InternalXbase . g : 123:3 : ' = '
{ if ( state . backtracking == 0 ) { before ( grammarAccess . getOpSingleAssignAccess ( ) . getEqualsSignKeyword... |
public class RunnersApi { /** * List jobs that are being processed or were processed by specified Runner .
* < pre > < code > GitLab Endpoint : GET / runners / : id / jobs < / code > < / pre >
* @ param runnerId The ID of a runner
* @ return List jobs that are being processed or were processed by specified Runner... | return ( getJobs ( runnerId , null , getDefaultPerPage ( ) ) . all ( ) ) ; |
public class Crouton { /** * Creates a { @ link Crouton } with provided text - resource and style for a given
* activity .
* @ param activity
* The { @ link Activity } that represents the context in which the Crouton should exist .
* @ param customView
* The custom { @ link View } to display
* @ param viewG... | return new Crouton ( activity , customView , ( ViewGroup ) activity . findViewById ( viewGroupResId ) ) ; |
public class HtmlDocletWriter { /** * Add the class link .
* @ param context the id of the context where the link will be added
* @ param cd the class doc to link to
* @ param contentTree the content tree to which the link will be added */
public void addPreQualifiedClassLink ( LinkInfoImpl . Kind context , Class... | addPreQualifiedClassLink ( context , cd , false , contentTree ) ; |
public class MappingServiceImpl { /** * Package - private for testability */
long applyMappingToRepo ( EntityMapping sourceMapping , Repository < Entity > targetRepo , Progress progress , int depth ) { } } | progress . status ( format ( "Mapping source [%s]..." , sourceMapping . getLabel ( ) ) ) ; AtomicLong counter = new AtomicLong ( ) ; boolean canAdd = targetRepo . count ( ) == 0 ; dataService . getRepository ( sourceMapping . getName ( ) ) . forEachBatched ( entities -> processBatch ( sourceMapping , targetRepo , progr... |
public class CmsRfsFileDisposalDialog { /** * Creates the dialog HTML for all defined widgets of the named dialog ( page ) . < p >
* This overwrites the method from the super class to create a layout variation for the widgets . < p >
* @ param dialog the dialog ( page ) to get the HTML for
* @ return the dialog H... | StringBuffer result = new StringBuffer ( 1024 ) ; result . append ( createWidgetTableStart ( ) ) ; // show error header once if there were validation errors
result . append ( createWidgetErrorHeader ( ) ) ; if ( dialog . equals ( PAGES [ 0 ] ) ) { // create the widgets for the first dialog page
result . append ( "<scri... |
public class AWSSimpleSystemsManagementClient { /** * Removes a task from a Maintenance Window .
* @ param deregisterTaskFromMaintenanceWindowRequest
* @ return Result of the DeregisterTaskFromMaintenanceWindow operation returned by the service .
* @ throws DoesNotExistException
* Error returned when the ID spe... | request = beforeClientExecution ( request ) ; return executeDeregisterTaskFromMaintenanceWindow ( request ) ; |
public class Sheet { /** * Gets the row key value as a String suitable for use in javascript rendering .
* @ param context
* @ return */
protected String getRowKeyValueAsString ( final Object key ) { } } | final String result = key . toString ( ) ; return "r_" + StringUtils . deleteWhitespace ( result ) ; |
public class LongRadixHeap { /** * { @ inheritDoc } */
@ Override protected int msd ( Long a , Long b ) { } } | /* * Value equal */
if ( a . longValue ( ) == b . longValue ( ) ) { return - 1 ; } /* * This is a fast way to compute floor ( log _ 2 ( a xor b ) ) . */
double axorb = a ^ b ; return Math . getExponent ( axorb ) ; |
public class Fraction { /** * Creates a < code > Fraction < / code > instance from a < code > double < / code > value .
* This method uses the < a href = " http : / / archives . math . utk . edu / articles / atuyl / confrac / " > continued fraction
* algorithm < / a > , computing a maximum of 25 convergents and bou... | final int sign = value < 0 ? - 1 : 1 ; value = Math . abs ( value ) ; if ( value > Integer . MAX_VALUE || Double . isNaN ( value ) ) { throw new ArithmeticException ( "The value must not be greater than Integer.MAX_VALUE or NaN" ) ; } final int wholeNumber = ( int ) value ; value -= wholeNumber ; int numer0 = 0 ; // th... |
public class JobsInner { /** * Gets a list of currently existing nodes which were used for the Job execution . The returned information contains the node ID , its public IP and SSH port .
* @ param resourceGroupName Name of the resource group to which the resource belongs .
* @ param workspaceName The name of the w... | return listRemoteLoginInformationSinglePageAsync ( resourceGroupName , workspaceName , experimentName , jobName ) . concatMap ( new Func1 < ServiceResponse < Page < RemoteLoginInformationInner > > , Observable < ServiceResponse < Page < RemoteLoginInformationInner > > > > ( ) { @ Override public Observable < ServiceRes... |
public class DCModuleGenerator { /** * Utility method to generate a single element containing a string .
* @ param name the name of the elment to generate .
* @ param value the value of the text in the element .
* @ return the element generated . */
protected final Element generateSimpleElement ( final String nam... | final Element element = new Element ( name , getDCNamespace ( ) ) ; element . addContent ( value ) ; return element ; |
public class ChangeLogActivity { /** * Helper Methods */
private void parseExtras ( Bundle icicle ) { } } | Intent intent = getIntent ( ) ; if ( intent != null ) { mConfigResId = intent . getIntExtra ( EXTRA_CONFIG , - 1 ) ; } if ( icicle != null ) { mConfigResId = icicle . getInt ( EXTRA_CONFIG , - 1 ) ; } if ( mConfigResId == - 1 ) { finish ( ) ; return ; } // Parse configuration
RecyclerView recycler = Winds . draft ( thi... |
public class ClassGraph { /** * Prints dependencies recovered from the methods of a class . A
* dependency is inferred only if another relation between the two
* classes is not already in the graph .
* @ param classes */
public void printInferredDependencies ( ClassDoc c ) { } } | if ( hidden ( c ) ) return ; Options opt = optionProvider . getOptionsFor ( c ) ; Set < Type > types = new HashSet < Type > ( ) ; // harvest method return and parameter types
for ( MethodDoc method : filterByVisibility ( c . methods ( false ) , opt . inferDependencyVisibility ) ) { types . add ( method . returnType ( )... |
public class ClassicCounter { /** * { @ inheritDoc } */
public double logIncrementCount ( E key , double count ) { } } | if ( tempMDouble == null ) { tempMDouble = new MutableDouble ( ) ; } MutableDouble oldMDouble = map . put ( key , tempMDouble ) ; if ( oldMDouble != null ) { count = SloppyMath . logAdd ( count , oldMDouble . doubleValue ( ) ) ; totalCount += count - oldMDouble . doubleValue ( ) ; } else { totalCount += count ; } tempM... |
public class KnowledgeSwitchYardScanner { /** * Converts faults to mappings model .
* @ param faults faults
* @ param knowledgeNamespace knowledgeNamespace
* @ return mappings model */
protected FaultsModel toFaultsModel ( Fault [ ] faults , KnowledgeNamespace knowledgeNamespace ) { } } | FaultsModel faultsModel = null ; if ( faults != null ) { for ( Fault fault : faults ) { if ( fault != null ) { FaultModel faultModel = new V1FaultModel ( knowledgeNamespace . uri ( ) ) ; String from = fault . from ( ) ; if ( ! UNDEFINED . equals ( from ) ) { faultModel . setFrom ( from ) ; } String to = fault . to ( ) ... |
public class HttpMethodBase { /** * This method processes the specified cookie headers . It is invoked from
* within { @ link # processResponseHeaders ( HttpState , HttpConnection ) }
* @ param headers cookie { @ link Header } s to be processed
* @ param state the { @ link HttpState state } information associated... | LOG . trace ( "enter HttpMethodBase.processCookieHeaders(Header[], HttpState, " + "HttpConnection)" ) ; String host = this . params . getVirtualHost ( ) ; if ( host == null ) { host = conn . getHost ( ) ; } for ( int i = 0 ; i < headers . length ; i ++ ) { Header header = headers [ i ] ; Cookie [ ] cookies = null ; try... |
public class CheckArg { /** * Check that the argument is null
* @ param argument The argument
* @ param name The name of the argument
* @ throws IllegalArgumentException If value is non - null */
public static void isNull ( Object argument , String name ) { } } | if ( argument != null ) { throw new IllegalArgumentException ( CommonI18n . argumentMustBeNull . text ( name ) ) ; } |
public class RecentchangeTitles { /** * generates the next MediaWiki - request ( GetMethod ) and adds it to msgs .
* @ param namespace the namespace ( s ) that will be searched for links , as a string of numbers
* separated by ' | ' ; if null , this parameter is omitted
* @ param rcstart timestamp */
private Http... | RequestBuilder requestBuilder = new ApiRequestBuilder ( ) . action ( "query" ) . formatXml ( ) . param ( "list" , "recentchanges" ) . param ( "rclimit" , LIMIT ) ; if ( namespace != null ) { requestBuilder . param ( "rcnamespace" , MediaWiki . urlEncode ( MWAction . createNsString ( namespace ) ) ) ; } if ( rcstart . l... |
public class XmlUtil { /** * Convert string to XML { @ link Document }
* @ param string - string to be converted
* @ return - { @ link Document }
* @ throws Exception - if { @ link DocumentBuilder } is not initialized */
public static Document stringToXml ( String string ) throws Exception { } } | if ( builder == null ) { throw new Exception ( "DocumentBuilder is null." ) ; } return builder . parse ( new InputSource ( new ByteArrayInputStream ( string . getBytes ( "UTF-8" ) ) ) ) ; |
public class AbstractWriter { /** * Writes a character to the output .
* @ param buf the buffer to write . */
@ Override public void write ( int ch ) throws IOException { } } | char [ ] buffer = _tempCharBuffer ; buffer [ 0 ] = ( char ) ch ; write ( buffer , 0 , 1 ) ; |
public class SerializableClientProxy { /** * Always returns the original proxy object that was serialized .
* @ return the proxy object
* @ throws java . io . ObjectStreamException */
Object readResolve ( ) throws ObjectStreamException { } } | Bean < ? > bean = Container . instance ( contextId ) . services ( ) . get ( ContextualStore . class ) . < Bean < Object > , Object > getContextual ( beanId ) ; if ( bean == null ) { throw BeanLogger . LOG . proxyDeserializationFailure ( beanId ) ; } return Container . instance ( contextId ) . deploymentManager ( ) . ge... |
public class IFixUtils { /** * This method calculates a hash of the required file and compares it against the supplied hash . It then returns
* true if both hashes are equals .
* @ param fileToHash - The file to calculate the hash for .
* @ param hashToCompare - The hash to compare .
* @ return - A boolean indi... | boolean result = false ; // Now calculate the new hash and compare the 2 . If they are NOT the same the ifix needs to be re - applied .
String fileHash = MD5Utils . getFileMD5String ( fileToHash ) ; if ( fileHash . equals ( hashToCompare ) ) result = true ; return result ; |
public class StringBuilders { /** * Returns true if the specified section of the left CharSequence equals , ignoring case , the specified section of
* the right CharSequence .
* @ param left the left CharSequence
* @ param leftOffset start index in the left CharSequence
* @ param leftLength length of the sectio... | if ( leftLength == rightLength ) { for ( int i = 0 ; i < rightLength ; i ++ ) { if ( toLowerCase ( left . charAt ( i + leftOffset ) ) != toLowerCase ( right . charAt ( i + rightOffset ) ) ) { return false ; } } return true ; } return false ; |
public class CipherUtils { /** * Generate a { @ link SecretKey } for the given symmetric algorithm and keysize
* Example : CipherUtils . generateKeyPair ( " AES " , 128) */
public static SecretKey generateKey ( String algorithm , int keySize ) { } } | KeyGenerator secretKeyGenerator ; try { secretKeyGenerator = KeyGenerator . getInstance ( algorithm ) ; } catch ( NoSuchAlgorithmException e ) { throw new IllegalArgumentException ( e ) ; } secretKeyGenerator . init ( keySize ) ; return secretKeyGenerator . generateKey ( ) ; |
public class Humanize { /** * Rounds a number to significant figures .
* @ param num
* The number to be rounded
* @ param precision
* The number of significant digits
* @ return The number rounded to significant figures */
public static Number roundToSignificantFigures ( Number num , int precision ) { } } | return new BigDecimal ( num . doubleValue ( ) ) . round ( new MathContext ( precision , RoundingMode . HALF_EVEN ) ) ; |
public class ObjectStructuredFieldOffsetImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public void eSet ( int featureID , Object newValue ) { } } | switch ( featureID ) { case AfplibPackage . OBJECT_STRUCTURED_FIELD_OFFSET__SF_OFF : setSFOff ( ( Integer ) newValue ) ; return ; case AfplibPackage . OBJECT_STRUCTURED_FIELD_OFFSET__SF_OFF_HI : setSFOffHi ( ( Integer ) newValue ) ; return ; } super . eSet ( featureID , newValue ) ; |
public class LocalDirectoryTransport { /** * On a request to shut down ,
* < ul >
* < li > check that we are in a valid state , < / li >
* < li > set the state . < / li >
* < / ul >
* If we have already shut down , a second call is not an error , but requires
* no action . */
@ Override public void shutdown... | super . testStateChange ( State . SHUTDOWN ) ; if ( super . getState ( ) != State . SHUTDOWN ) { super . setState ( State . SHUTDOWN ) ; } |
public class MonitorableRegistry { /** * Registers the monitorable if it does not already exist , but otherwise returns an already registered
* Monitorable with the same name , Semantics and UNnit definition . This method is useful when objects
* appear and disappear , and then return , and the lifecycle of the app... | String name = monitorable . getName ( ) ; if ( monitorables . containsKey ( name ) ) { Monitorable < ? > existingMonitorableWithSameName = monitorables . get ( name ) ; if ( monitorable . getSemantics ( ) . equals ( existingMonitorableWithSameName . getSemantics ( ) ) && monitorable . getUnit ( ) . equals ( existingMon... |
public class DecimalFormat { /** * < strong > [ icu ] < / strong > Sets the maximum number of significant digits that will be displayed . If
* < code > max < / code > is less than one then it is set to one . If the minimum significant
* digits count is greater than < code > max < / code > , then it is set to < code... | if ( max < 1 ) { max = 1 ; } // pin min sig dig to 1 . . max
int min = Math . min ( minSignificantDigits , max ) ; minSignificantDigits = min ; maxSignificantDigits = max ; setSignificantDigitsUsed ( true ) ; |
public class PayloadFactory { /** * This method was created to simplify the construction of request payloads . However , the use of this method
* shouldn ' t be compulsory and you can also use plain old Maps .
* @ param entries
* { @ code Map . Entry < String , Object > } the entries that will describe the reques... | Map < String , Object > map = new HashMap < > ( ) ; for ( Map . Entry < String , Object > entry : entries ) map . put ( entry . getKey ( ) , entry . getValue ( ) ) ; return Collections . unmodifiableMap ( map ) ; |
public class CPDefinitionLocalServiceImpl { /** * Moves the commerce product definition with the ID to the recycle bin .
* @ param userId the primary key of the user moving the commerce product
* definition
* @ param cpDefinitionId the primary key of the commerce product definition
* to be moved
* @ return th... | CPDefinition cpDefinition = cpDefinitionPersistence . findByPrimaryKey ( cpDefinitionId ) ; return cpDefinitionLocalService . moveCPDefinitionToTrash ( userId , cpDefinition ) ; |
public class LCharFunctionBuilder { /** * One of ways of creating builder . This might be the only way ( considering all _ functional _ builders ) that might be utilize to specify generic params only once . */
@ Nonnull public static < R > LCharFunctionBuilder < R > charFunction ( Consumer < LCharFunction < R > > consu... | return new LCharFunctionBuilder ( consumer ) ; |
public class XMemcachedClient { /** * ( non - Javadoc )
* @ see net . rubyeye . xmemcached . MemcachedClient # addServer ( java . lang . String ) */
public final void addServer ( String hostList ) throws IOException { } } | Map < InetSocketAddress , InetSocketAddress > addresses = AddrUtil . getAddressMap ( hostList ) ; if ( addresses != null && addresses . size ( ) > 0 ) { for ( Map . Entry < InetSocketAddress , InetSocketAddress > entry : addresses . entrySet ( ) ) { final InetSocketAddress mainNodeAddr = entry . getKey ( ) ; final Inet... |
public class FnFunc { /** * Builds a function that will execute the specified function < tt > thenFunction < / tt >
* only if the target object is not null and the result of executing < tt > condition < / tt >
* on the target object is true , and will execute the specified function
* < tt > elseFunction < / tt > ... | return ifTrueThenElse ( targetType , FnBoolean . and ( FnObject . isNotNull ( ) , condition ) , thenFunction , elseFunction ) ; |
public class HttpServer { synchronized void addMappings ( HttpContext context ) { } } | if ( context == _notFoundContext ) return ; String [ ] hosts = context . getVirtualHosts ( ) ; if ( hosts == null || hosts . length == 0 ) hosts = __noVirtualHost ; // For each host name
for ( int h = 0 ; h < hosts . length ; h ++ ) { String virtualHost = hosts [ h ] ; addMapping ( virtualHost , context ) ; } |
public class SimpleBlas { /** * Generalized Least Squares via * GELSD .
* Note that B must be padded to contain the solution matrix . This occurs when A has fewer rows
* than columns .
* For example : in A * X = B , A is ( m , n ) , X is ( n , k ) and B is ( m , k ) . Now if m < n , since B is overwritten to cont... | int m = A . rows ; int n = A . columns ; int nrhs = B . columns ; int minmn = min ( m , n ) ; int maxmn = max ( m , n ) ; if ( B . rows < maxmn ) { throw new SizeException ( "Result matrix B must be padded to contain the solution matrix X!" ) ; } // int smlsiz = NativeBlas . ilaenv ( 9 , " DGELSD " , " " , m , n , nrhs... |
public class ThriftUtils { /** * Helper method to create a new framed - transport , threaded - selector
* { @ link TServer } .
* Note : if { @ code numSelectorThreads < 1 } , the { @ link TServer } is created
* with 2 selector threads .
* Note : if { @ code numWorkerThreads < 1 } , the { @ link TServer } is cre... | if ( numSelectorThreads < 1 ) { numSelectorThreads = 2 ; } if ( numWorkerThreads < 1 ) { numWorkerThreads = 8 ; } TNonblockingServerTransport transport = new TNonblockingServerSocket ( port , clientTimeoutMillisecs ) ; TTransportFactory transportFactory = new TFramedTransport . Factory ( maxFrameSize ) ; TThreadedSelec... |
public class Cluster { /** * Does the topology need scheduling ?
* A topology needs scheduling if one of the following conditions holds :
* < ul >
* < li > Although the topology is assigned slots , but is squeezed . i . e . the topology is assigned less slots than desired . < / li >
* < li > There are unassigne... | int desiredNumWorkers = topology . getNumWorkers ( ) ; int assignedNumWorkers = this . getAssignedNumWorkers ( topology ) ; if ( desiredNumWorkers > assignedNumWorkers ) { return true ; } return this . getUnassignedExecutors ( topology ) . size ( ) > 0 ; |
public class QuickWidget { /** * Intersect a line and a DesktopWindowRect */
private Point intersection ( int x1 , int y1 , int x2 , int y2 , DesktopWindowRect rect ) { } } | Point bottom = intersection ( x1 , y1 , x2 , y2 , rect . getX ( ) , rect . getY ( ) , rect . getX ( ) + rect . getHeight ( ) , rect . getY ( ) ) ; if ( bottom != null ) { return bottom ; } Point right = intersection ( x1 , y1 , x2 , y2 , rect . getX ( ) + rect . getWidth ( ) , rect . getY ( ) , rect . getX ( ) + rect .... |
public class ProxyDataSourceBuilder { /** * Register { @ link SLF4JSlowQueryListener } .
* @ param thresholdTime slow query threshold time
* @ param timeUnit slow query threshold time unit
* @ param logLevel log level for slf4j
* @ return builder
* @ since 1.4.1 */
public ProxyDataSourceBuilder logSlowQueryBy... | return logSlowQueryBySlf4j ( thresholdTime , timeUnit , logLevel , null ) ; |
public class AtomicNumberAtom { /** * ( non - Javadoc )
* @ see
* org . openscience . cdk . isomorphism . matchers . smarts . SMARTSAtom # matches ( org
* . openscience . cdk . interfaces . IAtom ) */
@ Override public boolean matches ( IAtom atom ) { } } | return Preconditions . checkNotNull ( atom . getAtomicNumber ( ) , "Atomic number is not set." ) . equals ( this . getAtomicNumber ( ) ) ; |
public class ListUnmarshaller { /** * Unmarshalls the current token in the Json document to list . */
private List < T > unmarshallJsonToList ( JsonUnmarshallerContext context ) throws Exception { } } | List < T > list = new ArrayList < T > ( ) ; if ( context . getCurrentToken ( ) == JsonToken . VALUE_NULL ) { return null ; } while ( true ) { JsonToken token = context . nextToken ( ) ; if ( token == null ) { return list ; } if ( token == END_ARRAY ) { return list ; } else { list . add ( itemUnmarshaller . unmarshall (... |
public class CommercePriceListPersistenceImpl { /** * Returns the commerce price list where companyId = & # 63 ; and externalReferenceCode = & # 63 ; or returns < code > null < / code > if it could not be found . Uses the finder cache .
* @ param companyId the company ID
* @ param externalReferenceCode the external... | return fetchByC_ERC ( companyId , externalReferenceCode , true ) ; |
public class HndlI18nRequest { /** * < p > Handle request . Synchronization whole code may hit performance ,
* so data is copied into temporary references in synchronize block .
* Any way it ' s hardly ever happens changing languages features
* in database . < / p >
* @ param pReqVars Request scoped variables
... | List < LangPreferences > lpfsTmp ; List < Languages > lgsTmp ; List < DecimalSeparator > dssTmp ; List < DecimalGroupSeparator > dgssTmp ; boolean isFirstReq = false ; synchronized ( this ) { if ( this . langPreferences == null ) { try { isFirstReq = true ; this . logger . info ( null , HndlI18nRequest . class , "Refre... |
public class ServicesApi { /** * Get the JIRA service settings for a project .
* < pre > < code > GitLab Endpoint : GET / projects / : id / services / jira < / code > < / pre >
* @ param projectIdOrPath id , path of the project , or a Project instance holding the project ID or path
* @ return a JiraService instan... | Response response = get ( Response . Status . OK , null , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "services" , "jira" ) ; return ( response . readEntity ( JiraService . class ) ) ; |
public class DefaultBeanDescriptor { /** * Extract provided properties information and insert it in { @ link # parameterDescriptorMap } .
* @ param propertyDescriptor the JAVA bean property descriptor .
* @ param defaultInstance the default instance of bean class . */
protected void extractPropertyDescriptor ( java... | DefaultPropertyDescriptor desc = new DefaultPropertyDescriptor ( ) ; Method writeMethod = propertyDescriptor . getWriteMethod ( ) ; if ( writeMethod != null ) { Method readMethod = propertyDescriptor . getReadMethod ( ) ; // is parameter hidden
PropertyHidden parameterHidden = extractPropertyAnnotation ( writeMethod , ... |
public class DataUrlHelper { /** * Gets data embedded in data url .
* @ param dataUrl url to extract data from .
* @ return data part of URL . */
public static String getData ( String dataUrl ) { } } | int indexOfComma = dataUrl . indexOf ( ',' ) ; return dataUrl . substring ( indexOfComma + 1 ) ; |
public class InstanceAdminClient { /** * Creates an instance and begins preparing it to begin serving . The returned [ long - running
* operation ] [ google . longrunning . Operation ] can be used to track the progress of preparing the new
* instance . The instance name is assigned by the caller . If the named inst... | CreateInstanceRequest request = CreateInstanceRequest . newBuilder ( ) . setParent ( parent == null ? null : parent . toString ( ) ) . setInstanceId ( instanceId == null ? null : instanceId . toString ( ) ) . setInstance ( instance ) . build ( ) ; return createInstanceAsync ( request ) ; |
public class Operator { /** * Sets the minimum and preferred resources for this contract instance . The resource denotes
* how many memories and cpu cores of the user function will be consumed during the execution .
* @ param minResources The minimum resource of this operator .
* @ param preferredResources The pr... | this . minResources = minResources ; this . preferredResources = preferredResources ; |
public class DescribeCommand { /** * < pre > - - long < / pre >
* Always output the long format ( the tag , the number of commits and the abbreviated commit name )
* even when it matches a tag . This is useful when you want to see parts of the commit object name
* in " describe " output , even when the commit in ... | if ( forceLongFormat != null && forceLongFormat ) { this . forceLongFormat = true ; log . info ( "--long = {}" , true ) ; } return this ; |
public class Invite { /** * Create a InviteFetcher to execute fetch .
* @ param pathServiceSid The SID of the Service to fetch the resource from
* @ param pathChannelSid The SID of the Channel the resource to fetch belongs to
* @ param pathSid The unique string that identifies the resource
* @ return InviteFetc... | return new InviteFetcher ( pathServiceSid , pathChannelSid , pathSid ) ; |
public class ExpiresFilter { /** * If no expiration header has been set by the servlet and an expiration has
* been defined in the { @ link ExpiresFilter } configuration , sets the '
* < tt > Expires < / tt > ' header and the attribute ' < tt > max - age < / tt > ' of the '
* < tt > Cache - Control < / tt > ' hea... | if ( ! isEligibleToExpirationHeaderGeneration ( request , response ) ) { return ; } Date expirationDate = getExpirationDate ( request , response ) ; if ( expirationDate == null ) { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Request '{}' with response status '{}' content-type '{}', no expiration configured" ... |
public class AnyValueMap { /** * Converts map element into a long or returns null if conversion is not
* possible .
* @ param key a key of element to get .
* @ return long value of the element or null if conversion is not supported .
* @ see LongConverter # toNullableLong ( Object ) */
public Long getAsNullable... | Object value = getAsObject ( key ) ; return LongConverter . toNullableLong ( value ) ; |
public class Utils { /** * Returns the float representation at { @ code value } if it exists and is a float or can be coerced
* to a float . Returns { @ code defaultValue } otherwise . */
public static float coerceToFloat ( Object value , float defaultValue ) { } } | if ( value instanceof Float ) { return ( float ) value ; } if ( value instanceof Number ) { return ( ( Number ) value ) . floatValue ( ) ; } else if ( value instanceof String ) { try { return Float . valueOf ( ( String ) value ) ; } catch ( NumberFormatException ignored ) { } } return defaultValue ; |
public class KeyValueHandler { /** * Encodes a { @ link UnlockRequest } into its lower level representation .
* @ return a ready { @ link BinaryMemcacheRequest } . */
private static BinaryMemcacheRequest handleUnlockRequest ( final UnlockRequest msg ) { } } | byte [ ] key = msg . keyBytes ( ) ; short keyLength = ( short ) key . length ; BinaryMemcacheRequest request = new DefaultBinaryMemcacheRequest ( key ) ; request . setOpcode ( OP_UNLOCK ) ; request . setKeyLength ( keyLength ) ; request . setTotalBodyLength ( keyLength ) ; request . setCAS ( msg . cas ( ) ) ; return re... |
public class DescribeFileSystemsRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( DescribeFileSystemsRequest describeFileSystemsRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( describeFileSystemsRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( describeFileSystemsRequest . getMaxItems ( ) , MAXITEMS_BINDING ) ; protocolMarshaller . marshall ( describeFileSystemsRequest . getMarker ( ) , MARKER_BINDIN... |
public class ServletLimiterBuilder { /** * Partition the limit by request parameter
* @ return Chainable builder */
public ServletLimiterBuilder partitionByParameter ( String name ) { } } | return partitionResolver ( request -> Optional . ofNullable ( request . getParameter ( name ) ) . orElse ( null ) ) ; |
public class FileManager { /** * Use this method to register a file with the watcherService
* @ param dir directory of file
* @ param fileType the name / extension of the file
* IMPORTANT : Please try to always enter the full name with extension of the file ( Ex : " test . txt " ) ,
* it would be best if the fi... | WatchKey key = dir . register ( watcher , ENTRY_MODIFY ) ; List < FileInfo > fileInfos = addOnMap . get ( key ) ; if ( fileInfos != null ) { fileInfos . add ( new FileInfo ( dir , fileType , reloadableFile ) ) ; } else { fileInfos = new ArrayList < > ( ) ; fileInfos . add ( new FileInfo ( dir , fileType , reloadableFil... |
public class GVRAssetLoader { /** * Loads a hierarchy of scene objects { @ link GVRSceneObject } asymchronously from a 3D model
* on the volume provided and adds it to the specified scene .
* and will return before the model is loaded .
* IAssetEvents are emitted to event listeners attached to the context .
* T... | Threads . spawn ( new Runnable ( ) { public void run ( ) { String filePath = volume . getFileName ( ) ; AssetRequest assetRequest = new AssetRequest ( model , volume , scene , null , false ) ; String ext = filePath . substring ( filePath . length ( ) - 3 ) . toLowerCase ( ) ; model . setName ( assetRequest . getBaseNam... |
public class RuntimeUtil { /** * Returns the PID of the current process . The PID will also be saved in system property < code > " pid " < / code >
* @ return PID of current progress
* @ throws IOException If an I / O error occurs */
public static String getPID ( ) throws IOException { } } | String pid = System . getProperty ( "pid" ) ; // NOI18N
if ( pid == null ) { String command ; if ( OS . get ( ) . isUnix ( ) ) command = "echo $$ $PPID" ; else { // getpids . exe is taken from http : / / www . scheibli . com / projects / getpids / index . html ( GPL )
File tempFile = File . createTempFile ( "getpids" ,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.