I have two Java classes located in different jars deployed on IBM Websphere App Server 7.0 (it is a bit old but I forced to use it on a project).
The first class has a static final field:
public class TFFVERSION {
public static final String ACTUAL_VERSION = "8.3";
}
The second uses the field in a non-static method:
xslTemplate = String.format("%s_v%s", xslTemplate, TFFVERSION.ACTUAL_VERSION);
What I am trying is understand is why the compiler put the copy of constant 8.3
in String.format
call? This makes impossible to just change the first class without recompiling and redeploying the second.
Is this a kind of optimization or a Bug in IBM Java V9?
Here I've opened class files in a text editor showing the problem (image is clickable for better resolution):
Java decompilers show the correct static field invocation though. There are no other 8.3
constants in the second class.