ashishm07 commented on code in PR #7122:
URL: https://github.com/apache/ignite-3/pull/7122#discussion_r2603995928


##########
examples/java/src/main/java/org/apache/ignite/example/code/deployment/AbstractDeploymentUnitExample.java:
##########
@@ -0,0 +1,57 @@
+package org.apache.ignite.example.code.deployment;
+
+import java.io.IOException;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.Map;
+import org.apache.ignite.example.util.DeployComputeUnit;
+
+public class AbstractDeploymentUnitExample {
+
+    // Root path of ignite-examples/
+    protected static final Path projectRoot =
+            Paths.get("").toAbsolutePath();
+
+    // Compiled class output when running from IDE/CLI
+    protected static final Path DEFAULT_CLASSES_DIR =
+            projectRoot.resolve("examples/java/build/classes/java/main");
+
+    // Default JAR output
+    protected static final Path DEFAULT_JAR_PATH =
+            Path.of("build/libs/deploymentunit-example-1.0.0.jar");
+
+    protected static volatile String jarPathAsString = "";
+    protected static volatile Path jarPath = DEFAULT_JAR_PATH;
+    protected static volatile boolean runFromIDE = true;
+    // ---------------------------------------------------
+
+    /**
+     * Processes the deployment unit.
+     *
+     * @param args Arguments passed to the deployment process.
+     * @throws IOException if any error occurs.
+     */
+    protected static synchronized void processDeploymentUnit(String[] args)

Review Comment:
   The earlier commit failed the PMD sanity check, which is why I initially 
modified the class to follow the Singleton pattern. After the PR review, I’m 
revising the implementation again to remove those unnecessary additions while 
still keeping the sanity checks passing.



##########
examples/java/src/main/java/org/apache/ignite/example/code/deployment/AbstractDeploymentUnitExample.java:
##########
@@ -0,0 +1,57 @@
+package org.apache.ignite.example.code.deployment;
+
+import java.io.IOException;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.Map;
+import org.apache.ignite.example.util.DeployComputeUnit;
+
+public class AbstractDeploymentUnitExample {
+
+    // Root path of ignite-examples/
+    protected static final Path projectRoot =
+            Paths.get("").toAbsolutePath();
+
+    // Compiled class output when running from IDE/CLI
+    protected static final Path DEFAULT_CLASSES_DIR =
+            projectRoot.resolve("examples/java/build/classes/java/main");
+
+    // Default JAR output
+    protected static final Path DEFAULT_JAR_PATH =
+            Path.of("build/libs/deploymentunit-example-1.0.0.jar");
+
+    protected static volatile String jarPathAsString = "";

Review Comment:
   The earlier commit failed the PMD sanity check, which is why I initially 
modified the class to follow the Singleton pattern. After the PR review, I’m 
revising the implementation again to remove those unnecessary additions while 
still keeping the sanity checks passing.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to