forked from azachar/org.eclipse.jdt.ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 410056: [1.8][move method] Moving default method brings up Textua…
…l Move wizard
- Loading branch information
Showing
21 changed files
with
238 additions
and
8 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test18_1/in/A.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package p; | ||
public interface A{ | ||
default String getDefaultName(B b) { | ||
return "Something"; | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test18_1/in/B.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package p; | ||
class B{ | ||
} |
3 changes: 3 additions & 0 deletions
3
...eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test18_1/out/A.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package p; | ||
public interface A{ | ||
} |
7 changes: 7 additions & 0 deletions
7
...eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test18_1/out/B.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package p; | ||
class B{ | ||
|
||
public String getDefaultName() { | ||
return "Something"; | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test18_2/in/A.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package p; | ||
public interface A{ | ||
default String getDefaultName(B b) { | ||
return "Something"; | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test18_2/in/B.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package p; | ||
interface B{ | ||
} |
3 changes: 3 additions & 0 deletions
3
...eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test18_2/out/A.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package p; | ||
public interface A{ | ||
} |
7 changes: 7 additions & 0 deletions
7
...eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test18_2/out/B.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package p; | ||
interface B{ | ||
|
||
default String getDefaultName() { | ||
return "Something"; | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test18_3/in/A.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package p1; | ||
|
||
import p2.B; | ||
|
||
public interface A { | ||
public int fInt= 10; | ||
public B fB= new B() {}; | ||
public String fString= "something"; | ||
public boolean fBool= true; | ||
|
||
/** | ||
* This is a comment | ||
* @param j | ||
* @param foo | ||
* @param bar | ||
*/ | ||
public default void mA1(float j, int foo, String bar) { | ||
System.out.println(bar + j + this); | ||
String z= fString + fBool; | ||
} | ||
|
||
public void mA2(); | ||
} |
5 changes: 5 additions & 0 deletions
5
org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test18_3/in/B.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package p2; | ||
|
||
public interface B { | ||
|
||
} |
12 changes: 12 additions & 0 deletions
12
...eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test18_3/out/A.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package p1; | ||
|
||
import p2.B; | ||
|
||
public interface A { | ||
public int fInt= 10; | ||
public B fB= new B() {}; | ||
public String fString= "something"; | ||
public boolean fBool= true; | ||
|
||
public void mA2(); | ||
} |
17 changes: 17 additions & 0 deletions
17
...eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test18_3/out/B.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package p2; | ||
|
||
public interface B { | ||
|
||
/** | ||
* This is a comment | ||
* @param a TODO | ||
* @param j | ||
* @param foo | ||
* @param bar | ||
*/ | ||
public default void mA1(A a, float j, int foo, String bar) { | ||
System.out.println(bar + j + a); | ||
String z= A.fString + A.fBool; | ||
} | ||
|
||
} |
23 changes: 23 additions & 0 deletions
23
org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test18_4/in/A.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package p1; | ||
|
||
import p2.B; | ||
|
||
public interface A { | ||
public int fInt= 10; | ||
public B fB= new B(); | ||
public String fString= "something"; | ||
public boolean fBool= true; | ||
|
||
/** | ||
* This is a comment | ||
* @param j | ||
* @param foo | ||
* @param bar | ||
*/ | ||
public default void mA1(float j, int foo, String bar) { | ||
System.out.println(bar + j + this); | ||
String z= fString + fBool; | ||
} | ||
|
||
public void mA2(); | ||
} |
5 changes: 5 additions & 0 deletions
5
org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test18_4/in/B.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package p2; | ||
|
||
public class B { | ||
|
||
} |
12 changes: 12 additions & 0 deletions
12
...eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test18_4/out/A.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package p1; | ||
|
||
import p2.B; | ||
|
||
public interface A { | ||
public int fInt= 10; | ||
public B fB= new B(); | ||
public String fString= "something"; | ||
public boolean fBool= true; | ||
|
||
public void mA2(); | ||
} |
17 changes: 17 additions & 0 deletions
17
...eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test18_4/out/B.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package p2; | ||
|
||
public class B { | ||
|
||
/** | ||
* This is a comment | ||
* @param a TODO | ||
* @param j | ||
* @param foo | ||
* @param bar | ||
*/ | ||
public void mA1(A a, float j, int foo, String bar) { | ||
System.out.println(bar + j + a); | ||
String z= A.fString + A.fBool; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
...efactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/MoveInstanceMethodTests18.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2014 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 | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
* | ||
* Contributors: | ||
* IBM Corporation - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.jdt.ui.tests.refactoring; | ||
|
||
import junit.framework.Test; | ||
|
||
public class MoveInstanceMethodTests18 extends MoveInstanceMethodTests { | ||
|
||
private static final Class clazz= MoveInstanceMethodTests18.class; | ||
|
||
public MoveInstanceMethodTests18(String name) { | ||
super(name); | ||
} | ||
|
||
public static Test suite() { | ||
return setUpTest(new NoSuperTestsSuite(clazz)); | ||
} | ||
|
||
public static Test setUpTest(Test someTest) { | ||
return new Java18Setup(someTest); | ||
} | ||
|
||
// test for bug 410056, move default method from interface to class | ||
public void test18_1() throws Exception { | ||
String[] cuQNames= new String[] { "p.A", "p.B" }; | ||
String selectionCuQName= "p.A"; | ||
helper1(cuQNames, selectionCuQName, 3, 20, 3, 34, PARAMETER, "b", true, true); | ||
|
||
} | ||
|
||
// test for bug 410056, move default method from interface to interface | ||
public void test18_2() throws Exception { | ||
String[] cuQNames= new String[] { "p.A", "p.B" }; | ||
String selectionCuQName= "p.A"; | ||
helper1(cuQNames, selectionCuQName, 3, 20, 3, 34, PARAMETER, "b", true, true); | ||
} | ||
|
||
// test for bug 410056, move default method from interface to interface(declared field) | ||
public void test18_3() throws Exception { | ||
String[] cuQNames= new String[] { "p.A", "p.B" }; | ||
String selectionCuQName= "p.A"; | ||
helper1(cuQNames, selectionCuQName, 17, 25, 17, 28, FIELD, "fB", true, true); | ||
} | ||
|
||
// test for bug 410056, move default method from interface to class(declared field) | ||
public void test18_4() throws Exception { | ||
String[] cuQNames= new String[] { "p.A", "p.B" }; | ||
String selectionCuQName= "p.A"; | ||
helper1(cuQNames, selectionCuQName, 17, 25, 17, 28, FIELD, "fB", true, true); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters