summaryrefslogtreecommitdiffstats
path: root/tests/pureJava/PackagesAndStaticClassesWithTheSameName.java
blob: e0dd410104dfcd7851067d737077091e8bc1f6fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/*
 * This test case reveals a limitation in the ajc unparser using fully qualified
 * names for types.  I don't believe that there is in fact a general solution to
 * this problem, so for now we move this to opentests
 */

import org.aspectj.testing.*;

public class PackagesAndStaticClassesWithTheSameName {
    public static void main(String[] args) {
        String string = "string";
        java.lang.Str str = new java.lang.Str(string);
        Tester.checkEqual(string + ":" + string, str+"");
    }

    static class java {
        static class lang {
            static class Str {
                private String str;
                Str(String str) {
                    this.str = str;
                }
                public String toString() { return str + ":" + str; }
            }
        }
    }
}