Commits

Anonymous committed e8a7a35

XW-639 latest trunk does not build on Leopard with Java 6
o fixing build

git-svn-id: http://svn.opensymphony.com/svn/xwork/trunk@1790e221344d-f017-0410-9bd5-d282ab1896d7

Comments (0)

Files changed (2)

src/java/com/opensymphony/xwork2/validator/DefaultValidatorFactory.java

                 URL u = urls.next();
                 try {
                     URI uri = new URI(u.toExternalForm().replaceAll(" ", "%20"));
-                    if (uri.isOpaque() && "file".equalsIgnoreCase(uri.getScheme())) {
+                    if (!uri.isOpaque() && "file".equalsIgnoreCase(uri.getScheme())) {
                         File f = new File(uri);
                         FilenameFilter filter = new FilenameFilter() {
                             public boolean accept(File file, String fileName) {

src/test/com/opensymphony/xwork2/validator/DefaultValidatorFactoryTest.java

     public void testParseValidators() {
         Mock mockValidatorFileParser = new Mock(ValidatorFileParser.class);
         mockValidatorFileParser.expect("parseValidatorDefinitions", C.args(C.IS_NOT_NULL, C.IS_NOT_NULL, C.eq("com/opensymphony/xwork2/validator/validators/default.xml")));
-        mockValidatorFileParser.expect("parseValidatorDefinitions", C.args(C.IS_NOT_NULL, C.IS_NOT_NULL, C.eq("my-validators.xml")));
-        mockValidatorFileParser.expect("parseValidatorDefinitions", C.args(C.IS_NOT_NULL, C.IS_NOT_NULL, C.eq("myOther-validators.xml")));
         mockValidatorFileParser.expect("parseValidatorDefinitions", C.args(C.IS_NOT_NULL, C.IS_NOT_NULL, C.eq("validators.xml")));
+        mockValidatorFileParser.expect("parseValidatorDefinitions", C.args(C.IS_NOT_NULL, C.IS_NOT_NULL, C.eq("myOther-validators.xml")));
+        mockValidatorFileParser.expect("parseValidatorDefinitions", C.args(C.IS_NOT_NULL, C.IS_NOT_NULL, C.eq("my-validators.xml")));
         DefaultValidatorFactory factory = new DefaultValidatorFactory(null, (ValidatorFileParser) mockValidatorFileParser.proxy());
 
         mockValidatorFileParser.verify();