Refactor static member invocation
Someone used a static method. Refactor the method into a static import while fixing the assertion.
Start file
import org.Assert; C{ m(){ Assert.assertEquals(42, "Meaning of life"); } }
End file
import static org.Assert.assertEquals; C{ m(){ assertEquals("Meaning of life", "Meaning of life"); } }
View Diff
1c1 < import org.Assert; --- > import static org.Assert.assertEquals; 5c5 < Assert.assertEquals(42, "Meaning of life"); --- > assertEquals("Meaning of life", "Meaning of life");
Solutions
The best way to learn is to practice. Below, you will find some of the solutions other golfers have entered. To unlock higher ranked solutions, submit your own entry which does as well or better than the solutions you can currently see - climb the ladder!
Check out these helpful resources to improve your Vim skills... Game on.
Unlock 63 remaining solutions by signing in and submitting your own entry
#64 Alok Singh / @TheRevAlokSingh - Score: 289 - 03/25/15 @ 05:51
<Down><Down><Down><Down><Down><Down><Down><Up><Up><Up><Up><Up><Up><Up><Up><Up><Up><BS>jljkklhllllllllllhhhhhhhhhhh lhjkjjjjjkkkkkkkkkklhhhhhh<C-N><C-N>kklllllllllljkkkkkkkkhhhh/<Esc>:s <BS>/\.Ass<BS><BS><BS><BS><BS>ass<BS><BS><BS><Esc><Esc><Esc><Esc>l<BS><BS>lhistatic<C-H><C-H><C-H><C-H><C-H><C-H> static l<BS><BS><C-H><C-H><Left><Right>ic<Right><Left><Esc>wwwwhls<Esc>li.<Esc>hlxld<Esc>A.assertEquals<BS>s:<BS>;<Esc>j5ggdwx<BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS>jjjjllhhvllllllllllllllllyhhhvhp<Esc>jjjjkkkjjjjjjjjjjjjjjj:wq<CR>
0 comments