Bug 58692 - Empty Block comments should see // coments
Summary: Empty Block comments should see // coments
Status: RESOLVED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 3.0 M9   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-04-15 13:04 EDT by Tom Dickens CLA
Modified: 2004-05-18 13:23 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tom Dickens CLA 2004-04-15 13:04:40 EDT
I like your error/warning for requiring comments on empty blocks!
In my code, I have many catch blocks commented as follows:
  } catch (Exception e) { } // Ignore CANCEL_BUTTON Exception
which is not correct to satisify this check.

I must change the comment to the form:
  } catch (Exception e) { /* Ignore CANCEL_BUTTON Exception */ }

which is uglier and more prone to errors (open comment and a close comment)

Please include end-of-line comments on the same line as an empty block
endif brace as a valid comment to satisify this error/warning. Both of
the following cases should be OK:

(1)
  } catch (Exception e) { } // Ignore CANCEL_BUTTON Exception

(2)
  } catch (Exception e) { 
     } // Ignore CANCEL_BUTTON Exception

note: This case currently works:
  } catch (Exception e) { // Ignore CANCEL_BUTTON Exception
     }
Comment 1 Philipe Mulet CLA 2004-04-15 18:28:57 EDT
This was discussed when we added this feature, and the consensus was not to 
consider trailing line comments to be a valid comment for an empty block.

As you noted, you may simply write the empty block on 2 lines.