Bug 29684 - Incremental: Commenting out conflict yeilds NullPointerException
Summary: Incremental: Commenting out conflict yeilds NullPointerException
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Jim Hugunin CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-01-16 23:40 EST by Nicholas Lesiecki CLA
Modified: 2003-01-21 19:52 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nicholas Lesiecki CLA 2003-01-16 23:40:04 EST
Compiling the following two files (in package member_conflict) with

ajc -Xlint -incremental -sourceroots member_conflict

yeilds a well-formed error.

Files:
----
public class SomeClass {

    public String toString() {
        return "from SomeClass";
    }
}

public aspect Conflicter {

    public String SomeClass.toString() {
        return "from Conflicter";
    }

    public static void main(String[] args) {
       int i = 0;
    }
}

However, modifying Conflicter so that it reads:

public aspect Conflicter {

//    public String SomeClass.toString() {
//        return "from Conflicter";
//    }

    public static void main(String[] args) {
       int i = 0;
    }
}

saving the file and invoking the incremental compilation yeilds a
NullPointerException (full output below).

C:\aopbook_tech\aop7>ajc -Xlint -incremental -sourceroots member_conflict
inter-type declaration from member_conflict.Conflicter conflicts with existing
member: java.lang.String member_conflict.
SomeClass.toString()
inter-type declaration from member_conflict.Conflicter conflicts with existing
member: java.lang.String member_conflict.
SomeClass.toString()

2 errors
    press enter to recompile (q to quit):

Exception thrown from AspectJ 1.1beta4

This might be logged as a bug already -- see the bug database at
  http://dev.eclipse.org (product: AspectJ, component: compiler)

Bugs for exceptions thrown have titles File:line from the top stack,
e.g., "SomeFile.java:243"

If you don't find the exception below in a bug, please add a new bug
To make the bug a priority, please include a test program
that can reproduce this exception.
null
java.lang.NullPointerException
        at org.eclipse.jdt.internal.core.builder.State.copyFrom(State.java:60)
        at
org.eclipse.jdt.internal.core.builder.IncrementalImageBuilder.<init>(IncrementalImageBuilder.java:41)
        at
org.aspectj.ajdt.internal.core.builder.AjBuildManager$IncrementalBuilder.<init>(AjBuildManager.java:661)
        at
org.aspectj.ajdt.internal.core.builder.AjBuildManager.getIncrementalBuilder(AjBuildManager.java:127)
        at
org.aspectj.ajdt.internal.core.builder.AjBuildManager.incrementalBuild(AjBuildManager.java:159)
        at org.aspectj.ajdt.ajc.AjdtCommand.repeatCommand(AjdtCommand.java:90)
        at org.aspectj.tools.ajc.Main.run(Main.java:203)
        at org.aspectj.tools.ajc.Main.runMain(Main.java:138)
        at org.aspectj.tools.ajc.Main.main(Main.java:58)


1 fail|abort, 2 errors
Comment 1 Jim Hugunin CLA 2003-01-21 19:52:19 EST
this bug is fixed in the current cvs tree with a test in scripts/incr.py

this bug revealed some more serious issues in the handling of types across 
incremental compiles and between the compiler and the weaver that must be 
addressed before any candidate