< prev index next >
src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java
Print this page
*** 234,244 ****
/** Warn about unsafe vararg method decl.
* @param pos Position to be used for error reporting.
*/
void warnUnsafeVararg(DiagnosticPosition pos, Warning warnKey) {
! if (lint.isEnabled(LintCategory.VARARGS) && Feature.SIMPLIFIED_VARARGS.allowedInSource(source))
log.warning(LintCategory.VARARGS, pos, warnKey);
}
public void warnStatic(DiagnosticPosition pos, Warning warnKey) {
if (lint.isEnabled(LintCategory.STATIC))
--- 234,244 ----
/** Warn about unsafe vararg method decl.
* @param pos Position to be used for error reporting.
*/
void warnUnsafeVararg(DiagnosticPosition pos, Warning warnKey) {
! if (lint.isEnabled(LintCategory.VARARGS))
log.warning(LintCategory.VARARGS, pos, warnKey);
}
public void warnStatic(DiagnosticPosition pos, Warning warnKey) {
if (lint.isEnabled(LintCategory.STATIC))
*** 884,894 ****
}
};
void checkVarargsMethodDecl(Env<AttrContext> env, JCMethodDecl tree) {
MethodSymbol m = tree.sym;
- if (!Feature.SIMPLIFIED_VARARGS.allowedInSource(source)) return;
boolean hasTrustMeAnno = m.attribute(syms.trustMeType.tsym) != null;
Type varargElemType = null;
if (m.isVarArgs()) {
varargElemType = types.elemtype(tree.params.last().type);
}
--- 884,893 ----
*** 996,1015 ****
}
}
if (useVarargs) {
Type argtype = owntype.getParameterTypes().last();
if (!types.isReifiable(argtype) &&
! (!Feature.SIMPLIFIED_VARARGS.allowedInSource(source) ||
! sym.baseSymbol().attribute(syms.trustMeType.tsym) == null ||
!isTrustMeAllowedOnMethod(sym))) {
warnUnchecked(env.tree.pos(), Warnings.UncheckedGenericArrayCreation(argtype));
}
TreeInfo.setVarargsElement(env.tree, types.elemtype(argtype));
}
- if ((sym.flags() & SIGNATURE_POLYMORPHIC) != 0 && !target.hasMethodHandles()) {
- log.error(env.tree, Errors.BadTargetSigpolyCall(target, Target.JDK1_7));
- }
return owntype;
}
//where
private void assertConvertible(JCTree tree, Type actual, Type formal, Warner warn) {
if (types.isConvertible(actual, formal, warn))
--- 995,1010 ----
}
}
if (useVarargs) {
Type argtype = owntype.getParameterTypes().last();
if (!types.isReifiable(argtype) &&
! (sym.baseSymbol().attribute(syms.trustMeType.tsym) == null ||
!isTrustMeAllowedOnMethod(sym))) {
warnUnchecked(env.tree.pos(), Warnings.UncheckedGenericArrayCreation(argtype));
}
TreeInfo.setVarargsElement(env.tree, types.elemtype(argtype));
}
return owntype;
}
//where
private void assertConvertible(JCTree tree, Type actual, Type formal, Warner warn) {
if (types.isConvertible(actual, formal, warn))
< prev index next >