Bug 56709 - Compiler should generate full class file if flag errors aren't real JDK errors
Summary: Compiler should generate full class file if flag errors aren't real JDK errors
Status: RESOLVED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: 3.0 M9   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-03-30 04:48 EST by Dirk Baeumer CLA
Modified: 2005-08-18 06:11 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dirk Baeumer CLA 2004-03-30 04:48:41 EST
I20040330

I have set some of the style and ununsed code options to error. The 
disadvantage of doing so is that the compiler doesn't generate complete class 
files anymore. For example if I have a unused local the compiler generates a 
method body throwing an UnresolvedCompilerError although from a JDK standpoint 
the code is correct. This is especially annoying with hot code replace.
Comment 1 Olivier Thomann CLA 2004-03-30 09:11:11 EST
Workaround is to set this as warnings and not errors.
Comment 2 Dani Megert CLA 2004-03-30 09:21:00 EST
Sure, we know this. In order to release clean code many of us have set unused
private members and imports to 'error'. However, when you then quickly comment
out some code and run (or debug) it no longer works. This is quite a pain.
Comment 3 Philipe Mulet CLA 2004-04-03 15:05:02 EST
If you decide these are errors, then we should not allow it to run with 
unresolved errors. This is the whole purpose of raising errors.

Leave them as warning, and start fixing them, so that your set of warnings 
become manageable again.
Comment 4 Dirk Baeumer CLA 2004-04-04 12:31:20 EDT
Philippe, I don't agree here. The problem is that these problems are neither 
warning nor errors (we discussed this a while ago). Since we can't change this 
we switch them to errors to get their attention. But if I am under 
developement with hot code replace it really hurts not being able to execute 
the code. Can you please reconsider this request.
Comment 5 Dani Megert CLA 2004-04-05 05:04:10 EDT
+1

Not fixing this bug renders the "error" state for all our additional checks
useless (at least for me): why would anybody set the state to error for e.g.
imports or unused code because you cannot run/debug? On the other side, not all
checks have the same importance but since I now have to flag them as warning 
and since we have lots of them, they don't get any attendance anymore and bad
code gets released to the repository.
Comment 6 Philipe Mulet CLA 2004-04-05 18:52:30 EDT
Reopening, but recategorizing as LATER.
I am still not convinced this would be a good idea. What you'd like instead is 
to have several levels of warnings. 

Errors have to be fatal and prevent running the code. I don't think people 
would understand being able to run code with errors as if there was none... 
I strongly believe you should address warning categories one at a time to bring 
them down to a manageable set. If you waited so long without addressing them, 
then I can understand your being overhelmed now, but then you should focus on a 
few critical ones, then reveal more of them as you fixed the first ones.

Comment 7 Philipe Mulet CLA 2004-04-05 18:52:46 EDT
Not for 3.0
Comment 8 Philipe Mulet CLA 2004-04-06 05:14:55 EDT
Re: comment#5. This is not a bug, but working as per design.

Thinking more about it, if we did allow generating errors and still issuing 
functional classfiles, then users would get confused by errors which prevent 
from running (JLS errors). There is no way you could tell the difference, and 
this would make the tools useless. How can you determine if you can export and 
deploy code any longer ? Just guess...

We have another PR for providing refinements on warning severities. 
I consider this one closed.
Comment 9 Philipe Mulet CLA 2004-04-06 05:15:27 EDT
Working as expected.
Comment 10 Markus Keller CLA 2005-08-18 06:11:00 EDT
The other PR is bug 47340.