Skip to content

Commit a335e4f

Browse files
committed
Remove null check before calling initCause
1 parent 705540f commit a335e4f

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

src/java.base/share/classes/com/sun/crypto/provider/DHPrivateKey.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -373,9 +373,7 @@ private void readObject(ObjectInputStream stream)
373373
c = decode(encodedKeyIntern);
374374
} catch (IOException e) {
375375
InvalidObjectException ioe = new InvalidObjectException("Invalid encoding");
376-
if (ioe != null) {
377-
ioe.initCause(e);
378-
}
376+
ioe.initCause(e);
379377
throw ioe;
380378
}
381379
if (!Arrays.equals(c.key, key) || !c.x.equals(x) || !c.p.equals(p)

src/java.base/share/classes/com/sun/crypto/provider/DHPublicKey.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -380,9 +380,7 @@ private void readObject(ObjectInputStream stream)
380380
c = decode(encodedKeyIntern);
381381
} catch (IOException e) {
382382
InvalidObjectException ioe = new InvalidObjectException("Invalid encoding");
383-
if (ioe != null) {
384-
ioe.initCause(e);
385-
}
383+
ioe.initCause(e);
386384
throw ioe;
387385
}
388386
if (!Arrays.equals(c.key, key) || !c.y.equals(y) || !c.p.equals(p)

0 commit comments

Comments
 (0)