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 tagName ) throws Exception { } } | 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 = ( Element ) nodeList . item ( 0 ) ; Class < ? > beanClass = getBeanClass ( element ) ; BeanDefinitionBuilder builder = BeanDefinitionBuilder . rootBeanDefinition ( beanClass ) ; doParse ( element , builder ) ; DefaultListableBeanFactory factory = new DefaultListableBeanFactory ( ) ; factory . setParentBeanFactory ( SpringUtil . getAppContext ( ) ) ; AbstractBeanDefinition beanDefinition = builder . getBeanDefinition ( ) ; factory . registerBeanDefinition ( tagName , beanDefinition ) ; return factory . getBean ( tagName ) ; |
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 ( LdapSearchScope scope ) { } } | 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 ) resource ; if ( result == null ) { result = new JarEntryDirectoryImpl ( relativeName , this , this ) ; _resources . put ( relativeName , result ) ; _childDirs . add ( result ) ; } return result ; |
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
* @ return the PoolRemoveNodesOptions object itself . */
public PoolRemoveNodesOptions withIfUnmodifiedSince ( DateTime ifUnmodifiedSince ) { } } | 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 typeDefaultInstance , final Message source ) { } } | 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 IOException { } } | 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 GetSequenceFailedException ( "clientId:" + clientId + " authorize failed, return message is empty" ) ; } else { if ( resultMap . get ( "errorCode" ) != null ) { throw new GetSequenceFailedException ( "clientId:" + clientId + " authorize failed, return message is: " + result ) ; } String accessUrl = resultMap . get ( "accessUrl" ) ; String accessToken = resultMap . get ( "accessToken" ) ; if ( accessUrl == null || accessToken == null ) { throw new GetSequenceFailedException ( "clientId:" + clientId + " authorize failed, accessUrl or accessToken is null, detail message is " + result ) ; } try { accessUrl = URLDecoder . decode ( accessUrl . trim ( ) , "UTF-8" ) ; } catch ( UnsupportedEncodingException e ) { throw new GetSequenceFailedException ( e ) ; } this . accessUrl = accessUrl ; this . accessToken = accessToken ; } |
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 GroundyTask > taskClass , Context context ) { } } | 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 . put ( taskClass , groundyTask ) ; } else if ( CACHE . containsKey ( taskClass ) ) { CACHE . remove ( taskClass ) ; } groundyTask . setContext ( context ) ; groundyTask . onCreate ( ) ; return groundyTask ; } catch ( Exception e ) { L . e ( TAG , "Unable to create value for call " + taskClass , e ) ; } return groundyTask ; |
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 during
* the execution of this tag handler instance , and this call will occur
* < strong > BEFORE < / strong > the { @ link UIComponent } is added to
* the view . < / p >
* < p > Tag subclasses that want to support additional set properties
* must ensure that the base class < code > setProperties ( ) < / code >
* method is still called . A typical implementation that supports
* extra properties < code > foo < / code > and < code > bar < / code > would look
* something like this : < / p >
* < pre >
* protected void setProperties ( UIComponent component ) {
* super . setProperties ( component ) ;
* if ( foo ! = null ) {
* component . setAttribute ( " foo " , foo ) ;
* if ( bar ! = null ) {
* component . setAttribute ( " bar " , bar ) ;
* < / pre >
* < p > The default implementation overrides the following properties : < / p >
* < ul >
* < li > < code > rendered < / code > - Set if a value for the
* < code > rendered < / code > property is specified for
* this tag handler instance . < / li >
* < li > < code > rendererType < / code > - Set if the < code > getRendererType ( ) < / code >
* method returns a non - null value . < / li >
* < / ul >
* @ param component { @ link UIComponent } whose properties are to be
* overridden */
protected void setProperties ( UIComponent component ) { } } | // 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 FacesException ( e ) ; } } else { component . setValueExpression ( "rendered" , rendered ) ; } } if ( getRendererType ( ) != null ) { component . setRendererType ( getRendererType ( ) ) ; } |
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 matching commerce notification attachment
* @ throws NoSuchNotificationAttachmentException if a matching commerce notification attachment could not be found */
@ Override public CommerceNotificationAttachment findByUuid_Last ( String uuid , OrderByComparator < CommerceNotificationAttachment > orderByComparator ) throws NoSuchNotificationAttachmentException { } } | 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=" ) ; msg . append ( uuid ) ; msg . append ( "}" ) ; throw new NoSuchNotificationAttachmentException ( msg . toString ( ) ) ; |
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 */
public static H2HeaderField decodeHeader ( WsByteBuffer buffer , H2HeaderTable table , boolean isFirstHeader , boolean isTrailerBlock , H2ConnectionSettings settings ) throws CompressionException { } } | 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 CompressionException ( "Invalid attempt to decode empty or null buffer." ) ; } // Get first byte for header being decoded
byte currentByte = buffer . get ( ) ; buffer . position ( buffer . position ( ) - 1 ) ; // Format this instruction byte so that 4 LSB are set to ' 1 ' ,
// allowing for quick assessment of what instruction this byte
// contains .
byte maskedByte = HpackUtils . format ( currentByte , HpackConstants . MASK_0F ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Operation Byte: " + HpackUtils . byteToHexString ( currentByte ) ) ; } int decodedInteger = 0 ; H2HeaderField header = null ; // If the MSB is 1 , the masked byte will be negative since this is
// a signed byte .
if ( maskedByte < HpackConstants . MASK_00 ) { // Check against the byte ' 100000 ' as the index value of 0
// for indexed headers is not used and MUST be treated as a
// decoding error .
if ( currentByte == HpackConstants . MASK_80 ) { throw new CompressionException ( "An indexed header cannot have an index of 0" ) ; } // Look for the corresponding integer representation - each byte for
// the integer representation decoder , for this case , has N = 7.
decodedInteger = IntegerRepresentation . decode ( buffer , ByteFormatType . INDEXED ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Operation byte indicated header is already indexed at index location: " + decodedInteger + ". Searching table..." ) ; } // Get both header name and value using the given index location .
header = table . getHeaderEntry ( decodedInteger ) ; if ( header == null ) { throw new CompressionException ( "Received an invalid header index" ) ; } checkIsValidH2Header ( header , isTrailerBlock ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Found header: [" + header . getName ( ) + ", " + header . getValue ( ) + "]" ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . exit ( tc , "decodeHeader" ) ; } return header ; } // Not currently index - verify literal index type and handle
// accordingly . There are three types of possible encodings for a < HeaderField > .
// Bits 7 , 6 , and 5 will tell us what type of encoding this is . There is
// also the possibility of a table update command .
else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Header not fully indexed in table, determining indexing type." ) ; } /* * If bit 7 is ' 1 ' , then this LiteralIndexType . INCREMENTAL
* Literal Header Field with Incremental Indexing
* | 0 | 1 | Index ( 6 + ) - - - - - | */
if ( maskedByte >= HpackConstants . MASK_4F ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Indexing decode type: INCREMENTAL" ) ; } header = decodeHeader ( buffer , table , ByteFormatType . INCREMENTAL ) ; } else if ( maskedByte >= HpackConstants . MASK_2F ) { if ( ! isFirstHeader ) { throw new CompressionException ( "dynamic table size update must occur at the beginning of the first header block" ) ; } int fragmentLength = IntegerRepresentation . decode ( buffer , ByteFormatType . TABLE_UPDATE ) ; if ( settings != null && fragmentLength > settings . getHeaderTableSize ( ) ) { throw new CompressionException ( "dynamic table size update size was larger than SETTINGS_HEADER_TABLE_SIZE" ) ; } table . updateTableSize ( fragmentLength ) ; return null ; } /* * Bit 7 is ' 0 ' & bits 6-5 match ' 01 ' , then this is
* LiteralIndexType . NEVERINDEX */
else if ( maskedByte == HpackConstants . MASK_1F ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Indexing decode type: NEVERINDEX" ) ; } header = decodeHeader ( buffer , table , ByteFormatType . NEVERINDEX ) ; } /* * Bit 7 is ' 0 ' & bits 6-5 match ' 00 ' , then this is
* LiteralIndexType . NOINDEXING */
else if ( maskedByte == HpackConstants . MASK_0F ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Indexing decode type: NOINDEXING" ) ; } header = decodeHeader ( buffer , table , ByteFormatType . NOINDEXING ) ; } } checkIsValidH2Header ( header , isTrailerBlock ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Decoded the header: [" + header . getName ( ) + ", " + header . getValue ( ) + "]" ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . exit ( tc , "decodeHeader" ) ; } return header ; |
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 updates the upstream control with this new completed prefix
* @ param m The value tickRange */
public void writeSilenceForced ( TickRange vtr ) { } } | 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 , "writeSilenceForced from: " + start + " to " + end + " on Stream " + streamID ) ; } TickRange tr = new TickRange ( TickRange . Completed , start , end ) ; synchronized ( this ) { tr = oststream . writeCompletedRangeForced ( tr ) ; try { if ( tr . startstamp == 0 ) { // we are completed up to this point so we can
// simulate receiving an ack . This will enable the
// src stream to remove the msg from the store if it is no longer
// needed
writeAckPrefix ( tr . endstamp ) ; } } catch ( SIResourceException e ) { FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.gd.InternalOutputStream.writeSilenceForced" , "1:1273:1.83.1.1" , this ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "writeSilenceForced" ) ; |
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 ( dumpDir != null ) { dumpResources ( classes , dumpDir ) ; } final CompilationResult result = this . compiler . compile ( classes , this . src , this . packageStoreWrapper , rootClassLoader ) ; // this will sort out the errors based on what class / file they happened in
if ( result . getErrors ( ) . length > 0 ) { for ( int i = 0 ; i < result . getErrors ( ) . length ; i ++ ) { final CompilationProblem err = result . getErrors ( ) [ i ] ; final ErrorHandler handler = this . errorHandlers . get ( err . getFileName ( ) ) ; handler . addError ( err ) ; } final Collection errors = this . errorHandlers . values ( ) ; for ( Object error : errors ) { final ErrorHandler handler = ( ErrorHandler ) error ; if ( handler . isInError ( ) ) { this . results . add ( handler . getError ( ) ) ; } } } // We ' ve compiled everthing , so clear it for the next set of additions
this . generatedClassList . clear ( ) ; this . errorHandlers . clear ( ) ; |
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 you want to override
* the existing values .
* @ param results
* A list of < code > MLModel < / code > that meet the search criteria .
* @ return Returns a reference to this object so that method calls can be chained together . */
public DescribeMLModelsResult withResults ( MLModel ... results ) { } } | 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 . TILE_SET_COLOR__SIZE2 : setSIZE2 ( ( Integer ) newValue ) ; return ; case AfplibPackage . TILE_SET_COLOR__SIZE3 : setSIZE3 ( ( Integer ) newValue ) ; return ; case AfplibPackage . TILE_SET_COLOR__SIZE4 : setSIZE4 ( ( Integer ) newValue ) ; return ; case AfplibPackage . TILE_SET_COLOR__CVAL1 : setCVAL1 ( ( Integer ) newValue ) ; return ; case AfplibPackage . TILE_SET_COLOR__CVAL2 : setCVAL2 ( ( Integer ) newValue ) ; return ; case AfplibPackage . TILE_SET_COLOR__CVAL3 : setCVAL3 ( ( Integer ) newValue ) ; return ; case AfplibPackage . TILE_SET_COLOR__CVAL4 : setCVAL4 ( ( Integer ) newValue ) ; return ; } super . eSet ( featureID , newValue ) ; |
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 ListDocumentsResponse listDocuments ( String status , String marker , int maxSize ) { } } | ListDocumentsRequest request = new ListDocumentsRequest ( ) ; InternalRequest internalRequest = this . createRequest ( HttpMethodName . GET , request , DOC ) ; internalRequest . addParameter ( "status" , status ) ; if ( marker != null ) { internalRequest . addParameter ( "marker" , marker ) ; } internalRequest . addParameter ( "maxSize" , String . valueOf ( maxSize ) ) ; ListDocumentsResponse response ; try { response = this . invokeHttpClient ( internalRequest , ListDocumentsResponse . class ) ; } finally { try { internalRequest . getContent ( ) . close ( ) ; } catch ( Exception e ) { // ignore exception
} } return response ; |
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 generation . */
public String getPreviewPlan ( ) throws ProgramInvocationException { } } | Thread . currentThread ( ) . setContextClassLoader ( this . getUserCodeClassLoader ( ) ) ; List < DataSinkNode > previewPlan ; if ( isUsingProgramEntryPoint ( ) ) { previewPlan = PactCompiler . createPreOptimizedPlan ( getPlan ( ) ) ; } else if ( isUsingInteractiveMode ( ) ) { // temporary hack to support the web client
PreviewPlanEnvironment env = new PreviewPlanEnvironment ( ) ; env . setAsContext ( ) ; try { invokeInteractiveModeForExecution ( ) ; } catch ( ProgramInvocationException e ) { throw e ; } catch ( Throwable t ) { // the invocation gets aborted with the preview plan
if ( env . previewPlan != null ) { previewPlan = env . previewPlan ; } else { throw new ProgramInvocationException ( "The program caused an error: " , t ) ; } } if ( env . previewPlan != null ) { previewPlan = env . previewPlan ; } else { throw new ProgramInvocationException ( "The program plan could not be fetched. The program silently swallowed the control flow exceptions." ) ; } } else { throw new RuntimeException ( ) ; } PlanJSONDumpGenerator jsonGen = new PlanJSONDumpGenerator ( ) ; StringWriter string = new StringWriter ( 1024 ) ; PrintWriter pw = null ; try { pw = new PrintWriter ( string ) ; jsonGen . dumpPactPlanAsJSON ( previewPlan , pw ) ; } finally { pw . close ( ) ; } return string . toString ( ) ; |
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 ( neighbourTile != tile ) { buildExternalLink ( tile , node , neighbourTile ) ; } else { Poly neighbour = graphData . getNode ( connection - nodeOffset ) ; buildInternalLink ( tile , node , neighbourTile , neighbour ) ; } } } |
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 . append ( htmlModule ( module , i ) ) ; } return html . toString ( ) ; |
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 the string with any replacements applied */
public static String replaceLast ( String source , String pattern , String replacement ) { } } | 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 calculated arc tangens { @ link BigDecimal } with the precision specified in the default { @ link MathContext }
* @ see # setDefaultMathContext ( MathContext )
* @ see # atan2 ( BigDecimal , BigDecimal ) */
public static BigDecimal atan2 ( BigDecimal y , BigDecimal x ) { } } | 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 > destination ) throws Exception { } } | 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 obtained from { @ link # toObservable ( ) } .
* < b > Callback Scheduling < / b >
* < ul >
* < li > When using { @ link ExecutionIsolationStrategy # THREAD } this defaults to using { @ link Schedulers # computation ( ) } for callbacks . < / li >
* < li > When using { @ link ExecutionIsolationStrategy # SEMAPHORE } this defaults to using { @ link Schedulers # immediate ( ) } for callbacks . < / li >
* < / ul >
* Use { @ link # toObservable ( rx . Scheduler ) } to schedule the callback differently .
* See https : / / github . com / Netflix / RxJava / wiki for more information .
* @ return { @ code Observable < R > } that executes and calls back with the result of of { @ link HystrixCommand } { @ code < BatchReturnType > } execution after mapping
* the { @ code < BatchReturnType > } into { @ code < ResponseType > } */
public Observable < ResponseType > observe ( ) { } } | // 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 while the execution has already started
return subject . doOnUnsubscribe ( new Action0 ( ) { @ Override public void call ( ) { underlyingSubscription . unsubscribe ( ) ; } } ) ; |
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 stack , or an attached policy that explicitly grants permissions . For more information about user
* permissions , see < a
* href = " http : / / docs . aws . amazon . com / opsworks / latest / userguide / opsworks - security - users . html " > Managing User
* Permissions < / a > .
* @ param describeCommandsRequest
* @ return Result of the DescribeCommands operation returned by the service .
* @ throws ValidationException
* Indicates that a request was not valid .
* @ throws ResourceNotFoundException
* Indicates that a resource was not found .
* @ sample AWSOpsWorks . DescribeCommands
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / opsworks - 2013-02-18 / DescribeCommands " target = " _ top " > AWS API
* Documentation < / a > */
@ Override public DescribeCommandsResult describeCommands ( DescribeCommandsRequest request ) { } } | 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 [ TypeArguments ] Creator
* | " ( " Arguments " ) " " - > " ( Expression | Block )
* | Ident " - > " ( Expression | Block )
* | [ Annotations ] Ident { " . " [ Annotations ] Ident }
* | Expression3 MemberReferenceSuffix
* [ [ Annotations ] " [ " ( " ] " BracketsOpt " . " CLASS | Expression " ] " )
* | Arguments
* | " . " ( CLASS | THIS | [ TypeArguments ] SUPER Arguments | NEW [ TypeArguments ] InnerCreator )
* | BasicType BracketsOpt " . " CLASS
* PrefixOp = " + + " | " - - " | " ! " | " ~ " | " + " | " - "
* PostfixOp = " + + " | " - - "
* Type3 = Ident { " . " Ident } [ TypeArguments ] { TypeSelector } BracketsOpt
* | BasicType
* TypeNoParams3 = Ident { " . " Ident } BracketsOpt
* Selector = " . " [ TypeArguments ] Ident [ Arguments ]
* | " . " THIS
* | " . " [ TypeArguments ] SUPER SuperSuffix
* | " . " NEW [ TypeArguments ] InnerCreator
* | " [ " Expression " ] "
* TypeSelector = " . " Ident [ TypeArguments ]
* SuperSuffix = Arguments | " . " Ident [ Arguments ] */
protected JCExpression term3 ( ) { } } | 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 BANG : case TILDE : case PLUS : case SUB : if ( typeArgs == null && ( mode & EXPR ) != 0 ) { TokenKind tk = token . kind ; nextToken ( ) ; mode = EXPR ; if ( tk == SUB && ( token . kind == INTLITERAL || token . kind == LONGLITERAL ) && token . radix ( ) == 10 ) { mode = EXPR ; t = literal ( names . hyphen , pos ) ; } else { t = term3 ( ) ; return F . at ( pos ) . Unary ( unoptag ( tk ) , t ) ; } } else return illegal ( ) ; break ; case LPAREN : if ( typeArgs == null && ( mode & EXPR ) != 0 ) { ParensResult pres = analyzeParens ( ) ; switch ( pres ) { case CAST : accept ( LPAREN ) ; mode = TYPE ; int pos1 = pos ; List < JCExpression > targets = List . of ( t = term3 ( ) ) ; while ( token . kind == AMP ) { checkIntersectionTypesInCast ( ) ; accept ( AMP ) ; targets = targets . prepend ( term3 ( ) ) ; } if ( targets . length ( ) > 1 ) { t = toP ( F . at ( pos1 ) . TypeIntersection ( targets . reverse ( ) ) ) ; } accept ( RPAREN ) ; mode = EXPR ; JCExpression t1 = term3 ( ) ; return F . at ( pos ) . TypeCast ( t , t1 ) ; case IMPLICIT_LAMBDA : case EXPLICIT_LAMBDA : t = lambdaExpressionOrStatement ( true , pres == ParensResult . EXPLICIT_LAMBDA , pos ) ; break ; default : // PARENS
accept ( LPAREN ) ; mode = EXPR ; t = termRest ( term1Rest ( term2Rest ( term3 ( ) , TreeInfo . orPrec ) ) ) ; accept ( RPAREN ) ; t = toP ( F . at ( pos ) . Parens ( t ) ) ; break ; } } else { return illegal ( ) ; } break ; case THIS : if ( ( mode & EXPR ) != 0 ) { mode = EXPR ; t = to ( F . at ( pos ) . Ident ( names . _this ) ) ; nextToken ( ) ; if ( typeArgs == null ) t = argumentsOpt ( null , t ) ; else t = arguments ( typeArgs , t ) ; typeArgs = null ; } else return illegal ( ) ; break ; case SUPER : if ( ( mode & EXPR ) != 0 ) { mode = EXPR ; t = to ( F . at ( pos ) . Ident ( names . _super ) ) ; t = superSuffix ( typeArgs , t ) ; typeArgs = null ; } else return illegal ( ) ; break ; case INTLITERAL : case LONGLITERAL : case FLOATLITERAL : case DOUBLELITERAL : case CHARLITERAL : case STRINGLITERAL : case TRUE : case FALSE : case NULL : if ( typeArgs == null && ( mode & EXPR ) != 0 ) { mode = EXPR ; t = literal ( names . empty ) ; } else return illegal ( ) ; break ; case NEW : if ( typeArgs != null ) return illegal ( ) ; if ( ( mode & EXPR ) != 0 ) { mode = EXPR ; nextToken ( ) ; if ( token . kind == LT ) typeArgs = typeArguments ( false ) ; t = creator ( pos , typeArgs ) ; typeArgs = null ; } else return illegal ( ) ; break ; case MONKEYS_AT : // Only annotated cast types and method references are valid
List < JCAnnotation > typeAnnos = typeAnnotationsOpt ( ) ; if ( typeAnnos . isEmpty ( ) ) { // else there would be no ' @ '
throw new AssertionError ( "Expected type annotations, but found none!" ) ; } JCExpression expr = term3 ( ) ; if ( ( mode & TYPE ) == 0 ) { // Type annotations on class literals no longer legal
switch ( expr . getTag ( ) ) { case REFERENCE : { JCMemberReference mref = ( JCMemberReference ) expr ; mref . expr = toP ( F . at ( pos ) . AnnotatedType ( typeAnnos , mref . expr ) ) ; t = mref ; break ; } case SELECT : { JCFieldAccess sel = ( JCFieldAccess ) expr ; if ( sel . name != names . _class ) { return illegal ( ) ; } else { log . error ( token . pos , "no.annotations.on.dot.class" ) ; return expr ; } } default : return illegal ( typeAnnos . head . pos ) ; } } else { // Type annotations targeting a cast
t = insertAnnotationsToMostInner ( expr , typeAnnos , false ) ; } break ; case UNDERSCORE : case IDENTIFIER : case ASSERT : case ENUM : if ( typeArgs != null ) return illegal ( ) ; if ( ( mode & EXPR ) != 0 && peekToken ( ARROW ) ) { t = lambdaExpressionOrStatement ( false , false , pos ) ; } else { t = toP ( F . at ( token . pos ) . Ident ( ident ( ) ) ) ; loop : while ( true ) { pos = token . pos ; final List < JCAnnotation > annos = typeAnnotationsOpt ( ) ; // need to report an error later if LBRACKET is for array
// index access rather than array creation level
if ( ! annos . isEmpty ( ) && token . kind != LBRACKET && token . kind != ELLIPSIS ) return illegal ( annos . head . pos ) ; switch ( token . kind ) { case LBRACKET : nextToken ( ) ; if ( token . kind == RBRACKET ) { nextToken ( ) ; t = bracketsOpt ( t ) ; t = toP ( F . at ( pos ) . TypeArray ( t ) ) ; if ( annos . nonEmpty ( ) ) { t = toP ( F . at ( pos ) . AnnotatedType ( annos , t ) ) ; } // . class is only allowed if there were no annotations
JCExpression nt = bracketsSuffix ( t ) ; if ( nt != t && ( annos . nonEmpty ( ) || TreeInfo . containsTypeAnnotation ( t ) ) ) { // t and nt are different if bracketsSuffix parsed a . class .
// The check for nonEmpty covers the case when the whole array is annotated .
// Helper method isAnnotated looks for annos deeply within t .
syntaxError ( "no.annotations.on.dot.class" ) ; } t = nt ; } else { if ( ( mode & EXPR ) != 0 ) { mode = EXPR ; JCExpression t1 = term ( ) ; if ( ! annos . isEmpty ( ) ) t = illegal ( annos . head . pos ) ; t = to ( F . at ( pos ) . Indexed ( t , t1 ) ) ; } accept ( RBRACKET ) ; } break loop ; case LPAREN : if ( ( mode & EXPR ) != 0 ) { mode = EXPR ; t = arguments ( typeArgs , t ) ; if ( ! annos . isEmpty ( ) ) t = illegal ( annos . head . pos ) ; typeArgs = null ; } break loop ; case DOT : nextToken ( ) ; int oldmode = mode ; mode &= ~ NOPARAMS ; typeArgs = typeArgumentsOpt ( EXPR ) ; mode = oldmode ; if ( ( mode & EXPR ) != 0 ) { switch ( token . kind ) { case CLASS : if ( typeArgs != null ) return illegal ( ) ; mode = EXPR ; t = to ( F . at ( pos ) . Select ( t , names . _class ) ) ; nextToken ( ) ; break loop ; case THIS : if ( typeArgs != null ) return illegal ( ) ; mode = EXPR ; t = to ( F . at ( pos ) . Select ( t , names . _this ) ) ; nextToken ( ) ; break loop ; case SUPER : mode = EXPR ; t = to ( F . at ( pos ) . Select ( t , names . _super ) ) ; t = superSuffix ( typeArgs , t ) ; typeArgs = null ; break loop ; case NEW : if ( typeArgs != null ) return illegal ( ) ; mode = EXPR ; int pos1 = token . pos ; nextToken ( ) ; if ( token . kind == LT ) typeArgs = typeArguments ( false ) ; t = innerCreator ( pos1 , typeArgs , t ) ; typeArgs = null ; break loop ; } } List < JCAnnotation > tyannos = null ; if ( ( mode & TYPE ) != 0 && token . kind == MONKEYS_AT ) { tyannos = typeAnnotationsOpt ( ) ; } // typeArgs saved for next loop iteration .
t = toP ( F . at ( pos ) . Select ( t , ident ( ) ) ) ; if ( tyannos != null && tyannos . nonEmpty ( ) ) { t = toP ( F . at ( tyannos . head . pos ) . AnnotatedType ( tyannos , t ) ) ; } break ; case ELLIPSIS : if ( this . permitTypeAnnotationsPushBack ) { this . typeAnnotationsPushedBack = annos ; } else if ( annos . nonEmpty ( ) ) { // Don ' t return here - - error recovery attempt
illegal ( annos . head . pos ) ; } break loop ; case LT : if ( ( mode & TYPE ) == 0 && isUnboundMemberRef ( ) ) { // this is an unbound method reference whose qualifier
// is a generic type i . e . A < S > : : m
int pos1 = token . pos ; accept ( LT ) ; ListBuffer < JCExpression > args = new ListBuffer < JCExpression > ( ) ; args . append ( typeArgument ( ) ) ; while ( token . kind == COMMA ) { nextToken ( ) ; args . append ( typeArgument ( ) ) ; } accept ( GT ) ; t = toP ( F . at ( pos1 ) . TypeApply ( t , args . toList ( ) ) ) ; checkGenerics ( ) ; while ( token . kind == DOT ) { nextToken ( ) ; mode = TYPE ; t = toP ( F . at ( token . pos ) . Select ( t , ident ( ) ) ) ; t = typeArgumentsOpt ( t ) ; } t = bracketsOpt ( t ) ; if ( token . kind != COLCOL ) { // method reference expected here
t = illegal ( ) ; } mode = EXPR ; return term3Rest ( t , typeArgs ) ; } break loop ; default : break loop ; } } } if ( typeArgs != null ) illegal ( ) ; t = typeArgumentsOpt ( t ) ; break ; case BYTE : case SHORT : case CHAR : case INT : case LONG : case FLOAT : case DOUBLE : case BOOLEAN : if ( typeArgs != null ) illegal ( ) ; t = bracketsSuffix ( bracketsOpt ( basicType ( ) ) ) ; break ; case VOID : if ( typeArgs != null ) illegal ( ) ; if ( ( mode & EXPR ) != 0 ) { nextToken ( ) ; if ( token . kind == DOT ) { JCPrimitiveTypeTree ti = toP ( F . at ( pos ) . TypeIdent ( TypeTag . VOID ) ) ; t = bracketsSuffix ( ti ) ; } else { return illegal ( pos ) ; } } else { // Support the corner case of myMethodHandle . < void > invoke ( ) by passing
// a void type ( like other primitive types ) to the next phase .
// The error will be reported in Attr . attribTypes or Attr . visitApply .
JCPrimitiveTypeTree ti = to ( F . at ( pos ) . TypeIdent ( TypeTag . VOID ) ) ; nextToken ( ) ; return ti ; // return illegal ( ) ;
} break ; default : return illegal ( ) ; } return term3Rest ( t , typeArgs ) ; |
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 < code > null < / code > )
* @ return the first matching commerce notification template , or < code > null < / code > if a matching commerce notification template could not be found */
public static CommerceNotificationTemplate fetchByG_E_First ( long groupId , boolean enabled , OrderByComparator < CommerceNotificationTemplate > orderByComparator ) { } } | 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 parameters specifying the image to copy and the source container registry .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the { @ link ServiceResponse } object if successful . */
public Observable < Void > beginImportImageAsync ( String resourceGroupName , String registryName , ImportImageParameters parameters ) { } } | 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 . emptyMap ( ) , violation . getMessage ( ) , ( ( SerializeableConstraintValidationImpl < Object > ) violation ) . getRootBeanClass ( ) , pclass , violation . getLeafBean ( ) , null , violation . getPropertyPath ( ) , violation . getConstraintDescriptor ( ) , null , null ) ) . collect ( Collectors . toList ( ) ) ) ; |
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 enumClass
* @ return */
public static < T extends Enum < ? > > String getEnumValuesAsString ( Class < T > enumClass ) { } } | // 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 ( vals [ i ] . name ( ) ) ; str . append ( ", " ) ; } str . append ( "or " ) ; str . append ( vals [ vals . length - 1 ] . name ( ) ) ; } return str . toString ( ) ; |
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 word : sspace . getWords ( ) ) { Vector v = sspace . getVector ( word ) ; double sim = Similarity . cosineSimilarity ( v1 , v ) ; if ( sim > baseSim ) rank ++ ; } return rank ; |
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 specified , full array reduction is performed
* @ return Reduced array of rank ( input rank - num dimensions ) */
public SDVariable argmax ( SDVariable in , int ... dimensions ) { } } | 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 initialized .
* 3 . Reads the entire contents of the DurableDataLog , extracts Operations , and updates the Metadata and other
* components ( via MemoryStateUpdater ) based on their contents .
* 4 . Metadata is taken out of recovery mode .
* @ return The number of Operations recovered .
* @ throws Exception If an exception occurred . This could be one of the following :
* * DataLogWriterNotPrimaryException : If unable to acquire DurableDataLog ownership or the ownership
* has been lost in the process .
* * DataCorruptionException : If an unrecoverable corruption has been detected with the recovered data .
* * SerializationException : If a DataFrame or Operation was unable to be deserialized .
* * IOException : If a general IO exception occurred . */
public int performRecovery ( ) throws Exception { } } | 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 metadata .
this . metadata . reset ( ) ; OperationMetadataUpdater metadataUpdater = new OperationMetadataUpdater ( this . metadata ) ; this . stateUpdater . enterRecoveryMode ( metadataUpdater ) ; boolean successfulRecovery = false ; int recoveredItemCount ; try { recoveredItemCount = recoverAllOperations ( metadataUpdater ) ; this . metadata . setContainerEpoch ( this . durableDataLog . getEpoch ( ) ) ; log . info ( "{} Recovery completed. Epoch = {}, Items Recovered = {}, Time = {}ms." , this . traceObjectId , this . metadata . getContainerEpoch ( ) , recoveredItemCount , timer . getElapsedMillis ( ) ) ; successfulRecovery = true ; } finally { // We must exit recovery mode when done , regardless of outcome .
this . metadata . exitRecoveryMode ( ) ; this . stateUpdater . exitRecoveryMode ( successfulRecovery ) ; } LoggerHelpers . traceLeave ( log , this . traceObjectId , "performRecovery" , traceId ) ; return recoveredItemCount ; |
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 instance ) { } } | 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 mat The matrix that the determinant is to be computed from
* @ return The determinant . */
public static double recursive ( DMatrixRMaj mat ) { } } | 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 ; i ++ ) { DMatrixRMaj minorMat = new DMatrixRMaj ( mat . numRows - 1 , mat . numRows - 1 ) ; for ( int j = 1 ; j < mat . numRows ; j ++ ) { for ( int k = 0 ; k < mat . numRows ; k ++ ) { if ( k < i ) { minorMat . set ( j - 1 , k , mat . get ( j , k ) ) ; } else if ( k > i ) { minorMat . set ( j - 1 , k - 1 , mat . get ( j , k ) ) ; } } } if ( i % 2 == 0 ) result += mat . get ( 0 , i ) * recursive ( minorMat ) ; else result -= mat . get ( 0 , i ) * recursive ( minorMat ) ; } return result ; |
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 , String value , int propertyIndex ) { } } | 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 init parameter ' s name
* @ param defaultValue
* the value by default if null or empty
* @ return the parameter if it was specified and was not empty , < code > null < / code > otherwise
* @ throws NullPointerException
* if context or name is < code > null < / code > */
public static String getStringInitParameter ( ExternalContext context , String name , String defaultValue ) { } } | 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 ( ) ) . append ( '\'' ) ; if ( getPortB ( ) != - 1 ) str . append ( " portb='" ) . append ( getPortB ( ) ) . append ( '\'' ) ; if ( getHostA ( ) != null ) str . append ( " hosta='" ) . append ( getHostA ( ) ) . append ( '\'' ) ; if ( getHostB ( ) != null ) str . append ( " hostb='" ) . append ( getHostB ( ) ) . append ( '\'' ) ; return str . toString ( ) ; |
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 key is null . */
public JSONWriter key ( String string ) throws JSONException { } } | 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 + "\"" ) ; } topObject . put ( string , true ) ; if ( this . comma ) { this . writer . append ( ',' ) ; } this . writer . append ( JSONObject . quote ( string ) ) ; this . writer . append ( ':' ) ; this . comma = false ; this . mode = 'o' ; return this ; } catch ( IOException e ) { // Android as of API 25 does not support this exception constructor
// however we won ' t worry about it . If an exception is happening here
// it will just throw a " Method not found " exception instead .
throw new JSONException ( e ) ; } } throw new JSONException ( "Misplaced key." ) ; |
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 , which is
// important because some systems have small limits on the maximum length of
// a file ( e . g . , ~ 256 characters ) . However , it means that other parts of
// Gin must reference the fragment using its canonical class name , to avoid
// ambiguity .
return injectorClassName + "_fragment" ; |
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 hasFieldAnnotation ( final String fieldAnnotationName ) { } } | 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 ,
* either WIDE or ABBREVIATED . There are no NARROW quarters . */
public void setQuarters ( String [ ] newQuarters , int context , int width ) { } } | 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 STANDALONE : switch ( width ) { case WIDE : standaloneQuarters = duplicate ( newQuarters ) ; break ; case ABBREVIATED : standaloneShortQuarters = duplicate ( newQuarters ) ; break ; case NARROW : // standaloneNarrowQuarters = duplicate ( newQuarters ) ;
break ; default : // HANDLE SHORT , etc .
break ; } break ; } |
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 ( ) , m . getSignature ( ) , et == null ? null : et . getExceptionNames ( ) ) ) ; } } return methodInfos ; |
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 ( innerInstance != null ) { injectAndPostConstruct ( innerInstance ) ; } } return instance ; |
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 we fail quietly anyway
// just to be safe .
continue ; } for ( Reference ref : getReferences ( symbol ) ) { Node currentNode = ref . getNode ( ) ; if ( ! currentNode . isQualifiedName ( ) ) { continue ; } while ( currentNode . isGetProp ( ) ) { currentNode = currentNode . getFirstChild ( ) ; String name = currentNode . getQualifiedName ( ) ; if ( name != null ) { Symbol namespace = isAnySymbolDeclared ( name , currentNode , root . scope ) ; if ( namespace == null ) { namespace = root . scope . getQualifiedSlot ( name ) ; } if ( namespace == null && root . scope . isGlobalScope ( ) ) { namespace = declareSymbol ( name , registry . getNativeType ( JSTypeNative . UNKNOWN_TYPE ) , true , root . scope , currentNode , null /* JsDoc info */
) ; } if ( namespace != null ) { namespace . defineReferenceAt ( currentNode ) ; } } } } } |
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 to
* override the existing values .
* @ param tableList
* A list of the requested < code > Table < / code > objects .
* @ return Returns a reference to this object so that method calls can be chained together . */
public GetTablesResult withTableList ( Table ... tableList ) { } } | 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 wellFormed the well formed string to convert
* @ return the CPE URI encoded representation of the well formed string
* @ throws CpeEncodingException thrown if the string provided is not well
* formed */
public static String wellFormedToCpeUri ( String wellFormed ) throws CpeEncodingException { } } | 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 StringBuilder ( wellFormed . length ( ) + 10 ) ; for ( int x = 0 ; x < bytes . length ; x ++ ) { byte c = bytes [ x ] ; if ( ( c >= '0' && c <= '9' ) || ( c >= 'a' && c <= 'z' ) || ( c >= 'A' && c <= 'Z' ) ) { sb . append ( ( char ) c ) ; } else if ( c == '\\' ) { x += 1 ; if ( x >= bytes . length ) { throw new CpeEncodingException ( "Invalid Well Formed string - ends with an unquoted backslash" ) ; } c = bytes [ x ] ; if ( c == '_' || c == '.' || c == '-' ) { sb . append ( ( char ) c ) ; } else { // consider . append ( Integer . toHexString ( c ) )
sb . append ( '%' ) . append ( HEX_CHARS [ ( c & 0xF0 ) >>> 4 ] ) . append ( HEX_CHARS [ c & 0x0F ] ) ; } } else if ( c == '*' ) { sb . append ( "%02" ) ; } else if ( c == '?' ) { sb . append ( "%01" ) ; } else { throw new CpeEncodingException ( "Invalid Well Formed string - unexpected characters: " + wellFormed ) ; } } return sb . toString ( ) ; } catch ( UnsupportedEncodingException ex ) { throw new CpeEncodingException ( "UTF-8 encoding is not supported on this JVM?" , ex ) ; } |
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 . tensorflow . TensorSliceProto . Extent extent = 1 ; < / code > */
public java . util . List < ? extends org . tensorflow . framework . TensorSliceProto . ExtentOrBuilder > getExtentOrBuilderList ( ) { } } | 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 PatternFlatSelectFunction < IN , OUT > function ) { } } | 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 property is not found , or if the value is other
* than " yes " .
* @ param key the property key .
* @ param props the list of properties that will be searched .
* @ return the value in this property list as a boolean value , or false
* if null or not " yes " . */
public static boolean getBooleanProperty ( String key , Properties props ) { } } | 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 theTaskDeadlinesServiceImpl to work the first time ,
// so we try again , since by then the initialization is already done .
taskService = super . newTaskService ( ) ; } return taskService ; |
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
* @ throws com . thinkaurelius . titan . core . TitanException if clearing the storage is unsuccessful */
public static final void clear ( TitanGraph graph ) { } } | 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 can be cleared." ) ; final GraphDatabaseConfiguration config = g . getConfiguration ( ) ; BackendOperation . execute ( new Callable < Boolean > ( ) { @ Override public Boolean call ( ) throws Exception { config . getBackend ( ) . clearStorage ( ) ; return true ; } @ Override public String toString ( ) { return "ClearBackend" ; } } , Duration . ofSeconds ( 20 ) ) ; |
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_BINDING ) ; protocolMarshaller . marshall ( applicationSummary . getApplicationStatus ( ) , APPLICATIONSTATUS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
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 prevent baseList ' s concrete type from getting picked up by < j : forEach > in view
return updateFirstTransientBuildKey ( toPageEntries ( baseList ) ) ; } |
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 ) ; printHelpForCancel ( customCommandLines ) ; printHelpForSavepoint ( customCommandLines ) ; System . out . println ( ) ; |
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 , DMatrix6 out ) { } } | 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 ( ) , ATTRIBUTENAME_BINDING ) ; protocolMarshaller . marshall ( getAttributeValuesRequest . getNextToken ( ) , NEXTTOKEN_BINDING ) ; protocolMarshaller . marshall ( getAttributeValuesRequest . getMaxResults ( ) , MAXRESULTS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
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 epicIid the IID of the epic to get
* @ return an Optional instance with the specified Epic as a value */
public Optional < Epic > getOptionalEpic ( Object groupIdOrPath , Integer epicIid ) { } } | 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 must be a size
* constant .
* @ param token a token for a bounded size , e . g . " max ( 50dlu ; pref ) "
* @ param setMax if true we set a maximum size , otherwise a minimum size
* @ return a Size that represents the parse result */
private Size parseOldBoundedSize ( String token , boolean setMax ) { } } | 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 and set min or max .
if ( isConstant ( size1 ) ) { if ( size2 instanceof Sizes . ComponentSize ) { return new BoundedSize ( size2 , setMax ? null : size1 , setMax ? size1 : null ) ; } throw new IllegalArgumentException ( "Bounded sizes must not be both constants." ) ; } if ( isConstant ( size2 ) ) { return new BoundedSize ( size1 , setMax ? null : size2 , setMax ? size2 : null ) ; } throw new IllegalArgumentException ( "Bounded sizes must not be both logical." ) ; |
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 the observable to the PagedList & lt ; ClassicAdministratorInner & gt ; object */
public Observable < Page < ClassicAdministratorInner > > listNextAsync ( final String nextPageLink ) { } } | return listNextWithServiceResponseAsync ( nextPageLink ) . map ( new Func1 < ServiceResponse < Page < ClassicAdministratorInner > > , Page < ClassicAdministratorInner > > ( ) { @ Override public Page < ClassicAdministratorInner > call ( ServiceResponse < Page < ClassicAdministratorInner > > response ) { return response . body ( ) ; } } ) ; |
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 . debug ( "SQLException occurs while checking the function " + functionName , e ) ; } return false ; } finally { JDBCUtils . freeResources ( resultSet , null , null ) ; } return false ; |
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 ( ) ) ) ; } return null ; |
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 submitted .
* @ param formItems form items retrieved from < code > multipart / form - data < / code > request .
* @ return 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 submitted . */
protected Map < String , String > params1st ( List < FormItem > formItems ) { } } | 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
* beginning of the run file , so it ' s a mapping from this list , to instrument ID specified for
* each spectrumRef . */
public void addInstrument ( Instrument instrument , String id ) { } } | 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 , instrument ) ; |
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 name */
public OvhRole serviceName_node_hostname_role_type_GET ( String serviceName , String hostname , net . minidev . ovh . api . cluster . hadoop . OvhRoleTypeEnum type ) throws IOException { } } | 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 . */
@ SuppressWarnings ( { } } | "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 . getDeclaredMethod ( methodName ) ; if ( ! m . isAccessible ( ) ) { m . setAccessible ( true ) ; m . invoke ( instance ) ; m . setAccessible ( false ) ; return m ; } else { m . invoke ( instance ) ; return m ; } } catch ( Exception e ) { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , e . getMessage ( ) ) ; } return null ; } } } ) ; |
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.