signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class FileSystem { /** * Returns the FileSystem for this URI ' s scheme and authority . The scheme
* of the URI determines a configuration property name ,
* < tt > fs . < i > scheme < / i > . class < / tt > whose value names the FileSystem class .
* The entire URI is passed to the FileSystem instance ' s i... | String scheme = uri . getScheme ( ) ; String authority = uri . getAuthority ( ) ; if ( scheme == null ) { // no scheme : use default FS
return get ( conf ) ; } if ( authority == null ) { // no authority
URI defaultUri = getDefaultUri ( conf ) ; if ( scheme . equals ( defaultUri . getScheme ( ) ) // if scheme matches de... |
public class ConnectionManager { /** * Query a player to determine the port on which its database server is running .
* @ param announcement the device announcement with which we detected a new player on the network . */
private void requestPlayerDBServerPort ( DeviceAnnouncement announcement ) { } } | Socket socket = null ; try { InetSocketAddress address = new InetSocketAddress ( announcement . getAddress ( ) , DB_SERVER_QUERY_PORT ) ; socket = new Socket ( ) ; socket . connect ( address , socketTimeout . get ( ) ) ; InputStream is = socket . getInputStream ( ) ; OutputStream os = socket . getOutputStream ( ) ; soc... |
public class FDUtil { /** * creates a classbane from give source path
* @ param str
* @ return */
public static String toClassName ( String str ) { } } | StringBuffer javaName = new StringBuffer ( ) ; String [ ] arr = lucee . runtime . type . util . ListUtil . listToStringArray ( str , '/' ) ; for ( int i = 0 ; i < arr . length ; i ++ ) { if ( i == ( arr . length - 1 ) ) arr [ i ] = replaceLast ( arr [ i ] , '.' , '$' ) ; if ( i != 0 ) javaName . append ( '.' ) ; javaNa... |
public class ExtraLanguagePreferenceAccess { /** * Replies the preference value from the given store .
* @ param store the preference storE .
* @ param preferenceContainerID the identifier of the generator ' s preference container .
* @ param preferenceName the name of the preference .
* @ return the key . */
p... | return store . getString ( getPrefixedKey ( preferenceContainerID , preferenceName ) ) ; |
public class FieldUtil { /** * Utility to remove the trailing 0 ' s .
* @ param sb the input string builder ; may not be null */
protected static void removeTralingZeros ( StringBuilder sb ) { } } | int endIndex = sb . length ( ) ; if ( endIndex > 0 ) { -- endIndex ; int index = endIndex ; while ( sb . charAt ( index ) == '0' ) { -- index ; } if ( index < endIndex ) sb . delete ( index + 1 , endIndex + 1 ) ; } |
public class Encoding { /** * Decodes HTML entities to produce a string containing only valid
* Unicode scalar values . */
public static String decodeHtml ( String s ) { } } | int firstAmp = s . indexOf ( '&' ) ; int safeLimit = longestPrefixOfGoodCodeunits ( s ) ; if ( ( firstAmp & safeLimit ) < 0 ) { return s ; } StringBuilder sb ; { int n = s . length ( ) ; sb = new StringBuilder ( n ) ; int pos = 0 ; int amp = firstAmp ; while ( amp >= 0 ) { long endAndCodepoint = HtmlEntities . decodeEn... |
public class cacheforwardproxy { /** * Use this API to add cacheforwardproxy . */
public static base_response add ( nitro_service client , cacheforwardproxy resource ) throws Exception { } } | cacheforwardproxy addresource = new cacheforwardproxy ( ) ; addresource . ipaddress = resource . ipaddress ; addresource . port = resource . port ; return addresource . add_resource ( client ) ; |
public class PersistentState { /** * Set the state of parsing for a particular log file .
* @ param state the ParseState to set */
public static void setState ( ParseState state ) { } } | if ( state == null ) { System . err . println ( "Null state found" ) ; Environment . logInfo ( "Null state found" ) ; } persData . setProperty ( state . filename , state . firstLine + SEPARATOR + state . offset ) ; |
public class AbstractJaxWsWebEndpoint { /** * Configure common endpoint properties
* @ param endpointInfo */
protected void configureEndpointInfoProperties ( EndpointInfo libertyEndpointInfo , org . apache . cxf . service . model . EndpointInfo cxfEndpointInfo ) { } } | // Disable jaxb validation event handler , as IBM FastPath does not support this , which will finally fallback to RI unmarshall
cxfEndpointInfo . setProperty ( SET_JAXB_VALIDATION_EVENT_HANDLER , false ) ; // Set autoRewriteSoapAddressForAllServices with true by default , which will override all the services in the tar... |
public class CommerceDiscountUsageEntryLocalServiceUtil { /** * Adds the commerce discount usage entry to the database . Also notifies the appropriate model listeners .
* @ param commerceDiscountUsageEntry the commerce discount usage entry
* @ return the commerce discount usage entry that was added */
public static... | return getService ( ) . addCommerceDiscountUsageEntry ( commerceDiscountUsageEntry ) ; |
public class Strings { /** * Collects object member values into an array of Strings , each prefixed by the field name .
* @ param object - an object
* @ param names - the names of data members of object
* @ return an array of strings , each in the format of < i > & lt ; member - name & gt ; : & lt ; member - valu... | return collect ( null , 0 , "" , object , ':' , names ) ; |
public class HttpOutputStreamEE7 { /** * @ see java . io . OutputStream # flush ( ) */
@ Override public void flush ( ) throws IOException { } } | if ( _callback != null ) { if ( ! this . _isReady ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Cannot flush stream , output not ready: " + this ) ; } return ; } else { validate ( ) ; flushBuffers ( ) ; } } else { super . flush ( ) ; } |
public class TransferManager { /** * Schedules a new transfer to copy data from one Amazon S3 location to
* another Amazon S3 location . This method is non - blocking and returns
* immediately ( i . e . before the copy has finished ) .
* Note : You need to use this method if the { @ link TransferManager } is crea... | appendSingleObjectUserAgent ( copyObjectRequest ) ; assertParameterNotNull ( copyObjectRequest . getSourceBucketName ( ) , "The source bucket name must be specified when a copy request is initiated." ) ; assertParameterNotNull ( copyObjectRequest . getSourceKey ( ) , "The source object key must be specified when a copy... |
public class RsIterator { /** * Answer the counted size
* @ return int */
protected int countedSize ( ) throws PersistenceBrokerException { } } | Query countQuery = getBroker ( ) . serviceBrokerHelper ( ) . getCountQuery ( getQueryObject ( ) . getQuery ( ) ) ; ResultSetAndStatement rsStmt ; ClassDescriptor cld = getQueryObject ( ) . getClassDescriptor ( ) ; int count = 0 ; // BRJ : do not use broker . getCount ( ) because it ' s extent - aware
// the count we ne... |
public class SwiftAPIDirect { /** * Get object
* @ param path path to object
* @ param account Joss account wrapper object
* @ param scm Swift connection manager
* @ return SwiftGETResponse input stream and content length
* @ throws IOException if network issues */
public static SwiftInputStreamWrapper getObj... | return getObject ( path , account , 0 , 0 , scm ) ; |
public class AnnotatedBeanFactoryRegistry { /** * Returns a factory of the specified { @ link BeanFactoryId } . */
static Optional < AnnotatedBeanFactory < ? > > find ( @ Nullable BeanFactoryId beanFactoryId ) { } } | if ( beanFactoryId == null ) { return Optional . empty ( ) ; } final AnnotatedBeanFactory < ? > factory = factories . get ( beanFactoryId ) ; return factory != null && factory != unsupportedBeanFactory ? Optional . of ( factory ) : Optional . empty ( ) ; |
public class CouchDBObjectMapper { /** * Sets the field value .
* @ param entity
* the entity
* @ param column
* the column
* @ param value
* the value */
private static void setFieldValue ( Object entity , Attribute column , JsonElement value ) { } } | if ( column . getJavaType ( ) . isAssignableFrom ( byte [ ] . class ) ) { PropertyAccessorHelper . set ( entity , ( Field ) column . getJavaMember ( ) , PropertyAccessorFactory . STRING . toBytes ( value . getAsString ( ) ) ) ; } else { PropertyAccessorHelper . set ( entity , ( Field ) column . getJavaMember ( ) , Prop... |
public class XMLUtils { /** * You must pass the xml string and the tag name . This should be called for
* situations where you want to get the value of a simple tag :
* & lt ; age & gt ; 18 & lt ; / age & gt ; .
* In this case , in order to get the 18 value we call the method like this :
* getTagText ( xml , " ... | NodeList nodes = this . getNodeList ( xmlString , tagName ) ; LOG . info ( "Elements returned = " + nodes . getLength ( ) ) ; Element element = ( Element ) nodes . item ( 0 ) ; LOG . info ( "element text = " + element . getTextContent ( ) ) ; return element . getTextContent ( ) ; |
public class LocalQueueConnection { /** * / * ( non - Javadoc )
* @ see net . timewalker . ffmq4 . common . connection . AbstractConnection # createDurableConnectionConsumer ( javax . jms . Topic , java . lang . String , java . lang . String , javax . jms . ServerSessionPool , int ) */
@ Override public ConnectionCon... | throw new IllegalStateException ( "Method not available on this domain." ) ; |
public class GlParticlesView { /** * { @ inheritDoc } */
public void setDensity ( @ IntRange ( from = 0 ) final int newNum ) { } } | queueEvent ( new Runnable ( ) { @ Override public void run ( ) { scene . setDensity ( newNum ) ; } } ) ; |
public class DescribeHapgResult { /** * @ param hsmsPendingRegistration */
public void setHsmsPendingRegistration ( java . util . Collection < String > hsmsPendingRegistration ) { } } | if ( hsmsPendingRegistration == null ) { this . hsmsPendingRegistration = null ; return ; } this . hsmsPendingRegistration = new com . amazonaws . internal . SdkInternalList < String > ( hsmsPendingRegistration ) ; |
public class JDBC4DatabaseMetaData { /** * Retrieves a description of a table ' s columns that are automatically updated when any value in a row is updated . */
@ Override public ResultSet getVersionColumns ( String catalog , String schema , String table ) throws SQLException { } } | checkClosed ( ) ; throw SQLError . noSupport ( ) ; |
public class JMatrixPanel { /** * For each element in matrix , draw it as a colored square or pixel .
* The color of a matrix element with value x is specified as
* - H : 1 - x / scalevalue
* - S : saturation
* - B : 1 - x / scalevalue
* @ param g1 */
public void drawDistances ( Graphics g1 ) { } } | Graphics2D g = ( Graphics2D ) g1 ; int c = matrix . getRowDimension ( ) ; int d = matrix . getColumnDimension ( ) ; float scale = getScale ( ) ; int width = Math . round ( scale ) ; for ( int i = 0 ; i < c ; i ++ ) { int ipaint = Math . round ( i * scale ) ; for ( int j = 0 ; j < d ; j ++ ) { double val = matrix . get ... |
public class Reflection { /** * fieldNames must contain only interned Strings */
public static synchronized void registerFieldsToFilter ( Class < ? > containingClass , String ... fieldNames ) { } } | fieldFilterMap = registerFilter ( fieldFilterMap , containingClass , fieldNames ) ; |
public class AnnotationUtil { /** * Attempts to get the the Riak links from a domain object by looking for a
* { @ literal @ RiakLinks } annotated member .
* @ param < T > the domain object type
* @ param container the RiakLinks container
* @ param domainObject the domain object
* @ return a Collection of Ria... | return AnnotationHelper . getInstance ( ) . getLinks ( container , domainObject ) ; |
public class IntentIntegrator { /** * Initiates a scan , using the specified camera , only for a certain set of barcode types , given as strings corresponding
* to their names in ZXing ' s { @ code BarcodeFormat } class like " UPC _ A " . You can supply constants
* like { @ link # PRODUCT _ CODE _ TYPES } for examp... | Intent intentScan = new Intent ( BS_PACKAGE + ".SCAN" ) ; intentScan . addCategory ( Intent . CATEGORY_DEFAULT ) ; // check which types of codes to scan for
if ( desiredBarcodeFormats != null ) { // set the desired barcode types
StringBuilder joinedByComma = new StringBuilder ( ) ; for ( String format : desiredBarcodeF... |
public class GlobalFileProperties { /** * Define el fichero del cual se van a leer las propiedades .
* @ param filePath */
public static void setInitFilePath ( String filePath ) { } } | filePath = getPropertiesFilePath ( filePath ) ; if ( staticFileProperties == null ) { staticFileProperties = new FileProperties ( filePath ) ; } else { staticFileProperties . setInitFilePath ( filePath ) ; } |
public class Mappings { /** * ( mapping ) return default value , if input value is null or empty
* NOTE : all options operations will be delegate to ' base ' mapping
* @ param base base mapping
* @ param defaultVal default value to be used when the related input is empty
* @ param constraints constraints
* @ ... | return optional ( base , constraints ) . map ( o -> o . orElse ( defaultVal ) ) ; |
public class KeyVaultClientBaseImpl { /** * Creates a new certificate .
* If this is the first version , the certificate resource is created . This operation requires the certificates / create permission .
* @ param vaultBaseUrl The vault name , for example https : / / myvault . vault . azure . net .
* @ param ce... | if ( vaultBaseUrl == null ) { throw new IllegalArgumentException ( "Parameter vaultBaseUrl is required and cannot be null." ) ; } if ( certificateName == null ) { throw new IllegalArgumentException ( "Parameter certificateName is required and cannot be null." ) ; } if ( this . apiVersion ( ) == null ) { throw new Illeg... |
public class Weld { /** * A package of the specified class will be scanned and found classes will be added to the set of bean classes for the synthetic bean archive .
* @ param scanRecursively
* @ param packageClass
* @ return self */
public Weld addPackage ( boolean scanRecursively , Class < ? > packageClass ) {... | packages . add ( new PackInfo ( packageClass , scanRecursively ) ) ; return this ; |
public class MediaLocationSettings { /** * Gets the securityPolicy value for this MediaLocationSettings .
* @ return securityPolicy * The security policy and authentication credentials needed to
* access the content in this media
* location . This value is required for a valid media
* location . */
public com .... | return securityPolicy ; |
public class SocketChannelStream { /** * Closes the underlying sockets and socket streams . */
@ Override public void close ( ) throws IOException { } } | SocketChannel s = _s ; _s = null ; if ( s != null ) { s . close ( ) ; } /* OutputStream os = _ os ;
_ os = null ;
InputStream is = _ is ;
_ is = null ;
try {
if ( os ! = null )
os . close ( ) ;
if ( is ! = null )
is . close ( ) ;
} finally {
if ( s ! = null )
s . close ( ) ; */ |
public class Cache { /** * F61004.6 */
@ Override public CacheElement insertUnpinned ( Object key , Object object ) { } } | boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "insertUnpinned" , new Object [ ] { key , object } ) ; try { Bucket bucket = getOrCreateBucketForKey ( key ) ; // d739870
Element element ; synchronized ( bucket ) { element = bucket . insertByKe... |
public class GoogleAuthenticatorAccountCouchDbRepository { /** * Find first account for user .
* @ param username username for lookup
* @ return first one time token account for user */
@ View ( name = "by_username" , map = "function(doc) { if(doc.secretKey) { emit(doc.username, doc) } }" ) public CouchDbGoogleAuth... | val view = createQuery ( "by_username" ) . key ( username ) . limit ( 1 ) ; try { return db . queryView ( view , CouchDbGoogleAuthenticatorAccount . class ) . stream ( ) . findFirst ( ) . orElse ( null ) ; } catch ( final DocumentNotFoundException ignored ) { return null ; } |
public class InterfaceEndpointsInner { /** * Creates or updates an interface endpoint in the specified resource group .
* @ param resourceGroupName The name of the resource group .
* @ param interfaceEndpointName The name of the interface endpoint .
* @ param parameters Parameters supplied to the create or update... | return ServiceFuture . fromResponse ( createOrUpdateWithServiceResponseAsync ( resourceGroupName , interfaceEndpointName , parameters ) , serviceCallback ) ; |
public class StatementExecutor { /** * Initialize executor .
* @ param routeResult route result
* @ throws SQLException SQL exception */
public void init ( final SQLRouteResult routeResult ) throws SQLException { } } | setSqlStatement ( routeResult . getSqlStatement ( ) ) ; getExecuteGroups ( ) . addAll ( obtainExecuteGroups ( routeResult . getRouteUnits ( ) ) ) ; cacheStatements ( ) ; |
public class OrientedBox3f { /** * Set the second axis of the box .
* The third axis is updated to be perpendicular to the two other axis .
* @ param x - the new values for the second axis .
* @ param y - the new values for the second axis .
* @ param z - the new values for the second axis . */
@ Override publi... | setSecondAxis ( x , y , z , getSecondAxisExtent ( ) ) ; |
public class TimeEstimate { /** * Gets the estimated time to crack formatted as a string .
* @ param result a { @ code Result } object to estimate time to crack for .
* @ param guess _ type a { @ code String } representing the estimate type to get time to crack for ( defined in { @ code Configuration } .
* @ retu... | ResourceBundle mainResource = result . getConfiguration ( ) . getMainResource ( ) ; BigDecimal seconds = getTimeToCrack ( result , guess_type ) ; BigDecimal minutes = new BigDecimal ( 60 ) ; BigDecimal hours = minutes . multiply ( new BigDecimal ( 60 ) ) ; BigDecimal days = hours . multiply ( new BigDecimal ( 24 ) ) ; ... |
public class DisasterRecoveryConfigurationsInner { /** * Fails over from the current primary server to this server .
* @ 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 ... | failoverWithServiceResponseAsync ( resourceGroupName , serverName , disasterRecoveryConfigurationName ) . toBlocking ( ) . last ( ) . body ( ) ; |
public class JspUtil { /** * Utility method used by data grid related classes to create URLs . If both an action name and href are provided ,
* the action name will be used to construct the URL string .
* @ param href the href
* @ param action the action
* @ param location the intra page location
* @ param sc... | PageContext pageContext = getPageContext ( jspContext ) ; /* add the jpfScopeID parameter , if the scope attribute is present . */
if ( scope != null ) { if ( params == null ) params = new HashMap ( ) ; params . put ( ScopedServletUtils . SCOPE_ID_PARAM , scope ) ; } String uri = null ; if ( action != null ) uri = Page... |
public class EntityUtilities { /** * Gets the CSNode Topic entity that is represented by the node .
* @ param node The node that represents a topic entry .
* @ param topicProvider The topic provider to lookup the topic entity from .
* @ return The topic entity represented by the node , or null if there isn ' t on... | if ( ! isNodeATopic ( node ) ) return null ; return topicProvider . getTopic ( node . getEntityId ( ) , node . getEntityRevision ( ) ) ; |
public class WorkManagerUtil { /** * Get explicit work manager override
* @ param work The work instance
* @ return The override , if none return null */
public static String getWorkManager ( DistributableWork work ) { } } | if ( work != null && work instanceof WorkContextProvider ) { List < WorkContext > contexts = ( ( WorkContextProvider ) work ) . getWorkContexts ( ) ; if ( contexts != null ) { for ( WorkContext wc : contexts ) { if ( wc instanceof DistributableContext ) { DistributableContext dc = ( DistributableContext ) wc ; return d... |
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link IndirectEntryType } { @ code > }
* @ param value
* Java instance representing xml element ' s value .
* @ return
* the new instance of { @ link JAXBElement } { @ code < } { @ link IndirectEntryType } { @ code >... | return new JAXBElement < IndirectEntryType > ( _IndirectEntry_QNAME , IndirectEntryType . class , null , value ) ; |
public class KriptonRequestBodyCollectionConverter { /** * / * ( non - Javadoc )
* @ see retrofit2 . Converter # convert ( java . lang . Object ) */
@ SuppressWarnings ( { } } | "unchecked" , "rawtypes" } ) @ Override public RequestBody convert ( T value ) throws IOException { Buffer buffer = new Buffer ( ) ; try { binderContext . serializeCollection ( ( Collection ) value , ( Class ) clazz , buffer . outputStream ( ) ) ; return RequestBody . create ( MEDIA_TYPE , buffer . readByteString ( ) )... |
public class OneStepIterator { /** * Initialize the context values for this expression
* after it is cloned .
* @ param context The XPath runtime context for this
* transformation . */
public void setRoot ( int context , Object environment ) { } } | super . setRoot ( context , environment ) ; if ( m_axis > - 1 ) m_iterator = m_cdtm . getAxisIterator ( m_axis ) ; m_iterator . setStartNode ( m_context ) ; |
public class AbstractScheduler { /** * Collects the instances required to run the job from the given { @ link ExecutionStage } and requests them at the
* loaded instance manager .
* @ param executionStage
* the execution stage to collect the required instances from
* @ throws InstanceException
* thrown if the... | final ExecutionGraph executionGraph = executionStage . getExecutionGraph ( ) ; final InstanceRequestMap instanceRequestMap = new InstanceRequestMap ( ) ; synchronized ( executionStage ) { executionStage . collectRequiredInstanceTypes ( instanceRequestMap , ExecutionState . CREATED ) ; final Iterator < Map . Entry < Ins... |
public class Geometry { /** * Sets the size of a UIObject */
public static final void setSize ( UIObject o , Rect size ) { } } | o . setPixelSize ( size . w , size . h ) ; |
public class CharacterDataImpl { /** * { @ inheritDoc } */
public String substringData ( int offset , int count ) throws DOMException { } } | if ( ( offset < 0 ) || ( count < 0 ) ) { throw new DOMException ( DOMException . INDEX_SIZE_ERR , null ) ; } String data = getData ( ) ; if ( offset > data . length ( ) ) { throw new DOMException ( DOMException . INDEX_SIZE_ERR , null ) ; } if ( offset + count > data . length ( ) ) { return data . substring ( offset ) ... |
public class CachedRender { /** * Render the cached operations . Note that this doesn ' t call the operations , but
* rather calls the cached version */
public void render ( ) { } } | if ( list == - 1 ) { throw new RuntimeException ( "Attempt to render cached operations that have been destroyed" ) ; } SlickCallable . enterSafeBlock ( ) ; GL . glCallList ( list ) ; SlickCallable . leaveSafeBlock ( ) ; |
public class LazyLinkingResource { /** * Return < code > true < / code > if the given feature may hold a proxy that has to be resolved .
* This is supposed to be an internal hook which allows to resolve proxies even in cases
* where EMF prohibits proxies , e . g . in case of opposite references .
* @ since 2.4 */... | return ! feature . isDerived ( ) && ! feature . isTransient ( ) && feature instanceof EReference && ( ( EReference ) feature ) . isResolveProxies ( ) ; |
public class TimestampUtils { /** * Returns the SQL Date object matching the given bytes with { @ link Oid # DATE } .
* @ param tz The timezone used .
* @ param bytes The binary encoded date value .
* @ return The parsed date object .
* @ throws PSQLException If binary format could not be parsed . */
public Dat... | if ( bytes . length != 4 ) { throw new PSQLException ( GT . tr ( "Unsupported binary encoding of {0}." , "date" ) , PSQLState . BAD_DATETIME_FORMAT ) ; } int days = ByteConverter . int4 ( bytes , 0 ) ; if ( tz == null ) { tz = getDefaultTz ( ) ; } long secs = toJavaSecs ( days * 86400L ) ; long millis = secs * 1000L ; ... |
public class InternalPureXbaseParser { /** * InternalPureXbase . g : 6660:1 : entryRuleXImportSection returns [ EObject current = null ] : iv _ ruleXImportSection = ruleXImportSection EOF ; */
public final EObject entryRuleXImportSection ( ) throws RecognitionException { } } | EObject current = null ; EObject iv_ruleXImportSection = null ; try { // InternalPureXbase . g : 6660:55 : ( iv _ ruleXImportSection = ruleXImportSection EOF )
// InternalPureXbase . g : 6661:2 : iv _ ruleXImportSection = ruleXImportSection EOF
{ if ( state . backtracking == 0 ) { newCompositeNode ( grammarAccess . get... |
public class Suggest { /** * clean up by deleting the documents and query options used in the example query */
public static void tearDownExample ( String host , int port , String user , String password , Authentication authType ) throws ResourceNotFoundException , ForbiddenUserException , FailedRequestException { } } | DatabaseClient client = DatabaseClientFactory . newClient ( host , port , user , password , authType ) ; XMLDocumentManager docMgr = client . newXMLDocumentManager ( ) ; for ( String filename : filenames ) { docMgr . delete ( "/example/" + filename ) ; } QueryOptionsManager optionsMgr = client . newServerConfigManager ... |
public class SearchManager { /** * Extract the username to be used in multiple queries
* @ return current logged in user */
@ Produces @ LoggedIn public String extractUsername ( ) { } } | final KeycloakPrincipal principal = ( KeycloakPrincipal ) httpServletRequest . getUserPrincipal ( ) ; if ( principal != null ) { logger . debug ( "Running with Keycloak context" ) ; KeycloakSecurityContext kcSecurityContext = principal . getKeycloakSecurityContext ( ) ; return kcSecurityContext . getToken ( ) . getPref... |
public class UnsupportedAvailabilityZoneException { /** * The supported Availability Zones for your account . Choose subnets in these Availability Zones for your cluster .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setValidZones ( java . util . Collectio... | if ( this . validZones == null ) { setValidZones ( new java . util . ArrayList < String > ( validZones . length ) ) ; } for ( String ele : validZones ) { this . validZones . add ( ele ) ; } return this ; |
public class JsDocInfoParser { /** * Parse a description as a { @ code @ type } . */
public JSDocInfo parseInlineTypeDoc ( ) { } } | skipEOLs ( ) ; JsDocToken token = next ( ) ; int lineno = stream . getLineno ( ) ; int startCharno = stream . getCharno ( ) ; Node typeAst = parseParamTypeExpression ( token ) ; recordTypeNode ( lineno , startCharno , typeAst , token == JsDocToken . LEFT_CURLY ) ; JSTypeExpression expr = createJSTypeExpression ( typeAs... |
public class StorageAccountsInner { /** * List SAS credentials of a storage account .
* @ param resourceGroupName The name of the resource group within the user ' s subscription . The name is case insensitive .
* @ param accountName The name of the storage account within the specified resource group . Storage accou... | if ( resourceGroupName == null ) { throw new IllegalArgumentException ( "Parameter resourceGroupName is required and cannot be null." ) ; } if ( accountName == null ) { throw new IllegalArgumentException ( "Parameter accountName is required and cannot be null." ) ; } if ( this . client . subscriptionId ( ) == null ) { ... |
public class JapaneseCharReplacer { /** * 半角を全角に変換する 。
* @ param text 変換対象の文字列 。
* @ return 変換後の値 。 変換対象の値がnullまたは空文字の場合は 、 そのまま返します 。 */
public String replaceToFullChar ( final String text ) { } } | if ( Utils . isEmpty ( text ) ) { return text ; } return fullCharReplacer . replace ( text ) ; |
public class DCEventSource { /** * This adds a new listener to the Invalidation listener .
* @ param listener The listener to be added . */
public void addListener ( InvalidationListener listener ) { } } | synchronized ( hsInvalidationListeners ) { hsInvalidationListeners . add ( listener ) ; invalidationListenerCount = hsInvalidationListeners . size ( ) ; bUpdateInvalidationListener = true ; } |
public class StructureInterface { /** * Return a String representing the 2 molecules of this interface in PDB format .
* If the molecule ids ( i . e . chain ids ) are the same for both molecules , then the second
* one will be replaced by the next letter in alphabet ( or A for Z )
* @ return */
public String toPD... | String molecId1 = getMoleculeIds ( ) . getFirst ( ) ; String molecId2 = getMoleculeIds ( ) . getSecond ( ) ; if ( molecId2 . equals ( molecId1 ) ) { // if both chains are named equally we want to still named them differently in the output pdb file
// so that molecular viewers can handle properly the 2 chains as separat... |
public class S { /** * Generate random string .
* The generated string is safe to be used as filename
* @ param len
* @ return a random string with specified length */
public static String random ( int len ) { } } | final char [ ] chars = { '0' , '1' , '2' , '3' , '4' , '5' , '6' , '7' , '8' , '9' , '$' , '#' , '^' , '&' , '_' , 'a' , 'b' , 'c' , 'd' , 'e' , 'f' , 'g' , 'h' , 'i' , 'j' , 'k' , 'l' , 'm' , 'n' , 'o' , 'p' , 'q' , 'r' , 's' , 't' , 'u' , 'v' , 'w' , 'x' , 'y' , 'z' , 'A' , 'B' , 'C' , 'D' , 'E' , 'F' , 'G' , 'H' , '... |
public class DirectUpdateDoublesSketch { /** * Puts */
@ Override void putMinValue ( final double minValue ) { } } | assert ( mem_ . getCapacity ( ) >= COMBINED_BUFFER ) ; mem_ . putDouble ( MIN_DOUBLE , minValue ) ; |
public class MD5Util { /** * Converts given string to MD5 hash
* @ param str str to be hashed with MD5 */
@ SuppressWarnings ( "checkstyle:magicnumber" ) public static String toMD5String ( String str ) { } } | try { MessageDigest md = MessageDigest . getInstance ( "MD5" ) ; if ( md == null || str == null ) { return null ; } byte [ ] byteData = md . digest ( str . getBytes ( Charset . forName ( "UTF-8" ) ) ) ; StringBuilder sb = new StringBuilder ( ) ; for ( byte aByteData : byteData ) { sb . append ( Integer . toString ( ( a... |
public class PackageIndexWriter { /** * Adds list of packages in the index table . Generate link to each package .
* @ param packages Packages to which link is to be generated
* @ param tbody the documentation tree to which the list will be added */
protected void addPackagesList ( PackageDoc [ ] packages , Content... | for ( int i = 0 ; i < packages . length ; i ++ ) { if ( packages [ i ] != null && packages [ i ] . name ( ) . length ( ) > 0 ) { if ( configuration . nodeprecated && Util . isDeprecated ( packages [ i ] ) ) continue ; Content packageLinkContent = getPackageLink ( packages [ i ] , getPackageName ( packages [ i ] ) ) ; C... |
public class DelayInformationManager { /** * Get Delayed Delivery information . This method first looks for a PacketExtension with the
* XEP - 203 namespace and falls back to the XEP - 91 namespace .
* @ param packet
* @ return the Delayed Delivery information or < code > null < / code > */
public static DelayInf... | DelayInformation delayInformation = getXep203DelayInformation ( packet ) ; if ( delayInformation != null ) { return delayInformation ; } return getLegacyDelayInformation ( packet ) ; |
public class ClassInfo { /** * Convert an ASM access mask to a reflection Modifier mask .
* @ param asmAccessMask the ASM access mask
* @ return the Modifier mask */
private int convertAccessMaskToModifierMask ( int asmAccessMask ) { } } | int modifier = 0 ; // Convert the ASM access info into Reflection API modifiers .
if ( ( asmAccessMask & Opcodes . ACC_FINAL ) != 0 ) modifier |= Modifier . FINAL ; if ( ( asmAccessMask & Opcodes . ACC_NATIVE ) != 0 ) modifier |= Modifier . NATIVE ; if ( ( asmAccessMask & Opcodes . ACC_INTERFACE ) != 0 ) modifier |= Mo... |
public class OrderingContextProxy { /** * owning connection which is cheap or ( ii ) from the messaging engine which is expensive . */
private void setOrderingContextProxyId ( ) throws SIConnectionUnavailableException , SIConnectionDroppedException , SIErrorException { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "setOrderingContextProxyId" ) ; final ConnectionProxy cp = getConnectionProxy ( ) ; final Short orderContext = cp . getOrderContext ( ) ; if ( orderContext != null ) { setProxyID ( orderContext . shortValue ( ) ) ; } ... |
public class SerDeState { /** * Common operations : */
public < T > T readObject ( Class < T > cls ) { } } | return kryo . readObject ( input , cls ) ; |
public class TypeUtils { /** * Format a { @ link ParameterizedType } as a { @ link String } .
* @ param p { @ code ParameterizedType } to format
* @ return String
* @ since 3.2 */
private static String parameterizedTypeToString ( final ParameterizedType p ) { } } | final StringBuilder buf = new StringBuilder ( ) ; final Type useOwner = p . getOwnerType ( ) ; final Class < ? > raw = ( Class < ? > ) p . getRawType ( ) ; if ( useOwner == null ) { buf . append ( raw . getName ( ) ) ; } else { if ( useOwner instanceof Class < ? > ) { buf . append ( ( ( Class < ? > ) useOwner ) . getNa... |
public class OlsonTimeZone { /** * Construct a GMT + 0 zone with no transitions . This is done when a
* constructor fails so the resultant object is well - behaved . */
private void constructEmpty ( ) { } } | transitionCount = 0 ; transitionTimes64 = null ; typeMapData = null ; typeCount = 1 ; typeOffsets = new int [ ] { 0 , 0 } ; finalZone = null ; finalStartYear = Integer . MAX_VALUE ; finalStartMillis = Double . MAX_VALUE ; transitionRulesInitialized = false ; |
public class CmsVfsDriver { /** * Appends the appropriate selection criteria related with the projectId . < p >
* @ param projectId the id of the project of the resources
* @ param mode the selection mode
* @ param conditions buffer to append the selection criteria
* @ param params list to append the selection ... | if ( ( mode & CmsDriverManager . READMODE_INCLUDE_PROJECT ) > 0 ) { // C _ READMODE _ INCLUDE _ PROJECT : add condition to match the PROJECT _ ID
conditions . append ( BEGIN_INCLUDE_CONDITION ) ; conditions . append ( m_sqlManager . readQuery ( projectId , "C_RESOURCES_SELECT_BY_PROJECT_LASTMODIFIED" ) ) ; conditions .... |
public class AmazonAlexaForBusinessClient { /** * Deletes room skill parameter details by room , skill , and parameter key ID .
* @ param deleteRoomSkillParameterRequest
* @ return Result of the DeleteRoomSkillParameter operation returned by the service .
* @ throws ConcurrentModificationException
* There is a ... | request = beforeClientExecution ( request ) ; return executeDeleteRoomSkillParameter ( request ) ; |
public class BidiGlobalDir { /** * Creates a bidi global direction that can only be determined at template runtime , by evaluating
* a given source code snippet that yields a boolean value where true indicates rtl .
* @ param isRtlCodeSnippet A code snippet that will evaluate at template runtime to a boolean
* va... | Preconditions . checkArgument ( isRtlCodeSnippet != null && isRtlCodeSnippet . length ( ) > 0 , "Bidi global direction source code snippet must be non-empty." ) ; Preconditions . checkArgument ( backend == SoyBackendKind . JS_SRC || backend == SoyBackendKind . PYTHON_SRC , "Bidi code snippets are only used in JS and Py... |
public class MessageReceiverFilterList { /** * Lookup this message listener .
* This message looks through my list to see if the listener ' s filter is there .
* @ param listener The listener to find .
* @ return The filter for this listener ( or null if not found ) . */
public BaseMessageFilter findMessageFilter... | Iterator < BaseMessageFilter > iterator = m_mapFilters . values ( ) . iterator ( ) ; while ( iterator . hasNext ( ) ) { BaseMessageFilter filter = iterator . next ( ) ; for ( int i = 0 ; ( filter . getMessageListener ( i ) != null ) ; i ++ ) { if ( filter . getMessageListener ( i ) == listener ) return filter ; } } ret... |
public class PumpStreamHandler { /** * Creates a stream pumper to copy the given input stream to the given
* output stream .
* @ param is the input stream to copy from
* @ param os the output stream to copy into
* @ return the stream pumper thread */
protected Thread createPump ( InputStream is , OutputStream o... | return createPump ( is , os , false , false ) ; |
public class ThriftKeyspaceImpl { /** * Convert a Map of options to an internal thrift keyspace definition
* @ param options */
private ThriftKeyspaceDefinitionImpl toThriftKeyspaceDefinition ( final Map < String , Object > options ) { } } | ThriftKeyspaceDefinitionImpl def = new ThriftKeyspaceDefinitionImpl ( ) ; Map < String , Object > internalOptions = Maps . newHashMap ( ) ; if ( options != null ) internalOptions . putAll ( options ) ; if ( internalOptions . containsKey ( "name" ) && ! internalOptions . get ( "name" ) . equals ( getKeyspaceName ( ) ) )... |
public class ProgressBar { /** * Wraps a { @ link Spliterator } so that when iterated , a progress bar is shown to track the traversal progress .
* For this function the progress bar can be fully customized by using a { @ link ProgressBarBuilder } .
* @ param sp Underlying spliterator
* @ param pbb An instance of... | long size = sp . getExactSizeIfKnown ( ) ; if ( size != - 1 ) pbb . setInitialMax ( size ) ; return new ProgressBarWrappedSpliterator < > ( sp , pbb . build ( ) ) ; |
public class CmsColor { /** * Sets the Red , Green , and Blue color variables . < p >
* @ param red valid range is 0-255
* @ param green valid range is 0-255
* @ param blue valid range is 0-255
* @ throws java . lang . Exception if something goes wrong */
public void setRGB ( int red , int green , int blue ) th... | if ( ( red < 0 ) || ( red > 255 ) ) { throw new Exception ( ) ; } if ( ( green < 0 ) || ( green > 255 ) ) { throw new Exception ( ) ; } if ( ( blue < 0 ) || ( blue > 255 ) ) { throw new Exception ( ) ; } m_red = ( float ) red / 255 ; m_green = ( float ) green / 255 ; m_blue = ( float ) blue / 255 ; RGBtoHSV ( m_red , m... |
public class Alerts { /** * 获取 { @ link Alert } 对象 , modality默认为 { @ link Modality # APPLICATION _ MODAL } , window默认为null , style默认为 { @ link
* StageStyle # DECORATED }
* @ param title 标题
* @ param header 信息头
* @ param content 内容
* @ param alertType { @ link AlertType }
* @ return { @ link Alert } */
publi... | return getAlert ( title , header , content , alertType , Modality . APPLICATION_MODAL , null , StageStyle . DECORATED ) ; |
public class PopupMenuMouseListener { /** * Called to display the popup menu . */
protected void showPopupMenu ( MouseEvent e ) { } } | if ( onAboutToShow ( e ) ) { JPopupMenu popupToShow = getPopupMenu ( e ) ; if ( popupToShow == null ) { return ; } popupToShow . show ( e . getComponent ( ) , e . getX ( ) , e . getY ( ) ) ; popupToShow . setVisible ( true ) ; } |
public class D6JavaModelGen4MySQL { /** * [ EN ] generate model class text < br >
* @ param dbDefinition
* @ return */
public String generateModelClass ( DBDefinition dbDefinition ) { } } | StringGrabber sgOutputModelCalssText = new StringGrabber ( ) ; sgOutputModelCalssText . append ( "@DBTable(tableName=" + DQ + dbDefinition . dbTableName + DQ + ")" ) ; sgOutputModelCalssText . newLine ( ) ; sgOutputModelCalssText . append ( "public class " + dbDefinition . javaClassName + " implements D6Model" ) ; sgOu... |
public class PermissionEvaluator { /** * boolean overloaded form of checkAuthenticatedAccount ( permission ) */
public boolean isSecuredByPermission ( final String permission , UserIdentityContext userIdentityContext ) { } } | try { checkPermission ( permission , userIdentityContext ) ; return true ; } catch ( AuthorizationException e ) { return false ; } |
public class WSJdbcObject { /** * Initialize the parent wrapper field and copy some fields from the parent wrapper .
* @ param parent the parent wrapper , or NULL if initializing a connection wrapper . */
final void init ( WSJdbcObject parent ) { } } | if ( parent != null ) { parentWrapper = parent ; dsConfig = parent . dsConfig ; freeResourcesOnClose = parent . freeResourcesOnClose ; } if ( freeResourcesOnClose ) // then initialize data structures to track them
{ arrays = new LinkedList < Array > ( ) ; blobs = new LinkedList < Blob > ( ) ; clobs = new LinkedList < C... |
public class AbstractSpringBeanDefinitionParser { /** * < p > addPropertyReferenceFromElement . < / p >
* @ param id a { @ link java . lang . String } object .
* @ param element a { @ link org . w3c . dom . Element } object .
* @ param bean a { @ link org . springframework . beans . factory . support . BeanDefini... | String beanElement = element . getAttribute ( id ) ; bean . addPropertyReference ( id , beanElement ) ; |
public class CLARANS { /** * Cluster a new instance .
* @ param x a new instance .
* @ return the cluster label , which is the index of nearest medoid . */
@ Override public int predict ( T x ) { } } | double minDist = Double . MAX_VALUE ; int bestCluster = 0 ; for ( int i = 0 ; i < k ; i ++ ) { double dist = distance . d ( x , medoids [ i ] ) ; if ( dist < minDist ) { minDist = dist ; bestCluster = i ; } } return bestCluster ; |
public class CPAttachmentFileEntryPersistenceImpl { /** * Returns all the cp attachment file entries where classNameId = & # 63 ; and classPK = & # 63 ; and type = & # 63 ; and status = & # 63 ; .
* @ param classNameId the class name ID
* @ param classPK the class pk
* @ param type the type
* @ param status the... | return findByC_C_T_ST ( classNameId , classPK , type , status , QueryUtil . ALL_POS , QueryUtil . ALL_POS , null ) ; |
public class ContentSpecParser { /** * Checks to see if a line is represents a Content Specifications Level Front Matter .
* @ param line The line to be checked .
* @ return True if the line is a front matter declaration , otherwise false . */
protected boolean isLevelInitialContentLine ( String line ) { } } | final Matcher matcher = LEVEL_INITIAL_CONTENT_PATTERN . matcher ( line . trim ( ) . toUpperCase ( Locale . ENGLISH ) ) ; return matcher . find ( ) ; |
public class CPDefinitionOptionRelLocalServiceBaseImpl { /** * Returns a range of all the cp definition option rels .
* Useful when paginating results . Returns a maximum of < code > end - start < / code > instances . < code > start < / code > and < code > end < / code > are not primary keys , they are indexes in the... | return cpDefinitionOptionRelPersistence . findAll ( start , end ) ; |
public class DisposeModule { /** * { @ inheritDoc } */
@ Override protected void configure ( ) { } } | final Disposer disposer = new Disposer ( ) ; bind ( Disposer . class ) . toInstance ( disposer ) ; bindListener ( getTypeMatcher ( ) , new AbstractMethodTypeListener ( getAnnotationType ( ) ) { @ Override protected < I > void hear ( final Method disposeMethod , TypeEncounter < I > encounter ) { encounter . register ( n... |
public class Similarity { /** * Computes the Average Common Feature Rank between the two feature arrays .
* Uses the top 20 features for comparison . Converts types and calls
* averageCommonFeatureRank ( Vector , Vector )
* @ throws IllegalArgumentException when the length of the two vectors are
* not the same ... | return averageCommonFeatureRank ( Vectors . asVector ( a ) , Vectors . asVector ( b ) ) ; |
public class SerialCom { /** * / * ( non - Javadoc )
* @ see javax . microedition . io . InputConnection # openDataInputStream ( ) */
DataInputStream openDataInputStream ( ) { } } | final InputStream is = getInputStream ( ) ; if ( is instanceof DataInputStream ) { return ( DataInputStream ) is ; } return new DataInputStream ( is ) ; |
public class CoreBuildFilterJdbcRepository { /** * The fat join query ( dreaming of Neo4J ) defines the following columns :
* < pre >
* B ( BUILDS )
* PR ( PROMOTION _ RUNS )
* PL ( PROMOTION _ LEVELS )
* S ( last validation run status )
* VALIDATIONSTAMPID
* VALIDATIONRUNSTATUSID
* PP ( PROPERTIES )
... | // Query root
StringBuilder tables = new StringBuilder ( "SELECT DISTINCT(B.ID) FROM BUILDS B " ) ; // Criterias
StringBuilder criteria = new StringBuilder ( " WHERE B.BRANCHID = :branch" ) ; // Parameters
MapSqlParameterSource params = new MapSqlParameterSource ( "branch" , branch . id ( ) ) ; Integer sinceBuildId = n... |
public class DatasourceTemplate { /** * Execute a query that returns a single int field . */
public int queryForInt ( String sql ) throws SQLException { } } | Number number = queryForObject ( sql , Integer . class ) ; return ( number != null ? number . intValue ( ) : 0 ) ; |
public class HttpRequest { /** * 设置请求方法
* @ param method HTTP方法
* @ return HttpRequest */
public HttpRequest method ( Method method ) { } } | if ( Method . PATCH == method ) { this . method = Method . POST ; this . header ( "X-HTTP-Method-Override" , "PATCH" ) ; } else { this . method = method ; } return this ; |
public class BandedLinearAligner { /** * Alignment which identifies what is the highly similar part of the both sequences .
* < p > Alignment is done in the way that beginning of second sequences is aligned to beginning of first
* sequence . < / p >
* < p > Alignment terminates when score in banded alignment matr... | try { int minLength = Math . min ( length1 , length2 ) + width + 1 ; length1 = Math . min ( length1 , minLength ) ; length2 = Math . min ( length2 , minLength ) ; MutationsBuilder < NucleotideSequence > mutations = new MutationsBuilder < > ( NucleotideSequence . ALPHABET ) ; BandedSemiLocalResult result = alignSemiLoca... |
public class PdfDocument { /** * Writes the outline tree to the body of the PDF document . */
void writeOutlines ( ) throws IOException { } } | if ( rootOutline . getKids ( ) . size ( ) == 0 ) return ; outlineTree ( rootOutline ) ; writer . addToBody ( rootOutline , rootOutline . indirectReference ( ) ) ; |
public class AbatisService { /** * Convert value object to sanitized SQL string
* @ param value - the value object
* @ return a string for use in an SQL statement
* @ author Toby Kurien */
public String toSqlString ( Object value ) { } } | if ( value == null ) { return "null" ; } String val = String . valueOf ( value ) ; if ( value instanceof Integer || value instanceof Float || value instanceof Double || value instanceof Long ) { return val ; } else if ( value instanceof Boolean ) { return "'" + ( ( Boolean ) value ? "true" : "false" ) + "'" ; } else if... |
public class Matrix3d { /** * Set the three columns of this matrix to the supplied vectors , respectively .
* @ param col0
* the first column
* @ param col1
* the second column
* @ param col2
* the third column
* @ return this */
public Matrix3d set ( Vector3dc col0 , Vector3dc col1 , Vector3dc col2 ) { }... | this . m00 = col0 . x ( ) ; this . m01 = col0 . y ( ) ; this . m02 = col0 . z ( ) ; this . m10 = col1 . x ( ) ; this . m11 = col1 . y ( ) ; this . m12 = col1 . z ( ) ; this . m20 = col2 . x ( ) ; this . m21 = col2 . y ( ) ; this . m22 = col2 . z ( ) ; return this ; |
public class Index { /** * Get several objects from this index
* @ param objectIDs the array of unique identifier of objects to retrieve
* @ param attributesToRetrieve contains the list of attributes to retrieve . */
public JSONObject getObjects ( List < String > objectIDs , List < String > attributesToRetrieve ) t... | return this . getObjects ( objectIDs , attributesToRetrieve , RequestOptions . empty ) ; |
public class DescribeProvisioningParametersRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( DescribeProvisioningParametersRequest describeProvisioningParametersRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( describeProvisioningParametersRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( describeProvisioningParametersRequest . getAcceptLanguage ( ) , ACCEPTLANGUAGE_BINDING ) ; protocolMarshaller . marshall ( describeProvisioningPara... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.