Skip to content

Commit c7d3524

Browse files
author
Kerry Kimbrough
committed
Refactor XML document readers to use org.xml.sax.Attributes.getQName(). For these readers, this is more correct than getLocalName(), which can return an empty string in some JVM implementations.
1 parent beb6e47 commit c7d3524

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

tcases-lib/src/main/java/org/cornutum/tcases/generator/io/GeneratorSetDocReader.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,11 +124,11 @@ public void validateAttributes( String elementName, Attributes attributes) throw
124124
Set<String> validAttributes = getValidAttributes();
125125
for( int i = attributes.getLength() - 1; i >= 0; i--)
126126
{
127-
if( !validAttributes.contains( attributes.getLocalName(i)))
127+
if( !validAttributes.contains( attributes.getQName(i)))
128128
{
129129
throw
130130
new SAXParseException
131-
( "Attribute=" + attributes.getLocalName(i)
131+
( "Attribute=" + attributes.getQName(i)
132132
+ " is not allowed for " + elementName + " elements",
133133
getDocumentLocator());
134134
}

tcases-lib/src/main/java/org/cornutum/tcases/io/SystemInputDocReader.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,11 @@ public void validateAttributes( String elementName, Attributes attributes) throw
125125
Set<String> validAttributes = getValidAttributes();
126126
for( int i = attributes.getLength() - 1; i >= 0; i--)
127127
{
128-
if( !validAttributes.contains( attributes.getLocalName(i)))
128+
if( !validAttributes.contains( attributes.getQName(i)))
129129
{
130130
throw
131131
new SAXParseException
132-
( "Attribute=" + attributes.getLocalName(i)
132+
( "Attribute=" + attributes.getQName(i)
133133
+ " is not allowed for " + elementName + " elements",
134134
getDocumentLocator());
135135
}

tcases-lib/src/main/java/org/cornutum/tcases/io/SystemTestDocReader.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,11 +206,11 @@ public void validateAttributes( String elementName, Attributes attributes) throw
206206
Set<String> validAttributes = getValidAttributes();
207207
for( int i = attributes.getLength() - 1; i >= 0; i--)
208208
{
209-
if( !validAttributes.contains( attributes.getLocalName(i)))
209+
if( !validAttributes.contains( attributes.getQName(i)))
210210
{
211211
throw
212212
new SAXParseException
213-
( "Attribute=" + attributes.getLocalName(i)
213+
( "Attribute=" + attributes.getQName(i)
214214
+ " is not allowed for " + elementName + " elements",
215215
getDocumentLocator());
216216
}

0 commit comments

Comments
 (0)