Obsolete
Status Update
Comments
sa...@gmail.com <sa...@gmail.com> #2
[Comment deleted]
bi...@gmail.com <bi...@gmail.com> #3
[Comment deleted]
bi...@gmail.com <bi...@gmail.com> #4
Thank you for your feedback. We assure you that we are doing our best to address all issues reported. For now, we will be closing the issue as won't fix obsolete.
xa...@android.com <xa...@android.com>
xa...@android.com <xa...@android.com>
xa...@android.com <xa...@android.com>
ad...@google.com <ad...@google.com> #5
Thank you for reporting this issue. At this time it appears this feedback is no longer relevant. If you continue to experience this issue please open a new bug and we can reinvestigate.
Description
The new incremental build logic in the Ant build script is broken and can produce binaries which do not reflect the source code, the binaries can crash or have logic errors.
Solving the dependency problem is extremely difficult and would actually require analyzing the source code a complete dependency chain or simply recompiling all java files any time any other java file in the project changes. Here is a super simple example demonstrating that fact:
A.java
public class A {
public static final int X = 100;
public static void test() {
}
}
B.java
public class B {
public static void test() {
}
}
C.java:
public class C extends Activity {
@Override
public void onCreate(Bundle savedInstanceState)
B.test();
System.out.println("X="+A.X);
}
}
If I compile this then class B loses the reference to class A completely. Now if I change the value to 101 in class A and do an Ant build using the Android build script the value printed out will not reflect my change to the source code. This same bug exists in javac if I recompile only java files with new timestamps.
Similarly there is another problem in the Ant script that will result in java.lang.NoSuchMethodError. If the user changes a method signature in class B and that method is referenced in class C, only class B is recompiled and when run C will get NoSuchMethodError, this bug also exists in javac if I recompile only java files with new timestamps.
Clearly the incremental build system introduced into the tools recently is broken and as far as Java source compilation is concerned should be disabled or fixed.