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

(soa) Mirror api should grant access to the code for copying it when generating files

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Won't Fix
    • Icon: P5 P5
    • None
    • 5.0
    • core-libs

      Name: jl125535 Date: 06/23/2004


      A DESCRIPTION OF THE REQUEST :
      The mirror api should grant access to the code segments for copying them when generating new files.

      JUSTIFICATION :
      Sometimes when generating new source files they should contain fragments of the original sources.

      Example:

      Source file:
      @Remote public class MyRemote {
          @Remote public void printSomething(final String s) {
              System.out.println(s);
          }
      }

      Generated file:
      public class MyRemote extends UnicastRemoteObject implements Remote {
          public MyRemote() throws RemoteException { }
          public void printSomething(final String s) throws RemoteException {
               System.out.println(s);
          }
      }

        To generate the new source file, the method content fragment of the original source file is required.

      Another example:

      Original source file:
      public class Date {
          // ...
          @PreCondition("day > 0", "day < 32")
          public void setDay(final int day) {
              this.day = day;
          }
      }

      Generated source file:
      public class Date {
          // ...
          @PreCondition("day > 0", "day < 32")
          public void setDay(final int day) {
              if (!(day > 0)) {
                  throw new IllegalArgumentException(
                       "Date.setDay(): supplied value for day argument out of range: "
                       + day + " does not meet precondition day > 0");
              }
              if (!(day < 32)) {
                  throw new IllegalArgumentException(
                      "Date.setDay(): supplied value for day argument out of range: "
                      + day + " does not meet precondition day < 32");
              }
              this.day = day;
          }
      }

      Again, access to the original method source is required.
      (Incident Review ID: 281131)
      ======================================================================
      ###@###.### 10/21/04 01:40 GMT

            darcy Joe Darcy
            jleesunw Jon Lee (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: