jdk Udiff src/java.base/share/classes/java/util/jar/Attributes.java (original) (raw)

< prev index next >

Print this page

rev 51517 : 8205525: Improve exception messages during manifest parsing of jar archives


@@ -24,18 +24,24 @@ */

package java.util.jar;

import java.io.DataOutputStream; +import java.io.File; import java.io.IOException; +import java.security.AccessController; +import java.security.PrivilegedAction; +import java.security.Security; import java.util.Collection; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.Map; import java.util.Objects; import java.util.Set;

+import sun.security.util.SecurityProperties; + import sun.util.logging.PlatformLogger;

/**


@@ -58,10 +64,13 @@ /** * The attribute name-value mappings. */ protected Map<Object,Object> map;


@@ -367,21 +376,29 @@

 /*
  * Reads attributes from the specified input stream.
  * XXX Need to handle UTF8 values.
  */

@@ -389,11 +406,12 @@ } int i = 0; if (lbuf[0] == ' ') { // continuation of previous line if (name == null) {


@@ -404,15 +422,17 @@ value = new String(buf, 0, buf.length, "UTF8"); lastline = null; } else { while (lbuf[i++] != ':') { if (i >= len) {


@@ -431,13 +451,28 @@ + "individual sections in both your\n" + "manifest and in the META-INF/MANIFEST.MF " + "entry in the jar file."); } } catch (IllegalArgumentException e) {

< prev index next >