signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class ModifyReplicationGroupShardConfigurationRequest { /** * Specifies the preferred availability zones for each node group in the cluster . If the value of
* < code > NodeGroupCount < / code > is greater than the current number of node groups ( shards ) , you can use this
* parameter to specify the preferr... | if ( reshardingConfiguration == null ) { reshardingConfiguration = new com . amazonaws . internal . SdkInternalList < ReshardingConfiguration > ( ) ; } return reshardingConfiguration ; |
public class DefaultGroovyMethods { /** * A convenience method for creating an immutable sorted map .
* @ param self a SortedMap
* @ return an immutable SortedMap
* @ see java . util . Collections # unmodifiableSortedMap ( java . util . SortedMap )
* @ since 1.0 */
public static < K , V > SortedMap < K , V > as... | return Collections . unmodifiableSortedMap ( self ) ; |
public class UDPBufferFactory { /** * Get a reference to the singleton instance of this class .
* @ return UDPBufferFactory */
public static UDPBufferFactory getRef ( ) { } } | if ( null == ofInstance ) { synchronized ( UDPBufferFactory . class ) { if ( null == ofInstance ) { ofInstance = new UDPBufferFactory ( ) ; } } } return ofInstance ; |
public class XMLUtils { /** * Gets the index of the longest NCName that is the suffix of a character
* sequence .
* @ param s
* The character sequence .
* @ return The index of the longest suffix of the specified character
* sequence { @ code s } that is an NCName , or - 1 if the character
* sequence { @ co... | // identify bnode labels and do not try to split them
if ( s . length ( ) > 1 && s . charAt ( 0 ) == '_' && s . charAt ( 1 ) == ':' ) { return - 1 ; } int index = - 1 ; for ( int i = s . length ( ) - 1 ; i > - 1 ; i -- ) { if ( ! Character . isLowSurrogate ( s . charAt ( i ) ) ) { int codePoint = Character . codePointA... |
public class ResultCache { /** * replace an cache entry */
void put ( int numberOfParagraph , int startOfSentencePosition , int nextSentencePosition , SingleProofreadingError [ ] errorArray ) { } } | remove ( numberOfParagraph , startOfSentencePosition ) ; add ( numberOfParagraph , startOfSentencePosition , nextSentencePosition , errorArray ) ; |
public class CommerceOrderPersistenceImpl { /** * Returns an ordered range of all the commerce orders where userId = & # 63 ; and createDate & lt ; & # 63 ; and orderStatus = & # 63 ; .
* Useful when paginating results . Returns a maximum of < code > end - start < / code > instances . < code > start < / code > and < ... | boolean pagination = true ; FinderPath finderPath = null ; Object [ ] finderArgs = null ; finderPath = FINDER_PATH_WITH_PAGINATION_FIND_BY_U_LTC_O ; finderArgs = new Object [ ] { userId , _getTime ( createDate ) , orderStatus , start , end , orderByComparator } ; List < CommerceOrder > list = null ; if ( retrieveFromCa... |
public class Cooccurrence { /** * setter for secondIds - sets a list of string ids to identify the second occurrence
* @ generated
* @ param v value to set into the feature */
public void setSecondIds ( StringArray v ) { } } | if ( Cooccurrence_Type . featOkTst && ( ( Cooccurrence_Type ) jcasType ) . casFeat_secondIds == null ) jcasType . jcas . throwFeatMissing ( "secondIds" , "ch.epfl.bbp.uima.types.Cooccurrence" ) ; jcasType . ll_cas . ll_setRefValue ( addr , ( ( Cooccurrence_Type ) jcasType ) . casFeatCode_secondIds , jcasType . ll_cas .... |
public class VirtualNetworkLinksInner { /** * Creates or updates a virtual network link to the specified Private DNS zone .
* @ param resourceGroupName The name of the resource group .
* @ param privateZoneName The name of the Private DNS zone ( without a terminating dot ) .
* @ param virtualNetworkLinkName The n... | return beginCreateOrUpdateWithServiceResponseAsync ( resourceGroupName , privateZoneName , virtualNetworkLinkName , parameters , ifMatch , ifNoneMatch ) . toBlocking ( ) . single ( ) . body ( ) ; |
public class MicroserviceAccess { /** * Walks through all activities looking for the attribute . */
public String getServiceSummaryVariableName ( Process processDefinition ) { } } | for ( Activity activity : processDefinition . getActivities ( ) ) { String attr = activity . getAttribute ( "serviceSummaryVariable" ) ; if ( attr != null ) return attr ; } return null ; |
public class DomainDetailsMarshaller { /** * Marshall the given parameter object . */
public void marshall ( DomainDetails domainDetails , ProtocolMarshaller protocolMarshaller ) { } } | if ( domainDetails == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class CFIImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public void eUnset ( int featureID ) { } } | switch ( featureID ) { case AfplibPackage . CFI__FIXED_LENGTH_RG : getFixedLengthRG ( ) . clear ( ) ; return ; } super . eUnset ( featureID ) ; |
public class Log { /** * Send an INFO message .
* @ param tag Used to identify the source of a log message . It usually identifies
* the class or activity where the log call occurs .
* @ param msg The message you would like logged . */
public static void i ( String tag , String msg ) { } } | if ( logger != null && isLoggingEnabled ( tag , INFO ) ) { logger . i ( tag , msg ) ; } |
public class RequestUtils { /** * Returns value of ID if one is present on a URL . Id is usually a part of a URI , such as : < code > / controller / action / id < / code > .
* This depends on a type of a URI , and whether controller is RESTful or not .
* @ return ID value from URI is one exists , null if not . */
p... | String paramId = RequestContext . getHttpRequest ( ) . getParameter ( "id" ) ; if ( paramId != null && RequestContext . getHttpRequest ( ) . getAttribute ( "id" ) != null ) { LOGGER . warn ( "WARNING: probably you have 'id' supplied both as a HTTP parameter, as well as in the URI. Choosing parameter over URI value." ) ... |
public class N { /** * Returns a { @ code Nullable } with value returned by { @ code func . apply ( init ) } if { @ code b } is { @ code true } ,
* otherwise returns an empty { @ code Nullable } if { @ code b } is false .
* @ param b
* @ param init
* @ param func
* @ return
* @ throws E */
public static < T... | if ( b ) { return Nullable . of ( func . apply ( init ) ) ; } else { return Nullable . empty ( ) ; } |
public class HttpResponseMessageImpl { /** * Read an instance of this object from the input stream .
* @ param input
* @ throws IOException
* @ throws ClassNotFoundException */
@ Override public void readExternal ( ObjectInput input ) throws IOException , ClassNotFoundException { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "De-serializing into: " + this ) ; } super . readExternal ( input ) ; if ( SERIALIZATION_V2 == getDeserializationVersion ( ) ) { setStatusCode ( input . readShort ( ) ) ; } else { setStatusCode ( input . readInt ( ) ) ; } set... |
public class ListDirectoriesResult { /** * Lists all directories that are associated with your account in pagination fashion .
* @ param directories
* Lists all directories that are associated with your account in pagination fashion . */
public void setDirectories ( java . util . Collection < Directory > directorie... | if ( directories == null ) { this . directories = null ; return ; } this . directories = new java . util . ArrayList < Directory > ( directories ) ; |
public class IterableExtensions { /** * Returns an Iterable containing all elements starting from the head of the source up to and excluding the first
* element that violates the predicate The resulting Iterable is a lazily computed view , so any modifications to the
* underlying Iterables will be reflected on subs... | if ( iterable == null ) throw new NullPointerException ( "iterable" ) ; if ( predicate == null ) throw new NullPointerException ( "predicate" ) ; return new Iterable < T > ( ) { @ Override public Iterator < T > iterator ( ) { return IteratorExtensions . takeWhile ( iterable . iterator ( ) , predicate ) ; } } ; |
public class MtasCodec { /** * ( non - Javadoc )
* @ see org . apache . lucene . codecs . Codec # postingsFormat ( ) */
@ Override public PostingsFormat postingsFormat ( ) { } } | initDelegate ( ) ; if ( delegate . postingsFormat ( ) instanceof PerFieldPostingsFormat ) { Codec defaultCodec = Codec . getDefault ( ) ; PostingsFormat defaultPostingsFormat = defaultCodec . postingsFormat ( ) ; if ( defaultPostingsFormat instanceof PerFieldPostingsFormat ) { defaultPostingsFormat = ( ( PerFieldPostin... |
public class AmazonS3Client { /** * Returns the URL to the key in the bucket given , using the client ' s scheme
* and endpoint . Returns null if the given bucket and key cannot be
* converted to a URL . */
public String getResourceUrl ( String bucketName , String key ) { } } | try { return getUrl ( bucketName , key ) . toString ( ) ; } catch ( Exception e ) { return null ; } |
public class MacUtils { /** * Return the overridden MAC address , if the system property
* OVERRIDE _ MAC _ PROP has been set . If the value of the property isn ' t a
* valid MAC address or it was not set , then null is returned . */
public static byte [ ] getOverride ( ) { } } | String overrideMac = System . getProperty ( OVERRIDE_MAC_PROP ) ; byte [ ] macBytes = null ; if ( overrideMac != null ) { ByteArrayOutputStream out = new ByteArrayOutputStream ( ) ; String [ ] rawBytes = overrideMac . split ( ":" ) ; if ( rawBytes . length == 6 ) { try { for ( String b : rawBytes ) { out . write ( Inte... |
public class SocketExporterLegacy { /** * Connect to a single server with retry . Limited exponential backoff .
* No timeout . This will run until the process is killed if it ' s not
* able to connect .
* @ param server hostname : port or just hostname ( hostname can be ip ) .
* @ throws IOException */
static O... | try { Socket pushSocket = new Socket ( server , port ) ; OutputStream out = pushSocket . getOutputStream ( ) ; m_logger . info ( "Connected to export endpoint node at: " + server + ":" + port ) ; return out ; } catch ( UnknownHostException e ) { m_logger . rateLimitedLog ( 120 , Level . ERROR , e , "Don't know about ho... |
public class ResourceTagsMarshaller { /** * Marshall the given parameter object . */
public void marshall ( ResourceTags resourceTags , ProtocolMarshaller protocolMarshaller ) { } } | if ( resourceTags == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( resourceTags . getArn ( ) , ARN_BINDING ) ; protocolMarshaller . marshall ( resourceTags . getTags ( ) , TAGS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientExcep... |
public class CryptoPrimitives { /** * validateCertificate checks whether the given certificate is trusted . It
* checks if the certificate is signed by one of the trusted certs in the
* trust store .
* @ param certPEM the certificate in PEM format
* @ return true if the certificate is trusted */
boolean validat... | if ( certPEM == null ) { return false ; } try { X509Certificate certificate = getX509Certificate ( certPEM ) ; if ( null == certificate ) { throw new Exception ( "Certificate transformation returned null" ) ; } return validateCertificate ( certificate ) ; } catch ( Exception e ) { logger . error ( "Cannot validate cert... |
public class RhinoEngine { /** * / * ( non - Javadoc )
* @ see minium . script . rhinojs . JsEngine # get ( java . lang . String , java . lang . Class ) */
@ Override @ SuppressWarnings ( "unchecked" ) public < T > T get ( final String varName , Class < T > clazz ) { } } | return ( T ) get ( varName ) ; |
public class ParserDQL { /** * < numeric primary > < charactr primary > < binary primary > < datetime primary > < interval primary > */
Expression XreadAllTypesPrimary ( boolean boole ) { } } | Expression e = null ; switch ( token . tokenType ) { case Tokens . SUBSTRING : case Tokens . SUBSTRING_REGEX : case Tokens . LOWER : case Tokens . UPPER : case Tokens . TRANSLATE_REGEX : case Tokens . TRIM : case Tokens . OVERLAY : case Tokens . NORMALIZE : case Tokens . POSITION : case Tokens . OCCURRENCES_REGEX : cas... |
public class UnitResponse { /** * create a new timed out unit response .
* @ param dataOrException the data or exception object .
* @ param errMsg the error message .
* @ return the newly created unit response object . */
public static UnitResponse createTimeout ( Object dataOrException , String errMsg ) { } } | return new UnitResponse ( ) . setCode ( Group . CODE_TIME_OUT ) . setData ( dataOrException ) . setMessage ( errMsg ) ; |
public class RemoteDomainConnectionService { /** * Analyzes a failure thrown connecting to the master for causes that indicate
* some problem not likely to be resolved by immediately retrying . If found ,
* throws an exception highlighting the underlying cause . If the cause is not
* one of the ones understood by... | Throwable cause = e ; while ( ( cause = cause . getCause ( ) ) != null ) { if ( cause instanceof SaslException ) { throw HostControllerLogger . ROOT_LOGGER . authenticationFailureUnableToConnect ( cause ) ; } else if ( cause instanceof SSLHandshakeException ) { throw HostControllerLogger . ROOT_LOGGER . sslFailureUnabl... |
public class ToLongBiFunctionBuilder { /** * One of ways of creating builder . This might be the only way ( considering all _ functional _ builders ) that might be utilize to specify generic params only once . */
@ Nonnull public static < T1 , T2 > ToLongBiFunctionBuilder < T1 , T2 > toLongBiFunction ( Consumer < ToLon... | return new ToLongBiFunctionBuilder ( consumer ) ; |
public class OtpConnection { /** * Send a pre - encoded message to a named process on a remote node .
* @ param dest
* the name of the remote process .
* @ param payload
* the encoded message to send .
* @ exception java . io . IOException
* if the connection is not active or a communication error
* occur... | super . sendBuf ( self . pid ( ) , dest , payload ) ; |
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public EClass getIfcTextLiteral ( ) { } } | if ( ifcTextLiteralEClass == null ) { ifcTextLiteralEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 711 ) ; } return ifcTextLiteralEClass ; |
public class N { /** * Note : All the objects with same value will be replaced with first element with the same value .
* @ param c
* @ param fromIndex
* @ param toIndex */
public static < T extends Comparable < T > > void bucketSort ( final List < T > c , final int fromIndex , final int toIndex ) { } } | Array . bucketSort ( c , fromIndex , toIndex ) ; |
public class RosterExchange { /** * Returns the XML representation of a Roster Item Exchange according the specification .
* Usually the XML representation will be inside of a Message XML representation like
* in the following example :
* < pre >
* & lt ; message id = " MlIpV - 4 " to = " gato1 @ gato . home " ... | StringBuilder buf = new StringBuilder ( ) ; buf . append ( '<' ) . append ( getElementName ( ) ) . append ( " xmlns=\"" ) . append ( getNamespace ( ) ) . append ( "\">" ) ; // Loop through all roster entries and append them to the string buffer
for ( Iterator < RemoteRosterEntry > i = getRosterEntries ( ) ; i . hasNext... |
public class LogMetadata { /** * Creates a new instance of the LogMetadata class which contains all the ledgers after ( and including ) the given address .
* @ param upToAddress The address to truncate to .
* @ return A new instance of the LogMetadata class . */
LogMetadata truncate ( LedgerAddress upToAddress ) { ... | Preconditions . checkState ( this . enabled , "Log is not enabled. Cannot perform any modifications on it." ) ; // Exclude all those Ledgers that have a LedgerId less than the one we are given . An optimization to this would
// involve trimming out the ledger which has a matching ledger id and the entry is is the last ... |
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public EClass getIfcRelProjectsElement ( ) { } } | if ( ifcRelProjectsElementEClass == null ) { ifcRelProjectsElementEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 479 ) ; } return ifcRelProjectsElementEClass ; |
public class Packager { /** * Return a container which holds all the boxes in the argument
* @ param boxes list of boxes to fit in a container
* @ param deadline the system time in millis at which the search should be aborted
* @ return index of container if match , - 1 if not */
public Container pack ( List < Bo... | return pack ( boxes , filterByVolumeAndWeight ( toBoxes ( boxes , false ) , Arrays . asList ( containers ) , 1 ) , deadLinePredicate ( deadline ) ) ; |
public class ExpressRouteCircuitsInner { /** * Creates or updates an express route circuit .
* @ param resourceGroupName The name of the resource group .
* @ param circuitName The name of the circuit .
* @ param parameters Parameters supplied to the create or update express route circuit operation .
* @ throws ... | return createOrUpdateWithServiceResponseAsync ( resourceGroupName , circuitName , parameters ) . toBlocking ( ) . last ( ) . body ( ) ; |
public class FileTransferHandlerVaadinUpload { /** * Upload started for { @ link Upload } variant .
* @ see com . vaadin . ui . Upload . StartedListener # uploadStarted ( com . vaadin . ui . Upload . StartedEvent ) */
@ Override public void uploadStarted ( final StartedEvent event ) { } } | // reset internal state here because instance is reused for next upload !
resetState ( ) ; final SoftwareModule softwareModule = getSelectedSoftwareModule ( ) ; this . fileUploadId = new FileUploadId ( event . getFilename ( ) , softwareModule ) ; if ( getUploadState ( ) . isFileInUploadState ( this . fileUploadId ) ) {... |
public class RomanticActionCustomizer { protected ActionExecute createActionExecute ( ActionMapping actionMapping , Method executeMethod ) { } } | final Execute anno = getExecuteAnnotation ( executeMethod ) ; // exists , already checked
final ExecuteOption executeOption = createExecuteOption ( anno ) ; return newActionExecute ( actionMapping , executeMethod , executeOption ) ; |
public class AddOnResult { /** * Create a AddOnResultFetcher to execute fetch .
* @ param pathAccountSid The SID of the Account that created the resource to
* fetch
* @ param pathReferenceSid The SID of the recording to which the result to
* fetch belongs
* @ param pathSid The unique string that identifies th... | return new AddOnResultFetcher ( pathAccountSid , pathReferenceSid , pathSid ) ; |
public class SaxonServlet { /** * Initialize the servlet by setting up the stylesheet cache , the http
* connection manager , and configuring credentials for the http client . */
@ Override public void init ( ServletConfig config ) throws ServletException { } } | m_cache = new HashMap < String , Templates > ( ) ; m_creds = new HashMap < String , UsernamePasswordCredentials > ( ) ; m_cManager = new PoolingClientConnectionManager ( ) ; m_cManager . getSchemeRegistry ( ) . register ( new Scheme ( "https" , 443 , SSLSocketFactory . getSocketFactory ( ) ) ) ; m_cManager . getSchemeR... |
public class CmsToolbar { /** * Returns all { @ link com . google . gwt . user . client . ui . Widget } added to the tool - bar in order of addition first left than right . < p >
* @ return all added Widgets */
public List < Widget > getAll ( ) { } } | List < Widget > all = new ArrayList < Widget > ( ) ; Iterator < Widget > it = m_buttonPanelLeft . iterator ( ) ; while ( it . hasNext ( ) ) { all . add ( it . next ( ) ) ; } it = m_buttonPanelRight . iterator ( ) ; while ( it . hasNext ( ) ) { all . add ( it . next ( ) ) ; } return all ; |
public class MultiMEProxyHandler { /** * removeUnusedNeighbours is called once all the Neighbours are defined from Admin .
* This will generate the reset state method to be sent to all Neighbouring
* ME ' s
* Also , this will check all Neighbours and ensure that they are all still
* valid and remove those that ... | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "removeUnusedNeighbours" ) ; final Enumeration neighbourList = _neighbours . getAllRecoveredNeighbours ( ) ; LocalTransaction transaction = null ; try { _lockManager . lockExclusive ( ) ; transaction = _transactionManager . ... |
public class RepositoryFinderMongo { /** * { @ inheritDoc } */
@ SuppressWarnings ( "unchecked" ) @ Override public < T extends GedObject > Collection < T > find ( final FinderObject owner , final Class < T > clazz ) { } } | logger . info ( "Starting find all of type" ) ; if ( ! ( owner instanceof Root ) ) { throw new IllegalArgumentException ( "Owner must be root" ) ; } final FindableDocument < ? extends GedObject , ? extends GedDocument < ? > > repo = repositoryManager . get ( clazz ) ; if ( repo == null ) { return null ; } final RootDoc... |
public class UIViewRoot { /** * Adds a The phaseListeners attached to ViewRoot . */
public void addPhaseListener ( PhaseListener phaseListener ) { } } | if ( phaseListener == null ) { throw new NullPointerException ( "phaseListener" ) ; } getStateHelper ( ) . add ( PropertyKeys . phaseListeners , phaseListener ) ; |
public class Symm { /** * Note : AES Encryption is NOT thread - safe . Must surround entire use with synchronized */
private synchronized void exec ( AESExec exec ) throws IOException { } } | if ( aes == null ) { try { byte [ ] bytes = new byte [ AES . AES_KEY_SIZE / 8 ] ; int offset = ( Math . abs ( codeset [ 0 ] ) + 47 ) % ( codeset . length - bytes . length ) ; for ( int i = 0 ; i < bytes . length ; ++ i ) { bytes [ i ] = ( byte ) codeset [ i + offset ] ; } aes = new AES ( bytes , 0 , bytes . length ) ; ... |
public class CachedConnectionManagerImpl { /** * { @ inheritDoc } */
public Map < String , String > listConnections ( ) { } } | if ( ! debug ) return Collections . unmodifiableMap ( Collections . EMPTY_MAP ) ; synchronized ( connectionStackTraces ) { Map < String , String > result = new HashMap < String , String > ( ) ; for ( Map . Entry < Object , Throwable > entry : connectionStackTraces . entrySet ( ) ) { Object key = entry . getKey ( ) ; Th... |
public class CreateOTAUpdateRequest { /** * A list of additional OTA update parameters which are name - value pairs .
* @ param additionalParameters
* A list of additional OTA update parameters which are name - value pairs .
* @ return Returns a reference to this object so that method calls can be chained togethe... | setAdditionalParameters ( additionalParameters ) ; return this ; |
public class AsynchronousRequest { /** * For more info on Currency API go < a href = " https : / / wiki . guildwars2 . com / wiki / API : 2 / currencies " > here < / a > < br / >
* Give user the access to { @ link Callback # onResponse ( Call , Response ) } and { @ link Callback # onFailure ( Call , Throwable ) } met... | gw2API . getAllCurrencies ( ) . enqueue ( callback ) ; |
public class AbcTuneBook { /** * Saves the ABC source String to file .
* @ param file
* @ throws IOException */
public void saveTo ( File file ) throws IOException { } } | FileWriter writer = new FileWriter ( file ) ; try { writer . write ( getAbcString ( ) ) ; } finally { writer . close ( ) ; } |
public class OperaStrings { /** * Checks whether given string has a double value .
* @ param string the string to check
* @ return true if string resembles a double value , false otherwise */
public static boolean isDouble ( String string ) { } } | if ( string == null ) { return false ; } try { Double . parseDouble ( string ) ; } catch ( NumberFormatException e ) { return false ; } return true ; |
public class PrincipalUser { /** * / * Method provided to be called using reflection to discretely create the admin user if needed . */
private static PrincipalUser createDefaultUser ( ) { } } | PrincipalUser result = new PrincipalUser ( "default" , "default@default.com" ) ; result . id = BigInteger . valueOf ( 2 ) ; result . setPrivileged ( false ) ; return result ; |
public class ReportUtil { /** * Write a report object to an output stream
* @ param report
* report object
* @ param out
* output stream */
public static void saveReport ( Report report , OutputStream out ) { } } | XStream xstream = XStreamFactory . createXStream ( ) ; xstream . toXML ( report , out ) ; |
public class Property { /** * Returns an annotation < em > collectively present < / em > on this property ' s members , else { @ code null } .
* @ param < T > the type of the annotation to query for and return , if collectively present
* @ param annotationClass the Class object corresponding to the annotation type ... | if ( annotationClass == null ) { throw new NullPointerException ( "Cannot get an annotation with a 'null' annotationClass." ) ; } return annotationClass . cast ( annotations . get ( annotationClass ) ) ; |
public class MavenDependencies { /** * Creates a new { @ link MavenDependency } instance
* @ param coordinate A coordinate of the new { @ link MavenDependency } instance .
* @ param scope A scope of the new { @ link MavenDependency } instance . Default will be { @ link ScopeType # COMPILE } .
* @ param optional W... | assert coordinate != null : "coordinate must be specified" ; assert exclusions != null : "exclusions must be specified" ; try { return ctor . newInstance ( coordinate , scope , optional , exclusions ) ; } catch ( final Exception e ) { throw new RuntimeException ( "Could not create new " + MavenDependency . class . getS... |
public class BELUtilities { /** * Inserts the platform - specific filesystem path separator between
* { @ code directory } and { @ code filename } and returns the resulting string .
* @ param directory Non - null string
* @ param filename Non - null string
* @ return String following the format
* { @ code dir... | return directory . concat ( separator ) . concat ( filename ) ; |
public class ReadabilityStatistics { /** * Returns the Spache Score of the text .
* @ param strText
* @ return */
public static double spacheScore ( String strText ) { } } | // http : / / simple . wikipedia . org / wiki / Spache _ Readability _ Formula
strText = cleanText ( strText ) ; int intUniqueUnfamiliarWordCount = 0 ; Set < String > arrWords = new HashSet < > ( ( new WhitespaceTokenizer ( ) ) . tokenize ( strText ) ) ; for ( String word : arrWords ) { if ( ! SPACHE_WORDLIST . contain... |
public class StompServer { /** * Stop this server .
* @ throws Exception
* @ throws Throwable */
public synchronized void stop ( ) throws Exception { } } | if ( ! running ) { return ; } for ( Connector each : this . connectors ) { try { each . stop ( ) ; each . setServer ( null ) ; } catch ( Exception e ) { // ignore
} } running = false ; |
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public EClass getIfcFireSuppressionTerminal ( ) { } } | if ( ifcFireSuppressionTerminalEClass == null ) { ifcFireSuppressionTerminalEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 273 ) ; } return ifcFireSuppressionTerminalEClass ; |
public class HttpResponseImpl { /** * @ see com . ibm . websphere . http . HttpResponse # getHeaders ( ) */
@ Override public List < String > getHeaders ( ) { } } | List < HeaderField > hdrs = this . message . getAllHeaders ( ) ; List < String > values = new ArrayList < String > ( hdrs . size ( ) ) ; for ( HeaderField header : hdrs ) { values . add ( header . getName ( ) ) ; } return values ; |
public class TemplateList { /** * Dump all patterns and elements that match those patterns */
void dumpAssociationTables ( ) { } } | Enumeration associations = m_patternTable . elements ( ) ; while ( associations . hasMoreElements ( ) ) { TemplateSubPatternAssociation head = ( TemplateSubPatternAssociation ) associations . nextElement ( ) ; while ( null != head ) { System . out . print ( "(" + head . getTargetString ( ) + ", " + head . getPattern ( ... |
public class ByteBufUtil { /** * Estimates the { @ link Xid } encoding size .
* If the instance is a { @ link RemoteXid } , the estimation is accurate . Otherwise , the max size is used .
* @ param xid the { @ link Xid } instance to test .
* @ return the estimated size . */
public static int estimateXidSize ( Xid... | if ( xid instanceof RemoteXid ) { return ( ( RemoteXid ) xid ) . estimateSize ( ) ; } else { // Worst case .
// To be more accurate , we need to invoke getGlobalTransactionId and getBranchQualifier that will most likely
// create and copy the array
return estimateVIntSize ( xid . getFormatId ( ) ) + Xid . MAXBQUALSIZE ... |
public class DatabaseAccess { /** * For unit tests only */
static ResultSet executeStatement ( SQL sql ) throws SQLException { } } | try ( SqlSession session = sqlSessionFactory . openSession ( true ) ) { try ( Connection conn = session . getConnection ( ) ) { try ( Statement stmt = conn . createStatement ( ) ) { return stmt . executeQuery ( sql . toString ( ) ) ; } } } |
public class Expressions { /** * Creates an BooleanIsNotEqual expression from the given expressions .
* @ param left The left expression .
* @ param right The right expression .
* @ return A new BooleanIsNotEqual binary expression . */
public static BooleanIsNotEqual isNotEqual ( ComparableExpression < Boolean > ... | return new BooleanIsNotEqual ( left , right ) ; |
public class LogContext { /** * Make the backend logging call . This is the point at which we have paid the price of creating a
* varargs array and doing any necessary auto - boxing . */
@ SuppressWarnings ( "ReferenceEquality" ) private void logImpl ( String message , Object ... args ) { } } | this . args = args ; // Evaluate any ( rare ) LazyArg instances early . This may throw exceptions from user code , but
// it seems reasonable to propagate them in this case ( they would have been thrown if the
// argument was evaluated at the call site anyway ) .
for ( int n = 0 ; n < args . length ; n ++ ) { if ( args... |
public class FilterFactories { /** * Creates a { @ link Filter } .
* A filter specification is of the form " package . of . FilterFactory = args - to - filter - factory " or
* " package . of . FilterFactory " .
* @ param request the request that will be filtered
* @ param filterSpec the filter specification
*... | Description topLevelDescription = request . getRunner ( ) . getDescription ( ) ; String [ ] tuple ; if ( filterSpec . contains ( "=" ) ) { tuple = filterSpec . split ( "=" , 2 ) ; } else { tuple = new String [ ] { filterSpec , "" } ; } return createFilter ( tuple [ 0 ] , new FilterFactoryParams ( topLevelDescription , ... |
public class PoolsImpl { /** * Deletes a pool from the specified account .
* When you request that a pool be deleted , the following actions occur : the pool state is set to deleting ; any ongoing resize operation on the pool are stopped ; the Batch service starts resizing the pool to zero nodes ; any tasks running o... | deleteWithServiceResponseAsync ( poolId , poolDeleteOptions ) . toBlocking ( ) . single ( ) . body ( ) ; |
public class RemoteRequest { /** * Prepare request */
protected Request request ( ) { } } | Request . Builder builder = new Request . Builder ( ) . url ( url ) ; builder = RequestUtils . preemptivelySetAuthCredentials ( builder , url , authenticator ) ; addHeaders ( builder ) ; setBody ( builder ) ; return builder . build ( ) ; |
public class MarkLogicClient { /** * TupleQuery
* @ param queryString
* @ param bindings
* @ param start
* @ param pageLength
* @ param includeInferred
* @ param baseURI
* @ return
* @ throws RepositoryException
* @ throws MalformedQueryException
* @ throws UnauthorizedException
* @ throws QueryIn... | InputStream stream = null ; try { stream = getClient ( ) . performSPARQLQuery ( queryString , bindings , start , pageLength , this . tx , includeInferred , baseURI ) ; } catch ( JsonProcessingException e ) { logger . error ( e . getLocalizedMessage ( ) ) ; throw new MarkLogicSesameException ( "Issue processing json." )... |
public class AllowedTag { /** * Determine if the body should be evaluated or not .
* @ return EVAL _ BODY _ INCLUDE if the body should be included , or SKIP _ BODY
* @ throws JspException when the tag cannot ( decide if to ) write the body content */
@ Override public int doStartTag ( ) throws JspException { } } | // Retrieve the action bean and event handler to secure .
ActionBean actionBean ; if ( bean == null ) { // Search in page , request , session ( if valid ) and application scopes , in that order .
actionBean = ( ActionBean ) pageContext . findAttribute ( StripesConstants . REQ_ATTR_ACTION_BEAN ) ; LOG . debug ( "Determi... |
public class UserConfigurationsCollection { /** * Gets configuration details .
* @ return the configuration details */
public synchronized Set < ConfigurationDetails > getConfigurationDetails ( ) { } } | return inventory . entries ( ) . stream ( ) . map ( c -> c . getConfiguration ( ) . orElse ( null ) ) . filter ( v -> v != null ) . map ( v -> v . getDetails ( ) ) . collect ( Collectors . toSet ( ) ) ; |
public class UniverseApi { /** * Get asteroid belt information Get information on an asteroid belt - - -
* This route expires daily at 11:05
* @ param asteroidBeltId
* asteroid _ belt _ id integer ( required )
* @ param datasource
* The server name you would like data from ( optional , default to
* tranquil... | ApiResponse < UniverseAsteroidBeltsResponse > resp = getUniverseAsteroidBeltsAsteroidBeltIdWithHttpInfo ( asteroidBeltId , datasource , ifNoneMatch ) ; return resp . getData ( ) ; |
public class GosuParserFactoryImpl { /** * Creates an IGosuParser appropriate for parsing and executing Gosu .
* @ param symTable The symbol table the parser uses to parse and execute script .
* @ return A parser appropriate for parsing Gosu source . */
public IGosuParser createParser ( ISymbolTable symTable , IScr... | IGosuParser parser = new GosuParser ( symTable , scriptabilityConstraint ) ; return parser ; |
public class AbstractHalProcessor { /** * As long as the processing isn ' t over { @ link # onProcess ( Set , RoundEnvironment ) } will be called , otherwise
* { @ link # onLastRound ( RoundEnvironment ) } will be called . If there ' s a { @ link GenerationException } thrown ,
* { @ link # onError ( GenerationExcep... | boolean result ; if ( ! roundEnv . processingOver ( ) ) { try { result = onProcess ( annotations , roundEnv ) ; } catch ( GenerationException e ) { onError ( e ) ; result = true ; } } else { try { result = onLastRound ( roundEnv ) ; } catch ( GenerationException e ) { onError ( e ) ; result = true ; } } round ++ ; retu... |
public class Engine { /** * Transforms a template into an expanded output using the given model .
* @ param template
* the template to expand
* @ param locale
* the locale being passed into renderers in
* { @ link TemplateContext }
* @ param sourceName
* the name of the current template ( if there is anyt... | return transformInternal ( template , locale , sourceName , model , getModelAdaptor ( ) , processListener ) ; |
public class DoublePersistedValueData { /** * { @ inheritDoc } */
public void writeExternal ( ObjectOutput out ) throws IOException { } } | out . writeInt ( orderNumber ) ; out . writeDouble ( value ) ; |
public class CPOptionCategoryLocalServiceWrapper { /** * Creates a new cp option category with the primary key . Does not add the cp option category to the database .
* @ param CPOptionCategoryId the primary key for the new cp option category
* @ return the new cp option category */
@ Override public com . liferay ... | return _cpOptionCategoryLocalService . createCPOptionCategory ( CPOptionCategoryId ) ; |
public class MainForm { /** * Write back to a File
* @ since 01.07.2006 */
private void writePropertyFile ( ) { } } | try { java . util . Properties props = new java . util . Properties ( ) ; MultimediaContainerManager . getContainerConfigs ( props ) ; props . setProperty ( PROPERTY_SEARCHPATH , searchPath ) ; props . setProperty ( PROPERTY_EXPORTPATH , exportPath ) ; props . setProperty ( PROPERTY_LOOKANDFEEL , uiClassName ) ; props ... |
public class StorageSnippets { /** * [ VARIABLE 42] */
public Bucket getBucketWithMetageneration ( String bucketName , long bucketMetageneration ) { } } | // [ START getBucketWithMetageneration ]
Bucket bucket = storage . get ( bucketName , BucketGetOption . metagenerationMatch ( bucketMetageneration ) ) ; // [ END getBucketWithMetageneration ]
return bucket ; |
public class QsAlignResult { /** * Map of Subunit equivalencies from the first to the second group .
* @ return an unmodifiable view of the original Map */
public Map < Integer , Integer > getSubunitMap ( ) { } } | if ( subunitMap == null ) return Collections . emptyMap ( ) ; return Collections . unmodifiableMap ( subunitMap ) ; |
public class ConnectionMonitorsInner { /** * Create or update a connection monitor .
* @ param resourceGroupName The name of the resource group containing Network Watcher .
* @ param networkWatcherName The name of the Network Watcher resource .
* @ param connectionMonitorName The name of the connection monitor . ... | return createOrUpdateWithServiceResponseAsync ( resourceGroupName , networkWatcherName , connectionMonitorName , parameters ) . toBlocking ( ) . last ( ) . body ( ) ; |
public class DynamoDbTicketRegistryFacilitator { /** * Gets all .
* @ return the all */
public Collection < Ticket > getAll ( ) { } } | val tickets = new ArrayList < Ticket > ( ) ; val metadata = this . ticketCatalog . findAll ( ) ; metadata . forEach ( r -> { val scan = new ScanRequest ( r . getProperties ( ) . getStorageName ( ) ) ; LOGGER . debug ( "Scanning table with request [{}]" , scan ) ; val result = this . amazonDynamoDBClient . scan ( scan )... |
public class AbstractAmazonDynamoDBAsync { /** * Simplified method form for invoking the BatchGetItem operation with an AsyncHandler .
* @ see # batchGetItemAsync ( BatchGetItemRequest , com . amazonaws . handlers . AsyncHandler ) */
@ Override public java . util . concurrent . Future < BatchGetItemResult > batchGetI... | return batchGetItemAsync ( new BatchGetItemRequest ( ) . withRequestItems ( requestItems ) . withReturnConsumedCapacity ( returnConsumedCapacity ) , asyncHandler ) ; |
public class DummyWorkspace { /** * This method notifies given Workspace that new use cycle is starting now
* @ return */
@ Override public MemoryWorkspace notifyScopeEntered ( ) { } } | parentWorkspace = Nd4j . getMemoryManager ( ) . getCurrentWorkspace ( ) ; Nd4j . getMemoryManager ( ) . setCurrentWorkspace ( null ) ; return this ; |
public class PooledPhynixxManagedConnectionFactory { /** * closes the current pool - if existing - and instanciates a new pool
* @ param cfg
* @ throws Exception */
public void setGenericPoolConfig ( GenericObjectPoolConfig cfg ) throws Exception { } } | if ( this . genericObjectPool != null ) { this . genericObjectPool . close ( ) ; } if ( cfg == null ) { cfg = new GenericObjectPoolConfig ( ) ; } this . genericObjectPool = new GenericObjectPool < IPhynixxManagedConnection < C > > ( new MyPoolableObjectFactory < C > ( this ) , cfg ) ; |
public class GreenPepperServerServiceImpl { /** * { @ inheritDoc } */
public List < Repository > getRequirementRepositoriesOfAssociatedProject ( String repositoryUid ) throws GreenPepperServerException { } } | try { sessionService . startSession ( ) ; Repository repository = loadRepository ( repositoryUid ) ; List < Repository > repositories = repositoryDao . getAllRequirementRepositories ( repository . getProject ( ) . getName ( ) ) ; log . debug ( "Retrieved Requirement Repositories Of Associated Project of " + repository ... |
public class SourcePrinter { /** * visit TripleDot , not used in the AST */
public void visitType ( GroovySourceAST t , int visit ) { } } | GroovySourceAST parent = getParentNode ( ) ; GroovySourceAST modifiers = parent . childOfType ( GroovyTokenTypes . MODIFIERS ) ; // No need to print ' def ' if we already have some modifiers
if ( modifiers == null || modifiers . getNumberOfChildren ( ) == 0 ) { if ( visit == OPENING_VISIT ) { if ( t . getNumberOfChildr... |
public class ResourceGroovyMethods { /** * Create a buffered reader for this file .
* @ param file a File
* @ return a BufferedReader
* @ throws IOException if an IOException occurs .
* @ since 1.0 */
public static BufferedReader newReader ( File file ) throws IOException { } } | CharsetToolkit toolkit = new CharsetToolkit ( file ) ; return toolkit . getReader ( ) ; |
public class MercurialConnector { /** * / * - - - Overridden methods - - - */
@ Override protected File cloneRepository ( File dest ) { } } | BaseRepository repo = Repository . clone ( RepositoryConfiguration . DEFAULT , dest , getUrl ( ) ) ; // set branch name
String branchName = MASTER ; ; String branch = getBranch ( ) ; if ( StringUtils . isNotBlank ( branch ) ) { branchName = branch ; } String tag = getTag ( ) ; if ( StringUtils . isNotBlank ( tag ) ) { ... |
public class NettySMTPClientTransportFactory { /** * Create a new NIO based { @ link SMTPClientTransportFactory }
* @ param workerCount
* @ return factory */
public static SMTPClientTransportFactory createNio ( int workerCount ) { } } | return new NettySMTPClientTransportFactory ( new NioClientSocketChannelFactory ( Executors . newCachedThreadPool ( ) , Executors . newCachedThreadPool ( ) , workerCount ) , FACTORY ) ; |
public class SQSSession { /** * Negative acknowledges all the messages on the session that is delivered
* but not acknowledged .
* @ throws JMSException
* If session is closed or on internal error . */
@ Override public void recover ( ) throws JMSException { } } | checkClosed ( ) ; // let ' s get all unacknowledged message identifiers
List < SQSMessageIdentifier > unAckedMessages = acknowledger . getUnAckMessages ( ) ; acknowledger . forgetUnAckMessages ( ) ; // let ' s summarize which queues and which message groups we ' re nacked
// we have to purge all prefetched messages and... |
public class VirtualFileSystem { /** * Returns existing { @ linkplain File } with specified path or creates the new one if { @ code create } is { @ code true } ,
* otherwise returns { @ code null } . If { @ code create } is { @ code true } it never returns { @ code null } .
* @ param txn { @ linkplain Transaction }... | final ArrayByteIterable key = StringBinding . stringToEntry ( path ) ; final ByteIterable value = pathnames . get ( txn , key ) ; if ( value != null ) { return new File ( path , value ) ; } if ( create ) { return createFile ( txn , path ) ; } return null ; |
public class AWSElasticsearchClient { /** * Returns domain configuration information about the specified Elasticsearch domains , including the domain ID ,
* domain endpoint , and domain ARN .
* @ param describeElasticsearchDomainsRequest
* Container for the parameters to the < code > < a > DescribeElasticsearchDo... | request = beforeClientExecution ( request ) ; return executeDescribeElasticsearchDomains ( request ) ; |
public class VpcConfigMarshaller { /** * Marshall the given parameter object . */
public void marshall ( VpcConfig vpcConfig , ProtocolMarshaller protocolMarshaller ) { } } | if ( vpcConfig == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( vpcConfig . getSubnetIds ( ) , SUBNETIDS_BINDING ) ; protocolMarshaller . marshall ( vpcConfig . getSecurityGroupIds ( ) , SECURITYGROUPIDS_BINDING ) ; } catch ( Exception e )... |
public class DateUtil { /** * Get the day of week of the date
* @ param date date
* @ return day of week of the date */
public static int getDayOfWeek ( Date date ) { } } | Calendar c = Calendar . getInstance ( ) ; c . setTime ( date ) ; return c . get ( Calendar . DAY_OF_WEEK ) ; |
public class IntIntSortedVector { /** * Gets the entrywise sum of the two vectors . */
public IntIntSortedVector getSum ( IntIntVector other ) { } } | IntIntSortedVector sum = new IntIntSortedVector ( this ) ; sum . add ( other ) ; return sum ; |
public class CommandHelper { /** * Convert the value according the type of DeviceData .
* @ param deviceDataArgout
* the DeviceData attribute to read
* @ return Double , the result in Double format
* @ throws DevFailed */
public static Double extractToDouble ( final DeviceData deviceDataArgout ) throws DevFaile... | final Object value = CommandHelper . extract ( deviceDataArgout ) ; Double argout = null ; if ( value instanceof Short ) { argout = Double . valueOf ( ( ( Short ) value ) . doubleValue ( ) ) ; } else if ( value instanceof String ) { try { argout = Double . valueOf ( ( String ) value ) ; } catch ( final Exception e ) { ... |
public class Single { /** * Concatenate the single values , in a non - overlapping fashion , of the SingleSources provided by
* an Observable sequence .
* < img width = " 640 " height = " 319 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / Single . concat . o . png "... | "unchecked" , "rawtypes" } ) public static < T > Observable < T > concat ( ObservableSource < ? extends SingleSource < ? extends T > > sources ) { ObjectHelper . requireNonNull ( sources , "sources is null" ) ; return RxJavaPlugins . onAssembly ( new ObservableConcatMap ( sources , SingleInternalHelper . toObservable (... |
public class JsonHash { /** * see { @ link Map # put ( Object , Object ) } .
* this method is alternative of { @ link # put ( String , Object , Type ) } call with { @ link Type # LONG } .
* @ param key
* @ param value
* @ return see { @ link Map # put ( Object , Object ) }
* @ since 1.4.12
* @ author vvakam... | if ( value == null ) { stateMap . put ( key , Type . NULL ) ; } else { stateMap . put ( key , Type . LONG ) ; } return super . put ( key , value ) ; |
public class Proxies { /** * Create socks5 proxy */
public static Proxy socksProxy ( String host , int port ) { } } | return new Proxy ( Proxy . Type . SOCKS , new InetSocketAddress ( Objects . requireNonNull ( host ) , port ) ) ; |
public class AIStream { /** * Read L / A ticks from item stream and set rest to L / R , read and set L / D prefix */
private CreateTOMs recoverFromPersistentState ( AIProtocolItemStream persStreamState ) throws MessageStoreException { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "recoverFromPersistentState" , persStreamState ) ; NonLockingCursor cursor = null ; // ticks may still be locked by a transaction that did not commit before failure
AbstractItem abitem = null ; ArrayList < AIAcceptedTick > a... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.