Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 222848 - Renaming Top Level Type Leads to Undiagnosed Shadowing of Library Type
Summary: Renaming Top Level Type Leads to Undiagnosed Shadowing of Library Type
Status: RESOLVED DUPLICATE of bug 123098
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.3.1   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-15 08:56 EDT by Max Schaefer CLA
Modified: 2008-03-17 10:07 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 Max Schaefer CLA 2008-03-15 08:56:29 EDT
Build ID: M20071023-1652

Steps To Reproduce:

Test case:
  public class A {
    public static void main(String[] args) {
      new Thread() {
        public void run() {
          System.out.println(23);
	}
      }.start();
    }
  }

  class MyThread {
    public void start() {
      System.out.println(42);
    }
  }

Renaming class "MyThread" to "Thread" shadows the library class java.lang.Thread, which is not noticed by Eclipse. Thus the program changes from printing "23" before refactoring to printing "42" after.

More information:
Comment 1 Markus Keller CLA 2008-03-17 10:07:35 EDT

*** This bug has been marked as a duplicate of bug 123098 ***