Skip to content

Commit

Permalink
fix NPE for ReferenceAnalyzer.fIndexedDetectors null #1289
Browse files Browse the repository at this point in the history
  • Loading branch information
EcljpseB0T authored and jukzi committed Jun 6, 2024
1 parent 2194441 commit 8e177ee
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion apitools/org.eclipse.pde.api.tools/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.pde.api.tools;singleton:=true
Bundle-Version: 1.3.400.qualifier
Bundle-Version: 1.3.500.qualifier
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.29.0,4.0.0)",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ public void visit(String packageName, IApiTypeRoot classFile) {
* are interested in. Provides a fast way to hand references off to
* interested problem detectors.
*/
IApiProblemDetector[][] fIndexedDetectors;
private IApiProblemDetector[][] fIndexedDetectors;

/**
* Indexes the problem detectors by the reference kinds they are interested
Expand Down Expand Up @@ -230,10 +230,14 @@ void extractReferences(IApiTypeContainer scope, IProgressMonitor monitor) throws
*/
public IApiProblem[] analyze(IApiComponent component, IApiTypeContainer scope, IProgressMonitor monitor) throws CoreException {
SubMonitor localMonitor = SubMonitor.convert(monitor, 4);
// build problem detectors
IApiProblemDetector[] detectors = buildProblemDetectors(component, ProblemDetectorBuilder.K_ALL, localMonitor.split(1));
// analyze
try {
// build problem detectors
IApiProblemDetector[] detectors = buildProblemDetectors(component, ProblemDetectorBuilder.K_ALL,
localMonitor.split(1));
if (detectors.length == 0) {
return EMPTY_RESULT;
}
// analyze
// 1. extract references
localMonitor.subTask(BuilderMessages.ReferenceAnalyzer_analyzing_api_checking_use);
extractReferences(scope, localMonitor.split(1));
Expand Down

0 comments on commit 8e177ee

Please sign in to comment.