| Summary: | [convert local] reference to getClass() is updated wrong | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Mike Haller <mike.haller> |
| Component: | UI | Assignee: | JDT-UI-Inbox <jdt-ui-inbox> |
| Status: | CLOSED WONTFIX | QA Contact: | |
| Severity: | minor | ||
| Priority: | P3 | CC: | martinae, nospam, remy.suen |
| Version: | 3.4 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Whiteboard: | stalebug | ||
Moving to JDT/UI the resulting code is:
if (this.eclipseRefactoring.getClass() != obj.getClass())
return false;
getClass() should not change.
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. As such, we're closing this bug. If you have further information on the current state of the bug, please add it and reopen this bug. 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. -- The automated Eclipse Genie. |
Build ID: I20071213-1700 Steps To Reproduce: 1. Run unit test to verify test succeeds 2. Do the refactoring: Convert member type 'Foo' into top level, standard settings. 3. Run unit test again and see it failing More information: package sandbox; import junit.framework.TestCase; /** * Shows bug in Eclipse refactoring * 'Convert membery type to top level'. * * Steps: Run refactoring on inner class Foo. * Compare test results. * * @author mhaller */ public class EclipseRefactoring extends TestCase { private class Foo { public boolean equals(Object obj) { // For show case: System.out.println("Myself:" + getClass()); System.out.println("Parent:" + EclipseRefactoring.this.getClass()); // Note the changes here: if (getClass() != obj.getClass()) return false; return true; } } public void testname() throws Exception { Foo foo = new Foo(); Foo bar = new Foo(); assertTrue(foo.equals(bar)); } }