Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 325717

Summary: API checker misses invalid method reference to execution environment
Product: [Eclipse Project] PDE Reporter: Philippe Coucaud <phil_fj12>
Component: API ToolsAssignee: PDE API Tools Inbox <pde-apitools-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3    
Version: 3.7   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard: stalebug

Description Philippe Coucaud CLA 2010-09-20 03:57:30 EDT
Eclipse build-ID: I20100915-2024

Let's consider the following class:
-------------------------------------------
package test;

import org.eclipse.swt.events.VerifyEvent;
import org.eclipse.swt.events.VerifyListener;
import org.eclipse.swt.widgets.Text;

public class Test {
  static Text text;

  public static void main(String[] args) {
    "".isEmpty();

    text.addVerifyListener(new VerifyListener() {
      public void verifyText(VerifyEvent e) {
        "".isEmpty();
      }
    });
  }
}
-------------------------------------------

1. create an eclipse plug-in project with J2SE-1.5 as minimal environment and use a 6.0 JRE.
2. enable API tooling
3. add aforementioned class to project
4. the API checker correctly reports the first erroneous reference to String.isEmpty() (which does not exist in J2SE-1.5), but misses the second one inside the anonymous inner class:

The method String.isEmpty() referenced in test.Test.main(String[]) is not defined in the bundle's required execution environment: J2SE-1.5
Comment 1 Eclipse Webmaster CLA 2019-09-06 15:37:52 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.
Comment 2 Julian Honnen CLA 2019-09-09 02:20:12 EDT
Please remove the stalebug flag, if this issue is still relevant and can be reproduced on the latest release.