signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class CalculatorApp { /** * A generic middleware that maps uncaught exceptions to error code 418 */
static < T > Middleware < SyncHandler < Response < T > > , SyncHandler < Response < T > > > exceptionMiddleware ( ) { } } | return handler -> requestContext -> { try { return handler . invoke ( requestContext ) ; } catch ( RuntimeException e ) { return Response . forStatus ( Status . IM_A_TEAPOT ) ; } } ; |
public class BaseXmlParser { /** * Parses an xml extension from an xml string .
* @ param xml XML containing the extension .
* @ param tagName The top level tag name .
* @ return Result of the parsed extension .
* @ throws Exception Unspecified exception . */
protected Object fromXml ( String xml , String tagNa... | Document document = XMLUtil . parseXMLFromString ( xml ) ; NodeList nodeList = document . getElementsByTagName ( tagName ) ; if ( nodeList == null || nodeList . getLength ( ) != 1 ) { throw new DOMException ( DOMException . NOT_FOUND_ERR , "Top level tag '" + tagName + "' was not found." ) ; } Element element = ( Eleme... |
public class LdapIdentityStore { /** * Convert the { @ link LdapSearchScope } setting to the JNDI { @ link SearchControls } equivalent .
* @ param scope The { @ link LdapIdentityStore } to convert to the JNDI equivalent .
* @ return The JNDI { @ link SearchControls } search scope . */
private int getSearchScope ( L... | if ( scope == LdapSearchScope . ONE_LEVEL ) { return SearchControls . ONELEVEL_SCOPE ; } else { return SearchControls . SUBTREE_SCOPE ; } |
public class JarFileDirectoryImpl { /** * IJarFileDirectory methods */
@ Override public JarEntryDirectoryImpl getOrCreateDirectory ( String relativeName ) { } } | IResource resource = _resources . get ( relativeName ) ; if ( resource instanceof IFile ) { throw new UnsupportedOperationException ( "The requested resource " + relativeName + " is now being accessed as a directory, but was previously accessed as a file." ) ; } JarEntryDirectoryImpl result = ( JarEntryDirectoryImpl ) ... |
public class PoolRemoveNodesOptions { /** * Set a timestamp indicating the last modified time of the resource known to the client . The operation will be performed only if the resource on the service has not been modified since the specified time .
* @ param ifUnmodifiedSince the ifUnmodifiedSince value to set
* @ ... | if ( ifUnmodifiedSince == null ) { this . ifUnmodifiedSince = null ; } else { this . ifUnmodifiedSince = new DateTimeRfc1123 ( ifUnmodifiedSince ) ; } return this ; |
public class RpcUtil { /** * Creates a new message of type " Type " which is a copy of " source " . " source "
* must have the same descriptor but may be a different class ( e . g .
* DynamicMessage ) . */
@ SuppressWarnings ( "unchecked" ) private static < Type extends Message > Type copyAsType ( final Type typeDe... | return ( Type ) typeDefaultInstance . newBuilderForType ( ) . mergeFrom ( source ) . build ( ) ; |
public class Regex { /** * Writes in to out replacing every match with a string
* @ param in
* @ param bufferSize
* @ param out
* @ param format
* @ throws java . io . IOException
* @ see String . format */
public void replace ( PushbackReader in , int bufferSize , Writer out , String format ) throws IOExce... | InputReader reader = Input . getInstance ( in , bufferSize ) ; ObsoleteSimpleReplacer fsp = new ObsoleteSimpleReplacer ( format ) ; replace ( reader , out , fsp ) ; |
public class HttpSequenceRangeGetter { /** * param : clientId = & clientToken =
* return : accessUrl = & accessToken = & errorCode = & errorMessage = */
private void authorize ( ) { } } | Map < String , String > param = new HashMap < > ( ) ; param . put ( "clientId" , clientId ) ; param . put ( "authorizeToken" , authorizeToken ) ; String result = HttpUtils . sendPost ( authorizeUrl , param ) ; Map < String , String > resultMap = parseHttpKvString ( result ) ; if ( resultMap . isEmpty ( ) ) { throw new ... |
public class GroundyTaskFactory { /** * Builds a GroundyTask based on call .
* @ param taskClass groundy value implementation class
* @ param context used to instantiate the value
* @ return An instance of a GroundyTask if a given call is valid null otherwise */
static GroundyTask get ( Class < ? extends GroundyT... | if ( CACHE . containsKey ( taskClass ) ) { return CACHE . get ( taskClass ) ; } GroundyTask groundyTask = null ; try { L . d ( TAG , "Instantiating " + taskClass ) ; Constructor ctc = taskClass . getConstructor ( ) ; groundyTask = ( GroundyTask ) ctc . newInstance ( ) ; if ( groundyTask . canBeCached ( ) ) { CACHE . pu... |
public class MatrixFeatures_DDRM { /** * Checks to see if any element in the matrix is NaN of Infinite .
* @ param m A matrix . Not modified .
* @ return True if any element in the matrix is NaN of Infinite . */
public static boolean hasUncountable ( DMatrixD1 m ) { } } | int length = m . getNumElements ( ) ; for ( int i = 0 ; i < length ; i ++ ) { double a = m . get ( i ) ; if ( Double . isNaN ( a ) || Double . isInfinite ( a ) ) return true ; } return false ; |
public class UIComponentELTag { /** * < p > Override properties and attributes of the specified component ,
* if the corresponding properties of this tag handler instance were
* explicitly set . This method must be called < strong > ONLY < / strong >
* if the specified { @ link UIComponent } was in fact created d... | // The " id " property is explicitly set when components are created
// so it does not need to be set here
if ( rendered != null ) { if ( rendered . isLiteralText ( ) ) { try { component . setRendered ( Boolean . valueOf ( rendered . getExpressionString ( ) ) . booleanValue ( ) ) ; } catch ( ELException e ) { throw new... |
public class CommerceNotificationAttachmentPersistenceImpl { /** * Returns the last commerce notification attachment in the ordered set where uuid = & # 63 ; .
* @ param uuid the uuid
* @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > )
* @ return the last matchin... | CommerceNotificationAttachment commerceNotificationAttachment = fetchByUuid_Last ( uuid , orderByComparator ) ; if ( commerceNotificationAttachment != null ) { return commerceNotificationAttachment ; } StringBundler msg = new StringBundler ( 4 ) ; msg . append ( _NO_SUCH_ENTITY_WITH_KEY ) ; msg . append ( "uuid=" ) ; m... |
public class ReportUtil { /** * Convert a report object to xml text
* @ param report
* report object
* @ return xml text */
public static String reportToXml ( Report report ) { } } | XStream xstream = XStreamFactory . createXStream ( ) ; ByteArrayOutputStream bos = new ByteArrayOutputStream ( ) ; xstream . toXML ( report , bos ) ; return bos . toString ( ) ; |
public class MetaMasterSync { /** * Sets the master id and registers with the Alluxio leader master . */
private void setIdAndRegister ( ) throws IOException { } } | mMasterId . set ( mMasterClient . getId ( mMasterAddress ) ) ; mMasterClient . register ( mMasterId . get ( ) , ConfigurationUtils . getConfiguration ( ServerConfiguration . global ( ) , Scope . MASTER ) ) ; |
public class H2Headers { /** * Decode header bytes , validating against a given H2ConnectionSettings
* @ param WsByteBuffer
* @ param H2HeaderTable
* @ param isFirstHeader
* @ param H2ConnectionSettings
* @ return H2HeaderField
* @ throws CompressionException if invalid header names or values are found */
p... | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . entry ( tc , "decodeHeader" ) ; } if ( ! table . isDynamicTableValid ( ) ) { throw new CompressionException ( "The context for this dynamic table is not valid." ) ; } if ( buffer == null || ! buffer . hasRemaining ( ) ) { throw new Compre... |
public class BuilderUtils { /** * Check if a field is static
* @ param field
* @ throws DevFailed
* if static */
static void checkStatic ( final Field field ) throws DevFailed { } } | if ( Modifier . isStatic ( field . getModifiers ( ) ) ) { throw DevFailedUtils . newDevFailed ( DevFailedUtils . TANGO_BUILD_FAILED , field + MUST_NOT_BE_STATIC ) ; } |
public class PreparedStatementHandle { /** * # ifdef JDK > 6 */
public void setBinaryStream ( int parameterIndex , InputStream x ) throws SQLException { } } | checkClosed ( ) ; try { this . internalPreparedStatement . setBinaryStream ( parameterIndex , x ) ; if ( this . logStatementsEnabled ) { this . logParams . put ( parameterIndex , x ) ; } } catch ( SQLException e ) { throw this . connectionHandle . markPossiblyBroken ( e ) ; } |
public class InternalOutputStream { /** * This method uses a Value TickRange to write Silence into the stream ,
* because a message has expired before it was sent and so needs to be removed
* from the stream
* It forces the stream to be updated to Silence without checking the
* existing state
* It then update... | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "writeSilenceForced" , new Object [ ] { vtr } ) ; long start = vtr . startstamp ; long end = vtr . endstamp ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { SibTr . debug ( tc , "writeSilenceFor... |
public class JavaDialect { /** * This actually triggers the compiling of all the resources .
* Errors are mapped back to the element that originally generated the semantic
* code . */
public void compileAll ( ) { } } | if ( this . generatedClassList . isEmpty ( ) ) { this . errorHandlers . clear ( ) ; return ; } final String [ ] classes = new String [ this . generatedClassList . size ( ) ] ; this . generatedClassList . toArray ( classes ) ; File dumpDir = this . configuration . getPackageBuilderConfiguration ( ) . getDumpDir ( ) ; if... |
public class StatementParameter { /** * 设置Boolean类型参数 .
* @ param value */
public void setBool ( Boolean value ) { } } | this . checkNull ( value ) ; list . add ( value ) ; type . add ( Boolean . class ) ; |
public class ModifyInstancePlacementRequest { /** * This method is intended for internal use only . Returns the marshaled request configured with additional
* parameters to enable operation dry - run . */
@ Override public Request < ModifyInstancePlacementRequest > getDryRunRequest ( ) { } } | Request < ModifyInstancePlacementRequest > request = new ModifyInstancePlacementRequestMarshaller ( ) . marshall ( this ) ; request . addParameter ( "DryRun" , Boolean . toString ( true ) ) ; return request ; |
public class SummaryAndConfigPanel { /** * Sets the summary content .
* @ param content the new summary content */
public void setSummaryContent ( String content ) { } } | Logger . getRootLogger ( ) . info ( "New summary: " + content ) ; summaryArea . setText ( "<html><b>" + summaryTitleText + "</b><br/><br/>" + content + "</html>" ) ; |
public class Distance { /** * Gets the Bray Curtis distance between two points .
* @ param p IntPoint with X and Y axis coordinates .
* @ param q IntPoint with X and Y axis coordinates .
* @ return The Bray Curtis distance between x and y . */
public static double BrayCurtis ( IntPoint p , IntPoint q ) { } } | return BrayCurtis ( p . x , p . y , q . x , q . y ) ; |
public class DescribeMLModelsResult { /** * A list of < code > MLModel < / code > that meet the search criteria .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setResults ( java . util . Collection ) } or { @ link # withResults ( java . util . Collection ) ... | if ( this . results == null ) { setResults ( new com . amazonaws . internal . SdkInternalList < MLModel > ( results . length ) ) ; } for ( MLModel ele : results ) { this . results . add ( ele ) ; } return this ; |
public class TileSetColorImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public void eSet ( int featureID , Object newValue ) { } } | switch ( featureID ) { case AfplibPackage . TILE_SET_COLOR__CSPACE : setCSPACE ( ( Integer ) newValue ) ; return ; case AfplibPackage . TILE_SET_COLOR__RESERVED : setRESERVED ( ( Integer ) newValue ) ; return ; case AfplibPackage . TILE_SET_COLOR__SIZE1 : setSIZE1 ( ( Integer ) newValue ) ; return ; case AfplibPackage ... |
public class DocClient { /** * list all Document by status , marker .
* @ param status document status
* @ param marker the marker , can be " "
* @ param maxSize the maxSize , should be ( 0 , 200]
* @ return A ListDocumentsResponse object containing the information returned by Document . */
public ListDocuments... | ListDocumentsRequest request = new ListDocumentsRequest ( ) ; InternalRequest internalRequest = this . createRequest ( HttpMethodName . GET , request , DOC ) ; internalRequest . addParameter ( "status" , status ) ; if ( marker != null ) { internalRequest . addParameter ( "marker" , marker ) ; } internalRequest . addPar... |
public class EmojiParser { /** * Removes all emojis from a String
* @ param str the string to process
* @ return the string without any emoji */
public static String removeAllEmojis ( String str ) { } } | EmojiTransformer emojiTransformer = new EmojiTransformer ( ) { public String transform ( UnicodeCandidate unicodeCandidate ) { return "" ; } } ; return parseFromUnicode ( str , emojiTransformer ) ; |
public class PrototypeContainer { /** * Registers a new prototype associated to the specified key
* NOTE : IPrototype pattern
* @ param key key for the new prototype
* @ param prototype the prototype to register */
public void registerPrototype ( String key , IPrototype prototype ) { } } | prototypes . put ( new PrototypeKey ( key , prototype . getClass ( ) ) , prototype ) ; |
public class PackagedProgram { /** * Returns the analyzed plan without any optimizations .
* @ return
* the analyzed plan without any optimizations .
* @ throws ProgramInvocationException Thrown if an error occurred in the
* user - provided pact assembler . This may indicate
* missing parameters for generatio... | Thread . currentThread ( ) . setContextClassLoader ( this . getUserCodeClassLoader ( ) ) ; List < DataSinkNode > previewPlan ; if ( isUsingProgramEntryPoint ( ) ) { previewPlan = PactCompiler . createPreOptimizedPlan ( getPlan ( ) ) ; } else if ( isUsingInteractiveMode ( ) ) { // temporary hack to support the web clien... |
public class ConditionEvaluationReport { /** * Records the names of the classes that have been excluded from condition evaluation .
* @ param exclusions the names of the excluded classes */
public void recordExclusions ( Collection < String > exclusions ) { } } | Assert . notNull ( exclusions , "exclusions must not be null" ) ; this . exclusions . addAll ( exclusions ) ; |
public class LinkBuilder { /** * Process connections and transform them into recast neighbour flags */
void build ( int nodeOffset , GraphMeshData graphData , List < int [ ] > connections ) { } } | for ( int n = 0 ; n < connections . size ( ) ; n ++ ) { int [ ] nodeConnections = connections . get ( n ) ; MeshData tile = graphData . getTile ( n ) ; Poly node = graphData . getNode ( n ) ; for ( int connection : nodeConnections ) { MeshData neighbourTile = graphData . getTile ( connection - nodeOffset ) ; if ( neigh... |
public class CmsSetupBean { /** * Returns html for displaying a module selection box . < p >
* @ return html code */
public String htmlModules ( ) { } } | StringBuffer html = new StringBuffer ( 1024 ) ; Iterator < String > itModules = sortModules ( getAvailableModules ( ) . values ( ) ) . iterator ( ) ; for ( int i = 0 ; itModules . hasNext ( ) ; i ++ ) { String moduleName = itModules . next ( ) ; CmsModule module = getAvailableModules ( ) . get ( moduleName ) ; html . a... |
public class MetadataTemplate { /** * Gets the Json Array representation of the given list of strings .
* @ param keys List of strings
* @ return the JsonArray represents the list of keys */
private static JsonArray getJsonArray ( List < String > keys ) { } } | JsonArray array = new JsonArray ( ) ; for ( String key : keys ) { array . add ( key ) ; } return array ; |
public class StringReplacer { /** * Replaces the last exact match of the given pattern in the source
* string with the provided replacement .
* @ param source the source string
* @ param pattern the simple string pattern to search for
* @ param replacement the string to use for replacing matched patterns
* @ ... | return replaceOne ( source , pattern , replacement , findLast ( source , pattern ) ) ; |
public class SupportUtils { /** * Check if { @ link org . osgi . service . event . EventAdmin } is available
* @ return < code > true < / code > if EventAdmin class can be loaded ,
* < code > false < / code > otherwhise */
public static boolean isEventAdminAvailable ( ) { } } | try { return ( org . osgi . service . event . EventAdmin . class != null ) ; } catch ( NoClassDefFoundError ignore ) { return false ; } |
public class DefaultBigDecimalMath { /** * Calculates the arc tangens ( inverted tangens ) of { @ link BigDecimal } y / x in the range - < i > pi < / i > to < i > pi < / i > using the default { @ link MathContext } .
* @ param y the { @ link BigDecimal }
* @ param x the { @ link BigDecimal }
* @ return the calcul... | return BigDecimalMath . atan2 ( y , x , defaultMathContext ) ; |
public class ImportXMLScanListener { /** * Init Method . */
public void init ( RecordOwnerParent parent , String strSourcePrefix ) { } } | super . init ( parent , strSourcePrefix ) ; inout = new XmlInOut ( ( RecordOwner ) parent , null , null ) ; |
public class NioTLSSyslogSenderImpl { /** * Send an audit message to a designated destination address and port using the
* TLS socket specified .
* @ param msg Message to send
* @ param destination TLS socket to use
* @ throws Exception */
private void send ( AuditEventMessage msg , Destination < S > destinatio... | if ( EventUtils . isEmptyOrNull ( msg ) ) { return ; } // Serialize and format event message for syslog
byte [ ] msgBytes = getTransportPayload ( msg ) ; if ( EventUtils . isEmptyOrNull ( msgBytes ) ) { return ; } destination . write ( msgBytes ) ; |
public class HystrixObservableCollapser { /** * Used for asynchronous execution with a callback by subscribing to the { @ link Observable } .
* This eagerly starts execution the same as { @ link HystrixCollapser # queue ( ) } and { @ link HystrixCollapser # execute ( ) } .
* A lazy { @ link Observable } can be obta... | // use a ReplaySubject to buffer the eagerly subscribed - to Observable
ReplaySubject < ResponseType > subject = ReplaySubject . create ( ) ; // eagerly kick off subscription
final Subscription underlyingSubscription = toObservable ( ) . subscribe ( subject ) ; // return the subject that can be subscribed to later whil... |
public class AWSOpsWorksClient { /** * Describes the results of specified commands .
* < note >
* This call accepts only one resource - identifying parameter .
* < / note >
* < b > Required Permissions < / b > : To use this action , an IAM user must have a Show , Deploy , or Manage permissions
* level for the... | request = beforeClientExecution ( request ) ; return executeDescribeCommands ( request ) ; |
public class JavacParser { /** * Expression3 = PrefixOp Expression3
* | " ( " Expr | TypeNoParams " ) " Expression3
* | Primary { Selector } { PostfixOp }
* { @ literal
* Primary = " ( " Expression " ) "
* | Literal
* | [ TypeArguments ] THIS [ Arguments ]
* | [ TypeArguments ] SUPER SuperSuffix
* | NEW... | int pos = token . pos ; JCExpression t ; List < JCExpression > typeArgs = typeArgumentsOpt ( EXPR ) ; switch ( token . kind ) { case QUES : if ( ( mode & TYPE ) != 0 && ( mode & ( TYPEARG | NOPARAMS ) ) == TYPEARG ) { mode = TYPE ; return typeArgument ( ) ; } else return illegal ( ) ; case PLUSPLUS : case SUBSUB : case... |
public class JFXTreeTableView { /** * this method will filter the tree table */
private void filter ( Predicate < TreeItem < S > > predicate ) { } } | if ( task != null ) { task . cancel ( false ) ; } task = threadPool . schedule ( filterRunnable , 200 , TimeUnit . MILLISECONDS ) ; |
public class CommerceNotificationTemplateUtil { /** * Returns the first commerce notification template in the ordered set where groupId = & # 63 ; and enabled = & # 63 ; .
* @ param groupId the group ID
* @ param enabled the enabled
* @ param orderByComparator the comparator to order the set by ( optionally < cod... | return getPersistence ( ) . fetchByG_E_First ( groupId , enabled , orderByComparator ) ; |
public class LoggingScopeFactory { /** * Get a new instance of LoggingScope with specified log level .
* @ param logLevel
* @ param msg
* @ return */
public static LoggingScope getNewLoggingScope ( final Level logLevel , final String msg ) { } } | return new LoggingScopeImpl ( LOG , logLevel , msg ) ; |
public class DatanodeInfo { /** * Sets the admin state of this node . */
protected void setAdminState ( AdminStates newState ) { } } | if ( newState == AdminStates . NORMAL ) { adminState = null ; } else { adminState = newState ; } |
public class RTED_InfoTree_Opt { /** * Computes the tree edit distance between trees t1 and t2.
* @ param t1
* @ param t2
* @ return tree edit distance between trees t1 and t2 */
public double nonNormalizedTreeDist ( LblTree t1 , LblTree t2 ) { } } | init ( t1 , t2 ) ; STR = new int [ size1 ] [ size2 ] ; computeOptimalStrategy ( ) ; return computeDistUsingStrArray ( it1 , it2 ) ; |
public class RenameVars { /** * Makes a final name assignment . */
private void finalizeNameAssignment ( Assignment a , String newName ) { } } | a . setNewName ( newName ) ; // Keep track of the mapping
renameMap . put ( a . oldName , newName ) ; |
public class RegistriesInner { /** * Copies an image to this container registry from the specified container registry .
* @ param resourceGroupName The name of the resource group to which the container registry belongs .
* @ param registryName The name of the container registry .
* @ param parameters The paramete... | return beginImportImageWithServiceResponseAsync ( resourceGroupName , registryName , parameters ) . map ( new Func1 < ServiceResponse < Void > , Void > ( ) { @ Override public Void call ( ServiceResponse < Void > response ) { return response . body ( ) ; } } ) ; |
public class ValidationException { /** * get validation error set .
* @ param pclass class to get data from
* @ return the validationErrorSet */
@ SuppressWarnings ( { } } | "unchecked" } ) public final ArrayList < ConstraintViolation < ? > > getValidationErrorSet ( final Object pclass ) { return new ArrayList < > ( validationErrorSet . stream ( ) . map ( violation -> ConstraintViolationImpl . forBeanValidation ( violation . getMessageTemplate ( ) , Collections . emptyMap ( ) , Collections... |
public class PolicyDelta { /** * < pre >
* The delta for Bindings between two policies .
* < / pre >
* < code > repeated . google . iam . v1 . BindingDelta binding _ deltas = 1 ; < / code > */
public com . google . iam . v1 . BindingDelta getBindingDeltas ( int index ) { } } | return bindingDeltas_ . get ( index ) ; |
public class CliTools { /** * Constructs a comma - separated list of values for an enum .
* Example :
* > getEnumValues ( ScoringStrategy . class )
* " CA _ SCORING , SIDE _ CHAIN _ SCORING , SIDE _ CHAIN _ ANGLE _ SCORING , CA _ AND _ SIDE _ CHAIN _ ANGLE _ SCORING , or SEQUENCE _ CONSERVATION "
* @ param enum... | // ScoringStrategy [ ] vals = ScoringStrategy . values ( ) ;
T [ ] vals = enumClass . getEnumConstants ( ) ; StringBuilder str = new StringBuilder ( ) ; if ( vals . length == 1 ) { str . append ( vals [ 0 ] . name ( ) ) ; } else if ( vals . length > 1 ) { for ( int i = 0 ; i < vals . length - 1 ; i ++ ) { str . append ... |
public class DeeseAntonymEvaluation { /** * Returns the ranking < i > k < / i > such that { @ code other } is the k < sup > th < / th >
* most similar word to { @ code target } in the semantic space . */
private int findRank ( SemanticSpace sspace , String target , String other ) { } } | Vector v1 = sspace . getVector ( target ) ; Vector v2 = sspace . getVector ( other ) ; // Compute the base similarity between the two words
double baseSim = Similarity . cosineSimilarity ( v1 , v2 ) ; int rank = 0 ; // Next , count how many words are more similar to the target than the
// other word is
for ( String wor... |
public class SDBaseOps { /** * Argmax array reduction operation , optionally along specified dimensions . < br >
* Output values are the index of the maximum value of each slice along the specified dimension
* @ param in Input variable
* @ param dimensions Dimensions to reduce over . If dimensions are not specifi... | return argmax ( null , in , false , dimensions ) ; |
public class RecoveryProcessor { /** * Executes a DurableLog recovery using data from DurableDataLog . During this process , the following will happen :
* 1 . Metadata will be reset and put into recovery mode .
* 2 . DurableDataLog will be initialized . This will fail if the DurableDataLog has already been initiali... | long traceId = LoggerHelpers . traceEnterWithContext ( log , this . traceObjectId , "performRecovery" ) ; Timer timer = new Timer ( ) ; log . info ( "{} Recovery started." , this . traceObjectId ) ; // Put metadata ( and entire container ) into ' Recovery Mode ' .
this . metadata . enterRecoveryMode ( ) ; // Reset meta... |
public class AbstractInstanceManager { /** * Return the datastore type represented by an instance .
* @ param instance
* The instance .
* @ param < Instance >
* The instance type .
* @ return The corresponding datastore type . */
@ Override public < Instance > DatastoreType getDatastoreType ( Instance instanc... | InstanceInvocationHandler < DatastoreType > invocationHandler = proxyFactory . getInvocationHandler ( instance ) ; return invocationHandler . getDatastoreType ( ) ; |
public class NaiveDeterminant { /** * A simple and inefficient algorithm for computing the determinant . This should never be used .
* It is at least two orders of magnitude slower than { @ link DeterminantFromMinor _ DDRM } . This is included
* to provide a point of comparison for other algorithms .
* @ param ma... | if ( mat . numRows == 1 ) { return mat . get ( 0 ) ; } else if ( mat . numRows == 2 ) { return mat . get ( 0 ) * mat . get ( 3 ) - mat . get ( 1 ) * mat . get ( 2 ) ; } else if ( mat . numRows == 3 ) { return UnrolledDeterminantFromMinor_DDRM . det3 ( mat ) ; } double result = 0 ; for ( int i = 0 ; i < mat . numRows ; ... |
public class MeetMeUserImpl { /** * Sets the status to { @ link MeetMeUserState # LEFT } and dateLeft to the given date .
* @ param dateLeft the date this user left the room . */
void left ( Date dateLeft ) { } } | MeetMeUserState oldState ; synchronized ( this ) { oldState = this . state ; this . dateLeft = dateLeft ; this . state = MeetMeUserState . LEFT ; } firePropertyChange ( PROPERTY_STATE , oldState , state ) ; |
public class RelatedItemAdditionalProperties { /** * Sets the property , at the given index , to the given name , and value .
* @ param name The property name
* @ param value the property value
* @ param propertyIndex the property that is to be set or written over . */
public void setProperty ( String name , Stri... | additionalProperties [ propertyIndex ] . setName ( name ) ; additionalProperties [ propertyIndex ] . setValue ( value ) ; |
public class WebConfigParamUtils { /** * Gets the String init parameter value from the specified context . If the parameter is an empty String or a String
* containing only white space , this method returns < code > null < / code >
* @ param context
* the application ' s external context
* @ param name
* the ... | if ( name == null ) { throw new NullPointerException ( ) ; } String param = context . getInitParameter ( name ) ; if ( param == null ) { return defaultValue ; } param = param . trim ( ) ; if ( param . length ( ) == 0 ) { return defaultValue ; } return param ; |
public class RTPBridge { /** * Get the attributes string . */
public String getAttributes ( ) { } } | StringBuilder str = new StringBuilder ( ) ; if ( getSid ( ) != null ) str . append ( " sid='" ) . append ( getSid ( ) ) . append ( '\'' ) ; if ( getPass ( ) != null ) str . append ( " pass='" ) . append ( getPass ( ) ) . append ( '\'' ) ; if ( getPortA ( ) != - 1 ) str . append ( " porta='" ) . append ( getPortA ( ) ) ... |
public class Transform1D { /** * Translate the coordinates . This function does not change the path .
* @ param move where < code > x < / code > is the curviline coordinate and < code > y < / code > is the shift coordinate . */
public void translate ( Tuple2D < ? > move ) { } } | assert move != null : AssertMessages . notNullParameter ( ) ; this . curvilineTranslation += move . getX ( ) ; this . shiftTranslation += move . getY ( ) ; this . isIdentity = null ; |
public class Model { /** * Sets the minimum and maximum value for the calculation of the
* nice minimum and nice maximum values .
* @ param MIN _ VALUE
* @ param MAX _ VALUE */
public void setRange ( final double MIN_VALUE , final double MAX_VALUE ) { } } | maxValue = MAX_VALUE ; minValue = MIN_VALUE ; calculate ( ) ; validate ( ) ; calcAngleStep ( ) ; fireStateChanged ( ) ; |
public class HandlerConfigurer { /** * Decode buffer .
* @ param address memory address .
* @ param length length .
* @ return returns { @ link Packet } . */
public Packet decodeRawBuffer ( long address , int length ) { } } | return processPacket ( Memories . wrap ( address , length , memoryProperties . getCheckBounds ( ) ) ) ; |
public class JSONWriter { /** * Append a key . The key will be associated with the next value . In an
* object , every value must be preceded by a key .
* @ param string A key string .
* @ return this
* @ throws JSONException If the key is out of place . For example , keys
* do not belong in arrays or if the ... | if ( string == null ) { throw new JSONException ( "Null key." ) ; } if ( this . mode == 'k' ) { try { JSONObject topObject = this . stack [ this . top - 1 ] ; // don ' t use the built in putOnce method to maintain Android support
if ( topObject . has ( string ) ) { throw new JSONException ( "Duplicate key \"" + string ... |
public class NameGenerator { /** * Computes the name of a single fragment of a Ginjector .
* @ param injectorClassName the simple name of the injector ' s class ( not
* including its package ) */
public String getFragmentClassName ( String injectorClassName , FragmentPackageName fragmentPackageName ) { } } | // Sanity check .
Preconditions . checkArgument ( ! injectorClassName . contains ( "." ) , "The injector class must be a simple name, but it was \"%s\"" , injectorClassName ) ; // Note that the fragment package name is not actually included in the
// fragment . This reduces the length of the fragment ' s class name , w... |
public class ClassInfo { /** * Checks whether this class or one of its superclasses declares a field with the named annotation .
* @ param fieldAnnotationName
* The name of a field annotation .
* @ return true if this class or one of its superclasses declares a field with the named annotation . */
public boolean ... | for ( final ClassInfo ci : getOverrideOrder ( ) ) { if ( ci . hasDeclaredFieldAnnotation ( fieldAnnotationName ) ) { return true ; } } return false ; |
public class DateFormatSymbols { /** * < strong > [ icu ] < / strong > Sets quarter strings . For example : " 1st Quarter " , " 2nd Quarter " , etc .
* @ param newQuarters the new quarter strings .
* @ param context The formatting context , FORMAT or STANDALONE .
* @ param width The width of the quarter string , ... | switch ( context ) { case FORMAT : switch ( width ) { case WIDE : quarters = duplicate ( newQuarters ) ; break ; case ABBREVIATED : shortQuarters = duplicate ( newQuarters ) ; break ; case NARROW : // narrowQuarters = duplicate ( newQuarters ) ;
break ; default : // HANDLE SHORT , etc .
break ; } break ; case STANDALON... |
public class OverlyConcreteParameter { /** * returns a list of method information of all public or protected methods in
* this class
* @ param cls the class to look for methods
* @ return a map of ( method name ) ( method signature ) */
private static List < MethodInfo > getPublicMethodInfos ( final JavaClass cls... | List < MethodInfo > methodInfos = new ArrayList < > ( ) ; Method [ ] methods = cls . getMethods ( ) ; for ( Method m : methods ) { if ( ( m . getAccessFlags ( ) & ( Const . ACC_PUBLIC | Const . ACC_PROTECTED ) ) != 0 ) { ExceptionTable et = m . getExceptionTable ( ) ; methodInfos . add ( new MethodInfo ( m . getName ( ... |
public class FacesConfigurator { /** * Made public for use by ClassUtils . */
public Object injectAndPostConstruct ( Class < ? > Klass ) throws InjectionProviderException { } } | Object instance = null ; ManagedObject mo = ( ManagedObject ) ( ( WASInjectionProvider ) getInjectionProvider ( ) ) . inject ( Klass , true , _externalContext ) ; instance = mo . getObject ( ) ; if ( instance instanceof FacesWrapper ) { Object innerInstance = ( ( FacesWrapper ) instance ) . getWrapped ( ) ; if ( innerI... |
public class SymbolTable { /** * Not all symbol tables record references to " namespace " objects . For example , if you have :
* goog . dom . DomHelper = function ( ) { } ; The symbol table may not record that as a reference to
* " goog . dom " , because that would be redundant . */
void fillNamespaceReferences ( ... | for ( Symbol symbol : getAllSymbols ( ) ) { String qName = symbol . getName ( ) ; int rootIndex = qName . indexOf ( '.' ) ; if ( rootIndex == - 1 ) { continue ; } Symbol root = symbol . scope . getQualifiedSlot ( qName . substring ( 0 , rootIndex ) ) ; if ( root == null ) { // In theory , this should never happen , but... |
public class GetTablesResult { /** * A list of the requested < code > Table < / code > objects .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setTableList ( java . util . Collection ) } or { @ link # withTableList ( java . util . Collection ) } if you want... | if ( this . tableList == null ) { setTableList ( new java . util . ArrayList < Table > ( tableList . length ) ) ; } for ( Table ele : tableList ) { this . tableList . add ( ele ) ; } return this ; |
public class Convert { /** * CPE URL encodes the well formed string . If the value is NULL or ANY ( ' * ' )
* then an empty string is returned . If the value is a hyphen ( ' - ' ) the
* hyphen is returned un - encoded ; otherwise URL encoding is applied as
* specified in the CPE 2.2 format .
* @ param wellForme... | if ( wellFormed == null || wellFormed . isEmpty ( ) || LogicalValue . ANY . getAbbreviation ( ) . equals ( wellFormed ) ) { return "" ; } if ( LogicalValue . NA . getAbbreviation ( ) . equals ( wellFormed ) ) { return wellFormed ; } try { byte [ ] bytes = wellFormed . getBytes ( "UTF-8" ) ; StringBuilder sb = new Strin... |
public class TensorSliceProto { /** * < pre >
* Extent of the slice in all tensor dimensions .
* Must have one entry for each of the dimension of the tensor that this
* slice belongs to . The order of sizes is the same as the order of
* dimensions in the TensorShape .
* < / pre >
* < code > repeated . tenso... | return extent_ ; |
public class PatternProcessFunctionBuilder { /** * Starts constructing a { @ link PatternProcessFunction } from a { @ link PatternFlatSelectFunction } that
* emitted elements through { @ link org . apache . flink . util . Collector } . */
static < IN , OUT > FlatSelectBuilder < IN , OUT > fromFlatSelect ( final Patte... | return new FlatSelectBuilder < > ( function ) ; |
public class OutputPropertyUtils { /** * Searches for the boolean property with the specified key in the property list .
* If the key is not found in this property list , the default property list ,
* and its defaults , recursively , are then checked . The method returns
* < code > false < / code > if the propert... | String s = props . getProperty ( key ) ; if ( null == s || ! s . equals ( "yes" ) ) return false ; else return true ; |
public class PatchedLocalTaskServiceFactory { /** * { @ inheritDoc } */
@ Override public TaskService newTaskService ( ) { } } | TaskService taskService ; try { taskService = super . newTaskService ( ) ; } catch ( IllegalStateException ise ) { // There is a bug in TaskDeadlinesServiceImpl . initialize where there is no
// TaskPersistenceContext available on initialization , so it always fails the
// first time . We don ' t need theTaskDeadlinesS... |
public class TitanCleanup { /** * Clears out the entire graph . This will delete ALL of the data stored in this graph and the data will NOT be
* recoverable . This method is intended only for development and testing use .
* @ param graph
* @ throws IllegalArgumentException if the graph has not been shut down
* ... | Preconditions . checkNotNull ( graph ) ; Preconditions . checkArgument ( graph instanceof StandardTitanGraph , "Invalid graph instance detected: %s" , graph . getClass ( ) ) ; StandardTitanGraph g = ( StandardTitanGraph ) graph ; Preconditions . checkArgument ( ! g . isOpen ( ) , "Graph needs to be shut down before it ... |
public class ApplicationSummaryMarshaller { /** * Marshall the given parameter object . */
public void marshall ( ApplicationSummary applicationSummary , ProtocolMarshaller protocolMarshaller ) { } } | if ( applicationSummary == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( applicationSummary . getApplicationName ( ) , APPLICATIONNAME_BINDING ) ; protocolMarshaller . marshall ( applicationSummary . getApplicationARN ( ) , APPLICATIONARN_... |
public class HistoryWidget { /** * The records to be rendered this time . */
public Iterable < HistoryPageEntry < T > > getRenderList ( ) { } } | if ( trimmed ) { List < HistoryPageEntry < T > > pageEntries = toPageEntries ( baseList ) ; if ( pageEntries . size ( ) > THRESHOLD ) { return updateFirstTransientBuildKey ( pageEntries . subList ( 0 , THRESHOLD ) ) ; } else { trimmed = false ; return updateFirstTransientBuildKey ( pageEntries ) ; } } else { // to prev... |
public class CliFrontendParser { /** * Prints the help for the client . */
public static void printHelp ( Collection < CustomCommandLine < ? > > customCommandLines ) { } } | System . out . println ( "./flink <ACTION> [OPTIONS] [ARGUMENTS]" ) ; System . out . println ( ) ; System . out . println ( "The following actions are available:" ) ; printHelpForRun ( customCommandLines ) ; printHelpForInfo ( ) ; printHelpForList ( customCommandLines ) ; printHelpForStop ( customCommandLines ) ; print... |
public class FilterFragment { /** * A new array of filter fragments each constructed using the corresponding filters in the provided array .
* @ param filters the filters to create the fragments from
* @ return the array of filter fragments */
public static FilterFragment [ ] from ( Filter ... filters ) { } } | FilterFragment [ ] ret = new FilterFragment [ filters . length ] ; Arrays . setAll ( ret , ( i ) -> new FilterFragment ( filters [ i ] ) ) ; return ret ; |
public class CallManagerBean { /** * ( non - Javadoc )
* @ see org . jboss . mobicents . seam . CallManager # initMediaConnection ( javax . servlet . sip . SipServletRequest ) */
public void initMediaConnection ( SipServletRequest request ) throws IOException { } } | log . info ( "initiating media connection" ) ; sipServletResponse = request . createResponse ( SipServletResponse . SC_OK ) ; fireEvent ( null , ( byte [ ] ) request . getContent ( ) , "org.mobicents.slee.service.interopdemo.INIT_MEDIA" , request . getSession ( ) . getAttribute ( "callManagerRef" ) ) ; |
public class EditLogLedgerMetadataWritable { /** * Update internal state with a specified EditLogLedgerMetadata before
* serializing with { @ link # write ( DataOutput ) }
* @ param metadata The metadata to serialize to a byte array */
public void set ( EditLogLedgerMetadata metadata ) { } } | logVersion = metadata . getLogVersion ( ) ; ledgerId = metadata . getLedgerId ( ) ; firstTxId = metadata . getFirstTxId ( ) ; lastTxId = metadata . getLastTxId ( ) ; |
public class AbstractConnectionListener { /** * { @ inheritDoc } */
public Object getConnection ( ) throws ResourceException { } } | Object result = mc . getConnection ( credential . getSubject ( ) , credential . getConnectionRequestInfo ( ) ) ; addConnection ( result ) ; return result ; |
public class ProtoParser { /** * Parse a named { @ code . proto } schema . */
public static ProtoFileElement parse ( Location location , String data ) { } } | return new ProtoParser ( location , data . toCharArray ( ) ) . readProtoFile ( ) ; |
public class CommonOps_DDF6 { /** * Extracts all diagonal elements from ' input ' and places them inside the ' out ' vector . Elements
* are in sequential order .
* @ param input Matrix . Not modified .
* @ param out Vector containing diagonal elements . Modified . */
public static void diag ( DMatrix6x6 input , ... | out . a1 = input . a11 ; out . a2 = input . a22 ; out . a3 = input . a33 ; out . a4 = input . a44 ; out . a5 = input . a55 ; out . a6 = input . a66 ; |
public class WorkflowManagerAbstract { /** * / * ( non - Javadoc )
* @ see nz . co . senanque . workflow . WorkflowManager # getTask ( nz . co . senanque . workflow . instances . DeferredEvent ) */
@ Override public TaskBase getTask ( DeferredEvent deferredEvent ) { } } | return getTask ( deferredEvent . getProcessDefinitionName ( ) , deferredEvent . getTaskId ( ) ) ; |
public class CmsFormatterConfiguration { /** * Gets all detail formatters . < p >
* @ return the detail formatters */
public Collection < I_CmsFormatterBean > getDetailFormatters ( ) { } } | return Collections . < I_CmsFormatterBean > unmodifiableCollection ( Collections2 . filter ( m_allFormatters , new IsDetail ( ) ) ) ; |
public class GetAttributeValuesRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( GetAttributeValuesRequest getAttributeValuesRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( getAttributeValuesRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( getAttributeValuesRequest . getServiceCode ( ) , SERVICECODE_BINDING ) ; protocolMarshaller . marshall ( getAttributeValuesRequest . getAttributeName ( ) , ATT... |
public class EpicsApi { /** * Get an Optional instance with the value for the specific Epic .
* < pre > < code > GitLab Endpoint : GET / groups / : id / epics / : epic _ iid < / code > < / pre >
* @ param groupIdOrPath the group ID , path of the group , or a Group instance holding the group ID or path
* @ param e... | try { return ( Optional . ofNullable ( getEpic ( groupIdOrPath , epicIid ) ) ) ; } catch ( GitLabApiException glae ) { return ( GitLabApi . createOptionalFromException ( glae ) ) ; } |
public class FormSpec { /** * Parses an encoded compound size and sets the size fields . The compound size has format :
* max ( & lt ; atomic size & gt ; ; & lt ; atomic size2 & gt ; ) | min ( & lt ; atomic size1 & gt ; ; & lt ; atomic
* size2 & gt ; ) One of the two atomic sizes must be a logical size , the other ... | int semicolonIndex = token . indexOf ( ';' ) ; String sizeToken1 = token . substring ( 4 , semicolonIndex ) ; String sizeToken2 = token . substring ( semicolonIndex + 1 , token . length ( ) - 1 ) ; Size size1 = parseAtomicSize ( sizeToken1 ) ; Size size2 = parseAtomicSize ( sizeToken2 ) ; // Check valid combinations an... |
public class ClassicAdministratorsInner { /** * Gets service administrator , account administrator , and co - administrators for the subscription .
* @ param nextPageLink The NextLink from the previous successful call to List operation .
* @ throws IllegalArgumentException thrown if parameters fail the validation
... | return listNextWithServiceResponseAsync ( nextPageLink ) . map ( new Func1 < ServiceResponse < Page < ClassicAdministratorInner > > , Page < ClassicAdministratorInner > > ( ) { @ Override public Page < ClassicAdministratorInner > call ( ServiceResponse < Page < ClassicAdministratorInner > > response ) { return response... |
public class MysqlDBInitializer { /** * { @ inheritDoc } */
@ Override protected boolean isFunctionExists ( Connection conn , String functionName ) throws SQLException { } } | ResultSet resultSet = null ; try { resultSet = conn . getMetaData ( ) . getFunctions ( conn . getCatalog ( ) , null , "%" ) ; while ( resultSet . next ( ) ) { if ( functionName . equals ( resultSet . getString ( "FUNCTION_NAME" ) ) ) { return true ; } } } catch ( SQLException e ) { if ( LOG . isDebugEnabled ( ) ) { LOG... |
public class AttributeCriterionPane { /** * Return the actual search criterion object , or null if not all fields have been properly filled .
* @ return search criterion */
public AttributeCriterion getSearchCriterion ( ) { } } | Object operator = operatorSelect . getValue ( ) ; if ( operator != null ) { return AttributeCriterionUtil . getSearchCriterion ( layer . getServerLayerId ( ) , selectedAttribute , valueItem , org . geomajas . gwt . client . widget . attribute . AttributeCriterionPane . getOperatorCodeFromLabel ( operator . toString ( )... |
public class HttpSupport { /** * Convenience method to get first parameter values in case < code > multipart / form - data < / code > request was used .
* Returns a map where keys are names of all parameters , while values are first value for each parameter , even
* if such parameter has more than one value submitt... | return RequestUtils . params1st ( formItems ) ; |
public class LCMSRunInfo { /** * If only one instrument is added , it will be set as the default instrument , all the scans , that
* you add to the ScanCollection will implicitly refer to this one instrument .
* @ param id some identifier for mapping instruments . Instrumnt list is normally stored at the
* beginn... | if ( instrument == null || id == null ) { throw new IllegalArgumentException ( "Instruemnt and ID must be non-null values." ) ; } if ( instruments . size ( ) == 0 ) { defaultInstrumentID = id ; } else if ( instruments . size ( ) > 0 && ! isDefaultExplicitlySet ) { unsetDefaultInstrument ( ) ; } instruments . put ( id ,... |
public class ApiOvhClusterhadoop { /** * Get this object properties
* REST : GET / cluster / hadoop / { serviceName } / node / { hostname } / role / { type }
* @ param serviceName [ required ] The internal name of your cluster
* @ param hostname [ required ] Hostname of the node
* @ param type [ required ] Role... | String qPath = "/cluster/hadoop/{serviceName}/node/{hostname}/role/{type}" ; StringBuilder sb = path ( qPath , serviceName , hostname , type ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , OvhRole . class ) ; |
public class LifecycleCallbackHelper { /** * Invokes the class method . The object instance can be null for the application main class .
* @ param clazz the Class object
* @ param methodName the Method name
* @ param instance the instance object of the class . It can be null if the class is the application Main .... | "rawtypes" , "unchecked" } ) public void invokeMethod ( final Class clazz , final String methodName , final Object instance ) { // instance can be null for the static application main method
AccessController . doPrivileged ( new PrivilegedAction ( ) { @ Override public Object run ( ) { try { final Method m = clazz . ge... |
public class LinkedList { /** * Returns the first element in this list .
* @ return the first element in this list
* @ throws NoSuchElementException if this list is empty */
public E getFirst ( ) { } } | final Node < E > f = first ; if ( f == null ) throw new NoSuchElementException ( ) ; return f . item ; |
public class CellUtil { /** * 获取单元格值
* @ param cell { @ link Cell } 单元格
* @ param cellEditor 单元格值编辑器 。 可以通过此编辑器对单元格值做自定义操作
* @ return 值 , 类型可能为 : Date 、 Double 、 Boolean 、 String */
public static Object getCellValue ( Cell cell , CellEditor cellEditor ) { } } | if ( null == cell ) { return null ; } return getCellValue ( cell , cell . getCellTypeEnum ( ) , cellEditor ) ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.