/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 7046778
* @summary Project Coin: problem with diamond and member inner classes
*/
public class DiamondAndInnerClassTest {
enum TypeArgumentKind {
this.typeargStr = typeargStr;
}
switch (this) {
case NONE: return true;
default: throw new AssertionError("Unexpected decl kind: " + this);
}
}
switch (this) {
case NONE: return true;
default: throw new AssertionError("Unexpected decl kind: " + this);
}
}
}
enum ArgumentKind {
}
}
enum TypeQualifierArity {
int n;
this.n = n;
this.qualifierStr = qualifierStr;
}
}
return res;
}
return n ==innerClassDeclArity.n;
}
}
enum InnerClassDeclArity {
int n;
this.n = n;
this.classDeclStr = classDeclStr;
}
}
enum ArgumentListArity {
int n;
this.n = n;
this.argListStr = argListStr;
}
}
return res;
}
return n ==innerClassDeclArity.n;
}
}
//create default shared JavaCompiler - reused across multiple compilations
//no diamond on decl site
//diamond only allowed on the last type qualifier
continue;
}
//no rare types
//no diamond on decl site
//no rare types
//diamond only allowed on the last type qualifier
continue;
}
//no rare types
//no diamond on decl site
//no rare types
//diamond only allowed on the last type qualifier
continue;
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
this.argumentKinds = argumentKinds;
this.source = new JavaSource();
this.diagChecker = new DiagnosticChecker();
}
public JavaSource() {
}
return source;
}
}
try {
throw new AssertionError("Error thron when compiling the following code:\n" + source.getCharContent(true));
}
check();
}
void check() {
checkCount++;
boolean errorExpected = false;
for (int i = 0 ; i < innerClassDeclArity.n ; i++) {
errorExpected = true;
break;
}
}
if (!errorExpected) {
for (int i = 0 ; i < innerClassDeclArity.n ; i++) {
//System.out.println("check " + expectedArgKinds[i] + " against " + argumentKinds[i]);
errorExpected = true;
break;
}
}
}
throw new Error("invalid diagnostics for source:\n" +
source.getCharContent(true) +
"\nExpected error: " + errorExpected);
}
}
boolean errorFound;
errorFound = true;
}
}
}
}