Bug 31724 - declare warning/error emitted without context
Summary: declare warning/error emitted without context
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows NT
: P3 enhancement (vote)
Target Milestone: 1.2   Edit
Assignee: Jim Hugunin CLA
QA Contact:
URL:
Whiteboard:
Keywords: info
Depends on:
Blocks:
 
Reported: 2003-02-12 17:39 EST by Wes Isberg CLA
Modified: 2004-03-15 11:31 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Wes Isberg CLA 2003-02-12 17:39:57 EST
The compiler emits declare error/warning statements without accompanying code 
context or file/line numbers.

TestCase "omnibus declare warning" checked in:
   tests/ajcTestsFailing.xml
   tests/new/declare/DeclareWarning.java 

FYI, other issues that should be in another bug but are in the test case:
- initialization listed at line 0.  
  s.b. first initializer or first line of class

- pointcut using adviceexecution() does not pick out advice
Comment 1 Adrian Colyer CLA 2003-02-27 03:42:10 EST
The main tests in the omnibus now pass (ie. declare error/warnings are now 
emitted with context). I'm leaving this bug open as the "other issues" still 
remain. 




Initializers are reported at line zero because the shadow has no range 
associated with it.
Comment 2 Adrian Colyer CLA 2003-02-27 14:31:45 EST
Update : two of the expected warnings are *not* being generated - line 5 and 74.


This is post the "fix" for over eager CONSTRUCTOR kind matching on 
SignaturePatterns.
Comment 3 Wes Isberg CLA 2003-03-04 05:04:15 EST
I just checked in a fix that prefixes declare error/warning messages with the 
file and line, but not with source context.  (Adrian added the source location 
info, but it wasn't being emitted by the command-line compiler.)  We need to 
work up a good way for weaver messages to be associated with source context by 
any weaver clients (command-line and IDE compiler; linker hidden in shipping 
tool or load-time weaver with JMX face...).

The passing tests in the omnibus render false positives now because the harness 
only checks message lines (known harness limitation).  I need to enable the 
harness support for checking message files and develop support for checking 
text and context, then update the tests to seek the desired context.
Comment 4 Jim Hugunin CLA 2003-03-11 18:49:54 EST
this test passes in the current tree with the initializer join point now
having the correct location from the corresponding constructor

another test was added (new/declare/DeclareWarningEmpty.java) for initializers
and static intializer source locations when none are explicitly present in
the source code

Wes should reopen this bug if there are remaining message rendering issues
that I'm unaware of.
Comment 5 Wes Isberg CLA 2003-03-13 14:13:39 EST
Re-opening as a P3 known limitation.  The test currently gives false positives 
because the content of the text is not checked.  Currently the weaver emits 
messages without source context, e.g.,

  file.java:23: this is an error

rather than

     void around() : pc() {
     ^^^^
  file.java:23: this is an error

This is true of all error and warning messages detected by the weaver.
Comment 6 Wes Isberg CLA 2003-06-04 02:10:41 EDT
adding info keyword.

also fyi the test harness can now detect errors based on the content of
messages, but the test has not been updated accordingly.
Comment 7 Adrian Colyer CLA 2003-11-10 09:58:35 EST
I've updated ajcTests.xml to verify message text too. Also updated org.aspectj.
testing.util.LangUtil to handle matching of multiple expected messages on same 
line that differ only by message text.

Reclassified what's left of this bug as an enhancement request (give source 
context for declare error/warning) to be addressed "LATER."
Comment 8 Adrian Colyer CLA 2004-03-15 11:29:44 EST
reopening so that I can move the status to resolved-fixed
Comment 9 Adrian Colyer CLA 2004-03-15 11:31:33 EST
This was fixed as part of the work done for enh 50458. If source files are 
available, then the context is now output as part of the message. See enh 54819 
for details.