diff options
Diffstat (limited to 'src/test/java/cuchaz/enigma/inputs/innerClasses')
6 files changed, 33 insertions, 28 deletions
diff --git a/src/test/java/cuchaz/enigma/inputs/innerClasses/A_Anonymous.java b/src/test/java/cuchaz/enigma/inputs/innerClasses/A_Anonymous.java index f644439..f652d87 100644 --- a/src/test/java/cuchaz/enigma/inputs/innerClasses/A_Anonymous.java +++ b/src/test/java/cuchaz/enigma/inputs/innerClasses/A_Anonymous.java | |||
| @@ -4,14 +4,15 @@ | |||
| 4 | * are made available under the terms of the GNU Lesser General Public | 4 | * are made available under the terms of the GNU Lesser General Public |
| 5 | * License v3.0 which accompanies this distribution, and is available at | 5 | * License v3.0 which accompanies this distribution, and is available at |
| 6 | * http://www.gnu.org/licenses/lgpl.html | 6 | * http://www.gnu.org/licenses/lgpl.html |
| 7 | * | 7 | * |
| 8 | * Contributors: | 8 | * Contributors: |
| 9 | * Jeff Martin - initial API and implementation | 9 | * Jeff Martin - initial API and implementation |
| 10 | ******************************************************************************/ | 10 | ******************************************************************************/ |
| 11 | |||
| 11 | package cuchaz.enigma.inputs.innerClasses; | 12 | package cuchaz.enigma.inputs.innerClasses; |
| 12 | 13 | ||
| 13 | public class A_Anonymous { | 14 | public class A_Anonymous { |
| 14 | 15 | ||
| 15 | public void foo() { | 16 | public void foo() { |
| 16 | Runnable runnable = new Runnable() { | 17 | Runnable runnable = new Runnable() { |
| 17 | @Override | 18 | @Override |
diff --git a/src/test/java/cuchaz/enigma/inputs/innerClasses/B_AnonymousWithScopeArgs.java b/src/test/java/cuchaz/enigma/inputs/innerClasses/B_AnonymousWithScopeArgs.java index d78be84..d1b7601 100644 --- a/src/test/java/cuchaz/enigma/inputs/innerClasses/B_AnonymousWithScopeArgs.java +++ b/src/test/java/cuchaz/enigma/inputs/innerClasses/B_AnonymousWithScopeArgs.java | |||
| @@ -4,14 +4,15 @@ | |||
| 4 | * are made available under the terms of the GNU Lesser General Public | 4 | * are made available under the terms of the GNU Lesser General Public |
| 5 | * License v3.0 which accompanies this distribution, and is available at | 5 | * License v3.0 which accompanies this distribution, and is available at |
| 6 | * http://www.gnu.org/licenses/lgpl.html | 6 | * http://www.gnu.org/licenses/lgpl.html |
| 7 | * | 7 | * |
| 8 | * Contributors: | 8 | * Contributors: |
| 9 | * Jeff Martin - initial API and implementation | 9 | * Jeff Martin - initial API and implementation |
| 10 | ******************************************************************************/ | 10 | ******************************************************************************/ |
| 11 | |||
| 11 | package cuchaz.enigma.inputs.innerClasses; | 12 | package cuchaz.enigma.inputs.innerClasses; |
| 12 | 13 | ||
| 13 | public class B_AnonymousWithScopeArgs { | 14 | public class B_AnonymousWithScopeArgs { |
| 14 | 15 | ||
| 15 | public static void foo(final D_Simple arg) { | 16 | public static void foo(final D_Simple arg) { |
| 16 | System.out.println(new Object() { | 17 | System.out.println(new Object() { |
| 17 | @Override | 18 | @Override |
diff --git a/src/test/java/cuchaz/enigma/inputs/innerClasses/C_ConstructorArgs.java b/src/test/java/cuchaz/enigma/inputs/innerClasses/C_ConstructorArgs.java index eb03489..94061fa 100644 --- a/src/test/java/cuchaz/enigma/inputs/innerClasses/C_ConstructorArgs.java +++ b/src/test/java/cuchaz/enigma/inputs/innerClasses/C_ConstructorArgs.java | |||
| @@ -4,27 +4,28 @@ | |||
| 4 | * are made available under the terms of the GNU Lesser General Public | 4 | * are made available under the terms of the GNU Lesser General Public |
| 5 | * License v3.0 which accompanies this distribution, and is available at | 5 | * License v3.0 which accompanies this distribution, and is available at |
| 6 | * http://www.gnu.org/licenses/lgpl.html | 6 | * http://www.gnu.org/licenses/lgpl.html |
| 7 | * | 7 | * |
| 8 | * Contributors: | 8 | * Contributors: |
| 9 | * Jeff Martin - initial API and implementation | 9 | * Jeff Martin - initial API and implementation |
| 10 | ******************************************************************************/ | 10 | ******************************************************************************/ |
| 11 | |||
| 11 | package cuchaz.enigma.inputs.innerClasses; | 12 | package cuchaz.enigma.inputs.innerClasses; |
| 12 | 13 | ||
| 13 | @SuppressWarnings("unused") | 14 | @SuppressWarnings("unused") |
| 14 | public class C_ConstructorArgs { | 15 | public class C_ConstructorArgs { |
| 15 | 16 | ||
| 17 | Inner i; | ||
| 18 | |||
| 19 | public void foo() { | ||
| 20 | i = new Inner(5); | ||
| 21 | } | ||
| 22 | |||
| 16 | class Inner { | 23 | class Inner { |
| 17 | 24 | ||
| 18 | private int a; | 25 | private int a; |
| 19 | 26 | ||
| 20 | public Inner(int a) { | 27 | public Inner(int a) { |
| 21 | this.a = a; | 28 | this.a = a; |
| 22 | } | 29 | } |
| 23 | } | 30 | } |
| 24 | |||
| 25 | Inner i; | ||
| 26 | |||
| 27 | public void foo() { | ||
| 28 | i = new Inner(5); | ||
| 29 | } | ||
| 30 | } | 31 | } |
diff --git a/src/test/java/cuchaz/enigma/inputs/innerClasses/D_Simple.java b/src/test/java/cuchaz/enigma/inputs/innerClasses/D_Simple.java index 0e9bf82..71b3a6d 100644 --- a/src/test/java/cuchaz/enigma/inputs/innerClasses/D_Simple.java +++ b/src/test/java/cuchaz/enigma/inputs/innerClasses/D_Simple.java | |||
| @@ -4,14 +4,15 @@ | |||
| 4 | * are made available under the terms of the GNU Lesser General Public | 4 | * are made available under the terms of the GNU Lesser General Public |
| 5 | * License v3.0 which accompanies this distribution, and is available at | 5 | * License v3.0 which accompanies this distribution, and is available at |
| 6 | * http://www.gnu.org/licenses/lgpl.html | 6 | * http://www.gnu.org/licenses/lgpl.html |
| 7 | * | 7 | * |
| 8 | * Contributors: | 8 | * Contributors: |
| 9 | * Jeff Martin - initial API and implementation | 9 | * Jeff Martin - initial API and implementation |
| 10 | ******************************************************************************/ | 10 | ******************************************************************************/ |
| 11 | |||
| 11 | package cuchaz.enigma.inputs.innerClasses; | 12 | package cuchaz.enigma.inputs.innerClasses; |
| 12 | 13 | ||
| 13 | public class D_Simple { | 14 | public class D_Simple { |
| 14 | 15 | ||
| 15 | class Inner { | 16 | class Inner { |
| 16 | // nothing to do | 17 | // nothing to do |
| 17 | } | 18 | } |
diff --git a/src/test/java/cuchaz/enigma/inputs/innerClasses/E_AnonymousWithOuterAccess.java b/src/test/java/cuchaz/enigma/inputs/innerClasses/E_AnonymousWithOuterAccess.java index 255434d..976ec42 100644 --- a/src/test/java/cuchaz/enigma/inputs/innerClasses/E_AnonymousWithOuterAccess.java +++ b/src/test/java/cuchaz/enigma/inputs/innerClasses/E_AnonymousWithOuterAccess.java | |||
| @@ -4,17 +4,18 @@ | |||
| 4 | * are made available under the terms of the GNU Lesser General Public | 4 | * are made available under the terms of the GNU Lesser General Public |
| 5 | * License v3.0 which accompanies this distribution, and is available at | 5 | * License v3.0 which accompanies this distribution, and is available at |
| 6 | * http://www.gnu.org/licenses/lgpl.html | 6 | * http://www.gnu.org/licenses/lgpl.html |
| 7 | * | 7 | * |
| 8 | * Contributors: | 8 | * Contributors: |
| 9 | * Jeff Martin - initial API and implementation | 9 | * Jeff Martin - initial API and implementation |
| 10 | ******************************************************************************/ | 10 | ******************************************************************************/ |
| 11 | |||
| 11 | package cuchaz.enigma.inputs.innerClasses; | 12 | package cuchaz.enigma.inputs.innerClasses; |
| 12 | 13 | ||
| 13 | public class E_AnonymousWithOuterAccess { | 14 | public class E_AnonymousWithOuterAccess { |
| 14 | 15 | ||
| 15 | // reproduction of error case documented at: | 16 | // reproduction of error case documented at: |
| 16 | // https://bitbucket.org/cuchaz/enigma/issue/61/stackoverflowerror-when-deobfuscating | 17 | // https://bitbucket.org/cuchaz/enigma/issue/61/stackoverflowerror-when-deobfuscating |
| 17 | 18 | ||
| 18 | public Object makeInner() { | 19 | public Object makeInner() { |
| 19 | outerMethod(); | 20 | outerMethod(); |
| 20 | return new Object() { | 21 | return new Object() { |
| @@ -24,7 +25,7 @@ public class E_AnonymousWithOuterAccess { | |||
| 24 | } | 25 | } |
| 25 | }; | 26 | }; |
| 26 | } | 27 | } |
| 27 | 28 | ||
| 28 | private String outerMethod() { | 29 | private String outerMethod() { |
| 29 | return "foo"; | 30 | return "foo"; |
| 30 | } | 31 | } |
diff --git a/src/test/java/cuchaz/enigma/inputs/innerClasses/F_ClassTree.java b/src/test/java/cuchaz/enigma/inputs/innerClasses/F_ClassTree.java index 7d1dab4..b1de3c9 100644 --- a/src/test/java/cuchaz/enigma/inputs/innerClasses/F_ClassTree.java +++ b/src/test/java/cuchaz/enigma/inputs/innerClasses/F_ClassTree.java | |||
| @@ -4,25 +4,25 @@ | |||
| 4 | * are made available under the terms of the GNU Lesser General Public | 4 | * are made available under the terms of the GNU Lesser General Public |
| 5 | * License v3.0 which accompanies this distribution, and is available at | 5 | * License v3.0 which accompanies this distribution, and is available at |
| 6 | * http://www.gnu.org/licenses/lgpl.html | 6 | * http://www.gnu.org/licenses/lgpl.html |
| 7 | * | 7 | * |
| 8 | * Contributors: | 8 | * Contributors: |
| 9 | * Jeff Martin - initial API and implementation | 9 | * Jeff Martin - initial API and implementation |
| 10 | ******************************************************************************/ | 10 | ******************************************************************************/ |
| 11 | package cuchaz.enigma.inputs.innerClasses; | ||
| 12 | 11 | ||
| 12 | package cuchaz.enigma.inputs.innerClasses; | ||
| 13 | 13 | ||
| 14 | public class F_ClassTree { | 14 | public class F_ClassTree { |
| 15 | 15 | ||
| 16 | public class Level1 { | 16 | public class Level1 { |
| 17 | 17 | ||
| 18 | public int f1; | 18 | public int f1; |
| 19 | 19 | ||
| 20 | public class Level2 { | 20 | public class Level2 { |
| 21 | 21 | ||
| 22 | public int f2; | 22 | public int f2; |
| 23 | 23 | ||
| 24 | public class Level3 { | 24 | public class Level3 { |
| 25 | 25 | ||
| 26 | public int f3; | 26 | public int f3; |
| 27 | } | 27 | } |
| 28 | } | 28 | } |