From 8dfce158505c615875ff62a7c348f20796f984d0 Mon Sep 17 00:00:00 2001 From: "pl@gohorb.ba-horb.de" Date: Mon, 23 Jan 2023 11:51:05 +0100 Subject: [PATCH] new file: ../../AllgemeinTest/VectorNotObject.jav new file: ../../AllgemeinTest/WildcardCaptureConversionTest.jav modified: ../../../src/test/java/AllgemeinTest.java --- resources/AllgemeinTest/VectorNotObject.jav | 9 +++++++++ .../WildcardCaptureConversionTest.jav | 16 ++++++++++++++++ src/test/java/AllgemeinTest.java | 4 +++- 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 resources/AllgemeinTest/VectorNotObject.jav create mode 100644 resources/AllgemeinTest/WildcardCaptureConversionTest.jav diff --git a/resources/AllgemeinTest/VectorNotObject.jav b/resources/AllgemeinTest/VectorNotObject.jav new file mode 100644 index 00000000..d8ea900b --- /dev/null +++ b/resources/AllgemeinTest/VectorNotObject.jav @@ -0,0 +1,9 @@ +import java.util.Vector; + +class VectorNotObject { + + vectorAddAll(v1, v2) { + v1.addAll(v2); + return v1; + } + } diff --git a/resources/AllgemeinTest/WildcardCaptureConversionTest.jav b/resources/AllgemeinTest/WildcardCaptureConversionTest.jav new file mode 100644 index 00000000..59016f7a --- /dev/null +++ b/resources/AllgemeinTest/WildcardCaptureConversionTest.jav @@ -0,0 +1,16 @@ +import java.util.Vector; +import java.lang.Integer; +import java.lang.String; + +class WildcardCaptureConversionTest { + + m(x, y ,z) { + x = new Vector(); + y = new Vector(); + x.add(1); + y.add("2"); + //Integer i = x.elementAt(0); + //String s = y.elementAt(0); + return z.vectorAddAll(x, y); + } +} \ No newline at end of file diff --git a/src/test/java/AllgemeinTest.java b/src/test/java/AllgemeinTest.java index 46203361..2dfc4dbf 100644 --- a/src/test/java/AllgemeinTest.java +++ b/src/test/java/AllgemeinTest.java @@ -48,7 +48,9 @@ public class AllgemeinTest { //String className = "Box"; //String className = "Box_Main"; //String className = "wildcardPair"; - String className = "VectorConstAdd"; + //String className = "VectorConstAdd"; + String className = "VectorNotObject"; + //String className = "WildcardCaptureConversionTest"; //PL 2019-10-24: genutzt fuer unterschiedliche Tests path = System.getProperty("user.dir")+"/resources/AllgemeinTest/" + className + ".jav"; //path = System.getProperty("user.dir")+"/src/test/resources/AllgemeinTest/Overloading_Generics.jav";