diff options
Diffstat (limited to 'testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant')
109 files changed, 1099 insertions, 0 deletions
diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test0/in/C.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test0/in/C.java new file mode 100644 index 000000000..47de648f2 --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test0/in/C.java @@ -0,0 +1,10 @@ +// 5, 30 -> 5, 36 replaceAll == true, removeDeclaration == false +package p; + +class C { + private static final int FOOBAR= 0; + + private static void jb() { + System.out.println("Ceci, ce n'est pas une pipe: " + FOOBAR + " ;"); + } +}
\ No newline at end of file diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test0/out/C.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test0/out/C.java new file mode 100644 index 000000000..e8466a2d6 --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test0/out/C.java @@ -0,0 +1,10 @@ +// 5, 30 -> 5, 36 replaceAll == true, removeDeclaration == false +package p; + +class C { + private static final int FOOBAR= 0; + + private static void jb() { + System.out.println("Ceci, ce n'est pas une pipe: " + 0 + " ;"); + } +}
\ No newline at end of file diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test1/in/C.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test1/in/C.java new file mode 100644 index 000000000..928c335fa --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test1/in/C.java @@ -0,0 +1,22 @@ +// 3, 33 -> 3, 40 removeDeclaration == false, replaceAll == true +class C { + public static final boolean I_EXIST= true; + + static { + boolean beans= I_EXIST; + } +} + +class D { + int object_oriented_programming() { + return false || (!false && C.I_EXIST && (false != true)); + } +} + +class CPlusPlus extends C { + public static final int JAVA= I_EXIST ? 0xCAFEBABE : OxO; + + void beans() { + System.err.println(C . I_EXIST); + } +}
\ No newline at end of file diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test1/out/C.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test1/out/C.java new file mode 100644 index 000000000..0eb48a8f1 --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test1/out/C.java @@ -0,0 +1,22 @@ +// 3, 33 -> 3, 40 removeDeclaration == false, replaceAll == true +class C { + public static final boolean I_EXIST= true; + + static { + boolean beans= true; + } +} + +class D { + int object_oriented_programming() { + return false || (!false && true && (false != true)); + } +} + +class CPlusPlus extends C { + public static final int JAVA= true ? 0xCAFEBABE : OxO; + + void beans() { + System.err.println(true); + } +}
\ No newline at end of file diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test10/in/A.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test10/in/A.java new file mode 100644 index 000000000..ddbf9f55d --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test10/in/A.java @@ -0,0 +1,7 @@ +package p1; + +public class A { + public static final String EARTH= "Elysium"; + + public static final String ELYSIUM= EARTH; +}
\ No newline at end of file diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test10/in/B.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test10/in/B.java new file mode 100644 index 000000000..487d1dd9e --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test10/in/B.java @@ -0,0 +1,11 @@ +// 9, 28 -> 9, 37 replaceAll == false +package p2; + +import p1.A; + +class B { + + public static void main(String[] args) { + System.out.println(A.ELYSIUM); + } +}
\ No newline at end of file diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test10/out/A.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test10/out/A.java new file mode 100644 index 000000000..ddbf9f55d --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test10/out/A.java @@ -0,0 +1,7 @@ +package p1; + +public class A { + public static final String EARTH= "Elysium"; + + public static final String ELYSIUM= EARTH; +}
\ No newline at end of file diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test10/out/B.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test10/out/B.java new file mode 100644 index 000000000..e79665f1a --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test10/out/B.java @@ -0,0 +1,11 @@ +// 9, 28 -> 9, 37 replaceAll == false +package p2; + +import p1.A; + +class B { + + public static void main(String[] args) { + System.out.println(A.EARTH); + } +}
\ No newline at end of file diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test11/in/A.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test11/in/A.java new file mode 100644 index 000000000..0e499f487 --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test11/in/A.java @@ -0,0 +1,10 @@ +// 8, 25 -> 8, 25 replaceAll == false +package p1; + +import p2.B; + +public class A { + void f() { + int j= 4 * B.ZEMENT + 1; + } +}
\ No newline at end of file diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test11/in/B.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test11/in/B.java new file mode 100644 index 000000000..3e2d1cda0 --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test11/in/B.java @@ -0,0 +1,7 @@ +package p2; + +import p3.C; + +public class B { + public static final int ZEMENT= 4*C.BEGRIFF + p3.C.BEGRIFF; +}
\ No newline at end of file diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test11/in/C.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test11/in/C.java new file mode 100644 index 000000000..a2f3a71a5 --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test11/in/C.java @@ -0,0 +1,5 @@ +package p3; + +public class C { + public static final int BEGRIFF= "Der Begriff"; +}
\ No newline at end of file diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test11/out/A.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test11/out/A.java new file mode 100644 index 000000000..628296dc1 --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test11/out/A.java @@ -0,0 +1,10 @@ +// 8, 25 -> 8, 25 replaceAll == false +package p1; + +import p3.C; + +public class A { + void f() { + int j= 4 * (4*C.BEGRIFF + p3.C.BEGRIFF) + 1; + } +}
\ No newline at end of file diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test11/out/B.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test11/out/B.java new file mode 100644 index 000000000..3e2d1cda0 --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test11/out/B.java @@ -0,0 +1,7 @@ +package p2; + +import p3.C; + +public class B { + public static final int ZEMENT= 4*C.BEGRIFF + p3.C.BEGRIFF; +}
\ No newline at end of file diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test11/out/C.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test11/out/C.java new file mode 100644 index 000000000..a2f3a71a5 --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test11/out/C.java @@ -0,0 +1,5 @@ +package p3; + +public class C { + public static final int BEGRIFF= "Der Begriff"; +}
\ No newline at end of file diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test12/in/Declarer.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test12/in/Declarer.java new file mode 100644 index 000000000..6e0cca0d4 --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test12/in/Declarer.java @@ -0,0 +1,7 @@ +package p1; + +public class Declarer { + public static final String CONSTANT= foo; + + public static String foo= "foo_for_now"; +}
\ No newline at end of file diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test12/in/InlineSite.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test12/in/InlineSite.java new file mode 100644 index 000000000..0081d1408 --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test12/in/InlineSite.java @@ -0,0 +1,9 @@ +// Here, an import is added for a type needed only after a qualification is added. +// 7, 37 -> 7, 43 replaceAll == true, removeDeclaration == false +package p2; + +class InlineSite { + static { + System.out.println(p1.Declarer.CONSTANT); + } +}
\ No newline at end of file diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test12/out/Declarer.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test12/out/Declarer.java new file mode 100644 index 000000000..6e0cca0d4 --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test12/out/Declarer.java @@ -0,0 +1,7 @@ +package p1; + +public class Declarer { + public static final String CONSTANT= foo; + + public static String foo= "foo_for_now"; +}
\ No newline at end of file diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test12/out/InlineSite.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test12/out/InlineSite.java new file mode 100644 index 000000000..6ffb232f1 --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test12/out/InlineSite.java @@ -0,0 +1,11 @@ +// Here, an import is added for a type needed only after a qualification is added. +// 7, 37 -> 7, 43 replaceAll == true, removeDeclaration == false +package p2; + +import p1.Declarer; + +class InlineSite { + static { + System.out.println(Declarer.foo); + } +}
\ No newline at end of file diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test13/in/A.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test13/in/A.java new file mode 100644 index 000000000..8b20772f2 --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test13/in/A.java @@ -0,0 +1,9 @@ +package p1; + +public class A { + public class B { + public static final Object CONSTANT= ALFRED; + } + + public static final Object ALFRED= null; +}
\ No newline at end of file diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test13/in/InlineSite.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test13/in/InlineSite.java new file mode 100644 index 000000000..04b860a2d --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test13/in/InlineSite.java @@ -0,0 +1,9 @@ +// Here, an import is added for a type needed only after a qualification is added. +// 8, 19 -> 8, 29 removeAll == false +package p2; + +import p1.A.B; + +class InlineSite { + Object thing= B.CONSTANT; +}
\ No newline at end of file diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test13/out/A.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test13/out/A.java new file mode 100644 index 000000000..8b20772f2 --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test13/out/A.java @@ -0,0 +1,9 @@ +package p1; + +public class A { + public class B { + public static final Object CONSTANT= ALFRED; + } + + public static final Object ALFRED= null; +}
\ No newline at end of file diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test13/out/InlineSite.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test13/out/InlineSite.java new file mode 100644 index 000000000..331196ba2 --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test13/out/InlineSite.java @@ -0,0 +1,9 @@ +// Here, an import is added for a type needed only after a qualification is added. +// 8, 19 -> 8, 29 removeAll == false +package p2; + +import p1.A; + +class InlineSite { + Object thing= A.ALFRED; +}
\ No newline at end of file diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test14/in/GrueziWohl.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test14/in/GrueziWohl.java new file mode 100644 index 000000000..11d4e1e11 --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test14/in/GrueziWohl.java @@ -0,0 +1,17 @@ +// 7, 35 -> 7, 35 replaceAll == true, removeDeclaration == false; +package cantonzuerich; + +public class GrueziWohl { + private static String gruezi= "Gruezi"; + private static boolean jh= true; + private static final boolean WOHL= jh && "Gruezi".equals(gruezi); + + public String holenGruss() { + String gruezi= "Gruezi"; + return gruezi + (WOHL ? " Wohl" : "") + "!"; + } + + private boolean wohl() { + return WOHL; + } +}
\ No newline at end of file diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test14/out/GrueziWohl.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test14/out/GrueziWohl.java new file mode 100644 index 000000000..d9f0854ee --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test14/out/GrueziWohl.java @@ -0,0 +1,17 @@ +// 7, 35 -> 7, 35 replaceAll == true, removeDeclaration == false; +package cantonzuerich; + +public class GrueziWohl { + private static String gruezi= "Gruezi"; + private static boolean jh= true; + private static final boolean WOHL= jh && "Gruezi".equals(gruezi); + + public String holenGruss() { + String gruezi= "Gruezi"; + return gruezi + (jh && "Gruezi".equals(GrueziWohl.gruezi) ? " Wohl" : "") + "!"; + } + + private boolean wohl() { + return jh && "Gruezi".equals(gruezi); + } +}
\ No newline at end of file diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test15/in/Froehlichkeit.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test15/in/Froehlichkeit.java new file mode 100644 index 000000000..5cf853d98 --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test15/in/Froehlichkeit.java @@ -0,0 +1,21 @@ +// 14, 16 -> 14, 32 replaceAll == true, removeDeclaration == false +package schweiz.zuerich.zuerich; + +public abstract class Froehlichkeit { + static class MeineFroehlichkeit extends Froehlichkeit { + MeineFroehlichkeit(Object o) {} + } + private static Object something= new Object(); + private static final Froehlichkeit dieFroehlichkeit= new MeineFroehlichkeit(something); + + public Froehlichkeit holenFroehlichkeit() { + class MeineFroehlichkeit { + } + return dieFroehlichkeit; + } + + public Froehlichkeit deineFroehlichkeit() { + Object something= ""; + return dieFroehlichkeit; + } +}
\ No newline at end of file diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test15/out/Froehlichkeit.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test15/out/Froehlichkeit.java new file mode 100644 index 000000000..8002a212a --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test15/out/Froehlichkeit.java @@ -0,0 +1,21 @@ +// 14, 16 -> 14, 32 replaceAll == true, removeDeclaration == false +package schweiz.zuerich.zuerich; + +public abstract class Froehlichkeit { + static class MeineFroehlichkeit extends Froehlichkeit { + MeineFroehlichkeit(Object o) {} + } + private static Object something= new Object(); + private static final Froehlichkeit dieFroehlichkeit= new MeineFroehlichkeit(something); + + public Froehlichkeit holenFroehlichkeit() { + class MeineFroehlichkeit { + } + return new Froehlichkeit.MeineFroehlichkeit(something); + } + + public Froehlichkeit deineFroehlichkeit() { + Object something= ""; + return new MeineFroehlichkeit(Froehlichkeit.something); + } +}
\ No newline at end of file diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test16/in/IntegerMath.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test16/in/IntegerMath.java new file mode 100644 index 000000000..f85359c33 --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test16/in/IntegerMath.java @@ -0,0 +1,22 @@ +//8, 23 -> 8, 23 replaceAll == true, removeDeclaration == true +package p; + +class IntegerMath<E> { + /** + * This is {@link #PI} + */ + static final int PI= 3; + /** + * This uses {@link #PI} + */ + int getCircumference(int radius) { + return 2 * radius * PI/*.14159265*/; + } +} + +/** + * @see IntegerMath#PI + */ +class Test { + int c= new IntegerMath<String>().getCircumference(IntegerMath.PI); +}
\ No newline at end of file diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test16/out/IntegerMath.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test16/out/IntegerMath.java new file mode 100644 index 000000000..130456563 --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test16/out/IntegerMath.java @@ -0,0 +1,18 @@ +//8, 23 -> 8, 23 replaceAll == true, removeDeclaration == true +package p; + +class IntegerMath<E> { + /** + * This uses {@link #PI} + */ + int getCircumference(int radius) { + return 2 * radius * 3/*.14159265*/; + } +} + +/** + * @see IntegerMath#PI + */ +class Test { + int c= new IntegerMath<String>().getCircumference(3); +}
\ No newline at end of file diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test17/in/EnumRef.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test17/in/EnumRef.java new file mode 100644 index 000000000..fd7998bc6 --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test17/in/EnumRef.java @@ -0,0 +1,8 @@ +//4, 59 -> 4, 59 replaceAll == true, removeDeclaration == true +package p; + +enum Letter { A, B, C { }; public static final Letter MAIN= A; } + +class EnumRef { + Letter l= Letter.MAIN; +} diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test17/out/EnumRef.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test17/out/EnumRef.java new file mode 100644 index 000000000..9bd9aa971 --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test17/out/EnumRef.java @@ -0,0 +1,8 @@ +//4, 59 -> 4, 59 replaceAll == true, removeDeclaration == true +package p; + +enum Letter { A, B, C { } } + +class EnumRef { + Letter l= Letter.A; +} diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test18/in/Annot.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test18/in/Annot.java new file mode 100644 index 000000000..b31fa872c --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test18/in/Annot.java @@ -0,0 +1,14 @@ +//5, 18 -> 5, 18 replaceAll == true, removeDeclaration == true +package p; + +@interface Annot { + String DEFAULT_NAME= "Paul"; + String value(); +} +@Annot(Annot.DEFAULT_NAME) +class Test { + @Annot(value=Annot.DEFAULT_NAME) + String m(Annot a) { + return a.DEFAULT_NAME; + } +} diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test18/out/Annot.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test18/out/Annot.java new file mode 100644 index 000000000..efd5224bc --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test18/out/Annot.java @@ -0,0 +1,13 @@ +//5, 18 -> 5, 18 replaceAll == true, removeDeclaration == true +package p; + +@interface Annot { + String value(); +} +@Annot("Paul") +class Test { + @Annot(value="Paul") + String m(Annot a) { + return "Paul"; + } +} diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test19/in/Test.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test19/in/Test.java new file mode 100644 index 000000000..70ed7484a --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test19/in/Test.java @@ -0,0 +1,17 @@ +//7, 36 -> 7, 36 replaceAll == true, removeDeclaration == false +package p; + +@Test.Annot(Test.Annot.DEFAULT) +class Test { + @interface Annot { + public static final String DEFAULT= "John"; + String value(); + } + @Annot(Annot.DEFAULT) + int a; + @Annot(value=Annot.DEFAULT) + int b; +} + +@Test.Annot(value=Test.Annot.DEFAULT) +enum Test2 {}
\ No newline at end of file diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test19/out/Test.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test19/out/Test.java new file mode 100644 index 000000000..cd73f156a --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test19/out/Test.java @@ -0,0 +1,17 @@ +//7, 36 -> 7, 36 replaceAll == true, removeDeclaration == false +package p; + +@Test.Annot("John") +class Test { + @interface Annot { + public static final String DEFAULT= "John"; + String value(); + } + @Annot("John") + int a; + @Annot(value="John") + int b; +} + +@Test.Annot(value="John") +enum Test2 {}
\ No newline at end of file diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test2/in/Klass.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test2/in/Klass.java new file mode 100644 index 000000000..44afdd638 --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test2/in/Klass.java @@ -0,0 +1,14 @@ +// 10, 22 -> 10, 30 replaceAll == false + +package p; + +class Klass { + static final Klass KONSTANT= new Klass() ; + + + static void f() { + Klass klass= KONSTANT; + } + + Klass klass=KONSTANT; +}
\ No newline at end of file diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test2/out/Klass.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test2/out/Klass.java new file mode 100644 index 000000000..26f644e46 --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test2/out/Klass.java @@ -0,0 +1,14 @@ +// 10, 22 -> 10, 30 replaceAll == false + +package p; + +class Klass { + static final Klass KONSTANT= new Klass() ; + + + static void f() { + Klass klass= new Klass(); + } + + Klass klass=KONSTANT; +}
\ No newline at end of file diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test20/in/Test.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test20/in/Test.java new file mode 100644 index 000000000..55fc62b85 --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test20/in/Test.java @@ -0,0 +1,14 @@ +//10, 21 -> 10, 21 replaceAll == true, removeDeclaration == true +package p; + +class Test { + private enum Color { + PINK, YELLOW; + final static Color CORPORATE_COLOR= Color.PINK; + } + private enum Box { + FIRST(Color.CORPORATE_COLOR); + public Box(Color c) {} + } + Color c= Color.CORPORATE_COLOR; +} diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test20/out/Test.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test20/out/Test.java new file mode 100644 index 000000000..4879da057 --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test20/out/Test.java @@ -0,0 +1,13 @@ +//10, 21 -> 10, 21 replaceAll == true, removeDeclaration == true +package p; + +class Test { + private enum Color { + PINK, YELLOW + } + private enum Box { + FIRST(Test.Color.PINK); + public Box(Color c) {} + } + Color c= Test.Color.PINK; +} diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test21/in/A.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test21/in/A.java new file mode 100644 index 000000000..ce144d38f --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test21/in/A.java @@ -0,0 +1,10 @@ +//8, 16 -> 8, 19 replaceAll == true, removeDeclaration == false +package p; + +import static q.Consts.III; + +class A { + int getIII() { + return III; + } +} diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test21/in/Consts.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test21/in/Consts.java new file mode 100644 index 000000000..3b42e84d5 --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test21/in/Consts.java @@ -0,0 +1,6 @@ +package q; + +public interface Consts { + int I= 1; + int III= I + I + I; +}
\ No newline at end of file diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test21/out/A.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test21/out/A.java new file mode 100644 index 000000000..d667ede57 --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test21/out/A.java @@ -0,0 +1,10 @@ +//8, 16 -> 8, 19 replaceAll == true, removeDeclaration == false +package p; + +import static q.Consts.I; + +class A { + int getIII() { + return I + I + I; + } +} diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test21/out/Consts.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test21/out/Consts.java new file mode 100644 index 000000000..3b42e84d5 --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test21/out/Consts.java @@ -0,0 +1,6 @@ +package q; + +public interface Consts { + int I= 1; + int III= I + I + I; +}
\ No newline at end of file diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test22/in/A.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test22/in/A.java new file mode 100644 index 000000000..4c892c643 --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test22/in/A.java @@ -0,0 +1,13 @@ +//11, 16 -> 11, 19 replaceAll == true, removeDeclaration == true +package p; + +import static q.Consts.III; + +public class A { + public static final int getCount() { return 42; } + public static final int getCount2() { return 42; } + + int getIII() { + return III; + } +} diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test22/in/Consts.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test22/in/Consts.java new file mode 100644 index 000000000..030b0affe --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test22/in/Consts.java @@ -0,0 +1,11 @@ +package q; + +import p.A; +import r.Third; +import static p.A.getCount2; +import static r.Third.B; + +public interface Consts { + int I= 1; + int III= I + A.getCount() + getCount2() + Third.A + B; +}
\ No newline at end of file diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test22/in/Third.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test22/in/Third.java new file mode 100644 index 000000000..094ecaacd --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test22/in/Third.java @@ -0,0 +1,6 @@ +package r; + +public class Third { + public static final int A= -23; + public static final int B= 23; +}
\ No newline at end of file diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test22/out/A.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test22/out/A.java new file mode 100644 index 000000000..3eb15bfc1 --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test22/out/A.java @@ -0,0 +1,16 @@ +//11, 16 -> 11, 19 replaceAll == true, removeDeclaration == true +package p; + +import static p.A.getCount2; +import static q.Consts.I; +import static r.Third.B; +import r.Third; + +public class A { + public static final int getCount() { return 42; } + public static final int getCount2() { return 42; } + + int getIII() { + return I + A.getCount() + getCount2() + Third.A + B; + } +} diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test22/out/Consts.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test22/out/Consts.java new file mode 100644 index 000000000..3736dc848 --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test22/out/Consts.java @@ -0,0 +1,6 @@ +package q; + + +public interface Consts { + int I= 1; +}
\ No newline at end of file diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test22/out/Third.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test22/out/Third.java new file mode 100644 index 000000000..094ecaacd --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test22/out/Third.java @@ -0,0 +1,6 @@ +package r; + +public class Third { + public static final int A= -23; + public static final int B= 23; +}
\ No newline at end of file diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test23/in/Test.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test23/in/Test.java new file mode 100644 index 000000000..ad7d403ca --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test23/in/Test.java @@ -0,0 +1,14 @@ +//6, 26 -> 6, 26 replaceAll == false, removeDeclaration == false +package p; + +class Test { + Runnable getExecutor() { + return Runnables.DO_NOTHING; + } +} + +class Runnables { + public static final Runnable DO_NOTHING= new Runnable() { + public void run() { } + }; +} diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test23/out/Test.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test23/out/Test.java new file mode 100644 index 000000000..f8de45084 --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test23/out/Test.java @@ -0,0 +1,16 @@ +//6, 26 -> 6, 26 replaceAll == false, removeDeclaration == false +package p; + +class Test { + Runnable getExecutor() { + return new Runnable() { + public void run() { } + }; + } +} + +class Runnables { + public static final Runnable DO_NOTHING= new Runnable() { + public void run() { } + }; +} diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test24/in/A.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test24/in/A.java new file mode 100644 index 000000000..0c877af07 --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test24/in/A.java @@ -0,0 +1,16 @@ +//14, 17, 14, 17 replaceAll == true, removeDeclaration == true +package p; + +import static q.Consts.III; +import q.Consts; + +public class A { + public static final int getCount() { return 42; } + public static final int getCount2() { return 42; } + + int getIII() { + int i= q.Consts.III; + int ii= Consts.III; + return III + i + ii; + } +} diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test24/in/Consts.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test24/in/Consts.java new file mode 100644 index 000000000..0d21194ce --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test24/in/Consts.java @@ -0,0 +1,10 @@ +package q; + +import p.A; +import static p.A.getCount2; + +public interface Consts { + int I= 1; + int III= I + Consts.I + q.Consts.I + + p.A.getCount() + A.getCount() + getCount2(); +}
\ No newline at end of file diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test24/out/A.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test24/out/A.java new file mode 100644 index 000000000..1fec883a9 --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test24/out/A.java @@ -0,0 +1,20 @@ +//14, 17, 14, 17 replaceAll == true, removeDeclaration == true +package p; + +import static p.A.getCount2; +import static q.Consts.I; +import q.Consts; + +public class A { + public static final int getCount() { return 42; } + public static final int getCount2() { return 42; } + + int getIII() { + int i= Consts.I + Consts.I + q.Consts.I + + p.A.getCount() + A.getCount() + getCount2(); + int ii= Consts.I + Consts.I + q.Consts.I + + p.A.getCount() + A.getCount() + getCount2(); + return (I + Consts.I + q.Consts.I + + p.A.getCount() + A.getCount() + getCount2()) + i + ii; + } +} diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test24/out/Consts.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test24/out/Consts.java new file mode 100644 index 000000000..3736dc848 --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test24/out/Consts.java @@ -0,0 +1,6 @@ +package q; + + +public interface Consts { + int I= 1; +}
\ No newline at end of file diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test25/in/A.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test25/in/A.java new file mode 100644 index 000000000..767ac7c54 --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test25/in/A.java @@ -0,0 +1,13 @@ +//5, 32, 5, 32 +package p; + +class A { + private static final int CONST = 9; + + /* + * (non-Javadoc) comment + */ + public void foo() { + final int lineNumber2= /*preserve*/CONST/*this*/; + } +} diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test25/out/A.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test25/out/A.java new file mode 100644 index 000000000..e59316fcb --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test25/out/A.java @@ -0,0 +1,11 @@ +//5, 32, 5, 32 +package p; + +class A { + /* + * (non-Javadoc) comment + */ + public void foo() { + final int lineNumber2= /*preserve*/9/*this*/; + } +} diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test26/in/A.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test26/in/A.java new file mode 100644 index 000000000..098f7f927 --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test26/in/A.java @@ -0,0 +1,14 @@ +//5, 42, 5, 42 +package p; + +class A { + private static final StringBuffer logger_= getLogger(A.class); + + public static void handleException(final Throwable t) { + System.out.println(logger_); + } + + private static StringBuffer getLogger(Class name) { + return null; + } +} diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test26/out/A.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test26/out/A.java new file mode 100644 index 000000000..dbe1e6276 --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test26/out/A.java @@ -0,0 +1,12 @@ +//5, 42, 5, 42 +package p; + +class A { + public static void handleException(final Throwable t) { + System.out.println(getLogger(A.class)); + } + + private static StringBuffer getLogger(Class name) { + return null; + } +} diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test27/in/A.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test27/in/A.java new file mode 100644 index 000000000..16055daf9 --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test27/in/A.java @@ -0,0 +1,9 @@ +package p; + +class A { + static final int[] array = {}; + { + for (int i = array.length; i < array.length; array[i] = i) + ; + } +} diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test27/out/A.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test27/out/A.java new file mode 100644 index 000000000..77452abc9 --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test27/out/A.java @@ -0,0 +1,8 @@ +package p; + +class A { + { + for (int i = new int[]{}.length; i < new int[]{}.length; new int[]{}[i] = i) + ; + } +} diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test28/in/AnotherClass.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test28/in/AnotherClass.java new file mode 100644 index 000000000..871da96f1 --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test28/in/AnotherClass.java @@ -0,0 +1,7 @@ +package p; + +public class AnotherClass { + { + Const.someArr2[0] = null; + } +} diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test28/in/Const.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test28/in/Const.java new file mode 100644 index 000000000..eea5ac149 --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test28/in/Const.java @@ -0,0 +1,10 @@ +package p; + +import q.UsedClass; + +class Const { + public static final UsedClass someArr2[] = {}; + { + someArr2[0] = null; + } +} diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test28/in/UsedClass.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test28/in/UsedClass.java new file mode 100644 index 000000000..23ac9ec39 --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test28/in/UsedClass.java @@ -0,0 +1,3 @@ +package q; +public class UsedClass { +} diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test28/out/AnotherClass.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test28/out/AnotherClass.java new file mode 100644 index 000000000..86def5c0b --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test28/out/AnotherClass.java @@ -0,0 +1,9 @@ +package p; + +import q.UsedClass; + +public class AnotherClass { + { + new UsedClass[]{}[0] = null; + } +} diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test28/out/Const.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test28/out/Const.java new file mode 100644 index 000000000..6ffb4a5f6 --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test28/out/Const.java @@ -0,0 +1,9 @@ +package p; + +import q.UsedClass; + +class Const { + { + new UsedClass[]{}[0] = null; + } +} diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test28/out/UsedClass.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test28/out/UsedClass.java new file mode 100644 index 000000000..23ac9ec39 --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test28/out/UsedClass.java @@ -0,0 +1,3 @@ +package q; +public class UsedClass { +} diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test29/in/A.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test29/in/A.java new file mode 100644 index 000000000..3eab5a04a --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test29/in/A.java @@ -0,0 +1,17 @@ +package p; + +import java.util.Collections; +import java.util.Map; + +class A { + private static final Map<Float, Float> EMPTY_MAP= Collections.emptyMap(); + + <T extends Number> A(Map<T, T> map) { } + + A() { + this(EMPTY_MAP); + Map<Float, Float> emptyMap= EMPTY_MAP; + Map<?, ?> emptyMap2= EMPTY_MAP; + new A(EMPTY_MAP); + } +} diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test29/out/A.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test29/out/A.java new file mode 100644 index 000000000..645716f1b --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test29/out/A.java @@ -0,0 +1,15 @@ +package p; + +import java.util.Collections; +import java.util.Map; + +class A { + <T extends Number> A(Map<T, T> map) { } + + A() { + this(Collections.<Float, Float>emptyMap()); + Map<Float, Float> emptyMap= Collections.emptyMap(); + Map<?, ?> emptyMap2= Collections.emptyMap(); + new A(Collections.<Float, Float>emptyMap()); + } +} diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test3/in/LeVinSuperieure.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test3/in/LeVinSuperieure.java new file mode 100644 index 000000000..df91fba97 --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test3/in/LeVinSuperieure.java @@ -0,0 +1,11 @@ +// 5, 32 -> 5, 43 replaceAll == true, removeDeclaration == true +package p; + +class LeVinSuperieure { + public static final String LE_CONSTANT= "Pharmacology"; + + public LeVinSuperieure(final String appelation) { + String leNom= appelation == null ? LE_CONSTANT : appelation; + System.out.println("Nous avons cree un superieure vin, appelle " + leNom); + } +}
\ No newline at end of file diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test3/out/LeVinSuperieure.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test3/out/LeVinSuperieure.java new file mode 100644 index 000000000..d354d6053 --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test3/out/LeVinSuperieure.java @@ -0,0 +1,9 @@ +// 5, 32 -> 5, 43 replaceAll == true, removeDeclaration == true +package p; + +class LeVinSuperieure { + public LeVinSuperieure(final String appelation) { + String leNom= appelation == null ? "Pharmacology" : appelation; + System.out.println("Nous avons cree un superieure vin, appelle " + leNom); + } +}
\ No newline at end of file diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test30/in/A.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test30/in/A.java new file mode 100644 index 000000000..c118c3529 --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test30/in/A.java @@ -0,0 +1,6 @@ +package p; + +import static q.Consts.constant; + +class A { +} diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test30/in/B.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test30/in/B.java new file mode 100644 index 000000000..08c354cca --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test30/in/B.java @@ -0,0 +1,8 @@ +package p; + +import static q.Consts.constant; + +class B { + String fS= constant; + int fI= constant(); +} diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test30/in/C.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test30/in/C.java new file mode 100644 index 000000000..7e997d4bc --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test30/in/C.java @@ -0,0 +1,7 @@ +package p; + +import static q.Consts.constant; + +class C { + String fS= constant; +} diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test30/in/Consts.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test30/in/Consts.java new file mode 100644 index 000000000..580ae6df1 --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test30/in/Consts.java @@ -0,0 +1,7 @@ +//5, 32 -> 5, 40 replaceAll == true, removeDeclaration == true +package q; + +public class Consts { + public static final String constant=""; + public static int constant() { return -1; } +}
\ No newline at end of file diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test30/in/D.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test30/in/D.java new file mode 100644 index 000000000..fafd1cc19 --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test30/in/D.java @@ -0,0 +1,7 @@ +package p; + +import static q.Consts.constant; + +class D { + int fI= constant(); +} diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test30/out/A.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test30/out/A.java new file mode 100644 index 000000000..f6ef9fb04 --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test30/out/A.java @@ -0,0 +1,5 @@ +package p; + + +class A { +} diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test30/out/B.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test30/out/B.java new file mode 100644 index 000000000..26b3284be --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test30/out/B.java @@ -0,0 +1,8 @@ +package p; + +import static q.Consts.constant; + +class B { + String fS= ""; + int fI= constant(); +} diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test30/out/C.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test30/out/C.java new file mode 100644 index 000000000..08977441b --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test30/out/C.java @@ -0,0 +1,6 @@ +package p; + + +class C { + String fS= ""; +} diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test30/out/Consts.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test30/out/Consts.java new file mode 100644 index 000000000..b2a3d4747 --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test30/out/Consts.java @@ -0,0 +1,6 @@ +//5, 32 -> 5, 40 replaceAll == true, removeDeclaration == true +package q; + +public class Consts { + public static int constant() { return -1; } +}
\ No newline at end of file diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test30/out/D.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test30/out/D.java new file mode 100644 index 000000000..fafd1cc19 --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test30/out/D.java @@ -0,0 +1,7 @@ +package p; + +import static q.Consts.constant; + +class D { + int fI= constant(); +} diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test31/in/A.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test31/in/A.java new file mode 100644 index 000000000..1ee05b665 --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test31/in/A.java @@ -0,0 +1,7 @@ +package p; + +class A { + static final long CONST = 2; + + long much = CONST * Integer.MAX_VALUE; +} diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test31/out/A.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test31/out/A.java new file mode 100644 index 000000000..6a433712d --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test31/out/A.java @@ -0,0 +1,5 @@ +package p; + +class A { + long much = (long) 2 * Integer.MAX_VALUE; +} diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test32/in/A.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test32/in/A.java new file mode 100644 index 000000000..2b6ab0f57 --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test32/in/A.java @@ -0,0 +1,7 @@ +package p; + +class A { + static final long CONST = 2 + 1; + + long much = CONST * Integer.MAX_VALUE; +} diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test32/out/A.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test32/out/A.java new file mode 100644 index 000000000..500f2d802 --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test32/out/A.java @@ -0,0 +1,5 @@ +package p; + +class A { + long much = (long) (2 + 1) * Integer.MAX_VALUE; +} diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test33/in/A.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test33/in/A.java new file mode 100644 index 000000000..5b15f5f7e --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test33/in/A.java @@ -0,0 +1,18 @@ +package p; + +class A { + public static final int B= 12; + public static final int C= B - 1; //inline C + public static final int K= 99; + + public static void main(String[] args) { + int f1= K - 1 - C; + int f2= K - C - C - C; + + int x1= K + C; + int x2= K - C; + int x3= K + 1 - C; + int x4= K - 1 + C; + int x5= K + 1 + C - C - C; + } +} diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test33/out/A.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test33/out/A.java new file mode 100644 index 000000000..030e3a65d --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test33/out/A.java @@ -0,0 +1,17 @@ +package p; + +class A { + public static final int B= 12; + public static final int K= 99; + + public static void main(String[] args) { + int f1= K - 1 - (B - 1); + int f2= K - (B - 1) - (B - 1) - (B - 1); + + int x1= K + (B - 1); + int x2= K - (B - 1); + int x3= K + 1 - (B - 1); + int x4= K - 1 + (B - 1); + int x5= K + 1 + (B - 1) - (B - 1) - (B - 1); + } +} diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test34/in/A.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test34/in/A.java new file mode 100644 index 000000000..63c78d0d6 --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test34/in/A.java @@ -0,0 +1,6 @@ +package p; + +class A { + static final Short C= 1; + boolean b= equals(C); +} diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test34/out/A.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test34/out/A.java new file mode 100644 index 000000000..be3025cde --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test34/out/A.java @@ -0,0 +1,5 @@ +package p; + +class A { + boolean b= equals((short) 1); +} diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test4/in/Klus.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test4/in/Klus.java new file mode 100644 index 000000000..ced6dc795 --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test4/in/Klus.java @@ -0,0 +1,8 @@ +// 5, 36 -> 5, 36 replaceAll == true, removeDeclaration == false +package p; + +class Klus { + private static final int KLUSPLATZ= 34; + + private int kreuzplatz= (kreuzplatz= -1 +KLUSPLATZ+ (-1)); +}
\ No newline at end of file diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test4/out/Klus.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test4/out/Klus.java new file mode 100644 index 000000000..56daf649a --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test4/out/Klus.java @@ -0,0 +1,8 @@ +// 5, 36 -> 5, 36 replaceAll == true, removeDeclaration == false +package p; + +class Klus { + private static final int KLUSPLATZ= 34; + + private int kreuzplatz= (kreuzplatz= -1 +34+ (-1)); +}
\ No newline at end of file diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test5/in/PartOfDeclNameSelected.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test5/in/PartOfDeclNameSelected.java new file mode 100644 index 000000000..6a5ea9381 --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test5/in/PartOfDeclNameSelected.java @@ -0,0 +1,9 @@ +// 5, 32 -> 5, 34 replaceAllReferences == true, removeDeclaration == true +package p; + +class PartOfDeclNameSelected { + public static final long foooo= 1; + static { + long l= foooo; + } +}
\ No newline at end of file diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test5/out/PartOfDeclNameSelected.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test5/out/PartOfDeclNameSelected.java new file mode 100644 index 000000000..a50f61a07 --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test5/out/PartOfDeclNameSelected.java @@ -0,0 +1,8 @@ +// 5, 32 -> 5, 34 replaceAllReferences == true, removeDeclaration == true +package p; + +class PartOfDeclNameSelected { + static { + long l= (long) 1; + } +}
\ No newline at end of file diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test6/in/CursorPositionedInReference.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test6/in/CursorPositionedInReference.java new file mode 100644 index 000000000..5441bb274 --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test6/in/CursorPositionedInReference.java @@ -0,0 +1,10 @@ +// 8, 57 -> 8, 57 replaceAll == false +package p; + +class CursorPositionedInReference { + static final String VISUALAGE_FOR_COBOL= "simply irresistible"; + + public static CursorPositionedInReference eat() { + System.out.println("Refactoring is " + VISUALAGE_FOR_COBOL); + } +}
\ No newline at end of file diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test6/out/CursorPositionedInReference.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test6/out/CursorPositionedInReference.java new file mode 100644 index 000000000..079cba539 --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test6/out/CursorPositionedInReference.java @@ -0,0 +1,10 @@ +// 8, 57 -> 8, 57 replaceAll == false +package p; + +class CursorPositionedInReference { + static final String VISUALAGE_FOR_COBOL= "simply irresistible"; + + public static CursorPositionedInReference eat() { + System.out.println("Refactoring is " + "simply irresistible"); + } +}
\ No newline at end of file diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test7/in/PartOfReferenceSelected.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test7/in/PartOfReferenceSelected.java new file mode 100644 index 000000000..3777c201d --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test7/in/PartOfReferenceSelected.java @@ -0,0 +1,10 @@ +// 8, 52 -> 8, 62 replaceAll == false +package p; + +class PartOfReferenceSelected { + static final String VISUALAGE_FOR_COBOL= "simply irresistible"; + + public static CursorPositionedInReference eat() { + System.out.println("Refactoring is " + VISUALAGE_FOR_COBOL); + } +}
\ No newline at end of file diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test7/out/PartOfReferenceSelected.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test7/out/PartOfReferenceSelected.java new file mode 100644 index 000000000..5d2c1654d --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test7/out/PartOfReferenceSelected.java @@ -0,0 +1,10 @@ +// 8, 52 -> 8, 62 replaceAll == false +package p; + +class PartOfReferenceSelected { + static final String VISUALAGE_FOR_COBOL= "simply irresistible"; + + public static CursorPositionedInReference eat() { + System.out.println("Refactoring is " + "simply irresistible"); + } +}
\ No newline at end of file diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test8/in/C.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test8/in/C.java new file mode 100644 index 000000000..8808f0596 --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test8/in/C.java @@ -0,0 +1,6 @@ +// 5, 29 -> 5, 37 replaceAll == true, removeDeclaration == false +package p1; + +public class C { + public static final int CONSTANT= 12345; +}
\ No newline at end of file diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test8/in/D.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test8/in/D.java new file mode 100644 index 000000000..e65ae9102 --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test8/in/D.java @@ -0,0 +1,9 @@ +package p2; + +import p1.C; + +class D { + void f() { + int j= C.CONSTANT; + } +}
\ No newline at end of file diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test8/out/C.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test8/out/C.java new file mode 100644 index 000000000..8808f0596 --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test8/out/C.java @@ -0,0 +1,6 @@ +// 5, 29 -> 5, 37 replaceAll == true, removeDeclaration == false +package p1; + +public class C { + public static final int CONSTANT= 12345; +}
\ No newline at end of file diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test8/out/D.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test8/out/D.java new file mode 100644 index 000000000..9b9ad0a0f --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test8/out/D.java @@ -0,0 +1,8 @@ +package p2; + + +class D { + void f() { + int j= 12345; + } +}
\ No newline at end of file diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test9/in/C.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test9/in/C.java new file mode 100644 index 000000000..806e8588a --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test9/in/C.java @@ -0,0 +1,5 @@ +package p1; + +public class C { + public static final int CONSTANT= 12345; +}
\ No newline at end of file diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test9/in/D.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test9/in/D.java new file mode 100644 index 000000000..9ea4920d9 --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test9/in/D.java @@ -0,0 +1,10 @@ +// 8, 18 -> 8, 26 replaceAll == true, removeDeclaration == true +package p2; + +import p1.C; + +class D { + void f() { + int j= C.CONSTANT; + } +}
\ No newline at end of file diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test9/in/E.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test9/in/E.java new file mode 100644 index 000000000..6d6b96a93 --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test9/in/E.java @@ -0,0 +1,7 @@ +package p3; + +import p1.C; + +public class E { + static int e= 1 + C.CONSTANT; +}
\ No newline at end of file diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test9/out/C.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test9/out/C.java new file mode 100644 index 000000000..1df4f81ab --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test9/out/C.java @@ -0,0 +1,4 @@ +package p1; + +public class C { +}
\ No newline at end of file diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test9/out/D.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test9/out/D.java new file mode 100644 index 000000000..74ccf93ed --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test9/out/D.java @@ -0,0 +1,9 @@ +// 8, 18 -> 8, 26 replaceAll == true, removeDeclaration == true +package p2; + + +class D { + void f() { + int j= 12345; + } +}
\ No newline at end of file diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test9/out/E.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test9/out/E.java new file mode 100644 index 000000000..282fbc6ef --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test9/out/E.java @@ -0,0 +1,6 @@ +package p3; + + +public class E { + static int e= 1 + 12345; +}
\ No newline at end of file diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/cannotInline/testFail0/in/NeueZuercherZeitung.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/cannotInline/testFail0/in/NeueZuercherZeitung.java new file mode 100644 index 000000000..40b9ea98d --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/cannotInline/testFail0/in/NeueZuercherZeitung.java @@ -0,0 +1,7 @@ +// 5, 27 -> 5, 28, replaceAll= true removeDeclaration == false +package foo; + +class NeueZuercherZeitung { + public static Object foob; +} + diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/cannotInline/testFail1/in/Fun.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/cannotInline/testFail1/in/Fun.java new file mode 100644 index 000000000..071ae4c28 --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/cannotInline/testFail1/in/Fun.java @@ -0,0 +1,10 @@ +// 8, 35 -> 8, 35 replaceAll == false +package fun; + +import java.util.*; + +class Fun { + int m() { + return GregorianCalendar.BC; + } +}
\ No newline at end of file diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/cannotInline/testFail2/in/EnumRef.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/cannotInline/testFail2/in/EnumRef.java new file mode 100644 index 000000000..da630063a --- /dev/null +++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/cannotInline/testFail2/in/EnumRef.java @@ -0,0 +1,8 @@ +//7, 22 -> 7, 22 replaceAll == true, removeDeclaration == true +package p; + +enum Letter { A, B, C } + +class EnumRef { + Letter l= Letter.A; +} |