Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable auto formatting upon save in Eclipse?

Eclipse keeps auto formatting upon save, for example: it is insisting the following code should be in a single line once I save, despite breaking it up the way I want to.

@Transactional(rollbackFor = DataAccessException.class, readOnly = false, timeout = 30, propagation = Propagation.SUPPORTS, isolation = Isolation.DEFAULT) 
like image 587
Oliver Avatar asked Mar 04 '11 21:03

Oliver


2 Answers

Window > Preferences > Java > Editor > Save Actions.

Can also be configured at the project level. Project > Properties > Java Editor > Save Actions.

like image 55
dty Avatar answered Sep 27 '22 18:09

dty


Absolutely maddening improvement. For if statements do the following: Window | Preferences | Java | Code Style | Formatter | Control statements tab Select Keep simple if on one line. You might also try the Line wrapping tab

like image 31
Mike Avatar answered Sep 27 '22 18:09

Mike