You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by an...@apache.org on 2021/04/20 09:14:02 UTC

[jena] branch main updated: JENA-2094: Run in non-strict mode in normal operation.

This is an automated email from the ASF dual-hosted git repository.

andy pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/jena.git


The following commit(s) were added to refs/heads/main by this push:
     new 9f14ed0  JENA-2094: Run in non-strict mode in normal operation.
     new 4bcb178  Merge pull request #986 from afs/jena2094-iri
9f14ed0 is described below

commit 9f14ed0a4ee4f5415d4b696f62e113b547cd31f7
Author: Andy Seaborne <an...@apache.org>
AuthorDate: Mon Apr 19 22:46:02 2021 +0100

    JENA-2094: Run in non-strict mode in normal operation.
---
 .../main/java/org/apache/jena/riot/system/ParserProfileStd.java    | 7 +++----
 .../src/main/java/org/apache/jena/irix/IRIProviderJenaIRI.java     | 5 +++--
 jena-core/src/main/java/org/apache/jena/irix/SystemIRIx.java       | 4 ++--
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/jena-arq/src/main/java/org/apache/jena/riot/system/ParserProfileStd.java b/jena-arq/src/main/java/org/apache/jena/riot/system/ParserProfileStd.java
index 7a83291..186ceda 100644
--- a/jena-arq/src/main/java/org/apache/jena/riot/system/ParserProfileStd.java
+++ b/jena-arq/src/main/java/org/apache/jena/riot/system/ParserProfileStd.java
@@ -105,7 +105,6 @@ public class ParserProfileStd implements ParserProfile
             return iri;
         } catch (IRIException ex) {
             // This should only be errors and the errorHandler may be set to "don't continue".
-            // errorHandler.warning("Bad IRI: <" + uriStr + "> : "+ex.getMessage(), line, col);
             if ( SystemIRIx.getProvider() instanceof IRIProviderJenaIRI )
                 // Checking did this error/warning.
                 // Puts the IRI in the message.
@@ -113,9 +112,9 @@ public class ParserProfileStd implements ParserProfile
             else
                 // Does not put the IRI in the message.
                 errorHandler.error("Bad IRI: <" + uriStr + "> : "+ex.getMessage(), line, col);
-            // Error handler let it pass so return something.
-            if ( checking )
-                doChecking(null, uriStr, line, col);
+//            // Error handler let it pass, but should have printed something so don't out duplicate messages.
+//            if ( checking )
+//                doChecking(null, uriStr, line, col);
             return IRIx.createAny(uriStr);
         }
     }
diff --git a/jena-core/src/main/java/org/apache/jena/irix/IRIProviderJenaIRI.java b/jena-core/src/main/java/org/apache/jena/irix/IRIProviderJenaIRI.java
index f24fa30..bf2fcf9 100644
--- a/jena-core/src/main/java/org/apache/jena/irix/IRIProviderJenaIRI.java
+++ b/jena-core/src/main/java/org/apache/jena/irix/IRIProviderJenaIRI.java
@@ -216,11 +216,11 @@ public class IRIProviderJenaIRI implements IRIProvider {
             Violation v = vIter.next();
 
             int code = v.getViolationCode() ;
-            // Filter codes. These are for errors , not checking.
+            // Filter codes.
             // Global settings below; this section is for conditional filtering.
             switch(code) {
                 case Violation.PROHIBITED_COMPONENT_PRESENT:
-                    // Allow "p:u@" when non-strict.
+                    // Allow "u:p@" when non-strict.
                     // Jena3 compatibility.
                     if ( isHTTP(iri) && ! STRICT_HTTP && v.getComponent() == IRIComponents.USER )
                         continue;
@@ -237,6 +237,7 @@ public class IRIProviderJenaIRI implements IRIProvider {
                     if ( isFILE(iri) )
                         continue;
             }
+            // First error.
             String msg = v.getShortMessage();
             throw new IRIException(msg);
         }
diff --git a/jena-core/src/main/java/org/apache/jena/irix/SystemIRIx.java b/jena-core/src/main/java/org/apache/jena/irix/SystemIRIx.java
index 5f8d7e1..6f5496f 100644
--- a/jena-core/src/main/java/org/apache/jena/irix/SystemIRIx.java
+++ b/jena-core/src/main/java/org/apache/jena/irix/SystemIRIx.java
@@ -40,8 +40,8 @@ public class SystemIRIx {
     private static IRIProvider provider;
     static {
         provider = providerJenaIRI;
-        provider.strictMode("urn", false);
-        provider.strictMode("http", true);
+        provider.strictMode("urn",  false);
+        provider.strictMode("http", false);
         provider.strictMode("file", false);
     }