dodona-edu / judge-java

JUnit-based Java judge for the Dodona learning environment
MIT License
1 stars 1 forks source link

improve method finding for generic methods #38

Closed ninewise closed 4 years ago

ninewise commented 5 years ago
ninewise commented 4 years ago

This seems impossible for constructors since we don't have the actual types, only objects (so Class, not Type). We might not be able to find (slightly wrong) constructors we could use, but we'll still find all correct constructors as before.

ninewise commented 4 years ago

I think this is now finished for normal methods.

It's not implemented for constructors, yet: I can't dynamically find the Types given a call to current AssertionStubber.stub method since generic types of Objects are erased at runtime. Possible solution: if a stubbed interface has a void _construct(...) method, I can take the Type's of that one to find the actual constructor. Better ideas?

ninewise commented 4 years ago

Some the messages explaining the type issues will not be understood by people starting out with Java. I don't have any ideas immediately on how to fix this, but I'm pretty sure it will be a problem.

The messages in the Assignable class won't ever be shown to the user. I included them to simplify debugging and left them because they won't impact performance. Are the other messages unclear, too?

Also since this judge has i18n support now, any chance we can translate this?

I will translate all messages shown to the user before merging this.

chvp commented 4 years ago

No, that's fine then.