summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjesus m. rodriguez <jesusr@redhat.com>2012-05-10 14:55:54 (GMT)
committerjesus m. rodriguez <jesusr@redhat.com>2012-05-16 15:02:32 (GMT)
commit2b413ea653406d438dab382797cdbce6c8cb19ae (patch)
tree0555097900ca8e99795980e5aeb90a3625bb5b67
parent3f665cb8f23764f6db9187da6fd6ad063bd41311 (diff)
downloadcandlepin-2b413ea653406d438dab382797cdbce6c8cb19ae.zip
candlepin-2b413ea653406d438dab382797cdbce6c8cb19ae.tar.gz
candlepin-2b413ea653406d438dab382797cdbce6c8cb19ae.tar.xz
findbugs: Dead store to local variable
-rw-r--r--proxy/src/main/java/org/candlepin/model/PoolCurator.java6
-rw-r--r--proxy/src/main/java/org/candlepin/util/Util.java4
2 files changed, 4 insertions, 6 deletions
diff --git a/proxy/src/main/java/org/candlepin/model/PoolCurator.java b/proxy/src/main/java/org/candlepin/model/PoolCurator.java
index 2a7b1ba..19d52ba 100644
--- a/proxy/src/main/java/org/candlepin/model/PoolCurator.java
+++ b/proxy/src/main/java/org/candlepin/model/PoolCurator.java
@@ -391,10 +391,8 @@ public class PoolCurator extends AbstractHibernateCurator<Pool> {
public List<ActivationKey> getActivationKeysForPool(Pool p) {
List<ActivationKey> activationKeys = new ArrayList<ActivationKey>();
- List<ActivationKeyPool> activationKeyPools = new ArrayList<ActivationKeyPool>();
-
- activationKeyPools = currentSession().createCriteria(ActivationKeyPool.class)
- .add(Restrictions.eq("pool", p)).list();
+ List<ActivationKeyPool> activationKeyPools = currentSession().createCriteria(
+ ActivationKeyPool.class).add(Restrictions.eq("pool", p)).list();
for (ActivationKeyPool akp : activationKeyPools) {
activationKeys.add(akp.getKey());
diff --git a/proxy/src/main/java/org/candlepin/util/Util.java b/proxy/src/main/java/org/candlepin/util/Util.java
index 465aa62..465947a 100644
--- a/proxy/src/main/java/org/candlepin/util/Util.java
+++ b/proxy/src/main/java/org/candlepin/util/Util.java
@@ -291,7 +291,7 @@ public class Util {
catch (NoSuchAlgorithmException nsae) {
throw new RuntimeException(nsae);
}
- byte[] sha1hash = new byte[40];
+
try {
md.update(combined.getBytes("UTF-8"), 0, combined.length());
}
@@ -299,7 +299,7 @@ public class Util {
throw new RuntimeException(uee);
}
- sha1hash = md.digest();
+ byte[] sha1hash = md.digest();
return new String(Hex.encodeHex(sha1hash));
}