Skip to content

Commit

Permalink
refact: compare input case insensitive (#668)
Browse files Browse the repository at this point in the history
  • Loading branch information
asmfstatoil authored May 9, 2023
1 parent 834ffe7 commit 45e1260
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -286,11 +286,11 @@ public void init(PhaseInterface phase) {
/** {@inheritDoc} */
@Override
public void init(PhaseInterface phase, String type) {
if (type.equals("density")) {
if (type.equalsIgnoreCase("density")) {
density = densityCalc.calcDensity();
} else if (type.equals("viscosity")) {
} else if (type.equalsIgnoreCase("viscosity")) {
viscosity = viscosityCalc.calcViscosity();
} else if (type.equals("conductivity")) {
} else if (type.equalsIgnoreCase("conductivity")) {
conductivity = conductivityCalc.calcConductivity();
} else {
init(phase);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ public double getMeasuredValue(String measurement) {
return tempFluid.getPhase("gas").getCorrectedVolume()
/ tempFluid.getPhase("oil").getCorrectedVolume();
} else {
logger.warn("Measurement type " + measurement + " is not found");
return 0.0;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,9 @@ public double getMeasuredValue(String measurement) {

if (measurement.equals("gas export rate")) {
return gasExportFlow;
}
if (measurement.equals("oil export rate")) {
} else if (measurement.equals("oil export rate")) {
return oilExportFlow;
}
if (measurement.equals("total export rate")) {
} else if (measurement.equals("total export rate")) {
return wellStream.getFluid().getFlowRate("kg/hr");
}
return 0.0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,11 @@ public GasScrubberDesignStandard(String name, MechanicalDesign equipmentInn) {
String specName = dataSet.getString("SPECIFICATION");
if (specName.equals("GasLoadFactor")) {
gasLoadFactor = Double.parseDouble(dataSet.getString("MAXVALUE"));
}
if (specName.equals("FlowDesignFactor")) {
} else if (specName.equals("FlowDesignFactor")) {
designFactorVolumeFlow = Double.parseDouble(dataSet.getString("MAXVALUE"));
}
if (specName.equals("LengthGasInetToHHLL")) {
} else if (specName.equals("LengthGasInetToHHLL")) {
designFactorVolumeFlow = Double.parseDouble(dataSet.getString("MINVALUE"));
}
if (specName.equals("LengthMeshPadToDemistingCyclone")) {
} else if (specName.equals("LengthMeshPadToDemistingCyclone")) {
designFactorVolumeFlow = Double.parseDouble(dataSet.getString("MINVALUE"));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,6 @@ public double calcWallThickness() {
+ equipment.getCorrosionAllowanse();
}

return wallT / 1000.0; // return wall thcikness in meter
return wallT / 1000.0; // return wall thickness in meter
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -665,15 +665,15 @@ public ArrayList<SeparatorSection> getSeparatorSections() {
* @param type a {@link java.lang.String} object
*/
public void addSeparatorSection(String name, String type) {
if (type.equals("vane")) {
if (type.equalsIgnoreCase("vane")) {
separatorSection.add(new SeparatorSection(name, type, this));
} else if (type.equals("meshpad")) {
} else if (type.equalsIgnoreCase("meshpad")) {
separatorSection.add(new MeshSection(name, type, this));
} else if (type.equals("manway")) {
} else if (type.equalsIgnoreCase("manway")) {
separatorSection.add(new ManwaySection(name, type, this));
} else if (type.equals("valve")) {
} else if (type.equalsIgnoreCase("valve")) {
separatorSection.add(new ValveSection(name, type, this));
} else if (type.equals("nozzle")) {
} else if (type.equalsIgnoreCase("nozzle")) {
separatorSection.add(new NozzleSection(name, type, this));
} else {
separatorSection.add(new SeparatorSection(name, type, this));
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/neqsim/thermo/system/SystemThermo.java
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ public void addSolidComplexPhase(String type) {
setMultiPhaseCheck(true);
}
addHydratePhase();
if (type.equals("wax")) {
if (type.equalsIgnoreCase("wax")) {
phaseArray[5] = new PhaseWax();
} else {
phaseArray[5] = new PhaseSolidComplex();
Expand Down Expand Up @@ -4174,15 +4174,15 @@ public void readFluid(String fluidName) {
while (dataSet.next()) {
String componentType = dataSet.getString("ComponentType");

if (componentType.equals("normal")) {
if (componentType.equalsIgnoreCase("normal")) {
addComponent(dataSet.getString("ComponentName"),
Double.parseDouble(dataSet.getString("Rate")));
} else if (componentType.equals("TBP")) {
} else if (componentType.equalsIgnoreCase("TBP")) {
addTBPfraction(dataSet.getString("ComponentName"),
Double.parseDouble(dataSet.getString("Rate")),
Double.parseDouble(dataSet.getString("MolarMass")) / 1000.0,
Double.parseDouble(dataSet.getString("Density")));
} else if (componentType.equals("Plus")) {
} else if (componentType.equalsIgnoreCase("plus")) {
addPlusFraction(dataSet.getString("ComponentName"),
Double.parseDouble(dataSet.getString("Rate")),
Double.parseDouble(dataSet.getString("MolarMass")) / 1000.0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public static double getFurstParamMDEA(int i) {
* @param type a {@link java.lang.String} object
*/
public static void setFurstParams(String type) {
if (type.equals("electrolyteCPA")) {
if (type.equalsIgnoreCase("electrolyteCPA")) {
furstParams = furstParamsCPA;
}
}
Expand Down

0 comments on commit 45e1260

Please sign in to comment.