signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class Tick { /** * Check if specific time has been elapsed ( in tick referential ) .
* @ param rate The rate reference .
* @ param milli The milliseconds to check ( based on frame time ) .
* @ return < code > true < / code > if time elapsed , < code > false < / code > else .
* @ throws LionEngineExceptio... | if ( started && rate > 0 ) { final double frameTime = ONE_SECOND_IN_MILLI / rate ; return Double . compare ( milli , StrictMath . floor ( currentTicks * frameTime ) ) <= 0 ; } return false ; |
public class MojoExecutor { /** * Builds the configuration for the goal using Elements
* @ param elements A list of elements for the configuration section
* @ return The elements transformed into the Maven - native XML format */
public static Xpp3Dom configuration ( Element ... elements ) { } } | Xpp3Dom dom = new Xpp3Dom ( "configuration" ) ; for ( Element e : elements ) { dom . addChild ( e . toDom ( ) ) ; } return dom ; |
public class MemorySession { /** * @ see com . ibm . wsspi . session . ISession # removeAttribute ( java . lang . Object ) */
@ Override public synchronized Object removeAttribute ( Object name ) { } } | if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && LoggingUtil . SESSION_LOGGER_CORE . isLoggable ( Level . FINER ) ) { String s = name + appNameAndIdString ; LoggingUtil . SESSION_LOGGER_CORE . entering ( methodClassName , methodNames [ REMOVE_ATTRIBUTE ] , s ) ; } Object oldValue = _attributes .... |
public class ContentNegotiator { /** * Return true if the transport and content negotiators have finished . */
public boolean isFullyEstablished ( ) { } } | boolean result = true ; MediaNegotiator mediaNeg = getMediaNegotiator ( ) ; if ( ( mediaNeg == null ) || ! mediaNeg . isFullyEstablished ( ) ) { result = false ; } TransportNegotiator transNeg = getTransportNegotiator ( ) ; if ( ( transNeg == null ) || ! transNeg . isFullyEstablished ( ) ) { result = false ; } return r... |
public class JsonObject { /** * Retrieves the decrypted value from the field name and casts it to { @ link Boolean } .
* Note : Use of the Field Level Encryption functionality provided in the
* com . couchbase . client . encryption namespace provided by Couchbase is
* subject to the Couchbase Inc . Enterprise Sub... | return ( Boolean ) getAndDecrypt ( name , providerName ) ; |
public class MediaMarkupBuilderUtil { /** * Adds CSS classes that denote the changes to the media element when compared to a different version .
* If no diff has been requested by the WCM UI , there won ' t be any changes to the element .
* @ param mediaElement Element to be decorated
* @ param resource Resource ... | addDiffDecoration ( mediaElement , resource , refProperty , request , null ) ; |
public class CommerceShipmentLocalServiceUtil { /** * Creates a new commerce shipment with the primary key . Does not add the commerce shipment to the database .
* @ param commerceShipmentId the primary key for the new commerce shipment
* @ return the new commerce shipment */
public static com . liferay . commerce ... | return getService ( ) . createCommerceShipment ( commerceShipmentId ) ; |
public class AuditServiceImpl { /** * ( non Java - doc )
* Validates the supplied non - custom event name is a valid event name . Return true if valid ; false otherwise */
public boolean validateEventName ( String eventName ) { } } | boolean isValid = false ; if ( ( AuditConstants . validEventNamesList ) . contains ( eventName ) ) isValid = true ; return isValid ; |
public class AnnotatedMethodInvoker { public Method getInvokableMethodForClass ( final Class < ? > valueClass ) { } } | if ( valueClass == null ) return null ; Method method = methods . get ( valueClass ) ; if ( method != null ) return method ; // get the list of all classes and interfaces .
// first classes .
Class < ? > clazz = valueClass . getSuperclass ( ) ; while ( clazz != null ) { method = methods . get ( clazz ) ; if ( method !=... |
public class WordVectorsImpl { /** * Words nearest based on positive and negative words
* @ param positive the positive words
* @ param negative the negative words
* @ param top the top n words
* @ return the words nearest the mean of the words */
@ Override public Collection < String > wordsNearest ( Collectio... | return modelUtils . wordsNearest ( positive , negative , top ) ; |
public class GraphiteSanitize { /** * Trims the string and replaces all whitespace characters with the provided symbol */
static String sanitize ( String string ) { } } | return WHITESPACE . matcher ( string . trim ( ) ) . replaceAll ( DASH ) ; |
public class Contract { /** * syntactic sugar */
public Contract addAction ( CodeableConcept t ) { } } | if ( t == null ) return this ; if ( this . action == null ) this . action = new ArrayList < CodeableConcept > ( ) ; this . action . add ( t ) ; return this ; |
public class CmsJspInstanceDateBean { /** * Returns the start and end dates / times as " start - end " in the provided date / time format specific for the request locale .
* @ param dateTimeFormat the format to use for date ( time is always short ) .
* @ return the formatted date / time string . */
private String g... | DateFormat df ; String result ; if ( isWholeDay ( ) ) { df = DateFormat . getDateInstance ( dateTimeFormat , m_series . getLocale ( ) ) ; result = df . format ( getStart ( ) ) ; if ( getLastDay ( ) . after ( getStart ( ) ) ) { result += DATE_SEPARATOR + df . format ( getLastDay ( ) ) ; } } else { df = DateFormat . getD... |
public class LogFormatter { /** * Format message and write to the output stream .
* @ param out The output stream to write to .
* @ param message The message to be written .
* @ param < Message > The message type .
* @ param < Field > The field type . */
public < Message extends PMessage < Message , Field > , F... | IndentedPrintWriter builder = new IndentedPrintWriter ( out , indent , newline ) ; if ( message == null ) { builder . append ( null ) ; } else { builder . append ( message . descriptor ( ) . getQualifiedName ( ) ) . append ( space ) ; appendMessage ( builder , message ) ; } builder . flush ( ) ; |
public class GosuStyleContext { /** * Fetch the font to use for a given attribute set . */
@ Override public Font getFont ( AttributeSet attr ) { } } | boolean bUnderline = StyleConstants . isUnderline ( attr ) ; boolean bStrikethrough = StyleConstants . isStrikeThrough ( attr ) ; if ( ! bUnderline && ! bStrikethrough ) { // StyleContext ignores the Underline and Strikethrough attribute
return getFont ( attr , getFontFamily ( attr ) ) ; } // Must build the font via Te... |
public class DevicesManagementApi { /** * Updates a device type information
* Updates a device type information
* @ param dtid Device type ID . ( required )
* @ param deviceTypeInfo Device type info object to be set ( required )
* @ return ApiResponse & lt ; DeviceTypesInfoEnvelope & gt ;
* @ throws ApiExcept... | com . squareup . okhttp . Call call = updateDeviceTypesInfoValidateBeforeCall ( dtid , deviceTypeInfo , null , null ) ; Type localVarReturnType = new TypeToken < DeviceTypesInfoEnvelope > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnType ) ; |
public class BankCountryValidator { /** * { @ inheritDoc } check if given object is valid .
* @ see javax . validation . ConstraintValidator # isValid ( Object ,
* javax . validation . ConstraintValidatorContext ) */
@ Override public final boolean isValid ( final Object pvalue , final ConstraintValidatorContext pc... | if ( pvalue == null ) { return true ; } try { String valueCountry = BeanPropertyReaderUtil . getNullSaveStringProperty ( pvalue , this . fieldCountryCode ) ; final String valueIban = BeanPropertyReaderUtil . getNullSaveStringProperty ( pvalue , this . fieldIban ) ; final String valueBic = BeanPropertyReaderUtil . getNu... |
public class CacheImpl { /** * Checks if the given { @ link CacheItem } has expired . If so , it is removed from its scope in the
* { @ link CacheStoreAdapter } .
* @ return true if the item has expired and was removed from the scope , false otherwise
* @ throws Exception */
protected boolean checkForExpiration (... | if ( item . isExpired ( ticks . get ( ) ) ) { cacheStoreAdapter . remove ( item . getScope ( ) , item . getKey ( ) ) ; return true ; } else { return false ; } |
public class AbstractObjectTable { /** * Construct the table model for this table . The default implementation of
* this creates a GlazedTableModel using an Advanced format .
* @ param eventList
* on which to build the model
* @ return table model */
protected GlazedTableModel createTableModel ( EventList event... | return new GlazedTableModel ( eventList , getColumnPropertyNames ( ) , modelId ) { protected TableFormat createTableFormat ( ) { return new DefaultAdvancedTableFormat ( ) ; } } ; |
public class vlan { /** * Use this API to add vlan . */
public static base_response add ( nitro_service client , vlan resource ) throws Exception { } } | vlan addresource = new vlan ( ) ; addresource . id = resource . id ; addresource . aliasname = resource . aliasname ; addresource . ipv6dynamicrouting = resource . ipv6dynamicrouting ; return addresource . add_resource ( client ) ; |
public class RuleClassifier { /** * This function This expands the rule */
public void expandeRule ( RuleClassification rl , Instance inst , int ruleIndex ) { } } | int remainder = ( int ) Double . MAX_VALUE ; int numInstanciaObservers = ( int ) rl . obserClassDistrib . sumOfValues ( ) ; // Number of instances for this rule observers .
this . updateRuleAttribStatistics ( inst , rl , ruleIndex ) ; if ( numInstanciaObservers != 0 && this . gracePeriodOption . getValue ( ) != 0 ) { r... |
public class CmsSitemapController { /** * Recomputes the properties for a client sitemap entry . < p >
* @ param entry the entry for whose descendants the properties should be recomputed */
protected void recomputeProperties ( CmsClientSitemapEntry entry ) { } } | for ( I_CmsPropertyUpdateHandler handler : m_propertyUpdateHandlers ) { handler . handlePropertyUpdate ( entry ) ; } for ( CmsClientSitemapEntry child : entry . getSubEntries ( ) ) { recomputeProperties ( child ) ; } |
public class ArrayHelper { /** * Check if the passed array contains only < code > null < / code > element .
* @ param < T >
* element type
* @ param aArray
* The array to check . May be < code > null < / code > .
* @ return < code > true < / code > only if the passed array is neither
* < code > null < / cod... | if ( isEmpty ( aArray ) ) return false ; for ( final Object aObj : aArray ) if ( aObj != null ) return false ; return true ; |
public class InefficientStringBuffering { /** * implements the visitor to create and clear the stack
* @ param obj
* the context object of the currently parsed code block */
@ Override public void visitCode ( final Code obj ) { } } | if ( obj . getCode ( ) != null ) { stack . resetForMethodEntry ( this ) ; sawLDCEmpty = false ; super . visitCode ( obj ) ; } |
public class JsonParser { /** * < p > parse . < / p >
* @ param key a { @ link java . lang . String } object .
* @ param value a { @ link java . lang . Object } object .
* @ param environment a { @ link org . configureme . environments . DynamicEnvironment } object .
* @ return a { @ link java . util . List } o... | // an object value means a change in environment , let ' s see what it is
if ( value instanceof JSONObject && key . startsWith ( COMPOSITE_ATTR_PREFIX ) ) return Collections . singletonList ( parseComposite ( key , ( JSONObject ) value , environment ) ) ; if ( value instanceof JSONArray && key . startsWith ( COMPOSITE_... |
public class MapOperation { /** * This method helps to add clearing Near Cache event only from one - partition which matches partitionId of the map name . */
protected final void invalidateAllKeysInNearCaches ( ) { } } | if ( mapContainer . hasInvalidationListener ( ) ) { int partitionId = getPartitionId ( ) ; Invalidator invalidator = getNearCacheInvalidator ( ) ; if ( partitionId == getNodeEngine ( ) . getPartitionService ( ) . getPartitionId ( name ) ) { invalidator . invalidateAllKeys ( name , getCallerUuid ( ) ) ; } invalidator . ... |
public class MessageInitialProcess { /** * Init Method . */
public void init ( RecordOwnerParent taskParent , Record recordMain , Map < String , Object > properties ) { } } | super . init ( taskParent , recordMain , properties ) ; this . registerInitialProcesses ( ) ; |
public class QueryCache { /** * Obtain the cache . Start it lazily when needed . */
private Cache < QueryCacheKey , Object > getCache ( ) { } } | final Cache < QueryCacheKey , Object > cache = lazyCache ; // Most likely branch first :
if ( cache != null ) { return cache ; } synchronized ( this ) { if ( lazyCache == null ) { // define the query cache configuration if it does not already exist ( from a previous call or manually defined by the user )
internalCacheR... |
public class YahooFinance { /** * Sends a request with the historical quotes included
* starting from the specified { @ link Calendar } date
* at the specified interval .
* Returns null if the data can ' t be retrieved from Yahoo Finance .
* @ param symbol the symbol of the stock for which you want to retrieve ... | return YahooFinance . get ( symbol , from , HistQuotesRequest . DEFAULT_TO , interval ) ; |
public class AbstractParamContainerPanel { /** * Expands the node of the param panel with the given name .
* @ param panelName the name of the panel whose node should be expanded , should not be { @ code null } .
* @ since TODO add version */
public void expandParamPanelNode ( String panelName ) { } } | DefaultMutableTreeNode node = getTreeNodeFromPanelName ( panelName ) ; if ( node != null ) { getTreeParam ( ) . expandPath ( new TreePath ( node . getPath ( ) ) ) ; } |
public class responderaction { /** * Use this API to fetch all the responderaction resources that are configured on netscaler . */
public static responderaction [ ] get ( nitro_service service ) throws Exception { } } | responderaction obj = new responderaction ( ) ; responderaction [ ] response = ( responderaction [ ] ) obj . get_resources ( service ) ; return response ; |
public class CssSkinGenerator { /** * ( non - Javadoc )
* @ see
* net . jawr . web . resource . handler . reader . ResourceBrowser # getFilePath ( java .
* lang . String ) */
@ Override public String getFilePath ( String resourcePath ) { } } | String path = getResolver ( ) . getResourcePath ( resourcePath ) ; return rsBrowser . getFilePath ( path ) ; |
public class BooleanUtils { /** * < p > Negates the specified boolean . < / p >
* < p > If { @ code null } is passed in , { @ code null } will be returned . < / p >
* < p > NOTE : This returns null and will throw a NullPointerException if unboxed to a boolean . < / p >
* < pre >
* BooleanUtils . negate ( Boolea... | if ( bool == null ) { return null ; } return bool . booleanValue ( ) ? Boolean . FALSE : Boolean . TRUE ; |
public class GetMetricStatisticsRequest { /** * The percentile statistics . Specify values between p0.0 and p100 . When calling < code > GetMetricStatistics < / code > ,
* you must specify either < code > Statistics < / code > or < code > ExtendedStatistics < / code > , but not both . Percentile
* statistics are no... | if ( this . extendedStatistics == null ) { setExtendedStatistics ( new com . amazonaws . internal . SdkInternalList < String > ( extendedStatistics . length ) ) ; } for ( String ele : extendedStatistics ) { this . extendedStatistics . add ( ele ) ; } return this ; |
public class ServerStatsEncoding { /** * Decodes serialized byte array to create { @ link ServerStats } as per Opencensus Summary Span
* specification .
* @ param serialized encoded { @ code ServerStats } in byte array .
* @ return decoded { @ code ServerStats } . null if decoding fails .
* @ since 0.16 */
publ... | final ByteBuffer bb = ByteBuffer . wrap ( serialized ) ; bb . order ( ByteOrder . LITTLE_ENDIAN ) ; long serviceLatencyNs = 0L ; long lbLatencyNs = 0L ; byte traceOption = ( byte ) 0 ; // Check the version first .
if ( ! bb . hasRemaining ( ) ) { throw new ServerStatsDeserializationException ( "Serialized ServerStats b... |
public class PayIn { /** * Gets the structure that maps which property depends on other property .
* @ return */
@ Override public Map < String , Map < String , Map < String , Class < ? > > > > getDependentObjects ( ) { } } | return new HashMap < String , Map < String , Map < String , Class < ? > > > > ( ) { { put ( "PaymentType" , new HashMap < String , Map < String , Class < ? > > > ( ) { { put ( "CARD" , new HashMap < String , Class < ? > > ( ) { { put ( "PaymentDetails" , PayInPaymentDetailsCard . class ) ; } } ) ; put ( "PREAUTHORIZED"... |
public class InstanceNetworkInterface { /** * One or more security groups .
* @ param groups
* One or more security groups . */
public void setGroups ( java . util . Collection < GroupIdentifier > groups ) { } } | if ( groups == null ) { this . groups = null ; return ; } this . groups = new com . amazonaws . internal . SdkInternalList < GroupIdentifier > ( groups ) ; |
public class GroupsPieChart { /** * Updates the state of the chart
* @ param groupTargetCounts
* list of target counts
* @ param totalTargetsCount
* total count of targets that are represented by the pie */
public void setChartState ( final List < Long > groupTargetCounts , final Long totalTargetsCount ) { } } | getState ( ) . setGroupTargetCounts ( groupTargetCounts ) ; getState ( ) . setTotalTargetCount ( totalTargetsCount ) ; markAsDirty ( ) ; |
public class DebugMolecularFormula { /** * { @ inheritDoc } */
@ Override public IMolecularFormula addIsotope ( IIsotope isotope ) { } } | logger . debug ( "Adding isotope: " , isotope ) ; return super . addIsotope ( isotope ) ; |
public class StringUtility { /** * Joins the string representation of objects on the provided delimiter .
* The iteration will be performed twice . Once to compute the total length
* of the resulting string , and the second to build the result .
* @ throws ConcurrentModificationException if iteration is not consi... | int delimiterLength = delimiter . length ( ) ; // Find total length
int totalLength = 0 ; boolean didOne = false ; for ( Object obj : objects ) { if ( didOne ) totalLength += delimiterLength ; else didOne = true ; totalLength += String . valueOf ( obj ) . length ( ) ; } // Build result
StringBuilder sb = new StringBuil... |
public class GrassLegacyUtilities { /** * return the rectangle of the cell of the active region , that surrounds the given coordinates
* @ param activeRegion
* @ param x the given easting coordinate
* @ param y given northing coordinate
* @ return the rectangle localizing the cell inside which the x and y stay ... | double minx = activeRegion . getRectangle ( ) . getBounds2D ( ) . getMinX ( ) ; double ewres = activeRegion . getWEResolution ( ) ; double snapx = minx + ( Math . round ( ( x - minx ) / ewres ) * ewres ) ; double miny = activeRegion . getRectangle ( ) . getBounds2D ( ) . getMinY ( ) ; double nsres = activeRegion . getN... |
public class ElemLiteralResult { /** * Return the raw value of the attribute .
* @ param namespaceURI : localName or localName if the namespaceURI is null of
* the attribute to get
* @ return The Attr value as a string , or the empty string if that attribute
* does not have a specified or default value */
publi... | AVT avt = getLiteralResultAttribute ( rawName ) ; if ( ( null != avt ) ) { return avt . getSimpleString ( ) ; } return EMPTYSTRING ; |
public class JSLocalConsumerPoint { /** * NOTE : Callers to this method will have the JSLocalConsumerPoint locked
* ( and their JSKeyGroup locked if applicable ) */
private int lockMessages ( boolean isolatedRun ) throws SIResourceException { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "lockMessages" , new Object [ ] { this , Boolean . valueOf ( isolatedRun ) } ) ; int numOfMsgs = 0 ; _transferredConsumer = null ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc... |
public class ApiOvhMe { /** * Get this object properties
* REST : GET / me / order / { orderId } / details / { orderDetailId } / extension
* @ param orderId [ required ]
* @ param orderDetailId [ required ]
* API beta */
public OvhItemDetail order_orderId_details_orderDetailId_extension_GET ( Long orderId , Lon... | String qPath = "/me/order/{orderId}/details/{orderDetailId}/extension" ; StringBuilder sb = path ( qPath , orderId , orderDetailId ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , OvhItemDetail . class ) ; |
public class SibRaProducerSession { /** * Sends a message . Checks that the session is valid . Maps the transaction
* parameter before delegating .
* @ param msg
* the message to send
* @ param tran
* the transaction to send the message under
* @ throws SIConnectionUnavailableException
* if the connection... | checkValid ( ) ; _delegate . send ( msg , _parentConnection . mapTransaction ( tran ) ) ; |
public class UIResults { /** * Create a self - referencing URL that will perform a query for all copies
* of the given URL .
* < p > This method builds URL that passes target URL in CGI parameter ,
* along with other parameters unnecessary for making simple capture
* query request . It is not suitable for simpl... | WaybackRequest newWBR = wbRequest . clone ( ) ; newWBR . setCaptureQueryRequest ( ) ; newWBR . setRequestUrl ( url ) ; return newWBR . getAccessPoint ( ) . getQueryPrefix ( ) + "query?" + newWBR . getQueryArguments ( 1 ) ; |
public class PdfContentByte { /** * Sets the fill color . < CODE > color < / CODE > can be an
* < CODE > ExtendedColor < / CODE > .
* @ param color the color */
public void setColorFill ( Color color ) { } } | PdfXConformanceImp . checkPDFXConformance ( writer , PdfXConformanceImp . PDFXKEY_COLOR , color ) ; int type = ExtendedColor . getType ( color ) ; switch ( type ) { case ExtendedColor . TYPE_GRAY : { setGrayFill ( ( ( GrayColor ) color ) . getGray ( ) ) ; break ; } case ExtendedColor . TYPE_CMYK : { CMYKColor cmyk = ( ... |
public class RenderUtils { /** * Render disabled class as : - class - simple - name ( class - package ) .
* @ param type class
* @ return rendered disabled class line */
public static String renderDisabledClassLine ( final Class < ? > type ) { } } | return String . format ( "-%-27s %-26s" , getClassName ( type ) , brackets ( renderPackage ( type ) ) ) ; |
public class Seconds { /** * Obtains a { @ code Seconds } representing the number of seconds
* equivalent to a number of hours .
* The resulting amount will be second - based , with the number of seconds
* equal to the number of minutes multiplied by 60.
* @ param minutes the number of minutes , positive or neg... | if ( minutes == 0 ) { return ZERO ; } return new Seconds ( Math . multiplyExact ( minutes , SECONDS_PER_MINUTE ) ) ; |
public class FileUpload { /** * Base support for the attribute tag . This is overridden to prevent setting the < code > type < / code >
* attribute .
* @ param name The name of the attribute . This value may not be null or the empty string .
* @ param value The value of the attribute . This may contain an express... | if ( name != null ) { if ( name . equals ( TYPE ) ) { String s = Bundle . getString ( "Tags_AttributeMayNotBeSet" , new Object [ ] { name } ) ; registerTagError ( s , null ) ; } else if ( name . equals ( READONLY ) ) { _state . readonly = Boolean . valueOf ( value ) . booleanValue ( ) ; return ; } } super . setAttribut... |
public class JFapUtils { /** * Generate a JFAPSUMMARY message in trace .
* It is a good idea for the caller to check the main trace TraceComponent . isAnyTracingEnabled ( ) before calling this method .
* The data output by this message can be searched for in several ways :
* < nl >
* < li > Searching on JFAPSUM... | // Use a request number of - 1 to distinguish from valid request numbers which are non - negative .
debugSummaryMessage ( callersTrace , connection , conversation , remark , - 1 ) ; |
public class CmsImportVersion5 { /** * Imports the relations . < p > */
protected void importRelations ( ) { } } | if ( m_importedRelations . isEmpty ( ) ) { return ; } m_report . println ( Messages . get ( ) . container ( Messages . RPT_START_IMPORT_RELATIONS_0 ) , I_CmsReport . FORMAT_HEADLINE ) ; int i = 0 ; Iterator < Entry < String , List < CmsRelation > > > it = m_importedRelations . entrySet ( ) . iterator ( ) ; while ( it .... |
public class DateTimePatternParser { /** * Render the compiled pattern back into string form . */
public static String render ( List < Node > nodes ) { } } | StringBuilder buf = new StringBuilder ( ) ; for ( Node node : nodes ) { if ( node instanceof Text ) { String text = ( ( Text ) node ) . text ; boolean inquote = false ; for ( int i = 0 ; i < text . length ( ) ; i ++ ) { char ch = text . charAt ( i ) ; switch ( ch ) { case 'G' : case 'y' : case 'Y' : case 'u' : case 'U'... |
public class AbstractQueuedSynchronizer { /** * Releases in exclusive mode . Implemented by unblocking one or
* more threads if { @ link # tryRelease } returns true .
* This method can be used to implement method { @ link Lock # unlock } .
* @ param arg the release argument . This value is conveyed to
* { @ lin... | if ( tryRelease ( arg ) ) { Node h = head ; if ( h != null && h . waitStatus != 0 ) unparkSuccessor ( h ) ; return true ; } return false ; |
public class aaauser { /** * Use this API to fetch aaauser resources of given names . */
public static aaauser [ ] get ( nitro_service service , String username [ ] ) throws Exception { } } | if ( username != null && username . length > 0 ) { aaauser response [ ] = new aaauser [ username . length ] ; aaauser obj [ ] = new aaauser [ username . length ] ; for ( int i = 0 ; i < username . length ; i ++ ) { obj [ i ] = new aaauser ( ) ; obj [ i ] . set_username ( username [ i ] ) ; response [ i ] = ( aaauser ) ... |
public class MkCoPTree { /** * auxiliary function for approxKdist methods . */
private double ssqerr ( int k0 , int kmax , double [ ] logk , double [ ] log_kDist , double m , double t ) { } } | int k = kmax - k0 ; double result = 0 ; for ( int i = 0 ; i < k ; i ++ ) { // double h = log _ kDist [ i ] - ( m * ( logk [ i ] - logk [ 0 ] ) + t ) ; ? ? ?
double h = log_kDist [ i ] - m * logk [ i ] - t ; result += h * h ; } return result ; |
public class ZKStream { /** * region private helpers */
@ VisibleForTesting String getActiveTxPath ( final int epoch , final String txId ) { } } | return ZKPaths . makePath ( ZKPaths . makePath ( activeTxRoot , Integer . toString ( epoch ) ) , txId ) ; |
public class Channel { /** * / / / / / Transaction monitoring / / / / / */
private void startEventQue ( ) { } } | if ( eventQueueThread != null ) { return ; } client . getExecutorService ( ) . execute ( ( ) -> { eventQueueThread = Thread . currentThread ( ) ; while ( ! shutdown ) { if ( ! initialized ) { try { logger . debug ( "not intialized:" + initialized ) ; Thread . sleep ( 1 ) ; } catch ( InterruptedException e ) { logger . ... |
public class AlertEntityConditionService { /** * Returns the alert conditions for the given entity .
* @ param entity The entity to look up
* @ return The alert conditions for the entity */
public Collection < AlertCondition > list ( Entity entity ) { } } | return list ( entity . getId ( ) , entity . getType ( ) ) ; |
public class HttpResponseMessageImpl { /** * Query whether this response message ' s status code represents a temporary
* status of 1xx .
* @ return boolean */
public boolean isTemporaryStatusCode ( ) { } } | int code = this . myStatusCode . getIntCode ( ) ; // We need to check if the WebContainer spec level is greater than 3.0
// If it is then we don ' t want to treat the 101 status code as a temp
// one as it changes our behavior
if ( HttpDispatcher . useEE7Streams ( ) && ( code == 101 ) ) return false ; return ( 100 <= c... |
public class SkinSwitcherJsGenerator { /** * ( non - Javadoc )
* @ see net . jawr . web . resource . bundle . generator . AbstractCachedGenerator #
* generateResource ( net . jawr . web . resource . bundle . generator . GeneratorContext ,
* java . lang . String ) */
@ Override public Reader generateResource ( Str... | JawrConfig ctxConfig = context . getConfig ( ) ; String skinCookieName = ctxConfig . getSkinCookieName ( ) ; String script = createScript ( skinCookieName ) ; return new StringReader ( script ) ; |
public class DefaultClusterManager { /** * Creates a redeploy handler . */
private Handler < AsyncResult < String > > createRedeployHandler ( final JsonObject deploymentInfo , final CountDownLatch latch ) { } } | return new Handler < AsyncResult < String > > ( ) { @ Override public void handle ( AsyncResult < String > result ) { if ( result . failed ( ) ) { log . error ( result . cause ( ) ) ; latch . countDown ( ) ; } else { addMappedDeployment ( result . result ( ) , deploymentInfo , new Handler < AsyncResult < String > > ( )... |
public class Bugsnag { /** * Set a timeout ( in ms ) to use when delivering Bugsnag error reports and sessions .
* This is a convenient shorthand for bugsnag . getDelivery ( ) . setTimeout ( ) ;
* @ param timeout the timeout to set ( in ms )
* @ see # setDelivery */
public void setTimeout ( int timeout ) { } } | if ( config . delivery instanceof HttpDelivery ) { ( ( HttpDelivery ) config . delivery ) . setTimeout ( timeout ) ; } if ( config . sessionDelivery instanceof HttpDelivery ) { ( ( HttpDelivery ) config . sessionDelivery ) . setTimeout ( timeout ) ; } |
public class RemoteConsumerDispatcher { /** * Overriding super class method to do nothing */
protected void eventPostCommitAdd ( SIMPMessage msg , TransactionCommon transaction ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "eventPostCommitAdd" , new Object [ ] { msg , transaction } ) ; SibTr . exit ( tc , "eventPostCommitAdd" ) ; } |
public class Matrix4d { /** * Set this matrix to a rotation matrix which rotates the given radians about a given axis .
* The axis described by the < code > axis < / code > vector needs to be a unit vector .
* When used with a right - handed coordinate system , the produced rotation will rotate a vector
* counter... | return rotation ( angle , axis . x ( ) , axis . y ( ) , axis . z ( ) ) ; |
public class InputUtils { /** * Defines order of @ parameters based on @ processedInput
* @ param processedInput InputHandler processedInput
* @ param parameters Query Parameters ordering of which would be updated */
public static void defineOrder ( ProcessedInput processedInput , QueryParameters parameters ) { } } | String parameterName = null ; for ( int i = 0 ; i < processedInput . getAmountOfParameters ( ) ; i ++ ) { parameterName = processedInput . getParameterName ( i ) ; if ( parameterName != null ) { parameters . updatePosition ( parameterName , i ) ; } } |
public class Analyzer { /** * Reflectively examine the view , gathering , filtering , and sorting fields . The results are
* assigned to { @ link # requiredLists } and { @ link # requiredObjects } ; fields that are lists and
* objects of fields that are not lists , respectively . This method is idempotent ; subsequ... | if ( requiredLists != null && requiredObjects != null ) { return ; } requiredLists = required . stream ( ) . filter ( this :: isList ) . map ( f -> new RequiredList < > ( f , view ) ) . filter ( l -> Element . class . isAssignableFrom ( l . genericType ( ) ) || View . class . isAssignableFrom ( l . genericType ( ) ) ||... |
public class FilterUtilities { /** * Creates an intersect filter .
* @ param geomName the name of the geom field to filter .
* @ param geometry the geometry to use as filtering geom .
* @ return the filter .
* @ throws CQLException */
public static Filter getIntersectsGeometryFilter ( String geomName , Geometry... | Filter result = CQL . toFilter ( "INTERSECTS(" + geomName + ", " + geometry . toText ( ) + " )" ) ; return result ; |
public class AnnotatedMethodInvoker { /** * Examines the passed class and extracts a single method that is annotated with the specified annotation type , < code > null < / code > if not methods are so annotated . Behavior is undefined if multiple methods
* have the specified annotation . */
public static < T extends ... | final List < Method > methods = introspectAnnotationMultiple ( klass , annotationType ) ; return ( methods . size ( ) > 0 ) ? methods . get ( 0 ) : null ; |
public class AuthService { /** * Logs into Argus .
* @ param username The username .
* @ param password The password .
* @ throws IOException If the server is unavailable . */
public void login ( String username , String password ) throws IOException { } } | String requestUrl = RESOURCE + "/login" ; Credentials creds = new Credentials ( ) ; creds . setPassword ( password ) ; creds . setUsername ( username ) ; ArgusResponse response = getClient ( ) . executeHttpRequest ( ArgusHttpClient . RequestType . POST , requestUrl , creds ) ; try { assertValidResponse ( response , req... |
public class ListBuilder { /** * Returns an immutable { @ link C . List } from a collection
* @ param col the collection specified
* @ param < T > element type
* @ return an immutable list contains all elements in the collection */
public static < T > C . List < T > toList ( Collection < ? extends T > col ) { } } | if ( col . size ( ) == 0 ) { return Nil . list ( ) ; } if ( col instanceof C . List ) { C . List < T > list = $ . cast ( col ) ; if ( list . is ( C . Feature . IMMUTABLE ) ) { return list ; } } return new ListBuilder < T > ( col ) . toList ( ) ; |
public class DescribeAgentsRequest { /** * The agent or the Connector IDs for which you want information . If you specify no IDs , the system returns
* information about all agents / Connectors associated with your AWS user account .
* < b > NOTE : < / b > This method appends the values to the existing list ( if an... | if ( this . agentIds == null ) { setAgentIds ( new java . util . ArrayList < String > ( agentIds . length ) ) ; } for ( String ele : agentIds ) { this . agentIds . add ( ele ) ; } return this ; |
public class CassandraClientBase { /** * Finds a { @ link List } of entities from database .
* @ param entityClass
* the entity class
* @ param relationNames
* the relation names
* @ param isWrapReq
* the is wrap req
* @ param metadata
* the metadata
* @ param rowIds
* the row ids
* @ return the l... | List entities = null ; MetamodelImpl metaModel = ( MetamodelImpl ) kunderaMetadata . getApplicationMetadata ( ) . getMetamodel ( metadata . getPersistenceUnit ( ) ) ; EntityType entityType = metaModel . entity ( metadata . getEntityClazz ( ) ) ; List < AbstractManagedType > subManagedType = ( ( AbstractManagedType ) en... |
public class MemberBox { /** * Writes a Constructor or Method object .
* Methods and Constructors are not serializable , so we must serialize
* information about the class , the name , and the parameters and
* recreate upon deserialization . */
private static void writeMember ( ObjectOutputStream out , Executable... | if ( member == null ) { out . writeBoolean ( false ) ; return ; } out . writeBoolean ( true ) ; if ( ! ( member instanceof Method || member instanceof Constructor ) ) throw new IllegalArgumentException ( "not Method or Constructor" ) ; out . writeBoolean ( member instanceof Method ) ; out . writeObject ( member . getNa... |
public class FibonacciHeap { /** * Dequeues and returns the minimum element of the Fibonacci heap . If the
* heap is empty , this throws a NoSuchElementException .
* @ return The smallest element of the Fibonacci heap .
* @ throws java . util . NoSuchElementException If the heap is empty . */
public Entry < T > d... | /* Check for whether we ' re empty . */
if ( isEmpty ( ) ) throw new NoSuchElementException ( "Heap is empty." ) ; /* Otherwise , we ' re about to lose an element , so decrement the number of
* entries in this heap . */
-- mSize ; /* Grab the minimum element so we know what to return . */
Entry < T > minElem = mMin ;... |
public class StreamingJobsInner { /** * Creates a streaming job or replaces an already existing streaming job .
* @ 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 jobName The name of the stre... | return ServiceFuture . fromHeaderResponse ( createOrReplaceWithServiceResponseAsync ( resourceGroupName , jobName , streamingJob , ifMatch , ifNoneMatch ) , serviceCallback ) ; |
public class SqlExistStatement { /** * Return SELECT clause for object existence call */
public String getStatement ( ) { } } | if ( sql == null ) { StringBuffer stmt = new StringBuffer ( 128 ) ; ClassDescriptor cld = getClassDescriptor ( ) ; FieldDescriptor [ ] fieldDescriptors = cld . getPkFields ( ) ; if ( fieldDescriptors == null || fieldDescriptors . length == 0 ) { throw new OJBRuntimeException ( "No PK fields defined in metadata for " + ... |
public class Exceptions { /** * TODO : was package - level initially */
public static RuntimeException launderCacheListenerException ( CacheListenerException e ) { } } | Throwable cause = e . getCause ( ) ; if ( cause instanceof CacheEntryListenerException ) return ( CacheEntryListenerException ) cause ; if ( cause instanceof Exception ) return new CacheEntryListenerException ( cause ) ; if ( cause instanceof Error ) throw ( Error ) cause ; return e ; |
public class ZPicture { /** * Queues a ' picture ' message to the socket ( or actor ) , so it can be sent .
* @ param picture The picture is a string that defines the type of each frame .
* This makes it easy to send a complex multiframe message in
* one call . The picture can contain any of these characters ,
... | if ( ! FORMAT . matcher ( picture ) . matches ( ) ) { throw new ZMQException ( picture + " is not in expected format " + FORMAT . pattern ( ) , ZError . EPROTO ) ; } ZMsg msg = new ZMsg ( ) ; for ( int pictureIndex = 0 , argIndex = 0 ; pictureIndex < picture . length ( ) ; pictureIndex ++ , argIndex ++ ) { char pattern... |
public class DaoUtils { /** * Returns an escaped value in parameter , with the desired wildcards . Suitable to be used in a like sql query < br / >
* Escapes the " / " , " % " and " _ " characters . < br / >
* You < strong > must < / strong > add " ESCAPE ' / ' " after your like query . It defines ' / ' as the esca... | String escapedValue = escapePercentAndUnderscore ( value ) ; String wildcard = "%" ; switch ( wildcardPosition ) { case BEFORE : escapedValue = wildcard + escapedValue ; break ; case AFTER : escapedValue += wildcard ; break ; case BEFORE_AND_AFTER : escapedValue = wildcard + escapedValue + wildcard ; break ; default : ... |
public class Reflection { /** * Allows to gracefully create a new instance of class , without having to try - catch exceptions .
* @ param ofClass instance of this class will be constructed using reflection .
* @ return a new instance of passed class .
* @ throws GdxRuntimeException when unable to create a new in... | try { return ClassReflection . newInstance ( ofClass ) ; } catch ( final Throwable exception ) { throw new GdxRuntimeException ( "Unable to create a new instance of class: " + ofClass , exception ) ; } |
public class RAMJobStore { /** * Get all of the Triggers that are associated to the given Job .
* < p > If there are no matches , a zero - length array should be returned . */
@ Override public List < Trigger > getTriggersForJob ( String jobKey ) { } } | ArrayList < Trigger > trigList = new ArrayList < Trigger > ( ) ; synchronized ( lock ) { for ( int i = 0 ; i < wrappedTriggers . size ( ) ; i ++ ) { TriggerWrapper tw = wrappedTriggers . get ( i ) ; if ( tw . jobKey . equals ( jobKey ) ) { trigList . add ( ( OperableTrigger ) tw . trigger . clone ( ) ) ; } } } return t... |
public class AbstractResult { /** * Computes the confidence 05 interval - factor . This value has to be combined with the mean to get the
* confidence - interval .
* @ param meter the meter for the 05 - confidence interval factor
* @ return the 99 % confidence */
public final double getConf05 ( final AbstractMete... | checkIfMeterExists ( meter ) ; final AbstractUnivariateStatistic conf05 = new Percentile ( 5.0 ) ; final CollectionDoubleCollection doubleColl = new CollectionDoubleCollection ( this . meterResults . get ( meter ) ) ; return conf05 . evaluate ( doubleColl . toArray ( ) , 0 , doubleColl . toArray ( ) . length ) ; |
public class SillynessPotPourri { /** * implements the visitor to look for various silly bugs
* @ param seen
* the opcode of the currently parsed instruction */
@ edu . umd . cs . findbugs . annotations . SuppressFBWarnings ( value = "SF_SWITCH_FALLTHROUGH" , justification = "This fall-through is deliberate and doc... | int reg = - 1 ; SPPUserValue userValue = null ; try { stack . precomputation ( this ) ; checkTrimLocations ( ) ; if ( isBranchByteCode ( seen ) ) { Integer branchTarget = Integer . valueOf ( getBranchTarget ( ) ) ; BitSet branchInsSet = branchTargets . get ( branchTarget ) ; if ( branchInsSet == null ) { branchInsSet =... |
public class Scs_gaxpy { /** * Sparse matrix times dense column vector , y = A * x + y .
* @ param A
* column - compressed matrix
* @ param x
* size n , vector x
* @ param y
* size m , vector y
* @ return true if successful , false on error */
public static boolean cs_gaxpy ( Scs A , float [ ] x , float [... | int p , j , n , Ap [ ] , Ai [ ] ; float Ax [ ] ; if ( ! Scs_util . CS_CSC ( A ) || x == null || y == null ) return ( false ) ; /* check inputs */
n = A . n ; Ap = A . p ; Ai = A . i ; Ax = A . x ; for ( j = 0 ; j < n ; j ++ ) { for ( p = Ap [ j ] ; p < Ap [ j + 1 ] ; p ++ ) { y [ Ai [ p ] ] += Ax [ p ] * x [ j ] ; } } ... |
public class CommerceShipmentItemUtil { /** * Returns a range of all the commerce shipment items where commerceShipmentId = & # 63 ; .
* Useful when paginating results . Returns a maximum of < code > end - start < / code > instances . < code > start < / code > and < code > end < / code > are not primary keys , they a... | return getPersistence ( ) . findByCommerceShipment ( commerceShipmentId , start , end ) ; |
public class DistributedObjectCacheAdapter { /** * Adds one or more aliases for the given key in the cache ' s mapping table . If the alias is already
* associated with another key , it will be changed to associate with the new key .
* @ param key the key assoicated with alias
* @ param aliasArray the aliases to ... | final String methodName = "addAlias(key, aliasArray)" ; functionNotAvailable ( methodName ) ; |
public class ReadWriteMultipleRequest { /** * getMessage - - return a prepared message .
* @ return prepared message */
public byte [ ] getMessage ( ) { } } | byte results [ ] = new byte [ 9 + 2 * getWriteWordCount ( ) ] ; results [ 0 ] = ( byte ) ( readReference >> 8 ) ; results [ 1 ] = ( byte ) ( readReference & 0xFF ) ; results [ 2 ] = ( byte ) ( readCount >> 8 ) ; results [ 3 ] = ( byte ) ( readCount & 0xFF ) ; results [ 4 ] = ( byte ) ( writeReference >> 8 ) ; results [... |
public class OWLObjectPropertyRangeAxiomImpl_CustomFieldSerializer { /** * Deserializes the content of the object from the
* { @ link com . google . gwt . user . client . rpc . SerializationStreamReader } .
* @ param streamReader the { @ link com . google . gwt . user . client . rpc . SerializationStreamReader } to... | deserialize ( streamReader , instance ) ; |
public class CmsRequestContext { /** * Adds the given site root of this context to the given resource name ,
* taking into account special folders like " / system " where no site root must be added ,
* and also translates the resource name with the configured the directory translator . < p >
* @ param siteRoot th... | if ( ( resourcename == null ) || ( siteRoot == null ) ) { return null ; } siteRoot = getAdjustedSiteRoot ( siteRoot , resourcename ) ; StringBuffer result = new StringBuffer ( 128 ) ; result . append ( siteRoot ) ; if ( ( ( siteRoot . length ( ) == 0 ) || ( siteRoot . charAt ( siteRoot . length ( ) - 1 ) != '/' ) ) && ... |
public class SymoplibParser { /** * Load all SpaceGroup information from the file spacegroups . xml
* @ return a map providing information for all spacegroups */
private static TreeMap < Integer , SpaceGroup > parseSpaceGroupsXML ( ) { } } | // NOTE : if the space group file is requested by some part of the code ( i . e . this method is called ) and
// there is a problem in reading it , then that ' s truly a FATAL problem , since this is not a user file
// but a file that ' s part of the distribution : it MUST be there and MUST have the right format . A fa... |
public class AsynchronousRequest { /** * For more info on guild log API go < a href = " https : / / wiki . guildwars2 . com / wiki / API : 2 / guild / : id / log " > here < / a > < br / >
* Give user the access to { @ link Callback # onResponse ( Call , Response ) } and { @ link Callback # onFailure ( Call , Throwabl... | isParamValid ( new ParamChecker ( ParamType . GUILD , id ) , new ParamChecker ( ParamType . API , api ) ) ; gw2API . getFilteredGuildLogInfo ( id , api , Integer . toString ( since ) ) . enqueue ( callback ) ; |
public class FontDescriptorSpecificationImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public void setFtDsFlags ( Integer newFtDsFlags ) { } } | Integer oldFtDsFlags = ftDsFlags ; ftDsFlags = newFtDsFlags ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , AfplibPackage . FONT_DESCRIPTOR_SPECIFICATION__FT_DS_FLAGS , oldFtDsFlags , ftDsFlags ) ) ; |
public class CsvWriter { /** * Create a DSL on the specified type .
* @ param typeReference the type of object to write
* @ param < T > the type
* @ return a DSL on the specified type */
public static < T > CsvWriterDSL < T > from ( TypeReference < T > typeReference ) { } } | return from ( typeReference . getType ( ) ) ; |
public class TraceNLS { /** * Return the message obtained by looking up the localized text
* corresponding to the specified key in the specified ResourceBundle using
* the specified Locale and formatting the resultant text using the
* specified substitution arguments .
* The message is formatted using the java ... | return TraceNLSResolver . getInstance ( ) . getMessage ( aClass , bundle , bundleName , key , args , defaultString , true , locale , quiet ) ; |
public class RequestHttpWeb { /** * Service is the main call when data is available from the socket . */
@ Override public StateConnection service ( ) { } } | try { StateConnection nextState = _state . service ( this ) ; // return StateConnection . CLOSE ;
return nextState ; /* if ( _ invocation = = null & & getRequestHttp ( ) . parseInvocation ( ) ) {
if ( _ invocation = = null ) {
return NextState . CLOSE ;
return _ invocation . service ( this , getResponse ( ) ) ;
... |
public class ServerInfoMBeanImpl { /** * { @ inheritDoc } */
@ Override public String getDefaultHostname ( ) { } } | final String hostname = varReg . resolveString ( VAR_DEFAULTHOSTNAME ) ; // If we have no specified host name ( we get the raw variable back ) , or the host name is empty , default to localhost
if ( VAR_DEFAULTHOSTNAME . equals ( hostname ) || hostname . trim ( ) . isEmpty ( ) ) { return "localhost" ; } else if ( "*" .... |
public class Serializables { /** * Utility for turning a serializable object into a byte array . If the { @ code compress } option is selected
* then the bytes will be run through gzip compression . */
public static byte [ ] serialize ( Serializable serializable , boolean compress ) throws IOException { } } | requireNonNull ( serializable ) ; try ( ByteArrayOutputStream o = new ByteArrayOutputStream ( ) ; ObjectOutputStream oos = new ObjectOutputStream ( compress ? new GZIPOutputStream ( o ) : o ) ) { oos . writeObject ( serializable ) ; oos . flush ( ) ; oos . close ( ) ; // must close before getting bytes because GZip str... |
public class BaseTemplate { /** * Imports a template and renders it using the specified model , allowing fine grained composition of templates and
* layouting . This works similarily to a template include but allows a distinct model to be used . If the layout
* inherits from the parent model , a new model is create... | Map submodel = inheritModel ? forkModel ( model ) : model ; URL resource = engine . resolveTemplate ( templateName ) ; engine . createTypeCheckedModelTemplate ( resource , modelTypes ) . make ( submodel ) . writeTo ( out ) ; return this ; |
public class Jwts { /** * Creates a new { @ link Header } instance suitable for < em > plaintext < / em > ( not digitally signed ) JWTs , populated
* with the specified name / value pairs . As this is a less common use of JWTs , consider using the
* { @ link # jwsHeader ( java . util . Map ) } factory method instea... | return Classes . newInstance ( "io.jsonwebtoken.impl.DefaultHeader" , MAP_ARG , header ) ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.