如果我的方法包含一个语句...
if (some-condition) {
return someObject.methodOne().methodTwo().methodThree().methodFour();
}
Eclipse 格式化将其“折叠”为...
if (some-condition) {return someObject.methodOne().methodTwo().methodThree().methodFour();}
但是,如果我的方法包含多个语句...
if (some-condition) {
int a = 42;
return something;
}
Eclipse 格式化将其清理干净并保留在多行中......
if (some-condition) {
int a = 42;
return something;
}
如果我的方法只有一个 return 语句,我仍然希望它占据多行。我从不希望它“折叠”成一行。
如何为我想要的行为配置 Eclipse 格式?我已经玩了很长一段时间没有成功的设置。
谢谢!