Unnecessary 'this' qualifier removed; some other warnings fixed

GitOrigin-RevId: bb4ab241211dbe4702d2db6b93213861c041d35d
This commit is contained in:
Tagir Valeev
2024-07-09 13:23:22 +02:00
committed by intellij-monorepo-bot
parent adb0171be3
commit 26437b1785
15 changed files with 26 additions and 25 deletions

View File

@@ -43,18 +43,19 @@ public class SPIFile extends PsiFileBase {
while ((d = fileName.indexOf(".", idx)) > -1) {
final PsiPackage aPackage = JavaPsiFacade.getInstance(getProject()).findPackage(fileName.substring(0, d));
if (aPackage != null) {
refs.add(new SPIFileName2PackageReference(SPIFile.this, aPackage));
refs.add(new SPIFileName2PackageReference(this, aPackage));
}
idx = d + 1;
}
final PsiReference reference = getReference();
PsiElement resolve = reference.resolve();
while (resolve instanceof PsiClass) {
resolve = ((PsiClass)resolve).getContainingClass();
PsiClass psiClass = (PsiClass)resolve;
resolve = psiClass.getContainingClass();
if (resolve != null) {
final String jvmClassName = ClassUtil.getJVMClassName((PsiClass)resolve);
final String jvmClassName = ClassUtil.getJVMClassName(psiClass);
if (jvmClassName != null) {
refs.add(new SPIFileName2PackageReference(SPIFile.this, resolve));
refs.add(new SPIFileName2PackageReference(this, resolve));
}
}
}

View File

@@ -273,14 +273,14 @@ public class TypeAnnotationContainer {
myReferenceElement = NotNullLazyValue.atomicLazy(() -> {
int index = myText.indexOf('(');
String refText = index > 0 ? myText.substring(1, index) : myText.substring(1);
return new ClsJavaCodeReferenceElementImpl(ClsTypeAnnotationImpl.this, refText);
return new ClsJavaCodeReferenceElementImpl(this, refText);
});
myParameterList = NotNullLazyValue.atomicLazy(() -> {
PsiNameValuePair[] attrs = myText.indexOf('(') > 0
? JavaPsiFacade.getElementFactory(getProject()).createAnnotationFromText(myText, myParent)
.getParameterList().getAttributes()
: PsiNameValuePair.EMPTY_ARRAY;
return new ClsAnnotationParameterListImpl(ClsTypeAnnotationImpl.this, attrs);
return new ClsAnnotationParameterListImpl(this, attrs);
});
}

View File

@@ -19,10 +19,10 @@ public abstract class ClsMemberImpl<T extends PsiMemberStub> extends ClsReposito
protected ClsMemberImpl(T stub) {
super(stub);
myDocComment = !stub.isDeprecated() ? null : NotNullLazyValue.atomicLazy(() -> {
return new ClsDocCommentImpl(ClsMemberImpl.this);
return new ClsDocCommentImpl(this);
});
myNameIdentifier = NotNullLazyValue.atomicLazy(() -> {
return new ClsIdentifierImpl(ClsMemberImpl.this, getName());
return new ClsIdentifierImpl(this, getName());
});
}

View File

@@ -1043,7 +1043,7 @@ public final class SearchEverywhereUI extends BigPopupUI implements DataProvider
return;
}
Component oppositeComponent = e.getOppositeComponent();
if (!isHintComponent(oppositeComponent) && !UIUtil.haveCommonOwner(SearchEverywhereUI.this, oppositeComponent)) {
if (!isHintComponent(oppositeComponent) && !UIUtil.haveCommonOwner(this, oppositeComponent)) {
sendStatisticsAndClose();
}
}

View File

@@ -83,7 +83,7 @@ public class TreeTableView extends TreeTable implements SelectionProvider {
@Override
public TreeTableCellRenderer createTableRenderer(TreeTableModel treeTableModel) {
return new TreeTableCellRenderer(TreeTableView.this, getTree()) {
return new TreeTableCellRenderer(this, getTree()) {
@Override
public Component getTableCellRendererComponent(JTable table,
Object value,

View File

@@ -580,7 +580,7 @@ public class Tree extends JTree implements ComponentWithEmptyText, ComponentWith
@ApiStatus.Internal
public void fireAccessibleTreeExpanded(@NotNull TreePath path) {
if (accessibleContext != null) {
((AccessibleJTree)accessibleContext).treeExpanded(new TreeExpansionEvent(Tree.this, path));
((AccessibleJTree)accessibleContext).treeExpanded(new TreeExpansionEvent(this, path));
}
}
@@ -597,7 +597,7 @@ public class Tree extends JTree implements ComponentWithEmptyText, ComponentWith
@ApiStatus.Internal
public void fireAccessibleTreeCollapsed(@NotNull TreePath path) {
if (accessibleContext != null) {
((AccessibleJTree)accessibleContext).treeCollapsed(new TreeExpansionEvent(Tree.this, path));
((AccessibleJTree)accessibleContext).treeCollapsed(new TreeExpansionEvent(this, path));
}
}

View File

@@ -28,7 +28,7 @@ public final class ListModelEditor<T> extends ListModelEditorBase<T> {
.setAddAction(button -> {
if (!model.isEmpty()) {
T lastItem = model.getElementAt(model.getSize() - 1);
if (ListModelEditor.this.itemEditor.isEmpty(lastItem)) {
if (this.itemEditor.isEmpty(lastItem)) {
ScrollingUtil.selectItem(list, ContainerUtil.indexOfIdentity(model.getItems(), lastItem));
return;
}

View File

@@ -204,7 +204,7 @@ public abstract class ProcessHandler extends UserDataHolderBase {
if (myState.compareAndSet(State.TERMINATING, State.TERMINATED)) {
try {
myExitCode = exitCode;
myEventMulticaster.processTerminated(new ProcessEvent(ProcessHandler.this, exitCode));
myEventMulticaster.processTerminated(new ProcessEvent(this, exitCode));
}
catch (Throwable e) {
if (!isCanceledException(e)) {

View File

@@ -47,7 +47,7 @@ public class ExternalChangesDetectionVcsTest extends AbstractJunitVcsTestCase {
myClientRoot = new File(myTempDirTestFixture.getTempDirPath(), "clientroot");
myClientRoot.mkdir();
initProject(myClientRoot, ExternalChangesDetectionVcsTest.this.getTestName());
initProject(myClientRoot, this.getTestName());
myVcs = new MockAbstractVcs(myProject);
myVcs.setChangeProvider(new MyMockChangeProvider());

View File

@@ -379,7 +379,7 @@ public class TestNGConfigurationEditor<T extends TestNGConfiguration> extends Se
}
try {
if (declaration instanceof PsiClass &&
new TestClassBrowser(project, TestNGConfigurationEditor.this).getFilter().isAccepted((PsiClass)declaration)) {
new TestClassBrowser(project, this).getFilter().isAccepted((PsiClass)declaration)) {
return JavaCodeFragment.VisibilityChecker.Visibility.VISIBLE;
}
}

View File

@@ -38,7 +38,7 @@ public class TestNGDependsOnInspectionTest extends LightJavaCodeInsightFixtureTe
protected void setUp() {
UIUtil.invokeAndWaitIfNeeded(() -> {
try {
TestNGDependsOnInspectionTest.super.setUp();
super.setUp();
myFixture.enableInspections(new DependsOnMethodInspection());
}
@@ -53,7 +53,7 @@ public class TestNGDependsOnInspectionTest extends LightJavaCodeInsightFixtureTe
protected void tearDown() {
UIUtil.invokeAndWaitIfNeeded(() -> {
try {
TestNGDependsOnInspectionTest.super.tearDown();
super.tearDown();
}
catch (Exception e) {
throw new RuntimeException(e);

View File

@@ -24,7 +24,7 @@ public class UndeclaredTestsInspectionTest extends JavaInspectionTestCase {
protected void setUp() {
UIUtil.invokeAndWaitIfNeeded(() -> {
try {
UndeclaredTestsInspectionTest.super.setUp();
super.setUp();
}
catch (Exception e) {
throw new RuntimeException(e);
@@ -37,7 +37,7 @@ public class UndeclaredTestsInspectionTest extends JavaInspectionTestCase {
protected void tearDown() {
UIUtil.invokeAndWaitIfNeeded(() -> {
try {
UndeclaredTestsInspectionTest.super.tearDown();
super.tearDown();
}
catch (Exception e) {
throw new RuntimeException(e);

View File

@@ -17,7 +17,7 @@ public class TestNGDataProviderTest extends LightJavaCodeInsightFixtureTestCase
protected void setUp() {
UIUtil.invokeAndWaitIfNeeded(() -> {
try {
TestNGDataProviderTest.super.setUp();
super.setUp();
}
catch (Exception e) {
throw new RuntimeException(e);
@@ -30,7 +30,7 @@ public class TestNGDataProviderTest extends LightJavaCodeInsightFixtureTestCase
protected void tearDown() {
UIUtil.invokeAndWaitIfNeeded(() -> {
try {
TestNGDataProviderTest.super.tearDown();
super.tearDown();
}
catch (Exception e) {
throw new RuntimeException(e);

View File

@@ -17,7 +17,7 @@ public class TestNGSuiteTest extends LightJavaCodeInsightFixtureTestCase {
protected void setUp() {
UIUtil.invokeAndWaitIfNeeded(() -> {
try {
TestNGSuiteTest.super.setUp();
super.setUp();
}
catch (Exception e) {
throw new RuntimeException(e);
@@ -30,7 +30,7 @@ public class TestNGSuiteTest extends LightJavaCodeInsightFixtureTestCase {
protected void tearDown() {
UIUtil.invokeAndWaitIfNeeded(() -> {
try {
TestNGSuiteTest.super.tearDown();
super.tearDown();
}
catch (Exception e) {
throw new RuntimeException(e);

View File

@@ -203,7 +203,7 @@ public class XmlDoctypeImpl extends XmlElementImpl implements XmlDoctype {
}
protected PsiReference createUrlReference(final PsiElement dtdUrlElement) {
return new URLReference(XmlDoctypeImpl.this) {
return new URLReference(this) {
@Override
public @NotNull String getCanonicalText() {
return extractValue(dtdUrlElement);