jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1860521 - in /jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control: CacheManager.java DNSCacheManager.java
Date Sun, 02 Jun 2019 12:37:35 GMT
Author: pmouawad
Date: Sun Jun  2 12:37:35 2019
New Revision: 1860521

URL: http://svn.apache.org/viewvc?rev=1860521&view=rev
Log:
Fix Sonar false positive on Exception handling

Modified:
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/CacheManager.java
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/DNSCacheManager.java

Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/CacheManager.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/CacheManager.java?rev=1860521&r1=1860520&r2=1860521&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/CacheManager.java
(original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/CacheManager.java
Sun Jun  2 12:37:35 2019
@@ -274,9 +274,9 @@ public class CacheManager extends Config
         try {
             expiresDate = org.apache.http.client.utils.DateUtils
                     .parseDate(expires);
-        } catch (IllegalArgumentException e) {
+        } catch (IllegalArgumentException e) { // Exception handled by return
             if (log.isDebugEnabled()) {
-                log.debug("Unable to parse Expires: '{}' {}", expires, e.toString());
+                log.debug("Unable to parse Expires: '{}', exception: {}", expires, e);
             }
             expiresDate = CacheManager.EXPIRED_DATE; // invalid dates must be
                                                      // treated as expired

Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/DNSCacheManager.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/DNSCacheManager.java?rev=1860521&r1=1860520&r2=1860521&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/DNSCacheManager.java
(original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/DNSCacheManager.java
Sun Jun  2 12:37:35 2019
@@ -286,8 +286,8 @@ public class DNSCacheManager extends Con
             for (int i = 0; i < records.length; i++) {
                 addresses[i] = ((ARecord) records[i]).getAddress();
             }
-        } catch (TextParseException tpe) {
-            log.debug("Failed to create Lookup object: {}", tpe.toString());
+        } catch (TextParseException tpe) { // NOSONAR Exception handled
+            log.debug("Failed to create Lookup object for host:{}, error message:{}", host,
tpe.toString());
         }
         return addresses;
     }



Mime
View raw message