Skip to content

fix: Fix NPE and add a message #2111

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

Merged

Conversation

Nurkambay
Copy link
Contributor

Checklist:

  • Each of my commits contains one meaningful change
  • I have performed rebase of my branch on top of the development
  • I have performed a self-review of my own code
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have checked my code and corrected any misspellings

.map(CobolDocumentModel::getAnalysisResult)
.map(AnalysisResult::getRootNode).orElseGet(() -> {
if (isCopybook(uri, text)) {
communications.notifyGeneralMessage(MessageType.Info, "Cannot retrieve outline tree because file was treated as a copybook");
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zeibura please check this message
It will appear as a VSCode info box when a user tries to generate a graph from CCF for the copybook. Sometimes some COBOL programs are treated as a copybook and the user has the ability to try to build a graph and this message is to inform the user that it is not possible.

@@ -30,7 +30,7 @@ public class CopybookIdentificationServiceBasedOnContent implements CopybookIden
private final List<Pattern> patterns = new LinkedList<>();
public CopybookIdentificationServiceBasedOnContent() {
patterns.add(Pattern.compile(
"(?i)^(?<sequence>.{0,6})(?<indicator>.?)\\s(?<!\\n)*(PROGRAM-ID)\\s*\\.?\\s*(?<programName>.{1,30})\\s*\\.?$",
"(?i)^(?<sequence>.{0,6})(?<indicator>.?)\\h*(PROGRAM-ID)\\s*\\.?\\s*(?<programName>.{1,30})\\s*\\.?$",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simplification. Use \h instead of s(?<!\\n)

@Nurkambay Nurkambay merged commit 21b9b09 into eclipse-che4z:development Oct 24, 2023
@Nurkambay Nurkambay deleted the add-message-for-copybook branch October 24, 2023 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants