Bug 1315980 - Changed ExtendedJSONObject to implement Cloneable and the clone() method to throw CloneNotSupportedException. Changed inner class in ResizablePathDrawable to implement Cloneable. r?sebastian draft
authorSwaroop Rao <swaroop.rao@gmail.com>
Thu, 17 Nov 2016 10:37:41 -0500
changeset 440480 10067cef70f887fff3879cee054d7919f235f242
parent 440479 dc995ef5b36196b96ebc7174f9d3c2c81a875d93
child 440506 1c4ddfdaa698ba8a2352f6257db270a7733c6d61
push id36228
push userbmo:swaroop.rao@gmail.com
push dateThu, 17 Nov 2016 15:40:41 +0000
reviewerssebastian
bugs1315980
milestone52.0a1
Bug 1315980 - Changed ExtendedJSONObject to implement Cloneable and the clone() method to throw CloneNotSupportedException. Changed inner class in ResizablePathDrawable to implement Cloneable. r?sebastian MozReview-Commit-ID: AIxAp1zlN2J
mobile/android/base/java/org/mozilla/gecko/widget/ResizablePathDrawable.java
mobile/android/services/src/main/java/org/mozilla/gecko/sync/ExtendedJSONObject.java
--- a/mobile/android/base/java/org/mozilla/gecko/widget/ResizablePathDrawable.java
+++ b/mobile/android/base/java/org/mozilla/gecko/widget/ResizablePathDrawable.java
@@ -80,17 +80,17 @@ public class ResizablePathDrawable exten
         return updateColor(stateSet);
     }
 
     /**
      * Path-based shape implementation that re-creates the path
      * when it gets resized as opposed to PathShape's scaling
      * behaviour.
      */
-    public static class NonScaledPathShape extends Shape {
+    public static class NonScaledPathShape extends Shape implements Cloneable {
         private Path path;
 
         public NonScaledPathShape() {
             path = new Path();
         }
 
         @Override
         public void draw(Canvas canvas, Paint paint) {
--- 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
@@ -20,17 +20,17 @@ import java.util.Map.Entry;
 import java.util.Set;
 
 /**
  * Extend JSONObject to do little things, like, y'know, accessing members.
  *
  * @author rnewman
  *
  */
-public class ExtendedJSONObject {
+public class ExtendedJSONObject implements Cloneable {
 
   public JSONObject object;
 
   /**
    * Return a <code>JSONParser</code> instance for immediate use.
    * <p>
    * <code>JSONParser</code> is not thread-safe, so we return a new instance
    * each call. This is extremely inefficient in execution time and especially
@@ -169,17 +169,17 @@ public class ExtendedJSONObject {
     }
   }
 
   public ExtendedJSONObject(String jsonString) throws IOException, NonObjectJSONException {
     this(jsonString == null ? null : new StringReader(jsonString));
   }
 
   @Override
-  public ExtendedJSONObject clone() {
+  public ExtendedJSONObject clone() throws CloneNotSupportedException {
     return new ExtendedJSONObject((JSONObject) this.object.clone());
   }
 
   // Passthrough methods.
   public Object get(String key) {
     return this.object.get(key);
   }