Skip to content

Conversation

@yutaro-sakamoto
Copy link
Contributor

This pull request simplifies the generated Java code by removing unnecessary exception handling and related imports from the init() method in the code generator. The changes focus on making the output Java code cleaner and easier to read.

Java code generation cleanup:

  • Removed the try-catch block for NullPointerException and IndexOutOfBoundsException from the generated init() method in cobj/codegen.c, eliminating redundant error handling code. [1] [2]
  • Removed the import statements for java.lang.NullPointerException and java.lang.IndexOutOfBoundsException from the generated Java files, as they are no longer needed.

@yutaro-sakamoto yutaro-sakamoto marked this pull request as ready for review December 4, 2025 07:45
Copilot AI review requested due to automatic review settings December 4, 2025 07:45
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR simplifies the Java code generator by removing unnecessary exception handling from the generated init() method. The try-catch blocks for NullPointerException and IndexOutOfBoundsException provided no actual error recovery or meaningful handling - they merely printed generic error messages. Removing this boilerplate makes the generated Java code cleaner and more maintainable.

  • Removed try-catch wrapper from the generated init() method's body
  • Removed unnecessary exception import statements from generated Java files
  • Fixed a spelling inconsistency ("NullpointerException" → proper capitalization) as a side effect of removal

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@yutaro-sakamoto yutaro-sakamoto merged commit 2b8e428 into opensourcecobol:develop Dec 5, 2025
295 of 296 checks passed
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