aboutsummaryrefslogtreecommitdiffstats
path: root/tests/pureJava/conflictingPackageNamesWithPackages
diff options
context:
space:
mode:
authorwisberg <wisberg>2002-12-16 18:51:06 +0000
committerwisberg <wisberg>2002-12-16 18:51:06 +0000
commit144143c2970a1e874d74cdbd0f8c622d4282a3c3 (patch)
treeb12383d3d9e76c7e1f25f7fbec83051ef17f81fb /tests/pureJava/conflictingPackageNamesWithPackages
parentfafae443719b26159ab2d7dac1c9b46b5e00b671 (diff)
downloadaspectj-144143c2970a1e874d74cdbd0f8c622d4282a3c3.tar.gz
aspectj-144143c2970a1e874d74cdbd0f8c622d4282a3c3.zip
initial version
Diffstat (limited to 'tests/pureJava/conflictingPackageNamesWithPackages')
-rw-r--r--tests/pureJava/conflictingPackageNamesWithPackages/Java.java16
-rw-r--r--tests/pureJava/conflictingPackageNamesWithPackages/Main.java29
2 files changed, 45 insertions, 0 deletions
diff --git a/tests/pureJava/conflictingPackageNamesWithPackages/Java.java b/tests/pureJava/conflictingPackageNamesWithPackages/Java.java
new file mode 100644
index 000000000..a3cf27560
--- /dev/null
+++ b/tests/pureJava/conflictingPackageNamesWithPackages/Java.java
@@ -0,0 +1,16 @@
+package conflictingPackageNamesWithPackages;
+
+public class Java {
+ public String lang() {
+ throw new RuntimeException("String lang(): shouldn't have been called");
+ }
+
+ public static class lang {
+ public static class String {
+ public String() {
+ throw new RuntimeException("new String(): shouldn't have been called");
+ }
+ }
+ static String String() { return null; }
+ }
+}
diff --git a/tests/pureJava/conflictingPackageNamesWithPackages/Main.java b/tests/pureJava/conflictingPackageNamesWithPackages/Main.java
new file mode 100644
index 000000000..48e0c7291
--- /dev/null
+++ b/tests/pureJava/conflictingPackageNamesWithPackages/Main.java
@@ -0,0 +1,29 @@
+package conflictingPackageNamesWithPackages;
+
+import org.aspectj.testing.*;
+
+public class Main {
+ public static void main(String[] args) {
+ new Main().go();
+ Tester.checkAllEvents();
+ }
+
+ public void go() {
+
+ String str0 = new String("String:String");
+ java.lang.String str1 = new String("java.lang.String:String");
+ String str2 = new java.lang.String("String:java.lang.String");
+ java.lang.String str3 = new java.lang.String("String:java.lang.java.lang.String");
+
+ Tester.checkEqual(str0, "String:String");
+ Tester.checkEqual(str1, "java.lang.String:String");
+ Tester.checkEqual(str2, "String:java.lang.String");
+ Tester.checkEqual(str3, "String:java.lang.java.lang.String");
+
+ Tester.event("Driver.go");
+ }
+
+ static {
+ Tester.expectEvent("Driver.go");
+ }
+}