Skip to content

Commit 16c75f0

Browse files
committed
fixed a minor bug
1 parent 13d4da3 commit 16c75f0

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ xpath-utils
1111
<dependency>
1212
<groupId>com.avides.xpath</groupId>
1313
<artifactId>xpath-utils</artifactId>
14-
<version>1.1.3.RELEASE</version>
14+
<version>1.1.4.RELEASE</version>
1515
</dependency>
1616
```
1717
#### Available methods

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<name>xpath-utils</name>
66
<description>Provides some utility-methods to simplify the use of XPath</description>
77
<url>https://github.com/avides/xpath-utils</url>
8-
<version>1.1.3.RELEASE</version>
8+
<version>1.1.4.RELEASE</version>
99

1010
<properties>
1111
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

src/main/java/com/avides/xpath/utils/XPathUtils.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1630,6 +1630,7 @@ static <T> Function<String, T> getConverter(Class<? extends Function<String, T>>
16301630
return converter;
16311631
}
16321632

1633+
@SuppressWarnings("unchecked")
16331634
private static <T> T unmarshallOrConvert(Node node, Class<T> subType, Function<String, T> converter)
16341635
{
16351636
if (node != null)
@@ -1642,6 +1643,10 @@ else if (converter != null)
16421643
{
16431644
return converter.apply(node.getValue());
16441645
}
1646+
else if ((subType == null) || (subType == String.class))
1647+
{
1648+
return (T) node.getValue();
1649+
}
16451650
}
16461651
return null;
16471652
}

0 commit comments

Comments
 (0)