From e8704ce6939c4e31475d466de0ba904d461a3d13 Mon Sep 17 00:00:00 2001 From: Roman Shevchenko Date: Tue, 24 Jun 2014 17:15:05 +0200 Subject: [PATCH] java: more decompiler tests --- .../java/decompiler/IdeaDecompilerTest.java | 1 + .../testData/Anonymous$1.class | Bin 0 -> 672 bytes .../java-decompiler/testData/Anonymous.class | Bin 0 -> 407 bytes .../java-decompiler/testData/Anonymous.java | 13 ++++++++++ .../java-decompiler/testData/Anonymous.txt | 24 ++++++++++++++++++ 5 files changed, 38 insertions(+) create mode 100644 plugins/java-decompiler/testData/Anonymous$1.class create mode 100644 plugins/java-decompiler/testData/Anonymous.class create mode 100644 plugins/java-decompiler/testData/Anonymous.java create mode 100644 plugins/java-decompiler/testData/Anonymous.txt diff --git a/plugins/java-decompiler/test/org/jetbrains/java/decompiler/IdeaDecompilerTest.java b/plugins/java-decompiler/test/org/jetbrains/java/decompiler/IdeaDecompilerTest.java index 1a30abf9aabf..2f900d5c11ac 100644 --- a/plugins/java-decompiler/test/org/jetbrains/java/decompiler/IdeaDecompilerTest.java +++ b/plugins/java-decompiler/test/org/jetbrains/java/decompiler/IdeaDecompilerTest.java @@ -55,6 +55,7 @@ public class IdeaDecompilerTest extends LightCodeInsightFixtureTestCase { public void testExtendsList() { doTestDecompiler(); } public void testParameters() { doTestDecompiler(); } public void testConstants() { doTestDecompiler(); } + public void testAnonymous() { doTestDecompiler(); } private void doTestDecompiler() { String name = PluginPathManager.getPluginHomePath("java-decompiler") + "/testData/" + getName().substring(4); diff --git a/plugins/java-decompiler/testData/Anonymous$1.class b/plugins/java-decompiler/testData/Anonymous$1.class new file mode 100644 index 0000000000000000000000000000000000000000..338c04840be2c66efbf0a24b5f76e3bece34a948 GIT binary patch literal 672 zcmZ`$YfBqJ6g`u~Y_i#!t+h?n_-tA?Yc-aBR0I_ZfwX?G6#A)bvV*Ryvtb`X|CK_G z&_aJef0XnL(fGoJy=Ugkz30w7^Y7~SUjQGmR)&cg9qJ}3m^CnGqJY^F<~1(pu&Be5 zfj0);2^3Gguo3tIqRmZu6eNvxfl6mvMe65ClqDOaHv<)%y;H9hdg`z>WT|Q%L|NREp8}meKI*roQ>nP8 zdSR4M;ImARBHzHW1qV$FmSVq$$@$Ef#6E_6LRUml&HU4q&*ykQ<;hK>6%JahV-nk;|cm*Te#*Fpald KnUpb!{Qd)W9gTSa literal 0 HcmV?d00001 diff --git a/plugins/java-decompiler/testData/Anonymous.class b/plugins/java-decompiler/testData/Anonymous.class new file mode 100644 index 0000000000000000000000000000000000000000..df67a585875317f00aefa33860a376daff77a858 GIT binary patch literal 407 zcmZ8dO-sW-5Pg%RiAiHywbrkbAd==_QI9Qx6of#~gHos`({z!Pb|d)^{8tJ}LBSv3 zj}j+Aa_AmrXWqQ`W@mqXKfeK-W8Z>~EfY1g4QyLb(J`=NV3z=b?MW$;;XFuFkrHZQ zoXdOGRiIps?!}2v|&6Igr*-!ah)$FBDo7Db4HA(B%bCWXKknJ&w}TmHxJ}v z?`AR+Vb&*Dw{f0?;wmcGjY}EJmqnbXCk53;9kvY<7NK6Xj!p}Fk6>01p|xtwk8%8p z(D%9{9P*kvuT4-2PtFw1c?8FGu8zwZu-qlcRX?D-mFxybi+hDqD>+TH{xxSM0(9K* mJCu9vfmMSqsAKnF3GH=7U*lOiJ8UqnU=wSlGk+rAeEtAr$43bO literal 0 HcmV?d00001 diff --git a/plugins/java-decompiler/testData/Anonymous.java b/plugins/java-decompiler/testData/Anonymous.java new file mode 100644 index 000000000000..6f4a89389a27 --- /dev/null +++ b/plugins/java-decompiler/testData/Anonymous.java @@ -0,0 +1,13 @@ +public class Anonymous { + private int count = 0; + + public Object produce() { + final int id = count++; + return new Object() { + @Override + public String toString() { + return "anonymous_" + id; + } + }; + } +} \ No newline at end of file diff --git a/plugins/java-decompiler/testData/Anonymous.txt b/plugins/java-decompiler/testData/Anonymous.txt new file mode 100644 index 000000000000..a7cea92713b7 --- /dev/null +++ b/plugins/java-decompiler/testData/Anonymous.txt @@ -0,0 +1,24 @@ +// +// Source code recreated from a .class file by IntelliJ IDEA +// (powered by Fernflower decompiler) +// + + +public class Anonymous { + + private int count = 0; + + + public Anonymous() { + } + + public Object produce() { + ++this.count; + final int var1 = this.count; + return new Object() { + public String toString() { + return "anonymous_" + var1; + } + }; + } +}