Handle @null values in string-arrays
Scope:
- when a string-array resource has a value @null, robolectric
crashes on processing it. It redundantly removes "@" from
resource id which leaves only "null" value for string resource
loader and leads to NPE.
problem xml content addressed by this cl:
<string-array name="some_name">
<item>@null</item>
</string-array>
Change-Id: I744a7f0b9e0cb3c6fc255a16159cd63a43bf975e
(cherry picked from commit ee8ff43810b93e386dd96f5d0dab7e8501c0b9f4)
diff --git a/src/main/java/com/xtremelabs/robolectric/res/StringArrayResourceLoader.java b/src/main/java/com/xtremelabs/robolectric/res/StringArrayResourceLoader.java
index 3ba7280..1a3988c 100644
--- a/src/main/java/com/xtremelabs/robolectric/res/StringArrayResourceLoader.java
+++ b/src/main/java/com/xtremelabs/robolectric/res/StringArrayResourceLoader.java
@@ -35,7 +35,6 @@
String value = childNode.getTextContent();
if (value.startsWith("@")) {
- value = value.substring(1);
arrayValues.add(stringResourceLoader.getValue(value , isSystem));
} else {
arrayValues.add(value);