< prev index next >

src/java.base/share/classes/sun/util/PropertyResourceBundleCharset.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * 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
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -32,11 +32,10 @@
 import java.nio.charset.CharsetEncoder;
 import java.nio.charset.CoderResult;
 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
  * for loading properties files. This first tries to load the properties
  * file with UTF-8 encoding). If it fails, then load the file with ISO-8859-1

@@ -92,16 +91,15 @@
             if (cr.isUnderflow() || cr.isOverflow() ||
                 PropertyResourceBundleCharset.this.strictUTF8) {
                 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);
         }
     }
 }
< prev index next >