From 53dbd2fc79fb0451eff50b05d9f13c69dbd8156f Mon Sep 17 00:00:00 2001 From: Rohail Iqbal Date: Sat, 29 Oct 2022 14:01:09 +0000 Subject: [PATCH 1/3] added runtime exception catch block done this to resolve spotbugs fix --- .../plugins/http_request/auth/CertificateAuthentication.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/jenkins/plugins/http_request/auth/CertificateAuthentication.java b/src/main/java/jenkins/plugins/http_request/auth/CertificateAuthentication.java index 54d44a57..fd340b80 100644 --- a/src/main/java/jenkins/plugins/http_request/auth/CertificateAuthentication.java +++ b/src/main/java/jenkins/plugins/http_request/auth/CertificateAuthentication.java @@ -35,7 +35,10 @@ public CloseableHttpClient authenticate(HttpClientBuilder clientBuilder, credentials.getPassword().getPlainText().toCharArray()).build()); return clientBuilder.build(); - } catch (Exception e) { + }catch(RuntimeException e){ + throw new RuntimeException(); + } + catch (Exception e) { throw new IOException(e); } } From cacb31e89a367eeb08d80d21963f6124ad4eeb05 Mon Sep 17 00:00:00 2001 From: Rohail Iqbal Date: Sat, 29 Oct 2022 14:03:27 +0000 Subject: [PATCH 2/3] Removed Rec-catch-exception block from spotbugs-excludes --- src/spotbugs/spotbugs-excludes.xml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/spotbugs/spotbugs-excludes.xml b/src/spotbugs/spotbugs-excludes.xml index 7b5ec41f..a8d4a31f 100644 --- a/src/spotbugs/spotbugs-excludes.xml +++ b/src/spotbugs/spotbugs-excludes.xml @@ -14,12 +14,6 @@ - - - - - - From f7a543f1778054006e6149ab0da663312ef14832 Mon Sep 17 00:00:00 2001 From: Rohail Iqbal Date: Sat, 29 Oct 2022 14:36:32 +0000 Subject: [PATCH 3/3] added reference to the exception --- .../plugins/http_request/auth/CertificateAuthentication.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/jenkins/plugins/http_request/auth/CertificateAuthentication.java b/src/main/java/jenkins/plugins/http_request/auth/CertificateAuthentication.java index fd340b80..1fe70302 100644 --- a/src/main/java/jenkins/plugins/http_request/auth/CertificateAuthentication.java +++ b/src/main/java/jenkins/plugins/http_request/auth/CertificateAuthentication.java @@ -36,7 +36,7 @@ public CloseableHttpClient authenticate(HttpClientBuilder clientBuilder, return clientBuilder.build(); }catch(RuntimeException e){ - throw new RuntimeException(); + throw new RuntimeException(e); } catch (Exception e) { throw new IOException(e);