Revision: 20019
http://sourceforge.net/p/gate/code/20019
Author: markagreenwood
Date: 2017-01-30 17:25:24 +0000 (Mon, 30 Jan 2017)
Log Message:
-----------
don't try and create a ResourceReference instance from a string if the string
is either null or empty
Modified Paths:
--------------
gate/branches/sawdust2/gate-core/src/main/java/gate/creole/Parameter.java
gate/branches/sawdust2/gate-core/src/main/java/gate/creole/ResourceReference.java
Modified:
gate/branches/sawdust2/gate-core/src/main/java/gate/creole/Parameter.java
===================================================================
--- gate/branches/sawdust2/gate-core/src/main/java/gate/creole/Parameter.java
2017-01-30 17:14:03 UTC (rev 20018)
+++ gate/branches/sawdust2/gate-core/src/main/java/gate/creole/Parameter.java
2017-01-30 17:25:24 UTC (rev 20019)
@@ -261,10 +261,12 @@
}
}
else if (typeName.equals("gate.creole.ResourceReference")) {
- try {
- value = new ResourceReference(plugin, stringValue);
- } catch(URISyntaxException e) {
- throw new ParameterException("Malformed ResourceReference parameter
value: "+stringValue,e);
+ if (stringValue != null && !stringValue.equals("")) {
+ try {
+ value = new ResourceReference(plugin, stringValue);
+ } catch(URISyntaxException e) {
+ throw new ParameterException("Malformed ResourceReference parameter
value: "+stringValue,e);
+ }
}
}
// java builtin types - for numeric types, we don't attempt to parse an
Modified:
gate/branches/sawdust2/gate-core/src/main/java/gate/creole/ResourceReference.java
===================================================================
---
gate/branches/sawdust2/gate-core/src/main/java/gate/creole/ResourceReference.java
2017-01-30 17:14:03 UTC (rev 20018)
+++
gate/branches/sawdust2/gate-core/src/main/java/gate/creole/ResourceReference.java
2017-01-30 17:25:24 UTC (rev 20019)
@@ -61,9 +61,9 @@
public ResourceReference(Plugin plugin, String path)
throws URISyntaxException {
- if (path == null) path = "";
-
- if(plugin != null) {
+ if(path == null) path = "";
+
+ if(plugin != null) {
uri = plugin.getBaseURI().resolve(path);
} else {
uri = new URI(path);
@@ -149,7 +149,7 @@
throw new IOException("Unable to locate URI: " + uri);
}
- public URI toURI() throws URISyntaxException {
+ public URI toURI() {
return uri;
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
GATE-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gate-cvs