mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Fix deprecated Code style API usages in Tests/JavaDoc
This commit is contained in:
@@ -521,7 +521,7 @@ public class JavaSpacePropertyProcessor extends JavaElementVisitor {
|
||||
|
||||
/**
|
||||
* Initializes {@link #myResult} property with {@link Spacing} which {@code 'min line feeds'} property is defined
|
||||
* from {@link CodeStyleSettings#BLANK_LINES_AROUND_CLASS} value.
|
||||
* from {@link CommonCodeStyleSettings#BLANK_LINES_AROUND_CLASS} value.
|
||||
*/
|
||||
private void setAroundClassSpacing() {
|
||||
myResult = Spacing.createSpacing(0, Integer.MAX_VALUE, mySettings.BLANK_LINES_AROUND_CLASS + 1,
|
||||
|
||||
@@ -106,7 +106,7 @@ public class IndentTest extends LightIdeaTestCase {
|
||||
public void testParenthesizedContinuation() throws Exception {
|
||||
|
||||
defaultSettings();
|
||||
CodeStyleSettings settings = CodeStyleSettingsManager.getSettings(getProject());
|
||||
CommonCodeStyleSettings settings = getJavaSettings();
|
||||
settings.ALIGN_MULTILINE_PARENTHESIZED_EXPRESSION = true;
|
||||
|
||||
doTest("ParenthesizedContinuation.java", "ParenthesizedContinuation_after.java");
|
||||
@@ -115,7 +115,7 @@ public class IndentTest extends LightIdeaTestCase {
|
||||
public void testParenthesizedContinuation2() throws Exception {
|
||||
|
||||
defaultSettings();
|
||||
CodeStyleSettings settings = CodeStyleSettingsManager.getSettings(getProject());
|
||||
CommonCodeStyleSettings settings = getJavaSettings();
|
||||
settings.ALIGN_MULTILINE_PARENTHESIZED_EXPRESSION = true;
|
||||
|
||||
doTest("ParenthesizedContinuation2.java", "ParenthesizedContinuation2_after.java");
|
||||
@@ -159,7 +159,7 @@ public class IndentTest extends LightIdeaTestCase {
|
||||
}
|
||||
|
||||
private void defaultSettings() {
|
||||
CodeStyleSettings settings = CodeStyleSettingsManager.getSettings(getProject());
|
||||
CommonCodeStyleSettings settings = getJavaSettings();
|
||||
|
||||
settings.ALIGN_MULTILINE_PARAMETERS = true;
|
||||
settings.ALIGN_MULTILINE_PARAMETERS_IN_CALLS = false;
|
||||
|
||||
@@ -1953,16 +1953,17 @@ class JavaFormatterTest : AbstractJavaFormatterTest() {
|
||||
}
|
||||
|
||||
fun testWrapParamsOnEveryItem() {
|
||||
val codeStyleSettings = CodeStyleSettingsManager.getSettings(LightPlatformTestCase.getProject())
|
||||
val codeStyleSettings = CodeStyleSettingsManager.getSettings(getProject())
|
||||
|
||||
val oldMargin = codeStyleSettings.getCommonSettings(JavaLanguage.INSTANCE).RIGHT_MARGIN
|
||||
val oldKeep = codeStyleSettings.KEEP_LINE_BREAKS
|
||||
val oldWrap = codeStyleSettings.METHOD_PARAMETERS_WRAP
|
||||
val javaSettings = codeStyleSettings.getCommonSettings(JavaLanguage.INSTANCE)
|
||||
val oldMargin = javaSettings.RIGHT_MARGIN
|
||||
val oldKeep = javaSettings.KEEP_LINE_BREAKS
|
||||
val oldWrap = javaSettings.METHOD_PARAMETERS_WRAP
|
||||
|
||||
try {
|
||||
codeStyleSettings.setRightMargin(JavaLanguage.INSTANCE, 80)
|
||||
codeStyleSettings.KEEP_LINE_BREAKS = false
|
||||
codeStyleSettings.METHOD_PARAMETERS_WRAP = CommonCodeStyleSettings.WRAP_ON_EVERY_ITEM
|
||||
javaSettings.KEEP_LINE_BREAKS = false
|
||||
javaSettings.METHOD_PARAMETERS_WRAP = CommonCodeStyleSettings.WRAP_ON_EVERY_ITEM
|
||||
|
||||
doClassTest(
|
||||
"public void foo(String p1,\n" +
|
||||
@@ -1986,8 +1987,8 @@ class JavaFormatterTest : AbstractJavaFormatterTest() {
|
||||
}
|
||||
finally {
|
||||
codeStyleSettings.setRightMargin(JavaLanguage.INSTANCE, oldMargin)
|
||||
codeStyleSettings.KEEP_LINE_BREAKS = oldKeep
|
||||
codeStyleSettings.METHOD_PARAMETERS_WRAP = oldWrap
|
||||
javaSettings.KEEP_LINE_BREAKS = oldKeep
|
||||
javaSettings.METHOD_PARAMETERS_WRAP = oldWrap
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user