History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: GRVY-1147
Type: New Feature New Feature
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Ilya Sergey
Reporter: Eugene Vigdorchik
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Groovy

new quickfix to dynamize invalid groovy code

Created: 05 Mar 08 15:37   Updated: 08 Sep 08 14:43
Component/s: Refactoring
Affects Version/s: jetgroovy 2.0
Fix Version/s: jetgroovy 2.0

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown


 Description  « Hide
When converting java to groovy it is quite often to get
new Runnable() {
public void run() {
}
}

flagged in the editor with "Cannot instantiate interface" - note that it wworks only for interfaces, not for abstract classes!
At this point we could provide an intelligent quick fix that would convert one-method interface instantiation to closure,
and many methods to map as MyInterface:

MyInterface i = [m1: {}, .. mn : {}] as MyInterface

Note that in case of overloading we'd have to put the methods with List arguments and dispatch at runtime.



 All   Comments   Work Log   Change History      Sort Order:
There are no comments yet on this issue.