syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject [4/5] syncope git commit: Moving the default toString() style to ToStringStyle.JSON_STYLE
Date Fri, 15 Sep 2017 10:36:27 GMT
Moving the default toString() style to ToStringStyle.JSON_STYLE


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

Branch: refs/heads/master
Commit: ad6c103c95cc58a62fee3b68b18059b59589ebc5
Parents: fcb0d83
Author: Francesco Chicchiriccò <ilgrosso@apache.org>
Authored: Fri Sep 15 12:31:13 2017 +0200
Committer: Francesco Chicchiriccò <ilgrosso@apache.org>
Committed: Fri Sep 15 12:33:41 2017 +0200

----------------------------------------------------------------------
 .../client/console/commons/status/StatusBean.java   |  2 +-
 .../client/console/panels/search/SearchClause.java  |  2 +-
 .../apache/syncope/common/lib/AbstractBaseBean.java |  2 +-
 .../org/apache/syncope/common/lib/to/UserTO.java    | 16 ++--------------
 .../rest/api/beans/ConnObjectTOListQuery.java       |  2 +-
 .../api/dao/search/AbstractSearchCond.java          |  2 +-
 .../persistence/api/dao/search/OrderByClause.java   |  2 +-
 .../jpa/entity/AbstractPlainAttrValue.java          |  2 +-
 .../syncope/core/provisioning/api/IntAttrName.java  |  2 +-
 .../core/provisioning/api/WorkflowResult.java       |  2 +-
 .../provisioning/api/cache/VirAttrCacheKey.java     |  2 +-
 .../java/job/report/AuditReportlet.java             |  6 +++---
 .../security/SyncopeAuthenticationDetails.java      |  2 +-
 .../spring/security/SyncopeGrantedAuthority.java    |  2 +-
 14 files changed, 17 insertions(+), 29 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/ad6c103c/client/console/src/main/java/org/apache/syncope/client/console/commons/status/StatusBean.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/commons/status/StatusBean.java
b/client/console/src/main/java/org/apache/syncope/client/console/commons/status/StatusBean.java
index c8bba79..fe7ce9f 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/commons/status/StatusBean.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/commons/status/StatusBean.java
@@ -96,7 +96,7 @@ public class StatusBean implements Serializable {
 
     @Override
     public String toString() {
-        return ReflectionToStringBuilder.toString(this, ToStringStyle.MULTI_LINE_STYLE);
+        return ReflectionToStringBuilder.toString(this, ToStringStyle.JSON_STYLE);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/syncope/blob/ad6c103c/client/console/src/main/java/org/apache/syncope/client/console/panels/search/SearchClause.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/search/SearchClause.java
b/client/console/src/main/java/org/apache/syncope/client/console/panels/search/SearchClause.java
index 9007485..415abba 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/search/SearchClause.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/search/SearchClause.java
@@ -126,6 +126,6 @@ public final class SearchClause implements Serializable {
 
     @Override
     public String toString() {
-        return ReflectionToStringBuilder.toString(this, ToStringStyle.MULTI_LINE_STYLE);
+        return ReflectionToStringBuilder.toString(this, ToStringStyle.JSON_STYLE);
     }
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/ad6c103c/common/lib/src/main/java/org/apache/syncope/common/lib/AbstractBaseBean.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/AbstractBaseBean.java
b/common/lib/src/main/java/org/apache/syncope/common/lib/AbstractBaseBean.java
index bd8b06e..0187d70 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/AbstractBaseBean.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/AbstractBaseBean.java
@@ -49,6 +49,6 @@ public abstract class AbstractBaseBean implements Serializable {
 
     @Override
     public String toString() {
-        return ReflectionToStringBuilder.toString(this, ToStringStyle.MULTI_LINE_STYLE);
+        return ReflectionToStringBuilder.toString(this, ToStringStyle.JSON_STYLE);
     }
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/ad6c103c/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 3e9cd4d..877b866 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
@@ -20,7 +20,6 @@ package org.apache.syncope.common.lib.to;
 
 import com.fasterxml.jackson.annotation.JsonIgnore;
 import com.fasterxml.jackson.annotation.JsonProperty;
-import java.lang.reflect.Field;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
@@ -29,8 +28,7 @@ import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlElementWrapper;
 import javax.xml.bind.annotation.XmlRootElement;
 import javax.xml.bind.annotation.XmlType;
-import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
-import org.apache.commons.lang3.builder.ToStringStyle;
+import org.apache.commons.lang3.builder.ToStringExclude;
 import org.apache.syncope.common.lib.types.AnyTypeKind;
 
 @XmlRootElement(name = "user")
@@ -39,6 +37,7 @@ public class UserTO extends AnyTO implements GroupableRelatableTO {
 
     private static final long serialVersionUID = 7791304495192615740L;
 
+    @ToStringExclude
     private String password;
 
     private final List<String> roles = new ArrayList<>();
@@ -231,15 +230,4 @@ public class UserTO extends AnyTO implements GroupableRelatableTO {
     public List<MembershipTO> getDynMemberships() {
         return dynMemberships;
     }
-
-    @Override
-    public String toString() {
-        return new ReflectionToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) {
-
-            @Override
-            protected boolean accept(final Field f) {
-                return super.accept(f) && !f.getName().equals("password");
-            }
-        }.toString();
-    }
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/ad6c103c/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/beans/ConnObjectTOListQuery.java
----------------------------------------------------------------------
diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/beans/ConnObjectTOListQuery.java
b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/beans/ConnObjectTOListQuery.java
index 16d0e66..951c29d 100644
--- a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/beans/ConnObjectTOListQuery.java
+++ b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/beans/ConnObjectTOListQuery.java
@@ -112,6 +112,6 @@ public class ConnObjectTOListQuery implements Serializable {
 
     @Override
     public String toString() {
-        return ReflectionToStringBuilder.toString(this, ToStringStyle.MULTI_LINE_STYLE);
+        return ReflectionToStringBuilder.toString(this, ToStringStyle.JSON_STYLE);
     }
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/ad6c103c/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/search/AbstractSearchCond.java
----------------------------------------------------------------------
diff --git a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/search/AbstractSearchCond.java
b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/search/AbstractSearchCond.java
index 2087bc7..d84083c 100644
--- a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/search/AbstractSearchCond.java
+++ b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/search/AbstractSearchCond.java
@@ -40,7 +40,7 @@ public abstract class AbstractSearchCond implements Serializable {
 
     @Override
     public String toString() {
-        return ReflectionToStringBuilder.toString(this, ToStringStyle.MULTI_LINE_STYLE);
+        return ReflectionToStringBuilder.toString(this, ToStringStyle.JSON_STYLE);
     }
 
     public abstract boolean isValid();

http://git-wip-us.apache.org/repos/asf/syncope/blob/ad6c103c/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/search/OrderByClause.java
----------------------------------------------------------------------
diff --git a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/search/OrderByClause.java
b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/search/OrderByClause.java
index 8d4b978..5fa9e79 100644
--- a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/search/OrderByClause.java
+++ b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/search/OrderByClause.java
@@ -67,6 +67,6 @@ public class OrderByClause implements Serializable {
 
     @Override
     public String toString() {
-        return ReflectionToStringBuilder.toString(this, ToStringStyle.MULTI_LINE_STYLE);
+        return ReflectionToStringBuilder.toString(this, ToStringStyle.JSON_STYLE);
     }
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/ad6c103c/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/AbstractPlainAttrValue.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/AbstractPlainAttrValue.java
b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/AbstractPlainAttrValue.java
index b471690..bd19107 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/AbstractPlainAttrValue.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/AbstractPlainAttrValue.java
@@ -277,6 +277,6 @@ public abstract class AbstractPlainAttrValue extends AbstractGeneratedKeyEntity
 
     @Override
     public String toString() {
-        return ReflectionToStringBuilder.toString(this, ToStringStyle.MULTI_LINE_STYLE);
+        return ReflectionToStringBuilder.toString(this, ToStringStyle.JSON_STYLE);
     }
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/ad6c103c/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/IntAttrName.java
----------------------------------------------------------------------
diff --git a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/IntAttrName.java
b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/IntAttrName.java
index 1dfa654..f46384e 100644
--- a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/IntAttrName.java
+++ b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/IntAttrName.java
@@ -97,7 +97,7 @@ public class IntAttrName {
 
     @Override
     public String toString() {
-        return ToStringBuilder.reflectionToString(this, ToStringStyle.MULTI_LINE_STYLE);
+        return ToStringBuilder.reflectionToString(this, ToStringStyle.JSON_STYLE);
     }
 
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/ad6c103c/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/WorkflowResult.java
----------------------------------------------------------------------
diff --git a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/WorkflowResult.java
b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/WorkflowResult.java
index c1902eb..472a108 100644
--- a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/WorkflowResult.java
+++ b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/WorkflowResult.java
@@ -77,6 +77,6 @@ public class WorkflowResult<T> {
 
     @Override
     public String toString() {
-        return ReflectionToStringBuilder.toString(this, ToStringStyle.MULTI_LINE_STYLE);
+        return ReflectionToStringBuilder.toString(this, ToStringStyle.JSON_STYLE);
     }
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/ad6c103c/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/cache/VirAttrCacheKey.java
----------------------------------------------------------------------
diff --git a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/cache/VirAttrCacheKey.java
b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/cache/VirAttrCacheKey.java
index 10e76a5..41d5224 100644
--- a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/cache/VirAttrCacheKey.java
+++ b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/cache/VirAttrCacheKey.java
@@ -73,6 +73,6 @@ public class VirAttrCacheKey {
 
     @Override
     public String toString() {
-        return ReflectionToStringBuilder.toString(this, ToStringStyle.MULTI_LINE_STYLE, true);
+        return ReflectionToStringBuilder.toString(this, ToStringStyle.JSON_STYLE, true);
     }
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/ad6c103c/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/job/report/AuditReportlet.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/job/report/AuditReportlet.java
b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/job/report/AuditReportlet.java
index 96039f0..d6f0ec5 100644
--- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/job/report/AuditReportlet.java
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/job/report/AuditReportlet.java
@@ -86,7 +86,7 @@ public class AuditReportlet extends AbstractReportlet {
 
             if (auditEntry.getBefore() != null) {
                 char[] before = ToStringBuilder.reflectionToString(
-                        auditEntry.getBefore(), ToStringStyle.MULTI_LINE_STYLE).toCharArray();
+                        auditEntry.getBefore(), ToStringStyle.JSON_STYLE).toCharArray();
                 handler.startElement("", "", "before", null);
                 handler.characters(before, 0, before.length);
                 handler.endElement("", "", "before");
@@ -96,7 +96,7 @@ public class AuditReportlet extends AbstractReportlet {
                 handler.startElement("", "", "inputs", null);
                 for (Object inputObj : auditEntry.getInput()) {
                     char[] input = ToStringBuilder.reflectionToString(
-                            inputObj, ToStringStyle.MULTI_LINE_STYLE).toCharArray();
+                            inputObj, ToStringStyle.JSON_STYLE).toCharArray();
                     handler.startElement("", "", "input", null);
                     handler.characters(input, 0, input.length);
                     handler.endElement("", "", "input");
@@ -106,7 +106,7 @@ public class AuditReportlet extends AbstractReportlet {
 
             if (auditEntry.getOutput() != null) {
                 char[] output = ToStringBuilder.reflectionToString(
-                        auditEntry.getOutput(), ToStringStyle.MULTI_LINE_STYLE).toCharArray();
+                        auditEntry.getOutput(), ToStringStyle.JSON_STYLE).toCharArray();
                 handler.startElement("", "", "output", null);
                 handler.characters(output, 0, output.length);
                 handler.endElement("", "", "output");

http://git-wip-us.apache.org/repos/asf/syncope/blob/ad6c103c/core/spring/src/main/java/org/apache/syncope/core/spring/security/SyncopeAuthenticationDetails.java
----------------------------------------------------------------------
diff --git a/core/spring/src/main/java/org/apache/syncope/core/spring/security/SyncopeAuthenticationDetails.java
b/core/spring/src/main/java/org/apache/syncope/core/spring/security/SyncopeAuthenticationDetails.java
index e5a6726..cfd1eec 100644
--- a/core/spring/src/main/java/org/apache/syncope/core/spring/security/SyncopeAuthenticationDetails.java
+++ b/core/spring/src/main/java/org/apache/syncope/core/spring/security/SyncopeAuthenticationDetails.java
@@ -60,7 +60,7 @@ public class SyncopeAuthenticationDetails implements Serializable {
 
     @Override
     public String toString() {
-        return ReflectionToStringBuilder.toString(this, ToStringStyle.MULTI_LINE_STYLE);
+        return ReflectionToStringBuilder.toString(this, ToStringStyle.JSON_STYLE);
     }
 
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/ad6c103c/core/spring/src/main/java/org/apache/syncope/core/spring/security/SyncopeGrantedAuthority.java
----------------------------------------------------------------------
diff --git a/core/spring/src/main/java/org/apache/syncope/core/spring/security/SyncopeGrantedAuthority.java
b/core/spring/src/main/java/org/apache/syncope/core/spring/security/SyncopeGrantedAuthority.java
index bca6990..c9ba8d3 100644
--- a/core/spring/src/main/java/org/apache/syncope/core/spring/security/SyncopeGrantedAuthority.java
+++ b/core/spring/src/main/java/org/apache/syncope/core/spring/security/SyncopeGrantedAuthority.java
@@ -81,7 +81,7 @@ public class SyncopeGrantedAuthority implements GrantedAuthority {
 
     @Override
     public String toString() {
-        return ReflectionToStringBuilder.toString(this, ToStringStyle.MULTI_LINE_STYLE);
+        return ReflectionToStringBuilder.toString(this, ToStringStyle.JSON_STYLE);
     }
 
 }


Mime
View raw message