You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Default no-args constructor for class that have ancestors calls constructor with arguments and passes nulls.
For example if we have two classes Foo and Bar, that extends it and have default value defined for an element of Foo:
publicclassFoo {
privatefinalStringparam1;
publicFoo(){
param1="Default1";
}
publicFoo(Stringparam1){
this.param1 = param1;
}
//..
}
publicfinalclassBarextendsFoo {
privatefinalStringparam2;
publicBar(){
super(null);// Foo have default value for param1, but it will not be setthis.param2="Default2";
}
//..
}
If we create an instance of Bar class using no-args constructor (for example, if we parse some xml without param1 specified), we will have an object with param1==null, and not "Default1"
The text was updated successfully, but these errors were encountered:
from generateStandardConstructor(...) method completely
or adding a check of the constructorDefaults flag, in order not to create such a call in resulting class
Default no-args constructor for class that have ancestors calls constructor with arguments and passes nulls.
For example if we have two classes Foo and Bar, that extends it and have default value defined for an element of Foo:
If we create an instance of Bar class using no-args constructor (for example, if we parse some xml without param1 specified), we will have an object with param1==null, and not "Default1"
The text was updated successfully, but these errors were encountered: