void (@NotNull CodeStyleSettings oldCodeStyleSettings, @NotNull CodeStyleSettings currentCodeStyleSettings) { final CodeInsightSettings settings = CodeInsightSettings.getInstance(); // don't use method references here to make stack trace reading easier //noinspection Convert2MethodRef RunAll.runAll( () -> { try { checkCodeInsightSettingsEqual(defaultSettings, settings); } catch (AssertionError error) { CodeInsightSettings clean = new CodeInsightSettings(); for (Field field : clean.getClass().getFields()) { try { ReflectionUtil.copyFieldValue(clean, settings, field); } catch (Exception ignored) { } } throw error; } }, () -> { currentCodeStyleSettings.getIndentOptions(JavaFileType.INSTANCE); try { checkCodeStyleSettingsEqual(oldCodeStyleSettings, currentCodeStyleSettings); } finally { currentCodeStyleSettings.clearCodeStyleSettings(); } } ); }