You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by th...@apache.org on 2017/07/07 02:05:47 UTC

[12/50] commons-dbutils git commit: Findbugs: don't expose internal mutable state

Findbugs: don't expose internal mutable state

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/dbutils/trunk@1611129 13f79535-47bb-0310-9956-ffa450edef68


Project: http://git-wip-us.apache.org/repos/asf/commons-dbutils/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-dbutils/commit/22183c68
Tree: http://git-wip-us.apache.org/repos/asf/commons-dbutils/tree/22183c68
Diff: http://git-wip-us.apache.org/repos/asf/commons-dbutils/diff/22183c68

Branch: refs/heads/master
Commit: 22183c68c099696d71e3a953dff52b95f688aac3
Parents: b76da88
Author: Benedikt Ritter <br...@apache.org>
Authored: Wed Jul 16 18:39:33 2014 +0000
Committer: Benedikt Ritter <br...@apache.org>
Committed: Wed Jul 16 18:39:33 2014 +0000

----------------------------------------------------------------------
 .../commons/dbutils/wrappers/SqlNullCheckedResultSet.java    | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-dbutils/blob/22183c68/src/main/java/org/apache/commons/dbutils/wrappers/SqlNullCheckedResultSet.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/dbutils/wrappers/SqlNullCheckedResultSet.java b/src/main/java/org/apache/commons/dbutils/wrappers/SqlNullCheckedResultSet.java
index a83735c..f8d1d3f 100644
--- a/src/main/java/org/apache/commons/dbutils/wrappers/SqlNullCheckedResultSet.java
+++ b/src/main/java/org/apache/commons/dbutils/wrappers/SqlNullCheckedResultSet.java
@@ -253,7 +253,7 @@ public class SqlNullCheckedResultSet implements InvocationHandler {
      * @return the value
      */
     public Date getNullDate() {
-        return this.nullDate;
+        return this.nullDate != null ? new Date(this.nullDate.getTime()) : null;
     }
 
     /**
@@ -353,7 +353,7 @@ public class SqlNullCheckedResultSet implements InvocationHandler {
      * @return the value
      */
     public Timestamp getNullTimestamp() {
-        return this.nullTimestamp;
+        return this.nullTimestamp != null ? new Timestamp(this.nullTimestamp.getTime()) : null;
     }
 
     /**
@@ -492,7 +492,7 @@ public class SqlNullCheckedResultSet implements InvocationHandler {
      * @param nullDate the value
      */
     public void setNullDate(Date nullDate) {
-        this.nullDate = nullDate;
+        this.nullDate = nullDate != null ? new Date(nullDate.getTime()) : null;
     }
 
     /**
@@ -592,7 +592,7 @@ public class SqlNullCheckedResultSet implements InvocationHandler {
      * @param nullTimestamp the value
      */
     public void setNullTimestamp(Timestamp nullTimestamp) {
-        this.nullTimestamp = nullTimestamp;
+        this.nullTimestamp = nullTimestamp != null ? new Timestamp(nullTimestamp.getTime()) : null;
     }
 
     /**