Author: epbernard
Date: 2009-07-29 22:27:53 -0400 (Wed, 29 Jul 2009)
New Revision: 17219
Modified:
beanvalidation/trunk/validation-tck/src/main/resources/org/hibernate/jsr303/tck/tests/xmlconfiguration/validation.xml
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/xml/ValidationXmlParser.java
Log:
HV-195 be permissive to heading '/' on mapping file names
Modified:
beanvalidation/trunk/validation-tck/src/main/resources/org/hibernate/jsr303/tck/tests/xmlconfiguration/validation.xml
===================================================================
---
beanvalidation/trunk/validation-tck/src/main/resources/org/hibernate/jsr303/tck/tests/xmlconfiguration/validation.xml 2009-07-30
02:15:39 UTC (rev 17218)
+++
beanvalidation/trunk/validation-tck/src/main/resources/org/hibernate/jsr303/tck/tests/xmlconfiguration/validation.xml 2009-07-30
02:27:53 UTC (rev 17219)
@@ -2,7 +2,7 @@
<validation-config
xmlns="http://jboss.org/xml/ns/javax/validation/configuration"
xsi:schemaLocation="http://jboss.org/xml/ns/javax/validation/configu...
validation-configuration-1.0.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-
<constraint-mapping>/org/hibernate/jsr303/tck/tests/xmlconfiguration/order-constraints.xml</constraint-mapping>
+
<constraint-mapping>org/hibernate/jsr303/tck/tests/xmlconfiguration/order-constraints.xml</constraint-mapping>
<constraint-mapping>org/hibernate/jsr303/tck/tests/xmlconfiguration/user-constraints.xml</constraint-mapping>
<property name="javax.validation.test">foobar</property>
</validation-config>
\ No newline at end of file
Modified:
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/xml/ValidationXmlParser.java
===================================================================
---
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/xml/ValidationXmlParser.java 2009-07-30
02:15:39 UTC (rev 17218)
+++
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/xml/ValidationXmlParser.java 2009-07-30
02:27:53 UTC (rev 17219)
@@ -230,6 +230,11 @@
}
private InputStream getInputStreamForPath(String path) {
+ //TODO not sure it's the right thing to do (ie removing '/'
+ //remove heading '/'
+ if ( path.startsWith( "/" ) ) {
+ path = path.substring( 1 );
+ }
// try the context class loader first
ClassLoader loader = Thread.currentThread().getContextClassLoader();
boolean isContextCL = true;