timowest / scalagen

Java to Scala transformation
Apache License 2.0
216 stars 32 forks source link

Fix loop condition and early return conversion (find/map) #62

Closed dnadolny closed 10 years ago

dnadolny commented 10 years ago

The previous code only handled the case where the variable being looped over is used exactly once in a condition (converted to find) or an early return (converted to map). This handles all cases. It's not the greatest since I'm creating a new class that extends NameExpr and has to be dealt with as a special case in ModifierVisitor, but there's no way to add new expressions without changing javaparser (and scala expressions/nodes shouldn't be in there).

timowest commented 10 years ago

Could you update the content? There seem to be conflicts now.

dnadolny commented 10 years ago

Updated, it should merge cleanly now.