[ductilej] push by rc...@opiumtrail.com - Unchecked exception compilation error under DuctileJ... on 2010-07-24 23:42 GMT

1 view
Skip to first unread message

duct...@googlecode.com

unread,
Jul 24, 2010, 7:43:11 PM7/24/10
to ductil...@googlegroups.com
Revision: d61357dd1a
Author: Richard Cook <rc...@opiumtrail.com>
Date: Sat Jul 24 16:41:22 2010
Log: Unchecked exception compilation error under DuctileJ

This is a perplexing one: whether or not DuctileJ should support
compilation of code without exception annotations on methods that originate
exceptions we should at least be consistent. As is, this source file will
compile (ant clean dtests) without reporting a compilation error. If,
however, one deletes the source file NullPointerExceptionTest.java and
recompiles then the error is reported.
http://code.google.com/p/ductilej/source/detail?r=d61357dd1a

Added:
/src/org/ductilej/dtests/UncheckedExceptionTest.java

=======================================
--- /dev/null
+++ /src/org/ductilej/dtests/UncheckedExceptionTest.java Sat Jul 24
16:41:22 2010
@@ -0,0 +1,24 @@
+//
+// $Id$
+
+package org.ductilej.dtests;
+
+import org.junit.Test;
+import static org.junit.Assert.*;
+
+/**
+ * Should compile under DuctileJ but not javac due to lack of check
+ * exception annotation ("throws") on Foo's constructor.
+ */
+public class UncheckedExceptionTest
+{
+ class Foo {
+ public Foo() {
+ throw new java.lang.Exception();
+ }
+ }
+
+ public UncheckedExceptionTest() {
+ }
+}
+

Reply all
Reply to author
Forward
0 new messages