Community
Participate
Working Groups
The formatter improperly indents after a wrapped ternary expression. It indents all following statements with the indentation of the wrapped expression. My default indentation is set to indent one not two. There does not appear to be an option in the formatter to control anything with regard to ternary expressions. Example: offset = length + Integer.SIZE + bytes.length > offset ? ( int ) pFile.length() : length; ByteBuffer header = ByteBuffer.allocate( length ); header.putLong( i ); header.putInt( offset ); pFile.seek( offset ); pFile.writeInt( bytes.length ); pFile.write( bytes ); pFile.seek( 0 ); pFile.write( header.array() ); pFile.setLength( offset + Integer.SIZE + bytes.length );
Are you using the formatter or 'Correct Indentation' (Ctrl+I)? If the latter, it's bug 65463.
It is just formatting automatically as I type. I am not invoking the formatter or the indentation correcter explicitly. The only way to prevent the problem is to disable the auto formatting so that it doesn't change it back.
*** This bug has been marked as a duplicate of bug 65463 ***