Skip to content
Permalink
Browse files
8259291: Cleanup unnecessary local variables
Reviewed-by: mullan
  • Loading branch information
XueleiFan committed Jan 6, 2021
1 parent d20d2fa commit df721f0c69d143e13ff025ec9c305fcce2e0b925
@@ -265,8 +265,7 @@ static VerifyDataScheme valueOf(ProtocolVersion protocolVersion) {
"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 @@ static VerifyDataScheme valueOf(ProtocolVersion protocolVersion) {
"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 @@ private long t13Encrypt(
}

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 @@ private long t13Encrypt(
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 @@ public String toString(
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 @@ void encodeAlert(byte level, byte description) throws IOException {
}

// use the buf of ByteArrayOutputStream
int position = headerSize + writeCipher.getExplicitNonceSize();
count = position;
count = headerSize + writeCipher.getExplicitNonceSize();

write(level);
write(description);
@@ -221,8 +220,7 @@ void encodeChangeCipherSpec() throws IOException {
}

// 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.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.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;

1 comment on commit df721f0

@openjdk-notifier

This comment has been minimized.

Copy link

@openjdk-notifier openjdk-notifier bot commented on df721f0 Jan 6, 2021

Please sign in to comment.