Incorporate PR247

This commit is contained in:
JohnHake 2020-02-12 12:40:28 -08:00
parent 335974458e
commit 5965b1dcb7

View File

@ -14,7 +14,7 @@ public class SimpleUtil {
// Searches the entire project for Simple language files with instances of the Simple property with the given key
public static List<SimpleProperty> findProperties(Project project, String key) {
List<SimpleProperty> result = null;
List<SimpleProperty> result = new ArrayList<>();
Collection<VirtualFile> virtualFiles =
FileTypeIndex.getFiles(SimpleFileType.INSTANCE, GlobalSearchScope.allScope(project));
for (VirtualFile virtualFile : virtualFiles) {
@ -24,16 +24,13 @@ public class SimpleUtil {
if (properties != null) {
for (SimpleProperty property : properties) {
if (key.equals(property.getKey())) {
if (result == null) {
result = new ArrayList<SimpleProperty>();
}
result.add(property);
result.add(property);
}
}
}
}
}
return result != null ? result : Collections.<SimpleProperty>emptyList();
return result;
}
public static List<SimpleProperty> findProperties(Project project) {