Merge "Use StrictJarManifest.ATTRIBUTE_NAME_NAME instead of Attributes.Name.NAME."
am: 2dc5a42743
Change-Id: I5a61fe6e4b9507a754f8977225bc4dbbee88a4ff
This commit is contained in:
@@ -44,6 +44,9 @@ public class StrictJarManifest implements Cloneable {
|
|||||||
|
|
||||||
private static final byte[] VALUE_SEPARATOR = new byte[] { ':', ' ' };
|
private static final byte[] VALUE_SEPARATOR = new byte[] { ':', ' ' };
|
||||||
|
|
||||||
|
/** The attribute name "Name". */
|
||||||
|
static final Attributes.Name ATTRIBUTE_NAME_NAME = new Attributes.Name("Name");
|
||||||
|
|
||||||
private final Attributes mainAttributes;
|
private final Attributes mainAttributes;
|
||||||
private final HashMap<String, Attributes> entries;
|
private final HashMap<String, Attributes> entries;
|
||||||
|
|
||||||
@@ -276,7 +279,7 @@ public class StrictJarManifest implements Cloneable {
|
|||||||
Iterator<String> i = manifest.getEntries().keySet().iterator();
|
Iterator<String> i = manifest.getEntries().keySet().iterator();
|
||||||
while (i.hasNext()) {
|
while (i.hasNext()) {
|
||||||
String key = i.next();
|
String key = i.next();
|
||||||
writeEntry(out, Attributes.Name.NAME, key, encoder, buffer);
|
writeEntry(out, ATTRIBUTE_NAME_NAME, key, encoder, buffer);
|
||||||
Attributes attributes = manifest.entries.get(key);
|
Attributes attributes = manifest.entries.get(key);
|
||||||
Iterator<?> entries = attributes.keySet().iterator();
|
Iterator<?> entries = attributes.keySet().iterator();
|
||||||
while (entries.hasNext()) {
|
while (entries.hasNext()) {
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ class StrictJarManifestReader {
|
|||||||
public void readEntries(Map<String, Attributes> entries, Map<String, StrictJarManifest.Chunk> chunks) throws IOException {
|
public void readEntries(Map<String, Attributes> entries, Map<String, StrictJarManifest.Chunk> chunks) throws IOException {
|
||||||
int mark = pos;
|
int mark = pos;
|
||||||
while (readHeader()) {
|
while (readHeader()) {
|
||||||
if (!Attributes.Name.NAME.equals(name)) {
|
if (!StrictJarManifest.ATTRIBUTE_NAME_NAME.equals(name)) {
|
||||||
throw new IOException("Entry is not named");
|
throw new IOException("Entry is not named");
|
||||||
}
|
}
|
||||||
String entryNameValue = value;
|
String entryNameValue = value;
|
||||||
|
|||||||
Reference in New Issue
Block a user