Skip to content

Commit

Permalink
fix: initPhysicalProperties if cloning a propertyHandler
Browse files Browse the repository at this point in the history
  • Loading branch information
asmfstatoil committed Oct 27, 2024
1 parent b3e1606 commit a698dd8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/java/neqsim/thermo/phase/Phase.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,13 @@ public Phase clone() {
}

clonedPhase.componentArray = this.componentArray.clone();
for (int i = 0; i < numberOfComponents; i++) {
for (int i = 0; i < this.numberOfComponents; i++) {
clonedPhase.componentArray[i] = this.componentArray[i].clone();
}
// System.out.println("cloned length: " + componentArray.length);
if (physicalPropertyHandler != null) {
if (this.physicalPropertyHandler != null) {
clonedPhase.physicalPropertyHandler = this.physicalPropertyHandler.clone();
clonedPhase.initPhysicalProperties();
}

return clonedPhase;
Expand Down

0 comments on commit a698dd8

Please sign in to comment.