syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject svn commit: r1463586 - in /syncope/branches/1_0_X/core/src/main/java/org/apache/syncope/core/persistence/validation/attrvalue: AlwaysTrueValidator.java BasicValidator.java EmailAddressValidator.java
Date Tue, 02 Apr 2013 15:07:10 GMT
Author: ilgrosso
Date: Tue Apr  2 15:07:10 2013
New Revision: 1463586

URL: http://svn.apache.org/r1463586
Log:
[SYNCOPE-348] Applying provided suggestion

Modified:
    syncope/branches/1_0_X/core/src/main/java/org/apache/syncope/core/persistence/validation/attrvalue/AlwaysTrueValidator.java
    syncope/branches/1_0_X/core/src/main/java/org/apache/syncope/core/persistence/validation/attrvalue/BasicValidator.java
    syncope/branches/1_0_X/core/src/main/java/org/apache/syncope/core/persistence/validation/attrvalue/EmailAddressValidator.java

Modified: syncope/branches/1_0_X/core/src/main/java/org/apache/syncope/core/persistence/validation/attrvalue/AlwaysTrueValidator.java
URL: http://svn.apache.org/viewvc/syncope/branches/1_0_X/core/src/main/java/org/apache/syncope/core/persistence/validation/attrvalue/AlwaysTrueValidator.java?rev=1463586&r1=1463585&r2=1463586&view=diff
==============================================================================
--- syncope/branches/1_0_X/core/src/main/java/org/apache/syncope/core/persistence/validation/attrvalue/AlwaysTrueValidator.java
(original)
+++ syncope/branches/1_0_X/core/src/main/java/org/apache/syncope/core/persistence/validation/attrvalue/AlwaysTrueValidator.java
Tue Apr  2 15:07:10 2013
@@ -23,14 +23,14 @@ import org.apache.syncope.core.persisten
 
 public class AlwaysTrueValidator extends AbstractValidator {
 
-    public AlwaysTrueValidator(AbstractSchema schema) {
+    private static final long serialVersionUID = 872107345555773183L;
 
+    public AlwaysTrueValidator(final AbstractSchema schema) {
         super(schema);
     }
 
     @Override
-    protected void doValidate(AbstractAttrValue attributeValue) throws InvalidAttrValueException
{
-
+    protected void doValidate(final AbstractAttrValue attributeValue) throws InvalidAttrValueException
{
         Boolean value = attributeValue.getValue();
         if (!value) {
             throw new InvalidAttrValueException(attributeValue);

Modified: syncope/branches/1_0_X/core/src/main/java/org/apache/syncope/core/persistence/validation/attrvalue/BasicValidator.java
URL: http://svn.apache.org/viewvc/syncope/branches/1_0_X/core/src/main/java/org/apache/syncope/core/persistence/validation/attrvalue/BasicValidator.java?rev=1463586&r1=1463585&r2=1463586&view=diff
==============================================================================
--- syncope/branches/1_0_X/core/src/main/java/org/apache/syncope/core/persistence/validation/attrvalue/BasicValidator.java
(original)
+++ syncope/branches/1_0_X/core/src/main/java/org/apache/syncope/core/persistence/validation/attrvalue/BasicValidator.java
Tue Apr  2 15:07:10 2013
@@ -31,8 +31,7 @@ public class BasicValidator extends Abst
     }
 
     @Override
-    protected void doValidate(AbstractAttrValue attributeValue) throws InvalidAttrValueException
{
-
+    protected void doValidate(final AbstractAttrValue attributeValue) throws InvalidAttrValueException
{
         if (SchemaType.Enum.equals(schema.getType())) {
             final String[] enumeration = schema.getEnumerationValues().split(AbstractSchema.enumValuesSeparator);
 

Modified: syncope/branches/1_0_X/core/src/main/java/org/apache/syncope/core/persistence/validation/attrvalue/EmailAddressValidator.java
URL: http://svn.apache.org/viewvc/syncope/branches/1_0_X/core/src/main/java/org/apache/syncope/core/persistence/validation/attrvalue/EmailAddressValidator.java?rev=1463586&r1=1463585&r2=1463586&view=diff
==============================================================================
--- syncope/branches/1_0_X/core/src/main/java/org/apache/syncope/core/persistence/validation/attrvalue/EmailAddressValidator.java
(original)
+++ syncope/branches/1_0_X/core/src/main/java/org/apache/syncope/core/persistence/validation/attrvalue/EmailAddressValidator.java
Tue Apr  2 15:07:10 2013
@@ -25,8 +25,12 @@ import org.apache.syncope.core.persisten
 
 public class EmailAddressValidator extends AbstractValidator {
 
+    private static final long serialVersionUID = 792457177290331518L;
+
     private static final Pattern EMAIL_PATTERN = Pattern.compile(
-            "^[\\w\\-]([\\.\\w])+[\\w]+@([\\w\\-]+\\.)+[A-Z]{2,4}$", Pattern.CASE_INSENSITIVE);
+            "^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*"
+            + "@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$",
+            Pattern.CASE_INSENSITIVE);
 
     public EmailAddressValidator(final AbstractSchema schema) {
         super(schema);



Mime
View raw message