EA-39157 Groovy allows empty method names

This commit is contained in:
Max Medvedev
2012-10-17 13:16:17 +04:00
parent e6e4f240f6
commit e7116a7f71
2 changed files with 3 additions and 2 deletions
@@ -59,8 +59,7 @@ public class MethodUsagesSearcher extends QueryExecutorBase<PsiReference, Method
final String textToSearch = method.getName();
if (StringUtil.isEmpty(textToSearch)) {
PsiFile file = aClass.getContainingFile();
LOG.error("Cannot search for the method with empty name: "+method+"; class:"+aClass+"; file: "+ file+"; "+(file == null ? null : file.getVirtualFile()));
return;
}
final PsiMethod[] methods = strictSignatureSearch ? new PsiMethod[]{method} : aClass.findMethodsByName(textToSearch, false);
@@ -19,6 +19,7 @@ package org.jetbrains.plugins.groovy.findUsages;
import com.intellij.openapi.application.QueryExecutorBase;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.roots.ProjectRootManager;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiFile;
@@ -72,6 +73,7 @@ public class MethodLateBoundReferencesSearcher extends QueryExecutorBase<PsiRefe
private static void orderSearching(SearchScope searchScope, final String name, @NotNull SearchRequestCollector collector, final int paramCount) {
if (StringUtil.isEmpty(name)) return;
collector.searchWord(name, searchScope, UsageSearchContext.IN_CODE, true, new RequestResultProcessor("groovy.lateBound") {
@Override
public boolean processTextOccurrence(PsiElement element, int offsetInElement, Processor<PsiReference> consumer) {