I have solved this now. It appears that the auto generated code has changed slightly between Mendix 9 and Mendix 10. I looked back at the code from an old branch that I haven't updated to Mendix 10 yet and found this difference.
Mendix 9:
public class GetFileFromZip extends CustomJavaAction<IMendixObject>
{
private IMendixObject __ZipFile;
private system.proxies.FileDocument ZipFile;
private java.lang.String FilePathEndsWith;
private java.lang.Boolean CaseSensitive;
Same code but Mendix 10:
public class GetFileFromZip extends CustomJavaAction<IMendixObject>
{
/** @deprecated use ZipFile.getMendixObject() instead. */
@java.lang.Deprecated(forRemoval = true)
private final IMendixObject __ZipFile;
private final system.proxies.FileDocument ZipFile;
private final java.lang.String FilePathEndsWith;
private final java.lang.Boolean CaseSensitive;
Note the addition of "final". This means that later on in my code when I try the line:
FilePathEndsWith = FilePathEndsWith.toLowerCase();
I get an error as the variable is meant to be "final" and therefore cannot change.
I understand the error now and hope that this helps anyone struggling with similar errors. It can be tricky to spot that the auto generated parts of the code have changed.
Hi, you should use the Parameters on the java action general tab to try pass those classes/entities so that it will not be removed.