Bug 84879 - [DCR] Compiler could flag misindented code
Summary: [DCR] Compiler could flag misindented code
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 129910 131356 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-02-10 07:08 EST by Philipe Mulet CLA
Modified: 2015-11-23 14:49 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Philipe Mulet CLA 2005-02-10 07:08:23 EST
Build 20050202

One could imagine the compiler optionally flagging code which is likely wrong
based on its indentation:

if (bool) 
    thenStatement();
    notPartOfThenStatement();

Developer did likely omit to use a block in if statement, or indentation is
misleading. Anyhow, a codestyle warning may be useful there.
Comment 1 Olivier Thomann CLA 2005-02-10 17:09:00 EST
We don't tokenize whitespaces so the notion of indentations doesn't exist for a
statement. I don't believe this should be done by a compiler. This is more a QA
tool or a code formatter.
Comment 2 Philipe Mulet CLA 2005-04-07 09:44:27 EDT
Deferring post 3.1
Comment 3 Olivier Thomann CLA 2005-07-12 10:41:29 EDT
Reopen for consideration in 3.2.
Comment 4 Philipe Mulet CLA 2006-03-01 09:10:26 EST
*** Bug 129910 has been marked as a duplicate of this bug. ***
Comment 5 Genady Beryozkin CLA 2006-03-06 17:57:29 EST
An excellent idea! (python guys will be especially happy about this small victory).

Practically there is a problem of tabs vs. spaces. For somebody the code
may appear indented correctly when for others it will appear misindented.
Comment 6 Olivier Thomann CLA 2006-03-10 14:36:19 EST
*** Bug 131356 has been marked as a duplicate of this bug. ***