COBCH2330 A primitive or immutable type passed BY REFERENCE is read-only in Java

A COBOL item that maps to a primitive or immutable Java type has been passed BY REFERENCE within a CALL statement.

The BY REFERENCE passing method is not permitted for Java primitive and immutable types as their values cannot be changed within the Java program; you must change the CALL statement.

01 x pic x(10)  *> maps to a Java String
...
call "java.Demo2.depart2" using BY REFERENCE x.  *> cannot be passed BY REFERENCE
...