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
--- 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);
}