String Index out of Bounds Exception
An error occurred while compiling the Cobol program with the Jopaz compiler:
java.lang.StringIndexOutOfBoundsException caught! (null)
---------------------------------------------------------
java.lang.StringIndexOutOfBoundsException caught! (null)
in program HELWLD, paragraph _012_34_56_78_TEST_ALPNUM (/opt/softwareag/jpz/jpz-compiler/sources/HELWLD.cbl:12)
(Top of stack)
(java.lang.String.<init>(String.java:530))
(com.jopaz.types.CobolVar.basicToString(CobolVar.java:246))
(com.jopaz.types.CobolVar.toString(CobolVar.java:253))
(com.jopaz.types.PicX.isNumeric(PicX.java:267))
with following Jopaz configuration:
JOPAZ JPZ-x.x.x.x_000
jopaz.compiler.options=-b -coe -cax -dznt -cv -cva -dcii -di -dv=0 -lf -lo=/opt/softwareag/jpz/jpz-compiler/list
-jc -od=/opt/softwareag/jpz/jpz-compiler/output -pt2 -sp=/opt/softwareag/jpz/jpz-compiler/cpy -verobse
[Jopaz] jopaz.runtime.version=JPZ-x.x.x.x_000
where JPZ-x.x.x.x_000 is your Jopaz release version,
1. Enter the following code:
jopaz.array_check=1 // Array boundaries are checked at runtime=more details
//in case of "out of bounds" errors .
jopaz.display_message =1 //All messages are sent to SYSOUT .
2. If the following error occurs during the execution with the previously mentioned options, try to use the option -m1 in addition. For this, the comments on the -m1 definition must be observed:
Index out of bound CHECK ARRAY : detected index out of bound W- ASBORIND (0) [19]
-m1 // -Could prevent the IndexOutOfBoundsException.
// -The -m1 put all of WORKING-STORAGE into a contiguous block of memory.
// -It allow to run correctly in case of memory violation like for example to use
// index of occurs outside min or max limits.
// -In this case, occurs could "violate" memory programmatically accessing
// upper or lower working storage.
// -Using the -m1 you have to comment out or remove the jopaz.array_check =1
3. If the StringIndexOutOfBoundsException still exists when using the compiler option -m1, add the following option to your configuration:
jopaz.exception.java =1 // True = Internal java methods are traced in exception messages
// False = COBOL paragraph names are traced in exception messages
// Default value is false