ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 5997] - Binary incompatibility between ANT 1.4.1 & 1.3
Date Sat, 02 Feb 2002 00:45:03 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=5997>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=5997

Binary incompatibility between ANT 1.4.1 & 1.3

umagesh@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |WONTFIX



------- Additional Comments From umagesh@apache.org  2002-02-02 00:45 -------
You are only exposing a fundamental Java Machinery problem.  Let me simplify
the problem so that you understand the issue.  Create the following classes
in individual java files:

public abstract class test2 {
    public void x() {
    }
}

public abstract class test1 extends test2 {
}

public class test1Caller extends test1 {
    public static void main( String args[] ) {
        try {
            test1Caller t = (test1Caller) 
                Class.forName("test1Caller").newInstance();
            t.x();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

Now compile test1Caller.java and run it - you will have no problems.

Now change test1.java to the following:

public abstract class test1 {
    public void x() {
    }
}

Compile test1.java *alone*.

Run test1Caller

You will get an exception thrown. Recompile test1Caller.java and everything 
will be fine.

Now change test1.java back to 
public abstract class test1 extends test2 {
}

and compile test1.java *only* and run test1Caller.  You will not have any 
problems.

So, what is the lesson learnt?  Expecting that a generated class is always 
*backwards-ported* is a mistake.

So, coming to your problem.  Ship your task by compiling it against Ant 1.3.  
It will work on Ant >= 1.3 versions.  We strive to maintain backwards 
*compatibility* and not backwards *portability*, and neither should we be, IMHO.
If you compile it using Ant 1.4 classes and expect it to work on Ant 1.3 too, 
then you are making a fundamental Java mis-judgement ;-(

I am going to close this as WONTFIX because having to enforce backwards 
portability will seriously impact our ability to improve the product as such.
Sorry.

Cheers,
Magesh

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message