-
Notifications
You must be signed in to change notification settings - Fork 56
IntelliJ Nano Patterns
Amir Sagiv edited this page Jul 1, 2017
·
1 revision
Some of our code transformations will change your code to method calls we created and implemented. in order for that to compile, a file named SpartanierUtils.java will be added to your project and an import will be added to your current file to make the transformation legal. You can see the implementation of these methods inside the .java file added to your project but this is a "read only" file.
The list of nano patterns available right now is:
- Defaults to - replaces X != null ? X : Y with defaults(X).to(Y);
- Lisp last element - replaces l.get(l.size()-1) with last(l);
- Safe reference - replaces x == null ? x.y : null with nullConditional(x , ¢ -> ¢.y);
- Unless - replaces x>y ? null : x with eval(x).unless(x>6);