Menu

#3 MockLib interface isn't very friendly to Java 1.4

r3-1-0
open
JMockLib (4)
5
2009-02-12
2009-02-12
No

While working on a project that is stuck in 1.4 land I ran into some issues. Some of the interface methods make use of the new Java 5 ellipses feature. For example, addReturnValue(String method, T... objects).
This works well in with Java 5 so you can pass one or more return values if you want to add a series of items. However in Java 1.4 this is treated as an array and forces you to wrap even one item in an array.

So, I'd like to add methods to handle the one item occurrence.

Suggested added interface methods:
<T extends Object> void addReturnValue(String method, T object);
<T extends Object> void removeIgnore(String method);

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.