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 | |
| 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')
26 files changed, 761 insertions, 0 deletions
diff --git a/src/test/java/cuchaz/enigma/inputs/Keep.java b/src/test/java/cuchaz/enigma/inputs/Keep.java new file mode 100644 index 0000000..f04875f --- /dev/null +++ b/src/test/java/cuchaz/enigma/inputs/Keep.java | |||
| @@ -0,0 +1,17 @@ | |||
| 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; | ||
| 12 | |||
| 13 | public class Keep { | ||
| 14 | public static void main(String[] args) { | ||
| 15 | System.out.println("Keep me!"); | ||
| 16 | } | ||
| 17 | } | ||
diff --git a/src/test/java/cuchaz/enigma/inputs/constructors/BaseClass.java b/src/test/java/cuchaz/enigma/inputs/constructors/BaseClass.java new file mode 100644 index 0000000..65e782a --- /dev/null +++ b/src/test/java/cuchaz/enigma/inputs/constructors/BaseClass.java | |||
| @@ -0,0 +1,25 @@ | |||
| 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.constructors; | ||
| 12 | |||
| 13 | // none/a | ||
| 14 | public class BaseClass { | ||
| 15 | |||
| 16 | // <init>()V | ||
| 17 | public BaseClass() { | ||
| 18 | System.out.println("Default constructor"); | ||
| 19 | } | ||
| 20 | |||
| 21 | // <init>(I)V | ||
| 22 | public BaseClass(int i) { | ||
| 23 | System.out.println("Int constructor " + i); | ||
| 24 | } | ||
| 25 | } | ||
diff --git a/src/test/java/cuchaz/enigma/inputs/constructors/Caller.java b/src/test/java/cuchaz/enigma/inputs/constructors/Caller.java new file mode 100644 index 0000000..75096ec --- /dev/null +++ b/src/test/java/cuchaz/enigma/inputs/constructors/Caller.java | |||
| @@ -0,0 +1,57 @@ | |||
| 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.constructors; | ||
| 12 | |||
| 13 | // none/b | ||
| 14 | public class Caller { | ||
| 15 | |||
| 16 | // a()V | ||
| 17 | public void callBaseDefault() { | ||
| 18 | // none/a.<init>()V | ||
| 19 | System.out.println(new BaseClass()); | ||
| 20 | } | ||
| 21 | |||
| 22 | // b()V | ||
| 23 | public void callBaseInt() { | ||
| 24 | // none/a.<init>(I)V | ||
| 25 | System.out.println(new BaseClass(5)); | ||
| 26 | } | ||
| 27 | |||
| 28 | // c()V | ||
| 29 | public void callSubDefault() { | ||
| 30 | // none/d.<init>()V | ||
| 31 | System.out.println(new SubClass()); | ||
| 32 | } | ||
| 33 | |||
| 34 | // d()V | ||
| 35 | public void callSubInt() { | ||
| 36 | // none/d.<init>(I)V | ||
| 37 | System.out.println(new SubClass(6)); | ||
| 38 | } | ||
| 39 | |||
| 40 | // e()V | ||
| 41 | public void callSubIntInt() { | ||
| 42 | // none/d.<init>(II)V | ||
| 43 | System.out.println(new SubClass(4, 2)); | ||
| 44 | } | ||
| 45 | |||
| 46 | // f()V | ||
| 47 | public void callSubSubInt() { | ||
| 48 | // none/e.<init>(I)V | ||
| 49 | System.out.println(new SubSubClass(3)); | ||
| 50 | } | ||
| 51 | |||
| 52 | // g()V | ||
| 53 | public void callDefaultConstructable() { | ||
| 54 | // none/c.<init>()V | ||
| 55 | System.out.println(new DefaultConstructable()); | ||
| 56 | } | ||
| 57 | } | ||
diff --git a/src/test/java/cuchaz/enigma/inputs/constructors/DefaultConstructable.java b/src/test/java/cuchaz/enigma/inputs/constructors/DefaultConstructable.java new file mode 100644 index 0000000..655f4da --- /dev/null +++ b/src/test/java/cuchaz/enigma/inputs/constructors/DefaultConstructable.java | |||
| @@ -0,0 +1,15 @@ | |||
| 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.constructors; | ||
| 12 | |||
| 13 | public class DefaultConstructable { | ||
| 14 | // only default constructor | ||
| 15 | } | ||
diff --git a/src/test/java/cuchaz/enigma/inputs/constructors/SubClass.java b/src/test/java/cuchaz/enigma/inputs/constructors/SubClass.java new file mode 100644 index 0000000..b0fb3e9 --- /dev/null +++ b/src/test/java/cuchaz/enigma/inputs/constructors/SubClass.java | |||
| @@ -0,0 +1,38 @@ | |||
| 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.constructors; | ||
| 12 | |||
| 13 | // none/d extends none/a | ||
| 14 | public class SubClass extends BaseClass { | ||
| 15 | |||
| 16 | // <init>()V | ||
| 17 | public SubClass() { | ||
| 18 | // none/a.<init>()V | ||
| 19 | } | ||
| 20 | |||
| 21 | // <init>(I)V | ||
| 22 | public SubClass(int num) { | ||
| 23 | // <init>()V | ||
| 24 | this(); | ||
| 25 | System.out.println("SubClass " + num); | ||
| 26 | } | ||
| 27 | |||
| 28 | // <init>(II)V | ||
| 29 | public SubClass(int a, int b) { | ||
| 30 | // <init>(I)V | ||
| 31 | this(a + b); | ||
| 32 | } | ||
| 33 | |||
| 34 | // <init>(III)V | ||
| 35 | public SubClass(int a, int b, int c) { | ||
| 36 | // none/a.<init>()V | ||
| 37 | } | ||
| 38 | } | ||
diff --git a/src/test/java/cuchaz/enigma/inputs/constructors/SubSubClass.java b/src/test/java/cuchaz/enigma/inputs/constructors/SubSubClass.java new file mode 100644 index 0000000..5031405 --- /dev/null +++ b/src/test/java/cuchaz/enigma/inputs/constructors/SubSubClass.java | |||
| @@ -0,0 +1,21 @@ | |||
| 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.constructors; | ||
| 12 | |||
| 13 | // none/e extends none/d | ||
| 14 | public class SubSubClass extends SubClass { | ||
| 15 | |||
| 16 | // <init>(I)V | ||
| 17 | public SubSubClass(int i) { | ||
| 18 | // none/c.<init>(I)V | ||
| 19 | super(i); | ||
| 20 | } | ||
| 21 | } | ||
diff --git a/src/test/java/cuchaz/enigma/inputs/inheritanceTree/BaseClass.java b/src/test/java/cuchaz/enigma/inputs/inheritanceTree/BaseClass.java new file mode 100644 index 0000000..4f9c5b0 --- /dev/null +++ b/src/test/java/cuchaz/enigma/inputs/inheritanceTree/BaseClass.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.inheritanceTree; | ||
| 12 | |||
| 13 | // none/a | ||
| 14 | public abstract class BaseClass { | ||
| 15 | |||
| 16 | // a | ||
| 17 | private String m_name; | ||
| 18 | |||
| 19 | // <init>(Ljava/lang/String;)V | ||
| 20 | protected BaseClass(String name) { | ||
| 21 | m_name = name; | ||
| 22 | } | ||
| 23 | |||
| 24 | // a()Ljava/lang/String; | ||
| 25 | public String getName() { | ||
| 26 | return m_name; | ||
| 27 | } | ||
| 28 | |||
| 29 | // a()V | ||
| 30 | public abstract void doBaseThings(); | ||
| 31 | } | ||
diff --git a/src/test/java/cuchaz/enigma/inputs/inheritanceTree/SubclassA.java b/src/test/java/cuchaz/enigma/inputs/inheritanceTree/SubclassA.java new file mode 100644 index 0000000..140d2a8 --- /dev/null +++ b/src/test/java/cuchaz/enigma/inputs/inheritanceTree/SubclassA.java | |||
| @@ -0,0 +1,21 @@ | |||
| 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.inheritanceTree; | ||
| 12 | |||
| 13 | // none/b extends none/a | ||
| 14 | public abstract class SubclassA extends BaseClass { | ||
| 15 | |||
| 16 | // <init>(Ljava/lang/String;)V | ||
| 17 | protected SubclassA(String name) { | ||
| 18 | // call to none/a.<init>(Ljava/lang/String)V | ||
| 19 | super(name); | ||
| 20 | } | ||
| 21 | } | ||
diff --git a/src/test/java/cuchaz/enigma/inputs/inheritanceTree/SubclassB.java b/src/test/java/cuchaz/enigma/inputs/inheritanceTree/SubclassB.java new file mode 100644 index 0000000..99d149b --- /dev/null +++ b/src/test/java/cuchaz/enigma/inputs/inheritanceTree/SubclassB.java | |||
| @@ -0,0 +1,40 @@ | |||
| 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.inheritanceTree; | ||
| 12 | |||
| 13 | // none/c extends none/a | ||
| 14 | public class SubclassB extends BaseClass { | ||
| 15 | |||
| 16 | // a | ||
| 17 | private int m_numThings; | ||
| 18 | |||
| 19 | // <init>()V | ||
| 20 | protected SubclassB() { | ||
| 21 | // none/a.<init>(Ljava/lang/String;)V | ||
| 22 | super("B"); | ||
| 23 | |||
| 24 | // access to a | ||
| 25 | m_numThings = 4; | ||
| 26 | } | ||
| 27 | |||
| 28 | @Override | ||
| 29 | // a()V | ||
| 30 | public void doBaseThings() { | ||
| 31 | // call to none/a.a()Ljava/lang/String; | ||
| 32 | System.out.println("Base things by B! " + getName()); | ||
| 33 | } | ||
| 34 | |||
| 35 | // b()V | ||
| 36 | public void doBThings() { | ||
| 37 | // access to a | ||
| 38 | System.out.println("" + m_numThings + " B things!"); | ||
| 39 | } | ||
| 40 | } | ||
diff --git a/src/test/java/cuchaz/enigma/inputs/inheritanceTree/SubsubclassAA.java b/src/test/java/cuchaz/enigma/inputs/inheritanceTree/SubsubclassAA.java new file mode 100644 index 0000000..2e414b7 --- /dev/null +++ b/src/test/java/cuchaz/enigma/inputs/inheritanceTree/SubsubclassAA.java | |||
| @@ -0,0 +1,34 @@ | |||
| 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.inheritanceTree; | ||
| 12 | |||
| 13 | // none/d extends none/b | ||
| 14 | public class SubsubclassAA extends SubclassA { | ||
| 15 | |||
| 16 | protected SubsubclassAA() { | ||
| 17 | // call to none/b.<init>(Ljava/lang/String;)V | ||
| 18 | super("AA"); | ||
| 19 | } | ||
| 20 | |||
| 21 | @Override | ||
| 22 | // a()Ljava/lang/String; | ||
| 23 | public String getName() { | ||
| 24 | // call to none/b.a()Ljava/lang/String; | ||
| 25 | return "subsub" + super.getName(); | ||
| 26 | } | ||
| 27 | |||
| 28 | @Override | ||
| 29 | // a()V | ||
| 30 | public void doBaseThings() { | ||
| 31 | // call to none/d.a()Ljava/lang/String; | ||
| 32 | System.out.println("Base things by " + getName()); | ||
| 33 | } | ||
| 34 | } | ||
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 | } | ||
diff --git a/src/test/java/cuchaz/enigma/inputs/loneClass/LoneClass.java b/src/test/java/cuchaz/enigma/inputs/loneClass/LoneClass.java new file mode 100644 index 0000000..bf264fa --- /dev/null +++ b/src/test/java/cuchaz/enigma/inputs/loneClass/LoneClass.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.loneClass; | ||
| 12 | |||
| 13 | public class LoneClass { | ||
| 14 | |||
| 15 | private String m_name; | ||
| 16 | |||
| 17 | public LoneClass(String name) { | ||
| 18 | m_name = name; | ||
| 19 | } | ||
| 20 | |||
| 21 | public String getName() { | ||
| 22 | return m_name; | ||
| 23 | } | ||
| 24 | } | ||
diff --git a/src/test/java/cuchaz/enigma/inputs/translation/A_Basic.java b/src/test/java/cuchaz/enigma/inputs/translation/A_Basic.java new file mode 100644 index 0000000..26acac8 --- /dev/null +++ b/src/test/java/cuchaz/enigma/inputs/translation/A_Basic.java | |||
| @@ -0,0 +1,32 @@ | |||
| 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.translation; | ||
| 12 | |||
| 13 | public class A_Basic { | ||
| 14 | |||
| 15 | public int one; | ||
| 16 | public float two; | ||
| 17 | public String three; | ||
| 18 | |||
| 19 | public void m1() { | ||
| 20 | } | ||
| 21 | |||
| 22 | public int m2() { | ||
| 23 | return 42; | ||
| 24 | } | ||
| 25 | |||
| 26 | public void m3(int a1) { | ||
| 27 | } | ||
| 28 | |||
| 29 | public int m4(int a1) { | ||
| 30 | return 5; // chosen by fair die roll, guaranteed to be random | ||
| 31 | } | ||
| 32 | } | ||
diff --git a/src/test/java/cuchaz/enigma/inputs/translation/B_BaseClass.java b/src/test/java/cuchaz/enigma/inputs/translation/B_BaseClass.java new file mode 100644 index 0000000..035e329 --- /dev/null +++ b/src/test/java/cuchaz/enigma/inputs/translation/B_BaseClass.java | |||
| @@ -0,0 +1,25 @@ | |||
| 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.translation; | ||
| 12 | |||
| 13 | public class B_BaseClass { | ||
| 14 | |||
| 15 | public int f1; | ||
| 16 | public char f2; | ||
| 17 | |||
| 18 | public int m1() { | ||
| 19 | return 5; | ||
| 20 | } | ||
| 21 | |||
| 22 | public int m2() { | ||
| 23 | return 42; | ||
| 24 | } | ||
| 25 | } | ||
diff --git a/src/test/java/cuchaz/enigma/inputs/translation/C_SubClass.java b/src/test/java/cuchaz/enigma/inputs/translation/C_SubClass.java new file mode 100644 index 0000000..6026a8d --- /dev/null +++ b/src/test/java/cuchaz/enigma/inputs/translation/C_SubClass.java | |||
| @@ -0,0 +1,27 @@ | |||
| 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.translation; | ||
| 12 | |||
| 13 | public class C_SubClass extends B_BaseClass { | ||
| 14 | |||
| 15 | public char f2; // shadows B_BaseClass.f2 | ||
| 16 | public int f3; | ||
| 17 | public int f4; | ||
| 18 | |||
| 19 | @Override | ||
| 20 | public int m1() { | ||
| 21 | return 32; | ||
| 22 | } | ||
| 23 | |||
| 24 | public int m3() { | ||
| 25 | return 7; | ||
| 26 | } | ||
| 27 | } | ||
diff --git a/src/test/java/cuchaz/enigma/inputs/translation/D_AnonymousTesting.java b/src/test/java/cuchaz/enigma/inputs/translation/D_AnonymousTesting.java new file mode 100644 index 0000000..a1827f9 --- /dev/null +++ b/src/test/java/cuchaz/enigma/inputs/translation/D_AnonymousTesting.java | |||
| @@ -0,0 +1,28 @@ | |||
| 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.translation; | ||
| 12 | |||
| 13 | import java.util.ArrayList; | ||
| 14 | import java.util.List; | ||
| 15 | |||
| 16 | public class D_AnonymousTesting { | ||
| 17 | |||
| 18 | public List<Object> getObjs() { | ||
| 19 | List<Object> objs = new ArrayList<Object>(); | ||
| 20 | objs.add(new Object() { | ||
| 21 | @Override | ||
| 22 | public String toString() { | ||
| 23 | return "Object!"; | ||
| 24 | } | ||
| 25 | }); | ||
| 26 | return objs; | ||
| 27 | } | ||
| 28 | } | ||
diff --git a/src/test/java/cuchaz/enigma/inputs/translation/E_Bridges.java b/src/test/java/cuchaz/enigma/inputs/translation/E_Bridges.java new file mode 100644 index 0000000..769eb70 --- /dev/null +++ b/src/test/java/cuchaz/enigma/inputs/translation/E_Bridges.java | |||
| @@ -0,0 +1,32 @@ | |||
| 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.translation; | ||
| 12 | |||
| 13 | import java.util.Iterator; | ||
| 14 | |||
| 15 | |||
| 16 | public class E_Bridges implements Iterator<Object> { | ||
| 17 | |||
| 18 | @Override | ||
| 19 | public boolean hasNext() { | ||
| 20 | return false; | ||
| 21 | } | ||
| 22 | |||
| 23 | @Override | ||
| 24 | public String next() { | ||
| 25 | // the compiler will generate a bridge for this method | ||
| 26 | return "foo"; | ||
| 27 | } | ||
| 28 | |||
| 29 | @Override | ||
| 30 | public void remove() { | ||
| 31 | } | ||
| 32 | } | ||
diff --git a/src/test/java/cuchaz/enigma/inputs/translation/F_ObjectMethods.java b/src/test/java/cuchaz/enigma/inputs/translation/F_ObjectMethods.java new file mode 100644 index 0000000..32c246c --- /dev/null +++ b/src/test/java/cuchaz/enigma/inputs/translation/F_ObjectMethods.java | |||
| @@ -0,0 +1,29 @@ | |||
| 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.translation; | ||
| 12 | |||
| 13 | public class F_ObjectMethods { | ||
| 14 | |||
| 15 | public void callEmAll() | ||
| 16 | throws Throwable { | ||
| 17 | clone(); | ||
| 18 | equals(this); | ||
| 19 | finalize(); | ||
| 20 | getClass(); | ||
| 21 | hashCode(); | ||
| 22 | notify(); | ||
| 23 | notifyAll(); | ||
| 24 | toString(); | ||
| 25 | wait(); | ||
| 26 | wait(0); | ||
| 27 | wait(0, 0); | ||
| 28 | } | ||
| 29 | } | ||
diff --git a/src/test/java/cuchaz/enigma/inputs/translation/G_OuterClass.java b/src/test/java/cuchaz/enigma/inputs/translation/G_OuterClass.java new file mode 100644 index 0000000..a2e0daf --- /dev/null +++ b/src/test/java/cuchaz/enigma/inputs/translation/G_OuterClass.java | |||
| @@ -0,0 +1,36 @@ | |||
| 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.translation; | ||
| 12 | |||
| 13 | |||
| 14 | public class G_OuterClass { | ||
| 15 | |||
| 16 | public class A_InnerClass { | ||
| 17 | |||
| 18 | public int f1; | ||
| 19 | public String f2; | ||
| 20 | |||
| 21 | public void m1() {} | ||
| 22 | |||
| 23 | public class A_InnerInnerClass { | ||
| 24 | |||
| 25 | public int f3; | ||
| 26 | |||
| 27 | public void m2() {} | ||
| 28 | } | ||
| 29 | } | ||
| 30 | |||
| 31 | public class B_NamelessClass { | ||
| 32 | public class A_NamedInnerClass { | ||
| 33 | public int f4; | ||
| 34 | } | ||
| 35 | } | ||
| 36 | } | ||
diff --git a/src/test/java/cuchaz/enigma/inputs/translation/H_NamelessClass.java b/src/test/java/cuchaz/enigma/inputs/translation/H_NamelessClass.java new file mode 100644 index 0000000..1b718a5 --- /dev/null +++ b/src/test/java/cuchaz/enigma/inputs/translation/H_NamelessClass.java | |||
| @@ -0,0 +1,38 @@ | |||
| 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.translation; | ||
| 12 | |||
| 13 | |||
| 14 | public class H_NamelessClass { | ||
| 15 | |||
| 16 | public class A_InnerClass { | ||
| 17 | |||
| 18 | public int f1; | ||
| 19 | public String f2; | ||
| 20 | |||
| 21 | public void m1() {} | ||
| 22 | |||
| 23 | public class A_InnerInnerClass { | ||
| 24 | |||
| 25 | public int f3; | ||
| 26 | |||
| 27 | public void m2() {} | ||
| 28 | } | ||
| 29 | } | ||
| 30 | |||
| 31 | public class B_NamelessClass { | ||
| 32 | public class A_NamedInnerClass { | ||
| 33 | public int f4; | ||
| 34 | public class A_AnotherInnerClass {} | ||
| 35 | public class B_YetAnotherInnerClass {} | ||
| 36 | } | ||
| 37 | } | ||
| 38 | } | ||
diff --git a/src/test/java/cuchaz/enigma/inputs/translation/I_Generics.java b/src/test/java/cuchaz/enigma/inputs/translation/I_Generics.java new file mode 100644 index 0000000..3490f9d --- /dev/null +++ b/src/test/java/cuchaz/enigma/inputs/translation/I_Generics.java | |||
| @@ -0,0 +1,35 @@ | |||
| 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.translation; | ||
| 12 | |||
| 13 | import java.util.List; | ||
| 14 | import java.util.Map; | ||
| 15 | |||
| 16 | |||
| 17 | public class I_Generics { | ||
| 18 | |||
| 19 | public class A_Type { | ||
| 20 | } | ||
| 21 | |||
| 22 | public List<Integer> f1; | ||
| 23 | public List<A_Type> f2; | ||
| 24 | public Map<A_Type,A_Type> f3; | ||
| 25 | |||
| 26 | public class B_Generic<T> { | ||
| 27 | public T f4; | ||
| 28 | public T m1() { | ||
| 29 | return null; | ||
| 30 | } | ||
| 31 | } | ||
| 32 | |||
| 33 | public B_Generic<Integer> f5; | ||
| 34 | public B_Generic<A_Type> f6; | ||
| 35 | } | ||