lovubuntu / checker-framework

Automatically exported from code.google.com/p/checker-framework
0 stars 0 forks source link

Eclipse plugin error from comment block when running selected checkers #239

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Have a source code file containing an annotated try-with-resources:

try (
/*@DefaultQualifier(Nullable.class)*/
InputStream in = resourceRoot.getResourceAsStream(url)) {
  if(in != null) {
    bytes = readFully(in, BUFFER_SIZE);
  } else {
    throw new IllegalArgumentException("Resource not found: " + url);
  }
}

2. Add characters *//* between @ and DefaultQualifier to "disable" the 
annotation so that Checker Framework would skip over it, and save.
3. Run selected checkers on the source code file.

What is the expected output? What do you see instead?

Checker should treat /*@*//*DefaultQualifier(Nullable.class)*/ as a normal 
comment and not process it.

Instead the Eclipse plugin tries to add a marker which results in an error in 
the Error Log.

What version of the product are you using? On what operating system?

Checker Framework Feature 1.6.6, Eclipse IDE for Java Developers 
2.0.0.20130613-0530, Java(TM) SE Runtime Environment 1.7.0_25-b16, Windows 8.1 
Pro Preview Evaluation copy Build 9431

Please provide any additional information below.

The Error Log shows the following:

java.lang.RuntimeException: Marker reporter expects at least 3 arguments 
separated by $$.
Message was: illegal start of type
          /*@*//*DefaultQualifier(Nullable.class)*/ line was 132
    at checkers.eclipse.marker.MarkerReporter.<init>(MarkerReporter.java:46)
    at checkers.eclipse.util.MarkerUtil.addMarker(MarkerUtil.java:61)
    at checkers.eclipse.actions.CheckerWorker.markErrors(CheckerWorker.java:144)
    at checkers.eclipse.actions.CheckerWorker.work(CheckerWorker.java:107)
    at checkers.eclipse.actions.CheckerWorker.run(CheckerWorker.java:81)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)

Original issue reported on code.google.com by timo.kin...@gmail.com on 14 Aug 2013 at 2:18

GoogleCodeExporter commented 9 years ago

Original comment by wdi...@gmail.com on 14 Aug 2013 at 7:57

GoogleCodeExporter commented 9 years ago
The Checker Framework itself used to crash on the given source code.  I don't 
know whether that was related to the reported problem, but the Checker 
Framework crash is now fixed in the DFF branch.  It might be worthwhile to 
double-check that this problem still occurs.

Original comment by michael.ernst@gmail.com on 20 Aug 2013 at 8:41

GoogleCodeExporter commented 9 years ago
Added test to jsr308-langtools to ensure the /*@*//*XXX*/ comment style is 
ignored:
http://code.google.com/p/jsr308-langtools/source/detail?r=64a24077ce69

The parsing of error markers should be improved in the Eclipse plug-in, also 
related to Issue 227:
https://code.google.com/p/checker-framework/issues/detail?id=227

Original comment by wdi...@gmail.com on 27 Aug 2013 at 11:20

GoogleCodeExporter commented 9 years ago

Original comment by mer...@cs.washington.edu on 21 Nov 2013 at 8:26