Add type parameters where possible

This commit is contained in:
Florian Schmaus 2019-07-28 12:27:29 +02:00
parent 987791b9bd
commit 7690b542ab
3 changed files with 6 additions and 6 deletions

View File

@ -43,8 +43,8 @@ public class PartialUserId {
@Override
public boolean accept(String identifier, @Nonnull PGPSecretKey key) {
for (Iterator userIds = key.getUserIDs(); userIds.hasNext(); ) {
String userId = (String) userIds.next();
for (Iterator<String> userIds = key.getUserIDs(); userIds.hasNext(); ) {
String userId = userIds.next();
if (userId.contains(identifier)) {
return true;
}

View File

@ -216,9 +216,9 @@ public class BCUtil {
}
public static PGPPublicKey getMasterKeyFrom(@Nonnull PGPKeyRing ring) {
Iterator it = ring.getPublicKeys();
Iterator<PGPPublicKey> it = ring.getPublicKeys();
while (it.hasNext()) {
PGPPublicKey k = (PGPPublicKey) it.next();
PGPPublicKey k = it.next();
if (k.isMasterKey()) {
// There can only be one master key, so we can immediately return
return k;
@ -235,7 +235,7 @@ public class BCUtil {
boolean signingKey = false;
Iterator sit = k.getSignatures();
Iterator<?> sit = k.getSignatures();
while (sit.hasNext()) {
Object n = sit.next();
if (!(n instanceof PGPSignature)) {

View File

@ -125,7 +125,7 @@ public class MultiMap<K, V> {
return true;
}
return map.equals(((MultiMap) o).map);
return map.equals(((MultiMap<?, ?>) o).map);
}
@Override