Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix NPE #2311

Merged
merged 1 commit into from
May 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
import org.eclipse.lsp.cobol.common.AnalysisConfig;
import org.eclipse.lsp.cobol.common.benchmark.BenchmarkSession;
import org.eclipse.lsp.cobol.common.benchmark.BenchmarkSessionProvider;
import org.eclipse.lsp.cobol.common.dialects.CobolLanguageId;
import org.eclipse.lsp.cobol.common.error.SyntaxError;
import org.eclipse.lsp.cobol.common.mapping.ExtendedDocument;
import org.eclipse.lsp.cobol.common.model.tree.Node;
import org.eclipse.lsp.cobol.core.semantics.CopybooksRepository;
import org.eclipse.lsp.cobol.common.dialects.CobolLanguageId;

/**
* Contains related to analysis state
Expand All @@ -43,7 +43,7 @@ public class AnalysisContext implements BenchmarkSessionProvider {
private final String text;
private final CobolLanguageId languageId;

private @Setter List<Node> dialectNodes;
private @Setter List<Node> dialectNodes = new ArrayList<>();
private @Setter CopybooksRepository copybooksRepository;

public AnalysisContext(ExtendedDocument extendedDocument,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ class HpCopybookProcessingStage implements Stage<AnalysisContext, DialectOutcome
@Override
public StageResult<DialectOutcome> run(AnalysisContext context, StageResult<Void> prevStageResult) {
List<SyntaxError> errors = new LinkedList<>();

List<CopybookDescriptor> cbs = CopybookParser.parseAndCleanup(context.getExtendedDocument());
cbs.forEach(
cb -> {
Expand Down
Loading