-
Notifications
You must be signed in to change notification settings - Fork 38
Add EXCEPTION-FILE and EXCEPTION-LOCATION #218
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
Add EXCEPTION-FILE and EXCEPTION-LOCATION #218
Conversation
This reverts commit c238e73.
| data = String.valueOf(' '); | ||
| currField.memcpy(data.getBytes(), 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
下記のように変更してはどうでしょうか。
currField.getDataStorage().setByte(0, ' ');このように変更した場合、変数dataが未使用になるので、変数dataの宣言も削除してください
| || (CobolRuntimeException.getExceptionCode() & 0x0500) != 0x0500) { | ||
| field.setSize(2); | ||
| makeFieldEntry(field); | ||
| currField.memcpy("00", 2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
memcpyの内部で"00"からbyte[]への変換が発生します。
文字列からbyte[]への変換は性能への影響が大きい場合があるので、改善してください。
例えば、
//メンバ変数の宣言
private static final byte[] byteArray00 = "00".getBytes():
//データのコピー
currField.memcpy(byteArray00, 2);または、
CobolDataStorage storage = currField.getDataStorage();
storage.setByte(0, '0');
storage.setByte(1, '0');のように変更するのが良いと考えます。
|
レビューの内容に従ってコードを修正しました。 |
I added EXCEPTION-FILE and EXCEPTION-LOCATION in CobolIntrinsic.java.
And, New test cases were added to functions.at.