Skip to content

Commit

Permalink
Fix method call serialization #66
Browse files Browse the repository at this point in the history
  • Loading branch information
timowest committed Nov 14, 2013
1 parent c8cf134 commit 34dd93c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,8 @@ class ScalaDumpVisitor(settings: ConversionSettings) extends VoidVisitor[ScalaDu
def visit(n: MethodCallExpr, arg: Context) {
//val split = arg.split
var args = if (n.getArgs == null) 0 else n.getArgs.size
val shortForm = (SHORT_FORM.contains(n.getName) && args < 2) || (NO_ARGS_SHORT.contains(n.getName) && args == 0)
val shortForm = ((SHORT_FORM.contains(n.getName) && args < 2 && !n.getArgs.get(0).isInstanceOf[LiteralExpr])
|| (NO_ARGS_SHORT.contains(n.getName) && args == 0))
if (n.getScope != null) {
val split = settings.splitLongLines && print(n.getScope, arg).length > 50
n.getScope.accept(this, arg)
Expand Down
19 changes: 19 additions & 0 deletions scalagen/src/test/scala/com/mysema/examples/Literal.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.mysema.examples;


public class Literal {

public void doSomething() {
final String s = query("");
System.out.println(s);
}

public void doSomething2() {
System.out.println(query(""));
}

private String query(String string) {
return null;
}

}

0 comments on commit 34dd93c

Please sign in to comment.