mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-13 15:52:01 +07:00
[Java. Inspections] disable suggestion of adding excepion to signature in base methods if they are synthetic
IDEA-358300 GitOrigin-RevId: c042955003e44d4d575569543c4247ac223c02ec
This commit is contained in:
committed by
intellij-monorepo-bot
parent
bc8f0bf7c5
commit
ae1025c38d
@@ -0,0 +1,25 @@
|
||||
package com.intellij.java.lomboktest
|
||||
|
||||
import com.intellij.codeInsight.daemon.QuickFixBundle
|
||||
import com.intellij.openapi.command.executeCommand
|
||||
import com.intellij.refactoring.suggested.LightJavaCodeInsightFixtureTestCaseWithUtils
|
||||
import com.intellij.testFramework.LightProjectDescriptor
|
||||
import de.plushnikov.intellij.plugin.LombokTestUtil.LOMBOK_DESCRIPTOR
|
||||
|
||||
class LombokAddRuntimeExceptionToThrowsActionTest: LightJavaCodeInsightFixtureTestCaseWithUtils() {
|
||||
override fun getProjectDescriptor(): LightProjectDescriptor = LOMBOK_DESCRIPTOR
|
||||
|
||||
override fun getBasePath(): String = "community/plugins/lombok/testData/intention/addExceptionToThrows"
|
||||
|
||||
|
||||
fun testOverridingSyntheticElement() = doTest()
|
||||
|
||||
private fun doTest() {
|
||||
val name = getTestName(false)
|
||||
myFixture.configureByFile("before$name.java")
|
||||
val intention = myFixture.availableIntentions.singleOrNull { it.familyName == QuickFixBundle.message("add.runtime.exception.to.throws.family") }
|
||||
assertNotNull(intention)
|
||||
executeCommand { intention?.invoke(project, editor, file) }
|
||||
myFixture.checkResultByFile("after$name.java")
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
import lombok.Getter;
|
||||
|
||||
public class A {
|
||||
@Getter
|
||||
private String s;
|
||||
|
||||
private static class B extends A {
|
||||
@Override
|
||||
public String getS() {
|
||||
throw new RuntimeException();
|
||||
}
|
||||
}
|
||||
|
||||
private static class C extends B {
|
||||
@Override
|
||||
public String getS() throws RuntimeException {
|
||||
throw new Runtime<caret>Exception();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
import lombok.Getter;
|
||||
|
||||
public class A {
|
||||
@Getter
|
||||
private String s;
|
||||
|
||||
private static class B extends A {
|
||||
@Override
|
||||
public String getS() {
|
||||
throw new RuntimeException();
|
||||
}
|
||||
}
|
||||
|
||||
private static class C extends B {
|
||||
@Override
|
||||
public String getS() {
|
||||
throw new Runtime<caret>Exception();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user