Bug 176718 - ajc craches with NullPointerException, when current working directory has a name with the suffix .java
Summary: ajc craches with NullPointerException, when current working directory has a n...
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: 1.5.3   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 1.6.1   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-03-08 10:59 EST by Boris Glawe CLA
Modified: 2008-06-12 18:53 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Boris Glawe CLA 2007-03-08 10:59:08 EST
create a directory called "aroundTest.java"

Go to this directory and create the two files listed below. The crash is reproducable with this code in my case - consider it as dummy code. The bug might also be reproducible with different code:


/*# Test.java: ############################*/


public class Test{

        public Test(){
                val = 0;
        }

        public int getValue(){
                return val;
        }


        public void setValue(int v){
                val = v;
        }

        private int val;
}






/*# Prog.java */

public class Prog{
        public static void main(String[] args){
                System.out.println("running");
                Test t = new Test();
                t.setValue(42);
                System.out.println("exiting");
        }
}






Now compile the code with ajc:

# ajc *.java

In my case I always get a NullPointerException

A workaround is to rename the current working directory to a name which does not  have the suffix ".java".

greets Boris
Comment 1 Andrew Clement CLA 2008-06-12 18:53:40 EDT
crashes with 1.5.3, but works now with 1.6.1 - thanks for the clear description.