Hello,
Instant generator adds a sequence number to the unnamed attributes. The sequence number also appears in getters and setters. How do I get rid of this sequence number?
I have set the unnamed attribute to “${classname}” in the options for Instant Generator.
Here is a sample of the generated code…
public class RequestContext {
private LoggingContext loggingContext921;
public void setLoggingContext921(LoggingContext loggingContext921) {
this.loggingContext921 = loggingContext921;
}
public LoggingContext getLoggingContext921() {
return this.loggingContext921;
}
}
In the above example, it added sequence number 921 to the aggregated unnamed attribute. I would prefer to name it just “loggingContext”.
Actually having random number appended to the attribute name is to avoid multiple unnamed attributes having the same name. Your case won’t have problem because there is only one attribute. If there are more than one, you can’t have two attributes both named as loggingContext.
I do understand the reason behind appending a sequence number. But I do not need it and wouldn’t prefer to see the sequence numbers through out my code that use these getters and setters.
Description of fix:
Random number will be added to the attribute name only if needed. If the same attribute does not exist in class, it won’t add random number to the attribute name.
To install the patch:
Shutdown any running instances of VP
Replace $vp-suite-install-dir/lib/vpplatform.jar with the downloaded jar file
Run $vp-suite-install-dir/bin/VP Suite.exe to install the patch
Restart the application
Note:
If you are going to download with Internet Explorer, you may need to rename the file from .zip to .jar manually
Please do not run Product Update after applying the patch. Otherwise the update will replace the patch with the previous version (I will inform you to run the update when the next release is ready)