From eac92d159587ef404a02d1a5f61d117360def914 Mon Sep 17 00:00:00 2001 From: Andy Seaborne Date: Fri, 28 Oct 2016 16:33:30 +0100 Subject: [PATCH] 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". --- .../jena/rdf/model/impl/PropertyImpl.java | 48 +------------------ 1 file changed, 2 insertions(+), 46 deletions(-) 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 efd71114e58..abaf3b7c5a5 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 EnhNode wrap( Node n, EnhGraph eg ) 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 boolean isProperty() @Override public int getOrdinal() { - if (ordinal < 0) ordinal = computeOrdinal(); + if (ordinal < 0) + ordinal = computeOrdinal(); return ordinal; } @@ -122,33 +107,4 @@ private int parseInt( String digits ) 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 '9') return; - // } - // try { - // ordinal = Integer.parseInt(localName.substring(1)); - // } catch (NumberFormatException e) { - // logger.error( "checkOrdinal fails on " + localName, e ); - // } - // } - // } - } - }