[hibernate-commits] Hibernate SVN: r15357 - in validator/trunk: hibernate-validator and 5 other directories.

hibernate-commits at lists.jboss.org hibernate-commits at lists.jboss.org
Mon Oct 20 10:45:15 EDT 2008


Author: hardy.ferentschik
Date: 2008-10-20 10:45:15 -0400 (Mon, 20 Oct 2008)
New Revision: 15357

Added:
   validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/ValidatorConstants.java
   validator/trunk/hibernate-validator/src/main/resources/META-INF/MANIFEST.MF
Modified:
   validator/trunk/hibernate-validator/pom.xml
   validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/engine/ValidatorImpl.java
   validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/impl/InvalidConstraintImpl.java
   validator/trunk/hibernate-validator/src/test/resources/log4j.properties
   validator/trunk/pom.xml
Log:
minor cleanup and improvements for logging


Modified: validator/trunk/hibernate-validator/pom.xml
===================================================================
--- validator/trunk/hibernate-validator/pom.xml	2008-10-20 07:30:50 UTC (rev 15356)
+++ validator/trunk/hibernate-validator/pom.xml	2008-10-20 14:45:15 UTC (rev 15357)
@@ -14,8 +14,8 @@
     <name>Hibernate Validator</name>
     <distributionManagement>
         <site>
-          <id>local</id>
-          <url>file:///Users/hardy/Sites/${artifactId}</url>
+            <id>local</id>
+            <url>file:///Users/hardy/Sites/${artifactId}</url>
         </site>
     </distributionManagement>
     <dependencies>
@@ -34,13 +34,17 @@
             <optional>true</optional>
         </dependency>
         <dependency>
-            <groupId>commons-collections</groupId>
-            <artifactId>commons-collections</artifactId>
-        </dependency>
-        <dependency>
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
             <scope>test</scope>
         </dependency>
     </dependencies>
+    <build>
+        <resources>
+            <resource>
+                <directory>src/main/resources</directory>
+                <filtering>true</filtering>
+            </resource>
+        </resources>
+    </build>
 </project>

Added: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/ValidatorConstants.java
===================================================================
--- validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/ValidatorConstants.java	                        (rev 0)
+++ validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/ValidatorConstants.java	2008-10-20 14:45:15 UTC (rev 15357)
@@ -0,0 +1,32 @@
+// $Id:$
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2008, Red Hat Middleware LLC, and individual contributors
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+* http://www.apache.org/licenses/LICENSE-2.0
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.hibernate.validation;
+
+/**
+ * @author Hardy Ferentschik
+ */
+public class ValidatorConstants {
+
+    private ValidatorConstants() {
+    }
+
+    /**
+     * The default group/sequence name used when no group parameter is passed to validate().
+     */
+    public static final String DEFAULT_GROUP_NAME = "default";
+}

Modified: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/engine/ValidatorImpl.java
===================================================================
--- validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/engine/ValidatorImpl.java	2008-10-20 07:30:50 UTC (rev 15356)
+++ validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/engine/ValidatorImpl.java	2008-10-20 14:45:15 UTC (rev 15357)
@@ -36,6 +36,7 @@
 import javax.validation.Validator;
 
 import org.hibernate.validation.Version;
+import org.hibernate.validation.ValidatorConstants;
 import org.hibernate.validation.impl.ConstraintDescriptorImpl;
 import org.hibernate.validation.impl.ConstraintFactoryImpl;
 import org.hibernate.validation.impl.InvalidConstraintImpl;
@@ -52,15 +53,8 @@
  */
 public class ValidatorImpl<T> implements Validator<T> {
 
-	/**
-	 * The default group/sequence name when no group parameter is passed to validate().
-	 *
-	 * @todo Is it correct to use this default string and if so is this the correct place to define it?
-	 */
-	private static final String DEFAULT_GROUP_NAME = "default";
+    private static final Set<Class> INDEXABLE_CLASS = new HashSet<Class>();
 
-	private static final Set<Class> INDEXABLE_CLASS = new HashSet<Class>();
-
 	static {
 		INDEXABLE_CLASS.add( Integer.class );
 		INDEXABLE_CLASS.add( Long.class );
@@ -135,7 +129,7 @@
 
 		// if no group is specified use the default
 		if ( groups.size() == 0 ) {
-			groups = Arrays.asList( DEFAULT_GROUP_NAME );
+			groups = Arrays.asList( ValidatorConstants.DEFAULT_GROUP_NAME );
 		}
 
 		List<String> expandedGroups;
@@ -293,7 +287,7 @@
 
 		// if no group is specified use the default
 		if ( groups.length == 0 ) {
-			groups = new String[] { DEFAULT_GROUP_NAME };
+			groups = new String[] { ValidatorConstants.DEFAULT_GROUP_NAME };
 		}
 
 		List<String> expandedGroups;
@@ -356,7 +350,7 @@
 
 		// if no group is specified use the default
 		if ( groups.length == 0 ) {
-			groups = new String[] { DEFAULT_GROUP_NAME };
+			groups = new String[] { ValidatorConstants.DEFAULT_GROUP_NAME };
 		}
 
 		List<String> expandedGroups;

Modified: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/impl/InvalidConstraintImpl.java
===================================================================
--- validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/impl/InvalidConstraintImpl.java	2008-10-20 07:30:50 UTC (rev 15356)
+++ validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/impl/InvalidConstraintImpl.java	2008-10-20 14:45:15 UTC (rev 15357)
@@ -92,11 +92,6 @@
 		return groups;
 	}
 
-	public void addParent(T parentBean, String parentProperty) {
-		this.propertyPath = parentProperty + "." + propertyPath;
-		this.rootBean = parentBean;
-	}
-
 	public void addGroups(Set<String> groupSet) {
 		groups.addAll( groupSet );
 	}

Added: validator/trunk/hibernate-validator/src/main/resources/META-INF/MANIFEST.MF
===================================================================
--- validator/trunk/hibernate-validator/src/main/resources/META-INF/MANIFEST.MF	                        (rev 0)
+++ validator/trunk/hibernate-validator/src/main/resources/META-INF/MANIFEST.MF	2008-10-20 14:45:15 UTC (rev 15357)
@@ -0,0 +1,10 @@
+Manifest-Version: 1.0
+Archiver-Version: Plexus Archiver
+Created-By: Apache Maven
+Built-By: ${user.name}
+Build-Jdk: ${java.version}
+Implementation-Title: ${pom.artifactId}
+Implementation-Vendor: ${pom.groupId}
+Implementation-Vendor-Id: ${pom.groupId}
+Implementation-Version: ${pom.version}
+Specification-Title: Bean Validation


Property changes on: validator/trunk/hibernate-validator/src/main/resources/META-INF/MANIFEST.MF
___________________________________________________________________
Name: svn:mergeinfo
   + 

Modified: validator/trunk/hibernate-validator/src/test/resources/log4j.properties
===================================================================
--- validator/trunk/hibernate-validator/src/test/resources/log4j.properties	2008-10-20 07:30:50 UTC (rev 15356)
+++ validator/trunk/hibernate-validator/src/test/resources/log4j.properties	2008-10-20 14:45:15 UTC (rev 15357)
@@ -18,7 +18,8 @@
 
 
 ### set log levels - for more verbose logging change 'info' to 'debug' ###
-log4j.rootLogger=debug, stdout
+log4j.rootLogger=info, stdout
 
 log4j.logger.org.hibernate.validation.engine.ValidatorImpl=trace
+org.hibernate.validation.impl.ResourceBundleMessageResolver=info
 

Modified: validator/trunk/pom.xml
===================================================================
--- validator/trunk/pom.xml	2008-10-20 07:30:50 UTC (rev 15356)
+++ validator/trunk/pom.xml	2008-10-20 14:45:15 UTC (rev 15357)
@@ -103,7 +103,7 @@
                                 <Implementation-Vendor>${pom.groupId}</Implementation-Vendor>
                                 <Implementation-Vendor-Id>${pom.groupId}</Implementation-Vendor-Id>
                                 <Implementation-URL>${pom.url}</Implementation-URL>
-                                <Specification-Title>Bean Validation"</Specification-Title>
+                                <Specification-Title>Bean Validation</Specification-Title>
                             </manifestEntries>
                         </archive>
                     </configuration>
@@ -159,7 +159,7 @@
     </licenses>
 
     <scm>
-        <connection>scm:https://svn.jboss.org/repos/beancheck/ri/trunk</connection>
+        <connection>scm:https://svn.jboss.org/repos/hibernate/validator/trunk</connection>
         <url>http://fisheye.jboss.org/browse/Fixme</url>
     </scm>
 




More information about the hibernate-commits mailing list