Repository: jena Updated Branches: refs/heads/master b732fdf69 -> 488257beb
JENA-1253: Remove RDF/XML related validity checks. These were applied only in some constructors and not others leading to inconsistent behaviour. Remove checkOrdinal because it was a no-op and the comment by it says "remove shortly". Project: http://git-wip-us.apache.org/repos/asf/jena/repo Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/eac92d15 Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/eac92d15 Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/eac92d15 Branch: refs/heads/master Commit: eac92d159587ef404a02d1a5f61d117360def914 Parents: fb101b8 Author: Andy Seaborne <[email protected]> Authored: Fri Oct 28 16:33:30 2016 +0100 Committer: Andy Seaborne <[email protected]> Committed: Fri Oct 28 16:36:49 2016 +0100 ---------------------------------------------------------------------- .../jena/rdf/model/impl/PropertyImpl.java | 48 +------------------- 1 file changed, 2 insertions(+), 46 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/jena/blob/eac92d15/jena-core/src/main/java/org/apache/jena/rdf/model/impl/PropertyImpl.java ---------------------------------------------------------------------- diff --git a/jena-core/src/main/java/org/apache/jena/rdf/model/impl/PropertyImpl.java b/jena-core/src/main/java/org/apache/jena/rdf/model/impl/PropertyImpl.java index efd7111..abaf3b7 100644 --- a/jena-core/src/main/java/org/apache/jena/rdf/model/impl/PropertyImpl.java +++ b/jena-core/src/main/java/org/apache/jena/rdf/model/impl/PropertyImpl.java @@ -52,50 +52,34 @@ public class PropertyImpl extends ResourceImpl implements Property public PropertyImpl( String uri ) { super( uri ); - checkLocalName(); - checkOrdinal(); } @Override public Property inModel( Model m ) { return getModel() == m ? this : m.createProperty( getURI() ); } - private void checkLocalName() - { - String localName = getLocalName(); - if (localName == null || localName.equals( "" )) - throw new InvalidPropertyURIException( getURI() ); - } - public PropertyImpl( String nameSpace, String localName ) { super( nameSpace, localName ); - checkLocalName(); - checkOrdinal(); } public PropertyImpl( String uri, ModelCom m ) { super( uri, m ); - checkOrdinal(); } public PropertyImpl( String nameSpace, String localName, ModelCom m ) { super( nameSpace, localName, m ); - checkOrdinal(); } public PropertyImpl( Node n, EnhGraph m ) { super( n, m ); - checkOrdinal(); } public PropertyImpl( String nameSpace, String localName, int ordinal, ModelCom m ) { super( nameSpace, localName, m ); - checkLocalName(); - this.ordinal = ordinal; } @Override @@ -105,7 +89,8 @@ public class PropertyImpl extends ResourceImpl implements Property @Override public int getOrdinal() { - if (ordinal < 0) ordinal = computeOrdinal(); + if (ordinal < 0) + ordinal = computeOrdinal(); return ordinal; } @@ -122,33 +107,4 @@ public class PropertyImpl extends ResourceImpl implements Property try { return Integer.parseInt( digits );} catch (NumberFormatException e) { throw new JenaException( "checkOrdinal fails on " + digits, e ); } } - - // Remove shortly. - - protected void checkOrdinal() - { - // char c; - // String nameSpace = getNameSpace(); - // String localName = getLocalName(); - // // check for an rdf:_xxx property - // if (localName.length() > 0) - // { - // if (localName.charAt(0) == '_' && nameSpace.equals(RDF.getURI()) - // && nameSpace.equals(RDF.getURI()) - // && localName.length() > 1 - // ) - // { - // for (int i=1; i<localName.length(); i++) { - // c = localName.charAt(i); - // if (c < '0' || c > '9') return; - // } - // try { - // ordinal = Integer.parseInt(localName.substring(1)); - // } catch (NumberFormatException e) { - // logger.error( "checkOrdinal fails on " + localName, e ); - // } - // } - // } - } - }
