branch develop updated (a0d6190 -> e026bd9)
This is an automated email from the git hooks/post-receive script. New change to branch develop in repository nuiton-validator. See https://gitlab.nuiton.org/nuiton/nuiton-validator.git from a0d6190 Migration vers gitlab + simplification configuration des sites new fdbbe05 Utilisation d'un vrai equals pour calculer l'unicité (fixes #3630) new bf2f301 Updates nuitonpom to 10.1 (fixes #3981) new 4b22ae4 updates guava to 19.0 (fixes #3982) new 1c8fea3 updates commons-collections4 to 4.1 (fixes #3983) new 33d3d93 updates commons-lang3 to 3.4 (fixes #3984) new 3f0ba7e updates xwork-core to 2.3.30 (fixes #3985) new 5570f7b updates javassist to 3.20.0-GA (fixes #3986) new 3ed4867 updates nuiton-utils to 3.0-rc-12 (fixes #3987) new e026bd9 updates nuiton-i18n to 3.5 (fixes #3988) The 9 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit e026bd9b90cfb3d08b2101f593048422e7fffae5 Author: Tony CHEMIT <chemit@codelutin.com> Date: Wed Jul 27 10:04:30 2016 +0200 updates nuiton-i18n to 3.5 (fixes #3988) commit 3ed48675f983f773c7a420d88760ef61c5c08baa Author: Tony CHEMIT <chemit@codelutin.com> Date: Wed Jul 27 10:03:53 2016 +0200 updates nuiton-utils to 3.0-rc-12 (fixes #3987) commit 5570f7b50dfdc4db89b3f781967b2cf97a8427a9 Author: Tony CHEMIT <chemit@codelutin.com> Date: Wed Jul 27 10:03:09 2016 +0200 updates javassist to 3.20.0-GA (fixes #3986) commit 3f0ba7eb9a397d1a0635371e52e93e874b98a6d2 Author: Tony CHEMIT <chemit@codelutin.com> Date: Wed Jul 27 10:02:17 2016 +0200 updates xwork-core to 2.3.30 (fixes #3985) commit 33d3d935c717eee8030fdbb8177b90ffce3e3f5c Author: Tony CHEMIT <chemit@codelutin.com> Date: Wed Jul 27 10:00:37 2016 +0200 updates commons-lang3 to 3.4 (fixes #3984) commit 1c8fea36396162554ca43c98507d92aad25606a5 Author: Tony CHEMIT <chemit@codelutin.com> Date: Wed Jul 27 09:59:25 2016 +0200 updates commons-collections4 to 4.1 (fixes #3983) commit 4b22ae4dc8ba74ee669caaac3e90412c9008e4af Author: Tony CHEMIT <chemit@codelutin.com> Date: Wed Jul 27 09:58:24 2016 +0200 updates guava to 19.0 (fixes #3982) commit bf2f301f49e1ba6102ca72b61e7947d5e5876038 Author: Tony CHEMIT <chemit@codelutin.com> Date: Wed Jul 27 09:57:30 2016 +0200 Updates nuitonpom to 10.1 (fixes #3981) commit fdbbe05781353ccacf7ab4eaa60c0e666ed749fe Author: Tony CHEMIT <chemit@codelutin.com> Date: Wed Jul 27 09:51:32 2016 +0200 Utilisation d'un vrai equals pour calculer l'unicité (fixes #3630) Summary of changes: README.txt => README.md | 0 pom.xml | 33 +++---- .../field/CollectionFieldExpressionValidator.java | 105 +++++++++++++++++---- src/site/site.xml | 21 ++--- 4 files changed, 113 insertions(+), 46 deletions(-) rename README.txt => README.md (100%) -- To stop receiving notification emails like this one, please contact nuiton.org SCM administrator <admin+scm@nuiton.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository nuiton-validator. See https://gitlab.nuiton.org/nuiton/nuiton-validator.git commit fdbbe05781353ccacf7ab4eaa60c0e666ed749fe Author: Tony CHEMIT <chemit@codelutin.com> Date: Wed Jul 27 09:51:32 2016 +0200 Utilisation d'un vrai equals pour calculer l'unicité (fixes #3630) --- .../field/CollectionFieldExpressionValidator.java | 105 +++++++++++++++++---- 1 file changed, 89 insertions(+), 16 deletions(-) diff --git a/src/main/java/org/nuiton/validator/xwork2/field/CollectionFieldExpressionValidator.java b/src/main/java/org/nuiton/validator/xwork2/field/CollectionFieldExpressionValidator.java index eae1fab..a34b9ae 100644 --- a/src/main/java/org/nuiton/validator/xwork2/field/CollectionFieldExpressionValidator.java +++ b/src/main/java/org/nuiton/validator/xwork2/field/CollectionFieldExpressionValidator.java @@ -21,6 +21,7 @@ */ package org.nuiton.validator.xwork2.field; +import com.google.common.base.Objects; import com.opensymphony.xwork2.util.ValueStack; import com.opensymphony.xwork2.validator.ValidationException; import com.opensymphony.xwork2.validator.validators.FieldExpressionValidator; @@ -28,8 +29,9 @@ import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Collection; import java.util.Collections; -import java.util.HashSet; +import java.util.Comparator; import java.util.Set; +import java.util.TreeSet; /** * Un validateur basé sur {@link FieldExpressionValidator} qui valide sur une @@ -166,11 +168,11 @@ public class CollectionFieldExpressionValidator extends NuitonFieldExpressionVal if (useFirst && mode != Mode.ALL) { throw new ValidationException("can only use expressionForFirst in " + - "mode ALL but was " + mode); + "mode ALL but was " + mode); } if (useLast && mode != Mode.ALL) { throw new ValidationException("can only use expressionForLast in " + - "mode ALL but was " + mode); + "mode ALL but was " + mode); } String fieldName = getFieldName(); @@ -305,27 +307,47 @@ public class CollectionFieldExpressionValidator extends NuitonFieldExpressionVal return count == 1; } +// protected Boolean validateUniqueKey(Collection<?> col) throws ValidationException { +// boolean answer = true; +// +// Set<Integer> hashCodes = new HashSet<Integer>(); +// int index = -1; +// for (Object entry : col) { +// index++; +// // construction du hash de la clef d'unicite +// Integer hash = getUniqueKeyHashCode(entry); +// if (!hashCodes.contains(hash)) { +// hashCodes.add(hash); +// continue; +// } +// // une entree avec ce hash a deja ete trouvee +// // on est donc en violation sur la clef unique +// answer = false; +// if (log.isDebugEnabled()) { +// log.debug("duplicated uniquekey " + hash + " for entry " + index); +// } +// } +// hashCodes.clear(); +// return answer; +// } + protected Boolean validateUniqueKey(Collection<?> col) throws ValidationException { boolean answer = true; - Set<Integer> hashCodes = new HashSet<Integer>(); + Comparator<? super Object> comparator1 = getComparator(); + Set<? super Object> hashCodes = new TreeSet<Object>(comparator1); int index = -1; for (Object entry : col) { index++; - // construction du hash de la clef d'unicite - Integer hash = getUniqueKeyHashCode(entry); - if (!hashCodes.contains(hash)) { - hashCodes.add(hash); - continue; - } - // une entree avec ce hash a deja ete trouvee - // on est donc en violation sur la clef unique - answer = false; - if (log.isDebugEnabled()) { - log.debug("duplicated uniquekey " + hash + " for entry " + index); + boolean wasAdded = hashCodes.add(entry); + if (!wasAdded) { + answer = false; + if (log.isDebugEnabled()) { + log.debug("duplicated unique entry at position: " + index); + } + break; } } - hashCodes.clear(); return answer; } @@ -484,4 +506,55 @@ public class CollectionFieldExpressionValidator extends NuitonFieldExpressionVal return index == size - 1; } } + + Comparator<? super Object> comparator; + + private Comparator<? super Object> getComparator() { + if (comparator == null) { + comparator = new MyComparator<Object>(keys); + } + return comparator; + } + + private class MyComparator<O> implements Comparator<O> { + + private final String[] keys; + + public MyComparator(String... keys) { + this.keys = keys; + } + + @Override + public int compare(O o1, O o2) { + + boolean equals = true; + + for (String key : keys) { + + Object property1 = getPropertyValue(key, o1); + Object property2 = getPropertyValue(key, o2); + + equals = Objects.equal(property1, property2); + + if (!equals) { + break; + } + } + + return equals ? 0 : -1; + } + } + + protected Object getPropertyValue(String key, Object o) { + + try { + return getFieldValue(key, o); + + } catch (ValidationException e) { + if (log.isErrorEnabled()) { + log.error("Can't get property '" + key + "'value on oject: " + o); + } + return null; + } + } } -- To stop receiving notification emails like this one, please contact nuiton.org SCM administrator <admin+scm@nuiton.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository nuiton-validator. See https://gitlab.nuiton.org/nuiton/nuiton-validator.git commit bf2f301f49e1ba6102ca72b61e7947d5e5876038 Author: Tony CHEMIT <chemit@codelutin.com> Date: Wed Jul 27 09:57:30 2016 +0200 Updates nuitonpom to 10.1 (fixes #3981) --- README.txt => README.md | 0 pom.xml | 19 +++++++------------ src/site/site.xml | 21 ++++++++++----------- 3 files changed, 17 insertions(+), 23 deletions(-) diff --git a/README.txt b/README.md similarity index 100% rename from README.txt rename to README.md diff --git a/pom.xml b/pom.xml index db52113..4829cfe 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.nuiton</groupId> <artifactId>nuitonpom</artifactId> - <version>5</version> + <version>10.1</version> </parent> <artifactId>nuiton-validator</artifactId> @@ -13,7 +13,7 @@ <name>Nuiton Validator</name> <description>Simple Validator API</description> - <url>https://nuiton-validator.nuiton.org</url> + <url>http://nuiton-validator.nuiton.org</url> <inceptionYear>2013</inceptionYear> <developers> @@ -38,25 +38,20 @@ <url>https://gitlab.nuiton.org/nuiton/nuiton-validator</url> </scm> - <distributionManagement> - <site> - <id>${site.server}</id> - <url>${site.url}</url> - </site> - </distributionManagement> - <properties> <projectId>nuiton-validator</projectId> + <ciViewId>nuiton-validator</ciViewId> + + <javaVersion>1.6</javaVersion> + <signatureArtifactId>java16</signatureArtifactId> + <signatureVersion>1.0</signatureVersion> <nuitonI18nVersion>3.3</nuitonI18nVersion> <!-- i18n configuration --> <i18n.bundles>fr_FR,en_GB,es_ES</i18n.bundles> - <!-- Documentation is in apt format --> - <siteSourcesType>apt</siteSourcesType> - <!-- extra files to include in release --> <redmine.releaseFiles>${redmine.libReleaseFiles}</redmine.releaseFiles> diff --git a/src/site/site.xml b/src/site/site.xml index 432dcb3..55659cc 100644 --- a/src/site/site.xml +++ b/src/site/site.xml @@ -22,7 +22,10 @@ --> -<project name="${project.name}"> +<project name="${project.name}" + xmlns="http://maven.apache.org/DECORATION/1.4.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/DECORATION/1.4.0 http://maven.apache.org/xsd/decoration-1.4.0.xsd"> <bannerLeft> <name>${project.name}</name> @@ -37,16 +40,14 @@ <body> <links> - <item name="Nuiton.org" href="http://forge.nuiton.org"/> - <item name="Code Lutin" href="http://www.codelutin.com"/> + <item name="Nuiton.org" href="https://forge.nuiton.org"/> + <item name="Code Lutin" href="https://www.codelutin.com"/> <item name="Libre entreprise" href="http://www.libre-entreprise.org"/> </links> <breadcrumbs> - <item name="${project.name}" - href="${project.url}/index.html"/> - <item name="${project.version}" - href="${project.url}/${siteDeployClassifier}/index.html"/> + <item name="${project.name}" href="${project.url}/index.html"/> + <item name="${project.version}" href="${project.url}/${siteDeployClassifier}/index.html"/> </breadcrumbs> <menu name="Utilisateur"> @@ -57,10 +58,8 @@ <menu ref="reports"/> <footer> - <div id='mavenProjectProperties' locale='fr' - projectId='${project.projectId}' - version='${project.siteDeployClassifier}' - sourcesType='${project.siteSourcesType}'/> + <div id='mavenProjectProperties' locale='fr' sourcesType='apt' + projectId='${project.projectId}' version='${project.siteDeployClassifier}'/> </footer> </body> -- To stop receiving notification emails like this one, please contact nuiton.org SCM administrator <admin+scm@nuiton.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository nuiton-validator. See https://gitlab.nuiton.org/nuiton/nuiton-validator.git commit 4b22ae4dc8ba74ee669caaac3e90412c9008e4af Author: Tony CHEMIT <chemit@codelutin.com> Date: Wed Jul 27 09:58:24 2016 +0200 updates guava to 19.0 (fixes #3982) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4829cfe..5b7ac4d 100644 --- a/pom.xml +++ b/pom.xml @@ -132,7 +132,7 @@ <dependency> <groupId>com.google.guava</groupId> <artifactId>guava</artifactId> - <version>18.0</version> + <version>19.0</version> </dependency> <dependency> -- To stop receiving notification emails like this one, please contact nuiton.org SCM administrator <admin+scm@nuiton.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository nuiton-validator. See https://gitlab.nuiton.org/nuiton/nuiton-validator.git commit 1c8fea36396162554ca43c98507d92aad25606a5 Author: Tony CHEMIT <chemit@codelutin.com> Date: Wed Jul 27 09:59:25 2016 +0200 updates commons-collections4 to 4.1 (fixes #3983) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 5b7ac4d..7236dc9 100644 --- a/pom.xml +++ b/pom.xml @@ -126,7 +126,7 @@ <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-collections4</artifactId> - <version>4.0</version> + <version>4.1</version> </dependency> <dependency> -- To stop receiving notification emails like this one, please contact nuiton.org SCM administrator <admin+scm@nuiton.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository nuiton-validator. See https://gitlab.nuiton.org/nuiton/nuiton-validator.git commit 33d3d935c717eee8030fdbb8177b90ffce3e3f5c Author: Tony CHEMIT <chemit@codelutin.com> Date: Wed Jul 27 10:00:37 2016 +0200 updates commons-lang3 to 3.4 (fixes #3984) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 7236dc9..cd54dc6 100644 --- a/pom.xml +++ b/pom.xml @@ -114,7 +114,7 @@ <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-lang3</artifactId> - <version>3.3.2</version> + <version>3.4</version> </dependency> <dependency> -- To stop receiving notification emails like this one, please contact nuiton.org SCM administrator <admin+scm@nuiton.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository nuiton-validator. See https://gitlab.nuiton.org/nuiton/nuiton-validator.git commit 3f0ba7eb9a397d1a0635371e52e93e874b98a6d2 Author: Tony CHEMIT <chemit@codelutin.com> Date: Wed Jul 27 10:02:17 2016 +0200 updates xwork-core to 2.3.30 (fixes #3985) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index cd54dc6..8ae74bf 100644 --- a/pom.xml +++ b/pom.xml @@ -81,7 +81,7 @@ <dependency> <groupId>org.apache.struts.xwork</groupId> <artifactId>xwork-core</artifactId> - <version>2.3.20</version> + <version>2.3.30</version> <exclusions> <exclusion> <groupId>asm</groupId> -- To stop receiving notification emails like this one, please contact nuiton.org SCM administrator <admin+scm@nuiton.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository nuiton-validator. See https://gitlab.nuiton.org/nuiton/nuiton-validator.git commit 5570f7b50dfdc4db89b3f781967b2cf97a8427a9 Author: Tony CHEMIT <chemit@codelutin.com> Date: Wed Jul 27 10:03:09 2016 +0200 updates javassist to 3.20.0-GA (fixes #3986) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 8ae74bf..8ca6ffc 100644 --- a/pom.xml +++ b/pom.xml @@ -101,7 +101,7 @@ <dependency> <groupId>org.javassist</groupId> <artifactId>javassist</artifactId> - <version>3.18.2-GA</version> + <version>3.20.0-GA</version> <scope>runtime</scope> </dependency> -- To stop receiving notification emails like this one, please contact nuiton.org SCM administrator <admin+scm@nuiton.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository nuiton-validator. See https://gitlab.nuiton.org/nuiton/nuiton-validator.git commit 3ed48675f983f773c7a420d88760ef61c5c08baa Author: Tony CHEMIT <chemit@codelutin.com> Date: Wed Jul 27 10:03:53 2016 +0200 updates nuiton-utils to 3.0-rc-12 (fixes #3987) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 8ca6ffc..9ca3bb3 100644 --- a/pom.xml +++ b/pom.xml @@ -64,7 +64,7 @@ <dependency> <groupId>org.nuiton</groupId> <artifactId>nuiton-utils</artifactId> - <version>3.0-rc-8</version> + <version>3.0-rc-12</version> </dependency> <dependency> <groupId>org.nuiton</groupId> -- To stop receiving notification emails like this one, please contact nuiton.org SCM administrator <admin+scm@nuiton.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository nuiton-validator. See https://gitlab.nuiton.org/nuiton/nuiton-validator.git commit e026bd9b90cfb3d08b2101f593048422e7fffae5 Author: Tony CHEMIT <chemit@codelutin.com> Date: Wed Jul 27 10:04:30 2016 +0200 updates nuiton-i18n to 3.5 (fixes #3988) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 9ca3bb3..76f23fb 100644 --- a/pom.xml +++ b/pom.xml @@ -47,7 +47,7 @@ <signatureArtifactId>java16</signatureArtifactId> <signatureVersion>1.0</signatureVersion> - <nuitonI18nVersion>3.3</nuitonI18nVersion> + <nuitonI18nVersion>3.5</nuitonI18nVersion> <!-- i18n configuration --> <i18n.bundles>fr_FR,en_GB,es_ES</i18n.bundles> -- To stop receiving notification emails like this one, please contact nuiton.org SCM administrator <admin+scm@nuiton.org>.
participants (1)
-
nuiton.org scm