summaryrefslogtreecommitdiffstats
path: root/testData/src
diff options
context:
space:
mode:
authorRoman Shevchenko <roman.shevchenko@jetbrains.com>2014-09-01 18:54:33 +0400
committerRoman Shevchenko <roman.shevchenko@jetbrains.com>2014-09-01 18:54:33 +0400
commite629738a46ca5e82ad93939f3de7c05c37512323 (patch)
treee50253688a2b7eae45c3534985938178e54440d2 /testData/src
parentd5fe121d1d320085d3d80e4267f0bbcfd320a333 (diff)
downloadfernflower-e629738a46ca5e82ad93939f3de7c05c37512323.tar
fernflower-e629738a46ca5e82ad93939f3de7c05c37512323.tar.gz
fernflower-e629738a46ca5e82ad93939f3de7c05c37512323.tar.lz
fernflower-e629738a46ca5e82ad93939f3de7c05c37512323.tar.xz
fernflower-e629738a46ca5e82ad93939f3de7c05c37512323.zip
java-decompiler: tests moved
Diffstat (limited to 'testData/src')
-rw-r--r--testData/src/pkg/TestCodeConstructs.java28
-rw-r--r--testData/src/pkg/TestConstants.java64
-rw-r--r--testData/src/pkg/TestDeprecations.java36
-rw-r--r--testData/src/pkg/TestEnum.java36
-rw-r--r--testData/src/pkg/TestExtendsList.java26
-rw-r--r--testData/src/pkg/TestMethodParameters.java40
6 files changed, 230 insertions, 0 deletions
diff --git a/testData/src/pkg/TestCodeConstructs.java b/testData/src/pkg/TestCodeConstructs.java
new file mode 100644
index 0000000..3c0ad53
--- /dev/null
+++ b/testData/src/pkg/TestCodeConstructs.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2000-2014 JetBrains s.r.o.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package pkg;
+
+class TestCodeConstructs {
+ void expressions() {
+ new String().hashCode();
+ }
+
+ private int count = 0;
+ String fieldIncrement() {
+ int id = count++;
+ return "id:" + id;
+ }
+} \ No newline at end of file
diff --git a/testData/src/pkg/TestConstants.java b/testData/src/pkg/TestConstants.java
new file mode 100644
index 0000000..09b5419
--- /dev/null
+++ b/testData/src/pkg/TestConstants.java
@@ -0,0 +1,64 @@
+/*
+ * Copyright 2000-2014 JetBrains s.r.o.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package pkg;
+
+public class TestConstants {
+ static final boolean T = true;
+ static final boolean F = false;
+
+ static final char C0 = '\n';
+ static final char C1 = 'a';
+ static final char C2 = 512;
+
+ static final byte BMin = Byte.MIN_VALUE;
+ static final byte BMax = Byte.MAX_VALUE;
+
+ static final short SMin = Short.MIN_VALUE;
+ static final short SMax = Short.MAX_VALUE;
+
+ static final int IMin = Integer.MIN_VALUE;
+ static final int IMax = Integer.MAX_VALUE;
+
+ static final long LMin = Long.MIN_VALUE;
+ static final long LMax = Long.MAX_VALUE;
+
+ static final float FNan = Float.NaN;
+ static final float FNeg = Float.NEGATIVE_INFINITY;
+ static final float FPos = Float.POSITIVE_INFINITY;
+ static final float FMin = Float.MIN_VALUE;
+ static final float FMax = Float.MAX_VALUE;
+
+ static final double DNan = Double.NaN;
+ static final double DNeg = Double.NEGATIVE_INFINITY;
+ static final double DPos = Double.POSITIVE_INFINITY;
+ static final double DMin = Double.MIN_VALUE;
+ static final double DMax = Double.MAX_VALUE;
+
+ static @interface A {
+ Class<?> value();
+ }
+
+ @A(byte.class) void m1() { }
+ @A(char.class) void m2() { }
+ @A(double.class) void m3() { }
+ @A(float.class) void m4() { }
+ @A(int.class) void m5() { }
+ @A(long.class) void m6() { }
+ @A(short.class) void m7() { }
+ @A(boolean.class) void m8() { }
+ @A(void.class) void m9() { }
+ @A(java.util.Date.class) void m10() { }
+} \ No newline at end of file
diff --git a/testData/src/pkg/TestDeprecations.java b/testData/src/pkg/TestDeprecations.java
new file mode 100644
index 0000000..18ba0b5
--- /dev/null
+++ b/testData/src/pkg/TestDeprecations.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2000-2014 JetBrains s.r.o.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package pkg;
+
+public class TestDeprecations {
+ /** @deprecated */
+ public int byComment;
+
+ @Deprecated
+ public int byAnno;
+
+ /** @deprecated */
+ public void byComment() { }
+
+ @Deprecated
+ public void byAnno() { }
+
+ /** @deprecated */
+ public static class ByComment { }
+
+ @Deprecated
+ public static class ByAnno { }
+} \ No newline at end of file
diff --git a/testData/src/pkg/TestEnum.java b/testData/src/pkg/TestEnum.java
new file mode 100644
index 0000000..43fab48
--- /dev/null
+++ b/testData/src/pkg/TestEnum.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2000-2014 JetBrains s.r.o.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package pkg;
+
+public enum TestEnum {
+ E1,
+ E2() {
+ @Override
+ public void m() { }
+ },
+ E3("-"),
+ E4("+") {
+ @Override
+ public void m() { }
+ };
+
+ public void m() { }
+
+ private String s;
+
+ private TestEnum() { this("?"); }
+ private TestEnum(@Deprecated String s) { this.s = s; }
+}
diff --git a/testData/src/pkg/TestExtendsList.java b/testData/src/pkg/TestExtendsList.java
new file mode 100644
index 0000000..812f836
--- /dev/null
+++ b/testData/src/pkg/TestExtendsList.java
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2000-2014 JetBrains s.r.o.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package pkg;
+
+public class TestExtendsList {
+ static <T extends Comparable<? super T>> T m1(T t) {
+ return null;
+ }
+
+ static <T extends Object & Comparable<? super T>> T m2(T t) {
+ return null;
+ }
+} \ No newline at end of file
diff --git a/testData/src/pkg/TestMethodParameters.java b/testData/src/pkg/TestMethodParameters.java
new file mode 100644
index 0000000..b9739e9
--- /dev/null
+++ b/testData/src/pkg/TestMethodParameters.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2000-2014 JetBrains s.r.o.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package pkg;
+
+public class TestMethodParameters {
+ TestMethodParameters(@Deprecated int p01) { }
+ void m1(@Deprecated int p02) { }
+ static void m2(@Deprecated int p03) { }
+
+ class C1 {
+ C1(@Deprecated int p11) { }
+ void m(@Deprecated int p12) { }
+ }
+
+ static class C2 {
+ C2(@Deprecated int p21) { }
+ void m1(@Deprecated int p22) { }
+ static void m2(@Deprecated int p23) { }
+ }
+
+ void local() {
+ class Local {
+ Local(@Deprecated int p31) { }
+ void m(@Deprecated int p32) { }
+ }
+ }
+} \ No newline at end of file