Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 549217 - ECJ would give an Error report on the other line, if we make a bug on the comment marks.
Summary: ECJ would give an Error report on the other line, if we make a bug on the com...
Status: RESOLVED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.10   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 4.13 M1   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 549224 549225 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-07-12 07:38 EDT by Miaoying Wang CLA
Modified: 2019-07-15 12:24 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 Miaoying Wang CLA 2019-07-12 07:38:21 EDT
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.
Comment 1 Sarika Sinha CLA 2019-07-14 22:43:23 EDT
Moving to JDT Core.
Comment 2 Jay Arthanareeswaran CLA 2019-07-15 01:27:11 EDT
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.
Comment 3 Stephan Herrmann CLA 2019-07-15 12:23:21 EDT
*** Bug 549224 has been marked as a duplicate of this bug. ***
Comment 4 Stephan Herrmann CLA 2019-07-15 12:24:11 EDT
*** Bug 549225 has been marked as a duplicate of this bug. ***