summaryrefslogtreecommitdiff
path: root/wizards/com/sun/star/wizards/common
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-06-27 12:58:07 +0200
committerMichael Stahl <mstahl@redhat.com>2012-06-29 22:02:59 +0200
commit3be987460db9938977c9ff7ed59b7e43b64f430e (patch)
tree83a1c99d0f0f9e189acf6418eba7749ae6500902 /wizards/com/sun/star/wizards/common
parentdab59ab4bcadb14bef9ad7d185d58610fda22012 (diff)
Java cleanup - remove unnecessary casts
Change-Id: I9fc995d9b3f971b9b8869cb3f21ddf69b4f90e08
Diffstat (limited to 'wizards/com/sun/star/wizards/common')
-rw-r--r--wizards/com/sun/star/wizards/common/Configuration.java4
-rw-r--r--wizards/com/sun/star/wizards/common/NumericalHelper.java46
2 files changed, 25 insertions, 25 deletions
diff --git a/wizards/com/sun/star/wizards/common/Configuration.java b/wizards/com/sun/star/wizards/common/Configuration.java
index 50df0f7197bf..1264873b80d3 100644
--- a/wizards/com/sun/star/wizards/common/Configuration.java
+++ b/wizards/com/sun/star/wizards/common/Configuration.java
@@ -68,7 +68,7 @@ public abstract class Configuration
Object o = getNode(name, parent);
if (AnyConverter.isVoid(o))
{
- return (float) 0;
+ return 0;
}
return AnyConverter.toFloat(o);
}
@@ -78,7 +78,7 @@ public abstract class Configuration
Object o = getNode(name, parent);
if (AnyConverter.isVoid(o))
{
- return (double) 0;
+ return 0;
}
return AnyConverter.toDouble(o);
}
diff --git a/wizards/com/sun/star/wizards/common/NumericalHelper.java b/wizards/com/sun/star/wizards/common/NumericalHelper.java
index cd8a410b0a4e..d5a198f65693 100644
--- a/wizards/com/sun/star/wizards/common/NumericalHelper.java
+++ b/wizards/com/sun/star/wizards/common/NumericalHelper.java
@@ -218,7 +218,7 @@ public class NumericalHelper
switch (aTypeObject.iType)
{
case BYTE_TYPE:
- retValue = (short) getByte(aTypeObject);
+ retValue = getByte(aTypeObject);
break;
case CHAR_TYPE:
retValue = (byte) getChar(aTypeObject);
@@ -501,13 +501,13 @@ public class NumericalHelper
switch (aTypeObject.iType)
{
case BYTE_TYPE:
- retValue = (int) getByte(aTypeObject);
+ retValue = getByte(aTypeObject);
break;
case CHAR_TYPE:
- retValue = (int) getChar(aTypeObject);
+ retValue = getChar(aTypeObject);
break;
case SHORT_TYPE:
- retValue = (int) getShort(aTypeObject);
+ retValue = getShort(aTypeObject);
break;
case INT_TYPE:
retValue = getInt(aTypeObject);
@@ -557,16 +557,16 @@ public class NumericalHelper
switch (aTypeObject.iType)
{
case BYTE_TYPE:
- retValue = (long) getByte(aTypeObject);
+ retValue = getByte(aTypeObject);
break;
case CHAR_TYPE:
- retValue = (long) getChar(aTypeObject);
+ retValue = getChar(aTypeObject);
break;
case SHORT_TYPE:
- retValue = (long) getShort(aTypeObject);
+ retValue = getShort(aTypeObject);
break;
case INT_TYPE:
- retValue = (long) getInt(aTypeObject);
+ retValue = getInt(aTypeObject);
break;
case LONG_TYPE:
retValue = getLong(aTypeObject);
@@ -613,19 +613,19 @@ public class NumericalHelper
switch (aTypeObject.iType)
{
case BYTE_TYPE:
- retValue = (float) getByte(aTypeObject);
+ retValue = getByte(aTypeObject);
break;
case CHAR_TYPE:
- retValue = (float) getChar(aTypeObject);
+ retValue = getChar(aTypeObject);
break;
case SHORT_TYPE:
- retValue = (float) getShort(aTypeObject);
+ retValue = getShort(aTypeObject);
break;
case INT_TYPE:
- retValue = (float) getInt(aTypeObject);
+ retValue = getInt(aTypeObject);
break;
case LONG_TYPE:
- retValue = (float) getLong(aTypeObject);
+ retValue = getLong(aTypeObject);
break;
case FLOAT_TYPE:
retValue = getFloat(aTypeObject);
@@ -669,22 +669,22 @@ public class NumericalHelper
switch (aTypeObject.iType)
{
case BYTE_TYPE:
- retValue = (double) getByte(aTypeObject);
+ retValue = getByte(aTypeObject);
break;
case CHAR_TYPE:
- retValue = (double) getChar(aTypeObject);
+ retValue = getChar(aTypeObject);
break;
case SHORT_TYPE:
- retValue = (double) getShort(aTypeObject);
+ retValue = getShort(aTypeObject);
break;
case INT_TYPE:
- retValue = (double) getInt(aTypeObject);
+ retValue = getInt(aTypeObject);
break;
case LONG_TYPE:
- retValue = (double) getLong(aTypeObject);
+ retValue = getLong(aTypeObject);
break;
case FLOAT_TYPE:
- retValue = (double) getFloat(aTypeObject);
+ retValue = getFloat(aTypeObject);
break;
case DOUBLE_TYPE:
retValue = getDouble(aTypeObject);
@@ -1557,7 +1557,7 @@ public class NumericalHelper
for (int i = number.length() - 1; i >= 0; i--)
{
StringBuffer romanDigit = new StringBuffer();
- int b = (int) number.charAt(i) - ASCII_CODE_0;
+ int b = number.charAt(i) - ASCII_CODE_0;
if (b == FOUR)
{ // special case IV
romanDigit.append(ROMAN_EQUIV[symbolIndex]);
@@ -1597,7 +1597,7 @@ public class NumericalHelper
public static boolean representsIntegerNumber(double _dblvalue)
{
- double dblsecvalue = (double) ((int) _dblvalue);
+ double dblsecvalue = ((int) _dblvalue);
return Double.compare(_dblvalue, dblsecvalue) == 0;
}
@@ -1608,7 +1608,7 @@ public class NumericalHelper
public static double roundDouble(double _dblvalue, int _ndecimals)
{
- double dblfactor = java.lang.Math.pow(10.0, (double) _ndecimals);
- return ((double) ((int) (_dblvalue * dblfactor))) / dblfactor;
+ double dblfactor = java.lang.Math.pow(10.0, _ndecimals);
+ return ((int) (_dblvalue * dblfactor)) / dblfactor;
}
}