This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 46611 - [gjast] Error annotation doesn't work
Summary: [gjast] Error annotation doesn't work
Status: CLOSED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 4.x
Hardware: All All
: P2 blocker (vote)
Assignee: _ tball
URL:
Keywords: REGRESSION
: 46512 47125 47442 (view as bug list)
Depends on:
Blocks: 46624
  Show dependency tree
 
Reported: 2004-07-27 14:06 UTC by Marek Grummich
Modified: 2007-09-26 09:14 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marek Grummich 2004-07-27 14:06:14 UTC
Build 200407270649, j2sdk1.4.2_05

Summary is selfexplaining. Try to write e.g. FFF
fff = ""; in the source editor. The line should be
underscored, but it isn't. - REGRESSION
Comment 1 Tomas Hurka 2004-07-27 14:19:17 UTC
Probably caused by last gjast integration.
Comment 2 Martin Matula 2004-07-27 17:08:36 UTC
Tom, for now I rolled back the changes in gjast, javacore and parser
related to the new scanner and deprecation support, since tonight we
will have a q-build and it seems they caused regressions that you
won't be able to fix this week (since you are on vacation).
For this reason I am also closing this bug - it should be
reopened/verified once the changes are integrated again.

Checking in external/gjast.jar.scrambled;
/cvs/java/external/gjast.jar.scrambled,v  <--  gjast.jar.scrambled
new revision: 1.54; previous revision: 1.53
done
Processing log script arguments...
More commits to come...
Checking in
javacore/src/org/netbeans/modules/javacore/parser/TokenIterator.java;
/cvs/java/javacore/src/org/netbeans/modules/javacore/parser/TokenIterator.java,v
 <--  TokenIterator.java
new revision: 1.6; previous revision: 1.5
done
Processing log script arguments...
More commits to come...
Checking in
javacore/src/org/netbeans/modules/javacore/scanning/JavaUpdater.java;
/cvs/java/javacore/src/org/netbeans/modules/javacore/scanning/JavaUpdater.java,v
 <--  JavaUpdater.java
new revision: 1.5; previous revision: 1.4
done
Processing log script arguments...
More commits to come...
Checking in parser/src/org/netbeans/lib/java/parser/Factory.java;
/cvs/java/parser/src/org/netbeans/lib/java/parser/Factory.java,v  <--
 Factory.java
new revision: 1.4; previous revision: 1.3
done
Checking in parser/src/org/netbeans/lib/java/parser/JScanner.java;
/cvs/java/parser/src/org/netbeans/lib/java/parser/JScanner.java,v  <--
 JScanner.java
new revision: 1.4; previous revision: 1.3
done
Checking in parser/src/org/netbeans/lib/java/parser/Scanner.java;
/cvs/java/parser/src/org/netbeans/lib/java/parser/Scanner.java,v  <--
 Scanner.java
new revision: 1.5; previous revision: 1.4
done
Checking in parser/src/org/netbeans/lib/java/parser/ScannerToken.java;
/cvs/java/parser/src/org/netbeans/lib/java/parser/ScannerToken.java,v
 <--  ScannerToken.java
new revision: 1.4; previous revision: 1.3
done
Checking in parser/src/org/netbeans/lib/java/parser/Token.java;
/cvs/java/parser/src/org/netbeans/lib/java/parser/Token.java,v  <-- 
Token.java
new revision: 1.4; previous revision: 1.3
done
Checking in parser/src/org/netbeans/lib/java/parser/scanner.l;
/cvs/java/parser/src/org/netbeans/lib/java/parser/scanner.l,v  <-- 
scanner.l
new revision: 1.5; previous revision: 1.4
done
Comment 3 Martin Matula 2004-07-28 16:58:51 UTC
*** Issue 46512 has been marked as a duplicate of this issue. ***
Comment 4 Jan Becicka 2004-08-05 09:10:50 UTC
Today's build seems to be broken. Error annotations doesn't work, only
this message is written to console:
"(source unavailable)"

This commit seems to be responsible:
  User: tball   
  Date: 04/08/04 23:10:21

  Modified:    parser/src/org/netbeans/lib/java/parser Factory.java
                        JScanner.java Scanner.java ScannerToken.java
                        Token.java scanner.l
  Log:
  Resubmission of fast scanner changes:  tests pass, and now Jesse's
project scans without errors due to handling of null sourceLevel
values in the fast scanner.

Tom, can you check it? Thanks.
Comment 5 _ tball 2004-08-05 21:20:50 UTC
The problem is due to a change in javac where it now uses source
buffer offsets as positions instead of packed integers (a change
requested by the NetBeans team two years ago).  The javac Log class
(its error reporter) now has to re-read the source to determine the
line and column of an error, but the editor doesn't pass in a full
file path when doing error checking.  This prevented Log from
reporting line and column numbers in errors.

The fix I am now testing adds a method to Log so that the gjast error
checker (called indirectly by the editor) can give Log access to the
source buffer so it doesn't need to open any files.  Since I also
updated Log to use chars instead of bytes, I am also waiting on
approval from the javac team that they will incorporate these changes.
Comment 6 _ tball 2004-08-05 23:11:57 UTC
Got approval from javac team for proposed and tested changes.  
Comment 7 Jan Becicka 2004-08-06 07:32:02 UTC
Verified
Comment 8 Martin Matula 2004-08-09 09:48:50 UTC
Still does not work for semantic errors (for syntactic it does). I had
a class where I used identifier Utilities which was unresolved. No
error annotation was displayed. So I looked at the console window and
saw the error was found by the parser but the line number was missing.
This was the output:

cannot find symbol
symbol  : variable Utilities
location: class org.netbeans.modules.javacore.parser.WildCardRef

Note that for syntactic errors it is a bit different:

org/netbeans/modules/javacore/parser/WildCardRef.java:49: ';' expected
   kjh     return Utilities.compareObjects(bound, ref.bound);
Comment 9 Martin Matula 2004-08-10 09:17:53 UTC
Jan Becicka tried to write regression tests for error annotations to
make the verification easier, but he is not able to reproduce this bug
in the test project. So it seems that sometimes it works. We are only
able to reproduce it manually (perhaps, you Tom, as you will
investigate it, will be able to provide a suitable testcase). Here are
the steps to reproduce it:
1) open refactoring project and all required projects
2) open org.netbeans.modules.javacore.parser.WildCardRef
3) delete the last import statement in that file (import
org.openide.util.Utilities;)
-> there should be an error annotation on line 50 (return
Utilities.compareObjects(bound, ref.bound);), but it is not there and
the message in the console says:
(source unavailable)
cannot find symbol
symbol  : variable Utilities
location: class org.netbeans.modules.javacore.parser.WildCardRef
Comment 10 _ tball 2004-08-11 03:27:41 UTC
Cached source buffers so that error logger can figure out line and
column positions.
Comment 11 Martin Matula 2004-08-11 17:27:10 UTC
*** Issue 47125 has been marked as a duplicate of this issue. ***
Comment 12 Marek Grummich 2004-08-17 12:44:27 UTC
Verified
Comment 13 Jan Chalupa 2004-08-18 14:48:21 UTC
Fix required for NB 4.0 Beta 1. Please integrate asap. Thanks.
Comment 14 Martin Matula 2004-08-18 14:52:39 UTC
Done.

Checking in gjast.jar.scrambled;
/cvs/java/external/gjast.jar.scrambled,v  <--  gjast.jar.scrambled
new revision: 1.57.2.1; previous revision: 1.57
done
Comment 15 Marian Mirilovic 2004-08-18 23:04:32 UTC
filed another issue 47425
Comment 16 Martin Matula 2004-08-20 22:38:53 UTC
*** Issue 47442 has been marked as a duplicate of this issue. ***
Comment 17 Quality Engineering 2007-09-20 12:44:17 UTC
Reorganization of java component