This is an automated email from the ASF dual-hosted git repository.

dionusos pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/oozie.git


The following commit(s) were added to refs/heads/master by this push:
     new b5d2b9022 OOZIE-3695 [sharelib-hive2] Fix current SpotBugs discovered 
issues in Oozie's sharelib-hive2 module (jmakai via dionusos)
b5d2b9022 is described below

commit b5d2b90229ca9ddef852ea865405e84f3a0fec31
Author: Denes Bodo <dionu...@apache.org>
AuthorDate: Fri Feb 3 09:52:48 2023 +0100

    OOZIE-3695 [sharelib-hive2] Fix current SpotBugs discovered issues in 
Oozie's sharelib-hive2 module (jmakai via dionusos)
---
 release-log.txt                                                     | 1 +
 sharelib/hive2/pom.xml                                              | 5 +++++
 .../src/main/java/org/apache/oozie/action/hadoop/Hive2Main.java     | 6 +++++-
 3 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/release-log.txt b/release-log.txt
index 9eda2c7f5..e3ecb1eab 100644
--- a/release-log.txt
+++ b/release-log.txt
@@ -1,5 +1,6 @@
 -- Oozie 5.3.0 release (trunk - unreleased)
 
+OOZIE-3695 [sharelib-hive2] Fix current SpotBugs discovered issues in Oozie's 
sharelib-hive2 module (jmakai via dionusos)
 OOZIE-3694 [sharelib-hive] Fix current SpotBugs discovered issues in Oozie's 
sharelib-hive module (jmakai via dionusos)
 OOZIE-3690 [server] Fix current SpotBugs discovered issues in Oozie's server 
module (jmakai via dionusos)
 OOZIE-3692 [sharelib-spark] Fix current SpotBugs discovered issues in Oozie's 
sharelib-spark module (jmakai via dionusos)
diff --git a/sharelib/hive2/pom.xml b/sharelib/hive2/pom.xml
index e0362e028..95ba457db 100644
--- a/sharelib/hive2/pom.xml
+++ b/sharelib/hive2/pom.xml
@@ -234,6 +234,11 @@
             <artifactId>jline</artifactId>
             <version>${hive.jline.version}</version>
         </dependency>
+        <dependency>
+            <groupId>com.github.spotbugs</groupId>
+            <artifactId>spotbugs-annotations</artifactId>
+            <scope>provided</scope>
+        </dependency>
     </dependencies>
 
     <build>
diff --git 
a/sharelib/hive2/src/main/java/org/apache/oozie/action/hadoop/Hive2Main.java 
b/sharelib/hive2/src/main/java/org/apache/oozie/action/hadoop/Hive2Main.java
index aeec544ee..fb06a899a 100644
--- a/sharelib/hive2/src/main/java/org/apache/oozie/action/hadoop/Hive2Main.java
+++ b/sharelib/hive2/src/main/java/org/apache/oozie/action/hadoop/Hive2Main.java
@@ -40,6 +40,7 @@ import org.apache.hadoop.fs.Path;
 import org.apache.hive.beeline.BeeLine;
 
 import com.google.common.annotations.VisibleForTesting;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 
 public class Hive2Main extends LauncherMain {
     @VisibleForTesting
@@ -103,6 +104,7 @@ public class Hive2Main extends LauncherMain {
         return actionConf;
     }
 
+    @SuppressFBWarnings(value = "PATH_TRAVERSAL_IN", justification = "Hive 
script file created without user input")
     @Override
     protected void run(String[] args) throws Exception {
         System.out.println();
@@ -266,6 +268,7 @@ public class Hive2Main extends LauncherMain {
         return filename;
     }
 
+    @SuppressFBWarnings(value ="PATH_TRAVERSAL_OUT", justification = "Path is 
created runtime")
     private void runBeeline(String[] args, String logFile) throws Exception {
         // We do this instead of calling BeeLine.main so we can duplicate the 
error stream for harvesting Hadoop child job IDs
         BeeLine beeLine = new BeeLine();
@@ -274,10 +277,11 @@ public class Hive2Main extends LauncherMain {
         int status = beeLine.begin(args, null);
         beeLine.close();
         if (status != 0) {
-            System.exit(status);
+            throw new RuntimeException("Beeline exited with status: " + 
status);
         }
     }
 
+    @SuppressFBWarnings(value = "PATH_TRAVERSAL_IN", justification = "Hive 
script file created without user input")
     private static String readStringFromFile(String filePath) throws 
IOException {
         String line;
         BufferedReader br = null;

Reply via email to