I want to modify parameter value passed to a particular method of a java class. Here is the java file:
package config;
public class ABC extends LineAvailabilityNew
{
public void doMessageDataOverrides() throws MessageHandlerExcection
{
super.doMessageDataOverrides();
setWorkingLineQty("21");
setStoppedLineQty("10");
}
}
Now I want to modify parameter value for setWorkingLineQty("21") i.e 21 to say 35. The value is to be modified from another java class.
As of now, my other java class is achieving this by performing below activity:
Reading the parameter value using javaparser.
Get the file content
Create a copy of file content and using normal String replace function, replace setWorkingLineQty("21") to setWorkingLineQty("35")
Replace the file using File class
Note: I cannot make any changes to ABC class. Would appreciate answers through any other way.