signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class HttpsRedirect { /** * Return the full URL that should be redirected to including query parameters . */
private String getRedirectUrl ( HttpServletRequest request , String newScheme ) { } } | String serverName = request . getServerName ( ) ; String uri = request . getRequestURI ( ) ; StringBuilder redirect = new StringBuilder ( 100 ) ; redirect . append ( newScheme ) ; redirect . append ( "://" ) ; redirect . append ( serverName ) ; redirect . append ( uri ) ; String query = request . getQueryString ( ) ; i... |
public class RuntimeFieldFactory { /** * Returns the factory for inline ( scalar ) values . */
@ SuppressWarnings ( "unchecked" ) public static < T > RuntimeFieldFactory < T > getInline ( Class < T > typeClass ) { } } | return ( RuntimeFieldFactory < T > ) __inlineValues . get ( typeClass . getName ( ) ) ; |
public class IterableSubject { /** * Fails if the subject does not have the given size . */
public final void hasSize ( int expectedSize ) { } } | checkArgument ( expectedSize >= 0 , "expectedSize(%s) must be >= 0" , expectedSize ) ; int actualSize = size ( actual ( ) ) ; check ( "size()" ) . that ( actualSize ) . isEqualTo ( expectedSize ) ; |
public class ContentTargeting { /** * Gets the targetedContentMetadata value for this ContentTargeting .
* @ return targetedContentMetadata * A list of content metadata within hierarchies that are being
* targeted by the { @ code LineItem } . */
public com . google . api . ads . admanager . axis . v201808 . Content... | return targetedContentMetadata ; |
public class SqlInfo { /** * Visible for testing */
static boolean isFollowedOrPrefixedByColon ( String sql , int i ) { } } | return ':' == sql . charAt ( i + 1 ) || ( i > 0 && ':' == sql . charAt ( i - 1 ) ) ; |
public class PerformanceMetrics { /** * Creates new instance of performance metrics . Stores the key and correlation id of the parent metrics instance .
* Assigns next level .
* @ param nextAction a short name of measured operation , typically a first prefix of descriptor
* @ param nextActionClass a class which i... | PerformanceMetrics next = new PerformanceMetrics ( key , level + 1 , nextAction , nextActionClass , nextDescriptor , correlationId ) ; next . previous = this ; return next ; |
public class DirectClustering { /** * Performs one iteration of Direct Clustering over the data set . */
private static void clusterIteration ( Matrix matrix , int numClusters , KMeansSeed seedType , CriterionFunction criterion ) { } } | DoubleVector [ ] centers = seedType . chooseSeeds ( numClusters , matrix ) ; // Compute the initial set of assignments for each data point based on
// the initial assignments .
int [ ] initialAssignments = new int [ matrix . rows ( ) ] ; // If there is to be only one cluster , then everything will be auto
// assigned t... |
public class FnBigDecimal { /** * It multiplies target by multiplicand and returns its value . The result precision
* and { @ link RoundingMode } is specified by the given { @ link MathContext }
* @ param multiplicand the multiplicand
* @ param mathContext the { @ link MathContext } to define { @ link RoundingMod... | return multiplyBy ( Byte . valueOf ( multiplicand ) , mathContext ) ; |
public class Base64 { /** * Validate char byte and revalculate to data byte value or throw IllegalArgumentException .
* @ param decodabet The decodabet to use .
* @ param from The char byte to check .
* @ return The value byte .
* @ throws IllegalArgumentException If the char is not valid for the alphabet . */
... | byte b = decodabet [ from & 0x7F ] ; if ( b < 0 ) { throw new IllegalArgumentException ( String . format ( "Bad Base64%s character '%s'" , ( decodabet == _URL_SAFE_DECODABET ? " url safe" : "" ) , escape ( from ) ) ) ; } return b ; |
public class Java5 { /** * Synthetic parameters such as those added for inner class constructors may
* not be included in the parameter annotations array . This is the case when
* at least one parameter of an inner class constructor has an annotation with
* a RUNTIME retention ( this occurs for JDK8 and below ) .... | /* * TODO : Remove after JDK9 is the minimum JDK supported
* JDK9 + correctly accounts for the synthetic parameter and when it becomes
* the minimum version this method should no longer be required . */
int parameterCount = constructor . getParameterTypes ( ) . length ; Annotation [ ] [ ] annotations = constructor ... |
public class AbstractNode { /** * Returns a list of the entries .
* @ return a list of the entries
* @ deprecated Using this method means an extra copy - usually at the cost of
* performance . */
@ SuppressWarnings ( "unchecked" ) @ Deprecated public final List < E > getEntries ( ) { } } | List < E > result = new ArrayList < > ( numEntries ) ; for ( Entry entry : entries ) { if ( entry != null ) { result . add ( ( E ) entry ) ; } } return result ; |
public class PGPRGImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public void setPGorient ( Integer newPGorient ) { } } | Integer oldPGorient = pGorient ; pGorient = newPGorient ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , AfplibPackage . PGPRG__PGORIENT , oldPGorient , pGorient ) ) ; |
public class UndoUtils { /** * Returns an UndoManager with an unlimited history that can undo / redo { @ link PlainTextChange } s . New changes
* emitted from the stream will not be merged with the previous change
* after { @ link # DEFAULT _ PREVENT _ MERGE _ DELAY } */
public static < PS , SEG , S > UndoManager <... | return plainTextUndoManager ( area , DEFAULT_PREVENT_MERGE_DELAY ) ; |
public class XAttributeMapLazyImpl { /** * / * ( non - Javadoc )
* @ see java . util . Map # put ( java . lang . Object , java . lang . Object ) */
public synchronized XAttribute put ( String key , XAttribute value ) { } } | if ( backingStore == null ) { try { backingStore = backingStoreClass . newInstance ( ) ; } catch ( Exception e ) { // Fuckup
e . printStackTrace ( ) ; } } return backingStore . put ( key , value ) ; |
public class LdapTemplate { /** * { @ inheritDoc } */
@ Override public void search ( final String base , final String filter , final SearchControls controls , NameClassPairCallbackHandler handler , DirContextProcessor processor ) { } } | // Create a SearchExecutor to perform the search .
SearchExecutor se = new SearchExecutor ( ) { public NamingEnumeration executeSearch ( DirContext ctx ) throws javax . naming . NamingException { return ctx . search ( base , filter , controls ) ; } } ; if ( handler instanceof ContextMapperCallbackHandler ) { assureRetu... |
public class Pattern { /** * Appends a new pattern to the existing one . The new pattern enforces non - strict
* temporal contiguity . This means that a matching event of this pattern and the
* preceding matching event might be interleaved with other events which are ignored .
* @ param name Name of the new patte... | return new Pattern < > ( name , this , ConsumingStrategy . SKIP_TILL_ANY , afterMatchSkipStrategy ) ; |
public class ProjectReportScreen { /** * Add to the current level , then
* get the record at this level
* If the record doesn ' t exist , clone a new one and return it .
* @ param record The main record ( that I will clone if I need to )
* @ param iOffsetFromCurrentLevel The amount to bump the level
* @ retur... | int dLevel = ( int ) this . getScreenRecord ( ) . getField ( ProjectTaskScreenRecord . CURRENT_LEVEL ) . getValue ( ) ; dLevel = dLevel + iOffsetFromCurrentLevel ; this . getScreenRecord ( ) . getField ( ProjectTaskScreenRecord . CURRENT_LEVEL ) . setValue ( dLevel ) ; if ( m_rgCurrentLevelInfo . size ( ) >= dLevel ) {... |
public class ThriftCodecByteCodeGenerator { /** * Defines the generics bridge method with untyped args to the type specific write method . */
private void defineWriteBridgeMethod ( ) { } } | classDefinition . addMethod ( new MethodDefinition ( a ( PUBLIC , BRIDGE , SYNTHETIC ) , "write" , null , arg ( "struct" , Object . class ) , arg ( "protocol" , TProtocol . class ) ) . addException ( Exception . class ) . loadThis ( ) . loadVariable ( "struct" , structType ) . loadVariable ( "protocol" ) . invokeVirtua... |
public class ImageHandlerBuilder { /** * Resize the image to the given width and height
* @ param width
* @ param height
* @ return */
public ImageHandlerBuilder resize ( int width , int height ) { } } | BufferedImage resize = Scalr . resize ( image , Scalr . Mode . FIT_EXACT , width , height ) ; image . flush ( ) ; image = resize ; return this ; |
public class Solo { /** * Clicks a WebElement matching the specified By object .
* @ param by the By object . Examples are : { @ code By . id ( " id " ) } and { @ code By . name ( " name " ) } */
public void clickOnWebElement ( By by ) { } } | if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "clickOnWebElement(" + by + ")" ) ; } clickOnWebElement ( by , 0 , true ) ; |
public class Server { /** * Does global scope lookup for host name and context path
* @ param hostName
* Host name
* @ param contextPath
* Context path
* @ return Global scope */
public IGlobalScope lookupGlobal ( String hostName , String contextPath ) { } } | log . trace ( "{}" , this ) ; log . debug ( "Lookup global scope - host name: {} context path: {}" , hostName , contextPath ) ; // Init mappings key
String key = getKey ( hostName , contextPath ) ; // If context path contains slashes get complex key and look for it in mappings
while ( contextPath . indexOf ( SLASH ) !=... |
public class CATBrowseConsumer { /** * Closes the browser .
* @ param requestNumber */
@ Override public void close ( int requestNumber ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "close" , "" + requestNumber ) ; BrowserSession browserSession = mainConsumer . getBrowserSession ( ) ; try { browserSession . close ( ) ; } catch ( SIException e ) { // No FFDC code needed
// Only FFDC if we haven ' ... |
public class MethodCommand { /** * Gets a parameter value as a Java Boolean .
* @ param name The parameter name
* @ param params The parameters
* @ return The boolean */
protected BigDecimal asBigDecimal ( String name , Map < String , Value > params ) { } } | return coerceToBigDecimal ( params . get ( name ) ) ; |
public class InputHandler { /** * region . . . Mouse listener methods . . . */
@ Override public void mouseClicked ( MouseEvent e ) { } } | mouseEvents . add ( MouseInputEvent . fromMouseEvent ( MouseAction . CLICKED , e ) ) ; |
public class KeySnapshot { /** * Return all the keys of the given class .
* @ param clz Class
* @ return array of keys in this snapshot with the given class */
public static Key [ ] globalKeysOfClass ( final Class clz ) { } } | return KeySnapshot . globalSnapshot ( ) . filter ( new KeySnapshot . KVFilter ( ) { @ Override public boolean filter ( KeySnapshot . KeyInfo k ) { return Value . isSubclassOf ( k . _type , clz ) ; } } ) . keys ( ) ; |
public class DisasterRecoveryConfigurationsInner { /** * Creates or updates a disaster recovery configuration .
* @ param resourceGroupName The name of the resource group that contains the resource . You can obtain this value from the Azure Resource Manager API or the portal .
* @ param serverName The name of the s... | return createOrUpdateWithServiceResponseAsync ( resourceGroupName , serverName , disasterRecoveryConfigurationName ) . toBlocking ( ) . last ( ) . body ( ) ; |
public class CommercePriceListUtil { /** * Returns the first commerce price list in the ordered set where uuid = & # 63 ; .
* @ param uuid the uuid
* @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > )
* @ return the first matching commerce price list , or < code >... | return getPersistence ( ) . fetchByUuid_First ( uuid , orderByComparator ) ; |
public class Parsers { /** * A { @ link Parser } that sequentially runs { @ code p1 } and { @ code p2 } and collects the results in a
* { @ link Pair } object . Is equivalent to { @ link # tuple ( Parser , Parser ) } .
* @ deprecated Prefer to converting to your own object with a lambda . */
@ Deprecated public sta... | return sequence ( p1 , p2 , Pair :: new ) ; |
public class WikiUser { /** * create a credentials ini file from the command line */
public static void createIniFile ( String ... args ) { } } | try { // open up standard input
BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String wikiid = null ; if ( args . length > 0 ) wikiid = args [ 0 ] ; else wikiid = getInput ( "wiki id" , br ) ; String username = null ; if ( args . length > 1 ) username = args [ 1 ] ; else username = g... |
public class GovernatorComponentProviderFactory { /** * Maps a Guice scope to a Jersey scope .
* @ return the map */
public Map < Scope , ComponentScope > createScopeMap ( ) { } } | Map < Scope , ComponentScope > result = new HashMap < Scope , ComponentScope > ( ) ; result . put ( Scopes . SINGLETON , ComponentScope . Singleton ) ; result . put ( Scopes . NO_SCOPE , ComponentScope . PerRequest ) ; result . put ( ServletScopes . REQUEST , ComponentScope . PerRequest ) ; return result ; |
public class ClassUtils { /** * Returns the ( initialized ) class represented by { @ code className }
* using the { @ code classLoader } . This implementation supports
* the syntaxes " { @ code java . util . Map . Entry [ ] } " ,
* " { @ code java . util . Map $ Entry [ ] } " , " { @ code [ Ljava . util . Map . E... | return getClass ( classLoader , className , true ) ; |
public class Ifc2x3tc1FactoryImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public IfcDimensionExtentUsage createIfcDimensionExtentUsageFromString ( EDataType eDataType , String initialValue ) { } } | IfcDimensionExtentUsage result = IfcDimensionExtentUsage . get ( initialValue ) ; if ( result == null ) throw new IllegalArgumentException ( "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType . getName ( ) + "'" ) ; return result ; |
public class XGMMLUtility { /** * Write an XGMML & lt ; edge & gt ; from { @ code edge } properties .
* @ param edge { @ link Edge } , the edge to write
* @ param writer { @ link PrintWriter } , the writer */
public static void writeEdge ( Node src , Node tgt , Edge edge , PrintWriter writer ) { } } | StringBuilder sb = new StringBuilder ( ) ; RelationshipType rel = edge . rel ; String reldispval = rel . getDisplayValue ( ) ; sb . append ( " <edge label='" ) ; String dispval = format ( EDGE_LABEL , src . label , rel , tgt . label ) ; sb . append ( dispval ) ; sb . append ( "' source='" ) ; sb . append ( edge . sour... |
public class HtmlOutcomeTargetLink { /** * < p > Return the value of the < code > onmousemove < / code > property . < / p >
* < p > Contents : Javascript code executed when a pointer button is
* moved within this element . */
public java . lang . String getOnmousemove ( ) { } } | return ( java . lang . String ) getStateHelper ( ) . eval ( PropertyKeys . onmousemove ) ; |
public class MSDelegatingLocalTransactionSynchronization { public void beforeCompletion ( ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "beforeCompletion" ) ; if ( _state != TransactionState . STATE_ACTIVE ) { MessageStoreRuntimeException mre = new MessageStoreRuntimeException ( nls . getFormattedMessage ( "TRAN_PROTOCOL_ERROR_SIMS1001" , new Object [ ] { } ... |
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link String } { @ code > } */
@ XmlElementDecl ( namespace = "http://docs.oasis-open.org/ns/cmis/messaging/200908/" , name = "filter" , scope = GetProperties . class ) public JAXBElement < String > createGetPropertiesFilter... | return new JAXBElement < String > ( _GetPropertiesFilter_QNAME , String . class , GetProperties . class , value ) ; |
public class Pattern { /** * Splits the given input sequence around matches of this pattern .
* < p > The array returned by this method contains each substring of the
* input sequence that is terminated by another subsequence that matches
* this pattern or is terminated by the end of the input sequence . The
* ... | String [ ] fast = fastSplit ( pattern , input . toString ( ) , limit ) ; if ( fast != null ) { return fast ; } int index = 0 ; boolean matchLimited = limit > 0 ; ArrayList < String > matchList = new ArrayList < > ( ) ; Matcher m = matcher ( input ) ; // Add segments before each match found
while ( m . find ( ) ) { if (... |
public class ServletHttpResponse { public void addDateHeader ( String name , long value ) { } } | try { _httpResponse . addDateField ( name , value ) ; } catch ( IllegalStateException e ) { LogSupport . ignore ( log , e ) ; } |
public class TimeStampUtils { /** * Gets the current date / time based on the provided { @ code format }
* which is a SimpleDateFormat string . If application of the provided
* { @ code format } fails a default format is used .
* The DEFAULT is defined in Messages . properties .
* @ see SimpleDateFormat
* @ p... | try { SimpleDateFormat sdf = new SimpleDateFormat ( format ) ; return sdf . format ( new Date ( ) ) ; } catch ( IllegalArgumentException | NullPointerException e ) { return ( TimeStampUtils . currentDefaultFormattedTimeStamp ( ) ) ; } |
public class CreateConsumerQuery { /** * / * ( non - Javadoc )
* @ see net . timewalker . ffmq4 . network . packet . AbstractPacket # unserializeFrom ( net . timewalker . ffmq4 . utils . RawDataInputStream ) */
@ Override protected void unserializeFrom ( RawDataBuffer in ) { } } | super . unserializeFrom ( in ) ; consumerId = new IntegerID ( in . readInt ( ) ) ; destination = DestinationSerializer . unserializeFrom ( in ) ; messageSelector = in . readNullableUTF ( ) ; noLocal = in . readBoolean ( ) ; |
public class ARPACK { /** * Find k approximate eigen pairs of a symmetric matrix by the
* Lanczos algorithm .
* @ param k Number of eigenvalues of OP to be computed . 0 < k < N .
* @ param ritz Specify which of the Ritz values to compute . */
public static EVD eigen ( Matrix A , int k , Ritz ritz ) { } } | return eigen ( A , k , ritz , 1E-8 , 10 * A . nrows ( ) ) ; |
public class GuildManager { /** * Sets the { @ link net . dv8tion . jda . core . entities . Guild . VerificationLevel Verification Level } of this { @ link net . dv8tion . jda . core . entities . Guild Guild } .
* @ param level
* The new Verification Level for this { @ link net . dv8tion . jda . core . entities . G... | Checks . notNull ( level , "Level" ) ; Checks . check ( level != Guild . VerificationLevel . UNKNOWN , "Level must not be UNKNOWN" ) ; this . verificationLevel = level . getKey ( ) ; set |= VERIFICATION_LEVEL ; return this ; |
public class FacetInspector { /** * Inspect the given { @ link Class } for any { @ link FacetConstraintType # OPTIONAL } dependency { @ link Facet } types . */
public static < FACETTYPE extends Facet < ? > > Set < Class < FACETTYPE > > getOptionalFacets ( final Class < ? > inspectedType ) { } } | return getRelatedFacets ( inspectedType , FacetConstraintType . OPTIONAL ) ; |
public class vpnvserver_cachepolicy_binding { /** * Use this API to fetch vpnvserver _ cachepolicy _ binding resources of given name . */
public static vpnvserver_cachepolicy_binding [ ] get ( nitro_service service , String name ) throws Exception { } } | vpnvserver_cachepolicy_binding obj = new vpnvserver_cachepolicy_binding ( ) ; obj . set_name ( name ) ; vpnvserver_cachepolicy_binding response [ ] = ( vpnvserver_cachepolicy_binding [ ] ) obj . get_resources ( service ) ; return response ; |
public class RRBudget10V1_1Generator { /** * This method returns RRBudget10Document object based on proposal development
* document which contains the informations such as
* DUNSID , OrganizationName , BudgetType , BudgetYear and BudgetSummary .
* @ return rrBudgetDocument { @ link XmlObject } of type RRBudget10D... | deleteAutoGenNarratives ( ) ; RRBudget10Document rrBudgetDocument = RRBudget10Document . Factory . newInstance ( ) ; RRBudget10 rrBudget = RRBudget10 . Factory . newInstance ( ) ; rrBudget . setFormVersion ( FormVersion . v1_1 . getVersion ( ) ) ; if ( pdDoc . getDevelopmentProposal ( ) . getApplicantOrganization ( ) !... |
public class base_resource { /** * Converts netscaler resource to Json string .
* @ param service nitro _ service object .
* @ param id sessionId .
* @ param option Options object .
* @ return string in Json format . */
protected String resource_to_string ( nitro_service service , String id , options option ) {... | Boolean warning = service . get_warning ( ) ; String onerror = service . get_onerror ( ) ; String result = service . get_payload_formatter ( ) . resource_to_string ( this , id , option , warning , onerror ) ; return result ; |
public class Excel03SaxReader { /** * - - - - - Read start */
@ Override public Excel03SaxReader read ( File file , int sheetIndex ) throws POIException { } } | try { return read ( new POIFSFileSystem ( file ) , sheetIndex ) ; } catch ( IOException e ) { throw new POIException ( e ) ; } |
public class BaseFacebookClient { /** * Gets the URL - encoded version of the given { @ code value } for the parameter named { @ code name } .
* Includes special - case handling for access token parameters where we check if the token is already URL - encoded - if
* so , we don ' t encode again . All other parameter... | // Special handling for access _ token -
// ' % 7C ' is the pipe character and will be present in any access _ token
// parameter that ' s already URL - encoded . If we see this combination , don ' t
// URL - encode . Otherwise , URL - encode as normal .
return ACCESS_TOKEN_PARAM_NAME . equals ( name ) && value . conta... |
public class AuthorizationProcessManager { /** * Handle success in the authorization process . All the response listeners will be updated with
* success
* @ param response final success response from the server */
private void handleAuthorizationSuccess ( Response response ) { } } | Iterator < ResponseListener > iterator = authorizationQueue . iterator ( ) ; while ( iterator . hasNext ( ) ) { ResponseListener next = iterator . next ( ) ; next . onSuccess ( response ) ; iterator . remove ( ) ; } |
public class FileInputFormat { /** * Registers a decompression algorithm through a { @ link org . apache . flink . api . common . io . compression . InflaterInputStreamFactory }
* with a file extension for transparent decompression .
* @ param fileExtension of the compressed files
* @ param factory to create an {... | synchronized ( INFLATER_INPUT_STREAM_FACTORIES ) { if ( INFLATER_INPUT_STREAM_FACTORIES . put ( fileExtension , factory ) != null ) { LOG . warn ( "Overwriting an existing decompression algorithm for \"{}\" files." , fileExtension ) ; } } |
public class FormatterMojo { /** * Return the options to be passed when creating { @ link CodeFormatter } instance .
* @ return the formatting options or null if not config file found
* @ throws MojoExecutionException
* the mojo execution exception */
private Map < String , String > getFormattingOptions ( String ... | if ( this . useEclipseDefaults ) { getLog ( ) . info ( "Using Ecipse Defaults" ) ; // Use defaults only for formatting
Map < String , String > options = new HashMap < > ( ) ; options . put ( JavaCore . COMPILER_SOURCE , this . compilerSource ) ; options . put ( JavaCore . COMPILER_COMPLIANCE , this . compilerCompliance... |
public class AbstractInjectorCreator { /** * inner class */
protected void writeStatics ( TreeLogger logger , GeneratorContext context , SourceWriter srcWriter ) { } } | for ( InjectorWritterStatic delegate : Iterables . filter ( this . delegates , InjectorWritterStatic . class ) ) { delegate . writeStatic ( srcWriter ) ; } |
public class CmsSecurityManager { /** * Gets the groups which constitute a given role . < p >
* @ param context the request context
* @ param role the role
* @ param directUsersOnly if true , only direct users of the role group will be returned
* @ return the role ' s groups
* @ throws CmsException if somethi... | CmsDbContext dbc = m_dbContextFactory . getDbContext ( context ) ; try { return m_driverManager . getRoleGroups ( dbc , role . getGroupName ( ) , directUsersOnly ) ; } catch ( Exception e ) { dbc . report ( null , Messages . get ( ) . container ( Messages . ERR_GET_ROLE_GROUPS_1 , role . toString ( ) ) , e ) ; return n... |
public class ActiveMQQueueJmxStats { /** * Return a duplicate of this queue stats structure .
* @ return new queue stats structure with the same values . */
public ActiveMQQueueJmxStats dup ( String brokerName ) { } } | ActiveMQQueueJmxStats result = new ActiveMQQueueJmxStats ( brokerName , this . queueName ) ; this . copyOut ( result ) ; return result ; |
public class UserCoreDao { /** * Query for values
* @ param sql
* sql statement
* @ param args
* arguments
* @ return results
* @ since 3.1.0 */
public List < List < Object > > queryResults ( String sql , String [ ] args ) { } } | return db . queryResults ( sql , args ) ; |
public class DefaultContentHandler { /** * recursively remove a directory , logging warnings if needed . */
private static void rmDir ( File dir ) { } } | for ( File file : dir . listFiles ( ) ) { if ( file . isDirectory ( ) ) { rmDir ( file ) ; } else { if ( ! file . delete ( ) ) { logger . warn ( "Can't delete file " + file ) ; } } } if ( ! dir . delete ( ) ) { logger . warn ( "Can't delete dir " + dir ) ; } |
public class HtmlReport { /** * Convert EARL result into HTML report .
* @ param outputDir
* Location of the test result .
* @ return
* Return the output file .
* @ throws FileNotFoundException
* Throws exception if file is not available . */
public static File earlHtmlReport ( String outputDir ) throws Fil... | ClassLoader cl = Thread . currentThread ( ) . getContextClassLoader ( ) ; String resourceDir = cl . getResource ( "com/occamlab/te/earl/lib" ) . getPath ( ) ; String earlXsl = cl . getResource ( "com/occamlab/te/earl_html_report.xsl" ) . toString ( ) ; File htmlOutput = new File ( outputDir , "result" ) ; htmlOutput . ... |
public class DefaultSemanticHighlightingCalculator { /** * Actual implementation of the semantic highlighting calculation . It is ensured , that the given resource is not
* < code > null < / code > and refers to an initialized parse result .
* By default this will visit the elements in the resource recursively and ... | searchAndHighlightElements ( resource , acceptor , cancelIndicator ) ; highlightTasks ( resource , acceptor ) ; |
public class Tr { /** * If debug level diagnostic trace is enabled for the specified
* < code > TraceComponent < / code > , log the provided trace point .
* @ param tc
* the non - null < code > TraceComponent < / code > the event is
* associated with .
* @ param msg
* text to include in the event . No trans... | TrConfigurator . getDelegate ( ) . debug ( tc , msg , objs ) ; |
public class AbstractQueryRunner { /** * Creates new { @ link PreparedStatement } instance
* @ param conn SQL Connection
* @ param sql SQL Query string
* @ param getGeneratedKeys specifies if generated keys should be returned
* @ return new { @ link PreparedStatement } instance
* @ throws SQLException if exce... | PreparedStatement result = null ; String [ ] overrideGeneratedKeysArr = null ; Integer resultSetType = null ; Integer resultSetConcurrency = null ; if ( outputHandler instanceof LazyScrollOutputHandler ) { if ( overrider . hasOverride ( MjdbcConstants . OVERRIDE_LAZY_SCROLL_CHANGE_SENSITIVE ) == true ) { // read value
... |
public class SmartBlurFilter { /** * Convolve with a kernel consisting of one row */
private void thresholdBlur ( Kernel kernel , int [ ] inPixels , int [ ] outPixels , int width , int height , boolean alpha ) { } } | int index = 0 ; float [ ] matrix = kernel . getKernelData ( null ) ; int cols = kernel . getWidth ( ) ; int cols2 = cols / 2 ; for ( int y = 0 ; y < height ; y ++ ) { int ioffset = y * width ; int outIndex = y ; for ( int x = 0 ; x < width ; x ++ ) { float r = 0 , g = 0 , b = 0 , a = 0 ; int moffset = cols2 ; int rgb1 ... |
public class GrapesClient { /** * Return the list of module ancestors
* @ param moduleName
* @ param moduleVersion
* @ return List < Dependency >
* @ throws GrapesCommunicationException */
public List < Dependency > getModuleAncestors ( final String moduleName , final String moduleVersion ) throws GrapesCommuni... | final Client client = getClient ( ) ; final WebResource resource = client . resource ( serverURL ) . path ( RequestUtils . getArtifactAncestors ( moduleName , moduleVersion ) ) ; final ClientResponse response = resource . queryParam ( ServerAPI . SCOPE_COMPILE_PARAM , "true" ) . queryParam ( ServerAPI . SCOPE_PROVIDED_... |
public class UnsortedGrouping { /** * Applies an Aggregate transformation on a grouped { @ link Tuple } { @ link DataSet } . < br / >
* < b > Note : Only Tuple DataSets can be aggregated . < / b >
* The transformation applies a built - in { @ link Aggregations Aggregation } on a specified field
* of a Tuple group... | return new AggregateOperator < T > ( this , agg , field ) ; |
public class JFapByteBuffer { /** * Puts a byte [ ] into the byte buffer .
* @ param item */
public synchronized void put ( byte [ ] item ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "put" , item ) ; checkValid ( ) ; getCurrentByteBuffer ( item . length ) . put ( item ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "put" ) ; |
public class AssetCache { /** * Get the asset based on version spec whose name and custom attributes match the parameters . */
public static Asset getAsset ( AssetVersionSpec spec , Map < String , String > attributeValues ) { } } | Asset match = null ; try { for ( Asset asset : getAllAssets ( ) ) { if ( spec . getName ( ) . equals ( asset . getName ( ) ) ) { if ( asset . meetsVersionSpec ( spec . getVersion ( ) ) && ( match == null || asset . getVersion ( ) > match . getVersion ( ) ) ) { boolean attrsMatch = true ; for ( String attrName : attribu... |
public class HttpRequest { /** * Reconstructs the URL the client used to make the request . The returned URL contains a
* protocol , server name , port number , and , but it does not include a path .
* Because this method returns a < code > StringBuffer < / code > , not a string , you can modify the
* URL easily ... | StringBuffer url = new StringBuffer ( 48 ) ; synchronized ( url ) { String scheme = getScheme ( ) ; int port = getPort ( ) ; url . append ( scheme ) ; url . append ( "://" ) ; if ( _hostPort != null ) url . append ( _hostPort ) ; else { url . append ( getHost ( ) ) ; if ( port > 0 && ( ( scheme . equalsIgnoreCase ( "ht... |
public class StringUtil { /** * Unescapes the specified escaped CSV fields according to
* < a href = " https : / / tools . ietf . org / html / rfc4180 # section - 2 " > RFC - 4180 < / a > .
* @ param value A string with multiple CSV escaped fields which will be unescaped according to
* < a href = " https : / / to... | List < CharSequence > unescaped = new ArrayList < CharSequence > ( 2 ) ; StringBuilder current = InternalThreadLocalMap . get ( ) . stringBuilder ( ) ; boolean quoted = false ; int last = value . length ( ) - 1 ; for ( int i = 0 ; i <= last ; i ++ ) { char c = value . charAt ( i ) ; if ( quoted ) { switch ( c ) { case ... |
public class SVGParser { /** * Parse an opacity value ( a float clamped to the range 0 . . 1 ) . */
private static Float parseOpacity ( String val ) { } } | try { float o = parseFloat ( val ) ; return ( o < 0f ) ? 0f : ( o > 1f ) ? 1f : o ; } catch ( SVGParseException e ) { return null ; } |
public class ParsedScheduleExpression { /** * Determines the first timeout of the schedule expression .
* @ return the first timeout in milliseconds , or - 1 if there are no timeouts
* for the expression */
public long getFirstTimeout ( ) { } } | long lastTimeout = Math . max ( System . currentTimeMillis ( ) , start ) ; // d666295
// If we ' re already past the end date , then there is no timeout .
if ( lastTimeout > end ) { return - 1 ; } return getTimeout ( lastTimeout , false ) ; |
public class Killed { /** * Instantiate discrete constraints for a collection of VMs .
* @ param vms the VMs to integrate
* @ return the associated list of constraints */
public static List < Killed > newKilled ( Collection < VM > vms ) { } } | return vms . stream ( ) . map ( Killed :: new ) . collect ( Collectors . toList ( ) ) ; |
public class ProviGenProvider { /** * Called when the database needs to be upgraded . < / br > < / br >
* Call { @ code super . onUpgradeDatabase ( database , oldVersion , newVersion ) } to :
* < ul >
* < li > Automatically add columns if some are missing . < / li >
* < li > Automatically create tables and need... | for ( ContractHolder contract : contracts ) { if ( ! openHelper . hasTableInDatabase ( database , contract ) ) { openHelper . createTable ( database , contract ) ; } else { openHelper . addMissingColumnsInTable ( database , contract ) ; } } |
public class ModelSerializer { /** * Load a computation graph from a InputStream
* @ param is the inputstream to get the computation graph from
* @ return the loaded computation graph
* @ throws IOException */
public static ComputationGraph restoreComputationGraph ( @ NonNull InputStream is , boolean loadUpdater ... | checkInputStream ( is ) ; File tmpFile = null ; try { tmpFile = tempFileFromStream ( is ) ; return restoreComputationGraph ( tmpFile , loadUpdater ) ; } finally { if ( tmpFile != null ) { tmpFile . delete ( ) ; } } |
public class ActivationMarshaller { /** * Marshall the given parameter object . */
public void marshall ( Activation activation , ProtocolMarshaller protocolMarshaller ) { } } | if ( activation == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( activation . getActivationId ( ) , ACTIVATIONID_BINDING ) ; protocolMarshaller . marshall ( activation . getDescription ( ) , DESCRIPTION_BINDING ) ; protocolMarshaller . mar... |
public class TimingMarshaller { /** * Marshall the given parameter object . */
public void marshall ( Timing timing , ProtocolMarshaller protocolMarshaller ) { } } | if ( timing == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( timing . getSubmitTimeMillis ( ) , SUBMITTIMEMILLIS_BINDING ) ; protocolMarshaller . marshall ( timing . getStartTimeMillis ( ) , STARTTIMEMILLIS_BINDING ) ; protocolMarshaller .... |
public class LDataObjectQueue { /** * Clears the frame and timestamp queue .
* The queue will be empty on return . */
public final synchronized void clear ( ) { } } | timestamps = new long [ max ? timestamps . length : STD_BUFSIZE ] ; value = new CEMILData [ timestamps . length ] ; next = 0 ; size = 0 ; |
public class ContextRadialMenu { /** * Shows the < code > ContextRadialMenu < / code > at specified coordinates .
* @ param target Target node . This will be sent as parameter to all triggered actions .
* @ param x X - coord
* @ param y Y - coord */
public void showAt ( Node target , double x , double y ) { } } | requireNonNull ( target , "Parameter 'target' is null" ) ; internalShow ( pointer , target , x , y ) ; pointer . setVisible ( true ) ; |
public class DefaultGenerator { /** * ( non - Javadoc )
* @ see org . kie . decisiontable . parser . Generator # generate ( java . lang . String ,
* org . kie . decisiontable . parser . Row ) */
public void generate ( String templateName , Row row ) { } } | try { CompiledTemplate template = getTemplate ( templateName ) ; VariableResolverFactory factory = new MapVariableResolverFactory ( ) ; Map < String , Object > vars = new HashMap < String , Object > ( ) ; initializePriorCommaConstraints ( vars ) ; initializeHasPriorJunctionConstraint ( vars ) ; vars . put ( "row" , row... |
public class PersistableImpl { /** * This method is used by the task layer to get hold of data from the
* cache layer before it is hardened to disk . It should therefore return
* the data from the Item and not that from the ManagedObject .
* @ return
* @ throws SevereMessageStoreException */
@ Override public j... | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getData" ) ; java . util . List < DataSlice > retval = null ; synchronized ( this ) { if ( _link != null ) { retval = _link . getMemberData ( ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabl... |
public class PageServiceImpl { /** * Non - peek get . */
@ Override public void getSafe ( RowCursor cursor , Result < Boolean > result ) { } } | result . ok ( getImpl ( cursor ) ) ; |
public class TernaryTreeNode { /** * Returns true if the specified node is effectively a child of this node , false otherwise .
* @ param potentialChild - the node to test
* @ return a boolean , true if the specified node is effectively a child of this node , false otherwise */
@ Pure public boolean hasChild ( N po... | if ( ( this . left == potentialChild ) || ( this . middle == potentialChild ) || ( this . right == potentialChild ) ) { return true ; } return false ; |
public class CmsMacroResolver { /** * Copies resources , adjust internal links ( if adjustLinks = = true ) and resolves macros ( if keyValue map is set ) . < p >
* @ param cms CmsObject
* @ param source path
* @ param destination path
* @ param keyValue map to be used for macro resolver
* @ param adjustLinks ... | copyAndResolveMacro ( cms , source , destination , keyValue , adjustLinks , CmsResource . COPY_AS_NEW ) ; |
public class InviteController { /** * Displays the participant invitation dialog .
* @ param sessionId The id of the chat session making the invitation request .
* @ param exclusions List of participants that should be excluded from user selection .
* @ param callback Reports the list of participants that were se... | Map < String , Object > args = new HashMap < > ( ) ; args . put ( "sessionId" , sessionId ) ; args . put ( "exclusions" , exclusions ) ; PopupDialog . show ( DIALOG , args , true , true , true , ( event ) -> { Collection < IPublisherInfo > invitees = ( Collection < IPublisherInfo > ) event . getTarget ( ) . getAttribut... |
public class ObjectManager { /** * Waits for one checkpoint to complete .
* @ throws ObjectManagerException */
public final void waitForCheckpoint ( ) throws ObjectManagerException { } } | if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , "waitForCheckpoint" ) ; if ( ! testInterfaces ) { if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , "waitForCheckpoint via InterfaceDisabledException" ) ; throw new ... |
public class BuildMetrics { /** * Get a description of this profiled build . It contains info about tasks passed to gradle as targets from the command line . */
public String getBuildDescription ( ) { } } | StringBuilder sb = new StringBuilder ( ) ; for ( String name : startParameter . getExcludedTaskNames ( ) ) { sb . append ( "-x " ) ; sb . append ( name ) ; sb . append ( " " ) ; } for ( String name : startParameter . getTaskNames ( ) ) { sb . append ( name ) ; sb . append ( " " ) ; } String tasks = sb . toString ( ) ; ... |
public class ListDataController { /** * Returns the index of the first occurrence of the specified value in this
* controller , or - 1 if this controller does not contain the value .
* @ param value
* @ return found index , or - 1 if value was not found
* @ throws NullPointerException
* if parameter value is ... | Validate . notNull ( value , "Value required" ) ; Validate . validState ( getSize ( ) > 0 , "No data" ) ; return getData ( ) . indexOf ( value ) ; |
public class ExpressionDecomposer { /** * Perform any rewriting necessary so that the specified expression is { @ code MOVABLE } .
* < p > This method is a primary entrypoint into this class . It performs a partial expression
* decomposition such that { @ code expression } can be moved to a preceding statement with... | Node expressionRoot = findExpressionRoot ( expression ) ; checkNotNull ( expressionRoot ) ; checkState ( NodeUtil . isStatement ( expressionRoot ) , expressionRoot ) ; exposeExpression ( expressionRoot , expression ) ; |
public class Player { /** * 待ちの種類による可符
* @ param comp
* @ param last
* @ return */
private int calcFuByWait ( MentsuComp comp , Tile last ) { } } | if ( comp . isKanchan ( last ) || comp . isPenchan ( last ) || comp . isTanki ( last ) ) { return 2 ; } return 0 ; |
public class AbstractExecutableMemberWriter { /** * Add the parameter for the executable member .
* @ param member the member to write parameter for .
* @ param param the parameter that needs to be written .
* @ param isVarArg true if this is a link to var arg .
* @ param tree the content tree to which the para... | Content link = writer . getLink ( new LinkInfoImpl ( configuration , EXECUTABLE_MEMBER_PARAM , param . asType ( ) ) . varargs ( isVarArg ) ) ; tree . addContent ( link ) ; if ( name ( param ) . length ( ) > 0 ) { tree . addContent ( Contents . SPACE ) ; tree . addContent ( name ( param ) ) ; } |
public class TypeParserBuilder { /** * Register a custom made { @ link Parser } implementation , associated with
* the given { @ code targetType } .
* @ param targetType associated with given { @ code parser } .
* @ param parser custom made { @ link Parser } implementation .
* @ return { @ link TypeParserBuilde... | if ( parser == null ) { throw new NullPointerException ( makeNullArgumentErrorMsg ( "parser" ) ) ; } if ( targetType == null ) { throw new NullPointerException ( makeNullArgumentErrorMsg ( "targetType" ) ) ; } if ( targetType . isArray ( ) ) { String message = "Cannot register Parser for array class. Register a Parser ... |
public class RestUriVariablesFactory { /** * Returns the uri variables needed for a " fastFind " request
* @ param query
* @ param params
* @ return all uriVariables needed for the api call */
public Map < String , String > getUriVariablesForFastFind ( String query , FastFindParams params ) { } } | Map < String , String > uriVariables = params . getParameterMap ( ) ; uriVariables . put ( BH_REST_TOKEN , bullhornApiRest . getBhRestToken ( ) ) ; uriVariables . put ( QUERY , query ) ; return uriVariables ; |
public class AbstractConnection { /** * Send a pre - encoded message to a named process on a remote node .
* @ param dest
* the name of the remote process .
* @ param payload
* the encoded message to send .
* @ exception java . io . IOException
* if the connection is not active or a communication error
* ... | if ( ! connected ) { throw new IOException ( "Not connected" ) ; } @ SuppressWarnings ( "resource" ) final OtpOutputStream header = new OtpOutputStream ( headerLen ) ; // preamble : 4 byte length + " passthrough " tag + version
header . write4BE ( 0 ) ; // reserve space for length
header . write1 ( passThrough ) ; head... |
public class Namespace { /** * Deserializes given byte array to Object using Kryo instance in pool .
* @ param bytes serialized bytes
* @ param < T > deserialized Object type
* @ return deserialized Object */
public < T > T deserialize ( final byte [ ] bytes ) { } } | return kryoInputPool . run ( input -> { input . setInputStream ( new ByteArrayInputStream ( bytes ) ) ; return kryoPool . run ( kryo -> { @ SuppressWarnings ( "unchecked" ) T obj = ( T ) kryo . readClassAndObject ( input ) ; return obj ; } ) ; } , DEFAULT_BUFFER_SIZE ) ; |
public class TrialMeter { /** * Return a new trial measure environment .
* @ param name the trial meter name
* @ param description the trial meter description , maybe { @ code null }
* @ param params the parameters which are tested by this trial meter
* @ param dataSetNames the names of the calculated data sets... | return new TrialMeter < T > ( name , description , Env . of ( ) , params , DataSet . of ( params . size ( ) , dataSetNames ) ) ; |
public class AbstractGitFlowMojo { /** * Executes git rebase or git merge - - ff - only or git merge - - no - ff or git merge .
* @ param branchName
* Branch name to merge .
* @ param rebase
* Do rebase .
* @ param noff
* Merge with - - no - ff .
* @ param ffonly
* Merge with - - ff - only .
* @ param... | String sign = "" ; if ( gpgSignCommit ) { sign = "-S" ; } String msgParam = "" ; String msg = "" ; if ( StringUtils . isNotBlank ( message ) ) { msgParam = "-m" ; msg = replaceProperties ( message , messageProperties ) ; } if ( rebase ) { getLog ( ) . info ( "Rebasing '" + branchName + "' branch." ) ; executeGitCommand... |
public class Slf4jLogger { /** * Log an info message . Calls SLF4J { @ link Logger # info ( String , Throwable ) } .
* @ param message The message to log .
* @ param throwable The exception to log . */
@ Override public void info ( String message , Throwable throwable ) { } } | if ( this . logger . isInfoEnabled ( ) ) { this . logger . info ( buildMessage ( message ) , throwable ) ; } |
public class AbstractCollection { /** * { @ inheritDoc }
* < p > This implementation iterates over this collection , removing each
* element using the < tt > Iterator . remove < / tt > operation . Most
* implementations will probably choose to override this method for
* efficiency .
* < p > Note that this imp... | Iterator < E > it = iterator ( ) ; while ( it . hasNext ( ) ) { it . next ( ) ; it . remove ( ) ; } |
public class WstxInputData { /** * Note : Only public due to sub - classes needing to call this on
* base class instance from different package ( confusing ? ) */
public void copyBufferStateFrom ( WstxInputData src ) { } } | mInputBuffer = src . mInputBuffer ; mInputPtr = src . mInputPtr ; mInputEnd = src . mInputEnd ; mCurrInputProcessed = src . mCurrInputProcessed ; mCurrInputRow = src . mCurrInputRow ; mCurrInputRowStart = src . mCurrInputRowStart ; |
public class Matrix { /** * Creates a new Matrix that stores the result of { @ code A + c }
* @ param c the scalar to add to each value in < i > this < / i >
* @ return { @ code A + c } */
public Matrix add ( double c ) { } } | Matrix toReturn = getThisSideMatrix ( null ) ; toReturn . mutableAdd ( c ) ; return toReturn ; |
public class Curve25519 { /** * Calculating signature
* @ param random random seed for signature
* @ param privateKey private key for signature
* @ param message message to sign
* @ return signature */
public static byte [ ] calculateSignature ( byte [ ] random , byte [ ] privateKey , byte [ ] message ) { } } | byte [ ] result = new byte [ 64 ] ; if ( curve_sigs . curve25519_sign ( SHA512Provider , result , privateKey , message , message . length , random ) != 0 ) { throw new IllegalArgumentException ( "Message exceeds max length!" ) ; } return result ; |
public class BaseStrategy { /** * Delegates to the resource . findMatchingResource , see { @ link RepositoryResourceImpl # findMatchingResource ( ) }
* @ throws RepositoryBackendException If there was a problem with tbe backend
* @ throws RepositoryBadDataException If while checking for matching assets we find one ... | return resource . findMatchingResource ( ) ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.