From c8808d230a8c4f938b6adb54eb250299a092d87c Mon Sep 17 00:00:00 2001 From: "David A. Madore" Date: Mon, 19 Apr 2010 08:50:41 +0200 Subject: Use RuntimeException classes rather than Error to indicate errors. --- org/madore/damlengine/TodoDamlElement.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'org/madore/damlengine/TodoDamlElement.java') diff --git a/org/madore/damlengine/TodoDamlElement.java b/org/madore/damlengine/TodoDamlElement.java index e7b9527..d177998 100644 --- a/org/madore/damlengine/TodoDamlElement.java +++ b/org/madore/damlengine/TodoDamlElement.java @@ -25,7 +25,7 @@ public class TodoDamlElement extends TodoDefaultElement { public void handleNodeOnly() { if ( ! ( options instanceof DamlEngine.RootOptions ) ) - throw new Error("daml node can only be root node"); + throw new IllegalArgumentException("daml node can only be root node"); final String uriToTopName = "uri-to-top"; if ( node.hasAttributeNS(null, uriToTopName) ) ctx.uriToTop = node.getAttributeNS(null, uriToTopName); @@ -34,7 +34,7 @@ public class TodoDamlElement extends TodoDefaultElement { ctx.fileName = node.getAttributeNS(null, fileNameName); if ( ctx.htmlNode != null ) - throw new Error("html node already defined at daml node"); + throw new IllegalStateException("html node already defined at daml node"); ctx.htmlNode = ctx.doc.createElementNS(DamlEngine.XHTML_NS, "html"); String lang = LangHelper.getLangNorec(node); if ( lang != null ) @@ -44,7 +44,7 @@ public class TodoDamlElement extends TodoDefaultElement { ctx.htmlNode.appendChild(ctx.doc.createComment(" This file is automatically generated. Do not edit! ")); ctx.htmlNode.appendChild(ctx.doc.createTextNode("\n")); if ( ctx.headNode != null ) - throw new Error("head node already defined at daml node"); + throw new IllegalStateException("head node already defined at daml node"); ctx.headNode = ctx.doc.createElementNS(DamlEngine.XHTML_NS, "head"); ctx.htmlNode.appendChild(ctx.headNode); ctx.htmlNode.appendChild(ctx.doc.createTextNode("\n")); @@ -92,7 +92,7 @@ public class TodoDamlElement extends TodoDefaultElement { } else if ( child.getNodeType() == Node.TEXT_NODE || child.getNodeType() == Node.CDATA_SECTION_NODE ) { if ( ! Pattern.matches("^\\s*$",((CharacterData)child).getData()) ) - throw new Error("daml element cannot contain text"); + throw new IllegalArgumentException("daml element cannot contain text"); } } this.ownerDeque.registerAtStart(toProcess); -- cgit v1.2.3