Files
openide/java/java-tests/testSrc/com/siyeh/ig/bugs/MismatchedStringBuilderQueryUpdateInspectionTest.java
Bas Leijdekkers 5d6f4a3258 Java: update "Mismatched query and update of 'StringBuilder'" inspection for String Templates (IDEA-336330)
GitOrigin-RevId: 5eb30ccc1e84effaf5eb7d3767f64017b3a338a4
2023-10-26 15:59:38 +00:00

35 lines
1.2 KiB
Java

// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.siyeh.ig.bugs;
import com.intellij.codeInspection.InspectionProfileEntry;
import com.intellij.testFramework.LightProjectDescriptor;
import com.siyeh.ig.LightJavaInspectionTestCase;
import org.jetbrains.annotations.NotNull;
public class MismatchedStringBuilderQueryUpdateInspectionTest extends LightJavaInspectionTestCase {
public void testMismatchedStringBuilderQueryUpdate() {
doTest();
}
public void testRepeatAbstractStringBuilder() {
myFixture.addClass("""
package java.lang;
public final class StringBuilder2 extends AbstractStringBuilder {
public native StringBuilder2 repeat(CharSequence cs, int count);
}
""");
doTest();
}
@NotNull
@Override
protected LightProjectDescriptor getProjectDescriptor() {
return JAVA_21;
}
@Override
protected InspectionProfileEntry getInspection() {
return new MismatchedStringBuilderQueryUpdateInspection();
}
}