From 71055614f4647da80118b9a9de5ffc0720dec6f8 Mon Sep 17 00:00:00 2001 From: Willem Date: Fri, 14 Oct 2022 01:36:17 +0200 Subject: [PATCH] Removed not used bigint value --- .../unitxc/converter/UnitXConverter.java | 5 ----- .../unitxc/converter/UnitXConverterEngine.java | 13 +++++-------- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/gdxapp4d-unitxc/src/main/java/net/forwardfire/unitxc/converter/UnitXConverter.java b/gdxapp4d-unitxc/src/main/java/net/forwardfire/unitxc/converter/UnitXConverter.java index e2eecd67..e9f21eca 100644 --- a/gdxapp4d-unitxc/src/main/java/net/forwardfire/unitxc/converter/UnitXConverter.java +++ b/gdxapp4d-unitxc/src/main/java/net/forwardfire/unitxc/converter/UnitXConverter.java @@ -23,7 +23,6 @@ package net.forwardfire.unitxc.converter; -import java.math.BigDecimal; import java.util.Collections; import java.util.Map; @@ -74,10 +73,6 @@ public class UnitXConverter { } public UnitXConverterResult convertStepped(double value, UnitXCType fromType, UnitXCType toType, Map parameters) { - return convertStepped(BigDecimal.valueOf(value), fromType, toType, parameters); - } - - public UnitXConverterResult convertStepped(BigDecimal value, UnitXCType fromType, UnitXCType toType, Map parameters) { return convertEngine.convertStepped(value, fromType, toType, parameters); } } diff --git a/gdxapp4d-unitxc/src/main/java/net/forwardfire/unitxc/converter/UnitXConverterEngine.java b/gdxapp4d-unitxc/src/main/java/net/forwardfire/unitxc/converter/UnitXConverterEngine.java index 7697887a..33526fb8 100644 --- a/gdxapp4d-unitxc/src/main/java/net/forwardfire/unitxc/converter/UnitXConverterEngine.java +++ b/gdxapp4d-unitxc/src/main/java/net/forwardfire/unitxc/converter/UnitXConverterEngine.java @@ -23,7 +23,6 @@ package net.forwardfire.unitxc.converter; -import java.math.BigDecimal; import java.math.MathContext; import java.util.ArrayList; import java.util.HashMap; @@ -31,8 +30,6 @@ import java.util.List; import java.util.Map; import org.apache.commons.lang3.Validate; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import net.forwardfire.unitxc.UnitXCManager; import net.forwardfire.unitxc.model.DefaultUnitXConverterResult; @@ -58,7 +55,7 @@ import net.forwardfire.unitxc.model.step.value.UnitXConverterStepValueReferenceD */ public final class UnitXConverterEngine { - private final static Logger LOG = LoggerFactory.getLogger(UnitXConverterEngine.class); + //private final static Logger LOG = LoggerFactory.getLogger(UnitXConverterEngine.class); private final UnitXCManager manager; private final UnitXConverterStep roundingStep; @@ -67,8 +64,8 @@ public final class UnitXConverterEngine { this.roundingStep = new UnitXCConverterStepAutoRounding(UnitXConverterStepContext.createStepValue(),UnitXConverterStepContext.createStepValue()); } - public UnitXConverterResult convertStepped(BigDecimal valueConvert2,UnitXCType fromType,UnitXCType toType, Map parameters) { - Validate.notNull(valueConvert2,"Can't convert null to number"); + public UnitXConverterResult convertStepped(double valueConvert,UnitXCType fromType,UnitXCType toType, Map parameters) { + Validate.notNull(valueConvert,"Can't convert null to number"); Validate.notNull(fromType,"Can't convert from null unit type"); Validate.notNull(toType,"Can't convert to null unit type"); @@ -80,7 +77,7 @@ public final class UnitXConverterEngine { toType = Validate.notNull(manager.getUnitType(toType.getAliasOfType()),"Coultn't resolve alias id: "+toType.getAliasOfType()+" for: "+toType.getId()); } - double valueConvert = valueConvert2.doubleValue(); + //double valueConvert = valueConvert2.doubleValue(); long startTime = System.currentTimeMillis(); MathContext mathContext = MathContext.DECIMAL128; UnitXConverterStepContextImpl ctx = new UnitXConverterStepContextImpl(mathContext,valueConvert); @@ -114,7 +111,7 @@ public final class UnitXConverterEngine { double paraValue = convPara.getValue(); if (!paraToBase) { System.out.println("--- cont para");; - UnitXConverterResult res = convertStepped(BigDecimal.valueOf(paraValue), convPara.getValueType(), manager.getUnitType(convPara.getValueType().getUnitGroup().getBaseTypeId()), parameters); // FIXME rm parameters ? + UnitXConverterResult res = convertStepped(paraValue, convPara.getValueType(), manager.getUnitType(convPara.getValueType().getUnitGroup().getBaseTypeId()), parameters); // FIXME rm parameters ? paraValue = res.getResultValue(); //ctx.resultSteps.addAll(res.getResultSteps()); }