-
Notifications
You must be signed in to change notification settings - Fork 38
FUNCTION SUBSTITUTE and FUNCTION SUBSTITUTE-CASE added #246
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
FUNCTION SUBSTITUTE and FUNCTION SUBSTITUTE-CASE added #246
Conversation
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.
一旦レビューは以上とします。修正を完了したらコメントをください。アルゴリズムの正確性を検証します。
| } | ||
| } | ||
|
|
||
| byte[] p1 = fields[0].getDataStorage().getByteArray(); |
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.
CobolDataStorageクラスのgetByteArray()メソッドは使用しないでください。このPRでついでに、このメソッドをCobolDataStorageから消してもらえますか。
集団項目や部分参照のことを考慮すると、このメソッドの使用は(よほど注意深くコーディングしない限り)不具合を引き起こします。
ただし、CobolDataStorageクラスのgetByteArray(int, int)は、(性能面を十分に検討した上で)使用して良いです。
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.
@kio-watanabe
すみません、この指摘は誤りでした。修正は不要です。
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.
@kio-watanabe
すみません、やはりgetByteArray()は使用しないように修正してください
| int varsize = p1.length; | ||
| int pi1 = 0; | ||
| int calcsize = 0; | ||
| int found = 0; |
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.
このfoundの型はbooleanに変更することを推奨します。
| AbstractCobolField field = CobolFieldFactory.makeCobolField(0, (CobolDataStorage) null, attr); | ||
| field.setSize(calcsize); |
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.
単に
AbstractCobolField field = CobolFieldFactory.makeCobolField(calcsize, (CobolDataStorage) null, attr);と変更するのが良いでしょう
FUNCTION SUBSTITUTE and FUNCTION SUBSTITUTE-CASE are added.
Four failing tests now pass.