Java Mailing List Archive

http://www.gg3721.com/

Home » Hibernate Commits List »

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

hibernate-commits

2008-10-20


Author LoginPost Reply
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)
@@(protected) @@
  <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>
@@(protected) @@
        <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)
@@(protected) @@
+// $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)
@@(protected) @@
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;
@@(protected) @@
*/
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 );
@@(protected) @@

   // 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;
@@(protected) @@

   // 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;
@@(protected) @@

   // 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)
@@(protected) @@
   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)
@@(protected) @@
+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)
@@(protected) @@


### 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)
@@(protected) @@
                     <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>
@@(protected) @@
  </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>


_______________________________________________
hibernate-commits mailing list
hibernate-commits@(protected)
https://lists.jboss.org/mailman/listinfo/hibernate-commits
©2008 gg3721.com - Jax Systems, LLC, U.S.A.