|
Java example source code file (T6873845.java)
The T6873845.java Java example source code
import java.io.*;
import java.util.*;
import sun.misc.*;
/*
* @test /nodynamiccopyright/
* @bug 6873845
* @summary refine access to symbol file
*/
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:73:9: compiler.warn.sun.proprietary: sun.misc.Unsafe" + newline;
String warn2 = "T6873845.java:78: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
Other Java examples (source code examples)Here is a short list of links related to this Java T6873845.java source code file: |
| ... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.