-
Enhancement
-
Resolution: Won't Fix
-
P5
-
None
-
5.0
-
x86
-
linux
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
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
- duplicates
-
JDK-6182620 apt should support parsing local variable annotations
-
- Closed
-