void (@NotNull PsiFile file) { if (myType1 == JavaElementType.PACKAGE_STATEMENT) { int lf = mySettings.BLANK_LINES_AFTER_PACKAGE + 1; myResult = Spacing.createSpacing(0, 0, lf, mySettings.KEEP_LINE_BREAKS, mySettings.KEEP_BLANK_LINES_IN_DECLARATIONS); } else if (myType2 == JavaElementType.PACKAGE_STATEMENT) { int lf = mySettings.BLANK_LINES_BEFORE_PACKAGE + 1; // special case when header before package int keepLines = myType1 == JavaTokenType.C_STYLE_COMMENT ? mySettings.KEEP_BLANK_LINES_BETWEEN_PACKAGE_DECLARATION_AND_HEADER : mySettings.KEEP_BLANK_LINES_IN_DECLARATIONS; myResult = Spacing.createSpacing(0, 0, lf, mySettings.KEEP_LINE_BREAKS,keepLines); } else if (myType1 == JavaElementType.IMPORT_LIST) { int lf = mySettings.BLANK_LINES_AFTER_IMPORTS + 1; myResult = Spacing.createSpacing(0, 0, lf, mySettings.KEEP_LINE_BREAKS, mySettings.KEEP_BLANK_LINES_IN_DECLARATIONS); } else if (myType2 == JavaElementType.IMPORT_LIST) { int lf = mySettings.BLANK_LINES_BEFORE_IMPORTS + 1; myResult = Spacing.createSpacing(0, 0, lf, mySettings.KEEP_LINE_BREAKS, mySettings.KEEP_BLANK_LINES_IN_DECLARATIONS); } else if (myType2 == JavaElementType.CLASS) { int lf = mySettings.BLANK_LINES_AROUND_CLASS + 1; myResult = Spacing.createSpacing(0, 0, lf, mySettings.KEEP_LINE_BREAKS, mySettings.KEEP_BLANK_LINES_IN_DECLARATIONS); } }