Partially revert commit ff5659fbc3.

ff5659fbc was intended to be a clean revert of 660cf30e21
that fixed a DOA issue. However, the author incorrectly rebased that
revert and picked up pieces of a separate change as well. This reverts
those sections of the change so that they can be submitted with the
correct attribution and with proper review.

Bug: 34415265
Bug: 34914977
Test: make

Change-Id: I977c3ba10bb05f04ac8cfd95d17954c454c83340
This commit is contained in:
Narayan Kamath
2017-02-10 14:53:10 +00:00
parent 7a1c94cc89
commit e714927b19

View File

@@ -2747,15 +2747,15 @@ public class PackageParser {
String cls = clsSeq.toString();
char c = cls.charAt(0);
if (c == '.') {
return pkg + cls;
return (pkg + cls).intern();
}
if (cls.indexOf('.') < 0) {
StringBuilder b = new StringBuilder(pkg);
b.append('.');
b.append(cls);
return b.toString();
return b.toString().intern();
}
return cls;
return cls.intern();
}
private static String buildCompoundName(String pkg,
@@ -2775,7 +2775,7 @@ public class PackageParser {
+ pkg + ": " + nameError;
return null;
}
return pkg + proc;
return (pkg + proc).intern();
}
String nameError = validateName(proc, true, false);
if (nameError != null && !"system".equals(proc)) {
@@ -2783,7 +2783,7 @@ public class PackageParser {
+ pkg + ": " + nameError;
return null;
}
return proc;
return proc.intern();
}
private static String buildProcessName(String pkg, String defProc,
@@ -5101,7 +5101,7 @@ public class PackageParser {
if (v != null) {
if (v.type == TypedValue.TYPE_STRING) {
CharSequence cs = v.coerceToString();
data.putString(name, cs != null ? cs.toString() : null);
data.putString(name, cs != null ? cs.toString().intern() : null);
} else if (v.type == TypedValue.TYPE_INT_BOOLEAN) {
data.putBoolean(name, v.data != 0);
} else if (v.type >= TypedValue.TYPE_FIRST_INT