8148808: javac, remove unused options, step 1
Reviewed-by: mcimadamore, jjg
This commit is contained in:
parent
6c3f2df4bf
commit
286b0caa6c
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2016, Oracle and/or its affiliates. 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
|
||||
@ -217,11 +217,6 @@ public class Lint
|
||||
*/
|
||||
STATIC("static"),
|
||||
|
||||
/**
|
||||
* Warn about proprietary API that may be removed in a future release.
|
||||
*/
|
||||
SUNAPI("sunapi", true),
|
||||
|
||||
/**
|
||||
* Warn about issues relating to use of try blocks (i.e. try-with-resources)
|
||||
*/
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2016, Oracle and/or its affiliates. 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
|
||||
@ -83,7 +83,6 @@ public class Check {
|
||||
private final JCDiagnostic.Factory diags;
|
||||
private boolean warnOnSyntheticConflicts;
|
||||
private boolean suppressAbortOnBadClassFile;
|
||||
private boolean enableSunApiLintControl;
|
||||
private final JavaFileManager fileManager;
|
||||
private final Source source;
|
||||
private final Profile profile;
|
||||
@ -131,10 +130,8 @@ public class Check {
|
||||
allowStrictMethodClashCheck = source.allowStrictMethodClashCheck();
|
||||
allowPrivateSafeVarargs = source.allowPrivateSafeVarargs();
|
||||
allowDiamondWithAnonymousClassCreation = source.allowDiamondWithAnonymousClassCreation();
|
||||
complexInference = options.isSet("complexinference");
|
||||
warnOnSyntheticConflicts = options.isSet("warnOnSyntheticConflicts");
|
||||
suppressAbortOnBadClassFile = options.isSet("suppressAbortOnBadClassFile");
|
||||
enableSunApiLintControl = options.isSet("enableSunApiLintControl");
|
||||
warnOnAccessToSensitiveMembers = options.isSet("warnOnAccessToSensitiveMembers");
|
||||
|
||||
Target target = Target.instance(context);
|
||||
@ -144,14 +141,13 @@ public class Check {
|
||||
|
||||
boolean verboseDeprecated = lint.isEnabled(LintCategory.DEPRECATION);
|
||||
boolean verboseUnchecked = lint.isEnabled(LintCategory.UNCHECKED);
|
||||
boolean verboseSunApi = lint.isEnabled(LintCategory.SUNAPI);
|
||||
boolean enforceMandatoryWarnings = true;
|
||||
|
||||
deprecationHandler = new MandatoryWarningHandler(log, verboseDeprecated,
|
||||
enforceMandatoryWarnings, "deprecated", LintCategory.DEPRECATION);
|
||||
uncheckedHandler = new MandatoryWarningHandler(log, verboseUnchecked,
|
||||
enforceMandatoryWarnings, "unchecked", LintCategory.UNCHECKED);
|
||||
sunApiHandler = new MandatoryWarningHandler(log, verboseSunApi,
|
||||
sunApiHandler = new MandatoryWarningHandler(log, false,
|
||||
enforceMandatoryWarnings, "sunapi", null);
|
||||
|
||||
deferredLintHandler = DeferredLintHandler.instance(context);
|
||||
@ -177,10 +173,6 @@ public class Check {
|
||||
*/
|
||||
boolean allowDiamondWithAnonymousClassCreation;
|
||||
|
||||
/** Switch: -complexinference option set?
|
||||
*/
|
||||
boolean complexInference;
|
||||
|
||||
/** Character for synthetic names
|
||||
*/
|
||||
char syntheticNameChar;
|
||||
@ -248,15 +240,6 @@ public class Check {
|
||||
log.warning(LintCategory.VARARGS, pos, key, args);
|
||||
}
|
||||
|
||||
/** Warn about using proprietary API.
|
||||
* @param pos Position to be used for error reporting.
|
||||
* @param msg A string describing the problem.
|
||||
*/
|
||||
public void warnSunApi(DiagnosticPosition pos, String msg, Object... args) {
|
||||
if (!lint.isSuppressed(LintCategory.SUNAPI))
|
||||
sunApiHandler.report(pos, msg, args);
|
||||
}
|
||||
|
||||
public void warnStatic(DiagnosticPosition pos, String msg, Object... args) {
|
||||
if (lint.isEnabled(LintCategory.STATIC))
|
||||
log.warning(LintCategory.STATIC, pos, msg, args);
|
||||
@ -3226,13 +3209,8 @@ public class Check {
|
||||
|
||||
void checkSunAPI(final DiagnosticPosition pos, final Symbol s) {
|
||||
if ((s.flags() & PROPRIETARY) != 0) {
|
||||
deferredLintHandler.report(new DeferredLintHandler.LintLogger() {
|
||||
public void report() {
|
||||
if (enableSunApiLintControl)
|
||||
warnSunApi(pos, "sun.proprietary", s);
|
||||
else
|
||||
log.mandatoryWarning(pos, "sun.proprietary", s);
|
||||
}
|
||||
deferredLintHandler.report(() -> {
|
||||
log.mandatoryWarning(pos, "sun.proprietary", s);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2016, Oracle and/or its affiliates. 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
|
||||
@ -94,7 +94,6 @@ public class Resolve {
|
||||
public final boolean allowMethodHandles;
|
||||
public final boolean allowFunctionalInterfaceMostSpecific;
|
||||
public final boolean checkVarargsAccessAfterResolution;
|
||||
private final boolean debugResolve;
|
||||
private final boolean compactMethodDiags;
|
||||
final EnumSet<VerboseResolutionMode> verboseResolutionMode;
|
||||
|
||||
@ -120,7 +119,6 @@ public class Resolve {
|
||||
diags = JCDiagnostic.Factory.instance(context);
|
||||
Source source = Source.instance(context);
|
||||
Options options = Options.instance(context);
|
||||
debugResolve = options.isSet("debugresolve");
|
||||
compactMethodDiags = options.isSet(Option.XDIAGS, "compact") ||
|
||||
options.isUnset(Option.XDIAGS) && options.isUnset("rawDiagnostics");
|
||||
verboseResolutionMode = VerboseResolutionMode.getVerboseResolutionMode(options);
|
||||
@ -3897,8 +3895,6 @@ public class Resolve {
|
||||
super(HIDDEN, sym, "access error");
|
||||
this.env = env;
|
||||
this.site = site;
|
||||
if (debugResolve)
|
||||
log.error("proc.messager", sym + " @ " + site + " is inaccessible.");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2016, Oracle and/or its affiliates. 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
|
||||
@ -91,11 +91,6 @@ public class ClassReader {
|
||||
*/
|
||||
boolean verbose;
|
||||
|
||||
/** Switch: check class file for correct minor version, unrecognized
|
||||
* attributes.
|
||||
*/
|
||||
boolean checkClassFile;
|
||||
|
||||
/** Switch: read constant pool and code sections. This switch is initially
|
||||
* set to false but can be turned on from outside.
|
||||
*/
|
||||
@ -230,7 +225,6 @@ public class ClassReader {
|
||||
|
||||
Options options = Options.instance(context);
|
||||
verbose = options.isSet(VERBOSE);
|
||||
checkClassFile = options.isSet("-checkclassfile");
|
||||
|
||||
Source source = Source.instance(context);
|
||||
allowSimplifiedVarargs = source.allowSimplifiedVarargs();
|
||||
@ -1148,15 +1142,6 @@ public class ClassReader {
|
||||
attributeReaders.put(r.name, r);
|
||||
}
|
||||
|
||||
/** Report unrecognized attribute.
|
||||
*/
|
||||
void unrecognized(Name attrName) {
|
||||
if (checkClassFile)
|
||||
printCCF("ccf.unrecognized.attribute", attrName);
|
||||
}
|
||||
|
||||
|
||||
|
||||
protected void readEnclosingMethodAttr(Symbol sym) {
|
||||
// sym is a nested class with an "Enclosing Method" attribute
|
||||
// remove sym from it's current owners scope and place it in
|
||||
@ -1279,7 +1264,6 @@ public class ClassReader {
|
||||
if (r != null && r.accepts(kind))
|
||||
r.read(sym, attrLen);
|
||||
else {
|
||||
unrecognized(attrName);
|
||||
bp = bp + attrLen;
|
||||
}
|
||||
}
|
||||
@ -2315,8 +2299,7 @@ public class ClassReader {
|
||||
int maxMinor = Version.MAX().minor;
|
||||
if (majorVersion > maxMajor ||
|
||||
majorVersion * 1000 + minorVersion <
|
||||
Version.MIN().major * 1000 + Version.MIN().minor)
|
||||
{
|
||||
Version.MIN().major * 1000 + Version.MIN().minor) {
|
||||
if (majorVersion == (maxMajor + 1))
|
||||
log.warning("big.major.version",
|
||||
currentClassFile,
|
||||
@ -2329,13 +2312,7 @@ public class ClassReader {
|
||||
Integer.toString(maxMajor),
|
||||
Integer.toString(maxMinor));
|
||||
}
|
||||
else if (checkClassFile &&
|
||||
majorVersion == maxMajor &&
|
||||
minorVersion > maxMinor)
|
||||
{
|
||||
printCCF("found.later.version",
|
||||
Integer.toString(minorVersion));
|
||||
}
|
||||
|
||||
indexPool();
|
||||
if (signatureBuffer.length < bp) {
|
||||
int ns = Integer.highestOneBit(bp) << 1;
|
||||
@ -2455,14 +2432,6 @@ public class ClassReader {
|
||||
return flags & ~ACC_SUPER; // SUPER and SYNCHRONIZED bits overloaded
|
||||
}
|
||||
|
||||
/** Output for "-checkclassfile" option.
|
||||
* @param key The key to look up the correct internationalized string.
|
||||
* @param arg An argument for substitution into the output string.
|
||||
*/
|
||||
private void printCCF(String key, Object arg) {
|
||||
log.printLines(key, arg);
|
||||
}
|
||||
|
||||
/**
|
||||
* A subclass of JavaFileObject for the sourcefile attribute found in a classfile.
|
||||
* The attribute is only the last component of the original filename, so is unlikely
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2016, Oracle and/or its affiliates. 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
|
||||
@ -373,7 +373,6 @@ public class JavaCompiler {
|
||||
throw new Abort();
|
||||
}
|
||||
source = Source.instance(context);
|
||||
Target target = Target.instance(context);
|
||||
attr = Attr.instance(context);
|
||||
chk = Check.instance(context);
|
||||
gen = Gen.instance(context);
|
||||
@ -393,7 +392,6 @@ public class JavaCompiler {
|
||||
stubOutput = options.isSet("-stubs");
|
||||
relax = options.isSet("-relax");
|
||||
printFlat = options.isSet("-printflat");
|
||||
attrParseOnly = options.isSet("-attrparseonly");
|
||||
encoding = options.get(ENCODING);
|
||||
lineDebugInfo = options.isUnset(G_CUSTOM) ||
|
||||
options.isSet(G_CUSTOM, "lines");
|
||||
@ -405,7 +403,8 @@ public class JavaCompiler {
|
||||
|
||||
verboseCompilePolicy = options.isSet("verboseCompilePolicy");
|
||||
|
||||
if (attrParseOnly)
|
||||
if (options.isSet("shouldStopPolicy") &&
|
||||
CompileState.valueOf(options.get("shouldStopPolicy")) == CompileState.ATTR)
|
||||
compilePolicy = CompilePolicy.ATTR_ONLY;
|
||||
else
|
||||
compilePolicy = CompilePolicy.decode(options.get("compilePolicy"));
|
||||
@ -452,10 +451,6 @@ public class JavaCompiler {
|
||||
*/
|
||||
public boolean stubOutput;
|
||||
|
||||
/** Generate attributed parse tree only.
|
||||
*/
|
||||
public boolean attrParseOnly;
|
||||
|
||||
/** Switch: relax some constraints for producing the jsr14 prototype.
|
||||
*/
|
||||
boolean relax;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2016, Oracle and/or its affiliates. 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
|
||||
@ -766,10 +766,6 @@ public class JavacProcessingEnvironment implements ProcessingEnvironment, Closea
|
||||
|
||||
// Run contributing processors that haven't run yet
|
||||
psi.runContributingProcs(renv);
|
||||
|
||||
// Debugging
|
||||
if (options.isSet("displayFilerState"))
|
||||
filer.displayState();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1,6 +1,6 @@
|
||||
|
||||
#
|
||||
# Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 1999, 2016, Oracle and/or its affiliates. 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
|
||||
@ -1284,24 +1284,6 @@ compiler.note.unchecked.filename.additional=\
|
||||
compiler.note.unchecked.plural.additional=\
|
||||
Some input files additionally use unchecked or unsafe operations.
|
||||
|
||||
# 0: file name
|
||||
compiler.note.sunapi.filename=\
|
||||
{0} uses internal proprietary API that may be removed in a future release.
|
||||
|
||||
compiler.note.sunapi.plural=\
|
||||
Some input files use internal proprietary API that may be removed in a future release.
|
||||
|
||||
# The following string may appear after one of the above sunapi messages.
|
||||
compiler.note.sunapi.recompile=\
|
||||
Recompile with -Xlint:sunapi for details.
|
||||
|
||||
# 0: file name
|
||||
compiler.note.sunapi.filename.additional=\
|
||||
{0} uses additional internal proprietary API that may be removed in a future release.
|
||||
|
||||
compiler.note.sunapi.plural.additional=\
|
||||
Some input files additionally use internal proprietary API that may be removed in a future release.
|
||||
|
||||
# Notes related to annotation processing
|
||||
|
||||
# Print a client-generated note; assumed to be localized, no translation required
|
||||
@ -1375,13 +1357,6 @@ compiler.misc.verbose.sourcepath=\
|
||||
compiler.misc.verbose.classpath=\
|
||||
[search path for class files: {0}]
|
||||
|
||||
## extra output when using -checkclassfile (code/ClassReader)
|
||||
compiler.misc.ccf.found.later.version=\
|
||||
class file has later version than expected: {0}
|
||||
|
||||
compiler.misc.ccf.unrecognized.attribute=\
|
||||
unrecognized attribute: {0}
|
||||
|
||||
## extra output when using -prompt (util/Log)
|
||||
compiler.misc.resume.abort=\
|
||||
R)esume, A)bort>
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 1999, 2016, Oracle and/or its affiliates. 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
|
||||
@ -208,9 +208,6 @@ javac.opt.Xlint.desc.serial=\
|
||||
javac.opt.Xlint.desc.static=\
|
||||
Warn about accessing a static member using an instance.
|
||||
|
||||
javac.opt.Xlint.desc.sunapi=\
|
||||
Warn about proprietary API that may be removed in a future release.
|
||||
|
||||
javac.opt.Xlint.desc.try=\
|
||||
Warn about issues relating to use of try blocks (i.e. try-with-resources).
|
||||
|
||||
|
@ -1,87 +0,0 @@
|
||||
/*
|
||||
* @test /nodynamiccopyright/
|
||||
* @bug 6873845
|
||||
* @summary refine access to symbol file
|
||||
* @modules java.base/sun.misc
|
||||
* jdk.compiler
|
||||
*/
|
||||
|
||||
import java.io.*;
|
||||
import java.util.*;
|
||||
|
||||
import sun.misc.*;
|
||||
|
||||
public class T6873845 {
|
||||
public static void main(String... args) throws Exception {
|
||||
new T6873845().run();
|
||||
}
|
||||
|
||||
public void run() throws Exception {
|
||||
String out = compile(Arrays.asList("-XDrawDiagnostics", "-X"));
|
||||
if (out.contains("sunapi"))
|
||||
throw new Exception("unexpected output for -X");
|
||||
|
||||
String warn1 = "T6873845.java:75:9: compiler.warn.sun.proprietary: sun.misc.Unsafe" + newline;
|
||||
String warn2 = "T6873845.java:80:9: compiler.warn.sun.proprietary: sun.misc.Unsafe" + newline;
|
||||
String note1 = "- compiler.note.sunapi.filename: T6873845.java" + newline;
|
||||
String note2 = "- compiler.note.sunapi.recompile" + newline;
|
||||
|
||||
test(opts(),
|
||||
warn1 + warn2 + "2 warnings" + newline);
|
||||
test(opts("-XDenableSunApiLintControl"),
|
||||
note1 + note2);
|
||||
test(opts("-XDenableSunApiLintControl", "-XDsuppressNotes"),
|
||||
"");
|
||||
test(opts("-XDenableSunApiLintControl", "-Xlint:sunapi"),
|
||||
warn1 + "1 warning" + newline);
|
||||
test(opts("-XDenableSunApiLintControl", "-Xlint:all"),
|
||||
warn1 + "1 warning" + newline);
|
||||
test(opts("-XDenableSunApiLintControl", "-Xlint:all,-sunapi"),
|
||||
note1 + note2);
|
||||
}
|
||||
|
||||
List<String> opts(String... opts) {
|
||||
return Arrays.asList(opts);
|
||||
}
|
||||
|
||||
void test(List<String> opts, String expect) throws Exception {
|
||||
List<String> args = new ArrayList<String>();
|
||||
args.addAll(opts);
|
||||
args.add("-d");
|
||||
args.add(testClasses.getPath());
|
||||
args.add(new File(testSrc, "T6873845.java").getPath());
|
||||
compile(args); // to verify resource strings exist
|
||||
args.add(0, "-XDrawDiagnostics");
|
||||
String out = compile(args);
|
||||
if (!out.equals(expect))
|
||||
throw new Exception("unexpected output from compiler; expected: " + expect +
|
||||
"\n found: " + out);
|
||||
}
|
||||
|
||||
String compile(List<String> args) throws Exception{
|
||||
StringWriter sw = new StringWriter();
|
||||
PrintWriter pw = new PrintWriter(sw);
|
||||
System.out.println("compile: " + args);
|
||||
int rc = com.sun.tools.javac.Main.compile(args.toArray(new String[args.size()]), pw);
|
||||
pw.close();
|
||||
String out = sw.toString();
|
||||
System.out.println(out);
|
||||
if (rc != 0)
|
||||
throw new Exception("compilation failed unexpectedly");
|
||||
return out;
|
||||
}
|
||||
|
||||
void m1() {
|
||||
Unsafe.getUnsafe();
|
||||
}
|
||||
|
||||
@SuppressWarnings("sunapi")
|
||||
void m2() {
|
||||
Unsafe.getUnsafe();
|
||||
}
|
||||
|
||||
private File testSrc = new File(System.getProperty("test.src", "."));
|
||||
private File testClasses = new File(System.getProperty("test.classes", "."));
|
||||
private String newline = System.getProperty("line.separator");
|
||||
}
|
||||
|
@ -182,7 +182,7 @@ public class CheckResourceKeys {
|
||||
* have a significant recognizable substring to look for.
|
||||
*/
|
||||
private boolean isMandatoryWarningString(String s) {
|
||||
String[] bases = { "deprecated", "unchecked", "varargs", "sunapi" };
|
||||
String[] bases = { "deprecated", "unchecked", "varargs" };
|
||||
String[] tails = { ".filename", ".filename.additional", ".plural", ".plural.additional", ".recompile" };
|
||||
for (String b: bases) {
|
||||
if (s.startsWith(b)) {
|
||||
@ -229,7 +229,6 @@ public class CheckResourceKeys {
|
||||
"compiler.err.signature.doesnt.match.supertype", // UNUSED
|
||||
"compiler.err.type.var.more.than.once", // UNUSED
|
||||
"compiler.err.type.var.more.than.once.in.result", // UNUSED
|
||||
"compiler.misc.ccf.found.later.version", // UNUSED
|
||||
"compiler.misc.non.denotable.type", // UNUSED
|
||||
"compiler.misc.unnamed.package", // should be required, CR 6964147
|
||||
"compiler.misc.verbose.retro", // UNUSED
|
||||
|
@ -49,8 +49,6 @@ compiler.misc.bad.runtime.invisible.param.annotations # bad class file
|
||||
compiler.misc.bad.signature # bad class file
|
||||
compiler.misc.bad.type.annotation.value
|
||||
compiler.misc.base.membership # UNUSED
|
||||
compiler.misc.ccf.found.later.version
|
||||
compiler.misc.ccf.unrecognized.attribute
|
||||
compiler.misc.class.file.not.found # ClassReader
|
||||
compiler.misc.class.file.wrong.class
|
||||
compiler.misc.fatal.err.cant.locate.ctor # Resolve, from Lower
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2010, 2016, Oracle and/or its affiliates. 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
|
||||
@ -21,9 +21,7 @@
|
||||
* questions.
|
||||
*/
|
||||
|
||||
// key: compiler.note.sunapi.filename
|
||||
// key: compiler.note.sunapi.recompile
|
||||
// options: -XDenableSunApiLintControl
|
||||
// key: compiler.warn.sun.proprietary
|
||||
|
||||
class SunApiFilename {
|
||||
sun.misc.Unsafe x;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2010, 2016, Oracle and/or its affiliates. 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
|
||||
@ -21,9 +21,7 @@
|
||||
* questions.
|
||||
*/
|
||||
|
||||
// key: compiler.note.sunapi.filename.additional
|
||||
// key: compiler.warn.sun.proprietary
|
||||
// options: -XDenableSunApiLintControl -Xlint:sunapi -Xmaxwarns 1
|
||||
|
||||
class SunApiFilenameAdditional {
|
||||
sun.misc.Unsafe x1;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2010, 2016, Oracle and/or its affiliates. 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
|
||||
@ -21,9 +21,7 @@
|
||||
* questions.
|
||||
*/
|
||||
|
||||
// key: compiler.note.sunapi.plural
|
||||
// key: compiler.note.sunapi.recompile
|
||||
// options: -XDenableSunApiLintControl
|
||||
// key: compiler.warn.sun.proprietary
|
||||
|
||||
class SunApiPlural {
|
||||
sun.misc.Unsafe x;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2010, 2016, Oracle and/or its affiliates. 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
|
||||
@ -21,9 +21,7 @@
|
||||
* questions.
|
||||
*/
|
||||
|
||||
// key: compiler.note.sunapi.plural.additional
|
||||
// key: compiler.warn.sun.proprietary
|
||||
// options: -XDenableSunApiLintControl -Xlint:sunapi -Xmaxwarns 1
|
||||
|
||||
class SunApiPluralAdditional {
|
||||
sun.misc.Unsafe x;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2011, 2016, Oracle and/or its affiliates. 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
|
||||
@ -26,7 +26,7 @@
|
||||
* @bug 8003280
|
||||
* @summary Add lambda tests
|
||||
* conditional and varargs
|
||||
* @compile -XDcomplexinference Conditional01.java
|
||||
* @compile Conditional01.java
|
||||
*/
|
||||
|
||||
import java.util.*;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2011, 2016, Oracle and/or its affiliates. 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
|
||||
@ -26,7 +26,7 @@
|
||||
* @bug 8003280
|
||||
* @summary Add lambda tests
|
||||
* inference and conditionals
|
||||
* @compile -XDcomplexinference Conditional02.java
|
||||
* @compile Conditional02.java
|
||||
*/
|
||||
|
||||
class Conditional02 {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2011, 2016, Oracle and/or its affiliates. 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
|
||||
@ -26,7 +26,7 @@
|
||||
* @bug 8003280
|
||||
* @summary Add lambda tests
|
||||
* conditionals and boxing
|
||||
* @compile -XDcomplexinference Conditional03.java
|
||||
* @compile Conditional03.java
|
||||
*/
|
||||
|
||||
class Conditional03 {
|
||||
|
@ -4,7 +4,7 @@
|
||||
* @summary Add lambda tests
|
||||
* complex case of cyclic type inference (lambda returned where inference var expected)
|
||||
* @compile/fail/ref=TargetType27.out -XDrawDiagnostics TargetType27.java
|
||||
* @compile/fail/ref=TargetType27.out -XDrawDiagnostics -XDcomplexinference TargetType27.java
|
||||
* @compile/fail/ref=TargetType27.out -XDrawDiagnostics TargetType27.java
|
||||
*/
|
||||
|
||||
class TargetType27 {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2011, 2016, Oracle and/or its affiliates. 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
|
||||
@ -26,7 +26,7 @@
|
||||
* @bug 8003280
|
||||
* @summary Add lambda tests
|
||||
* spurious resolution diagnostics when diamond constructor contains poly expression
|
||||
* @compile -XDcomplexinference TargetType34.java
|
||||
* @compile TargetType34.java
|
||||
*/
|
||||
|
||||
class TargetType34<X> {
|
||||
|
@ -1,32 +0,0 @@
|
||||
/**
|
||||
* @test /nodynamiccopyright/
|
||||
* @bug 6594914
|
||||
* @summary \\@SuppressWarnings("deprecation") does not not work for the type of a variable
|
||||
* @modules java.base/sun.security.x509
|
||||
* @compile/ref=T6594914b.out -XDenableSunApiLintControl -XDrawDiagnostics -Xlint:sunapi T6594914b.java
|
||||
*/
|
||||
|
||||
|
||||
class T6747671b {
|
||||
|
||||
sun.security.x509.X509CertInfo a1; //warn
|
||||
|
||||
@SuppressWarnings("sunapi")
|
||||
sun.security.x509.X509CertInfo a2;
|
||||
|
||||
<X extends sun.security.x509.X509CertInfo>
|
||||
sun.security.x509.X509CertInfo m1(sun.security.x509.X509CertInfo a)
|
||||
throws sun.security.x509.CertException { return null; } //warn
|
||||
|
||||
@SuppressWarnings("sunapi")
|
||||
<X extends sun.security.x509.X509CertInfo>
|
||||
sun.security.x509.X509CertInfo m2(sun.security.x509.X509CertInfo a)
|
||||
throws sun.security.x509.CertException { return null; }
|
||||
|
||||
void test() {
|
||||
sun.security.x509.X509CertInfo a1; //warn
|
||||
|
||||
@SuppressWarnings("sunapi")
|
||||
sun.security.x509.X509CertInfo a2;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user