mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
8259291: Cleanup unnecessary local variables
Reviewed-by: mullan
This commit is contained in:
parent
d20d2fa957
commit
df721f0c69
6 changed files with 12 additions and 20 deletions
|
@ -265,8 +265,7 @@ final class Finished {
|
|||
"Invalid PRF output, format must be RAW. " +
|
||||
"Format received: " + prfKey.getFormat());
|
||||
}
|
||||
byte[] finished = prfKey.getEncoded();
|
||||
return finished;
|
||||
return prfKey.getEncoded();
|
||||
} catch (GeneralSecurityException e) {
|
||||
throw new RuntimeException("PRF failed", e);
|
||||
}
|
||||
|
@ -317,8 +316,7 @@ final class Finished {
|
|||
"Invalid PRF output, format must be RAW. " +
|
||||
"Format received: " + prfKey.getFormat());
|
||||
}
|
||||
byte[] finished = prfKey.getEncoded();
|
||||
return finished;
|
||||
return prfKey.getEncoded();
|
||||
} catch (GeneralSecurityException e) {
|
||||
throw new RuntimeException("PRF failed", e);
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1996, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1996, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -474,8 +474,7 @@ abstract class OutputRecord
|
|||
}
|
||||
|
||||
byte[] sequenceNumber = encCipher.authenticator.sequenceNumber();
|
||||
int position = headerSize;
|
||||
int contentLen = count - position;
|
||||
int contentLen = count - headerSize;
|
||||
|
||||
// ensure the capacity
|
||||
int requiredPacketSize =
|
||||
|
@ -495,7 +494,7 @@ abstract class OutputRecord
|
|||
pv = ProtocolVersion.TLS12;
|
||||
}
|
||||
|
||||
ByteBuffer destination = ByteBuffer.wrap(buf, position, contentLen);
|
||||
ByteBuffer destination = ByteBuffer.wrap(buf, headerSize, contentLen);
|
||||
count = headerSize + encCipher.encrypt(contentType, destination);
|
||||
|
||||
// Fill out the header, write it and the message.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -674,8 +674,7 @@ enum SSLExtension implements SSLStringizer {
|
|||
String extData;
|
||||
if (stringizer == null) {
|
||||
HexDumpEncoder hexEncoder = new HexDumpEncoder();
|
||||
String encoded = hexEncoder.encode(byteBuffer.duplicate());
|
||||
extData = encoded;
|
||||
extData = hexEncoder.encode(byteBuffer.duplicate());
|
||||
} else {
|
||||
extData = stringizer.toString(handshakeContext, byteBuffer);
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1996, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1996, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -63,8 +63,7 @@ final class SSLSocketOutputRecord extends OutputRecord implements SSLRecord {
|
|||
}
|
||||
|
||||
// use the buf of ByteArrayOutputStream
|
||||
int position = headerSize + writeCipher.getExplicitNonceSize();
|
||||
count = position;
|
||||
count = headerSize + writeCipher.getExplicitNonceSize();
|
||||
|
||||
write(level);
|
||||
write(description);
|
||||
|
@ -221,8 +220,7 @@ final class SSLSocketOutputRecord extends OutputRecord implements SSLRecord {
|
|||
}
|
||||
|
||||
// use the buf of ByteArrayOutputStream
|
||||
int position = headerSize + writeCipher.getExplicitNonceSize();
|
||||
count = position;
|
||||
count = headerSize + writeCipher.getExplicitNonceSize();
|
||||
|
||||
write((byte)1); // byte 1: change_cipher_spec(
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -30,7 +30,6 @@ import java.nio.ByteBuffer;
|
|||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -29,7 +29,6 @@ import java.io.IOException;
|
|||
import java.nio.ByteBuffer;
|
||||
import java.text.MessageFormat;
|
||||
import java.util.Arrays;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import javax.net.ssl.SSLProtocolException;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue