diff --git a/hedera-node/hapi-utils/src/main/java/com/hedera/node/app/hapi/utils/ByteStringUtils.java b/hedera-node/hapi-utils/src/main/java/com/hedera/node/app/hapi/utils/ByteStringUtils.java index da395f0eef30..b76aa1a6af07 100644 --- a/hedera-node/hapi-utils/src/main/java/com/hedera/node/app/hapi/utils/ByteStringUtils.java +++ b/hedera-node/hapi-utils/src/main/java/com/hedera/node/app/hapi/utils/ByteStringUtils.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2022-2024 Hedera Hashgraph, LLC + * Copyright (C) 2022-2025 Hedera Hashgraph, LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -113,7 +113,7 @@ byte[] getBytes() { @VisibleForTesting static boolean supports(final ByteString byteString) { return byteString.size() > UnsafeByteOutput.SIZE - && byteString.getClass() == UnsafeByteOutput.SUPPORTED_CLASS; + && UnsafeByteOutput.SUPPORTED_CLASS.equals(byteString.getClass()); } } diff --git a/hedera-node/hapi-utils/src/main/java/com/hedera/node/app/hapi/utils/fee/FeeBuilder.java b/hedera-node/hapi-utils/src/main/java/com/hedera/node/app/hapi/utils/fee/FeeBuilder.java index 9baa9ee64fa7..b7b7d5f4c1be 100644 --- a/hedera-node/hapi-utils/src/main/java/com/hedera/node/app/hapi/utils/fee/FeeBuilder.java +++ b/hedera-node/hapi-utils/src/main/java/com/hedera/node/app/hapi/utils/fee/FeeBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2024 Hedera Hashgraph, LLC + * Copyright (C) 2020-2025 Hedera Hashgraph, LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -213,7 +213,7 @@ public static int getAccountKeyStorageSize(final Key key) { if (key == null) { return 0; } - if (key == Key.getDefaultInstance()) { + if (Key.getDefaultInstance().equals(key)) { return 0; } diff --git a/hedera-node/hedera-app/src/main/java/com/hedera/node/app/statedumpers/accounts/BBMHederaAccount.java b/hedera-node/hedera-app/src/main/java/com/hedera/node/app/statedumpers/accounts/BBMHederaAccount.java index 82979feef8bc..3a126159cfc9 100644 --- a/hedera-node/hedera-app/src/main/java/com/hedera/node/app/statedumpers/accounts/BBMHederaAccount.java +++ b/hedera-node/hedera-app/src/main/java/com/hedera/node/app/statedumpers/accounts/BBMHederaAccount.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2024 Hedera Hashgraph, LLC + * Copyright (C) 2024-2025 Hedera Hashgraph, LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -104,7 +104,7 @@ public AccountID getProxy() { } public int[] getFirstUint256Key() { - return firstContractStorageKey == Bytes.EMPTY ? null : toInts(firstContractStorageKey); + return Bytes.EMPTY.equals(firstContractStorageKey) ? null : toInts(firstContractStorageKey); } private static int[] toInts(Bytes bytes) { diff --git a/hedera-node/hedera-app/src/main/java/com/hedera/node/app/statedumpers/utils/ThingsToStrings.java b/hedera-node/hedera-app/src/main/java/com/hedera/node/app/statedumpers/utils/ThingsToStrings.java index 4114a38ef511..fa0638cbcb46 100644 --- a/hedera-node/hedera-app/src/main/java/com/hedera/node/app/statedumpers/utils/ThingsToStrings.java +++ b/hedera-node/hedera-app/src/main/java/com/hedera/node/app/statedumpers/utils/ThingsToStrings.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2023-2024 Hedera Hashgraph, LLC + * Copyright (C) 2023-2025 Hedera Hashgraph, LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -513,7 +513,7 @@ public static Function getMaybeStringifyByteString(@NonNull fina } public static boolean getMaybeStringifyByteString(@NonNull final StringBuilder sb, @Nullable final Bytes bytes) { - if (bytes == null || bytes == Bytes.EMPTY) { + if (bytes == null || Bytes.EMPTY.equals(bytes)) { return false; } sb.append(toStringPossibleHumanReadableByteArray(";", bytes.toByteArray())); diff --git a/hedera-node/hedera-network-admin-service-impl/src/main/java/com/hedera/node/app/service/networkadmin/impl/WritableFreezeStore.java b/hedera-node/hedera-network-admin-service-impl/src/main/java/com/hedera/node/app/service/networkadmin/impl/WritableFreezeStore.java index a5ce61b6a02a..2d332cc4ed26 100644 --- a/hedera-node/hedera-network-admin-service-impl/src/main/java/com/hedera/node/app/service/networkadmin/impl/WritableFreezeStore.java +++ b/hedera-node/hedera-network-admin-service-impl/src/main/java/com/hedera/node/app/service/networkadmin/impl/WritableFreezeStore.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2023-2024 Hedera Hashgraph, LLC + * Copyright (C) 2023-2025 Hedera Hashgraph, LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -66,7 +66,7 @@ public void freezeTime(@NonNull final Timestamp freezeTime) { * Gets the scheduled freeze time. If no freeze has been scheduled, returns null. */ public Timestamp freezeTime() { - return freezeTimeState.get() == Timestamp.DEFAULT ? null : freezeTimeState.get(); + return Timestamp.DEFAULT.equals(freezeTimeState.get()) ? null : freezeTimeState.get(); } /** @@ -89,6 +89,6 @@ public Bytes updateFileHash() { if (fileHash == null) { return null; } - return fileHash.value() == Bytes.EMPTY ? null : fileHash.value(); + return Bytes.EMPTY.equals(fileHash.value()) ? null : fileHash.value(); } } diff --git a/hedera-node/hedera-smart-contract-service-impl/src/main/java/com/hedera/node/app/service/contract/impl/exec/systemcontracts/hts/create/CreateSyntheticTxnFactory.java b/hedera-node/hedera-smart-contract-service-impl/src/main/java/com/hedera/node/app/service/contract/impl/exec/systemcontracts/hts/create/CreateSyntheticTxnFactory.java index 10a5a8a892c6..2bf668a3a638 100644 --- a/hedera-node/hedera-smart-contract-service-impl/src/main/java/com/hedera/node/app/service/contract/impl/exec/systemcontracts/hts/create/CreateSyntheticTxnFactory.java +++ b/hedera-node/hedera-smart-contract-service-impl/src/main/java/com/hedera/node/app/service/contract/impl/exec/systemcontracts/hts/create/CreateSyntheticTxnFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2023-2024 Hedera Hashgraph, LLC + * Copyright (C) 2023-2025 Hedera Hashgraph, LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -89,7 +89,7 @@ private static void setTokenKeys( @NonNull final TokenCreateWrapper tokenCreateWrapper, final Builder txnBodyBuilder) { tokenCreateWrapper.getTokenKeys().forEach(tokenKeyWrapper -> { final var key = tokenKeyWrapper.key().asGrpc(); - if (key == Key.DEFAULT) { + if (Key.DEFAULT.equals(key)) { throw new IllegalArgumentException(); } if (tokenKeyWrapper.isUsedForAdminKey()) {