summaryrefslogtreecommitdiff
path: root/tools/gnu/classpath/tools/giop/grmic/Generator.java
diff options
context:
space:
mode:
Diffstat (limited to 'tools/gnu/classpath/tools/giop/grmic/Generator.java')
-rw-r--r--tools/gnu/classpath/tools/giop/grmic/Generator.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/tools/gnu/classpath/tools/giop/grmic/Generator.java b/tools/gnu/classpath/tools/giop/grmic/Generator.java
index 90bb21500..a45e8d398 100644
--- a/tools/gnu/classpath/tools/giop/grmic/Generator.java
+++ b/tools/gnu/classpath/tools/giop/grmic/Generator.java
@@ -56,13 +56,18 @@ public class Generator
/**
* Get resource with the given name, as string.
*
- * @param name
- * the resource name
+ * @param name the resource name
* @return the resourse string (in subfolder /templates).
*/
public String getResource(String name)
{
- InputStream in = getClass().getResourceAsStream("templates/" + name);
+ String resourcePath = "templates/" + name;
+ InputStream in = getClass().getResourceAsStream(resourcePath);
+
+ if (in == null)
+ throw new InternalError(getClass().getName() + ": no resource "
+ + resourcePath);
+
BufferedReader r = new BufferedReader(new InputStreamReader(in));
StringBuffer b = new StringBuffer();