[2/3] syncope git commit: FindBugs sweep of common
FindBugs sweep of common Project: http://git-wip-us.apache.org/repos/asf/syncope/repo Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/379e3e45 Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/379e3e45 Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/379e3e45 Branch: refs/heads/2_0_X Commit: 379e3e45c89b4c5356ace7df6107eccde5d38887 Parents: c4ed6e9 Author: Colm O hEigeartaighAuthored: Wed Dec 7 11:48:38 2016 + Committer: Francesco Chicchiriccò Committed: Wed Dec 7 13:27:19 2016 +0100 -- .../common/lib/to/AbstractAnnotatedBean.java| 22 -- .../apache/syncope/common/lib/to/UserTO.java| 31 ++ .../syncope/common/lib/to/WorkflowFormTO.java | 22 -- .../syncope/common/rest/api/beans/AnyQuery.java | 2 +- .../rest/api/beans/BulkExecDeleteQuery.java | 44 .../rest/api/beans/ConnObjectTOListQuery.java | 4 +- .../common/rest/api/beans/ExecuteQuery.java | 13 -- .../common/rest/api/beans/TaskQuery.java| 2 +- 8 files changed, 110 insertions(+), 30 deletions(-) -- http://git-wip-us.apache.org/repos/asf/syncope/blob/379e3e45/common/lib/src/main/java/org/apache/syncope/common/lib/to/AbstractAnnotatedBean.java -- diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/to/AbstractAnnotatedBean.java b/common/lib/src/main/java/org/apache/syncope/common/lib/to/AbstractAnnotatedBean.java index c0f7155..1459211 100644 --- a/common/lib/src/main/java/org/apache/syncope/common/lib/to/AbstractAnnotatedBean.java +++ b/common/lib/src/main/java/org/apache/syncope/common/lib/to/AbstractAnnotatedBean.java @@ -73,11 +73,18 @@ public class AbstractAnnotatedBean extends AbstractBaseBean { } public Date getCreationDate() { -return creationDate; +if (creationDate != null) { +return new Date(creationDate.getTime()); +} +return null; } public void setCreationDate(final Date creationDate) { -this.creationDate = creationDate; +if (creationDate != null) { +this.creationDate = new Date(creationDate.getTime()); +} else { +this.creationDate = null; +} } public String getLastModifier() { @@ -89,11 +96,18 @@ public class AbstractAnnotatedBean extends AbstractBaseBean { } public Date getLastChangeDate() { -return lastChangeDate; +if (lastChangeDate != null) { +return new Date(lastChangeDate.getTime()); +} +return null; } public void setLastChangeDate(final Date lastChangeDate) { -this.lastChangeDate = lastChangeDate; +if (lastChangeDate != null) { +this.lastChangeDate = new Date(lastChangeDate.getTime()); +} else { +this.lastChangeDate = null; +} } @JsonIgnore http://git-wip-us.apache.org/repos/asf/syncope/blob/379e3e45/common/lib/src/main/java/org/apache/syncope/common/lib/to/UserTO.java -- diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/to/UserTO.java b/common/lib/src/main/java/org/apache/syncope/common/lib/to/UserTO.java index 4ec8181..c575d90 100644 --- a/common/lib/src/main/java/org/apache/syncope/common/lib/to/UserTO.java +++ b/common/lib/src/main/java/org/apache/syncope/common/lib/to/UserTO.java @@ -113,14 +113,17 @@ public class UserTO extends AnyTO implements GroupableRelatableTO { } public Date getTokenExpireTime() { -return tokenExpireTime == null -? null -: new Date(tokenExpireTime.getTime()); +if (tokenExpireTime != null) { +return new Date(tokenExpireTime.getTime()); +} +return null; } public void setTokenExpireTime(final Date tokenExpireTime) { if (tokenExpireTime != null) { this.tokenExpireTime = new Date(tokenExpireTime.getTime()); +} else { +this.tokenExpireTime = null; } } @@ -133,7 +136,10 @@ public class UserTO extends AnyTO implements GroupableRelatableTO { } public Date getChangePwdDate() { -return changePwdDate; +if (changePwdDate != null) { +return new Date(changePwdDate.getTime()); +} +return null; } public Integer getFailedLogins() { @@ -141,11 +147,18 @@ public class UserTO extends AnyTO implements GroupableRelatableTO { } public Date getLastLoginDate() { -return lastLoginDate; +if (lastLoginDate != null) { +return new Date(lastLoginDate.getTime()); +} +return null; } public void
syncope git commit: FindBugs sweep of common
Repository: syncope Updated Branches: refs/heads/master 8a78765ee -> 5cab8afc9 FindBugs sweep of common Project: http://git-wip-us.apache.org/repos/asf/syncope/repo Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/5cab8afc Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/5cab8afc Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/5cab8afc Branch: refs/heads/master Commit: 5cab8afc94a1520accfcbeac30ab7da4a3dcc1ab Parents: 8a78765 Author: Colm O hEigeartaighAuthored: Wed Dec 7 11:48:38 2016 + Committer: Colm O hEigeartaigh Committed: Wed Dec 7 11:48:38 2016 + -- .../common/lib/to/AbstractAnnotatedBean.java| 22 -- .../apache/syncope/common/lib/to/UserTO.java| 31 ++ .../syncope/common/lib/to/WorkflowFormTO.java | 22 -- .../syncope/common/rest/api/beans/AnyQuery.java | 2 +- .../rest/api/beans/BulkExecDeleteQuery.java | 44 .../rest/api/beans/ConnObjectTOListQuery.java | 4 +- .../common/rest/api/beans/ExecuteQuery.java | 13 -- .../common/rest/api/beans/TaskQuery.java| 2 +- 8 files changed, 110 insertions(+), 30 deletions(-) -- http://git-wip-us.apache.org/repos/asf/syncope/blob/5cab8afc/common/lib/src/main/java/org/apache/syncope/common/lib/to/AbstractAnnotatedBean.java -- diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/to/AbstractAnnotatedBean.java b/common/lib/src/main/java/org/apache/syncope/common/lib/to/AbstractAnnotatedBean.java index c0f7155..1459211 100644 --- a/common/lib/src/main/java/org/apache/syncope/common/lib/to/AbstractAnnotatedBean.java +++ b/common/lib/src/main/java/org/apache/syncope/common/lib/to/AbstractAnnotatedBean.java @@ -73,11 +73,18 @@ public class AbstractAnnotatedBean extends AbstractBaseBean { } public Date getCreationDate() { -return creationDate; +if (creationDate != null) { +return new Date(creationDate.getTime()); +} +return null; } public void setCreationDate(final Date creationDate) { -this.creationDate = creationDate; +if (creationDate != null) { +this.creationDate = new Date(creationDate.getTime()); +} else { +this.creationDate = null; +} } public String getLastModifier() { @@ -89,11 +96,18 @@ public class AbstractAnnotatedBean extends AbstractBaseBean { } public Date getLastChangeDate() { -return lastChangeDate; +if (lastChangeDate != null) { +return new Date(lastChangeDate.getTime()); +} +return null; } public void setLastChangeDate(final Date lastChangeDate) { -this.lastChangeDate = lastChangeDate; +if (lastChangeDate != null) { +this.lastChangeDate = new Date(lastChangeDate.getTime()); +} else { +this.lastChangeDate = null; +} } @JsonIgnore http://git-wip-us.apache.org/repos/asf/syncope/blob/5cab8afc/common/lib/src/main/java/org/apache/syncope/common/lib/to/UserTO.java -- diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/to/UserTO.java b/common/lib/src/main/java/org/apache/syncope/common/lib/to/UserTO.java index 4ec8181..c575d90 100644 --- a/common/lib/src/main/java/org/apache/syncope/common/lib/to/UserTO.java +++ b/common/lib/src/main/java/org/apache/syncope/common/lib/to/UserTO.java @@ -113,14 +113,17 @@ public class UserTO extends AnyTO implements GroupableRelatableTO { } public Date getTokenExpireTime() { -return tokenExpireTime == null -? null -: new Date(tokenExpireTime.getTime()); +if (tokenExpireTime != null) { +return new Date(tokenExpireTime.getTime()); +} +return null; } public void setTokenExpireTime(final Date tokenExpireTime) { if (tokenExpireTime != null) { this.tokenExpireTime = new Date(tokenExpireTime.getTime()); +} else { +this.tokenExpireTime = null; } } @@ -133,7 +136,10 @@ public class UserTO extends AnyTO implements GroupableRelatableTO { } public Date getChangePwdDate() { -return changePwdDate; +if (changePwdDate != null) { +return new Date(changePwdDate.getTime()); +} +return null; } public Integer getFailedLogins() { @@ -141,11 +147,18 @@ public class UserTO extends AnyTO implements GroupableRelatableTO { } public Date getLastLoginDate() { -return lastLoginDate; +if (lastLoginDate != null) { +return new