Skip to content

Commit 3870167

Browse files
committed
Specialized some Iterators with correct inferred type
1 parent 635de01 commit 3870167

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

arduino-core/src/cc/arduino/contributions/GPGDetachedSignatureVerifier.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,13 @@ private PGPPublicKey readPublicKey(File file, String keyId) throws IOException,
9797
private PGPPublicKey readPublicKey(InputStream input, String keyId) throws IOException, PGPException {
9898
PGPPublicKeyRingCollection pgpPub = new PGPPublicKeyRingCollection(PGPUtil.getDecoderStream(input), new BcKeyFingerprintCalculator());
9999

100-
Iterator keyRingIter = pgpPub.getKeyRings();
100+
Iterator<PGPPublicKeyRing> keyRingIter = pgpPub.getKeyRings();
101101
while (keyRingIter.hasNext()) {
102-
PGPPublicKeyRing keyRing = (PGPPublicKeyRing) keyRingIter.next();
102+
PGPPublicKeyRing keyRing = keyRingIter.next();
103103

104-
Iterator keyIter = keyRing.getPublicKeys();
104+
Iterator<PGPPublicKey> keyIter = keyRing.getPublicKeys();
105105
while (keyIter.hasNext()) {
106-
PGPPublicKey key = (PGPPublicKey) keyIter.next();
106+
PGPPublicKey key = keyIter.next();
107107

108108
if (Long.toHexString(key.getKeyID()).toUpperCase().endsWith(keyId)) {
109109
return key;

0 commit comments

Comments
 (0)