--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/file/BaseFileManager.java Tue Feb 23 11:17:02 2016 -0800
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/file/BaseFileManager.java Tue Feb 23 16:13:48 2016 -0800
@@ -267,7 +267,14 @@
* @return true if successful, and false otherwise
*/
public boolean handleOption(Option option, String value) {
- return locations.handleOption(option, value);
+ switch (option) {
+ case ENCODING:
+ encodingName = value;
+ return true;
+
+ default:
+ return locations.handleOption(option, value);
+ }
}
/**
@@ -285,6 +292,7 @@
// </editor-fold>
// <editor-fold defaultstate="collapsed" desc="Encoding">
+ private String encodingName;
private String defaultEncodingName;
private String getDefaultEncodingName() {
if (defaultEncodingName == null) {
@@ -295,11 +303,7 @@
}
public String getEncodingName() {
- String encName = options.get(Option.ENCODING);
- if (encName == null)
- return getDefaultEncodingName();
- else
- return encName;
+ return (encodingName != null) ? encodingName : getDefaultEncodingName();
}
@SuppressWarnings("cast")
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/main/JavaCompiler.java Tue Feb 23 11:17:02 2016 -0800
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/main/JavaCompiler.java Tue Feb 23 16:13:48 2016 -0800
@@ -389,7 +389,6 @@
verbose = options.isSet(VERBOSE);
sourceOutput = options.isSet(PRINTSOURCE); // used to be -s
- encoding = options.get(ENCODING);
lineDebugInfo = options.isUnset(G_CUSTOM) ||
options.isSet(G_CUSTOM, "lines");
genEndPos = options.isSet(XJCOV) ||
@@ -444,9 +443,6 @@
*/
public boolean sourceOutput;
- /** The encoding to be used for source input.
- */
- public String encoding;
/** Generate code with the LineNumberTable attribute for debugging
*/
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/main/Option.java Tue Feb 23 11:17:02 2016 -0800
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/main/Option.java Tue Feb 23 16:13:48 2016 -0800
@@ -238,13 +238,7 @@
IMPLICIT("-implicit:", "opt.implicit", STANDARD, BASIC, ONEOF, "none", "class"),
- ENCODING("-encoding", "opt.arg.encoding", "opt.encoding", STANDARD, FILEMANAGER) {
- @Override
- public boolean process(OptionHelper helper, String option, String operand) {
- return super.process(helper, option, operand);
- }
-
- },
+ ENCODING("-encoding", "opt.arg.encoding", "opt.encoding", STANDARD, FILEMANAGER),
SOURCE("-source", "opt.arg.release", "opt.source", STANDARD, BASIC) {
@Override