jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1380366 - /jmeter/trunk/src/jorphan/org/apache/jorphan/util/Converter.java
Date Mon, 03 Sep 2012 21:23:17 GMT
Author: pmouawad
Date: Mon Sep  3 21:23:17 2012
New Revision: 1380366

URL: http://svn.apache.org/viewvc?rev=1380366&view=rev
Log:
Remove useless null test
use parseBoolean

Modified:
    jmeter/trunk/src/jorphan/org/apache/jorphan/util/Converter.java

Modified: jmeter/trunk/src/jorphan/org/apache/jorphan/util/Converter.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/jorphan/org/apache/jorphan/util/Converter.java?rev=1380366&r1=1380365&r2=1380366&view=diff
==============================================================================
--- jmeter/trunk/src/jorphan/org/apache/jorphan/util/Converter.java (original)
+++ jmeter/trunk/src/jorphan/org/apache/jorphan/util/Converter.java Mon Sep  3 21:23:17 2012
@@ -82,7 +82,7 @@ public class Converter {
      */
     public static Calendar getCalendar(Object date, Calendar defaultValue) {
         Calendar cal = new GregorianCalendar();
-        if (date != null && date instanceof java.util.Date) {
+        if (date instanceof java.util.Date) {
             cal.setTime((java.util.Date) date);
             return cal;
         } else if (date != null) {
@@ -125,7 +125,7 @@ public class Converter {
 
     public static Date getDate(Object date, Date defaultValue) {
         Date val = null;
-        if (date != null && date instanceof java.util.Date) {
+        if (date instanceof java.util.Date) {
             return (Date) date;
         } else if (date != null) {
             DateFormat formatter = DateFormat.getDateInstance(DateFormat.SHORT);
@@ -202,7 +202,7 @@ public class Converter {
         } else if (o instanceof Boolean) {
             return ((Boolean) o).booleanValue();
         }
-        return Boolean.valueOf(o.toString()).booleanValue();
+        return Boolean.parseBoolean(o.toString());
     }
 
     /**



Mime
View raw message