From d7be7ef36c45966bdded95e13a133862de72e778 Mon Sep 17 00:00:00 2001 From: dyrpsf Date: Tue, 13 Jan 2026 07:18:20 +0530 Subject: [PATCH] Copy label and associatedSpecies in GeneProduct copy constructor --- .../fbc/src/org/sbml/jsbml/ext/fbc/GeneProduct.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/extensions/fbc/src/org/sbml/jsbml/ext/fbc/GeneProduct.java b/extensions/fbc/src/org/sbml/jsbml/ext/fbc/GeneProduct.java index 534d2de4b..47871c706 100644 --- a/extensions/fbc/src/org/sbml/jsbml/ext/fbc/GeneProduct.java +++ b/extensions/fbc/src/org/sbml/jsbml/ext/fbc/GeneProduct.java @@ -112,12 +112,22 @@ public GeneProduct() { } /** - * Creates a new {@link GeneProduct} instance. + * Creates a new {@link GeneProduct} instance by copying all fields. * * @param nsb the instance to clone */ public GeneProduct(GeneProduct nsb) { super(nsb); + + // copy GeneProduct-specific fields + if (nsb.isSetLabel()) { + // use the setter to keep property-change semantics consistent + setLabel(nsb.getLabel()); + } + + if (nsb.isSetAssociatedSpecies()) { + setAssociatedSpecies(nsb.getAssociatedSpecies()); + } } /**