Skip to content

Commit 2b8e428

Browse files
Remove unnecessary exception handling and related imports (#760)
* change: remove NullPointerException * remove: IndexOutOfBoundsException
1 parent 0b2ea7f commit 2b8e428

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

cobj/codegen.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5045,8 +5045,6 @@ static void joutput_init_method(struct cb_program *prog) {
50455045
joutput_line("public void init() ");
50465046
joutput_line("{");
50475047
joutput_indent_level += 2;
5048-
joutput_line("try {");
5049-
joutput_indent_level += 2;
50505048

50515049
if (prog->decimal_index_max) {
50525050
joutput_line("/* Decimal structures */\n");
@@ -5264,12 +5262,6 @@ static void joutput_init_method(struct cb_program *prog) {
52645262
CB_PREFIX_FIELD, CB_PREFIX_ATTR, index);
52655263
}
52665264

5267-
joutput_indent_level -= 2;
5268-
joutput_line("} catch(NullPointerException e) {");
5269-
joutput_line(" System.out.println(\"Error - NullpointerException\");");
5270-
joutput_line("} catch(IndexOutOfBoundsException e) {");
5271-
joutput_line(" System.out.println(\"Error - IndexOutOfBoundsException\");");
5272-
joutput_line("}");
52735265
joutput_indent_level -= 2;
52745266
joutput_line("}\n");
52755267

@@ -6088,8 +6080,6 @@ void codegen(struct cb_program *prog, const int nested, char **program_id_list,
60886080
joutput_line("import jp.osscons.opensourcecobol.libcobj.file.*;");
60896081
joutput_line("import jp.osscons.opensourcecobol.libcobj.ui.*;");
60906082
joutput_line("import java.util.Optional;");
6091-
joutput_line("import java.lang.NullPointerException;");
6092-
joutput_line("import java.lang.IndexOutOfBoundsException;");
60936083
joutput("\n");
60946084

60956085
/*if (!cb_flag_no_cobol_comment) {

0 commit comments

Comments
 (0)