ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject [5/6] ant git commit: stick with RuntimeExceptions to prevent recursive logging loops
Date Thu, 22 Dec 2016 06:12:49 GMT
stick with RuntimeExceptions to prevent recursive logging loops


Project: http://git-wip-us.apache.org/repos/asf/ant/repo
Commit: http://git-wip-us.apache.org/repos/asf/ant/commit/7081e356
Tree: http://git-wip-us.apache.org/repos/asf/ant/tree/7081e356
Diff: http://git-wip-us.apache.org/repos/asf/ant/diff/7081e356

Branch: refs/heads/master
Commit: 7081e356a86317bf32635888a6d3cf340dfa9a67
Parents: 0715dda
Author: Stefan Bodewig <bodewig@apache.org>
Authored: Thu Dec 22 07:11:31 2016 +0100
Committer: Stefan Bodewig <bodewig@apache.org>
Committed: Thu Dec 22 07:11:31 2016 +0100

----------------------------------------------------------------------
 src/main/org/apache/tools/ant/XmlLogger.java                | 6 +++---
 src/main/org/apache/tools/ant/listener/MailLogger.java      | 4 ++--
 src/main/org/apache/tools/ant/taskdefs/LogOutputStream.java | 2 +-
 src/main/org/apache/tools/ant/util/DOMElementWriter.java    | 2 +-
 4 files changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ant/blob/7081e356/src/main/org/apache/tools/ant/XmlLogger.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/XmlLogger.java b/src/main/org/apache/tools/ant/XmlLogger.java
index a67a260..d03067d 100644
--- a/src/main/org/apache/tools/ant/XmlLogger.java
+++ b/src/main/org/apache/tools/ant/XmlLogger.java
@@ -264,7 +264,7 @@ public class XmlLogger implements BuildLogger {
             if (!threadStack.empty()) {
                 TimedElement poppedStack = threadStack.pop();
                 if (poppedStack != targetElement) {
-                    throw new RuntimeException("Mismatch - popped element = " + poppedStack
+                    throw new RuntimeException("Mismatch - popped element = " + poppedStack
//NOSONAR
                             + " finished target element = " + targetElement);
                 }
                 if (!threadStack.empty()) {
@@ -316,7 +316,7 @@ public class XmlLogger implements BuildLogger {
         Task task = event.getTask();
         TimedElement taskElement = tasks.get(task);
         if (taskElement == null) {
-            throw new RuntimeException("Unknown task " + task + " not in " + tasks);
+            throw new RuntimeException("Unknown task " + task + " not in " + tasks); //NOSONAR
         }
         long totalTime = System.currentTimeMillis() - taskElement.startTime;
         taskElement.element.setAttribute(TIME_ATTR, DefaultLogger.formatTime(totalTime));
@@ -334,7 +334,7 @@ public class XmlLogger implements BuildLogger {
         if (!threadStack.empty()) {
             TimedElement poppedStack = threadStack.pop();
             if (poppedStack != taskElement) {
-                throw new RuntimeException("Mismatch - popped element = " + poppedStack
+                throw new RuntimeException("Mismatch - popped element = " + poppedStack //NOSONAR
                         + " finished task element = " + taskElement);
             }
         }

http://git-wip-us.apache.org/repos/asf/ant/blob/7081e356/src/main/org/apache/tools/ant/listener/MailLogger.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/listener/MailLogger.java b/src/main/org/apache/tools/ant/listener/MailLogger.java
index 3d5bcd2..45289a1 100644
--- a/src/main/org/apache/tools/ant/listener/MailLogger.java
+++ b/src/main/org/apache/tools/ant/listener/MailLogger.java
@@ -327,7 +327,7 @@ public class MailLogger extends DefaultLogger {
      *      property is not present in properties.
      */
     private String getValue(Hashtable<String, Object> properties, String name,
-                            String defaultValue) throws Exception {
+                            String defaultValue) {
         String propertyName = "MailLogger." + name;
         String value = (String) properties.get(propertyName);
 
@@ -336,7 +336,7 @@ public class MailLogger extends DefaultLogger {
         }
 
         if (value == null) {
-            throw new Exception("Missing required parameter: " + propertyName);
+            throw new RuntimeException("Missing required parameter: " + propertyName); //NOSONAR
         }
 
         return value;

http://git-wip-us.apache.org/repos/asf/ant/blob/7081e356/src/main/org/apache/tools/ant/taskdefs/LogOutputStream.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/taskdefs/LogOutputStream.java b/src/main/org/apache/tools/ant/taskdefs/LogOutputStream.java
index b2c3468..23bb6bd 100644
--- a/src/main/org/apache/tools/ant/taskdefs/LogOutputStream.java
+++ b/src/main/org/apache/tools/ant/taskdefs/LogOutputStream.java
@@ -77,7 +77,7 @@ public class LogOutputStream extends LineOrientedOutputStream {
             super.processBuffer();
         } catch (IOException e) {
             // impossible since *our* processLine doesn't throw an IOException
-            throw new RuntimeException("Impossible IOException caught: " + e);
+            throw new RuntimeException("Impossible IOException caught: " + e); //NOSONAR
         }
     }
 

http://git-wip-us.apache.org/repos/asf/ant/blob/7081e356/src/main/org/apache/tools/ant/util/DOMElementWriter.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/util/DOMElementWriter.java b/src/main/org/apache/tools/ant/util/DOMElementWriter.java
index 14cbaee..cafecf0 100644
--- a/src/main/org/apache/tools/ant/util/DOMElementWriter.java
+++ b/src/main/org/apache/tools/ant/util/DOMElementWriter.java
@@ -494,7 +494,7 @@ public class DOMElementWriter {
         try {
             encodedata(out, value);
         } catch (IOException ex) {
-            throw new RuntimeException(ex);
+            throw new RuntimeException(ex); //NOSONAR
         }
         return out.toString();
     }


Mime
View raw message