diff options
| author | vrubezhny | 2015-05-19 17:35:28 +0000 |
|---|---|---|
| committer | vrubezhny | 2015-07-14 17:50:23 +0000 |
| commit | e610f24d240e91f26075484ec4bfafa031f80f25 (patch) | |
| tree | 9e6f0ad31d0db2c464f9ea2dbf225820f365e332 | |
| parent | 2894824dda183cca6aed55e7e38d0a8a094c106e (diff) | |
| download | webtools.jsdt-e610f24d240e91f26075484ec4bfafa031f80f25.tar.gz webtools.jsdt-e610f24d240e91f26075484ec4bfafa031f80f25.tar.xz webtools.jsdt-e610f24d240e91f26075484ec4bfafa031f80f25.zip | |
Bug 467319 - NullPointerException in CompilationUnitProblemFinder.process (280)
Issue is fixed
Signed-off-by: vrubezhny <vrubezhny@exadel.com>
| -rw-r--r-- | bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/CompilationUnitProblemFinder.java | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/CompilationUnitProblemFinder.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/CompilationUnitProblemFinder.java index 25ebbe6d9..37c018ce9 100644 --- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/CompilationUnitProblemFinder.java +++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/CompilationUnitProblemFinder.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2015 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -277,20 +277,22 @@ public class CompilationUnitProblemFinder extends Compiler implements ITypeReque true, // analyze code true); // generate code } - CompilationResult unitResult = unit.compilationResult; - CategorizedProblem[] unitProblems = unitResult.getProblems(); - int length = unitProblems == null ? 0 : unitProblems.length; - if (length > 0) { - CategorizedProblem[] categorizedProblems = new CategorizedProblem[length]; - System.arraycopy(unitProblems, 0, categorizedProblems, 0, length); - problems.put(IJavaScriptModelMarker.JAVASCRIPT_MODEL_PROBLEM_MARKER, categorizedProblems); - } - unitProblems = unitResult.getTasks(); - length = unitProblems == null ? 0 : unitProblems.length; - if (length > 0) { - CategorizedProblem[] categorizedProblems = new CategorizedProblem[length]; - System.arraycopy(unitProblems, 0, categorizedProblems, 0, length); - problems.put(IJavaScriptModelMarker.TASK_MARKER, categorizedProblems); + if (unit != null) { + CompilationResult unitResult = unit.compilationResult; + CategorizedProblem[] unitProblems = unitResult.getProblems(); + int length = unitProblems == null ? 0 : unitProblems.length; + if (length > 0) { + CategorizedProblem[] categorizedProblems = new CategorizedProblem[length]; + System.arraycopy(unitProblems, 0, categorizedProblems, 0, length); + problems.put(IJavaScriptModelMarker.JAVASCRIPT_MODEL_PROBLEM_MARKER, categorizedProblems); + } + unitProblems = unitResult.getTasks(); + length = unitProblems == null ? 0 : unitProblems.length; + if (length > 0) { + CategorizedProblem[] categorizedProblems = new CategorizedProblem[length]; + System.arraycopy(unitProblems, 0, categorizedProblems, 0, length); + problems.put(IJavaScriptModelMarker.TASK_MARKER, categorizedProblems); + } } if (NameLookup.VERBOSE) { System.out.println(Thread.currentThread() + " TIME SPENT in NameLoopkup#seekTypesInSourcePackage: " + environment.nameLookup.timeSpentInSeekTypesInSourcePackage + "ms"); //$NON-NLS-1$ //$NON-NLS-2$ |
