jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r924385 - /jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/JcrUtils.java
Date Wed, 17 Mar 2010 17:51:00 GMT
Author: jukka
Date: Wed Mar 17 17:50:59 2010
New Revision: 924385

URL: http://svn.apache.org/viewvc?rev=924385&view=rev
Log:
JCR-2555: Improved reusability of the JCA package

Fix handling of the default repository case

Modified:
    jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/JcrUtils.java

Modified: jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/JcrUtils.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/JcrUtils.java?rev=924385&r1=924384&r2=924385&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/JcrUtils.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/JcrUtils.java
Wed Mar 17 17:50:59 2010
@@ -108,8 +108,9 @@ public class JcrUtils {
     public static Repository getRepository(Map<String, String> parameters)
             throws RepositoryException {
         // Use the query part of a repository URI as additional parameters
-        String uri = parameters.get(JcrUtils.REPOSITORY_URI);
-        if (uri != null) {
+        if (parameters != null
+                && parameters.containsKey(JcrUtils.REPOSITORY_URI)) {
+            String uri = parameters.get(JcrUtils.REPOSITORY_URI);
             Map<String, String> copy = new HashMap<String, String>(parameters);
             try {
                 URI u = new URI(uri);
@@ -135,9 +136,9 @@ public class JcrUtils {
                     parameters = copy;
                 }
             } catch (URISyntaxException e) {
-                throw new RepositoryException(e);
+                // Ignore invalid URIs
             } catch (UnsupportedEncodingException e) {
-                throw new RepositoryException(e);
+                throw new RepositoryException("UTF-8 is not supported!", e);
             }
         }
 



Mime
View raw message