From a9ce7726a722c9deba659dff3f87b7e72d6c4997 Mon Sep 17 00:00:00 2001 From: Per Minborg Date: Tue, 3 Jan 2023 10:00:19 +0000 Subject: [PATCH] 8299437: Make InetSocketAddressHolder shallowly immutable Reviewed-by: djelinski, jpai, alanb --- .../share/classes/java/net/InetSocketAddress.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/java.base/share/classes/java/net/InetSocketAddress.java b/src/java.base/share/classes/java/net/InetSocketAddress.java index 3191d097b6a..08a4319dbf9 100644 --- a/src/java.base/share/classes/java/net/InetSocketAddress.java +++ b/src/java.base/share/classes/java/net/InetSocketAddress.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2023, 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 @@ -53,13 +53,13 @@ public class InetSocketAddress extends SocketAddress { // Private implementation class pointed to by all public methods. - private static class InetSocketAddressHolder { + private static final class InetSocketAddressHolder { // The hostname of the Socket Address - private String hostname; + private final String hostname; // The IP address of the Socket Address - private InetAddress addr; + private final InetAddress addr; // The port number of the Socket Address - private int port; + private final int port; private InetSocketAddressHolder(String hostname, InetAddress addr, int port) { this.hostname = hostname;