Remove redundant throws from Java close() methods

A close() imlementation that never throws an exception does not need to
declare that one might be thrown, even if the corresponding method in an
implemented interface does declare an exception might be thrown.

Signed-off-by: Mark S. Lewis <Mark.S.Lewis@outlook.com>
This commit is contained in:
Mark S. Lewis 2026-01-27 18:25:26 +00:00
parent d669a3fccf
commit 1522bd9b7d
No known key found for this signature in database
4 changed files with 38 additions and 3 deletions

View file

@ -22,11 +22,18 @@ jobs:
- name: Checkout - name: Checkout
uses: actions/checkout@v6 uses: actions/checkout@v6
- name: Test the network - name: Test the network
id: run-test
working-directory: test-network-k8s working-directory: test-network-k8s
run: ../ci/scripts/run-k8s-test-network-basic.sh run: ../ci/scripts/run-k8s-test-network-basic.sh
env: env:
CLIENT_LANGUAGE: typescript CLIENT_LANGUAGE: typescript
CHAINCODE_LANGUAGE: java CHAINCODE_LANGUAGE: java
- name: Upload failure logs
if: ${{ failure() && steps.run-test.conclusion == 'failure' }}
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: ${{ github.job }}-logs
path: test-network-k8s/network-debug.log
ccaas-external: ccaas-external:
runs-on: ${{ github.repository == 'hyperledger/fabric-samples' && 'fabric-ubuntu-22.04' || 'ubuntu-22.04' }} runs-on: ${{ github.repository == 'hyperledger/fabric-samples' && 'fabric-ubuntu-22.04' || 'ubuntu-22.04' }}
@ -34,11 +41,18 @@ jobs:
- name: Checkout - name: Checkout
uses: actions/checkout@v6 uses: actions/checkout@v6
- name: Test the network - name: Test the network
id: run-test
working-directory: test-network-k8s working-directory: test-network-k8s
run: ../ci/scripts/run-k8s-test-network-basic.sh run: ../ci/scripts/run-k8s-test-network-basic.sh
env: env:
CLIENT_LANGUAGE: typescript CLIENT_LANGUAGE: typescript
CHAINCODE_LANGUAGE: external CHAINCODE_LANGUAGE: external
- name: Upload failure logs
if: ${{ failure() && steps.run-test.conclusion == 'failure' }}
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: ${{ github.job }}-logs
path: test-network-k8s/network-debug.log
k8s-builder: k8s-builder:
runs-on: ${{ github.repository == 'hyperledger/fabric-samples' && 'fabric-ubuntu-22.04' || 'ubuntu-22.04' }} runs-on: ${{ github.repository == 'hyperledger/fabric-samples' && 'fabric-ubuntu-22.04' || 'ubuntu-22.04' }}
@ -46,12 +60,19 @@ jobs:
- name: Checkout - name: Checkout
uses: actions/checkout@v6 uses: actions/checkout@v6
- name: Test the network - name: Test the network
id: run-test
working-directory: test-network-k8s working-directory: test-network-k8s
run: ../ci/scripts/run-k8s-test-network-basic.sh run: ../ci/scripts/run-k8s-test-network-basic.sh
env: env:
CHAINCODE_NAME: basic CHAINCODE_NAME: basic
CHAINCODE_LANGUAGE: java CHAINCODE_LANGUAGE: java
CHAINCODE_BUILDER: k8s CHAINCODE_BUILDER: k8s
- name: Upload failure logs
if: ${{ failure() && steps.run-test.conclusion == 'failure' }}
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: ${{ github.job }}-logs
path: test-network-k8s/network-debug.log
multi-namespace: multi-namespace:
runs-on: ${{ github.repository == 'hyperledger/fabric-samples' && 'fabric-ubuntu-22.04' || 'ubuntu-22.04' }} runs-on: ${{ github.repository == 'hyperledger/fabric-samples' && 'fabric-ubuntu-22.04' || 'ubuntu-22.04' }}
@ -59,6 +80,7 @@ jobs:
- name: Checkout - name: Checkout
uses: actions/checkout@v6 uses: actions/checkout@v6
- name: Test the network - name: Test the network
id: run-test
working-directory: test-network-k8s working-directory: test-network-k8s
run: ../ci/scripts/run-k8s-test-network-basic.sh run: ../ci/scripts/run-k8s-test-network-basic.sh
env: env:
@ -68,6 +90,12 @@ jobs:
CHAINCODE_NAME: basic CHAINCODE_NAME: basic
CHAINCODE_LANGUAGE: java CHAINCODE_LANGUAGE: java
CHAINCODE_BUILDER: k8s CHAINCODE_BUILDER: k8s
- name: Upload failure logs
if: ${{ failure() && steps.run-test.conclusion == 'failure' }}
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: ${{ github.job }}-logs
path: test-network-k8s/network-debug.log
bft-orderer: bft-orderer:
runs-on: ${{ github.repository == 'hyperledger/fabric-samples' && 'fabric-ubuntu-22.04' || 'ubuntu-22.04' }} runs-on: ${{ github.repository == 'hyperledger/fabric-samples' && 'fabric-ubuntu-22.04' || 'ubuntu-22.04' }}
@ -78,6 +106,7 @@ jobs:
- name: Checkout - name: Checkout
uses: actions/checkout@v6 uses: actions/checkout@v6
- name: Test the network - name: Test the network
id: run-test
working-directory: test-network-k8s working-directory: test-network-k8s
run: ../ci/scripts/run-k8s-test-network-basic.sh run: ../ci/scripts/run-k8s-test-network-basic.sh
env: env:
@ -87,3 +116,9 @@ jobs:
# To test BFT Orderers, Fabric v3.x is explicitly specified here. # To test BFT Orderers, Fabric v3.x is explicitly specified here.
FABRIC_VERSION: '3.1' FABRIC_VERSION: '3.1'
ORDERER_TYPE: bft ORDERER_TYPE: bft
- name: Upload failure logs
if: ${{ failure() && steps.run-test.conclusion == 'failure' }}
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: ${{ github.job }}-logs
path: test-network-k8s/network-debug.log

View file

@ -83,7 +83,7 @@ public final class AssetTransferTest {
} }
@Override @Override
public void close() throws Exception { public void close() {
// do nothing // do nothing
} }

View file

@ -169,7 +169,7 @@ public final class App implements AutoCloseable {
} }
@Override @Override
public void close() throws Exception { public void close() {
executor.shutdownNow(); executor.shutdownNow();
} }
} }

View file

@ -70,7 +70,7 @@ public class ERC721TokenContractTest {
} }
@Override @Override
public void close() throws Exception { public void close() {
// do nothing // do nothing
} }
} }