Bug 60372 - Wrong "Empty control-flow statement" error
Summary: Wrong "Empty control-flow statement" error
Status: CLOSED INVALID
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.1 RC2   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2004-04-29 03:35 EDT by Dani Megert CLA
Modified: 2009-08-30 02:09 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dani Megert CLA 2004-04-29 03:35:28 EDT
I200404281424

With the latest build I get an error which I did not get yesterday. The code is
in CompilationUnitEditor.java rev. 241:
else if (end <= eventOffset) 
	// position comes way before change -
	// leave alone
	; <== *** Empty control-flow statement ***
else if (offset <= eventOffset && end >= eventOffset + eventOldLength) {

I have "Undocumented empty block" set to ignore. I could not find an option to
set "Empty control-flow statement"
Comment 1 Philipe Mulet CLA 2004-04-29 06:30:15 EDT
This option just got added, Martin is adding preference for it. I don't get why 
it would default to an ERROR. It should default to IGNORE, thus you shouldn't 
see it.

Comment 2 Dani Megert CLA 2004-04-29 06:34:40 EDT
I changed the code so I'm not 100% sure but I think the reconcile which reports
temporary problems work correctly but the builder generated an error marker.
Comment 3 Philipe Mulet CLA 2004-04-29 06:47:05 EDT
Actually, I got confused. The severity is controlled by the 
preference "unnecessary semicolon" which is going to be renamed into "empty 
statement" or something like that.

The question now is: did you make this problem be an error ?
Comment 4 Dani Megert CLA 2004-04-29 06:55:06 EDT
yes
Comment 5 Philipe Mulet CLA 2004-04-29 07:02:20 EDT
Ok closing, once the option is renamed it will be fine.
Comment 6 Dani Megert CLA 2004-05-04 11:37:08 EDT
I still think this is a bug: before I could have

while (time < 50) ;
and 
statement;;

where I only was informed about latter code and the first was treated as valid
code. These two are now folded together i.e. I get both reported with same
severity. I would either like to have separate options or treat the first one as
valid as it has been before.
Comment 7 Philipe Mulet CLA 2004-05-04 12:37:50 EDT
More options is always possible, but we discussed with Dirk and Martin, and 
they agreed we should fold these options together.
Hint: if you want to address the warning for the control-flow statement, 
simply replace the semicolon with {/*empty*/}.

Will keep this request as reminder if more people complain.
Comment 8 Dani Megert CLA 2004-05-04 12:55:49 EDT
Dirk, please revisit your decision. We have really lost functionality here and
the code gets worse and not better because people simply decrease or disable
this option. Erich agreed as well.
Comment 9 Frederic Fusier CLA 2005-02-17 09:43:15 EST
If you think this bug should be reconsidered for 3.1, then please reopen asap.
Otherwise, just close it, thanks.
Comment 10 Dani Megert CLA 2005-02-17 09:47:17 EST
I still think it should be reconsidered but I leave it up to Dirk. He's back
next week.
Comment 11 Frederic Fusier CLA 2005-06-08 05:48:26 EDT
Close as no more people complain about current behavior
Comment 12 Denis Roy CLA 2009-08-30 02:09:06 EDT
As of now 'LATER' and 'REMIND' resolutions are no longer supported.
Please reopen this bug if it is still valid for you.