From 7ce6cb4e2a08173445fb09ff21b6c8fdcccae1f0 Mon Sep 17 00:00:00 2001 From: Huzaifa Ahmed Date: Wed, 26 Oct 2022 14:04:11 +0500 Subject: [PATCH] Fix spotbugs minor issues --- .../plugins/jenkins/dto/AutomatedRunResultsDTO.java | 2 +- .../java/com/testlio/plugins/jenkins/dto/BrowsersDTO.java | 2 +- .../java/com/testlio/plugins/jenkins/dto/DevicesDTO.java | 2 +- .../testlio/plugins/jenkins/dto/RunConfigurationDTO.java | 8 ++++---- src/main/java/com/testlio/plugins/jenkins/dto/RunDTO.java | 2 +- .../java/com/testlio/plugins/jenkins/dto/UploadDTO.java | 2 +- .../plugins/jenkins/validation/FieldValidations.java | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/testlio/plugins/jenkins/dto/AutomatedRunResultsDTO.java b/src/main/java/com/testlio/plugins/jenkins/dto/AutomatedRunResultsDTO.java index e4b8e24..91a35c7 100644 --- a/src/main/java/com/testlio/plugins/jenkins/dto/AutomatedRunResultsDTO.java +++ b/src/main/java/com/testlio/plugins/jenkins/dto/AutomatedRunResultsDTO.java @@ -7,7 +7,7 @@ public class AutomatedRunResultsDTO { private Result results; @Data - public class Result { + public static class Result { private String result; } } diff --git a/src/main/java/com/testlio/plugins/jenkins/dto/BrowsersDTO.java b/src/main/java/com/testlio/plugins/jenkins/dto/BrowsersDTO.java index 6ca7088..8235385 100644 --- a/src/main/java/com/testlio/plugins/jenkins/dto/BrowsersDTO.java +++ b/src/main/java/com/testlio/plugins/jenkins/dto/BrowsersDTO.java @@ -10,7 +10,7 @@ public class BrowsersDTO { private List data; @Data - public class BrowserData { + public static class BrowserData { private String href; private String id; private String browserName; diff --git a/src/main/java/com/testlio/plugins/jenkins/dto/DevicesDTO.java b/src/main/java/com/testlio/plugins/jenkins/dto/DevicesDTO.java index 01d3ead..4ba1c3a 100644 --- a/src/main/java/com/testlio/plugins/jenkins/dto/DevicesDTO.java +++ b/src/main/java/com/testlio/plugins/jenkins/dto/DevicesDTO.java @@ -10,7 +10,7 @@ public class DevicesDTO { private List data; @Data - public class DeviceData { + public static class DeviceData { private String href; private String id; private String model; diff --git a/src/main/java/com/testlio/plugins/jenkins/dto/RunConfigurationDTO.java b/src/main/java/com/testlio/plugins/jenkins/dto/RunConfigurationDTO.java index 843da15..c1f78b3 100644 --- a/src/main/java/com/testlio/plugins/jenkins/dto/RunConfigurationDTO.java +++ b/src/main/java/com/testlio/plugins/jenkins/dto/RunConfigurationDTO.java @@ -9,7 +9,7 @@ public class RunConfigurationDTO { private List data; @Data - public class RunConfigurationData { + public static class RunConfigurationData { private String href; private String guid; private String runHref; @@ -23,11 +23,11 @@ public class RunConfigurationData { private ExecutionConfiguration executionConfiguration; @Data - public class Configuration { + public static class Configuration { private String networkProfileName; private Radios radios; @Data - public class Radios { + public static class Radios { private boolean wifi; private boolean bluetooth; private boolean gps; @@ -35,7 +35,7 @@ public class Radios { } } @Data - public class ExecutionConfiguration { + public static class ExecutionConfiguration { private boolean videoCapture; private int jobTimeoutMinutes; } diff --git a/src/main/java/com/testlio/plugins/jenkins/dto/RunDTO.java b/src/main/java/com/testlio/plugins/jenkins/dto/RunDTO.java index e15c9a9..29e6242 100644 --- a/src/main/java/com/testlio/plugins/jenkins/dto/RunDTO.java +++ b/src/main/java/com/testlio/plugins/jenkins/dto/RunDTO.java @@ -15,7 +15,7 @@ public class RunDTO { private Href configuration; @Data - public class Href { + public static class Href { private String href; } } diff --git a/src/main/java/com/testlio/plugins/jenkins/dto/UploadDTO.java b/src/main/java/com/testlio/plugins/jenkins/dto/UploadDTO.java index bd51604..a36b872 100644 --- a/src/main/java/com/testlio/plugins/jenkins/dto/UploadDTO.java +++ b/src/main/java/com/testlio/plugins/jenkins/dto/UploadDTO.java @@ -9,7 +9,7 @@ public class UploadDTO { private Href put; private Href get; @Data - public class Href { + public static class Href { private URL href; } } diff --git a/src/main/java/com/testlio/plugins/jenkins/validation/FieldValidations.java b/src/main/java/com/testlio/plugins/jenkins/validation/FieldValidations.java index 8818dfa..9a13958 100644 --- a/src/main/java/com/testlio/plugins/jenkins/validation/FieldValidations.java +++ b/src/main/java/com/testlio/plugins/jenkins/validation/FieldValidations.java @@ -44,7 +44,7 @@ public static FileDTO downloadFileFromURL(String URL) { return ret; }); - if(file.length() > FILE_MAX_SIZE) { + if(file!=null && file.length() > FILE_MAX_SIZE) { throw new IllegalArgumentException("Uploading "+fileDTO.getFileName()+" failed: max. file size "+FILE_MAX_SIZE/ONE_GB_IN_BYTES+"GB"); } fileDTO.setFile(file);