diff options
| author | 2016-06-30 00:49:21 +1000 | |
|---|---|---|
| committer | 2016-06-30 00:49:21 +1000 | |
| commit | 4be005617b3b8c3578cca07c5d085d12916f0d1d (patch) | |
| tree | db163431f38703e26da417ef05eaea2b27a498b9 /src/test/java/cuchaz/enigma/inputs/innerClasses | |
| parent | Some small changes to fix idea importing (diff) | |
| download | enigma-fork-4be005617b3b8c3578cca07c5d085d12916f0d1d.tar.gz enigma-fork-4be005617b3b8c3578cca07c5d085d12916f0d1d.tar.xz enigma-fork-4be005617b3b8c3578cca07c5d085d12916f0d1d.zip | |
Json format (#2)
* Added new format
* Fixed bug
* Updated Version
Diffstat (limited to 'src/test/java/cuchaz/enigma/inputs/innerClasses')
6 files changed, 156 insertions, 0 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 new file mode 100644 index 0000000..f644439 --- /dev/null +++ b/src/test/java/cuchaz/enigma/inputs/innerClasses/A_Anonymous.java | |||
| @@ -0,0 +1,24 @@ | |||
| 1 | /******************************************************************************* | ||
| 2 | * Copyright (c) 2015 Jeff Martin. | ||
| 3 | * All rights reserved. This program and the accompanying materials | ||
| 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 | ||
| 6 | * http://www.gnu.org/licenses/lgpl.html | ||
| 7 | * | ||
| 8 | * Contributors: | ||
| 9 | * Jeff Martin - initial API and implementation | ||
| 10 | ******************************************************************************/ | ||
| 11 | package cuchaz.enigma.inputs.innerClasses; | ||
| 12 | |||
| 13 | public class A_Anonymous { | ||
| 14 | |||
| 15 | public void foo() { | ||
| 16 | Runnable runnable = new Runnable() { | ||
| 17 | @Override | ||
| 18 | public void run() { | ||
| 19 | // don't care | ||
| 20 | } | ||
| 21 | }; | ||
| 22 | runnable.run(); | ||
| 23 | } | ||
| 24 | } | ||
diff --git a/src/test/java/cuchaz/enigma/inputs/innerClasses/B_AnonymousWithScopeArgs.java b/src/test/java/cuchaz/enigma/inputs/innerClasses/B_AnonymousWithScopeArgs.java new file mode 100644 index 0000000..d78be84 --- /dev/null +++ b/src/test/java/cuchaz/enigma/inputs/innerClasses/B_AnonymousWithScopeArgs.java | |||
| @@ -0,0 +1,23 @@ | |||
| 1 | /******************************************************************************* | ||
| 2 | * Copyright (c) 2015 Jeff Martin. | ||
| 3 | * All rights reserved. This program and the accompanying materials | ||
| 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 | ||
| 6 | * http://www.gnu.org/licenses/lgpl.html | ||
| 7 | * | ||
| 8 | * Contributors: | ||
| 9 | * Jeff Martin - initial API and implementation | ||
| 10 | ******************************************************************************/ | ||
| 11 | package cuchaz.enigma.inputs.innerClasses; | ||
| 12 | |||
| 13 | public class B_AnonymousWithScopeArgs { | ||
| 14 | |||
| 15 | public static void foo(final D_Simple arg) { | ||
| 16 | System.out.println(new Object() { | ||
| 17 | @Override | ||
| 18 | public String toString() { | ||
| 19 | return arg.toString(); | ||
| 20 | } | ||
| 21 | }); | ||
| 22 | } | ||
| 23 | } | ||
diff --git a/src/test/java/cuchaz/enigma/inputs/innerClasses/C_ConstructorArgs.java b/src/test/java/cuchaz/enigma/inputs/innerClasses/C_ConstructorArgs.java new file mode 100644 index 0000000..eb03489 --- /dev/null +++ b/src/test/java/cuchaz/enigma/inputs/innerClasses/C_ConstructorArgs.java | |||
| @@ -0,0 +1,30 @@ | |||
| 1 | /******************************************************************************* | ||
| 2 | * Copyright (c) 2015 Jeff Martin. | ||
| 3 | * All rights reserved. This program and the accompanying materials | ||
| 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 | ||
| 6 | * http://www.gnu.org/licenses/lgpl.html | ||
| 7 | * | ||
| 8 | * Contributors: | ||
| 9 | * Jeff Martin - initial API and implementation | ||
| 10 | ******************************************************************************/ | ||
| 11 | package cuchaz.enigma.inputs.innerClasses; | ||
| 12 | |||
| 13 | @SuppressWarnings("unused") | ||
| 14 | public class C_ConstructorArgs { | ||
| 15 | |||
| 16 | class Inner { | ||
| 17 | |||
| 18 | private int a; | ||
| 19 | |||
| 20 | public Inner(int a) { | ||
| 21 | this.a = a; | ||
| 22 | } | ||
| 23 | } | ||
| 24 | |||
| 25 | Inner i; | ||
| 26 | |||
| 27 | public void foo() { | ||
| 28 | i = new Inner(5); | ||
| 29 | } | ||
| 30 | } | ||
diff --git a/src/test/java/cuchaz/enigma/inputs/innerClasses/D_Simple.java b/src/test/java/cuchaz/enigma/inputs/innerClasses/D_Simple.java new file mode 100644 index 0000000..0e9bf82 --- /dev/null +++ b/src/test/java/cuchaz/enigma/inputs/innerClasses/D_Simple.java | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | /******************************************************************************* | ||
| 2 | * Copyright (c) 2015 Jeff Martin. | ||
| 3 | * All rights reserved. This program and the accompanying materials | ||
| 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 | ||
| 6 | * http://www.gnu.org/licenses/lgpl.html | ||
| 7 | * | ||
| 8 | * Contributors: | ||
| 9 | * Jeff Martin - initial API and implementation | ||
| 10 | ******************************************************************************/ | ||
| 11 | package cuchaz.enigma.inputs.innerClasses; | ||
| 12 | |||
| 13 | public class D_Simple { | ||
| 14 | |||
| 15 | class Inner { | ||
| 16 | // 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 new file mode 100644 index 0000000..255434d --- /dev/null +++ b/src/test/java/cuchaz/enigma/inputs/innerClasses/E_AnonymousWithOuterAccess.java | |||
| @@ -0,0 +1,31 @@ | |||
| 1 | /******************************************************************************* | ||
| 2 | * Copyright (c) 2015 Jeff Martin. | ||
| 3 | * All rights reserved. This program and the accompanying materials | ||
| 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 | ||
| 6 | * http://www.gnu.org/licenses/lgpl.html | ||
| 7 | * | ||
| 8 | * Contributors: | ||
| 9 | * Jeff Martin - initial API and implementation | ||
| 10 | ******************************************************************************/ | ||
| 11 | package cuchaz.enigma.inputs.innerClasses; | ||
| 12 | |||
| 13 | public class E_AnonymousWithOuterAccess { | ||
| 14 | |||
| 15 | // reproduction of error case documented at: | ||
| 16 | // https://bitbucket.org/cuchaz/enigma/issue/61/stackoverflowerror-when-deobfuscating | ||
| 17 | |||
| 18 | public Object makeInner() { | ||
| 19 | outerMethod(); | ||
| 20 | return new Object() { | ||
| 21 | @Override | ||
| 22 | public String toString() { | ||
| 23 | return outerMethod(); | ||
| 24 | } | ||
| 25 | }; | ||
| 26 | } | ||
| 27 | |||
| 28 | private String outerMethod() { | ||
| 29 | 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 new file mode 100644 index 0000000..7d1dab4 --- /dev/null +++ b/src/test/java/cuchaz/enigma/inputs/innerClasses/F_ClassTree.java | |||
| @@ -0,0 +1,30 @@ | |||
| 1 | /******************************************************************************* | ||
| 2 | * Copyright (c) 2015 Jeff Martin. | ||
| 3 | * All rights reserved. This program and the accompanying materials | ||
| 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 | ||
| 6 | * http://www.gnu.org/licenses/lgpl.html | ||
| 7 | * | ||
| 8 | * Contributors: | ||
| 9 | * Jeff Martin - initial API and implementation | ||
| 10 | ******************************************************************************/ | ||
| 11 | package cuchaz.enigma.inputs.innerClasses; | ||
| 12 | |||
| 13 | |||
| 14 | public class F_ClassTree { | ||
| 15 | |||
| 16 | public class Level1 { | ||
| 17 | |||
| 18 | public int f1; | ||
| 19 | |||
| 20 | public class Level2 { | ||
| 21 | |||
| 22 | public int f2; | ||
| 23 | |||
| 24 | public class Level3 { | ||
| 25 | |||
| 26 | public int f3; | ||
| 27 | } | ||
| 28 | } | ||
| 29 | } | ||
| 30 | } | ||