mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-11-23 17:22:16 -05:00
get rid of some inspection warnings
This commit is contained in:
parent
4da273ac16
commit
26f6d58284
@ -11,7 +11,6 @@ import org.robolectric.*;
|
|||||||
import org.robolectric.shadows.ShadowLog;
|
import org.robolectric.shadows.ShadowLog;
|
||||||
import org.spongycastle.bcpg.BCPGInputStream;
|
import org.spongycastle.bcpg.BCPGInputStream;
|
||||||
import org.spongycastle.bcpg.Packet;
|
import org.spongycastle.bcpg.Packet;
|
||||||
import org.spongycastle.bcpg.SecretKeyPacket;
|
|
||||||
import org.spongycastle.bcpg.SecretSubkeyPacket;
|
import org.spongycastle.bcpg.SecretSubkeyPacket;
|
||||||
import org.spongycastle.bcpg.SignaturePacket;
|
import org.spongycastle.bcpg.SignaturePacket;
|
||||||
import org.spongycastle.bcpg.UserIDPacket;
|
import org.spongycastle.bcpg.UserIDPacket;
|
||||||
@ -147,7 +146,7 @@ public class PgpKeyOperationTest {
|
|||||||
parcel.mFingerprint = ring.getFingerprint();
|
parcel.mFingerprint = ring.getFingerprint();
|
||||||
parcel.addSubKeys.add(new SubkeyAdd(algorithm.rsa, 1024, KeyFlags.SIGN_DATA, null));
|
parcel.addSubKeys.add(new SubkeyAdd(algorithm.rsa, 1024, KeyFlags.SIGN_DATA, null));
|
||||||
|
|
||||||
UncachedKeyRing modified = applyModificationWithChecks(parcel, ring, onlyA, onlyB);
|
applyModificationWithChecks(parcel, ring, onlyA, onlyB);
|
||||||
|
|
||||||
Assert.assertEquals("no extra packets in original", 0, onlyA.size());
|
Assert.assertEquals("no extra packets in original", 0, onlyA.size());
|
||||||
Assert.assertEquals("exactly two extra packets in modified", 2, onlyB.size());
|
Assert.assertEquals("exactly two extra packets in modified", 2, onlyB.size());
|
||||||
@ -179,7 +178,7 @@ public class PgpKeyOperationTest {
|
|||||||
parcel.revokeSubKeys.add(it.next().getKeyId());
|
parcel.revokeSubKeys.add(it.next().getKeyId());
|
||||||
}
|
}
|
||||||
|
|
||||||
UncachedKeyRing modified = applyModificationWithChecks(parcel, ring, onlyA, onlyB);
|
applyModificationWithChecks(parcel, ring, onlyA, onlyB);
|
||||||
|
|
||||||
Assert.assertEquals("no extra packets in original", 0, onlyA.size());
|
Assert.assertEquals("no extra packets in original", 0, onlyA.size());
|
||||||
Assert.assertEquals("exactly one extra packet in modified", 1, onlyB.size());
|
Assert.assertEquals("exactly one extra packet in modified", 1, onlyB.size());
|
||||||
@ -197,7 +196,7 @@ public class PgpKeyOperationTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testUserIdRevokeReadd() throws Exception {
|
public void testUserIdRevokeRead() throws Exception {
|
||||||
|
|
||||||
UncachedKeyRing modified;
|
UncachedKeyRing modified;
|
||||||
String uid = ring.getPublicKey().getUnorderedUserIds().get(1);
|
String uid = ring.getPublicKey().getUnorderedUserIds().get(1);
|
||||||
@ -232,8 +231,7 @@ public class PgpKeyOperationTest {
|
|||||||
parcel.mFingerprint = ring.getFingerprint();
|
parcel.mFingerprint = ring.getFingerprint();
|
||||||
parcel.addUserIds.add(uid);
|
parcel.addUserIds.add(uid);
|
||||||
|
|
||||||
modified = applyModificationWithChecks(
|
applyModificationWithChecks(parcel, modified, onlyA, onlyB, true, false);
|
||||||
parcel, modified, onlyA, onlyB, true, false);
|
|
||||||
|
|
||||||
Assert.assertEquals("exactly two outdated packets in original", 2, onlyA.size());
|
Assert.assertEquals("exactly two outdated packets in original", 2, onlyA.size());
|
||||||
Assert.assertEquals("exactly one extra packet in modified", 1, onlyB.size());
|
Assert.assertEquals("exactly one extra packet in modified", 1, onlyB.size());
|
||||||
@ -411,6 +409,7 @@ public class PgpKeyOperationTest {
|
|||||||
|
|
||||||
ArrayList onlyA = new ArrayList<RawPacket>();
|
ArrayList onlyA = new ArrayList<RawPacket>();
|
||||||
ArrayList onlyB = new ArrayList<RawPacket>();
|
ArrayList onlyB = new ArrayList<RawPacket>();
|
||||||
|
//noinspection unchecked
|
||||||
Assert.assertTrue("keyrings differ", !KeyringTestingHelper.diffKeyrings(
|
Assert.assertTrue("keyrings differ", !KeyringTestingHelper.diffKeyrings(
|
||||||
expectedKeyRing.getEncoded(), expectedKeyRing.getEncoded(), onlyA, onlyB));
|
expectedKeyRing.getEncoded(), expectedKeyRing.getEncoded(), onlyA, onlyB));
|
||||||
|
|
||||||
|
@ -692,6 +692,7 @@ public class PgpKeyOperation {
|
|||||||
|
|
||||||
private static int readMasterKeyFlags(PGPPublicKey masterKey) {
|
private static int readMasterKeyFlags(PGPPublicKey masterKey) {
|
||||||
int flags = KeyFlags.CERTIFY_OTHER;
|
int flags = KeyFlags.CERTIFY_OTHER;
|
||||||
|
//noinspection unchecked
|
||||||
for(PGPSignature sig : new IterableIterator<PGPSignature>(masterKey.getSignatures())) {
|
for(PGPSignature sig : new IterableIterator<PGPSignature>(masterKey.getSignatures())) {
|
||||||
if (!sig.hasSubpackets()) {
|
if (!sig.hasSubpackets()) {
|
||||||
continue;
|
continue;
|
||||||
|
@ -12,7 +12,6 @@ import java.util.ArrayList;
|
|||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Arrays;
|
|
||||||
|
|
||||||
/** Represent the result of an operation.
|
/** Represent the result of an operation.
|
||||||
*
|
*
|
||||||
@ -72,9 +71,6 @@ public class OperationResultParcel implements Parcelable {
|
|||||||
mParameters = parameters;
|
mParameters = parameters;
|
||||||
mIndent = indent;
|
mIndent = indent;
|
||||||
}
|
}
|
||||||
public LogEntryParcel(LogLevel level, LogType type, Object... parameters) {
|
|
||||||
this(level, type, 0, parameters);
|
|
||||||
}
|
|
||||||
|
|
||||||
public LogEntryParcel(Parcel source) {
|
public LogEntryParcel(Parcel source) {
|
||||||
mLevel = LogLevel.values()[source.readInt()];
|
mLevel = LogLevel.values()[source.readInt()];
|
||||||
|
@ -505,7 +505,7 @@
|
|||||||
<string name="cert_casual">casual</string>
|
<string name="cert_casual">casual</string>
|
||||||
<string name="cert_positive">positive</string>
|
<string name="cert_positive">positive</string>
|
||||||
<string name="cert_revoke">revoked</string>
|
<string name="cert_revoke">revoked</string>
|
||||||
<string name="cert_verify_ok">ok</string>
|
<string name="cert_verify_ok">OK</string>
|
||||||
<string name="cert_verify_failed">failed!</string>
|
<string name="cert_verify_failed">failed!</string>
|
||||||
<string name="cert_verify_error">error!</string>
|
<string name="cert_verify_error">error!</string>
|
||||||
<string name="cert_verify_unavailable">key unavailable</string>
|
<string name="cert_verify_unavailable">key unavailable</string>
|
||||||
|
Loading…
Reference in New Issue
Block a user