fixes for #483: Quantity subclasses copy() functions not all transferring values

This commit is contained in:
Grahame Grieve 2021-05-04 12:43:07 +10:00
parent 53ea22cae7
commit 898665f356
6 changed files with 681 additions and 669 deletions

View File

@ -115,6 +115,12 @@ public class Money extends Quantity implements ICompositeType {
public Money copy() {
Money dst = new Money();
copyValues(dst);
dst.value = value == null ? null : value.copy();
dst.comparator = comparator == null ? null : comparator.copy();
dst.unit = unit == null ? null : unit.copy();
dst.system = system == null ? null : system.copy();
dst.code = code == null ? null : code.copy();
return dst;
}

View File

@ -54,11 +54,6 @@ public class MoneyQuantity extends Quantity {
public void copyValues(MoneyQuantity dst) {
super.copyValues(dst);
dst.value = value == null ? null : value.copy();
dst.comparator = comparator == null ? null : comparator.copy();
dst.unit = unit == null ? null : unit.copy();
dst.system = system == null ? null : system.copy();
dst.code = code == null ? null : code.copy();
}
protected MoneyQuantity typedCopy() {

View File

@ -53,12 +53,7 @@ public class SimpleQuantity extends Quantity {
}
public void copyValues(SimpleQuantity dst) {
super.copyValues(dst);
dst.value = value == null ? null : value.copy();
dst.comparator = comparator == null ? null : comparator.copy();
dst.unit = unit == null ? null : unit.copy();
dst.system = system == null ? null : system.copy();
dst.code = code == null ? null : code.copy();
super.copyValues(dst);
}
protected SimpleQuantity typedCopy() {

View File

@ -53,11 +53,6 @@ public class MoneyQuantity extends Quantity {
public void copyValues(MoneyQuantity dst) {
super.copyValues(dst);
dst.value = value == null ? null : value.copy();
dst.comparator = comparator == null ? null : comparator.copy();
dst.unit = unit == null ? null : unit.copy();
dst.system = system == null ? null : system.copy();
dst.code = code == null ? null : code.copy();
}
protected MoneyQuantity typedCopy() {

View File

@ -53,11 +53,6 @@ public class SimpleQuantity extends Quantity {
public void copyValues(SimpleQuantity dst) {
super.copyValues(dst);
dst.value = value == null ? null : value.copy();
dst.comparator = comparator == null ? null : comparator.copy();
dst.unit = unit == null ? null : unit.copy();
dst.system = system == null ? null : system.copy();
dst.code = code == null ? null : code.copy();
}
protected SimpleQuantity typedCopy() {