aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorTor Norbye <tnorbye@google.com>2012-12-06 14:29:08 -0800
committerTor Norbye <tnorbye@google.com>2012-12-06 14:29:08 -0800
commit2c6c42bdffd1f9162c86d63a4b0bdee9a4eb7d59 (patch)
tree595da9fe04670b9ee45703e80623e5e8fa78e05e /common
parent28e56923b893874aaa37f1aa19735b26be8bb499 (diff)
downloadsdk-2c6c42bdffd1f9162c86d63a4b0bdee9a4eb7d59.zip
sdk-2c6c42bdffd1f9162c86d63a4b0bdee9a4eb7d59.tar.gz
sdk-2c6c42bdffd1f9162c86d63a4b0bdee9a4eb7d59.tar.bz2
Findbugs cleanup
Fix a couple of issues found by findbugs, and some test stability fixes. Change-Id: I97390ea606ea25d6a68e5b7f8245e5e689117995
Diffstat (limited to 'common')
-rw-r--r--common/src/com/android/utils/PositionXmlParser.java4
-rw-r--r--common/tests/src/com/android/utils/PositionXmlParserTest.java1
2 files changed, 2 insertions, 3 deletions
diff --git a/common/src/com/android/utils/PositionXmlParser.java b/common/src/com/android/utils/PositionXmlParser.java
index 1eae641..73574d5 100644
--- a/common/src/com/android/utils/PositionXmlParser.java
+++ b/common/src/com/android/utils/PositionXmlParser.java
@@ -208,7 +208,7 @@ public class PositionXmlParser {
int prologueStart = -1;
for (int lineEnd = offset; lineEnd < data.length; lineEnd++) {
if (data[lineEnd] == 0) {
- if ((lineEnd - offset) % 1 == 0) {
+ if ((lineEnd - offset) % 2 == 0) {
seenEvenZero = true;
} else {
seenOddZero = true;
@@ -255,7 +255,7 @@ public class PositionXmlParser {
// No prologue on the first line, and no byte order mark: Assume UTF-8/16
if (charset == null) {
- charset = seenOddZero ? UTF_16 : seenEvenZero ? UTF_16LE : UTF_8;
+ charset = seenOddZero ? UTF_16LE : seenEvenZero ? UTF_16 : UTF_8;
}
String xml = null;
diff --git a/common/tests/src/com/android/utils/PositionXmlParserTest.java b/common/tests/src/com/android/utils/PositionXmlParserTest.java
index 7d5b78b..18eda43 100644
--- a/common/tests/src/com/android/utils/PositionXmlParserTest.java
+++ b/common/tests/src/com/android/utils/PositionXmlParserTest.java
@@ -16,7 +16,6 @@
package com.android.utils;
-import com.android.utils.PositionXmlParser;
import com.android.utils.PositionXmlParser.Position;
import org.w3c.dom.Attr;