Maybe the question is also “do you always want multiple copies”.
What if my constructor would look like this:
public MyClass(int optimizationLevel) {…}
so an int instead of a boolean. What if there are 50 different values of the int which would cause some code to be omitted or executed differently. I dunno how great it would be to have 50 slightly different copies of the same class in memory… (especially in my particular case where these kind of classes tend to be quite big). I could imagine that with some applications, the JVM’s footprint could go through the roof if the JVM gets too eager to create multiple versions of the same class.
For now i think I’ll look into how I could get multiple copies through a custom ClassLoader