You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@activemq.apache.org by GitBox <gi...@apache.org> on 2022/10/14 18:12:09 UTC

[GitHub] [activemq-artemis] clebertsuconic commented on a diff in pull request #4258: ARTEMIS-4025 Fixing testsuite by adding json missing dependencies

clebertsuconic commented on code in PR #4258:
URL: https://github.com/apache/activemq-artemis/pull/4258#discussion_r996014119


##########
artemis-server/src/main/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImpl.java:
##########
@@ -415,8 +415,27 @@ public class ConfigurationImpl implements Configuration, Serializable {
     * Parent folder for all data folders.
     */
    private File artemisInstance;
-   private transient JsonObject status = JsonLoader.createObjectBuilder().build();
-   private final transient Checksum checksum = new Adler32();
+   private transient JsonObject jsonStatus = JsonLoader.createObjectBuilder().build();
+   private transient Checksum transientChecksum = null;
+
+
+   private JsonObject getJsonStatus() {
+      if (jsonStatus == null) {
+         jsonStatus = JsonLoader.createObjectBuilder().build();
+      }
+      return jsonStatus;
+   }
+
+   // Checksum would be otherwise final
+   // however some Quorum actiations are using Serialization to make a deep copy of ConfigurationImpl and it would become null
+   // for that reason this i making the proper initialization when needed.
+   private Checksum getCheckSun() {
+      if (transientChecksum == null) {
+         transientChecksum = new Adler32();
+      }
+      return transientChecksum;
+   }
+
 

Review Comment:
   @gtully  please review this?
   
   
   
   I just want to get the test suite back running again... so I will probably merge this pretty fast... but if you have a better fix please commit on top of this please?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@activemq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org