Community
Participate
Working Groups
Example package com.application.areca.context; import java.io.Serializable; /** * <BR> * @author Olivier PETRUCCI<BR> / public class StatusItem implements Serializable { private static final long serialVersionUID=-4194478179322849992L; private boolean hasErrors=false; private String key; private String errorMessage; public boolean isHasErrors(){ return hasErrors; } public void setHasErrors( boolean hasErrors){ this.hasErrors=hasErrors; } public String getKey(){ return key; } public void setKey( String key){ this.key=key; } public String getErrorMessage(){ return errorMessage; } public void setErrorMessage( String errorMessage){ this.errorMessage=errorMessage; this.hasErrors=true; } } Here the wrong line which is easily catched by manual check is the Line 6, with the lack of character '*' to complete the comment. But with an Error reported on Line 3, ECJ responds as the following: ---------- 1. ERROR in C:\DataG\StatusItem.java (at line 3) /** * <BR> * @author Olivier PETRUCCI<BR> / public class StatusItem implements Serializable { private static final long serialVersionUID=-4194478179322849992L; private boolean hasErrors=false; private String key; private String errorMessage; public boolean isHasErrors(){ return hasErrors; } public void setHasErrors( boolean hasErrors){ this.hasErrors=hasErrors; } public String getKey(){ return key; } public void setKey( String key){ this.key=key; } public String getErrorMessage(){ return errorMessage; } public void setErrorMessage( String errorMessage){ this.errorMessage=errorMessage; this.hasErrors=true; } } ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Unexpected end of comment ---------- 1 problem (1 error) It covers the nearly the whole code, while the bug is only locates on the Line 6 which is clearly focused through manually checking. Therefore, it is a so abroad bug localization that causes confusion.
Moving to JDT Core.
It may be easy for a human eye to see where the possible end is, but not so for the scanner. Unlike the human eye, the scanner also doesn't see the formatting, which makes it easier for us to recognize the closest point. I am not saying it's impossible for the scanner to find an earlier comment end, but it will still be a guess work and probably not worth the effort. I think the compiler has done its part in pointing out the error and the programmer can thence take over. I am inclined to close this as WONTFIX. If you have a compelling reason to address this, please give us your reasoning.
*** Bug 549224 has been marked as a duplicate of this bug. ***
*** Bug 549225 has been marked as a duplicate of this bug. ***