summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenny Root <kroot@google.com>2014-05-20 21:36:08 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-05-20 21:36:08 +0000
commit96817bc38a0fb644b95dfb73a6fb5c273708b8f3 (patch)
treed5e0b8ae9125d3760029ee654b45c228a35d6329
parentf7a15ff43004414e1eaa35872e9307383bdf84e4 (diff)
parent76b889a697b7408b6721b1e9592334c8d36fdeeb (diff)
downloadlibcore-96817bc38a0fb644b95dfb73a6fb5c273708b8f3.zip
libcore-96817bc38a0fb644b95dfb73a6fb5c273708b8f3.tar.gz
libcore-96817bc38a0fb644b95dfb73a6fb5c273708b8f3.tar.bz2
Merge "Signature: remove unnecessary throw on clone"
-rw-r--r--luni/src/main/java/java/security/Signature.java15
-rw-r--r--luni/src/main/java/java/security/SignatureSpi.java5
2 files changed, 3 insertions, 17 deletions
diff --git a/luni/src/main/java/java/security/Signature.java b/luni/src/main/java/java/security/Signature.java
index 24f5298..7dd7d93 100644
--- a/luni/src/main/java/java/security/Signature.java
+++ b/luni/src/main/java/java/security/Signature.java
@@ -624,14 +624,6 @@ public abstract class Signature extends SignatureSpi {
return engineGetParameter(param);
}
- @Override
- public Object clone() throws CloneNotSupportedException {
- if (this instanceof Cloneable) {
- return super.clone();
- }
- throw new CloneNotSupportedException();
- }
-
/**
* Internal Signature implementation
*/
@@ -711,11 +703,8 @@ public abstract class Signature extends SignatureSpi {
@Override
public Object clone() throws CloneNotSupportedException {
- if (spiImpl instanceof Cloneable) {
- SignatureSpi spi = (SignatureSpi) spiImpl.clone();
- return new SignatureImpl(getAlgorithm(), getProvider(), spiImpl);
- }
- throw new CloneNotSupportedException();
+ SignatureSpi spi = (SignatureSpi) spiImpl.clone();
+ return new SignatureImpl(getAlgorithm(), getProvider(), spi);
}
/**
diff --git a/luni/src/main/java/java/security/SignatureSpi.java b/luni/src/main/java/java/security/SignatureSpi.java
index 27be30c..66c43d7 100644
--- a/luni/src/main/java/java/security/SignatureSpi.java
+++ b/luni/src/main/java/java/security/SignatureSpi.java
@@ -307,9 +307,6 @@ public abstract class SignatureSpi {
@Override
public Object clone() throws CloneNotSupportedException {
- if (this instanceof Cloneable) {
- return super.clone();
- }
- throw new CloneNotSupportedException();
+ return super.clone();
}
}