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() {
+ }
+}
+