mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-05 01:50:56 +07:00
JavaCodeStyleSettings: do not store additional values, when setting is imported.
1. import only when legacy setting is not default, when importing set it to default to let it happen only once 2. removed legacy boolean value from settings
This commit is contained in:
@@ -41,8 +41,6 @@ public class JavaCodeStyleSettings extends CustomCodeStyleSettings {
|
||||
public static final int FULLY_QUALIFY_NAMES_ALWAYS = 2;
|
||||
public static final int SHORTEN_NAMES_ALWAYS_AND_ADD_IMPORT = 3;
|
||||
|
||||
public boolean LEGACY_SETTING_USE_FQ_CLASS_NAMES_IN_JAVADOC_IMPORTED = false;
|
||||
|
||||
public int CLASS_NAMES_IN_JAVADOC = FULLY_QUALIFY_NAMES_IF_NOT_IMPORTED;
|
||||
|
||||
public boolean useFqNamesInJavadocAlways() {
|
||||
@@ -51,12 +49,15 @@ public class JavaCodeStyleSettings extends CustomCodeStyleSettings {
|
||||
|
||||
@Override
|
||||
public void importLegacySettings() {
|
||||
if (!LEGACY_SETTING_USE_FQ_CLASS_NAMES_IN_JAVADOC_IMPORTED) {
|
||||
CodeStyleSettings settings = getContainer();
|
||||
if (!settings.USE_FQ_CLASS_NAMES_IN_JAVADOC) {
|
||||
CLASS_NAMES_IN_JAVADOC = SHORTEN_NAMES_ALWAYS_AND_ADD_IMPORT;
|
||||
}
|
||||
LEGACY_SETTING_USE_FQ_CLASS_NAMES_IN_JAVADOC_IMPORTED = true;
|
||||
importLegacyUseFqClassNamesInJavadocSetting();
|
||||
}
|
||||
|
||||
private void importLegacyUseFqClassNamesInJavadocSetting() {
|
||||
CodeStyleSettings settings = getContainer();
|
||||
boolean isDefaultValue = settings.USE_FQ_CLASS_NAMES_IN_JAVADOC;
|
||||
if (!isDefaultValue) {
|
||||
CLASS_NAMES_IN_JAVADOC = SHORTEN_NAMES_ALWAYS_AND_ADD_IMPORT;
|
||||
settings.USE_FQ_CLASS_NAMES_IN_JAVADOC = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user