Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[rap-dev] BigDecimal constructor

Hi

Sometimes RAP developers use BigDecimal contructor with int argument. This
contructor is represented in java 1.5. There is another contructor:
BigDecimal(double value). And the compiler can resolve call of the
BigDecimal(int arg) as BigDecimal(double arg). Sometimes it can be helpful.
But this code fails if you will build RAP platform with java 1.5 (even if
you have configured compiler to use java 1.4 compiliance level) and execute
it using JRE 1.4.

I do not sure that it is a bug, but this may cause problems for RAP users
(if they will deside to rebuild RAP platform).

I found this problem where my app fails to start with such exception:

[2/1/10 14:24:51:145 YEKT] 0000003a WebApp        E   SRVE0026E: [Servlet
Error]-[equinoxbridgeservlet]: java.lang.NoSuchMethodError:
java.math.BigDecimal: method <init>(I)V not found
	at
org.eclipse.swt.internal.graphics.DefaultTextSizeStorage.setStoreSize(Unknow
n Source)
	at
org.eclipse.swt.internal.graphics.DefaultTextSizeStorage.<clinit>(Unknown
Source)
	at
org.eclipse.swt.internal.graphics.TextSizeStorageRegistry.obtain(Unknown
Source)

I found illegal using of BigDecimal constructor in serveral places:

org.eclipse.swt.internal.graphics.DefaultTextSizeStorage.setStoreSize(int)
org.eclipse.swt.internal.graphics.TextSizeProbeStore.createProbeResult(IProb
e, Point)
org.eclipse.swt.internal.graphics.TextSizeDetermination.internalExtent(Font,
String, int, int)

It is possible that there are several similar problems with other code.

Regards,
Igor



Back to the top