[Fix] Qodana fix: Method 'fillClone()' overloads a compatible method of a superclass, when overriding might have been intended

This commit is contained in:
Robert von Burg 2023-05-10 19:53:49 +02:00
parent 0eaf3b20fb
commit 5ce785aab0
Signed by: eitch
GPG Key ID: 75DB9C85C74331F7
4 changed files with 27 additions and 17 deletions

View File

@ -279,13 +279,15 @@ public abstract class GroupedParameterizedElement extends AbstractStrolchElement
* @param clone
* the clone to fill
*/
protected void fillClone(GroupedParameterizedElement clone) {
@Override
protected void fillClone(AbstractStrolchElement clone) {
super.fillClone(clone);
clone.type = this.type;
GroupedParameterizedElement cloneGpe = (GroupedParameterizedElement) clone;
cloneGpe.type = this.type;
if (this.parameterBagMap != null) {
for (ParameterBag bag : this.parameterBagMap.values())
clone.addParameterBag(bag.getClone());
cloneGpe.addParameterBag(bag.getClone());
}
}

View File

@ -1193,12 +1193,14 @@ public abstract class ParameterizedElement extends AbstractStrolchElement {
return lb.build();
}
protected void fillClone(ParameterizedElement clone) {
@Override
protected void fillClone(AbstractStrolchElement clone) {
super.fillClone(clone);
clone.type = this.type;
ParameterizedElement clonePe = (ParameterizedElement) clone;
clonePe.type = this.type;
if (this.parameterMap != null) {
for (Parameter<?> param : this.parameterMap.values()) {
clone.addParameter(param.getClone());
clonePe.addParameter(param.getClone());
}
}
}

View File

@ -200,13 +200,15 @@ public abstract class AbstractParameter<T> extends AbstractStrolchElement implem
* @param clone
* the clone to fill
*/
protected void fillClone(AbstractParameter<?> clone) {
@Override
protected void fillClone(AbstractStrolchElement clone) {
super.fillClone(clone);
clone.hidden = this.hidden;
clone.interpretation = this.interpretation;
clone.uom = this.uom;
clone.index = this.index;
AbstractParameter<?> cloneP = (AbstractParameter<?>) clone;
cloneP.hidden = this.hidden;
cloneP.interpretation = this.interpretation;
cloneP.uom = this.uom;
cloneP.index = this.index;
}
@Override

View File

@ -196,13 +196,17 @@ public abstract class AbstractStrolchTimedState<T extends IValue> extends Abstra
return lb.build();
}
protected void fillClone(AbstractStrolchTimedState<T> clone) {
@Override
protected void fillClone(AbstractStrolchElement clone) {
super.fillClone(clone);
clone.hidden = this.hidden;
clone.index = this.index;
clone.interpretation = this.interpretation;
clone.uom = this.uom;
clone.state = this.state.getCopy();
@SuppressWarnings("unchecked")
AbstractStrolchTimedState<T> cloneT = (AbstractStrolchTimedState<T>) clone;
cloneT.hidden = this.hidden;
cloneT.index = this.index;
cloneT.interpretation = this.interpretation;
cloneT.uom = this.uom;
cloneT.state = this.state.getCopy();
}
@Override