Bug 203769 - Weird warning "Empty block" for an empty class
Summary: Weird warning "Empty block" for an empty class
Status: VERIFIED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.4 M2   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-09-18 09:54 EDT by NoName CLA
Modified: 2007-09-19 07:37 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 NoName CLA 2007-09-18 09:54:50 EDT
Build ID: I20070809-1105

Steps To Reproduce:
1. Copy the code below
2. Enable the Java warning "Empty Statement"
3. The compiler gives a warning for an empty class


More information:

==============================
public class EmptyClass { // Warning: Empty block should be documented

}
==============================
Comment 1 Jerome Lanneluc CLA 2007-09-18 12:38:07 EDT
The exact name of the preference is "Undocumented empty block". This is exactly what the warning tells you: the block defining the class body is empty and it is undocumented.
Comment 2 NoName CLA 2007-09-18 13:22:03 EDT
(In reply to comment #1)
> The exact name of the preference is "Undocumented empty block". This is exactly
> what the warning tells you: the block defining the class body is empty and it
> is undocumented.

Ok but if i add a javadoc to the class, i still get the warning.

==========================
/**
 * Dummy javadoc.
 */
public class EmptyClass {

}
==========================

To get rid of the warning, i need to add a dummy javadoc IN the class:

=============================
public class EmptyClass {
	/** Dummy javadoc*/
}
=============================

I think it's kind of weird...


Comment 3 Frederic Fusier CLA 2007-09-19 07:37:40 EDT
Any comment added inside the block removes the warning, not only a javadoc one,
for example:
public class EmptyClass {
        // this class is intentionally empty
}

Verified for 3.4 M2 using build I20070919-0010.