Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
package com.intellij.struts2.dom.params.custom;

import com.intellij.codeInsight.daemon.EmptyResolveMessageProvider;
import com.intellij.codeInspection.LocalQuickFix;
import com.intellij.codeInspection.LocalQuickFixProvider;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiMethod;
import com.intellij.psi.PsiReference;
Expand Down Expand Up @@ -60,13 +58,13 @@ public class ResultParamNameCustomConverter extends ParamNameConverter.ParamName


private static final class MergingBeanPropertyPathReference extends PsiReferenceBase<PsiElement>
implements EmptyResolveMessageProvider, LocalQuickFixProvider {
implements EmptyResolveMessageProvider {

private final List<BeanPropertyPathReference[]> allReferences = new SmartList<>();

/**
* @param element XML element.
* @param paramsElements First element will be used for quickfixes.
* @param paramsElements Elements providing bean property references.
*/
private MergingBeanPropertyPathReference(@NotNull XmlAttributeValue element,
ParamsElement @NotNull ... paramsElements) {
Expand Down Expand Up @@ -113,18 +111,5 @@ public String getUnresolvedMessagePattern() {
return "Cannot resolve property '" + getValue() + "'";
}

@Override
public @NotNull LocalQuickFix @Nullable [] getQuickFixes() {
List<LocalQuickFix> quickFixes = new SmartList<>();
for (BeanPropertyPathReference[] reference : allReferences) {
for (BeanPropertyPathReference pathReference : reference) {
final LocalQuickFix[] fixes = pathReference.getQuickFixes();
if (fixes != null) {
Collections.addAll(quickFixes, fixes);
}
}
}
return quickFixes.toArray(LocalQuickFix.EMPTY_ARRAY);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,8 @@

import com.intellij.codeInsight.daemon.EmptyResolveMessageProvider;
import com.intellij.codeInsight.lookup.LookupElementBuilder;
import com.intellij.codeInspection.LocalQuickFix;
import com.intellij.codeInspection.LocalQuickFixProvider;
import com.intellij.openapi.util.TextRange;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.psi.*;
import com.intellij.psi.impl.beanProperties.CreateBeanPropertyFixes;
import com.intellij.psi.util.PropertyUtilBase;
import com.intellij.util.ArrayUtilRt;
import com.intellij.util.IncorrectOperationException;
Expand All @@ -39,7 +35,7 @@
* @author Yann C&eacute;bron
*/
public class BeanPropertyPathReference extends PsiReferenceBase<PsiElement>
implements EmptyResolveMessageProvider, LocalQuickFixProvider {
implements EmptyResolveMessageProvider {

private final BeanPropertyPathReferenceSet referenceSet;
private final int index;
Expand Down Expand Up @@ -119,21 +115,6 @@ public PsiElement bindToElement(@NotNull final PsiElement element) throws Incorr
return getElement();
}

@Override
public @NotNull LocalQuickFix @Nullable [] getQuickFixes() {
final String value = getValue();
if (StringUtil.isEmpty(value)) {
return LocalQuickFix.EMPTY_ARRAY;
}

final PsiClass psiClass = getPsiClass();
if (psiClass == null) {
return LocalQuickFix.EMPTY_ARRAY;
}

return CreateBeanPropertyFixes.createFixes(value, psiClass, null, true);
}

@Nullable
private PsiMethod resolveProperty(@NotNull final PsiClass psiClass, final String propertyName) {
PsiMethod method = isLast() ?
Expand Down
Loading