Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4137085

stddoclet?: Design By Contract Support (@inv, @pre, @post)

XMLWordPrintable

    • generic, x86, sparc
    • generic, solaris_2.6, windows_95



      Name: tb29552 Date: 05/11/98


      I wonder if you would consider an enhancement
      request to include documentation tags to support
      "Design By Contract" - @inv, Class Invariant;
      @pre, Precondition; and @post, Postcondition.
      Currently, I am using the following convoluted
      html syntax to capture the relevant details:

        /**
         * Deposit money.
         <p>
           <font color="Teal">
      <strong> Precondition: </strong>
      </font>
      <strong> [ amount &gt; 0.00 ]; </strong>
      <font color="Blue">
             <em><strong> &quot;Amount must be positive.&quot; </strong></em>
      </font>
         </p>
         
         <p>
           <font color="Teal">
      <strong> Postcondition: </strong>
      </font>
             <strong> [ newBalance = oldBalance + amount ]; </strong>
      <font color="Blue">
      <em><strong> &quot;New balance must be equal to old balance plus amount.&quot; </strong></em>
      </font>
         </p>
         * @param amount java.lang.double
         */
        public void deposit( double amount )
        {
          /* Update balance */
          setBalance( amount );

          /* Instruct observable component to notify IObservers to
             pass SBAccountModel as observed and "state" as change code */
          this.observableComponent.notifyIObservers( this, "balance" );
        }
      (Review ID: 30092)
      ======================================================================

            bpatel Bhavesh Patel (Inactive)
            tbell Tim Bell
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: