nhatminhle / cofoja

Contracts for Java
GNU Lesser General Public License v3.0
151 stars 18 forks source link

When JavaCompiler not available NPE is thrown #21

Closed nhatminhle closed 9 years ago

nhatminhle commented 9 years ago

From f.tomass...@gmail.com on February 19, 2011 00:26:14

Run the Annotations Processor on the JRE.

In the constructor of class ContractJavaCompiler this line:

javaCompiler = ToolProvider.getSystemJavaCompiler();

will set javaCompiler to null causing a NPE on the following line. I would advice to add this check:

if (javaCompiler==null){
    throw new RuntimeException("No JavaCompiler available. Are you using a JRE instead of a JDK?");
}

Federico

Original issue: http://code.google.com/p/cofoja/issues/detail?id=16

nhatminhle commented 9 years ago

From nhat.min...@gmail.com on February 26, 2011 03:10:10

Thanks for reporting the discrepancy between JRE and JDK here. I have included the fix in an upcoming patch (pending review).

Status: Started
Owner: nhat.minh.le

nhatminhle commented 9 years ago

From chat...@google.com on March 08, 2011 07:15:04

Fixed on r89

Status: Fixed