This commit is contained in:
Tim Bell 2009-08-28 16:54:10 -07:00
commit 9d0ed63add
251 changed files with 1338 additions and 3195 deletions
langtools
src/share/classes/com/sun/tools/javac
test
com/sun/javadoc
lib
testHtmlDefinitionListTag
testSerializedFormDeprecationInfo
tools

@ -122,6 +122,9 @@ public enum Source {
public boolean allowGenerics() {
return compareTo(JDK1_5) >= 0;
}
public boolean allowDiamond() {
return compareTo(JDK1_7) >= 0;
}
public boolean allowEnums() {
return compareTo(JDK1_5) >= 0;
}

@ -195,6 +195,21 @@ public class Attr extends JCTree.Visitor {
return owntype;
}
Type checkReturn(JCTree tree, Type owntype, int ownkind, int pkind, Type pt) {
if (owntype.tag != ERROR && pt.tag != METHOD && pt.tag != FORALL) {
if ((ownkind & ~pkind) == 0) {
owntype = chk.checkReturnType(tree.pos(), owntype, pt);
} else {
log.error(tree.pos(), "unexpected.type",
kindNames(pkind),
kindName(ownkind));
owntype = types.createErrorType(owntype);
}
}
tree.type = owntype;
return owntype;
}
/** Is given blank final variable assignable, i.e. in a scope where it
* may be assigned to even though it is final?
* @param v The blank final variable.
@ -413,7 +428,14 @@ public class Attr extends JCTree.Visitor {
/** Derived visitor method: attribute a type tree.
*/
Type attribType(JCTree tree, Env<AttrContext> env) {
Type result = attribTree(tree, env, TYP, Type.noType);
Type result = attribType(tree, env, Type.noType);
return result;
}
/** Derived visitor method: attribute a type tree.
*/
Type attribType(JCTree tree, Env<AttrContext> env, Type pt) {
Type result = attribTree(tree, env, TYP, pt);
return result;
}
@ -1357,7 +1379,7 @@ public class Attr extends JCTree.Visitor {
// Check that value of resulting type is admissible in the
// current context. Also, capture the return type
result = check(tree, capture(restype), VAL, pkind, pt);
result = checkReturn(tree, capture(restype), VAL, pkind, pt);
}
chk.validate(tree.typeargs, localEnv);
}
@ -1432,9 +1454,9 @@ public class Attr extends JCTree.Visitor {
// Attribute clazz expression and store
// symbol + type back into the attributed tree.
Type clazztype = chk.checkClassType(
tree.clazz.pos(), attribType(clazz, env), true);
Type clazztype = attribType(clazz, env);
chk.validate(clazz, localEnv);
clazztype = chk.checkNewClassType(clazz.pos(), clazztype, true, pt);
if (tree.encl != null) {
// We have to work in this case to store
// symbol + type back into the attributed tree.
@ -1539,7 +1561,9 @@ public class Attr extends JCTree.Visitor {
// ...
// }
if (Resolve.isStatic(env)) cdef.mods.flags |= STATIC;
clazz = TreeInfo.isDiamond(tree) ?
make.Type(clazztype)
: clazz;
if (clazztype.tsym.isInterface()) {
cdef.implementing = List.of(clazz);
} else {
@ -2522,7 +2546,7 @@ public class Attr extends JCTree.Visitor {
if (clazztype.tag == CLASS) {
List<Type> formals = clazztype.tsym.type.getTypeArguments();
if (actuals.length() == formals.length()) {
if (actuals.length() == formals.length() || actuals.isEmpty()) {
List<Type> a = actuals;
List<Type> f = formals;
while (a.nonEmpty()) {
@ -2548,7 +2572,18 @@ public class Attr extends JCTree.Visitor {
clazzOuter = site;
}
}
owntype = new ClassType(clazzOuter, actuals, clazztype.tsym);
if (actuals.nonEmpty()) {
owntype = new ClassType(clazzOuter, actuals, clazztype.tsym);
}
else if (TreeInfo.isDiamond(tree)) {
//a type apply with no explicit type arguments - diamond operator
//the result type is a forall F where F's tvars are the type-variables
//that will be inferred when F is checked against the expected type
List<Type> ftvars = clazztype.tsym.type.getTypeArguments();
List<Type> new_tvars = types.newInstances(ftvars);
clazztype = new ClassType(clazzOuter, new_tvars, clazztype.tsym);
owntype = new ForAll(new_tvars, clazztype);
}
} else {
if (formals.length() != 0) {
log.error(tree.pos(), "wrong.number.type.args",

@ -362,8 +362,6 @@ public class Check {
Type checkType(DiagnosticPosition pos, Type found, Type req) {
if (req.tag == ERROR)
return req;
if (found.tag == FORALL)
return instantiatePoly(pos, (ForAll)found, req, convertWarner(pos, found, req));
if (req.tag == NONE)
return found;
if (types.isAssignable(found, req, convertWarner(pos, found, req)))
@ -381,11 +379,38 @@ public class Check {
return typeError(pos, diags.fragment("incompatible.types"), found, req);
}
Type checkReturnType(DiagnosticPosition pos, Type found, Type req) {
if (found.tag == FORALL) {
try {
return instantiatePoly(pos, (ForAll) found, req, convertWarner(pos, found, req));
} catch (Infer.NoInstanceException ex) {
if (ex.isAmbiguous) {
JCDiagnostic d = ex.getDiagnostic();
log.error(pos,
"undetermined.type" + (d != null ? ".1" : ""),
found, d);
return types.createErrorType(req);
} else {
JCDiagnostic d = ex.getDiagnostic();
return typeError(pos,
diags.fragment("incompatible.types" + (d != null ? ".1" : ""), d),
found, req);
}
} catch (Infer.InvalidInstanceException ex) {
JCDiagnostic d = ex.getDiagnostic();
log.error(pos, "invalid.inferred.types", ((ForAll)found).tvars, d);
return types.createErrorType(req);
}
} else {
return checkType(pos, found, req);
}
}
/** Instantiate polymorphic type to some prototype, unless
* prototype is `anyPoly' in which case polymorphic type
* is returned unchanged.
*/
Type instantiatePoly(DiagnosticPosition pos, ForAll t, Type pt, Warner warn) {
Type instantiatePoly(DiagnosticPosition pos, ForAll t, Type pt, Warner warn) throws Infer.NoInstanceException {
if (pt == Infer.anyPoly && complexInference) {
return t;
} else if (pt == Infer.anyPoly || pt.tag == NONE) {
@ -394,28 +419,9 @@ public class Check {
} else if (pt.tag == ERROR) {
return pt;
} else {
try {
return infer.instantiateExpr(t, pt, warn);
} catch (Infer.NoInstanceException ex) {
if (ex.isAmbiguous) {
JCDiagnostic d = ex.getDiagnostic();
log.error(pos,
"undetermined.type" + (d!=null ? ".1" : ""),
t, d);
return types.createErrorType(pt);
} else {
JCDiagnostic d = ex.getDiagnostic();
return typeError(pos,
diags.fragment("incompatible.types" + (d!=null ? ".1" : ""), d),
t, pt);
}
} catch (Infer.InvalidInstanceException ex) {
JCDiagnostic d = ex.getDiagnostic();
log.error(pos, "invalid.inferred.types", t.tvars, d);
return types.createErrorType(pt);
}
return infer.instantiateExpr(t, pt, warn);
}
}
}
/** Check that a given type can be cast to a given target type.
* Return the result of the cast.
@ -538,6 +544,29 @@ public class Check {
return t;
}
/** Check that type is a valid type for a new expression. If the type contains
* some uninferred type variables, instantiate them exploiting the expected
* type.
*
* @param pos Position to be used for error reporting.
* @param t The type to be checked.
* @param noBounds True if type bounds are illegal here.
* @param pt Expected type (used with diamond operator)
*/
Type checkNewClassType(DiagnosticPosition pos, Type t, boolean noBounds, Type pt) {
if (t.tag == FORALL) {
try {
t = instantiatePoly(pos, (ForAll)t, pt, Warner.noWarnings);
}
catch (Infer.NoInstanceException ex) {
JCDiagnostic d = ex.getDiagnostic();
log.error(pos, "cant.apply.diamond", t.getTypeArguments(), d);
return types.createErrorType(pt);
}
}
return checkClassType(pos, t, noBounds);
}
/** Check that type is a reifiable class, interface or array type.
* @param pos Position to be used for error reporting.
* @param t The type to be checked.
@ -890,7 +919,8 @@ public class Check {
}
checkCapture(tree);
}
if (tree.type.tag == CLASS || tree.type.tag == FORALL) {
// Check that this type is either fully parameterized, or
// not parameterized at all.
if (tree.type.getEnclosingType().isRaw())

@ -131,6 +131,7 @@ public class JavacParser implements Parser {
this.allowForeach = source.allowForeach();
this.allowStaticImport = source.allowStaticImport();
this.allowAnnotations = source.allowAnnotations();
this.allowDiamond = source.allowDiamond();
this.allowTypeAnnotations = source.allowTypeAnnotations();
this.keepDocComments = keepDocComments;
if (keepDocComments)
@ -148,6 +149,10 @@ public class JavacParser implements Parser {
*/
boolean allowGenerics;
/** Switch: Should diamond operator be recognized?
*/
boolean allowDiamond;
/** Switch: Should varargs be recognized?
*/
boolean allowVarargs;
@ -194,6 +199,7 @@ public class JavacParser implements Parser {
static final int TYPE = 2;
static final int NOPARAMS = 4;
static final int TYPEARG = 8;
static final int DIAMOND = 16;
/** The current mode.
*/
@ -1326,6 +1332,11 @@ public class JavacParser implements Parser {
ListBuffer<JCExpression> args = lb();
if (S.token() == LT) {
S.nextToken();
if (S.token() == GT && (mode & DIAMOND) != 0) {
checkDiamond();
S.nextToken();
return List.nil();
}
args.append(((mode & EXPR) == 0) ? typeArgument() : parseType());
while (S.token() == COMMA) {
S.nextToken();
@ -1497,7 +1508,7 @@ public class JavacParser implements Parser {
t = F.AnnotatedType(newAnnotations, t);
int oldmode = mode;
mode = TYPE;
mode = TYPE | DIAMOND;
if (S.token() == LT) {
checkGenerics();
t = typeArguments(t);
@ -1547,8 +1558,11 @@ public class JavacParser implements Parser {
JCExpression innerCreator(int newpos, List<JCExpression> typeArgs, JCExpression encl) {
JCExpression t = toP(F.at(S.pos()).Ident(ident()));
if (S.token() == LT) {
int oldmode = mode;
mode |= DIAMOND;
checkGenerics();
t = typeArguments(t);
mode = oldmode;
}
return classCreatorRest(newpos, encl, typeArgs, t);
}
@ -3099,6 +3113,12 @@ public class JavacParser implements Parser {
}
}
void checkDiamond() {
if (!allowDiamond) {
log.error(S.pos(), "diamond.not.supported.in.source", source.name);
allowDiamond = true;
}
}
void checkGenerics() {
if (!allowGenerics) {
log.error(S.pos(), "generics.not.supported.in.source", source.name);

@ -287,11 +287,12 @@ public class JavacProcessingEnvironment implements ProcessingEnvironment, Closea
// The to-be-wrapped iterator.
private Iterator<?> iterator;
private Log log;
private Class<?> loaderClass;
private boolean jusl;
private Object loader;
ServiceIterator(ClassLoader classLoader, Log log) {
Class<?> loaderClass;
String loadMethodName;
boolean jusl;
this.log = log;
try {
@ -324,6 +325,7 @@ public class JavacProcessingEnvironment implements ProcessingEnvironment, Closea
// For java.util.ServiceLoader, we have to call another
// method to get the iterator.
if (jusl) {
loader = result; // Store ServiceLoader to call reload later
Method m = loaderClass.getMethod("iterator");
result = m.invoke(result); // serviceLoader.iterator();
}
@ -365,6 +367,18 @@ public class JavacProcessingEnvironment implements ProcessingEnvironment, Closea
public void remove() {
throw new UnsupportedOperationException();
}
public void close() {
if (jusl) {
try {
// Call java.util.ServiceLoader.reload
Method reloadMethod = loaderClass.getMethod("reload");
reloadMethod.invoke(loader);
} catch(Exception e) {
; // Ignore problems during a call to reload.
}
}
}
}
@ -552,7 +566,7 @@ public class JavacProcessingEnvironment implements ProcessingEnvironment, Closea
* been discoverd so far as well as the means to discover more, if
* necessary. A single iterator should be used per round of
* annotation processing. The iterator first visits already
* discovered processors then fails over to the service provided
* discovered processors then fails over to the service provider
* mechanism if additional queries are made.
*/
class DiscoveredProcessors implements Iterable<ProcessorState> {
@ -624,6 +638,16 @@ public class JavacProcessingEnvironment implements ProcessingEnvironment, Closea
this.processorIterator = processorIterator;
this.procStateList = new ArrayList<ProcessorState>();
}
/**
* Free jar files, etc. if using a service loader.
*/
public void close() {
if (processorIterator != null &&
processorIterator instanceof ServiceIterator) {
((ServiceIterator) processorIterator).close();
}
}
}
private void discoverAndRunProcs(Context context,
@ -910,7 +934,7 @@ public class JavacProcessingEnvironment implements ProcessingEnvironment, Closea
* second to last round; errorRaised() gives the error status
* of the last round.
*/
errorStatus = errorStatus || messager.errorRaised();
errorStatus = errorStatus || messager.errorRaised();
// Free resources
@ -1023,6 +1047,8 @@ public class JavacProcessingEnvironment implements ProcessingEnvironment, Closea
*/
public void close() throws IOException {
filer.close();
if (discoveredProcs != null) // Make calling close idempotent
discoveredProcs.close();
discoveredProcs = null;
if (processorClassLoader != null && processorClassLoader instanceof Closeable)
((Closeable) processorClassLoader).close();

@ -48,7 +48,8 @@ import java.util.*;
* deletion without notice.</b>
*/
@SupportedAnnotationTypes("*")
@SupportedSourceVersion(SourceVersion.RELEASE_6)
// TODO: Change to version 7 based visitors when available
@SupportedSourceVersion(SourceVersion.RELEASE_7)
public class PrintingProcessor extends AbstractProcessor {
PrintWriter writer;
@ -374,6 +375,7 @@ public class PrintingProcessor extends AbstractProcessor {
for(TypeParameterElement tpe: typeParams) {
if (!first)
writer.print(", ");
printAnnotationsInline(tpe);
writer.print(tpe.toString());
first = false;
}

@ -1073,6 +1073,10 @@ compiler.err.cant.resolve.location.args.params=\
symbol: {0} <{2}>{1}({3})\n\
location: {4} {5}
compiler.err.cant.apply.diamond=\
diamond operator cannot infer types for {0};\n\
reason: {1}
## The following are all possible string for "kindname".
## They should be called whatever the JLS calls them after it been translated
## to the appropriate language.
@ -1205,6 +1209,10 @@ compiler.err.enums.not.supported.in.source=\
enums are not supported in -source {0}\n\
(use -source 5 or higher to enable enums)
compiler.err.diamond.not.supported.in.source=\
diamond operator is not supported in -source {0}\n\
(use -source 7 or higher to enable diamond operator)
########################################
# Diagnostics for where clause implementation
# used by the RichDiagnosticFormatter.

@ -204,6 +204,15 @@ public class TreeInfo {
return (JCMethodInvocation)exec.expr;
}
/** Return true if a tree represents a diamond new expr. */
public static boolean isDiamond(JCTree tree) {
switch(tree.getTag()) {
case JCTree.TYPEAPPLY: return ((JCTypeApply)tree).getTypeArguments().isEmpty();
case JCTree.NEWCLASS: return isDiamond(((JCNewClass)tree).clazz);
default: return false;
}
}
/** Return true if a tree represents the null literal. */
public static boolean isNull(JCTree tree) {
if (tree.getTag() != JCTree.LITERAL)

@ -123,6 +123,14 @@ public abstract class JavadocTester {
*/
private static int javadocRunNum = 0;
/**
* Whether or not to match newlines exactly.
* Set this value to false if the match strings
* contain text from javadoc comments containing
* non-platform newlines.
*/
protected boolean exactNewlineMatch = true;
/**
* Construct a JavadocTester.
*/
@ -419,15 +427,22 @@ public abstract class JavadocTester {
/**
* Search for the string in the given file and return true
* if the string was found.
* If exactNewlineMatch is false, newlines will be normalized
* before the comparison.
*
* @param fileString the contents of the file to search through
* @param stringToFind the string to search for
* @return true if the string was found
*/
private boolean findString(String fileString, String stringToFind) {
return fileString.indexOf(stringToFind) >= 0;
if (exactNewlineMatch) {
return fileString.indexOf(stringToFind) >= 0;
} else {
return fileString.replace(NL, "\n").indexOf(stringToFind.replace(NL, "\n")) >= 0;
}
}
/**
* Return the standard output.
* @return the standard output

@ -351,6 +351,7 @@ public class TestHtmlDefinitionListTag extends JavadocTester {
*/
public static void main(String[] args) {
TestHtmlDefinitionListTag tester = new TestHtmlDefinitionListTag();
tester.exactNewlineMatch = false;
run(tester, ARGS1, TEST_ALL, NEGATED_TEST);
run(tester, ARGS1, TEST_CMNT_DEPR, NEGATED_TEST);
run(tester, ARGS2, TEST_ALL, NEGATED_TEST);

@ -128,6 +128,7 @@ public class TestSerializedFormDeprecationInfo extends JavadocTester {
*/
public static void main(String[] args) {
TestSerializedFormDeprecationInfo tester = new TestSerializedFormDeprecationInfo();
tester.exactNewlineMatch = false;
run(tester, ARGS1, TEST_CMNT_DEPR, TEST_NOCMNT);
run(tester, ARGS2, TEST_NOCMNT, TEST_CMNT_DEPR);
run(tester, ARGS3, TEST_NODEPR, TEST_NOCMNT_NODEPR);

@ -33,12 +33,11 @@
OS=`uname -s`;
case "${OS}" in
Windows* | CYGWIN* )
SEP=";"
CYGWIN* )
DIFFOPTS="--strip-trailing-cr"
;;
* )
SEP=":"
;;
esac
@ -94,7 +93,7 @@ for i in ${ANNOTATION_FILES}
do
printf "%s\n" "Testing annotations on source file ${i}"
${APT} @options ${i} 2> result.txt
diff ${TESTSRC}/golden.txt result.txt
diff ${DIFFOPTS} ${TESTSRC}/golden.txt result.txt
RESULT=$?
case "$RESULT" in
@ -109,7 +108,7 @@ do
CLASS=`basename ${i} .java`
printf "%s\n" "Testing annotations on class file ${CLASS}"
${APT} @options1 ${CLASS} 2> result2.txt
diff ${TESTSRC}/golden.txt result2.txt
diff ${DIFFOPTS} ${TESTSRC}/golden.txt result2.txt
RESULT=$?
case "$RESULT" in

@ -32,12 +32,11 @@
OS=`uname -s`;
case "${OS}" in
Windows* | CYGWIN* )
SEP=";"
CYGWIN* )
DIFFOPTS="--strip-trailing-cr"
;;
* )
SEP=":"
;;
esac
@ -88,7 +87,7 @@ done
# check for mutliple methods and no static initializer
${APT} -XclassesAsDecls -cp ${TESTCLASSES} -print Aggregate > aggregate.txt
diff aggregate.txt ${TESTSRC}/goldenAggregate.txt
diff ${DIFFOPTS} aggregate.txt ${TESTSRC}/goldenAggregate.txt
RESULT=$?
case "$RESULT" in

@ -57,7 +57,12 @@ TestFile() {
OS=`uname -s`;
case "${OS}" in
Windows* | CYGWIN* )
Windows* )
SEP=";"
;;
CYGWIN* )
DIFFOPTS="--strip-trailing-cr"
SEP=";"
;;
@ -150,7 +155,7 @@ ${APT} @options2 2> output
TestNoFile "HelloWorld.class"
diff output ${TESTSRC}/golden.txt
diff ${DIFFOPTS} output ${TESTSRC}/golden.txt
RESULT=$?
case "$RESULT" in
@ -180,7 +185,7 @@ printf "%s\n" "-cp ${TESTCLASSES}" >> options3
printf "%s\n" "HelloAnnotation.java" >> options3
${APT} @options3 2> output
diff output ${TESTSRC}/goldenWarn.txt
diff ${DIFFOPTS} output ${TESTSRC}/goldenWarn.txt
RESULT=$?
case "$RESULT" in
@ -485,7 +490,7 @@ printf "%s\n" "-d ./class" >> options8
printf "%s\n" "${TESTSRC}/Dummy1.java" >> options8
${APT} @options8 > multiRoundOutput 2> multiRoundError
diff multiRoundOutput ${TESTSRC}/goldenFactory.txt
diff ${DIFFOPTS} multiRoundOutput ${TESTSRC}/goldenFactory.txt
RESULT=$?
case "$RESULT" in

@ -45,13 +45,13 @@ fi
OS=`uname -s`
case "$OS" in
SunOS | Linux )
NULL=/dev/null
PS=":"
FS="/"
;;
CYGWIN* )
FS="/"
DIFFOPTS="--strip-trailing-cr"
;;
Windows* )
NULL=NUL
PS=";"
FS="\\"
;;
* )
@ -68,7 +68,7 @@ rm -f Test.java Test.out
"${TESTJAVA}${FS}bin${FS}native2ascii" ${TESTTOOLVMOPTS} -encoding IBM1047 Test.tmp Test.out
diff -c "${TESTSRC}${FS}Test.out" Test.out
diff ${DIFFOPTS} -c "${TESTSRC}${FS}Test.out" Test.out
result=$?
if [ $result -eq o ]

@ -42,13 +42,13 @@ fi
OS=`uname -s`
case "$OS" in
SunOS | Linux )
NULL=/dev/null
PS=":"
FS="/"
;;
CYGWIN* )
FS="/"
DIFFOPTS="--strip-trailing-cr"
;;
Windows* )
NULL=NUL
PS=";"
FS="\\"
;;
* )
@ -57,8 +57,8 @@ case "$OS" in
;;
esac
"${TESTJAVA}${FS}bin${FS}javac" ${TESTTOOLVMOPTS} -d ${TC} -cp ${TC} -encoding iso-8859-1 -XD-printsource ${TS}${FS}T6302184.java 2>&1 > ${NULL}
diff -c ${TC}${FS}T6302184.java ${TS}${FS}T6302184.out
"${TESTJAVA}${FS}bin${FS}javac" ${TESTTOOLVMOPTS} -d ${TC} -cp ${TC} -encoding iso-8859-1 -XD-printsource ${TS}${FS}T6302184.java 2>&1
diff ${DIFFOPTS} -c ${TC}${FS}T6302184.java ${TS}${FS}T6302184.out
result=$?

@ -1,28 +1,5 @@
/*
* Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
/*
* @test
* @test /nodynamiccopyright/
* @bug 6521805
* @summary Regression: JDK5/JDK6 javac allows write access to outer class reference
* @author mcimadamore

@ -1,2 +1,2 @@
T6521805a.java:40:12: compiler.err.synthetic.name.conflict: this$0, T6521805a.Outer
T6521805a.java:17:12: compiler.err.synthetic.name.conflict: this$0, T6521805a.Outer
1 error

@ -1,2 +1,2 @@
T6521805a.java:40:12: compiler.warn.synthetic.name.conflict: this$0, T6521805a.Outer
T6521805a.java:17:12: compiler.warn.synthetic.name.conflict: this$0, T6521805a.Outer
1 warning

@ -1,28 +1,5 @@
/*
* Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
/*
* @test
* @test /nodynamiccopyright/
* @bug 6521805
* @summary Regression: JDK5/JDK6 javac allows write access to outer class reference
* @author mcimadamore

@ -1,2 +1,2 @@
T6521805d.java:41:18: compiler.err.synthetic.name.conflict: this$0, T6521805.Inner
T6521805d.java:18:18: compiler.err.synthetic.name.conflict: this$0, T6521805.Inner
1 error

@ -1,28 +1,5 @@
/*
* Copyright 2008 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
/**
* @test
* @test /nodynamiccopyright/
* @bug 6717241
* @summary some diagnostic argument is prematurely converted into a String object
* @author Maurizio Cimadamore

@ -1,4 +1,4 @@
T6717241a.java:36:21: compiler.err.cant.resolve: kindname.variable, v, ,
T6717241a.java:38:10: compiler.err.cant.resolve.args: kindname.method, m1, , int,java.lang.String
T6717241a.java:40:10: compiler.err.cant.resolve.args.params: kindname.method, m2, java.lang.Integer,java.lang.Double, int,java.lang.String
T6717241a.java:13:21: compiler.err.cant.resolve: kindname.variable, v, ,
T6717241a.java:15:10: compiler.err.cant.resolve.args: kindname.method, m1, , int,java.lang.String
T6717241a.java:17:10: compiler.err.cant.resolve.args.params: kindname.method, m2, java.lang.Integer,java.lang.Double, int,java.lang.String
3 errors

@ -1,28 +1,5 @@
/*
* Copyright 2008 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
/**
* @test
* @test /nodynamiccopyright/
* @bug 6717241
* @summary some diagnostic argument is prematurely converted into a String object
* @author Maurizio Cimadamore

@ -1,4 +1,4 @@
T6717241b.java:35:20: compiler.err.cant.resolve.location: kindname.variable, v, , , kindname.class, T6717241b
T6717241b.java:37:9: compiler.err.cant.resolve.location.args: kindname.method, m1, , int,java.lang.String, kindname.class, T6717241b
T6717241b.java:39:18: compiler.err.cant.resolve.location.args.params: kindname.method, m2, java.lang.Integer,java.lang.Double, int,java.lang.String, kindname.class, T6717241b
T6717241b.java:12:20: compiler.err.cant.resolve.location: kindname.variable, v, , , kindname.class, T6717241b
T6717241b.java:14:9: compiler.err.cant.resolve.location.args: kindname.method, m1, , int,java.lang.String, kindname.class, T6717241b
T6717241b.java:16:18: compiler.err.cant.resolve.location.args.params: kindname.method, m2, java.lang.Integer,java.lang.Double, int,java.lang.String, kindname.class, T6717241b
3 errors

@ -1,28 +1,5 @@
/*
* Copyright 2008 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
/*
* @test
* @test /nodynamiccopyright/
* @bug 6734819
* @summary Javac performs flows analysis on already translated classes
* @author Maurizio Cimadamore

@ -4,5 +4,5 @@
[flow W]
[attribute Z]
[flow Z]
T6734819c.java:38:11: compiler.err.unreachable.stmt
T6734819c.java:15:11: compiler.err.unreachable.stmt
1 error

@ -1,28 +1,5 @@
/*
* Copyright 2008 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
/*
* @test
* @test /nodynamiccopyright/
* @bug 6758789
* @summary 6758789: Some method resolution diagnostic should be improved
* @author Maurizio Cimadamore

@ -1,3 +1,3 @@
T6758789a.java:37:9: compiler.err.cant.apply.symbol: kindname.method, m1, compiler.misc.no.args, int, kindname.class, T6758789a, null
T6758789a.java:38:9: compiler.err.cant.apply.symbol: kindname.method, m2, int, compiler.misc.no.args, kindname.class, T6758789a, null
2 errors
T6758789a.java:14:9: compiler.err.cant.apply.symbol: kindname.method, m1, compiler.misc.no.args, int, kindname.class, T6758789a, null
T6758789a.java:15:9: compiler.err.cant.apply.symbol: kindname.method, m2, int, compiler.misc.no.args, kindname.class, T6758789a, null
2 errors

@ -1,28 +1,5 @@
/*
* Copyright 2008 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
/*
* @test
* @test /nodynamiccopyright/
* @bug 6758789
* @summary 6758789: Some method resolution diagnostic should be improved
* @author Maurizio Cimadamore

@ -1,5 +1,5 @@
T6758789b.java:39:11: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), T6758789a.Foo, T6758789a.Foo<X>
T6758789b.java:39:10: compiler.warn.unchecked.meth.invocation.applied: kindname.method, m, T6758789a.Foo<X>, T6758789a.Foo, kindname.class, T6758789a
T6758789b.java:16:11: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), T6758789a.Foo, T6758789a.Foo<X>
T6758789b.java:16:10: compiler.warn.unchecked.meth.invocation.applied: kindname.method, m, T6758789a.Foo<X>, T6758789a.Foo, kindname.class, T6758789a
- compiler.err.warnings.and.werror
1 error
2 warnings

@ -1,28 +1,5 @@
/*
* Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
/*
* @test
* @test /nodynamiccopyright/
* @bug 6840059
* @summary 6758789: Some method resolution diagnostic should be improved
* @author Maurizio Cimadamore

@ -1,3 +1,3 @@
T6840059.java:38:9: compiler.err.cant.resolve.location.args: kindname.constructor, T6840059, , java.lang.String, kindname.class, T6840059
T6840059.java:38:25: compiler.err.cant.resolve.location.args: kindname.constructor, T6840059, , , kindname.class, T6840059
T6840059.java:15:9: compiler.err.cant.resolve.location.args: kindname.constructor, T6840059, , java.lang.String, kindname.class, T6840059
T6840059.java:15:25: compiler.err.cant.resolve.location.args: kindname.constructor, T6840059, , , kindname.class, T6840059
2 errors

@ -56,14 +56,10 @@ echo "CLASSPATH=${CLASSPATH}"
# set platform-dependent variables
OS=`uname -s`
case "$OS" in
SunOS | Linux )
NULL=/dev/null
PS=":"
SunOS | Linux | CYGWIN* )
FS="/"
;;
Windows* )
NULL=NUL
PS=";"
FS="\\"
;;
* )

@ -1,28 +1,5 @@
/*
* Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
/**
* @test
* @test /nodynamiccopyright/
* @bug 6722234
* @summary javac diagnostics need better integration with the type-system
* @author mcimadamore

@ -1,2 +1,2 @@
T6722234a.java:35:9: compiler.err.cant.apply.symbol: kindname.method, m, compiler.misc.type.var: T, 1, compiler.misc.type.var: T, 2, kindname.class, T6722234a<compiler.misc.type.var: T, 1>, null
T6722234a.java:12:9: compiler.err.cant.apply.symbol: kindname.method, m, compiler.misc.type.var: T, 1, compiler.misc.type.var: T, 2, kindname.class, T6722234a<compiler.misc.type.var: T, 1>, null
1 error

@ -1,3 +1,3 @@
T6722234a.java:35:9: compiler.err.cant.apply.symbol: kindname.method, m, compiler.misc.type.var: T, 1, compiler.misc.type.var: T, 2, kindname.class, T6722234a<compiler.misc.type.var: T, 1>, null
T6722234a.java:12:9: compiler.err.cant.apply.symbol: kindname.method, m, compiler.misc.type.var: T, 1, compiler.misc.type.var: T, 2, kindname.class, T6722234a<compiler.misc.type.var: T, 1>, null
- compiler.misc.where.description.typevar.1: compiler.misc.type.var: T, 1,compiler.misc.type.var: T, 2,{(compiler.misc.where.typevar: compiler.misc.type.var: T, 1, java.lang.String, kindname.class, T6722234a),(compiler.misc.where.typevar: compiler.misc.type.var: T, 2, java.lang.Integer, kindname.method, <compiler.misc.type.var: T, 2>test(compiler.misc.type.var: T, 2))}
1 error

@ -1,28 +1,5 @@
/*
* Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
/**
* @test
* @test /nodynamiccopyright/
* @bug 6722234
* @summary javac diagnostics need better integration with the type-system
* @author mcimadamore

@ -1,2 +1,2 @@
T6722234b.java:39:9: compiler.err.cant.apply.symbol: kindname.method, m, List<T>,List<T>, List<compiler.misc.type.captureof: 1, ? extends T6722234b>,List<compiler.misc.type.captureof: 2, ? extends T6722234b>, kindname.class, T6722234b, null
T6722234b.java:16:9: compiler.err.cant.apply.symbol: kindname.method, m, List<T>,List<T>, List<compiler.misc.type.captureof: 1, ? extends T6722234b>,List<compiler.misc.type.captureof: 2, ? extends T6722234b>, kindname.class, T6722234b, null
1 error

@ -1,4 +1,4 @@
T6722234b.java:39:9: compiler.err.cant.apply.symbol: kindname.method, m, List<T>,List<T>, List<compiler.misc.captured.type: 1>,List<compiler.misc.captured.type: 2>, kindname.class, T6722234b, null
T6722234b.java:16:9: compiler.err.cant.apply.symbol: kindname.method, m, List<T>,List<T>, List<compiler.misc.captured.type: 1>,List<compiler.misc.captured.type: 2>, kindname.class, T6722234b, null
- compiler.misc.where.description.typevar: T,{(compiler.misc.where.typevar: T, Object, kindname.method, <T>m(List<T>,List<T>))}
- compiler.misc.where.description.captured.1: compiler.misc.captured.type: 1,compiler.misc.captured.type: 2,{(compiler.misc.where.captured.1: compiler.misc.captured.type: 1, T6722234b, compiler.misc.type.null, ? extends T6722234b),(compiler.misc.where.captured.1: compiler.misc.captured.type: 2, T6722234b, compiler.misc.type.null, ? extends T6722234b)}
1 error

@ -1,28 +1,5 @@
/*
* Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
/**
* @test
* @test /nodynamiccopyright/
* @bug 6722234
* @summary javac diagnostics need better integration with the type-system
* @author mcimadamore

@ -1,2 +1,2 @@
T6722234c.java:37:9: compiler.err.cant.apply.symbol: kindname.method, m, T6722234c.String, java.lang.String, kindname.class, T6722234c, null
T6722234c.java:14:9: compiler.err.cant.apply.symbol: kindname.method, m, T6722234c.String, java.lang.String, kindname.class, T6722234c, null
1 error

@ -1,28 +1,5 @@
/*
* Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
/**
* @test
* @test /nodynamiccopyright/
* @bug 6722234
* @summary javac diagnostics need better integration with the type-system
* @author mcimadamore

@ -1,3 +1,3 @@
T6722234d.java:41:20: compiler.err.prob.found.req: (compiler.misc.incompatible.types), compiler.misc.intersection.type: 1, T6722234d.A
T6722234d.java:18:20: compiler.err.prob.found.req: (compiler.misc.incompatible.types), compiler.misc.intersection.type: 1, T6722234d.A
- compiler.misc.where.description.intersection: compiler.misc.intersection.type: 1,{(compiler.misc.where.intersection: compiler.misc.intersection.type: 1, java.lang.Object,T6722234d.I1,T6722234d.I2)}
1 error

@ -1,3 +1,3 @@
T6722234d.java:41:20: compiler.err.prob.found.req: (compiler.misc.incompatible.types), compiler.misc.intersection.type: 1, T6722234d.A
T6722234d.java:18:20: compiler.err.prob.found.req: (compiler.misc.incompatible.types), compiler.misc.intersection.type: 1, T6722234d.A
- compiler.misc.where.description.intersection: compiler.misc.intersection.type: 1,{(compiler.misc.where.intersection: compiler.misc.intersection.type: 1, Object,I1,I2)}
1 error

@ -1,28 +1,5 @@
/*
* Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
/**
* @test
* @test /nodynamiccopyright/
* @bug 6799605
* @summary Basic/Raw formatters should use type/symbol printer instead of toString()
* @author mcimadamore

@ -1,4 +1,4 @@
T6799605.java:40:9: compiler.err.cant.resolve.location.args: kindname.method, m, , T6799605<compiler.misc.type.captureof: 1, ?>, kindname.class, T6799605<X>
T6799605.java:41:9: compiler.err.cant.resolve.location.args: kindname.method, m, , T6799605<compiler.misc.type.captureof: 1, ?>,T6799605<compiler.misc.type.captureof: 2, ?>, kindname.class, T6799605<X>
T6799605.java:42:9: compiler.err.cant.resolve.location.args: kindname.method, m, , T6799605<compiler.misc.type.captureof: 1, ?>,T6799605<compiler.misc.type.captureof: 2, ?>,T6799605<compiler.misc.type.captureof: 3, ?>, kindname.class, T6799605<X>
T6799605.java:17:9: compiler.err.cant.resolve.location.args: kindname.method, m, , T6799605<compiler.misc.type.captureof: 1, ?>, kindname.class, T6799605<X>
T6799605.java:18:9: compiler.err.cant.resolve.location.args: kindname.method, m, , T6799605<compiler.misc.type.captureof: 1, ?>,T6799605<compiler.misc.type.captureof: 2, ?>, kindname.class, T6799605<X>
T6799605.java:19:9: compiler.err.cant.resolve.location.args: kindname.method, m, , T6799605<compiler.misc.type.captureof: 1, ?>,T6799605<compiler.misc.type.captureof: 2, ?>,T6799605<compiler.misc.type.captureof: 3, ?>, kindname.class, T6799605<X>
3 errors

@ -1,28 +1,5 @@
/*
* Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
/**
* @test
* @test /nodynamiccopyright/
* @bug 6860795
* @summary NullPointerException when compiling a negative java source
* @author mcimadamore

@ -1,2 +1,2 @@
T6860795.java:33:27: compiler.err.already.defined: x, foo
T6860795.java:10:27: compiler.err.already.defined: x, foo
1 error

@ -1,28 +1,5 @@
/*
* Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
/**
* @test
* @test /nodynamiccopyright/
* @bug 6862608
* @summary rich diagnostic sometimes contain wrong type variable numbering
* @author mcimadamore

@ -1,3 +1,3 @@
T6862608a.java:42:41: compiler.err.invalid.inferred.types: T, (compiler.misc.inferred.do.not.conform.to.params: java.lang.Iterable<? extends java.util.Comparator<? super java.lang.String>>, java.util.List<java.util.Comparator<?>>)
T6862608a.java:19:41: compiler.err.invalid.inferred.types: T, (compiler.misc.inferred.do.not.conform.to.params: java.lang.Iterable<? extends java.util.Comparator<? super java.lang.String>>, java.util.List<java.util.Comparator<?>>)
- compiler.misc.where.description.typevar: T,{(compiler.misc.where.typevar: T, java.lang.Object, kindname.method, <T>compound(java.lang.Iterable<? extends java.util.Comparator<? super T>>))}
1 error

@ -1,28 +1,5 @@
/*
* Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
/**
* @test
* @test /nodynamiccopyright/
* @bug 6862608
* @summary rich diagnostic sometimes contain wrong type variable numbering
* @author mcimadamore

@ -1,3 +1,3 @@
T6862608b.java:34:7: compiler.err.cant.apply.symbol: kindname.method, test, compiler.misc.type.var: T, 1, compiler.misc.type.var: T, 2, kindname.class, T66862608b<compiler.misc.type.var: T, 1,compiler.misc.type.var: S, 2>, null
T6862608b.java:11:7: compiler.err.cant.apply.symbol: kindname.method, test, compiler.misc.type.var: T, 1, compiler.misc.type.var: T, 2, kindname.class, T66862608b<compiler.misc.type.var: T, 1,compiler.misc.type.var: S, 2>, null
- compiler.misc.where.description.typevar.1: compiler.misc.type.var: T, 1,compiler.misc.type.var: T, 2,compiler.misc.type.var: S, 1,compiler.misc.type.var: S, 2,{(compiler.misc.where.typevar: compiler.misc.type.var: T, 1, java.lang.String, kindname.class, T66862608b),(compiler.misc.where.typevar: compiler.misc.type.var: T, 2, compiler.misc.type.var: S, 1, kindname.method, <compiler.misc.type.var: S, 1,compiler.misc.type.var: T, 2>foo(compiler.misc.type.var: T, 2)),(compiler.misc.where.typevar: compiler.misc.type.var: S, 1, java.lang.Object, kindname.method, <compiler.misc.type.var: S, 1,compiler.misc.type.var: T, 2>foo(compiler.misc.type.var: T, 2)),(compiler.misc.where.typevar: compiler.misc.type.var: S, 2, java.lang.Object, kindname.class, T66862608b)}
1 error

@ -1,28 +1,5 @@
/*
* Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
/**
* @test
* @test /nodynamiccopyright/
* @bug 6864382
* @summary NullPointerException when compiling a negative java source
* @author mcimadamore

@ -1,2 +1,2 @@
T6864382.java:32:27: compiler.err.type.found.req: (compiler.misc.type.parameter: T), (compiler.misc.type.req.class)
T6864382.java:9:27: compiler.err.type.found.req: (compiler.misc.type.parameter: T), (compiler.misc.type.req.class)
1 error

@ -55,12 +55,14 @@ echo "CLASSPATH=${CLASSPATH}"
OS=`uname -s`
case "$OS" in
SunOS | Linux )
NULL=/dev/null
PS=":"
FS="/"
;;
CYGWIN* )
PS=";" # native PS, not Cygwin PS
FS="/"
;;
Windows* )
NULL=NUL
PS=";"
FS="\\"
;;

@ -1,28 +1,5 @@
/*
* Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
/**
* @test
* @test /nodynamiccopyright/
* @bug 6199153
* @summary Generic throws and overriding
* @author mcimadamore

@ -1,4 +1,4 @@
T6199153.java:41:21: compiler.warn.override.unchecked.thrown: (compiler.misc.cant.override: m(), T6199153.B, <T>m(), T6199153.A), java.io.IOException
T6199153.java:18:21: compiler.warn.override.unchecked.thrown: (compiler.misc.cant.override: m(), T6199153.B, <T>m(), T6199153.A), java.io.IOException
- compiler.err.warnings.and.werror
1 error
1 warning

@ -1,28 +1,5 @@
/*
* Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
/*
* @test
* @test /nodynamiccopyright/
* @bug 6400189
* @summary raw types and inference
* @author mcimadamore

@ -1,4 +1,4 @@
T6400189a.java:37:35: compiler.warn.unchecked.call.mbr.of.raw.type: <T>getAnnotation(java.lang.Class<T>), java.lang.reflect.Constructor
T6400189a.java:37:35: compiler.err.prob.found.req: (compiler.misc.incompatible.types), java.lang.annotation.Annotation, java.lang.annotation.Documented
T6400189a.java:14:35: compiler.warn.unchecked.call.mbr.of.raw.type: <T>getAnnotation(java.lang.Class<T>), java.lang.reflect.Constructor
T6400189a.java:14:35: compiler.err.prob.found.req: (compiler.misc.incompatible.types), java.lang.annotation.Annotation, java.lang.annotation.Documented
1 error
1 warning

@ -1,28 +1,5 @@
/*
* Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
/*
* @test
* @test /nodynamiccopyright/
* @bug 6400189
* @summary raw types and inference
* @author mcimadamore

@ -1,4 +1,4 @@
T6400189b.java:47:24: compiler.warn.unchecked.call.mbr.of.raw.type: <T>m(T6400189b<T>), T6400189b.B
T6400189b.java:47:24: compiler.err.prob.found.req: (compiler.misc.incompatible.types), java.lang.Object, java.lang.Integer
T6400189b.java:24:24: compiler.warn.unchecked.call.mbr.of.raw.type: <T>m(T6400189b<T>), T6400189b.B
T6400189b.java:24:24: compiler.err.prob.found.req: (compiler.misc.incompatible.types), java.lang.Object, java.lang.Integer
1 error
1 warning

@ -53,12 +53,14 @@ echo "CLASSPATH=${CLASSPATH}"
OS=`uname -s`
case "$OS" in
SunOS | Linux )
NULL=/dev/null
PS=":"
FS="/"
;;
CYGWIN* )
PS=";" # native PS, not Cygwin PS
FS="/"
;;
Windows* )
NULL=NUL
PS=";"
FS="\\"
;;

@ -1,28 +1,5 @@
/*
* Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
/*
* @test
* @test /nodynamiccopyright/
* @author mcimadamore
* @bug 6467183
* @summary

@ -1,6 +1,6 @@
T6467183a.java:39:26: compiler.warn.prob.found.req: (compiler.misc.unchecked.cast.to.type), T6467183a<T>.B, T6467183a<T>.A<T>
T6467183a.java:47:41: compiler.warn.prob.found.req: (compiler.misc.unchecked.cast.to.type), T6467183a<T>.A<java.lang.Integer>, T6467183a<T>.C<? extends java.lang.Number>
T6467183a.java:51:42: compiler.warn.prob.found.req: (compiler.misc.unchecked.cast.to.type), T6467183a<T>.A<java.lang.Integer>, T6467183a<T>.C<? extends java.lang.Integer>
T6467183a.java:16:26: compiler.warn.prob.found.req: (compiler.misc.unchecked.cast.to.type), T6467183a<T>.B, T6467183a<T>.A<T>
T6467183a.java:24:41: compiler.warn.prob.found.req: (compiler.misc.unchecked.cast.to.type), T6467183a<T>.A<java.lang.Integer>, T6467183a<T>.C<? extends java.lang.Number>
T6467183a.java:28:42: compiler.warn.prob.found.req: (compiler.misc.unchecked.cast.to.type), T6467183a<T>.A<java.lang.Integer>, T6467183a<T>.C<? extends java.lang.Integer>
- compiler.err.warnings.and.werror
1 error
3 warnings

@ -1,28 +1,5 @@
/*
* Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
/*
* @test
* @test /nodynamiccopyright/
* @author Maurizio Cimadamore
* @bug 6557182
* @summary Unchecked warning *and* inconvertible types

@ -1,4 +1,4 @@
T6557182.java:35:56: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), T, java.lang.Comparable<java.lang.Integer>
T6557182.java:39:56: compiler.warn.prob.found.req: (compiler.misc.unchecked.cast.to.type), T, java.lang.Comparable<java.lang.Integer>
T6557182.java:12:56: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), T, java.lang.Comparable<java.lang.Integer>
T6557182.java:16:56: compiler.warn.prob.found.req: (compiler.misc.unchecked.cast.to.type), T, java.lang.Comparable<java.lang.Integer>
1 error
1 warning

@ -1,28 +1,5 @@
/*
* Copyright 2008-2009 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
/*
* @test
* @test /nodynamiccopyright/
* @author Maurizio Cimadamore
* @bug 6665356
* @summary Cast not allowed when both qualifying type and inner class are parameterized
@ -77,4 +54,4 @@ class T6665356 {
void cast11(Outer<Integer>.Inner<Long> p) {
Object o = (Outer<Integer>.Inner<? super String>)p;
}
}
}

@ -1,8 +1,8 @@
T6665356.java:54:55: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), T6665356.Outer<java.lang.Integer>.Inner<java.lang.Long>, T6665356.Outer<? super java.lang.Number>.Inner<java.lang.Long>
T6665356.java:58:58: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), T6665356.Outer<java.lang.Integer>.Inner<java.lang.Long>, T6665356.Outer<java.lang.Integer>.Inner<? super java.lang.Number>
T6665356.java:62:65: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), T6665356.Outer<java.lang.Integer>.Inner<java.lang.Long>, T6665356.Outer<? super java.lang.Number>.Inner<? super java.lang.Number>
T6665356.java:66:57: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), T6665356.Outer<java.lang.Integer>.Inner<java.lang.Long>, T6665356.Outer<? extends java.lang.String>.Inner<java.lang.Long>
T6665356.java:70:60: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), T6665356.Outer<java.lang.Integer>.Inner<java.lang.Long>, T6665356.Outer<java.lang.Integer>.Inner<? extends java.lang.String>
T6665356.java:74:55: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), T6665356.Outer<java.lang.Integer>.Inner<java.lang.Long>, T6665356.Outer<? super java.lang.String>.Inner<java.lang.Long>
T6665356.java:78:58: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), T6665356.Outer<java.lang.Integer>.Inner<java.lang.Long>, T6665356.Outer<java.lang.Integer>.Inner<? super java.lang.String>
7 errors
T6665356.java:31:55: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), T6665356.Outer<java.lang.Integer>.Inner<java.lang.Long>, T6665356.Outer<? super java.lang.Number>.Inner<java.lang.Long>
T6665356.java:35:58: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), T6665356.Outer<java.lang.Integer>.Inner<java.lang.Long>, T6665356.Outer<java.lang.Integer>.Inner<? super java.lang.Number>
T6665356.java:39:65: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), T6665356.Outer<java.lang.Integer>.Inner<java.lang.Long>, T6665356.Outer<? super java.lang.Number>.Inner<? super java.lang.Number>
T6665356.java:43:57: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), T6665356.Outer<java.lang.Integer>.Inner<java.lang.Long>, T6665356.Outer<? extends java.lang.String>.Inner<java.lang.Long>
T6665356.java:47:60: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), T6665356.Outer<java.lang.Integer>.Inner<java.lang.Long>, T6665356.Outer<java.lang.Integer>.Inner<? extends java.lang.String>
T6665356.java:51:55: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), T6665356.Outer<java.lang.Integer>.Inner<java.lang.Long>, T6665356.Outer<? super java.lang.String>.Inner<java.lang.Long>
T6665356.java:55:58: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), T6665356.Outer<java.lang.Integer>.Inner<java.lang.Long>, T6665356.Outer<java.lang.Integer>.Inner<? super java.lang.String>
7 errors

@ -1,28 +1,5 @@
/*
* Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
/*
* @test
* @test /nodynamiccopyright/
* @author Maurizio Cimadamore
* @bug 6795580
* @summary parser confused by square brackets in qualified generic cast
@ -77,4 +54,4 @@ class T6795580 {
void cast11(Outer<Integer>.Inner<Long>[] p) {
Object o = (Outer<Integer>.Inner<? super String>[])p;
}
}
}

@ -1,8 +1,8 @@
T6795580.java:54:57: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), T6795580.Outer<java.lang.Integer>.Inner<java.lang.Long>[], T6795580.Outer<? super java.lang.Number>.Inner<java.lang.Long>[]
T6795580.java:58:60: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), T6795580.Outer<java.lang.Integer>.Inner<java.lang.Long>[], T6795580.Outer<java.lang.Integer>.Inner<? super java.lang.Number>[]
T6795580.java:62:67: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), T6795580.Outer<java.lang.Integer>.Inner<java.lang.Long>[], T6795580.Outer<? super java.lang.Number>.Inner<? super java.lang.Number>[]
T6795580.java:66:59: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), T6795580.Outer<java.lang.Integer>.Inner<java.lang.Long>[], T6795580.Outer<? extends java.lang.String>.Inner<java.lang.Long>[]
T6795580.java:70:62: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), T6795580.Outer<java.lang.Integer>.Inner<java.lang.Long>[], T6795580.Outer<java.lang.Integer>.Inner<? extends java.lang.String>[]
T6795580.java:74:57: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), T6795580.Outer<java.lang.Integer>.Inner<java.lang.Long>[], T6795580.Outer<? super java.lang.String>.Inner<java.lang.Long>[]
T6795580.java:78:60: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), T6795580.Outer<java.lang.Integer>.Inner<java.lang.Long>[], T6795580.Outer<java.lang.Integer>.Inner<? super java.lang.String>[]
T6795580.java:31:57: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), T6795580.Outer<java.lang.Integer>.Inner<java.lang.Long>[], T6795580.Outer<? super java.lang.Number>.Inner<java.lang.Long>[]
T6795580.java:35:60: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), T6795580.Outer<java.lang.Integer>.Inner<java.lang.Long>[], T6795580.Outer<java.lang.Integer>.Inner<? super java.lang.Number>[]
T6795580.java:39:67: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), T6795580.Outer<java.lang.Integer>.Inner<java.lang.Long>[], T6795580.Outer<? super java.lang.Number>.Inner<? super java.lang.Number>[]
T6795580.java:43:59: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), T6795580.Outer<java.lang.Integer>.Inner<java.lang.Long>[], T6795580.Outer<? extends java.lang.String>.Inner<java.lang.Long>[]
T6795580.java:47:62: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), T6795580.Outer<java.lang.Integer>.Inner<java.lang.Long>[], T6795580.Outer<java.lang.Integer>.Inner<? extends java.lang.String>[]
T6795580.java:51:57: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), T6795580.Outer<java.lang.Integer>.Inner<java.lang.Long>[], T6795580.Outer<? super java.lang.String>.Inner<java.lang.Long>[]
T6795580.java:55:60: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), T6795580.Outer<java.lang.Integer>.Inner<java.lang.Long>[], T6795580.Outer<java.lang.Integer>.Inner<? super java.lang.String>[]
7 errors

@ -1,28 +1,5 @@
/*
* Copyright 2008 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
/*
* @test
* @test /nodynamiccopyright/
* @bug 5009937
* @summary hiding versus generics versus binary compatibility
* @author Maurizio Cimadamore

@ -1,2 +1,2 @@
T5009937.java:39:21: compiler.err.name.clash.same.erasure.no.override: m(T5009937<java.lang.Integer>), T5009937.B, m(T5009937<java.lang.String>), T5009937.A
T5009937.java:16:21: compiler.err.name.clash.same.erasure.no.override: m(T5009937<java.lang.Integer>), T5009937.B, m(T5009937<java.lang.String>), T5009937.A
1 error

@ -1,28 +1,5 @@
/*
* Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
/*
* @test
* @test /nodynamiccopyright/
* @bug 6182950
* @summary methods clash algorithm should not depend on return type
* @author mcimadamore

@ -1,2 +1,2 @@
T6182950a.java:35:12: compiler.err.name.clash.same.erasure: m(java.util.List<java.lang.Integer>), m(java.util.List<java.lang.String>)
T6182950a.java:12:12: compiler.err.name.clash.same.erasure: m(java.util.List<java.lang.Integer>), m(java.util.List<java.lang.String>)
1 error

@ -1,28 +1,5 @@
/*
* Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
/*
* @test
* @test /nodynamiccopyright/
* @bug 6182950
* @summary methods clash algorithm should not depend on return type
* @author mcimadamore

@ -1,2 +1,2 @@
T6182950b.java:38:16: compiler.err.name.clash.same.erasure.no.override: m(java.util.List<java.lang.Integer>), T6182950b.B, m(java.util.List<java.lang.String>), T6182950b.A
T6182950b.java:15:16: compiler.err.name.clash.same.erasure.no.override: m(java.util.List<java.lang.Integer>), T6182950b.B, m(java.util.List<java.lang.String>), T6182950b.A
1 error

@ -1,28 +1,5 @@
/*
* Copyright 2008 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
/*
* @test
* @test /nodynamiccopyright/
* @bug 6677785
* @summary REGRESSION: StackOverFlowError with Cyclic Class level Type Parameters when used in constructors
* @author Maurizio Cimadamore

@ -1,2 +1,2 @@
T6677785.java:31:23: compiler.err.cyclic.inheritance: E
T6677785.java:8:23: compiler.err.cyclic.inheritance: E
1 error

@ -1,28 +1,5 @@
/*
* Copyright 2008 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
/*
* @test
* @test /nodynamiccopyright/
* @bug 6711619
*
* @summary javac doesn't allow access to protected members in intersection types
@ -71,4 +48,4 @@ class T6711619a {
ta = arg.w.a;
tb = arg.w.b;
}
}
}

@ -1,7 +1,7 @@
T6711619a.java:63:14: compiler.err.cant.resolve.args: kindname.method, a, ,
T6711619a.java:64:14: compiler.err.cant.resolve.args: kindname.method, b, ,
T6711619a.java:69:19: compiler.err.report.access: a, private, T6711619a.A
T6711619a.java:70:19: compiler.err.report.access: b, private, T6711619a.B
T6711619a.java:71:19: compiler.err.report.access: a, private, T6711619a.A
T6711619a.java:72:19: compiler.err.report.access: b, private, T6711619a.B
T6711619a.java:40:14: compiler.err.cant.resolve.args: kindname.method, a, ,
T6711619a.java:41:14: compiler.err.cant.resolve.args: kindname.method, b, ,
T6711619a.java:46:19: compiler.err.report.access: a, private, T6711619a.A
T6711619a.java:47:19: compiler.err.report.access: b, private, T6711619a.B
T6711619a.java:48:19: compiler.err.report.access: a, private, T6711619a.A
T6711619a.java:49:19: compiler.err.report.access: b, private, T6711619a.B
6 errors

@ -1,28 +1,5 @@
/*
* Copyright 2008 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
/*
* @test
* @test /nodynamiccopyright/
* @bug 6711619
*
* @summary javac doesn't allow access to protected members in intersection types
@ -61,4 +38,4 @@ class T6711619b {
return E.i;
}
}
}
}

@ -1,5 +1,5 @@
T6711619b.java:39:22: compiler.err.report.access: i, private, T6711619b.X1
T6711619b.java:46:22: compiler.err.report.access: i, private, T6711619b.X2
T6711619b.java:54:22: compiler.err.report.access: i, private, T6711619b.X3
T6711619b.java:61:22: compiler.err.report.access: i, private, T6711619b.X4
T6711619b.java:16:22: compiler.err.report.access: i, private, T6711619b.X1
T6711619b.java:23:22: compiler.err.report.access: i, private, T6711619b.X2
T6711619b.java:31:22: compiler.err.report.access: i, private, T6711619b.X3
T6711619b.java:38:22: compiler.err.report.access: i, private, T6711619b.X4
4 errors

@ -1,28 +1,5 @@
/*
* Copyright 2008-2009 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
/*
* @test
* @test /nodynamiccopyright/
* @bug 6723444
*
* @summary javac fails to substitute type variables into a constructor's throws clause

@ -1,13 +1,13 @@
T6723444.java:65:9: compiler.err.unreported.exception.need.to.catch.or.throw: X2
T6723444.java:66:9: compiler.err.unreported.exception.need.to.catch.or.throw: X2
T6723444.java:68:32: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Throwable
T6723444.java:69:17: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Throwable
T6723444.java:71:9: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Throwable
T6723444.java:72:9: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Throwable
T6723444.java:73:9: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Throwable
T6723444.java:74:9: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Throwable
T6723444.java:75:9: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Throwable
T6723444.java:76:9: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Throwable
T6723444.java:77:9: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Throwable
T6723444.java:78:9: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Throwable
12 errors
T6723444.java:42:9: compiler.err.unreported.exception.need.to.catch.or.throw: X2
T6723444.java:43:9: compiler.err.unreported.exception.need.to.catch.or.throw: X2
T6723444.java:45:32: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Throwable
T6723444.java:46:17: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Throwable
T6723444.java:48:9: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Throwable
T6723444.java:49:9: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Throwable
T6723444.java:50:9: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Throwable
T6723444.java:51:9: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Throwable
T6723444.java:52:9: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Throwable
T6723444.java:53:9: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Throwable
T6723444.java:54:9: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Throwable
T6723444.java:55:9: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Throwable
12 errors

@ -0,0 +1,38 @@
/*
* @test /nodynamiccopyright/
* @bug 6840638
*
* @summary Project Coin: Improved Type Inference for Generic Instance Creation (aka 'diamond')
* @author mcimadamore
* @compile/fail/ref=Neg01.out Neg01.java -source 1.7 -XDrawDiagnostics
*
*/
class Neg01<X extends Number> {
Neg01(X x) {}
<Z> Neg01(X x, Z z) {}
void test() {
Neg01<String> n1 = new Neg01<>(""); //new Foo<Integer> created
Neg01<? extends String> n2 = new Neg01<>(""); //new Foo<Integer> created
Neg01<?> n3 = new Neg01<>(""); //new Foo<Object> created
Neg01<? super String> n4 = new Neg01<>(""); //new Foo<Object> created
Neg01<String> n5 = new Neg01<>(""){}; //new Foo<Integer> created
Neg01<? extends String> n6 = new Neg01<>(""){}; //new Foo<Integer> created
Neg01<?> n7 = new Neg01<>(""){}; //new Foo<Object> created
Neg01<? super String> n8 = new Neg01<>(""){}; //new Foo<Object> created
Neg01<String> n9 = new Neg01<>("", ""); //new Foo<Integer> created
Neg01<? extends String> n10 = new Neg01<>("", ""); //new Foo<Integer> created
Neg01<?> n11 = new Neg01<>("", ""); //new Foo<Object> created
Foo<? super String> n12 = new Neg01<>("", ""); //new Foo<Object> created
Neg01<String> n13 = new Neg01<>("", ""){}; //new Foo<Integer> created
Neg01<? extends String> n14 = new Neg01<>("", ""){}; //new Foo<Integer> created
Neg01<?> n15 = new Neg01<>("", ""){}; //new Foo<Object> created
Neg01<? super String> n16 = new Neg01<>("", ""){}; //new Foo<Object> created
}
}

@ -0,0 +1,31 @@
Neg01.java:18:15: compiler.err.not.within.bounds: java.lang.String
Neg01.java:18:37: compiler.err.cant.apply.diamond: X, (compiler.misc.no.conforming.instance.exists: X, Neg01<X>, Neg01<java.lang.String>)
Neg01.java:19:25: compiler.err.not.within.bounds: ? extends java.lang.String
Neg01.java:19:47: compiler.err.cant.apply.diamond: X, (compiler.misc.no.unique.maximal.instance.exists: X, java.lang.String,java.lang.Number)
Neg01.java:20:23: compiler.err.cant.resolve.location.args: kindname.constructor, Neg01, , java.lang.String, kindname.class, Neg01<java.lang.Number>
Neg01.java:21:23: compiler.err.not.within.bounds: ? super java.lang.String
Neg01.java:21:45: compiler.err.cant.apply.diamond: X, (compiler.misc.no.conforming.instance.exists: X, Neg01<X>, Neg01<? super java.lang.String>)
Neg01.java:23:15: compiler.err.not.within.bounds: java.lang.String
Neg01.java:23:37: compiler.err.cant.apply.diamond: X, (compiler.misc.no.conforming.instance.exists: X, Neg01<X>, Neg01<java.lang.String>)
Neg01.java:24:25: compiler.err.not.within.bounds: ? extends java.lang.String
Neg01.java:24:47: compiler.err.cant.apply.diamond: X, (compiler.misc.no.unique.maximal.instance.exists: X, java.lang.String,java.lang.Number)
Neg01.java:25:23: compiler.err.cant.resolve.location.args: kindname.constructor, Neg01, , java.lang.String, kindname.class, Neg01<java.lang.Number>
Neg01.java:25:38: compiler.err.cant.resolve.location.args: kindname.constructor, Neg01, , , kindname.class, Neg01<java.lang.Number>
Neg01.java:26:23: compiler.err.not.within.bounds: ? super java.lang.String
Neg01.java:26:45: compiler.err.cant.apply.diamond: X, (compiler.misc.no.conforming.instance.exists: X, Neg01<X>, Neg01<? super java.lang.String>)
Neg01.java:28:15: compiler.err.not.within.bounds: java.lang.String
Neg01.java:28:37: compiler.err.cant.apply.diamond: X, (compiler.misc.no.conforming.instance.exists: X, Neg01<X>, Neg01<java.lang.String>)
Neg01.java:29:25: compiler.err.not.within.bounds: ? extends java.lang.String
Neg01.java:29:48: compiler.err.cant.apply.diamond: X, (compiler.misc.no.unique.maximal.instance.exists: X, java.lang.String,java.lang.Number)
Neg01.java:30:24: compiler.err.cant.resolve.location.args: kindname.constructor, Neg01, , java.lang.String,java.lang.String, kindname.class, Neg01<java.lang.Number>
Neg01.java:31:9: compiler.err.cant.resolve.location: kindname.class, Foo, , , kindname.class, Neg01<X>
Neg01.java:31:35: compiler.err.cant.resolve.location.args: kindname.constructor, Neg01, , java.lang.String,java.lang.String, kindname.class, Neg01<java.lang.Number>
Neg01.java:33:15: compiler.err.not.within.bounds: java.lang.String
Neg01.java:33:38: compiler.err.cant.apply.diamond: X, (compiler.misc.no.conforming.instance.exists: X, Neg01<X>, Neg01<java.lang.String>)
Neg01.java:34:25: compiler.err.not.within.bounds: ? extends java.lang.String
Neg01.java:34:48: compiler.err.cant.apply.diamond: X, (compiler.misc.no.unique.maximal.instance.exists: X, java.lang.String,java.lang.Number)
Neg01.java:35:24: compiler.err.cant.resolve.location.args: kindname.constructor, Neg01, , java.lang.String,java.lang.String, kindname.class, Neg01<java.lang.Number>
Neg01.java:35:43: compiler.err.cant.resolve.location.args: kindname.constructor, Neg01, , , kindname.class, Neg01<java.lang.Number>
Neg01.java:36:23: compiler.err.not.within.bounds: ? super java.lang.String
Neg01.java:36:46: compiler.err.cant.apply.diamond: X, (compiler.misc.no.conforming.instance.exists: X, Neg01<X>, Neg01<? super java.lang.String>)
30 errors

@ -0,0 +1,61 @@
/*
* @test /nodynamiccopyright/
* @bug 6840638
*
* @summary Project Coin: Improved Type Inference for Generic Instance Creation (aka 'diamond')
* @author mcimadamore
* @compile/fail/ref=Neg02.out Neg02.java -source 1.7 -XDrawDiagnostics
*
*/
class Neg02 {
static class Foo<X extends Number> {
Foo(X x) {}
<Z> Foo(X x, Z z) {}
}
void testSimple() {
Foo<String> f1 = new Foo<>(""); //new Foo<Integer> created
Foo<? extends String> f2 = new Foo<>(""); //new Foo<Integer> created
Foo<?> f3 = new Foo<>(""); //new Foo<Object> created
Foo<? super String> f4 = new Foo<>(""); //new Foo<Object> created
Foo<String> f5 = new Foo<>(""){}; //new Foo<Integer> created
Foo<? extends String> f6 = new Foo<>(""){}; //new Foo<Integer> created
Foo<?> f7 = new Foo<>(""){}; //new Foo<Object> created
Foo<? super String> f8 = new Foo<>(""){}; //new Foo<Object> created
Foo<String> f9 = new Foo<>("", ""); //new Foo<Integer> created
Foo<? extends String> f10 = new Foo<>("", ""); //new Foo<Integer> created
Foo<?> f11 = new Foo<>("", ""); //new Foo<Object> created
Foo<? super String> f12 = new Foo<>("", ""); //new Foo<Object> created
Foo<String> f13 = new Foo<>("", ""){}; //new Foo<Integer> created
Foo<? extends String> f14 = new Foo<>("", ""){}; //new Foo<Integer> created
Foo<?> f15 = new Foo<>("", ""){}; //new Foo<Object> created
Foo<? super String> f16 = new Foo<>("", ""){}; //new Foo<Object> created
}
void testQualified() {
Foo<String> f1 = new Neg02.Foo<>(""); //new Foo<Integer> created
Foo<? extends String> f2 = new Neg02.Foo<>(""); //new Foo<Integer> created
Foo<?> f3 = new Neg02.Foo<>(""); //new Foo<Object> created
Foo<? super String> f4 = new Neg02.Foo<>(""); //new Foo<Object> created
Foo<String> f5 = new Neg02.Foo<>(""){}; //new Foo<Integer> created
Foo<? extends String> f6 = new Neg02.Foo<>(""){}; //new Foo<Integer> created
Foo<?> f7 = new Neg02.Foo<>(""){}; //new Foo<Object> created
Foo<? super String> f8 = new Neg02.Foo<>(""){}; //new Foo<Object> created
Foo<String> f9 = new Neg02.Foo<>("", ""); //new Foo<Integer> created
Foo<? extends String> f10 = new Neg02.Foo<>("", ""); //new Foo<Integer> created
Foo<?> f11 = new Neg02.Foo<>("", ""); //new Foo<Object> created
Foo<? super String> f12 = new Neg02.Foo<>("", ""); //new Foo<Object> created
Foo<String> f13 = new Neg02.Foo<>("", ""){}; //new Foo<Integer> created
Foo<? extends String> f14 = new Neg02.Foo<>("", ""){}; //new Foo<Integer> created
Foo<?> f15 = new Neg02.Foo<>("", ""){}; //new Foo<Object> created
Foo<? super String> f16 = new Neg02.Foo<>("", ""){}; //new Foo<Object> created
}
}

@ -0,0 +1,61 @@
Neg02.java:19:13: compiler.err.not.within.bounds: java.lang.String
Neg02.java:19:33: compiler.err.cant.apply.diamond: X, (compiler.misc.no.conforming.instance.exists: X, Neg02.Foo<X>, Neg02.Foo<java.lang.String>)
Neg02.java:20:23: compiler.err.not.within.bounds: ? extends java.lang.String
Neg02.java:20:43: compiler.err.cant.apply.diamond: X, (compiler.misc.no.unique.maximal.instance.exists: X, java.lang.String,java.lang.Number)
Neg02.java:21:21: compiler.err.cant.resolve.location.args: kindname.constructor, Foo, , java.lang.String, kindname.class, Neg02.Foo<java.lang.Number>
Neg02.java:22:21: compiler.err.not.within.bounds: ? super java.lang.String
Neg02.java:22:41: compiler.err.cant.apply.diamond: X, (compiler.misc.no.conforming.instance.exists: X, Neg02.Foo<X>, Neg02.Foo<? super java.lang.String>)
Neg02.java:24:13: compiler.err.not.within.bounds: java.lang.String
Neg02.java:24:33: compiler.err.cant.apply.diamond: X, (compiler.misc.no.conforming.instance.exists: X, Neg02.Foo<X>, Neg02.Foo<java.lang.String>)
Neg02.java:25:23: compiler.err.not.within.bounds: ? extends java.lang.String
Neg02.java:25:43: compiler.err.cant.apply.diamond: X, (compiler.misc.no.unique.maximal.instance.exists: X, java.lang.String,java.lang.Number)
Neg02.java:26:21: compiler.err.cant.resolve.location.args: kindname.constructor, Foo, , java.lang.String, kindname.class, Neg02.Foo<java.lang.Number>
Neg02.java:26:34: compiler.err.cant.resolve.location.args: kindname.constructor, Foo, , , kindname.class, Neg02.Foo<java.lang.Number>
Neg02.java:27:21: compiler.err.not.within.bounds: ? super java.lang.String
Neg02.java:27:41: compiler.err.cant.apply.diamond: X, (compiler.misc.no.conforming.instance.exists: X, Neg02.Foo<X>, Neg02.Foo<? super java.lang.String>)
Neg02.java:29:13: compiler.err.not.within.bounds: java.lang.String
Neg02.java:29:33: compiler.err.cant.apply.diamond: X, (compiler.misc.no.conforming.instance.exists: X, Neg02.Foo<X>, Neg02.Foo<java.lang.String>)
Neg02.java:30:23: compiler.err.not.within.bounds: ? extends java.lang.String
Neg02.java:30:44: compiler.err.cant.apply.diamond: X, (compiler.misc.no.unique.maximal.instance.exists: X, java.lang.String,java.lang.Number)
Neg02.java:31:22: compiler.err.cant.resolve.location.args: kindname.constructor, Foo, , java.lang.String,java.lang.String, kindname.class, Neg02.Foo<java.lang.Number>
Neg02.java:32:21: compiler.err.not.within.bounds: ? super java.lang.String
Neg02.java:32:42: compiler.err.cant.apply.diamond: X, (compiler.misc.no.conforming.instance.exists: X, Neg02.Foo<X>, Neg02.Foo<? super java.lang.String>)
Neg02.java:34:13: compiler.err.not.within.bounds: java.lang.String
Neg02.java:34:34: compiler.err.cant.apply.diamond: X, (compiler.misc.no.conforming.instance.exists: X, Neg02.Foo<X>, Neg02.Foo<java.lang.String>)
Neg02.java:35:23: compiler.err.not.within.bounds: ? extends java.lang.String
Neg02.java:35:44: compiler.err.cant.apply.diamond: X, (compiler.misc.no.unique.maximal.instance.exists: X, java.lang.String,java.lang.Number)
Neg02.java:36:22: compiler.err.cant.resolve.location.args: kindname.constructor, Foo, , java.lang.String,java.lang.String, kindname.class, Neg02.Foo<java.lang.Number>
Neg02.java:36:39: compiler.err.cant.resolve.location.args: kindname.constructor, Foo, , , kindname.class, Neg02.Foo<java.lang.Number>
Neg02.java:37:21: compiler.err.not.within.bounds: ? super java.lang.String
Neg02.java:37:42: compiler.err.cant.apply.diamond: X, (compiler.misc.no.conforming.instance.exists: X, Neg02.Foo<X>, Neg02.Foo<? super java.lang.String>)
Neg02.java:41:13: compiler.err.not.within.bounds: java.lang.String
Neg02.java:41:39: compiler.err.cant.apply.diamond: X, (compiler.misc.no.conforming.instance.exists: X, Neg02.Foo<X>, Neg02.Foo<java.lang.String>)
Neg02.java:42:23: compiler.err.not.within.bounds: ? extends java.lang.String
Neg02.java:42:49: compiler.err.cant.apply.diamond: X, (compiler.misc.no.unique.maximal.instance.exists: X, java.lang.String,java.lang.Number)
Neg02.java:43:21: compiler.err.cant.resolve.location.args: kindname.constructor, Foo, , java.lang.String, kindname.class, Neg02.Foo<java.lang.Number>
Neg02.java:44:21: compiler.err.not.within.bounds: ? super java.lang.String
Neg02.java:44:47: compiler.err.cant.apply.diamond: X, (compiler.misc.no.conforming.instance.exists: X, Neg02.Foo<X>, Neg02.Foo<? super java.lang.String>)
Neg02.java:46:13: compiler.err.not.within.bounds: java.lang.String
Neg02.java:46:39: compiler.err.cant.apply.diamond: X, (compiler.misc.no.conforming.instance.exists: X, Neg02.Foo<X>, Neg02.Foo<java.lang.String>)
Neg02.java:47:23: compiler.err.not.within.bounds: ? extends java.lang.String
Neg02.java:47:49: compiler.err.cant.apply.diamond: X, (compiler.misc.no.unique.maximal.instance.exists: X, java.lang.String,java.lang.Number)
Neg02.java:48:21: compiler.err.cant.resolve.location.args: kindname.constructor, Foo, , java.lang.String, kindname.class, Neg02.Foo<java.lang.Number>
Neg02.java:48:40: compiler.err.cant.resolve.location.args: kindname.constructor, Foo, , , kindname.class, Neg02.Foo<java.lang.Number>
Neg02.java:49:21: compiler.err.not.within.bounds: ? super java.lang.String
Neg02.java:49:47: compiler.err.cant.apply.diamond: X, (compiler.misc.no.conforming.instance.exists: X, Neg02.Foo<X>, Neg02.Foo<? super java.lang.String>)
Neg02.java:51:13: compiler.err.not.within.bounds: java.lang.String
Neg02.java:51:39: compiler.err.cant.apply.diamond: X, (compiler.misc.no.conforming.instance.exists: X, Neg02.Foo<X>, Neg02.Foo<java.lang.String>)
Neg02.java:52:23: compiler.err.not.within.bounds: ? extends java.lang.String
Neg02.java:52:50: compiler.err.cant.apply.diamond: X, (compiler.misc.no.unique.maximal.instance.exists: X, java.lang.String,java.lang.Number)
Neg02.java:53:22: compiler.err.cant.resolve.location.args: kindname.constructor, Foo, , java.lang.String,java.lang.String, kindname.class, Neg02.Foo<java.lang.Number>
Neg02.java:54:21: compiler.err.not.within.bounds: ? super java.lang.String
Neg02.java:54:48: compiler.err.cant.apply.diamond: X, (compiler.misc.no.conforming.instance.exists: X, Neg02.Foo<X>, Neg02.Foo<? super java.lang.String>)
Neg02.java:56:13: compiler.err.not.within.bounds: java.lang.String
Neg02.java:56:40: compiler.err.cant.apply.diamond: X, (compiler.misc.no.conforming.instance.exists: X, Neg02.Foo<X>, Neg02.Foo<java.lang.String>)
Neg02.java:57:23: compiler.err.not.within.bounds: ? extends java.lang.String
Neg02.java:57:50: compiler.err.cant.apply.diamond: X, (compiler.misc.no.unique.maximal.instance.exists: X, java.lang.String,java.lang.Number)
Neg02.java:58:22: compiler.err.cant.resolve.location.args: kindname.constructor, Foo, , java.lang.String,java.lang.String, kindname.class, Neg02.Foo<java.lang.Number>
Neg02.java:58:45: compiler.err.cant.resolve.location.args: kindname.constructor, Foo, , , kindname.class, Neg02.Foo<java.lang.Number>
Neg02.java:59:21: compiler.err.not.within.bounds: ? super java.lang.String
Neg02.java:59:48: compiler.err.cant.apply.diamond: X, (compiler.misc.no.conforming.instance.exists: X, Neg02.Foo<X>, Neg02.Foo<? super java.lang.String>)
60 errors

@ -0,0 +1,83 @@
/*
* @test /nodynamiccopyright/
* @bug 6840638
*
* @summary Project Coin: Improved Type Inference for Generic Instance Creation (aka 'diamond')
* @author mcimadamore
* @compile/fail/ref=Neg03.out Neg03.java -source 1.7 -XDrawDiagnostics
*
*/
class Neg03<U> {
class Foo<V extends Number> {
Foo(V x) {}
<Z> Foo(V x, Z z) {}
}
void testSimple() {
Foo<String> f1 = new Foo<>(""); //new Foo<Integer> created
Foo<? extends String> f2 = new Foo<>(""); //new Foo<Integer> created
Foo<?> f3 = new Foo<>(""); //new Foo<Object> created
Foo<? super String> f4 = new Foo<>(""); //new Foo<Object> created
Foo<String> f5 = new Foo<>(""){}; //new Foo<Integer> created
Foo<? extends String> f6 = new Foo<>(""){}; //new Foo<Integer> created
Foo<?> f7 = new Foo<>(""){}; //new Foo<Object> created
Foo<? super String> f8 = new Foo<>(""){}; //new Foo<Object> created
Foo<String> f9 = new Foo<>("", ""); //new Foo<Integer> created
Foo<? extends String> f10 = new Foo<>("", ""); //new Foo<Integer> created
Foo<?> f11 = new Foo<>("", ""); //new Foo<Object> created
Foo<? super String> f12 = new Foo<>("", ""); //new Foo<Object> created
Foo<String> f13 = new Foo<>("", ""){}; //new Foo<Integer> created
Foo<? extends String> f14 = new Foo<>("", ""){}; //new Foo<Integer> created
Foo<?> f15 = new Foo<>("", ""){}; //new Foo<Object> created
Foo<? super String> f16 = new Foo<>("", ""){}; //new Foo<Object> created
}
void testQualified_1() {
Foo<String> f1 = new Neg03<U>.Foo<>(""); //new Foo<Integer> created
Foo<? extends String> f2 = new Neg03<U>.Foo<>(""); //new Foo<Integer> created
Foo<?> f3 = new Neg03<U>.Foo<>(""); //new Foo<Object> created
Foo<? super String> f4 = new Neg03<U>.Foo<>(""); //new Foo<Object> created
Foo<String> f5 = new Neg03<U>.Foo<>(""){}; //new Foo<Integer> created
Foo<? extends String> f6 = new Neg03<U>.Foo<>(""){}; //new Foo<Integer> created
Foo<?> f7 = new Neg03<U>.Foo<>(""){}; //new Foo<Object> created
Foo<? super String> f8 = new Neg03<U>.Foo<>(""){}; //new Foo<Object> created
Foo<String> f9 = new Neg03<U>.Foo<>("", ""); //new Foo<Integer> created
Foo<? extends String> f10 = new Neg03<U>.Foo<>("", ""); //new Foo<Integer> created
Foo<?> f11 = new Neg03<U>.Foo<>("", ""); //new Foo<Object> created
Foo<? super String> f12 = new Neg03<U>.Foo<>("", ""); //new Foo<Object> created
Foo<String> f13 = new Neg03<U>.Foo<>("", ""){}; //new Foo<Integer> created
Foo<? extends String> f14 = new Neg03<U>.Foo<>("", ""){}; //new Foo<Integer> created
Foo<?> f15 = new Neg03<U>.Foo<>("", ""){}; //new Foo<Object> created
Foo<? super String> f16 = new Neg03<U>.Foo<>("", ""){}; //new Foo<Object> created
}
void testQualified_2(Neg03<U> n) {
Foo<String> f1 = n.new Foo<>(""); //new Foo<Integer> created
Foo<? extends String> f2 = n.new Foo<>(""); //new Foo<Integer> created
Foo<?> f3 = n.new Foo<>(""); //new Foo<Integer> created
Foo<? super String> f4 = n.new Foo<>(""); //new Foo<Integer> created
Foo<String> f5 = n.new Foo<>(""){}; //new Foo<Integer> created
Foo<? extends String> f6 = n.new Foo<>(""){}; //new Foo<Integer> created
Foo<?> f7 = n.new Foo<>(""){}; //new Foo<Integer> created
Foo<? super String> f8 = n.new Foo<>(""){}; //new Foo<Integer> created
Foo<String> f9 = n.new Foo<>("", ""); //new Foo<Integer> created
Foo<? extends String> f10 = n.new Foo<>("", ""); //new Foo<Integer> created
Foo<?> f11 = n.new Foo<>("", ""); //new Foo<Integer> created
Foo<? super String> f12 = n.new Foo<>("", ""); //new Foo<Integer> created
Foo<String> f13 = n.new Foo<>("", ""){}; //new Foo<Integer> created
Foo<? extends String> f14 = n.new Foo<>("", ""){}; //new Foo<Integer> created
Foo<?> f15 = n.new Foo<>("", ""){}; //new Foo<Integer> created
Foo<? super String> f16 = n.new Foo<>("", ""){}; //new Foo<Integer> created
}
}

@ -0,0 +1,91 @@
Neg03.java:19:13: compiler.err.not.within.bounds: java.lang.String
Neg03.java:19:33: compiler.err.cant.apply.diamond: V, (compiler.misc.no.conforming.instance.exists: V, Neg03<U>.Foo<V>, Neg03<U>.Foo<java.lang.String>)
Neg03.java:20:23: compiler.err.not.within.bounds: ? extends java.lang.String
Neg03.java:20:43: compiler.err.cant.apply.diamond: V, (compiler.misc.no.unique.maximal.instance.exists: V, java.lang.String,java.lang.Number)
Neg03.java:21:21: compiler.err.cant.resolve.location.args: kindname.constructor, Foo, , java.lang.String, kindname.class, Neg03<U>.Foo<java.lang.Number>
Neg03.java:22:21: compiler.err.not.within.bounds: ? super java.lang.String
Neg03.java:22:41: compiler.err.cant.apply.diamond: V, (compiler.misc.no.conforming.instance.exists: V, Neg03<U>.Foo<V>, Neg03<U>.Foo<? super java.lang.String>)
Neg03.java:24:13: compiler.err.not.within.bounds: java.lang.String
Neg03.java:24:33: compiler.err.cant.apply.diamond: V, (compiler.misc.no.conforming.instance.exists: V, Neg03<U>.Foo<V>, Neg03<U>.Foo<java.lang.String>)
Neg03.java:25:23: compiler.err.not.within.bounds: ? extends java.lang.String
Neg03.java:25:43: compiler.err.cant.apply.diamond: V, (compiler.misc.no.unique.maximal.instance.exists: V, java.lang.String,java.lang.Number)
Neg03.java:26:21: compiler.err.cant.resolve.location.args: kindname.constructor, Foo, , java.lang.String, kindname.class, Neg03<U>.Foo<java.lang.Number>
Neg03.java:26:34: compiler.err.cant.resolve.location.args: kindname.constructor, Foo, , , kindname.class, Neg03<U>.Foo<java.lang.Number>
Neg03.java:27:21: compiler.err.not.within.bounds: ? super java.lang.String
Neg03.java:27:41: compiler.err.cant.apply.diamond: V, (compiler.misc.no.conforming.instance.exists: V, Neg03<U>.Foo<V>, Neg03<U>.Foo<? super java.lang.String>)
Neg03.java:29:13: compiler.err.not.within.bounds: java.lang.String
Neg03.java:29:33: compiler.err.cant.apply.diamond: V, (compiler.misc.no.conforming.instance.exists: V, Neg03<U>.Foo<V>, Neg03<U>.Foo<java.lang.String>)
Neg03.java:30:23: compiler.err.not.within.bounds: ? extends java.lang.String
Neg03.java:30:44: compiler.err.cant.apply.diamond: V, (compiler.misc.no.unique.maximal.instance.exists: V, java.lang.String,java.lang.Number)
Neg03.java:31:22: compiler.err.cant.resolve.location.args: kindname.constructor, Foo, , java.lang.String,java.lang.String, kindname.class, Neg03<U>.Foo<java.lang.Number>
Neg03.java:32:21: compiler.err.not.within.bounds: ? super java.lang.String
Neg03.java:32:42: compiler.err.cant.apply.diamond: V, (compiler.misc.no.conforming.instance.exists: V, Neg03<U>.Foo<V>, Neg03<U>.Foo<? super java.lang.String>)
Neg03.java:34:13: compiler.err.not.within.bounds: java.lang.String
Neg03.java:34:34: compiler.err.cant.apply.diamond: V, (compiler.misc.no.conforming.instance.exists: V, Neg03<U>.Foo<V>, Neg03<U>.Foo<java.lang.String>)
Neg03.java:35:23: compiler.err.not.within.bounds: ? extends java.lang.String
Neg03.java:35:44: compiler.err.cant.apply.diamond: V, (compiler.misc.no.unique.maximal.instance.exists: V, java.lang.String,java.lang.Number)
Neg03.java:36:22: compiler.err.cant.resolve.location.args: kindname.constructor, Foo, , java.lang.String,java.lang.String, kindname.class, Neg03<U>.Foo<java.lang.Number>
Neg03.java:36:39: compiler.err.cant.resolve.location.args: kindname.constructor, Foo, , , kindname.class, Neg03<U>.Foo<java.lang.Number>
Neg03.java:37:21: compiler.err.not.within.bounds: ? super java.lang.String
Neg03.java:37:42: compiler.err.cant.apply.diamond: V, (compiler.misc.no.conforming.instance.exists: V, Neg03<U>.Foo<V>, Neg03<U>.Foo<? super java.lang.String>)
Neg03.java:41:13: compiler.err.not.within.bounds: java.lang.String
Neg03.java:41:42: compiler.err.cant.apply.diamond: V, (compiler.misc.no.conforming.instance.exists: V, Neg03<U>.Foo<V>, Neg03<U>.Foo<java.lang.String>)
Neg03.java:42:23: compiler.err.not.within.bounds: ? extends java.lang.String
Neg03.java:42:52: compiler.err.cant.apply.diamond: V, (compiler.misc.no.unique.maximal.instance.exists: V, java.lang.String,java.lang.Number)
Neg03.java:43:21: compiler.err.cant.resolve.location.args: kindname.constructor, Foo, , java.lang.String, kindname.class, Neg03<U>.Foo<java.lang.Number>
Neg03.java:44:21: compiler.err.not.within.bounds: ? super java.lang.String
Neg03.java:44:50: compiler.err.cant.apply.diamond: V, (compiler.misc.no.conforming.instance.exists: V, Neg03<U>.Foo<V>, Neg03<U>.Foo<? super java.lang.String>)
Neg03.java:46:13: compiler.err.not.within.bounds: java.lang.String
Neg03.java:46:42: compiler.err.cant.apply.diamond: V, (compiler.misc.no.conforming.instance.exists: V, Neg03<U>.Foo<V>, Neg03<U>.Foo<java.lang.String>)
Neg03.java:47:23: compiler.err.not.within.bounds: ? extends java.lang.String
Neg03.java:47:52: compiler.err.cant.apply.diamond: V, (compiler.misc.no.unique.maximal.instance.exists: V, java.lang.String,java.lang.Number)
Neg03.java:48:21: compiler.err.cant.resolve.location.args: kindname.constructor, Foo, , java.lang.String, kindname.class, Neg03<U>.Foo<java.lang.Number>
Neg03.java:48:43: compiler.err.cant.resolve.location.args: kindname.constructor, Foo, , , kindname.class, Neg03<U>.Foo<java.lang.Number>
Neg03.java:49:21: compiler.err.not.within.bounds: ? super java.lang.String
Neg03.java:49:50: compiler.err.cant.apply.diamond: V, (compiler.misc.no.conforming.instance.exists: V, Neg03<U>.Foo<V>, Neg03<U>.Foo<? super java.lang.String>)
Neg03.java:51:13: compiler.err.not.within.bounds: java.lang.String
Neg03.java:51:42: compiler.err.cant.apply.diamond: V, (compiler.misc.no.conforming.instance.exists: V, Neg03<U>.Foo<V>, Neg03<U>.Foo<java.lang.String>)
Neg03.java:52:23: compiler.err.not.within.bounds: ? extends java.lang.String
Neg03.java:52:53: compiler.err.cant.apply.diamond: V, (compiler.misc.no.unique.maximal.instance.exists: V, java.lang.String,java.lang.Number)
Neg03.java:53:22: compiler.err.cant.resolve.location.args: kindname.constructor, Foo, , java.lang.String,java.lang.String, kindname.class, Neg03<U>.Foo<java.lang.Number>
Neg03.java:54:21: compiler.err.not.within.bounds: ? super java.lang.String
Neg03.java:54:51: compiler.err.cant.apply.diamond: V, (compiler.misc.no.conforming.instance.exists: V, Neg03<U>.Foo<V>, Neg03<U>.Foo<? super java.lang.String>)
Neg03.java:56:13: compiler.err.not.within.bounds: java.lang.String
Neg03.java:56:43: compiler.err.cant.apply.diamond: V, (compiler.misc.no.conforming.instance.exists: V, Neg03<U>.Foo<V>, Neg03<U>.Foo<java.lang.String>)
Neg03.java:57:23: compiler.err.not.within.bounds: ? extends java.lang.String
Neg03.java:57:53: compiler.err.cant.apply.diamond: V, (compiler.misc.no.unique.maximal.instance.exists: V, java.lang.String,java.lang.Number)
Neg03.java:58:22: compiler.err.cant.resolve.location.args: kindname.constructor, Foo, , java.lang.String,java.lang.String, kindname.class, Neg03<U>.Foo<java.lang.Number>
Neg03.java:58:48: compiler.err.cant.resolve.location.args: kindname.constructor, Foo, , , kindname.class, Neg03<U>.Foo<java.lang.Number>
Neg03.java:59:21: compiler.err.not.within.bounds: ? super java.lang.String
Neg03.java:59:51: compiler.err.cant.apply.diamond: V, (compiler.misc.no.conforming.instance.exists: V, Neg03<U>.Foo<V>, Neg03<U>.Foo<? super java.lang.String>)
Neg03.java:63:13: compiler.err.not.within.bounds: java.lang.String
Neg03.java:63:28: compiler.err.cant.apply.diamond: V, (compiler.misc.no.conforming.instance.exists: V, Neg03<U>.Foo<V>, Neg03<U>.Foo<java.lang.String>)
Neg03.java:64:23: compiler.err.not.within.bounds: ? extends java.lang.String
Neg03.java:64:38: compiler.err.cant.apply.diamond: V, (compiler.misc.no.unique.maximal.instance.exists: V, java.lang.String,java.lang.Number)
Neg03.java:65:23: compiler.err.cant.resolve.location.args: kindname.constructor, Foo, , java.lang.String, kindname.class, Neg03<U>.Foo<java.lang.Number>
Neg03.java:66:21: compiler.err.not.within.bounds: ? super java.lang.String
Neg03.java:66:36: compiler.err.cant.apply.diamond: V, (compiler.misc.no.conforming.instance.exists: V, Neg03<U>.Foo<V>, Neg03<U>.Foo<? super java.lang.String>)
Neg03.java:68:13: compiler.err.not.within.bounds: java.lang.String
Neg03.java:68:28: compiler.err.cant.apply.diamond: V, (compiler.misc.no.conforming.instance.exists: V, Neg03<U>.Foo<V>, Neg03<U>.Foo<java.lang.String>)
Neg03.java:69:23: compiler.err.not.within.bounds: ? extends java.lang.String
Neg03.java:69:38: compiler.err.cant.apply.diamond: V, (compiler.misc.no.unique.maximal.instance.exists: V, java.lang.String,java.lang.Number)
Neg03.java:70:23: compiler.err.cant.resolve.location.args: kindname.constructor, Foo, , java.lang.String, kindname.class, Neg03<U>.Foo<java.lang.Number>
Neg03.java:70:36: compiler.err.cant.resolve.location.args: kindname.constructor, Foo, , , kindname.class, Neg03<U>.Foo<java.lang.Number>
Neg03.java:71:21: compiler.err.not.within.bounds: ? super java.lang.String
Neg03.java:71:36: compiler.err.cant.apply.diamond: V, (compiler.misc.no.conforming.instance.exists: V, Neg03<U>.Foo<V>, Neg03<U>.Foo<? super java.lang.String>)
Neg03.java:73:13: compiler.err.not.within.bounds: java.lang.String
Neg03.java:73:28: compiler.err.cant.apply.diamond: V, (compiler.misc.no.conforming.instance.exists: V, Neg03<U>.Foo<V>, Neg03<U>.Foo<java.lang.String>)
Neg03.java:74:23: compiler.err.not.within.bounds: ? extends java.lang.String
Neg03.java:74:39: compiler.err.cant.apply.diamond: V, (compiler.misc.no.unique.maximal.instance.exists: V, java.lang.String,java.lang.Number)
Neg03.java:75:24: compiler.err.cant.resolve.location.args: kindname.constructor, Foo, , java.lang.String,java.lang.String, kindname.class, Neg03<U>.Foo<java.lang.Number>
Neg03.java:76:21: compiler.err.not.within.bounds: ? super java.lang.String
Neg03.java:76:37: compiler.err.cant.apply.diamond: V, (compiler.misc.no.conforming.instance.exists: V, Neg03<U>.Foo<V>, Neg03<U>.Foo<? super java.lang.String>)
Neg03.java:78:13: compiler.err.not.within.bounds: java.lang.String
Neg03.java:78:29: compiler.err.cant.apply.diamond: V, (compiler.misc.no.conforming.instance.exists: V, Neg03<U>.Foo<V>, Neg03<U>.Foo<java.lang.String>)
Neg03.java:79:23: compiler.err.not.within.bounds: ? extends java.lang.String
Neg03.java:79:39: compiler.err.cant.apply.diamond: V, (compiler.misc.no.unique.maximal.instance.exists: V, java.lang.String,java.lang.Number)
Neg03.java:80:24: compiler.err.cant.resolve.location.args: kindname.constructor, Foo, , java.lang.String,java.lang.String, kindname.class, Neg03<U>.Foo<java.lang.Number>
Neg03.java:80:41: compiler.err.cant.resolve.location.args: kindname.constructor, Foo, , , kindname.class, Neg03<U>.Foo<java.lang.Number>
Neg03.java:81:21: compiler.err.not.within.bounds: ? super java.lang.String
Neg03.java:81:37: compiler.err.cant.apply.diamond: V, (compiler.misc.no.conforming.instance.exists: V, Neg03<U>.Foo<V>, Neg03<U>.Foo<? super java.lang.String>)
90 errors

@ -0,0 +1,38 @@
/*
* @test /nodynamiccopyright/
* @bug 6840638
*
* @summary Project Coin: Improved Type Inference for Generic Instance Creation (aka 'diamond')
* @author mcimadamore
* @compile/fail/ref=Neg04.out Neg04.java -source 1.7 -XDrawDiagnostics
*
*/
class Neg04 {
void test() {
class Foo<V extends Number> {
Foo(V x) {}
<Z> Foo(V x, Z z) {}
}
Foo<String> n1 = new Foo<>(""); //new Foo<Integer> created
Foo<? extends String> n2 = new Foo<>(""); //new Foo<Integer> created
Foo<?> n3 = new Foo<>(""); //new Foo<Object> created
Foo<? super String> n4 = new Foo<>(""); //new Foo<Object> created
Foo<String> n5 = new Foo<>(""){}; //new Foo<Integer> created
Foo<? extends String> n6 = new Foo<>(""){}; //new Foo<Integer> created
Foo<?> n7 = new Foo<>(""){}; //new Foo<Object> created
Foo<? super String> n8 = new Foo<>(""){}; //new Foo<Object> created
Foo<String> n9 = new Foo<>("", ""); //new Foo<Integer> created
Foo<? extends String> n10 = new Foo<>("", ""); //new Foo<Integer> created
Foo<?> n11 = new Foo<>("", ""); //new Foo<Object> created
Foo<? super String> n12 = new Foo<>("", ""); //new Foo<Object> created
Foo<String> n13 = new Foo<>("", ""){}; //new Foo<Integer> created
Foo<? extends String> n14 = new Foo<>("", ""){}; //new Foo<Integer> created
Foo<?> n15 = new Foo<>("", ""){}; //new Foo<Object> created
Foo<? super String> n16 = new Foo<>("", ""){}; //new Foo<Object> created
}
}

@ -0,0 +1,31 @@
Neg04.java:18:13: compiler.err.not.within.bounds: java.lang.String
Neg04.java:18:33: compiler.err.cant.apply.diamond: V, (compiler.misc.no.conforming.instance.exists: V, Foo<V>, Foo<java.lang.String>)
Neg04.java:19:23: compiler.err.not.within.bounds: ? extends java.lang.String
Neg04.java:19:43: compiler.err.cant.apply.diamond: V, (compiler.misc.no.unique.maximal.instance.exists: V, java.lang.String,java.lang.Number)
Neg04.java:20:21: compiler.err.cant.resolve.location.args: kindname.constructor, Foo, , java.lang.String, kindname.class, Foo<java.lang.Number>
Neg04.java:21:21: compiler.err.not.within.bounds: ? super java.lang.String
Neg04.java:21:41: compiler.err.cant.apply.diamond: V, (compiler.misc.no.conforming.instance.exists: V, Foo<V>, Foo<? super java.lang.String>)
Neg04.java:23:13: compiler.err.not.within.bounds: java.lang.String
Neg04.java:23:33: compiler.err.cant.apply.diamond: V, (compiler.misc.no.conforming.instance.exists: V, Foo<V>, Foo<java.lang.String>)
Neg04.java:24:23: compiler.err.not.within.bounds: ? extends java.lang.String
Neg04.java:24:43: compiler.err.cant.apply.diamond: V, (compiler.misc.no.unique.maximal.instance.exists: V, java.lang.String,java.lang.Number)
Neg04.java:25:21: compiler.err.cant.resolve.location.args: kindname.constructor, Foo, , java.lang.String, kindname.class, Foo<java.lang.Number>
Neg04.java:25:34: compiler.err.cant.resolve.location.args: kindname.constructor, Foo, , , kindname.class, Foo<java.lang.Number>
Neg04.java:26:21: compiler.err.not.within.bounds: ? super java.lang.String
Neg04.java:26:41: compiler.err.cant.apply.diamond: V, (compiler.misc.no.conforming.instance.exists: V, Foo<V>, Foo<? super java.lang.String>)
Neg04.java:28:13: compiler.err.not.within.bounds: java.lang.String
Neg04.java:28:33: compiler.err.cant.apply.diamond: V, (compiler.misc.no.conforming.instance.exists: V, Foo<V>, Foo<java.lang.String>)
Neg04.java:29:23: compiler.err.not.within.bounds: ? extends java.lang.String
Neg04.java:29:44: compiler.err.cant.apply.diamond: V, (compiler.misc.no.unique.maximal.instance.exists: V, java.lang.String,java.lang.Number)
Neg04.java:30:22: compiler.err.cant.resolve.location.args: kindname.constructor, Foo, , java.lang.String,java.lang.String, kindname.class, Foo<java.lang.Number>
Neg04.java:31:21: compiler.err.not.within.bounds: ? super java.lang.String
Neg04.java:31:42: compiler.err.cant.apply.diamond: V, (compiler.misc.no.conforming.instance.exists: V, Foo<V>, Foo<? super java.lang.String>)
Neg04.java:33:13: compiler.err.not.within.bounds: java.lang.String
Neg04.java:33:34: compiler.err.cant.apply.diamond: V, (compiler.misc.no.conforming.instance.exists: V, Foo<V>, Foo<java.lang.String>)
Neg04.java:34:23: compiler.err.not.within.bounds: ? extends java.lang.String
Neg04.java:34:44: compiler.err.cant.apply.diamond: V, (compiler.misc.no.unique.maximal.instance.exists: V, java.lang.String,java.lang.Number)
Neg04.java:35:22: compiler.err.cant.resolve.location.args: kindname.constructor, Foo, , java.lang.String,java.lang.String, kindname.class, Foo<java.lang.Number>
Neg04.java:35:39: compiler.err.cant.resolve.location.args: kindname.constructor, Foo, , , kindname.class, Foo<java.lang.Number>
Neg04.java:36:21: compiler.err.not.within.bounds: ? super java.lang.String
Neg04.java:36:42: compiler.err.cant.apply.diamond: V, (compiler.misc.no.conforming.instance.exists: V, Foo<V>, Foo<? super java.lang.String>)
30 errors

@ -0,0 +1,61 @@
/*
* @test /nodynamiccopyright/
* @bug 6840638
*
* @summary Project Coin: Improved Type Inference for Generic Instance Creation (aka 'diamond')
* @author mcimadamore
* @compile/fail/ref=Neg05.out Neg05.java -source 1.7 -XDrawDiagnostics
*
*/
class Neg05<U> {
class Foo<V> {
Foo(V x) {}
<Z> Foo(V x, Z z) {}
}
void testRare_1() {
Neg05<?>.Foo<String> f1 = new Neg05.Foo<>(""); //new Foo<Integer> created
Neg05<?>.Foo<? extends String> f2 = new Neg05.Foo<>(""); //new Foo<Integer> created
Neg05<?>.Foo<?> f3 = new Neg05.Foo<>(""); //new Foo<Object> created
Neg05<?>.Foo<? super String> f4 = new Neg05.Foo<>(""); //new Foo<Object> created
Neg05<?>.Foo<String> f5 = new Neg05.Foo<>(""){}; //new Foo<Integer> created
Neg05<?>.Foo<? extends String> f6 = new Neg05.Foo<>(""){}; //new Foo<Integer> created
Neg05<?>.Foo<?> f7 = new Neg05.Foo<>(""){}; //new Foo<Object> created
Neg05<?>.Foo<? super String> f8 = new Neg05.Foo<>(""){}; //new Foo<Object> created
Neg05<?>.Foo<String> f9 = new Neg05.Foo<>("", ""); //new Foo<Integer> created
Neg05<?>.Foo<? extends String> f10 = new Neg05.Foo<>("", ""); //new Foo<Integer> created
Neg05<?>.Foo<?> f11 = new Neg05.Foo<>("", ""); //new Foo<Object> created
Neg05<?>.Foo<? super String> f12 = new Neg05.Foo<>("", ""); //new Foo<Object> created
Neg05<?>.Foo<String> f13 = new Neg05.Foo<>("", ""){}; //new Foo<Integer> created
Neg05<?>.Foo<? extends String> f14 = new Neg05.Foo<>("", ""){}; //new Foo<Integer> created
Neg05<?>.Foo<?> f15 = new Neg05.Foo<>("", ""){}; //new Foo<Object> created
Neg05<?>.Foo<? super String> f16 = new Neg05.Foo<>("", ""){}; //new Foo<Object> created
}
void testRare_2(Neg05 n) {
Neg05<?>.Foo<String> f1 = n.new Foo<>(""); //new Foo<Integer> created
Neg05<?>.Foo<? extends String> f2 = n.new Foo<>(""); //new Foo<Integer> created
Neg05<?>.Foo<?> f3 = n.new Foo<>(""); //new Foo<Integer> created
Neg05<?>.Foo<? super String> f4 = n.new Foo<>(""); //new Foo<Integer> created
Neg05<?>.Foo<String> f5 = n.new Foo<>(""){}; //new Foo<Integer> created
Neg05<?>.Foo<? extends String> f6 = n.new Foo<>(""){}; //new Foo<Integer> created
Neg05<?>.Foo<?> f7 = n.new Foo<>(""){}; //new Foo<Integer> created
Neg05<?>.Foo<? super String> f8 = n.new Foo<>(""){}; //new Foo<Integer> created
Neg05<?>.Foo<String> f9 = n.new Foo<>("", ""); //new Foo<Integer> created
Neg05<?>.Foo<? extends String> f10 = n.new Foo<>("", ""); //new Foo<Integer> created
Neg05<?>.Foo<?> f11 = n.new Foo<>("", ""); //new Foo<Integer> created
Neg05<?>.Foo<? super String> f12 = n.new Foo<>("", ""); //new Foo<Integer> created
Neg05<?>.Foo<String> f13 = n.new Foo<>("", ""){}; //new Foo<Integer> created
Neg05<?>.Foo<? extends String> f14 = n.new Foo<>("", ""){}; //new Foo<Integer> created
Neg05<?>.Foo<?> f15 = n.new Foo<>("", ""){}; //new Foo<Integer> created
Neg05<?>.Foo<? super String> f16 = n.new Foo<>("", ""){}; //new Foo<Integer> created
}
}

@ -0,0 +1,33 @@
Neg05.java:19:48: compiler.err.improperly.formed.type.inner.raw.param
Neg05.java:20:58: compiler.err.improperly.formed.type.inner.raw.param
Neg05.java:21:43: compiler.err.improperly.formed.type.inner.raw.param
Neg05.java:22:56: compiler.err.improperly.formed.type.inner.raw.param
Neg05.java:24:48: compiler.err.improperly.formed.type.inner.raw.param
Neg05.java:25:58: compiler.err.improperly.formed.type.inner.raw.param
Neg05.java:26:43: compiler.err.improperly.formed.type.inner.raw.param
Neg05.java:27:56: compiler.err.improperly.formed.type.inner.raw.param
Neg05.java:29:48: compiler.err.improperly.formed.type.inner.raw.param
Neg05.java:30:59: compiler.err.improperly.formed.type.inner.raw.param
Neg05.java:31:44: compiler.err.improperly.formed.type.inner.raw.param
Neg05.java:32:57: compiler.err.improperly.formed.type.inner.raw.param
Neg05.java:34:49: compiler.err.improperly.formed.type.inner.raw.param
Neg05.java:35:59: compiler.err.improperly.formed.type.inner.raw.param
Neg05.java:36:44: compiler.err.improperly.formed.type.inner.raw.param
Neg05.java:37:57: compiler.err.improperly.formed.type.inner.raw.param
Neg05.java:41:37: compiler.err.improperly.formed.type.inner.raw.param
Neg05.java:42:47: compiler.err.improperly.formed.type.inner.raw.param
Neg05.java:43:32: compiler.err.improperly.formed.type.inner.raw.param
Neg05.java:44:45: compiler.err.improperly.formed.type.inner.raw.param
Neg05.java:46:37: compiler.err.improperly.formed.type.inner.raw.param
Neg05.java:47:47: compiler.err.improperly.formed.type.inner.raw.param
Neg05.java:48:32: compiler.err.improperly.formed.type.inner.raw.param
Neg05.java:49:45: compiler.err.improperly.formed.type.inner.raw.param
Neg05.java:51:37: compiler.err.improperly.formed.type.inner.raw.param
Neg05.java:52:48: compiler.err.improperly.formed.type.inner.raw.param
Neg05.java:53:33: compiler.err.improperly.formed.type.inner.raw.param
Neg05.java:54:46: compiler.err.improperly.formed.type.inner.raw.param
Neg05.java:56:38: compiler.err.improperly.formed.type.inner.raw.param
Neg05.java:57:48: compiler.err.improperly.formed.type.inner.raw.param
Neg05.java:58:33: compiler.err.improperly.formed.type.inner.raw.param
Neg05.java:59:46: compiler.err.improperly.formed.type.inner.raw.param
32 errors

@ -0,0 +1,44 @@
/*
* @test /nodynamiccopyright/
* @bug 6840638
*
* @summary Project Coin: Improved Type Inference for Generic Instance Creation (aka 'diamond')
* @author mcimadamore
* @compile Pos01.java -source 1.7
* @run main Pos01
*
*/
public class Pos01<X> {
Pos01(X x) {}
<Z> Pos01(X x, Z z) {}
void test() {
Pos01<Integer> p1 = new Pos01<>(1); //new Foo<Integer> created
Pos01<? extends Integer> p2 = new Pos01<>(1); //new Foo<Integer> created
Pos01<?> p3 = new Pos01<>(1); //new Foo<Object> created
Pos01<? super Integer> p4 = new Pos01<>(1); //new Foo<Object> created
Pos01<Integer> p5 = new Pos01<>(1){}; //new Foo<Integer> created
Pos01<? extends Integer> p6 = new Pos01<>(1){}; //new Foo<Integer> created
Pos01<?> p7 = new Pos01<>(1){}; //new Foo<Object> created
Pos01<? super Integer> p8 = new Pos01<>(1){}; //new Foo<Object> created
Pos01<Integer> p9 = new Pos01<>(1, ""); //new Foo<Integer> created
Pos01<? extends Integer> p10 = new Pos01<>(1, ""); //new Foo<Integer> created
Pos01<?> p11 = new Pos01<>(1, ""); //new Foo<Object> created
Pos01<? super Integer> p12 = new Pos01<>(1, ""); //new Foo<Object> created
Pos01<Integer> p13 = new Pos01<>(1, ""){}; //new Foo<Integer> created
Pos01<? extends Integer> p14= new Pos01<>(1, ""){}; //new Foo<Integer> created
Pos01<?> p15 = new Pos01<>(1, ""){}; //new Foo<Object> created
Pos01<? super Integer> p16 = new Pos01<>(1, ""){}; //new Foo<Object> created
}
public static void main(String[] args) {
Pos01<String> p1 = new Pos01<>("");
p1.test();
}
}

@ -0,0 +1,67 @@
/*
* @test /nodynamiccopyright/
* @bug 6840638
*
* @summary Project Coin: Improved Type Inference for Generic Instance Creation (aka 'diamond')
* @author mcimadamore
* @compile Pos02.java -source 1.7
* @run main Pos02
*/
public class Pos02 {
static class Foo<X> {
Foo(X x) {}
<Z> Foo(X x, Z z) {}
}
void testSimple() {
Foo<Integer> f1 = new Foo<>(1); //new Foo<Integer> created
Foo<? extends Integer> f2 = new Foo<>(1); //new Foo<Integer> created
Foo<?> f3 = new Foo<>(1); //new Foo<Object> created
Foo<? super Integer> f4 = new Foo<>(1); //new Foo<Object> created
Foo<Integer> f5 = new Foo<>(1){}; //new Foo<Integer> created
Foo<? extends Integer> f6 = new Foo<>(1){}; //new Foo<Integer> created
Foo<?> f7 = new Foo<>(1){}; //new Foo<Object> created
Foo<? super Integer> f8 = new Foo<>(1){}; //new Foo<Object> created
Foo<Integer> f9 = new Foo<>(1, ""); //new Foo<Integer> created
Foo<? extends Integer> f10 = new Foo<>(1, ""); //new Foo<Integer> created
Foo<?> f11 = new Foo<>(1, ""); //new Foo<Object> created
Foo<? super Integer> f12 = new Foo<>(1, ""); //new Foo<Object> created
Foo<Integer> f13 = new Foo<>(1, ""){}; //new Foo<Integer> created
Foo<? extends Integer> f14 = new Foo<>(1, ""){}; //new Foo<Integer> created
Foo<?> f15 = new Foo<>(1, ""){}; //new Foo<Object> created
Foo<? super Integer> f16 = new Foo<>(1, ""){}; //new Foo<Object> created
}
void testQualified() {
Foo<Integer> f1 = new Pos02.Foo<>(1); //new Foo<Integer> created
Foo<? extends Integer> f2 = new Pos02.Foo<>(1); //new Foo<Integer> created
Foo<?> f3 = new Pos02.Foo<>(1); //new Foo<Object> created
Foo<? super Integer> f4 = new Pos02.Foo<>(1); //new Foo<Object> created
Foo<Integer> f5 = new Pos02.Foo<>(1){}; //new Foo<Integer> created
Foo<? extends Integer> f6 = new Pos02.Foo<>(1){}; //new Foo<Integer> created
Foo<?> f7 = new Pos02.Foo<>(1){}; //new Foo<Object> created
Foo<? super Integer> f8 = new Pos02.Foo<>(1){}; //new Foo<Object> created
Foo<Integer> f9 = new Pos02.Foo<>(1, ""); //new Foo<Integer> created
Foo<? extends Integer> f10 = new Pos02.Foo<>(1, ""); //new Foo<Integer> created
Foo<?> f11 = new Pos02.Foo<>(1, ""); //new Foo<Object> created
Foo<? super Integer> f12 = new Pos02.Foo<>(1, ""); //new Foo<Object> created
Foo<Integer> f13 = new Pos02.Foo<>(1, ""){}; //new Foo<Integer> created
Foo<? extends Integer> f14 = new Pos02.Foo<>(1, ""){}; //new Foo<Integer> created
Foo<?> f15 = new Pos02.Foo<>(1, ""){}; //new Foo<Object> created
Foo<? super Integer> f16 = new Pos02.Foo<>(1, ""){}; //new Foo<Object> created
}
public static void main(String[] args) {
Pos02 p2 = new Pos02();
p2.testSimple();
p2.testQualified();
}
}

@ -0,0 +1,91 @@
/*
* @test /nodynamiccopyright/
* @bug 6840638
*
* @summary Project Coin: Improved Type Inference for Generic Instance Creation (aka 'diamond')
* @author mcimadamore
* @compile Pos03.java -source 1.7
* @run main Pos03
*
*/
public class Pos03<U> {
class Foo<V> {
Foo(V x) {}
<Z> Foo(V x, Z z) {}
}
void testSimple() {
Foo<Integer> f1 = new Foo<>(1); //new Foo<Integer> created
Foo<? extends Integer> f2 = new Foo<>(1); //new Foo<Integer> created
Foo<?> f3 = new Foo<>(1); //new Foo<Object> created
Foo<? super Integer> f4 = new Foo<>(1); //new Foo<Object> created
Foo<Integer> f5 = new Foo<>(1){}; //new Foo<Integer> created
Foo<? extends Integer> f6 = new Foo<>(1){}; //new Foo<Integer> created
Foo<?> f7 = new Foo<>(1){}; //new Foo<Object> created
Foo<? super Integer> f8 = new Foo<>(1){}; //new Foo<Object> created
Foo<Integer> f9 = new Foo<>(1, ""); //new Foo<Integer> created
Foo<? extends Integer> f10 = new Foo<>(1, ""); //new Foo<Integer> created
Foo<?> f11 = new Foo<>(1, ""); //new Foo<Object> created
Foo<? super Integer> f12 = new Foo<>(1, ""); //new Foo<Object> created
Foo<Integer> f13 = new Foo<>(1, ""){}; //new Foo<Integer> created
Foo<? extends Integer> f14 = new Foo<>(1, ""){}; //new Foo<Integer> created
Foo<?> f15 = new Foo<>(1, ""){}; //new Foo<Object> created
Foo<? super Integer> f16 = new Foo<>(1, ""){}; //new Foo<Object> created
}
void testQualified_1() {
Foo<Integer> f1 = new Pos03<U>.Foo<>(1); //new Foo<Integer> created
Foo<? extends Integer> f2 = new Pos03<U>.Foo<>(1); //new Foo<Integer> created
Foo<?> f3 = new Pos03<U>.Foo<>(1); //new Foo<Object> created
Foo<? super Integer> f4 = new Pos03<U>.Foo<>(1); //new Foo<Object> created
Foo<Integer> f5 = new Pos03<U>.Foo<>(1){}; //new Foo<Integer> created
Foo<? extends Integer> f6 = new Pos03<U>.Foo<>(1){}; //new Foo<Integer> created
Foo<?> f7 = new Pos03<U>.Foo<>(1){}; //new Foo<Object> created
Foo<? super Integer> f8 = new Pos03<U>.Foo<>(1){}; //new Foo<Object> created
Foo<Integer> f9 = new Pos03<U>.Foo<>(1, ""); //new Foo<Integer> created
Foo<? extends Integer> f10 = new Pos03<U>.Foo<>(1, ""); //new Foo<Integer> created
Foo<?> f11 = new Pos03<U>.Foo<>(1, ""); //new Foo<Object> created
Foo<? super Integer> f12 = new Pos03<U>.Foo<>(1, ""); //new Foo<Object> created
Foo<Integer> f13 = new Pos03<U>.Foo<>(1, ""){}; //new Foo<Integer> created
Foo<? extends Integer> f14 = new Pos03<U>.Foo<>(1, ""){}; //new Foo<Integer> created
Foo<?> f15 = new Pos03<U>.Foo<>(1, ""){}; //new Foo<Object> created
Foo<? super Integer> f16 = new Pos03<U>.Foo<>(1, ""){}; //new Foo<Object> created
}
void testQualified_2(Pos03<U> p) {
Foo<Integer> f1 = p.new Foo<>(1); //new Foo<Integer> created
Foo<? extends Integer> f2 = p.new Foo<>(1); //new Foo<Integer> created
Foo<?> f3 = p.new Foo<>(1); //new Foo<Object> created
Foo<? super Integer> f4 = p.new Foo<>(1); //new Foo<Object> created
Foo<Integer> f5 = p.new Foo<>(1){}; //new Foo<Integer> created
Foo<? extends Integer> f6 = p.new Foo<>(1){}; //new Foo<Integer> created
Foo<?> f7 = p.new Foo<>(1){}; //new Foo<Object> created
Foo<? super Integer> f8 = p.new Foo<>(1){}; //new Foo<Object> created
Foo<Integer> f9 = p.new Foo<>(1, ""); //new Foo<Integer> created
Foo<? extends Integer> f10 = p.new Foo<>(1, ""); //new Foo<Integer> created
Foo<?> f11 = p.new Foo<>(1, ""); //new Foo<Object> created
Foo<? super Integer> f12 = p.new Foo<>(1, ""); //new Foo<Object> created
Foo<Integer> f13 = p.new Foo<>(1, ""){}; //new Foo<Integer> created
Foo<? extends Integer> f14 = p.new Foo<>(1, ""){}; //new Foo<Integer> created
Foo<?> f15 = p.new Foo<>(1, ""){}; //new Foo<Object> created
Foo<? super Integer> f16 = p.new Foo<>(1, ""){}; //new Foo<Object> created
}
public static void main(String[] args) {
Pos03<String> p3 = new Pos03<>();
p3.testSimple();
p3.testQualified_1();
p3.testQualified_2(p3);
}
}

@ -0,0 +1,44 @@
/*
* @test /nodynamiccopyright/
* @bug 6840638
*
* @summary Project Coin: Improved Type Inference for Generic Instance Creation (aka 'diamond')
* @author mcimadamore
* @compile Pos04.java -source 1.7
* @run main Pos04
*
*/
public class Pos04<U> {
void test() {
class Foo<V> {
Foo(V x) {}
<Z> Foo(V x, Z z) {}
}
Foo<Integer> p1 = new Foo<>(1); //new Foo<Integer> created
Foo<? extends Integer> p2 = new Foo<>(1); //new Foo<Integer> created
Foo<?> p3 = new Foo<>(1); //new Foo<Object> created
Foo<? super Integer> p4 = new Foo<>(1); //new Foo<Object> created
Foo<Integer> p5 = new Foo<>(1){}; //new Foo<Integer> created
Foo<? extends Integer> p6 = new Foo<>(1){}; //new Foo<Integer> created
Foo<?> p7 = new Foo<>(1){}; //new Foo<Object> created
Foo<? super Integer> p8 = new Foo<>(1){}; //new Foo<Object> created
Foo<Integer> p9 = new Foo<>(1, ""); //new Foo<Integer> created
Foo<? extends Integer> p10 = new Foo<>(1, ""); //new Foo<Integer> created
Foo<?> p11 = new Foo<>(1, ""); //new Foo<Object> created
Foo<? super Integer> p12 = new Foo<>(1, ""); //new Foo<Object> created
Foo<Integer> p13 = new Foo<>(1, ""){}; //new Foo<Integer> created
Foo<? extends Integer> p14 = new Foo<>(1, ""){}; //new Foo<Integer> created
Foo<?> p15 = new Foo<>(1, ""){}; //new Foo<Object> created
Foo<? super Integer> p16 = new Foo<>(1, ""){}; //new Foo<Object> created
}
public static void main(String[] args) {
Pos04<String> p4 = new Pos04<>();
p4.test();
}
}

@ -1,28 +1,5 @@
/*
* Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
/**
* @test
* @test /nodynamiccopyright/
* @bug 6315770
* @summary javac inference allows creation of strange types: Integer & Runnable
* @author Maurizio Cimadamore

Some files were not shown because too many files have changed in this diff Show More