You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@vxquery.apache.org by pr...@apache.org on 2012/08/01 20:04:20 UTC
svn commit: r1368146 -
/incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/datamodel/accessors/atomic/XSDecimalPointable.java
Author: prestonc
Date: Wed Aug 1 18:04:19 2012
New Revision: 1368146
URL: http://svn.apache.org/viewvc?rev=1368146&view=rev
Log:
Found a few bugs with the way information was referenced inside the byte array.
Modified:
incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/datamodel/accessors/atomic/XSDecimalPointable.java
Modified: incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/datamodel/accessors/atomic/XSDecimalPointable.java
URL: http://svn.apache.org/viewvc/incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/datamodel/accessors/atomic/XSDecimalPointable.java?rev=1368146&r1=1368145&r2=1368146&view=diff
==============================================================================
--- incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/datamodel/accessors/atomic/XSDecimalPointable.java (original)
+++ incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/datamodel/accessors/atomic/XSDecimalPointable.java Wed Aug 1 18:04:19 2012
@@ -113,7 +113,7 @@ public class XSDecimalPointable extends
long value = getDecimalValue(bytes, start);
// Normalize the value and take off trailing zeros.
while (value != 0 && value % 10 == 0) {
- value -= 10;
+ value /= 10;
--decimalPlace;
}
BytePointable.setByte(bytes, start + DECIMAL_PLACE_OFFSET, decimalPlace);
@@ -121,7 +121,7 @@ public class XSDecimalPointable extends
}
public byte getDecimalPlace() {
- return BytePointable.getByte(bytes, start + DECIMAL_PLACE_OFFSET);
+ return BytePointable.getByte(bytes, start);
}
public static byte getDecimalPlace(byte[] bytes, int start) {
@@ -129,7 +129,7 @@ public class XSDecimalPointable extends
}
public long getDecimalValue() {
- return LongPointable.getLong(bytes, start + VALUE_OFFSET);
+ return getDecimalValue(bytes, start);
}
public static long getDecimalValue(byte[] bytes, int start) {