void (boolean spaceAround) { if (!myChild1.textContains('\n')) { createSpaceInCode(spaceAround); return; } String text = myChild1.getText(); int maxLength = 0; int lastLength = 0; for (Iterator<String> line = text.lines().iterator(); line.hasNext();) { String currentLine = line.next(); int length = currentLine.length(); if (!line.hasNext()) { lastLength = length; } if (length > maxLength) { maxLength = length; } } int spaces = maxLength + (spaceAround ? 1 : 0) - lastLength; myResult = Spacing.createSpacing(spaces, spaces, 0, mySettings.KEEP_LINE_BREAKS, keepBlankLines()); }