Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 184064 Details for
Bug 328554
[move method] NPE during move method refactoring
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
fix and test
patch.txt (text/plain), 4.66 KB, created by
Markus Keller
on 2010-11-29 13:21:13 EST
(
hide
)
Description:
fix and test
Filename:
MIME Type:
Creator:
Markus Keller
Created:
2010-11-29 13:21:13 EST
Size:
4.66 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.ui >Index: core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/MoveInstanceMethodProcessor.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/MoveInstanceMethodProcessor.java,v >retrieving revision 1.109 >diff -u -r1.109 MoveInstanceMethodProcessor.java >--- core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/MoveInstanceMethodProcessor.java 18 Feb 2010 21:25:28 -0000 1.109 >+++ core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/MoveInstanceMethodProcessor.java 29 Nov 2010 18:20:09 -0000 >@@ -577,14 +577,14 @@ > } else { > if (expression instanceof FieldAccess) { > final FieldAccess access= (FieldAccess) expression; >- if (Bindings.equals(access.resolveFieldBinding(), fTarget)) { >+ if (Bindings.equals(fTarget, access.resolveFieldBinding())) { > rewrite.remove(expression, null); > visit(node.arguments()); > return false; > } > } else if (expression instanceof Name) { > final Name name= (Name) expression; >- if (Bindings.equals(name.resolveBinding(), fTarget)) { >+ if (Bindings.equals(fTarget, name.resolveBinding())) { > rewrite.remove(expression, null); > visit(node.arguments()); > return false; >@@ -607,7 +607,7 @@ > } > } > binding= node.getQualifier().resolveBinding(); >- if (Bindings.equals(binding, fTarget)) { >+ if (Bindings.equals(fTarget, binding)) { > fRewrite.replace(node, getFieldReference(node.getName(), fRewrite), null); > return false; > } >@@ -630,7 +630,7 @@ > } > } > } >- if (Bindings.equals(binding, fTarget)) >+ if (Bindings.equals(fTarget, binding)) > if (fAnonymousClass > 0) { > final ThisExpression target= ast.newThisExpression(); > target.setQualifier(ast.newSimpleName(fTargetType.getElementName())); >#P org.eclipse.jdt.ui.tests.refactoring >Index: resources/MoveInstanceMethod/canMove/test41/in/A.java >=================================================================== >RCS file: resources/MoveInstanceMethod/canMove/test41/in/A.java >diff -N resources/MoveInstanceMethod/canMove/test41/in/A.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ resources/MoveInstanceMethod/canMove/test41/in/A.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,14 @@ >+package p; >+ >+public class A { >+ void foo(B b) { >+ int j= i; >+ char c= System.out.abc; >+ long l= ab.c; >+ System.out.println(j); >+ } >+} >+ >+class B { >+ >+} >Index: resources/MoveInstanceMethod/canMove/test41/out/A.java >=================================================================== >RCS file: resources/MoveInstanceMethod/canMove/test41/out/A.java >diff -N resources/MoveInstanceMethod/canMove/test41/out/A.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ resources/MoveInstanceMethod/canMove/test41/out/A.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,15 @@ >+package p; >+ >+public class A { >+} >+ >+class B { >+ >+ void foo() { >+ int j= i; >+ char c= System.out.abc; >+ long l= ab.c; >+ System.out.println(j); >+ } >+ >+} >Index: test cases/org/eclipse/jdt/ui/tests/refactoring/MoveInstanceMethodTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/MoveInstanceMethodTests.java,v >retrieving revision 1.49 >diff -u -r1.49 MoveInstanceMethodTests.java >--- test cases/org/eclipse/jdt/ui/tests/refactoring/MoveInstanceMethodTests.java 11 Sep 2008 12:00:24 -0000 1.49 >+++ test cases/org/eclipse/jdt/ui/tests/refactoring/MoveInstanceMethodTests.java 29 Nov 2010 18:20:10 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2008 IBM Corporation and others. >+ * Copyright (c) 2000, 2010 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -435,6 +435,11 @@ > helper1(new String[] { "p.A", "p.B" }, "p.A", 4, 13, 4, 25, PARAMETER, "p", true, true); > } > >+ // Test problem with missing bindings (bug 328554) >+ public void test41() throws Exception { >+ helper1(new String[] { "p.A" }, "p.A", 4, 10, 4, 10, PARAMETER, "b", true, true); >+ } >+ > // Move mA1 to field fB, do not inline delegator > public void test3() throws Exception { > helper1(new String[] { "p1.A", "p2.B", "p3.C"}, "p1.A", 9, 17, 9, 20, FIELD, "fB", false, false);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 328554
:
181635
|
181792
|
182058
| 184064