author | mcimadamore |
Mon, 07 Mar 2011 14:31:50 +0000 | |
changeset 8635 | 383a416a2bdf |
parent 7208 | 5db8147393ec |
child 29776 | 984a79b71cfe |
permissions | -rw-r--r-- |
7208
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
1 |
/* |
8635
383a416a2bdf
7020044: Project Coin: diamond erroneous allowed on some anonymous inner classes
mcimadamore
parents:
7208
diff
changeset
|
2 |
* Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved. |
7208
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
4 |
* |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
8 |
* |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
13 |
* accompanied this code). |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
14 |
* |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
18 |
* |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
21 |
* questions. |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
22 |
*/ |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
23 |
|
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
24 |
/* |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
25 |
* @test |
8635
383a416a2bdf
7020044: Project Coin: diamond erroneous allowed on some anonymous inner classes
mcimadamore
parents:
7208
diff
changeset
|
26 |
* @bug 6996914 7020044 |
7208
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
27 |
* @summary Diamond inference: problem when accessing protected constructor |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
28 |
* @run main T6996914a |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
29 |
*/ |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
30 |
|
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
31 |
import com.sun.source.util.JavacTask; |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
32 |
import java.net.URI; |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
33 |
import java.util.Arrays; |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
34 |
import javax.tools.Diagnostic; |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
35 |
import javax.tools.DiagnosticListener; |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
36 |
import javax.tools.JavaCompiler; |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
37 |
import javax.tools.JavaFileObject; |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
38 |
import javax.tools.SimpleJavaFileObject; |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
39 |
import javax.tools.ToolProvider; |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
40 |
|
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
41 |
public class T6996914a { |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
42 |
|
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
43 |
enum PackageKind { |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
44 |
DEFAULT("", ""), |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
45 |
A("package a;", "import a.*;"); |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
46 |
|
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
47 |
String pkgDecl; |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
48 |
String importDecl; |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
49 |
|
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
50 |
PackageKind(String pkgDecl, String importDecl) { |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
51 |
this.pkgDecl = pkgDecl; |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
52 |
this.importDecl = importDecl; |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
53 |
} |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
54 |
} |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
55 |
|
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
56 |
enum ConstructorKind { |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
57 |
PACKAGE(""), |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
58 |
PROTECTED("protected"), |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
59 |
PRIVATE("private"), |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
60 |
PUBLIC("public"); |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
61 |
|
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
62 |
String mod; |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
63 |
|
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
64 |
ConstructorKind(String mod) { |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
65 |
this.mod = mod; |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
66 |
} |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
67 |
} |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
68 |
|
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
69 |
static class FooClass extends SimpleJavaFileObject { |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
70 |
|
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
71 |
final static String sourceStub = |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
72 |
"#P\n" + |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
73 |
"public class Foo<X> {\n" + |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
74 |
" #M Foo() {}\n" + |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
75 |
"}\n"; |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
76 |
|
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
77 |
String source; |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
78 |
|
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
79 |
public FooClass(PackageKind pk, ConstructorKind ck) { |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
80 |
super(URI.create("myfo:/" + (pk != PackageKind.DEFAULT ? "a/Foo.java" : "Foo.java")), |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
81 |
JavaFileObject.Kind.SOURCE); |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
82 |
source = sourceStub.replace("#P", pk.pkgDecl).replace("#M", ck.mod); |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
83 |
} |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
84 |
|
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
85 |
@Override |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
86 |
public CharSequence getCharContent(boolean ignoreEncodingErrors) { |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
87 |
return source; |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
88 |
} |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
89 |
} |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
90 |
|
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
91 |
static class ClientClass extends SimpleJavaFileObject { |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
92 |
|
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
93 |
final static String sourceStub = |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
94 |
"#I\n" + |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
95 |
"class Test {\n" + |
8635
383a416a2bdf
7020044: Project Coin: diamond erroneous allowed on some anonymous inner classes
mcimadamore
parents:
7208
diff
changeset
|
96 |
" Foo<String> fs = new Foo<>();\n" + |
7208
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
97 |
"}\n"; |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
98 |
|
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
99 |
String source; |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
100 |
|
8635
383a416a2bdf
7020044: Project Coin: diamond erroneous allowed on some anonymous inner classes
mcimadamore
parents:
7208
diff
changeset
|
101 |
public ClientClass(PackageKind pk) { |
7208
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
102 |
super(URI.create("myfo:/Test.java"), JavaFileObject.Kind.SOURCE); |
8635
383a416a2bdf
7020044: Project Coin: diamond erroneous allowed on some anonymous inner classes
mcimadamore
parents:
7208
diff
changeset
|
103 |
source = sourceStub.replace("#I", pk.importDecl); |
7208
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
104 |
} |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
105 |
|
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
106 |
@Override |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
107 |
public CharSequence getCharContent(boolean ignoreEncodingErrors) { |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
108 |
return source; |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
109 |
} |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
110 |
} |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
111 |
|
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
112 |
public static void main(String... args) throws Exception { |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
113 |
for (PackageKind pk : PackageKind.values()) { |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
114 |
for (ConstructorKind ck : ConstructorKind.values()) { |
8635
383a416a2bdf
7020044: Project Coin: diamond erroneous allowed on some anonymous inner classes
mcimadamore
parents:
7208
diff
changeset
|
115 |
compileAndCheck(pk, ck); |
7208
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
116 |
} |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
117 |
} |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
118 |
} |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
119 |
|
8635
383a416a2bdf
7020044: Project Coin: diamond erroneous allowed on some anonymous inner classes
mcimadamore
parents:
7208
diff
changeset
|
120 |
static void compileAndCheck(PackageKind pk, ConstructorKind ck) throws Exception { |
7208
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
121 |
FooClass foo = new FooClass(pk, ck); |
8635
383a416a2bdf
7020044: Project Coin: diamond erroneous allowed on some anonymous inner classes
mcimadamore
parents:
7208
diff
changeset
|
122 |
ClientClass client = new ClientClass(pk); |
7208
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
123 |
final JavaCompiler tool = ToolProvider.getSystemJavaCompiler(); |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
124 |
ErrorListener el = new ErrorListener(); |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
125 |
JavacTask ct = (JavacTask)tool.getTask(null, null, el, |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
126 |
null, null, Arrays.asList(foo, client)); |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
127 |
ct.analyze(); |
8635
383a416a2bdf
7020044: Project Coin: diamond erroneous allowed on some anonymous inner classes
mcimadamore
parents:
7208
diff
changeset
|
128 |
if (el.errors > 0 == check(pk, ck)) { |
7208
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
129 |
String msg = el.errors > 0 ? |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
130 |
"Error compiling files" : |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
131 |
"No error when compiling files"; |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
132 |
throw new AssertionError(msg + ": \n" + foo.source + "\n" + client.source); |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
133 |
} |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
134 |
} |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
135 |
|
8635
383a416a2bdf
7020044: Project Coin: diamond erroneous allowed on some anonymous inner classes
mcimadamore
parents:
7208
diff
changeset
|
136 |
static boolean check(PackageKind pk, ConstructorKind ck) { |
7208
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
137 |
switch (pk) { |
8635
383a416a2bdf
7020044: Project Coin: diamond erroneous allowed on some anonymous inner classes
mcimadamore
parents:
7208
diff
changeset
|
138 |
case A: return ck == ConstructorKind.PUBLIC; |
7208
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
139 |
case DEFAULT: return ck != ConstructorKind.PRIVATE; |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
140 |
default: throw new AssertionError("Unknown package kind"); |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
141 |
} |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
142 |
} |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
143 |
|
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
144 |
/** |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
145 |
* DiagnosticListener to count any errors that occur |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
146 |
*/ |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
147 |
private static class ErrorListener implements DiagnosticListener<JavaFileObject> { |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
148 |
|
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
149 |
public void report(Diagnostic<? extends JavaFileObject> diagnostic) { |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
150 |
switch (diagnostic.getKind()) { |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
151 |
case ERROR: |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
152 |
errors++; |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
153 |
} |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
154 |
} |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
155 |
int errors; |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
156 |
} |
5db8147393ec
6996914: Diamond inference: problem when accessing protected constructor
mcimadamore
parents:
diff
changeset
|
157 |
} |