Odd auto-formatting when refactoring is done

When I do some refactoring, IDEA reformats my code putting a lot of tab spaces to the indentation. It is somewhat erratic, and happened only when i was coding a hibernate callback:

        block of code
        return (ommited...).getHibernateTemplate().executeWithNativeSession(new HibernateCallback() {
            public Object doInHibernate(Session session) throws HibernateException, SQLException {
               block of code

The error occurred when i rename some variable inside some block of code, but it not happened always. :(.

ctrl+alt+L fixed the indentation. Since i could not establish in which situation this behavior occurred, I didn't open a issue. Someone else had similar problem?

1 comment
Comment actions Permalink

For some reason, IDEA reformats the code altered by some refactoring. I don't think this was happening on early versions and it is VERY annoying. Every time I make a custom format on code and make a refactor to it(change name, for example), IDEA messes everything up and I have to reformat everything again by hand.

Is this behavior default? I think IDEA should not format or indent code on a refactoring that change an already made code.


Please sign in to leave a comment.