signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class FloatList { /** * Adds a new floating box to the list
* @ param box Floating block box to be added */
public void add ( BlockBox box ) { } } | box . setOwnerFloatList ( this ) ; floats . add ( box ) ; if ( box . getBounds ( ) . y + box . getBounds ( ) . height > getMaxY ( ) ) bottomBox = box ; if ( box . getBounds ( ) . y > getLastY ( ) ) lastBox = box ; |
public class PropertiesUtil { /** * Loads and closes the given property input stream . If an error occurs , log to the status logger .
* @ param in a property input stream .
* @ param source a source object describing the source , like a resource string or a URL .
* @ return a new Properties object */
static Prop... | final Properties props = new Properties ( ) ; if ( null != in ) { try { props . load ( in ) ; } catch ( final IOException e ) { LowLevelLogUtil . logException ( "Unable to read " + source , e ) ; } finally { try { in . close ( ) ; } catch ( final IOException e ) { LowLevelLogUtil . logException ( "Unable to close " + s... |
public class RangedCriteria { /** * { @ inheritDoc } */
@ Override public void usage ( final UsageBuilder str , final int indentLevel ) { } } | if ( min != null ) if ( max != null ) str . append ( "The value must be from " + min . toString ( ) + " to " + max . toString ( ) + " inclusive" ) ; else str . append ( "The value must be at least " + min . toString ( ) + "." ) ; else str . append ( "The value must be less than or equal to " + max . toString ( ) + "." ... |
public class ResourceExtension { /** * use the resource manager */
public static void useResource ( String host , int port , String user , String password , Authentication authType ) throws ResourceNotFoundException , ForbiddenUserException , FailedRequestException { } } | // create the client
DatabaseClient client = DatabaseClientFactory . newClient ( host , port , user , password , authType ) ; // create the resource extension client
DictionaryManager dictionaryMgr = new DictionaryManager ( client ) ; // specify the identifier for the dictionary
String uri = "/example/metasyn.xml" ; //... |
public class DelegatedClientFactory { /** * Configure wordpress client .
* @ param properties the properties */
protected void configureWordPressClient ( final Collection < BaseClient > properties ) { } } | val wp = pac4jProperties . getWordpress ( ) ; if ( StringUtils . isNotBlank ( wp . getId ( ) ) && StringUtils . isNotBlank ( wp . getSecret ( ) ) ) { val client = new WordPressClient ( wp . getId ( ) , wp . getSecret ( ) ) ; configureClient ( client , wp ) ; LOGGER . debug ( "Created client [{}] with identifier [{}]" ,... |
public class JSPtoPRealization { /** * Method localQueuePointRemoved
* @ param isDeleted
* @ param isSystem
* @ param isTemporary
* @ param messagingEngineUuid
* @ throws SIResourceException */
@ Override public void localQueuePointRemoved ( boolean isDeleted , boolean isSystem , boolean isTemporary , SIBUuid... | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "localQueuePointRemoved" , new Object [ ] { Boolean . valueOf ( isDeleted ) , Boolean . valueOf ( isSystem ) , Boolean . valueOf ( isTemporary ) , messagingEngineUuid , this } ) ; if ( _pToPLocalMsgsItemStream != null ) { //... |
public class RunContainer { /** * To recover rooms between begin ( exclusive ) and end ( inclusive ) */
private void recoverRoomsInRange ( int begin , int end ) { } } | if ( end + 1 < this . nbrruns ) { copyValuesLength ( this . valueslength , end + 1 , this . valueslength , begin + 1 , this . nbrruns - 1 - end ) ; } this . nbrruns -= end - begin ; |
public class ApiConnection { /** * Issues a Web API query to confirm that the previous login attempt was
* successful , and sets the internal state of the API connection accordingly
* in this case .
* @ deprecated because it will be migrated to { @ class PasswordApiConnection } .
* @ param token
* the login t... | Map < String , String > params = new HashMap < > ( ) ; params . put ( ApiConnection . PARAM_ACTION , "login" ) ; params . put ( ApiConnection . PARAM_LOGIN_USERNAME , username ) ; params . put ( ApiConnection . PARAM_LOGIN_PASSWORD , password ) ; params . put ( ApiConnection . PARAM_LOGIN_TOKEN , token ) ; JsonNode roo... |
public class DefaultEventStudio { /** * Removes the given listener listening on the given event , from the hidden station , hiding the station abstraction .
* @ return true if the listener was found and removed
* @ see EventStudio # remove ( Listener , String )
* @ see DefaultEventStudio # HIDDEN _ STATION */
pub... | return remove ( eventClass , listener , HIDDEN_STATION ) ; |
public class LiteralProcessor { /** * ~ Methoden - - - - - */
@ Override public int print ( ChronoDisplay formattable , Appendable buffer , AttributeQuery attributes , Set < ElementPosition > positions , // optional
boolean quickPath ) throws IOException { } } | if ( this . attribute != null ) { char literal = attributes . get ( this . attribute , null ) . charValue ( ) ; buffer . append ( literal ) ; return 1 ; } else if ( this . multi == null ) { buffer . append ( this . single ) ; return 1 ; } else { buffer . append ( this . multi ) ; return this . multi . length ( ) ; } |
public class Partitioner { /** * Get the global partition of the whole data set , which has the global low and high watermarks
* @ param previousWatermark previous watermark for computing the low watermark of current run
* @ return a Partition instance */
public Partition getGlobalPartition ( long previousWatermark... | ExtractType extractType = ExtractType . valueOf ( state . getProp ( ConfigurationKeys . SOURCE_QUERYBASED_EXTRACT_TYPE ) . toUpperCase ( ) ) ; WatermarkType watermarkType = WatermarkType . valueOf ( state . getProp ( ConfigurationKeys . SOURCE_QUERYBASED_WATERMARK_TYPE , ConfigurationKeys . DEFAULT_WATERMARK_TYPE ) . t... |
public class Annotations { /** * Process : @ Connector
* @ param annotationRepository The annotation repository
* @ param classLoader The class loader
* @ param xmlResourceAdapterClass resource adpater class name as define in xml
* @ param connectionDefinitions
* @ param configProperties
* @ param plainConf... | Connector connector = null ; Collection < Annotation > values = annotationRepository . getAnnotation ( javax . resource . spi . Connector . class ) ; if ( values != null ) { if ( values . size ( ) == 1 ) { Annotation annotation = values . iterator ( ) . next ( ) ; String raClass = annotation . getClassName ( ) ; javax ... |
public class ServerBuilder { /** * Sets the server ' s icon .
* @ param icon The icon of the server .
* @ param fileType The type of the icon , e . g . " png " or " jpg " .
* @ return The current instance in order to chain call methods . */
public ServerBuilder setIcon ( BufferedImage icon , String fileType ) { }... | delegate . setIcon ( icon , fileType ) ; return this ; |
public class AmazonEC2Client { /** * Deletes the specified network interface . You must detach the network interface before you can delete it .
* @ param deleteNetworkInterfaceRequest
* Contains the parameters for DeleteNetworkInterface .
* @ return Result of the DeleteNetworkInterface operation returned by the s... | request = beforeClientExecution ( request ) ; return executeDeleteNetworkInterface ( request ) ; |
public class WorkManagerImpl { /** * { @ inheritDoc } */
public void scheduleWork ( Work work ) throws WorkException { } } | scheduleWork ( work , WorkManager . INDEFINITE , null , null ) ; |
public class S { /** * The counter function of { @ link # isEqual ( String , String , int ) }
* @ param s1
* @ param s2
* @ param modifier
* @ return true if s1 not equals s2 */
public static boolean isNotEqual ( String s1 , String s2 , int modifier ) { } } | return ! isEqual ( s1 , s2 , modifier ) ; |
public class HalParser { /** * Returns the JsonNode of the embedded items by link - relation type and resolves possibly curied rels .
* @ param halRepresentation the HAL document including the ' curies ' links .
* @ param jsonNode the JsonNode of the document
* @ param rel the link - relation type of interest
*... | final JsonNode embedded = jsonNode . get ( "_embedded" ) ; if ( embedded != null ) { final Curies curies = halRepresentation . getCuries ( ) ; final JsonNode curiedNode = embedded . get ( curies . resolve ( rel ) ) ; if ( curiedNode == null ) { return Optional . ofNullable ( embedded . get ( curies . expand ( rel ) ) )... |
public class SpiderParam { /** * Sets the whether the spider parses the SVN entries file for URIs ( not related to following the directions ) .
* @ param parseSVNentries the new value for parseSVNentries */
public void setParseSVNEntries ( boolean parseSVNentries ) { } } | this . parseSVNentries = parseSVNentries ; getConfig ( ) . setProperty ( SPIDER_PARSE_SVN_ENTRIES , Boolean . toString ( parseSVNentries ) ) ; |
public class WeldContainer { /** * A convenient method for { @ link CDI . current ( ) } . Returns current { @ link WeldContainer } instance
* if there is exactly one instance running . Throws { @ link IllegalStateException } in any other case .
* @ return Current { @ link WeldContainer } instance if and only if exa... | List < String > ids = WeldContainer . getRunningContainerIds ( ) ; if ( ids . size ( ) == 1 ) { return WeldContainer . instance ( ids . get ( 0 ) ) ; } else { // if there is either no container or multiple containers we want to throw exception
// in this case Weld cannot determine which container is " current "
throw W... |
public class Encoding { /** * Writes the HTML equivalent of the given plain text to output .
* For example , { @ code escapeHtmlOnto ( " 1 < 2 " , w ) } ,
* is equivalent to { @ code w . append ( " 1 & lt ; 2 " ) } but possibly with fewer
* smaller appends .
* Elides code - units that are not valid XML Characte... | int n = plainText . length ( ) ; int pos = 0 ; for ( int i = 0 ; i < n ; ++ i ) { char ch = plainText . charAt ( i ) ; if ( ch < REPLACEMENTS . length ) { // Handles all ASCII .
String repl = REPLACEMENTS [ ch ] ; if ( ch == '{' && repl == null ) { if ( i + 1 == n || plainText . charAt ( i + 1 ) == '{' ) { repl = brace... |
public class Scope { /** * 移除全局变量
* 全局作用域是指本次请求的整个 template */
public void removeGlobal ( Object key ) { } } | for ( Scope cur = this ; true ; cur = cur . parent ) { if ( cur . parent == null ) { cur . data . remove ( key ) ; return ; } } |
public class SecondaryIndex { /** * This is the primary way to create a secondary index instance for a CF column .
* It will validate the index _ options before initializing .
* @ param baseCfs the source of data for the Index
* @ param cdef the meta information about this column ( index _ type , index _ options ... | SecondaryIndex index ; switch ( cdef . getIndexType ( ) ) { case KEYS : index = new KeysIndex ( ) ; break ; case COMPOSITES : index = CompositesIndex . create ( cdef ) ; break ; case CUSTOM : assert cdef . getIndexOptions ( ) != null ; String class_name = cdef . getIndexOptions ( ) . get ( CUSTOM_INDEX_OPTION_NAME ) ; ... |
public class CmsDomUtil { /** * Returns the element position relative to its siblings . < p >
* @ param e the element to get the position for
* @ return the position , or < code > - 1 < / code > if not found */
public static int getPosition ( Element e ) { } } | NodeList < Node > childNodes = e . getParentElement ( ) . getChildNodes ( ) ; for ( int i = childNodes . getLength ( ) ; i >= 0 ; i -- ) { if ( childNodes . getItem ( i ) == e ) { return i ; } } return - 1 ; |
public class CanonicalStore { /** * clean up stale entries */
void cleanUpStaleEntries ( ) { } } | for ( KeyedRef < K , V > ref = q . poll ( ) ; ref != null ; ref = q . poll ( ) ) { map . remove ( ref . getKey ( ) , ref ) ; // CONCURRENT remove ( ) operation
} |
public class BeanBuilder { /** * Checks whether there are any runtime refs inside the list and
* converts it to a ManagedList if necessary
* @ param value The object that represents the list
* @ return Either a new list or a managed one */
private Object manageListIfNecessary ( List < Object > value ) { } } | boolean containsRuntimeRefs = false ; for ( ListIterator < Object > i = value . listIterator ( ) ; i . hasNext ( ) ; ) { Object e = i . next ( ) ; if ( e instanceof RuntimeBeanReference ) { containsRuntimeRefs = true ; } if ( e instanceof BeanConfiguration ) { BeanConfiguration c = ( BeanConfiguration ) e ; i . set ( c... |
public class UnitJudge { /** * check whether the specified unit is available .
* tips : don ' t use exception catching to get the result , cause this is bad performance . */
public static boolean available ( String groupName , String unitName ) { } } | return LocalUnitsManager . getLocalUnit ( groupName , unitName ) != null || UnitDiscovery . singleton != null && UnitDiscovery . singleton . firstInstance ( Unit . fullName ( groupName , unitName ) ) != null ; |
public class CrosstabBuilder { /** * { @ linkplain CrosstabBuilder # addColumn ( DJCrosstabColumn ) }
* @ param title
* @ param property
* @ param className
* @ param showTotal
* @ return */
public CrosstabBuilder addColumn ( String title , String property , String className , boolean showTotal ) { } } | DJCrosstabColumn col = new CrosstabColumnBuilder ( ) . setProperty ( property , className ) . setShowTotals ( showTotal ) . setTitle ( title ) . build ( ) ; addColumn ( col ) ; return this ; |
public class UIContextImpl { /** * Reserved for internal framework use . Retrieves a framework attribute .
* @ param name the attribute name .
* @ return the framework attribute with the given name . */
@ Override public Object getFwkAttribute ( final String name ) { } } | if ( attribMap == null ) { return null ; } return attribMap . get ( name ) ; |
public class Selection { /** * Gets the main type .
* @ param _ baseTypes the base types
* @ return the main type
* @ throws EFapsException on error */
private Type evalMainType ( final Collection < Type > _baseTypes ) throws EFapsException { } } | final Type ret ; if ( _baseTypes . size ( ) == 1 ) { ret = _baseTypes . iterator ( ) . next ( ) ; } else { final List < List < Type > > typeLists = new ArrayList < > ( ) ; for ( final Type type : _baseTypes ) { final List < Type > typesTmp = new ArrayList < > ( ) ; typeLists . add ( typesTmp ) ; Type tmpType = type ; w... |
public class HashMapHierarchy { /** * Remove a record .
* @ param obj Key */
private void removeRec ( O obj ) { } } | graph . remove ( obj ) ; for ( int i = 0 ; i < numelems ; ++ i ) { if ( obj == elems [ i ] ) { System . arraycopy ( elems , i + 1 , elems , i , -- numelems - i ) ; elems [ numelems ] = null ; return ; } } |
public class FileServlet { /** * Returns the content type for the specified path .
* @ param path the path to look up .
* @ return the content type for the path .
* @ throws FileNotFoundException if a file ( or welcome file ) does not exist at path .
* @ throws IOException if any other problem prevents the look... | File file = findFile ( path ) ; return lookupMimeType ( file . getName ( ) ) ; |
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link Object } { @ code > }
* @ param value
* Java instance representing xml element ' s value .
* @ return
* the new instance of { @ link JAXBElement } { @ code < } { @ link Object } { @ code > } */
@ XmlElementDecl... | return new JAXBElement < Object > ( __GenericApplicationPropertyOfTrack_QNAME , Object . class , null , value ) ; |
public class JarWithFile { /** * Opens a stream to an entry in the jar .
* @ param path relative path into the jar . */
public ZipStreamImpl openReadImpl ( PathImpl path ) throws IOException { } } | String pathName = path . getPath ( ) ; return openReadImpl ( pathName ) ; |
public class WWindowInterceptor { /** * Temporarily replaces the environment while the UI prepares to render .
* @ param request the request being responded to . */
@ Override public void preparePaint ( final Request request ) { } } | if ( windowId == null ) { super . preparePaint ( request ) ; } else { // Get the window component
ComponentWithContext target = WebUtilities . getComponentById ( windowId , true ) ; if ( target == null ) { throw new SystemException ( "No window component for id " + windowId ) ; } UIContext uic = UIContextHolder . getCu... |
public class Points { /** * Returns the Euclidian distance between the specified two points , truncated to the nearest
* integer . */
public static int distance ( int x1 , int y1 , int x2 , int y2 ) { } } | return ( int ) Math . sqrt ( distanceSq ( x1 , y1 , x2 , y2 ) ) ; |
public class CMARichText { /** * Update the value of this text .
* @ param value the new value of the text .
* @ return this instance for chaining . */
@ NonNull public CMARichText setValue ( @ NonNull CharSequence value ) { } } | if ( value == null ) { throw new NullPointerException ( "value is null." ) ; } this . value = value ; return this ; |
public class RecordFile { /** * Positions the current record as indicated by the specified record ID .
* @ param rid
* a record ID */
public void moveToRecordId ( RecordId rid ) { } } | moveTo ( rid . block ( ) . number ( ) ) ; rp . moveToId ( rid . id ( ) ) ; |
public class ToStream { /** * Tell if this character can be written without escaping . */
protected boolean escapingNotNeeded ( char ch ) { } } | final boolean ret ; if ( ch < 127 ) { // This is the old / fast code here , but is this
// correct for all encodings ?
if ( ch >= CharInfo . S_SPACE || ( CharInfo . S_LINEFEED == ch || CharInfo . S_CARRIAGERETURN == ch || CharInfo . S_HORIZONAL_TAB == ch ) ) ret = true ; else ret = false ; } else { ret = m_encodingInfo... |
public class XCalDocument { /** * Writes the xCal document to a file .
* @ param file the file to write to ( UTF - 8 encoding will be used )
* @ param outputProperties properties to assign to the JAXP transformer ( see
* { @ link Transformer # setOutputProperty } )
* @ throws IOException if there ' s a problem ... | Writer writer = new Utf8Writer ( file ) ; try { write ( writer , outputProperties ) ; } finally { writer . close ( ) ; } |
public class BELStatementConverter { /** * { @ inheritDoc } */
@ Override public Statement convert ( BELStatement bs ) { } } | if ( bs == null ) { return null ; } String comment = bs . getComment ( ) ; String belSyntax = bs . getStatementSyntax ( ) ; Statement s = BELParser . parseStatement ( belSyntax ) ; repopulateNamespaces ( s ) ; s . setComment ( comment ) ; final BELAnnotationConverter bac = new BELAnnotationConverter ( adefs ) ; List < ... |
public class SS { /** * Returns a < a href =
* " http : / / docs . aws . amazon . com / amazondynamodb / latest / developerguide / Expressions . SpecifyingConditions . html # ConditionExpressionReference . Comparators "
* > comparator condition < / a > ( that evaluates to true if the value of the
* current attrib... | return new ComparatorCondition ( "=" , this , new LiteralOperand ( new LinkedHashSet < String > ( Arrays . asList ( values ) ) ) ) ; |
public class RuntimeSchema { /** * Returns the schema wrapper . */
static < T > HasSchema < T > getSchemaWrapper ( Class < T > typeClass , IdStrategy strategy ) { } } | return strategy . getSchemaWrapper ( typeClass , true ) ; |
public class Bean { /** * Creates data proxy of specified class for specified session .
* @ param interfaceClass Class of the proxy interface .
* @ param session Session instance for the proxy .
* @ param < T > Type of the proxy interface .
* @ throws Exception */
protected < T > T createProxy ( Class < T > int... | return configBean . getConfig ( ) . getStoredProcedureProxyFactory ( ) . getProxy ( interfaceClass , session ) ; |
public class Network { /** * Convert megabits into a more ' human readable ' format ( from ' long ' to ' String ' )
* @ param megabits the amount in megabit ( mb )
* @ return a String containing a pretty formatted output */
private static String bitsToString ( long megabits ) { } } | int unit = 1000 ; if ( megabits < unit ) { return megabits + " mb" ; } int exp = ( int ) ( Math . log ( megabits ) / Math . log ( unit ) ) ; return new DecimalFormat ( "#.##" ) . format ( megabits / Math . pow ( unit , exp ) ) + "GTPE" . charAt ( exp - 1 ) + "b" ; |
public class ObjectInputStream { /** * Returns the previously - read object corresponding to the given serialization handle .
* @ throws InvalidObjectException
* If there is no previously - read object with this handle */
private Object registeredObjectRead ( int handle ) throws InvalidObjectException { } } | Object res = objectsRead . get ( handle - ObjectStreamConstants . baseWireHandle ) ; if ( res == UNSHARED_OBJ ) { throw new InvalidObjectException ( "Cannot read back reference to unshared object" ) ; } return res ; |
public class KernelPoints { /** * Returns a list of the raw vectors being used by the kernel points .
* Altering this vectors will alter the same vectors used by these objects
* and will cause inconsistent results .
* @ return the list of raw basis vectors used by the Kernel points */
public List < Vec > getRawBa... | List < Vec > vecs = new ArrayList < Vec > ( getBasisSize ( ) ) ; vecs . addAll ( this . points . get ( 0 ) . vecs ) ; return vecs ; |
public class FileSystemScanner { /** * / * - - - Private methods - - - */
private String [ ] createResolversIncludesPattern ( Collection < AbstractDependencyResolver > dependencyResolvers ) { } } | Collection < String > resultIncludes = new ArrayList < > ( ) ; // TODO - check if can be done with lambda
for ( AbstractDependencyResolver dependencyResolver : dependencyResolvers ) { for ( String manifestFile : dependencyResolver . getManifestFiles ( ) ) { if ( ! manifestFile . isEmpty ( ) ) { resultIncludes . add ( C... |
public class ScanRequest { /** * One or more substitution tokens for attribute names in an expression . The following are some use cases for using
* < code > ExpressionAttributeNames < / code > :
* < ul >
* < li >
* To access an attribute whose name conflicts with a DynamoDB reserved word .
* < / li >
* < l... | setExpressionAttributeNames ( expressionAttributeNames ) ; return this ; |
public class RecurlyClient { /** * Enter an offline payment for a manual invoice ( beta ) - Recurly Enterprise Feature
* @ param invoiceId String Recurly Invoice ID
* @ param payment The external payment */
public Transaction enterOfflinePayment ( final String invoiceId , final Transaction payment ) { } } | return doPOST ( Invoices . INVOICES_RESOURCE + "/" + invoiceId + "/transactions" , payment , Transaction . class ) ; |
public class servicegroup { /** * Use this API to fetch filtered set of servicegroup resources .
* filter string should be in JSON format . eg : " port : 80 , servicetype : HTTP " . */
public static servicegroup [ ] get_filtered ( nitro_service service , String filter ) throws Exception { } } | servicegroup obj = new servicegroup ( ) ; options option = new options ( ) ; option . set_filter ( filter ) ; servicegroup [ ] response = ( servicegroup [ ] ) obj . getfiltered ( service , option ) ; return response ; |
public class CmsVfsBundleManager { /** * Logs an exception that occurred . < p >
* @ param e the exception to log
* @ param logToErrorChannel if true erros should be written to the error channel instead of the info channel */
protected void logError ( Exception e , boolean logToErrorChannel ) { } } | if ( logToErrorChannel ) { LOG . error ( e . getLocalizedMessage ( ) , e ) ; } else { LOG . info ( e . getLocalizedMessage ( ) , e ) ; } // if an error was logged make sure that the flag to schedule a reload is reset
setReloadScheduled ( false ) ; |
public class OptionsUtil { /** * Checks if the specified Options object needs the javascript file
* " exporting . js " to work properly . This method can be called by GUI
* components to determine whether the javascript file has to be included in
* the page or not .
* @ param options the { @ link Options } obje... | // when no ExportingOptions are set , they are enabled by default , hence
// return true when they are null
return options . getExporting ( ) == null || ( options . getExporting ( ) . getEnabled ( ) != null && options . getExporting ( ) . getEnabled ( ) ) ; |
public class SkipBadRecords { /** * Get the directory to which skipped records are written . By default it is
* the sub directory of the output _ logs directory .
* User can stop writing skipped records by setting the value null .
* @ param conf the configuration .
* @ return path skip output directory . Null i... | String name = conf . get ( OUT_PATH ) ; if ( name != null ) { if ( "none" . equals ( name ) ) { return null ; } return new Path ( name ) ; } Path outPath = FileOutputFormat . getOutputPath ( new JobConf ( conf ) ) ; return outPath == null ? null : new Path ( outPath , "_logs" + Path . SEPARATOR + "skip" ) ; |
public class NativeHammerEvent { /** * Get relative x position on the page .
* @ return x position in pixels */
public final int getRelativeX ( ) { } } | NativeEvent e = getNativeEvent ( ) ; Element target = getTarget ( ) ; return e . getClientX ( ) - target . getAbsoluteLeft ( ) + target . getScrollLeft ( ) + target . getOwnerDocument ( ) . getScrollLeft ( ) ; |
public class SSLEngineFactory { /** * Creates a client mode { @ link SSLEngine } for the specified SSL options .
* @ param sslOptions
* an object encapsulating the SSL options to use when creating the
* SSLEngine .
* @ param host
* the host that the SSL engine will be used to connect to .
* @ param port
*... | final String methodName = "createClientSSLEngine" ; logger . entry ( this , methodName , sslOptions , host , port ) ; KeyManagerFactory keyManagerFactory = null ; TrustManagerFactory trustManagerFactory = null ; // Setup the key and trust manager factories from the supplied options
final File keyStoreFile = sslOptions ... |
public class AbstractJRebirthPreloader { /** * { @ inheritDoc } */
@ Override public void start ( final Stage stage ) throws Exception { } } | // Store the preloader stage to reuse it later
this . preloaderStage = stage ; // Configure the stage
stage . centerOnScreen ( ) ; stage . initStyle ( StageStyle . TRANSPARENT ) ; stage . setScene ( createPreloaderScene ( ) ) ; // Let ' s start the show
stage . show ( ) ; |
public class GeoJsonToAssembler { /** * Converts a multipolygon to its corresponding Transfer Object
* @ param input the multipolygon
* @ return the transfer object for the geometrycollection */
public GeometryCollectionTo toTransferObject ( GeometryCollection input ) { } } | GeometryCollectionTo result = new GeometryCollectionTo ( ) ; GeoJsonTo [ ] tos = new GeoJsonTo [ input . getNumGeometries ( ) ] ; for ( int i = 0 ; i < input . getNumGeometries ( ) ; i ++ ) { tos [ i ] = toTransferObject ( input . getGeometryN ( i ) ) ; tos [ i ] . setCrs ( null ) ; // Crs may not be repeated
} result ... |
public class SelectSubPlanAssembler { /** * Generate all possible access paths for an inner node in a join .
* The set of potential index expressions depends whether the inner node can be inlined
* with the NLIJ or not . In the former case , inner and inner - outer join expressions can
* be considered for the ind... | JoinNode innerChildNode = parentNode . getRightNode ( ) ; assert ( innerChildNode != null ) ; // In case of inner join WHERE and JOIN expressions can be merged
if ( parentNode . getJoinType ( ) == JoinType . INNER ) { parentNode . m_joinInnerOuterList . addAll ( parentNode . m_whereInnerOuterList ) ; parentNode . m_whe... |
public class DListImpl { /** * Determines whether there is an element of the collection that evaluates to true
* for the predicate .
* @ parampredicateAn OQL boolean query predicate .
* @ returnTrue if there is an element of the collection that evaluates to true
* for the predicate , otherwise false .
* @ exc... | DList results = ( DList ) this . query ( predicate ) ; if ( results == null || results . size ( ) == 0 ) return false ; else return true ; |
public class USING { /** * < div color = ' red ' style = " font - size : 24px ; color : red " > < b > < i > < u > JCYPHER < / u > < / i > < / b > < / div >
* < div color = ' red ' style = " font - size : 18px ; color : red " > < i > set the label to be used in the label scan < / i > < / div >
* < div color = ' red ... | UsingScan ret = UFactory . onLabel ( labelName ) ; ASTNode an = APIObjectAccess . getAstNode ( ret ) ; an . setClauseType ( ClauseType . USING_SCAN ) ; return ret ; |
public class PutFromLoadValidator { /** * This methods should be called only from tests ; it removes existing validator from the cache structures
* in order to replace it with new one .
* @ param cache */
public static PutFromLoadValidator removeFromCache ( AdvancedCache cache ) { } } | AsyncInterceptorChain chain = cache . getAsyncInterceptorChain ( ) ; BasicComponentRegistry cr = cache . getComponentRegistry ( ) . getComponent ( BasicComponentRegistry . class ) ; chain . removeInterceptor ( TxPutFromLoadInterceptor . class ) ; chain . removeInterceptor ( NonTxPutFromLoadInterceptor . class ) ; chain... |
public class ZookeeperBasedJobLock { /** * Release the lock .
* @ throws IOException */
@ Override public void unlock ( ) throws JobLockException { } } | if ( this . lock . isAcquiredInThisProcess ( ) ) { try { this . lock . release ( ) ; } catch ( Exception e ) { throw new JobLockException ( "Failed to release lock " + this . lockPath , e ) ; } } |
public class TypeHandlerUtils { /** * Transfers data from byte [ ] into sql . Clob
* @ param clob sql . Clob which would be filled
* @ param value array of bytes
* @ return sql . Clob from array of bytes
* @ throws SQLException */
public static Object convertClob ( Object clob , byte [ ] value ) throws SQLExcep... | ByteArrayInputStream input = new ByteArrayInputStream ( value ) ; // OutputStream output = clob . setAsciiStream ( 1 ) ;
OutputStream output = null ; try { output = ( OutputStream ) MappingUtils . invokeFunction ( clob , "setAsciiStream" , new Class [ ] { long . class } , new Object [ ] { 1 } ) ; } catch ( MjdbcExcepti... |
public class PackageManagerUtils { /** * Checks if the device has a low latency audio feature .
* @ param context the context .
* @ return { @ code true } if the device has a low latency audio feature . */
@ TargetApi ( Build . VERSION_CODES . GINGERBREAD ) public static boolean hasLowLatencyAudioFeature ( Context ... | return hasLowLatencyAudioFeature ( context . getPackageManager ( ) ) ; |
public class MetricsCacheManagerHttpServer { /** * manual test for local mode topology , for debug
* How to run :
* in the [ source root directory ] , run bazel test ,
* bazel run heron / metricscachemgr / src / java : metricscache - queryclient - unshaded - - \
* & lt ; host : port & gt ; & lt ; component _ na... | if ( args . length < 3 ) { System . out . println ( "Usage: java MetricsQuery <host:port> <component_name> <metrics_name>" ) ; } // construct metric cache stat url
String url = "http://" + args [ 0 ] + MetricsCacheManagerHttpServer . PATH_STATS ; System . out . println ( "endpoint: " + url + "; component: " + args [ 1 ... |
public class Randoms { /** * Pick a random element from the specified iterable , or return
* < code > ifEmpty < / code > if no element has a weight greater than < code > 0 < / code > .
* < p > < b > Implementation note : < / b > a random number is generated for every entry with a
* non - zero weight after the fir... | return pick ( values . iterator ( ) , ifEmpty , weigher ) ; |
public class TechnologyTargeting { /** * Sets the browserTargeting value for this TechnologyTargeting .
* @ param browserTargeting * The browsers being targeted by the { @ link LineItem } . */
public void setBrowserTargeting ( com . google . api . ads . admanager . axis . v201811 . BrowserTargeting browserTargeting )... | this . browserTargeting = browserTargeting ; |
public class CMutex { /** * Releases an array of mutex previously acquired
* @ param mutex
* the mutex array to release */
public static final void releaseMultiple ( CMutex mutex [ ] ) { } } | Arrays . sort ( mutex , new CMutexComparator ( ) ) ; for ( int i = mutex . length - 1 ; i >= 0 ; i -- ) { mutex [ i ] . release ( ) ; } |
public class VirtualWANsInner { /** * Retrieves the details of a VirtualWAN .
* @ param resourceGroupName The resource group name of the VirtualWan .
* @ param virtualWANName The name of the VirtualWAN being retrieved .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ throws Erro... | return getByResourceGroupWithServiceResponseAsync ( resourceGroupName , virtualWANName ) . toBlocking ( ) . single ( ) . body ( ) ; |
public class AWSACMPCAClient { /** * Revokes a certificate that you issued by calling the < a > IssueCertificate < / a > operation . If you enable a
* certificate revocation list ( CRL ) when you create or update your private CA , information about the revoked
* certificates will be included in the CRL . ACM PCA wr... | request = beforeClientExecution ( request ) ; return executeRevokeCertificate ( request ) ; |
public class TupleGenerator { /** * Returns a set of 1 - tuples containing the bindings for the given variable that are applicable to the given test case . */
private Iterator < Tuple > getBindingsFor ( VarTupleSet tuples , VarDef var ) { } } | return IteratorUtils . chainedIterator ( tuples . getUnused ( var ) , IteratorUtils . chainedIterator ( tuples . getUsed ( var ) , tuples . getUsedOnce ( var ) ) ) ; |
public class SocketListener { /** * { @ inheritDoc } */
@ Override public boolean listenToException ( final AbstractPerfidixMethodException exec ) { } } | try { return view . updateErrorInElement ( ( exec . getMethod ( ) . getDeclaringClass ( ) . getName ( ) + "." + exec . getMethod ( ) . getName ( ) ) , exec ) ; } catch ( final SocketViewException e ) { throw new IllegalStateException ( e ) ; } |
public class GoogleCloudStorageImpl { /** * Performs copy operation using GCS Copy requests
* @ see GoogleCloudStorage # copy ( String , List , String , List ) */
private void copyInternal ( BatchHelper batchHelper , final KeySetView < IOException , Boolean > innerExceptions , final String srcBucketName , final Strin... | Storage . Objects . Copy copyObject = configureRequest ( gcs . objects ( ) . copy ( srcBucketName , srcObjectName , dstBucketName , dstObjectName , null ) , srcBucketName ) ; batchHelper . queue ( copyObject , new JsonBatchCallback < StorageObject > ( ) { @ Override public void onSuccess ( StorageObject copyResponse , ... |
public class BoxTrash { /** * Restores a trashed folder to a new location with a new name .
* @ param folderID the ID of the trashed folder .
* @ param newName an optional new name to give the folder . This can be null to use the folder ' s original name .
* @ param newParentID an optional new parent ID for the f... | JsonObject requestJSON = new JsonObject ( ) ; if ( newName != null ) { requestJSON . add ( "name" , newName ) ; } if ( newParentID != null ) { JsonObject parent = new JsonObject ( ) ; parent . add ( "id" , newParentID ) ; requestJSON . add ( "parent" , parent ) ; } URL url = RESTORE_FOLDER_URL_TEMPLATE . build ( this .... |
public class PatternMatchingSupport { /** * Matches DOS - type wildcardexpressions rather than regular expressions .
* The function adds one little but handy feature of regular expressions :
* The ' | ' - character is regarded as a boolean OR that separates multiple expressions .
* @ param val string value that m... | // replace [ \ ^ $ . | ? * + ( ) to make regexp do wildcard match
String expCopy = StringSupport . replaceAll ( exp , new String [ ] { "[" , "\\" , "^" , "$" , "." , "?" , "*" , "+" , "(" , ")" } , new String [ ] { "\\[" , "\\\\" , "\\^" , "\\$" , "\\." , ".?" , ".*" , "\\+" , "\\(" , "\\)" } ) ; return ( valueMatchesR... |
public class Image { /** * Returns for given parameter < i > _ id < / i > the instance of class
* { @ link Image } .
* @ param _ id id to search in the cache
* @ return instance of class { @ link Image }
* @ throws CacheReloadException on error
* @ see # getCache */
public static Image get ( final long _id ) ... | return AbstractUserInterfaceObject . < Image > get ( _id , Image . class , CIAdminUserInterface . Image . getType ( ) ) ; |
public class SecretsManager { /** * Ensure that the given secret has an AWSCURRENT value . This requires the permission
* < code > secretsmanager : GetSecretValue < / code >
* @ param secretId
* the ARN of the secret .
* @ throws ResourceNotFoundException if the secret doesn ' t exist or it has no AWSCURRENT st... | final GetSecretValueRequest getSecretValueRequest = new GetSecretValueRequest ( ) ; getSecretValueRequest . setSecretId ( secretId ) ; getSecretValueRequest . setVersionStage ( CURRENT . getAwsName ( ) ) ; getDelegate ( ) . getSecretValue ( getSecretValueRequest ) ; |
public class UaaAuthorizationEndpoint { /** * We need explicit approval from the user . */
private ModelAndView getUserApprovalPageResponse ( Map < String , Object > model , AuthorizationRequest authorizationRequest , Authentication principal ) { } } | logger . debug ( "Loading user approval page: " + userApprovalPage ) ; model . putAll ( userApprovalHandler . getUserApprovalRequest ( authorizationRequest , principal ) ) ; return new ModelAndView ( userApprovalPage , model ) ; |
public class JSONObject { /** * get string value .
* @ param key key .
* @ return value or default value . */
public String getString ( String key ) { } } | Object tmp = objectMap . get ( key ) ; return tmp == null ? null : tmp . toString ( ) ; |
public class ComputationGraph { /** * Get the parameters for the ComputationGraph
* @ param backwardOnly If true : backprop parameters only ( i . e . , no visible layer biases used in layerwise pretraining layers ) */
public INDArray params ( boolean backwardOnly ) { } } | if ( backwardOnly ) return flattenedParams ; List < INDArray > list = new ArrayList < > ( layers . length ) ; for ( int i = 0 ; i < topologicalOrder . length ; i ++ ) { if ( ! vertices [ topologicalOrder [ i ] ] . hasLayer ( ) ) continue ; Layer l = vertices [ topologicalOrder [ i ] ] . getLayer ( ) ; INDArray layerPar... |
public class CmsContentService { /** * Synchronizes the locale independent fields . < p >
* @ param file the content file
* @ param content the XML content
* @ param skipPaths the paths to skip during locale synchronization
* @ param entities the edited entities
* @ param lastEdited the last edited locale
*... | CmsEntity lastEditedEntity = null ; for ( CmsEntity entity : entities ) { if ( lastEdited . equals ( CmsLocaleManager . getLocale ( CmsContentDefinition . getLocaleFromId ( entity . getId ( ) ) ) ) ) { lastEditedEntity = entity ; } else { synchronizeLocaleIndependentForEntity ( file , content , skipPaths , entity ) ; }... |
public class EnvironmentImpl { /** * Tries to load meta tree located at specified rootAddress .
* @ param rootAddress tree root address .
* @ return tree instance or null if the address is not valid . */
@ Nullable BTree loadMetaTree ( final long rootAddress , final LogTip logTip ) { } } | if ( rootAddress < 0 || rootAddress >= logTip . highAddress ) return null ; return new BTree ( log , getBTreeBalancePolicy ( ) , rootAddress , false , META_TREE_ID ) { @ NotNull @ Override public DataIterator getDataIterator ( long address ) { return new DataIterator ( log , address ) ; } } ; |
public class DescribeAlgorithmRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( DescribeAlgorithmRequest describeAlgorithmRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( describeAlgorithmRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( describeAlgorithmRequest . getAlgorithmName ( ) , ALGORITHMNAME_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request... |
public class MethodTypeSignature { /** * / * ( non - Javadoc )
* @ see io . github . classgraph . ScanResultObject # setScanResult ( io . github . classgraph . ScanResult ) */
@ Override void setScanResult ( final ScanResult scanResult ) { } } | super . setScanResult ( scanResult ) ; if ( typeParameters != null ) { for ( final TypeParameter typeParameter : typeParameters ) { typeParameter . setScanResult ( scanResult ) ; } } if ( this . parameterTypeSignatures != null ) { for ( final TypeSignature typeParameter : parameterTypeSignatures ) { typeParameter . set... |
public class CoinbaseAccountServiceRaw { /** * Authenticated resource that lets you ( as a merchant ) list all the subscriptions customers have
* made with you . This call returns { @ code CoinbaseSubscription } objects where you are the
* merchant .
* @ param page Optional parameter to request a desired page of ... | final CoinbaseSubscriptions subscriptions = coinbase . getsSubscriptions ( page , limit , exchange . getExchangeSpecification ( ) . getApiKey ( ) , signatureCreator , exchange . getNonceFactory ( ) ) ; return subscriptions ; |
public class BaseLexicon { /** * Normalize string .
* @ param sequence the sequence
* @ return the string */
protected String normalize ( CharSequence sequence ) { } } | if ( isCaseSensitive ( ) ) { return sequence . toString ( ) ; } return sequence . toString ( ) . toLowerCase ( ) ; |
public class OpenTok { /** * Creates a new OpenTok session .
* For example , when using the OpenTok . js library , use the session ID when calling the
* < a href = " http : / / tokbox . com / opentok / libraries / client / js / reference / OT . html # initSession " >
* OT . initSession ( ) < / a > method ( to ini... | final SessionProperties _properties = properties != null ? properties : new SessionProperties . Builder ( ) . build ( ) ; final Map < String , Collection < String > > params = _properties . toMap ( ) ; final String response = this . client . createSession ( params ) ; try { CreatedSession [ ] sessions = createdSessionR... |
public class PostContentRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( PostContentRequest postContentRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( postContentRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( postContentRequest . getBotName ( ) , BOTNAME_BINDING ) ; protocolMarshaller . marshall ( postContentRequest . getBotAlias ( ) , BOTALIAS_BINDING ) ; protocolMarshall... |
public class PDBFileParser { /** * Here we assign chains following the mmCIF data model :
* one chain per polymer , one chain per non - polymer group and
* several water chains .
* Subsequently we assign entities for them : either from those read from
* COMPOUND records or from those found heuristically through... | List < List < Chain > > polyModels = new ArrayList < > ( ) ; List < List < Chain > > nonPolyModels = new ArrayList < > ( ) ; List < List < Chain > > waterModels = new ArrayList < > ( ) ; for ( List < Chain > model : allModels ) { List < Chain > polyChains = new ArrayList < > ( ) ; List < Chain > nonPolyChains = new Arr... |
public class CallSiteArray { /** * otherwise or if method doesn ' t exist we make call via POJO meta class */
private static CallSite createPojoSite ( CallSite callSite , Object receiver , Object [ ] args ) { } } | final Class klazz = receiver . getClass ( ) ; MetaClass metaClass = InvokerHelper . getMetaClass ( receiver ) ; if ( ! GroovyCategorySupport . hasCategoryInCurrentThread ( ) && metaClass instanceof MetaClassImpl ) { final MetaClassImpl mci = ( MetaClassImpl ) metaClass ; final ClassInfo info = mci . getTheCachedClass (... |
public class DescribeNotificationsForBudgetResult { /** * A list of notifications that are associated with a budget .
* @ param notifications
* A list of notifications that are associated with a budget . */
public void setNotifications ( java . util . Collection < Notification > notifications ) { } } | if ( notifications == null ) { this . notifications = null ; return ; } this . notifications = new java . util . ArrayList < Notification > ( notifications ) ; |
public class Utils { /** * Compute the MD5 of the given string and return it as a Base64 - encoded value . The
* string is first converted to bytes using UTF - 8 , and the MD5 is computed on that
* value . The MD5 value is 16 bytes , but the Base64 - encoded string is 24 chars .
* @ param strIn A Unicode string .... | try { MessageDigest md5 = MessageDigest . getInstance ( "md5" ) ; byte [ ] bin = toBytes ( strIn ) ; byte [ ] bout = md5 . digest ( bin ) ; String strOut = javax . xml . bind . DatatypeConverter . printBase64Binary ( bout ) ; return strOut ; } catch ( Exception e ) { throw new RuntimeException ( e . getMessage ( ) , e ... |
public class Interval { /** * Cancel the current schedule , and ensure that any expirations that are queued up but have not
* yet run do not run . */
public final void cancel ( ) { } } | IntervalTask task = _task ; if ( task != null ) { _task = null ; task . cancel ( ) ; } |
public class SelectorUtils { /** * Replace the possible variable place holder .
* @ param formatter current formatter
* @ param str the string
* @ param caller for exception handling
* @ return the result */
static String replacePlaceHolder ( CssFormatter formatter , String str , LessObject caller ) { } } | int pos = str . startsWith ( "@{" ) ? 0 : str . indexOf ( "@" , 1 ) ; if ( pos >= 0 ) { formatter . addOutput ( ) ; SelectorUtils . appendToWithPlaceHolder ( formatter , str , pos , false , caller ) ; return formatter . releaseOutput ( ) ; } return str ; |
public class SenBotReferenceService { /** * Find a { @ link By } locator by its reference name
* @ param elementReference
* @ return { @ link By } */
public By getElementLocatorForElementReference ( String elementReference ) { } } | Map < String , By > objectReferenceMap = getObjectReferenceMap ( By . class ) ; By elementLocator = objectReferenceMap . get ( elementReference ) ; if ( elementLocator == null ) { fail ( "No elementLocator is found for element name: '" + elementReference + "'. Available element references are: " + objectReferenceMap . ... |
public class BinaryTreeAddressableHeap { /** * Get the parent node of a given node . */
private Node getParent ( Node n ) { } } | if ( n . y_s == null ) { return null ; } Node c = n . y_s ; if ( c . o_c == n ) { return c ; } Node p1 = c . y_s ; if ( p1 != null && p1 . o_c == n ) { return p1 ; } return c ; |
public class SnapshotContentItemVerifier { /** * ( non - Javadoc )
* @ see org . springframework . batch . item . ItemWriter # write ( java . util . List ) */
@ Override public void write ( List < ? extends SnapshotContentItem > items ) throws Exception { } } | for ( SnapshotContentItem item : items ) { Map < String , String > props = PropertiesSerializer . deserialize ( item . getMetadata ( ) ) ; String contentId = item . getContentId ( ) ; String checksum = props . get ( ContentStore . CONTENT_CHECKSUM ) ; // verify that manifest contains every item from the database except... |
public class UnionFindUtil { /** * Make a new instance ( automatically choosing the best implementation ) .
* @ param ids ID set
* @ return Union find algorithm */
public static UnionFind make ( StaticDBIDs ids ) { } } | if ( ids instanceof DBIDRange ) { return new WeightedQuickUnionRangeDBIDs ( ( DBIDRange ) ids ) ; } return new WeightedQuickUnionStaticDBIDs ( ids ) ; |
public class ConnectionTcp { /** * Initialize the socket for a new connection */
private void initSocket ( ) throws IOException { } } | _idleTimeout = _port . getKeepaliveTimeout ( ) ; _port . ssl ( _socket ) ; writeStream ( ) . init ( _socket . stream ( ) ) ; // ReadStream cannot use getWriteStream or auto - flush
// because of duplex mode
// ReadStream is = getReadStream ( ) ;
_readStream . init ( _socket . stream ( ) ) ; if ( log . isLoggable ( Leve... |
public class SpnegoContext { /** * Initialize the GSSContext to provide SPNEGO feature .
* @ param inputBuf
* @ param offset
* @ param len
* @ return
* @ throws GSSException */
byte [ ] initSecContext ( byte [ ] inputBuf , int offset , int len ) throws GSSException { } } | byte [ ] ret = null ; if ( len == 0 ) { byte [ ] mechToken = context . initSecContext ( inputBuf , offset , len ) ; int contextFlags = 0 ; if ( context . getCredDelegState ( ) ) { contextFlags |= NegTokenInit . DELEGATION ; } if ( context . getMutualAuthState ( ) ) { contextFlags |= NegTokenInit . MUTUAL_AUTHENTICATION... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.