This is an automated email from the ASF dual-hosted git repository. vieiro pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-netbeans.git
The following commit(s) were added to refs/heads/master by this push: new 6b8e596 [NETBEANS-277] Fix a NullPointerException issue with FastImportAction (#373) 6b8e596 is described below commit 6b8e596e3c9b44bdb14364d176740c42b39d1d33 Author: Daniel Trebbien <dtrebb...@gmail.com> AuthorDate: Fri Jan 19 10:25:29 2018 -0800 [NETBEANS-277] Fix a NullPointerException issue with FastImportAction (#373) Merged. --- .../netbeans/modules/java/editor/imports/FastImportAction.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/java.editor/src/org/netbeans/modules/java/editor/imports/FastImportAction.java b/java.editor/src/org/netbeans/modules/java/editor/imports/FastImportAction.java index 22a5d56..81957d5 100644 --- a/java.editor/src/org/netbeans/modules/java/editor/imports/FastImportAction.java +++ b/java.editor/src/org/netbeans/modules/java/editor/imports/FastImportAction.java @@ -97,7 +97,15 @@ public class FastImportAction extends BaseAction { final JavaSource javaSource = parameter.getJavaSource(); Pair<Map<String, List<Element>>, Map<String, List<Element>>> result = new ComputeImports(parameter).computeCandidates(Collections.singleton(ident)); - final List<TypeElement> priviledged = ElementFilter.typesIn(result.a.get(ident)); + List<Element> candidates = result.a.get(ident); + // If the identifier is already imported, in scope, or does + // not correspond to an importable element, then there will + // not be any candidates. + if (candidates == null) { + Toolkit.getDefaultToolkit().beep(); + return; + } + final List<TypeElement> priviledged = ElementFilter.typesIn(candidates); if (priviledged == null) { //not found? -- To stop receiving notification emails like this one, please contact ['"commits@netbeans.apache.org" <commits@netbeans.apache.org>']. --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org For additional commands, e-mail: commits-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists