From de3ac0c95aa933b70b75cdf57cc465e9b9237fc1 Mon Sep 17 00:00:00 2001 From: Yutaro Sakamoto Date: Thu, 4 Dec 2025 06:12:03 +0000 Subject: [PATCH 1/2] change: remove NullPointerException --- cobj/codegen.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/cobj/codegen.c b/cobj/codegen.c index 8241bd70..799cd893 100644 --- a/cobj/codegen.c +++ b/cobj/codegen.c @@ -5265,8 +5265,6 @@ static void joutput_init_method(struct cb_program *prog) { } joutput_indent_level -= 2; - joutput_line("} catch(NullPointerException e) {"); - joutput_line(" System.out.println(\"Error - NullpointerException\");"); joutput_line("} catch(IndexOutOfBoundsException e) {"); joutput_line(" System.out.println(\"Error - IndexOutOfBoundsException\");"); joutput_line("}"); @@ -6088,7 +6086,6 @@ void codegen(struct cb_program *prog, const int nested, char **program_id_list, joutput_line("import jp.osscons.opensourcecobol.libcobj.file.*;"); joutput_line("import jp.osscons.opensourcecobol.libcobj.ui.*;"); joutput_line("import java.util.Optional;"); - joutput_line("import java.lang.NullPointerException;"); joutput_line("import java.lang.IndexOutOfBoundsException;"); joutput("\n"); From 7a2342fdb50c28f8333ee224f91456bfab67e87c Mon Sep 17 00:00:00 2001 From: Yutaro Sakamoto Date: Thu, 4 Dec 2025 06:32:29 +0000 Subject: [PATCH 2/2] remove: IndexOutOfBoundsException --- cobj/codegen.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/cobj/codegen.c b/cobj/codegen.c index 799cd893..22f8b412 100644 --- a/cobj/codegen.c +++ b/cobj/codegen.c @@ -5045,8 +5045,6 @@ static void joutput_init_method(struct cb_program *prog) { joutput_line("public void init() "); joutput_line("{"); joutput_indent_level += 2; - joutput_line("try {"); - joutput_indent_level += 2; if (prog->decimal_index_max) { joutput_line("/* Decimal structures */\n"); @@ -5264,10 +5262,6 @@ static void joutput_init_method(struct cb_program *prog) { CB_PREFIX_FIELD, CB_PREFIX_ATTR, index); } - joutput_indent_level -= 2; - joutput_line("} catch(IndexOutOfBoundsException e) {"); - joutput_line(" System.out.println(\"Error - IndexOutOfBoundsException\");"); - joutput_line("}"); joutput_indent_level -= 2; joutput_line("}\n"); @@ -6086,7 +6080,6 @@ void codegen(struct cb_program *prog, const int nested, char **program_id_list, joutput_line("import jp.osscons.opensourcecobol.libcobj.file.*;"); joutput_line("import jp.osscons.opensourcecobol.libcobj.ui.*;"); joutput_line("import java.util.Optional;"); - joutput_line("import java.lang.IndexOutOfBoundsException;"); joutput("\n"); /*if (!cb_flag_no_cobol_comment) {