8159766: "Switching encoding from UTF-8 to ISO-8859-1" log message should be trace/debug message
authorokutsu
Wed, 22 Jun 2016 16:12:39 +0900
changeset 39136 0dbb98c91291
parent 39135 12b17886ae03
child 39137 6cf0e983a1e1
8159766: "Switching encoding from UTF-8 to ISO-8859-1" log message should be trace/debug message Reviewed-by: alanb, mchung, naoto
jdk/src/java.base/share/classes/sun/util/PropertyResourceBundleCharset.java
--- a/jdk/src/java.base/share/classes/sun/util/PropertyResourceBundleCharset.java	Tue Jun 21 20:20:14 2016 -0700
+++ b/jdk/src/java.base/share/classes/sun/util/PropertyResourceBundleCharset.java	Wed Jun 22 16:12:39 2016 +0900
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -34,7 +34,6 @@
 import java.nio.charset.CodingErrorAction;
 import java.nio.charset.StandardCharsets;
 import java.util.Objects;
-import sun.util.logging.PlatformLogger;
 
 /**
  * A Charset implementation for reading PropertyResourceBundle, in order
@@ -94,12 +93,11 @@
                 return cr;
             }
 
+            // Invalid or unmappable UTF-8 sequence detected.
+            // Switching to the ISO 8859-1 decorder.
+            assert cr.isMalformed() || cr.isUnmappable();
             in.reset();
             out.reset();
-
-            PlatformLogger.getLogger(getClass().getCanonicalName()).info(
-                "Invalid or unmappable UTF-8 sequence detected. " +
-                "Switching encoding from UTF-8 to ISO-8859-1");
             cdISO_8859_1 = StandardCharsets.ISO_8859_1.newDecoder();
             return cdISO_8859_1.decode(in, out, false);
         }