diff --git a/mobile/android/services/src/main/java/org/mozilla/gecko/browserid/JSONWebTokenUtils.java b/mobile/android/services/src/main/java/org/mozilla/gecko/browserid/JSONWebTokenUtils.java index a236ecdf120..a593472b1dc 100644 --- a/mobile/android/services/src/main/java/org/mozilla/gecko/browserid/JSONWebTokenUtils.java +++ b/mobile/android/services/src/main/java/org/mozilla/gecko/browserid/JSONWebTokenUtils.java @@ -35,14 +35,7 @@ public class JSONWebTokenUtils { public static final String DEFAULT_ASSERTION_ISSUER = "127.0.0.1"; public static String encode(String payload, SigningPrivateKey privateKey) throws UnsupportedEncodingException, GeneralSecurityException { - return encode(payload, privateKey, null); - } - - protected static String encode(String payload, SigningPrivateKey privateKey, Map headerFields) throws UnsupportedEncodingException, GeneralSecurityException { - ExtendedJSONObject header = new ExtendedJSONObject(); - if (headerFields != null) { - header.putAll(headerFields); - } + final ExtendedJSONObject header = new ExtendedJSONObject(); header.put("alg", privateKey.getAlgorithm()); String encodedHeader = Base64.encodeBase64URLSafeString(header.toJSONString().getBytes("UTF-8")); String encodedPayload = Base64.encodeBase64URLSafeString(payload.getBytes("UTF-8")); diff --git a/mobile/android/services/src/main/java/org/mozilla/gecko/sync/ExtendedJSONObject.java b/mobile/android/services/src/main/java/org/mozilla/gecko/sync/ExtendedJSONObject.java index e308f8619dc..8202676bc88 100644 --- a/mobile/android/services/src/main/java/org/mozilla/gecko/sync/ExtendedJSONObject.java +++ b/mobile/android/services/src/main/java/org/mozilla/gecko/sync/ExtendedJSONObject.java @@ -294,11 +294,6 @@ public class ExtendedJSONObject { map.put(key, value); } - @SuppressWarnings({ "unchecked", "rawtypes" }) - public void putAll(Map map) { - this.object.putAll(map); - } - /** * Remove key-value pair from JSONObject. * diff --git a/mobile/android/tests/background/junit4/src/org/mozilla/gecko/sync/test/TestExtendedJSONObject.java b/mobile/android/tests/background/junit4/src/org/mozilla/gecko/sync/test/TestExtendedJSONObject.java index 413f51ce60d..3730ffb5c01 100644 --- a/mobile/android/tests/background/junit4/src/org/mozilla/gecko/sync/test/TestExtendedJSONObject.java +++ b/mobile/android/tests/background/junit4/src/org/mozilla/gecko/sync/test/TestExtendedJSONObject.java @@ -20,6 +20,7 @@ import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNotSame; import static org.junit.Assert.assertNull; @@ -62,7 +63,6 @@ public class TestExtendedJSONObject { public void testSafeInteger() { ExtendedJSONObject o = new ExtendedJSONObject(); o.put("integer", Integer.valueOf(5)); - o.put("double", Double.valueOf(1.2)); o.put("string", "66"); o.put("object", new ExtendedJSONObject()); o.put("null", null); @@ -146,8 +146,7 @@ public class TestExtendedJSONObject { ExtendedJSONObject q = new ExtendedJSONObject(exampleJSON); q.put("modified", 0); assertNotSame(o, q); - q.put("modified", o.get("modified")); - assertEquals(o, q); + assertNotEquals(o, q); } @Test