SpartanizeJ L1.0
Pre-release
Pre-release
New Release!!!!
Advanced Leonidas-based tips:
-
Remove curly braces from if statement:
if (x > 0) { y++; } => if (x>0) y++;
-
Remove curly braces from while statement:
while (!s.isEmpty()) { write(s.pop());} => while (!s.isEmpty()) write(s.pop());
-
Remove double negation:
if(!(!(x > 9))) { ... } => if (x > 9) { ... }
-
Fluent Setter :
class X { private int y; public void setY(int y) { this.y = y; }} => class X { private int y; public X setY(int y) { this.y = y; return this; }}
-
Advance by one :
x += 1; => x++;
-
Reorder Literal Equals :
String s = ... ; s.equals("$$$") => "$$$".equals(s);
-
Collapse an if clause with throws :
if (x > 0) throw e1; throw e2; => throw x > 0 ? e1 : e2;
Advanced GUI :
- Enabling / Disabling of Spartanization
- Spartanization of an entire file
- Playground : try and spartanize you code!
- Modify enabled tips.