Bug 59895

Summary: NPE updating an aspect in incremental mode
Product: [Tools] AspectJ Reporter: Wes Isberg <wes>
Component: CompilerAssignee: Jim Hugunin <jim-aj>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P2 CC: christian
Version: 1.2   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
patch fix aclement: iplog+

Description Wes Isberg CLA 2004-04-25 20:43:35 EDT
NPE when updating an aspect in incremental mode.
Find test case in incremental/full-rebuild.

AjBuildManager.java:208 finally clause runs after 
every iteration:

     ret = !handler.hasErrors();
     handler = null;

But at AjBuildManager.java:124, handler is only set if 
there is not a complete rebuild: 

    if (!canIncremental && !batch) { // retry as batch?
        return doBuild(buildConfig, baseHandler, true);
    }
    this.handler = ...

Since result is set by return doBuild..), could say

    if (null != handler) {
        ret = !handler.hasErrors();
    }

(Seems to have been introduced in a month ago in 1.44.  Our test coverage of
incremental mode is awful.)
Comment 1 Wes Isberg CLA 2004-04-25 20:45:07 EDT
Created attachment 9930 [details]
patch fix

minimal, also adds warning guard, passes test suite.  But I don't like this
code ...
Comment 2 Wes Isberg CLA 2004-04-25 20:46:40 EDT
raising priority to fix before 1.2 final
Comment 3 Adrian Colyer CLA 2004-05-13 05:18:51 EDT
Adrian fixed.
Comment 4 Adrian Colyer CLA 2004-05-13 05:27:12 EDT
*** Bug 61845 has been marked as a duplicate of this bug. ***