Using Arrays in return types

21 views
Skip to first unread message

Pieter De Graef

unread,
Nov 15, 2011, 7:04:45 AM11/15/11
to gwtexporter
Hi,

I have stumbled upon a new problem in my attempts to export an
existing GWT library.
I have created an ExportOverlay of a Coordinate class, and have also
an ExportOverlay of a Geometry class. The problem lies in the
"getCoordinates" methods that should return an array of coordinates,
but runs into a ClassCastException. (cannot cast
org.geomajas.geometry.Coordinate to Expotable).

The org.geomajas.geometry.Coordinate is the original Coordinate class
for which I have created an overlay. The reason why I have used an
ExportOverlay is because I cannot touch the original Coordinate class,
so how can I circumvent the ClassCastException?


@Export("Coordinate")
@ExportPackage("org.geomajas.jsapi.spatial")
public class JsCoordinate implements
ExportOverlay<org.geomajas.geometry.Coordinate> {
......
}


@Export("Geometry")
@ExportPackage("org.geomajas.jsapi.spatial")
public class JsGeometry implements
ExportOverlay<org.geomajas.geometry.Geometry> {

// This method runs into ClassCastExceptions...
public org.geomajas.geometry.Coordinate[] getCoordinates() {
return null;
}
}

Manuel Carrasco Moñino

unread,
Nov 15, 2011, 5:23:33 PM11/15/11
to gwtex...@googlegroups.com
It may be a bug in array wrappers, could you open an issue with detailed information and code example?

Thanks
- Manolo

Pieter De Graef

unread,
Nov 16, 2011, 3:23:09 AM11/16/11
to gwtexporter
The issue has been logged. I have also added the classes that actually
run into this problem.

On Nov 15, 11:23 pm, Manuel Carrasco Moñino <man...@apache.org> wrote:
> It may be a bug in array wrappers, could you open an issue with detailed
> information and code example?
>
> Thanks
> - Manolo
>
Reply all
Reply to author
Forward
0 new messages