mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[java-action] IDEA-359468 Implement methods which return Long must return 0L
GitOrigin-RevId: 90705e2124800738a0de22eddfdc1a30126b3d47
This commit is contained in:
committed by
intellij-monorepo-bot
parent
ce1f8efe60
commit
ba6d180392
@@ -136,8 +136,9 @@ public final class PsiTypesUtil {
|
||||
return typeText + ".empty()";
|
||||
case CommonClassNames.JAVA_LANG_STRING:
|
||||
return "\"\"";
|
||||
case CommonClassNames.JAVA_LANG_INTEGER:
|
||||
case CommonClassNames.JAVA_LANG_LONG:
|
||||
return "0L";
|
||||
case CommonClassNames.JAVA_LANG_INTEGER:
|
||||
case CommonClassNames.JAVA_LANG_SHORT:
|
||||
case CommonClassNames.JAVA_LANG_BYTE:
|
||||
return "0";
|
||||
|
||||
@@ -260,6 +260,38 @@ public class OverrideImplementTest extends LightJavaCodeInsightFixtureTestCase {
|
||||
""");
|
||||
}
|
||||
|
||||
public void testOverrideLong() {
|
||||
myFixture.addClass(
|
||||
"""
|
||||
package bar;
|
||||
interface A {
|
||||
Long foo();
|
||||
}
|
||||
""");
|
||||
VirtualFile file = myFixture.addClass(
|
||||
"""
|
||||
package bar;
|
||||
class Test implements A {
|
||||
<caret>
|
||||
}
|
||||
"""
|
||||
).getContainingFile().getVirtualFile();
|
||||
myFixture.configureFromExistingVirtualFile(file);
|
||||
|
||||
invokeAction(true);
|
||||
|
||||
myFixture.checkResult(
|
||||
"""
|
||||
package bar;
|
||||
class Test implements A {
|
||||
@Override
|
||||
public Long foo() {
|
||||
return 0L;
|
||||
}
|
||||
}
|
||||
""");
|
||||
}
|
||||
|
||||
public void testTypeAnnotationsInImplementedMethod() {
|
||||
OverrideImplementsAnnotationsHandler handler = new OverrideImplementsAnnotationsHandler() {
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user