|
Ken Arnold made changes - 05/Jun/06 08:38 AM
I thought I had a workaround – make classes static, etc. But I don't. Because of things like this: public interface MockExpressionMatcher { boolean matches(String sql); When I use it in code, the anonymous object for MATCH_ALL is created in that class. Or at least it seems so. Consider: private MockDBConnection setupTestDB() { MockDBConnection c = new MockDBConnection(); c.addResultSetFactory(MockExpressionMatcher.MATCH_ALL, new MockUpdateFactory()); return c; } I then get the following problem when running tests: java.lang.NoSuchMethodException: com.hyphenhealth.edc.drq.editchecks.queries.TestComputeQuery$1.<init>() This is true – a javap of this anonymous class shows no constructor at all: class com.hyphenhealth.edc.drq.editchecks.queries.TestComputeQuery$1 extends java.lang.Object{ I cannot control this compiler behavior. This is how it handles static final constructed objects (in interfaces anyway). I cannot make this class non-static because this is not my file. (I probably could make a nested static class for each such field if I controlled the file). If there is a language for exclusion of nested classes I cannot find it in the documentation. So I'm out of workarounds for now. (This is partly a consequence of naming java files instead of classes for inclusion/exclusion. If classes were named I could exclude */\$* (all nested classes). But nested classes have no separate file to include/exclude. I will file a separate feature request for that.) My mistake, this is not a 2.0 issue (that was a typo). It's a 1.5.3 issue. I am going to have to add no-arg constructors to all nested classes right now. This is just wrong.
Brett Porter made changes - 31/Jul/06 09:09 AM
do you mean you are having this issue in 1.5.3 and it's already fixed in 2.0 ? No, I meant that I was using 1.5.3 when I had the problem, and that I hadn't tried it at 2.0. Sorry for the unclarity.
Stephen Coy made changes - 20/Feb/07 07:55 AM
Brett Porter made changes - 23/Feb/07 01:05 AM
Can't reproduce; integration checked in revision 597570
Dan Fabulich made changes - 23/Nov/07 12:55 AM
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
I suspect that adding this feature is what created the bug.