From 60729164c8f5b30f0cf002aa108574ea75052362 Mon Sep 17 00:00:00 2001
From: Cyrus <24922493+cyrus-dev@users.noreply.github.com>
Date: Fri, 19 Jan 2024 07:45:36 -0500
Subject: [PATCH] Last changes that resolve remaining spotbugs issues

---
 HIRS_Utils/config/spotbugs/spotbugs-exclude.xml       |  5 ++++-
 .../utils/tpm/eventlog/events/EvEfiSpecIdEvent.java   | 11 +++++++++--
 .../hirs/utils/tpm/eventlog/uefi/UefiVariable.java    |  1 -
 3 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/HIRS_Utils/config/spotbugs/spotbugs-exclude.xml b/HIRS_Utils/config/spotbugs/spotbugs-exclude.xml
index 0ff59d3f..7a56fa00 100644
--- a/HIRS_Utils/config/spotbugs/spotbugs-exclude.xml
+++ b/HIRS_Utils/config/spotbugs/spotbugs-exclude.xml
@@ -2,7 +2,10 @@
 <!-- Docs at http://findbugs.sourceforge.net/manual/filter.html -->
 <FindBugsFilter>
     <Match>
-	<Package name="~hirs\.utils.xjc.*" />
+	    <Package name="~hirs\.utils.xjc.*" />
+    </Match>
+    <Match>
+        <Package name="~hirs\.utils.rim.*" />
     </Match>
     <Match>
         <!-- https://github.com/spotbugs/spotbugs/pull/2748 -->
diff --git a/HIRS_Utils/src/main/java/hirs/utils/tpm/eventlog/events/EvEfiSpecIdEvent.java b/HIRS_Utils/src/main/java/hirs/utils/tpm/eventlog/events/EvEfiSpecIdEvent.java
index b61b700d..c082d16e 100644
--- a/HIRS_Utils/src/main/java/hirs/utils/tpm/eventlog/events/EvEfiSpecIdEvent.java
+++ b/HIRS_Utils/src/main/java/hirs/utils/tpm/eventlog/events/EvEfiSpecIdEvent.java
@@ -48,40 +48,46 @@ import java.util.List;
  * 6. The version of the log is used to determine which format the Log
  * is to use (sha1 or Crypto Agile)
  */
-@Getter
 public class EvEfiSpecIdEvent {
     /**
      * Minor Version.
      */
+    @Getter
     private String versionMinor = "";
     /**
      * Major Version.
      */
+    @Getter
     private String versionMajor = "";
     /**
      * Specification errata version.
      */
+    @Getter
     private String errata = "";
     /**
      * Signature (text) data.
      */
+    @Getter
     private String signature = "";
     /**
      * Platform class.
      */
+    @Getter
     private String platformClass = "";
     /**
      * Algorithm count.
      */
+    @Getter
     private int numberOfAlg = 0;
     /**
      * True if event log uses Crypto Agile format.
      */
+    @Getter
     private boolean cryptoAgile = false;
     /**
      * Algorithm list.
      */
-    private List<String> algList = new ArrayList<String>();
+    private List<String> algList;
 
     /**
      * EvEfiSpecIdEvent Constructor.
@@ -89,6 +95,7 @@ public class EvEfiSpecIdEvent {
      * @param efiSpecId byte array holding the spec ID Event.
      */
     public EvEfiSpecIdEvent(final byte[] efiSpecId) {
+        algList = new ArrayList<>();
         byte[] signatureBytes = new byte[UefiConstants.SIZE_16];
         System.arraycopy(efiSpecId, 0, signatureBytes, 0, UefiConstants.SIZE_16);
         signature = HexUtils.byteArrayToHexString(signatureBytes);
diff --git a/HIRS_Utils/src/main/java/hirs/utils/tpm/eventlog/uefi/UefiVariable.java b/HIRS_Utils/src/main/java/hirs/utils/tpm/eventlog/uefi/UefiVariable.java
index d3e9086d..b6960a88 100644
--- a/HIRS_Utils/src/main/java/hirs/utils/tpm/eventlog/uefi/UefiVariable.java
+++ b/HIRS_Utils/src/main/java/hirs/utils/tpm/eventlog/uefi/UefiVariable.java
@@ -32,7 +32,6 @@ public class UefiVariable {
     /**
      * List of Signature lists.
      */
-    @Getter
     private List<UefiSignatureList> certSuperList;
     /**
      * Name of the UEFI variable.