TYPE_RESOLVER in ca.odell.glazedlists.impl.beans.BeanProperty

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

TYPE_RESOLVER in ca.odell.glazedlists.impl.beans.BeanProperty

engintekin
Hi,

We are currently using GlazedLists v 1.7 and like to upgrade to version 1.8, but we couldn't solve a problem
that it's saying "Expected ParameterizedType but found TypeVariable".

We modified a line in BeanProperty class

currentClass = TYPE_RESOLVER.getReturnType(currentClass, partGetter);
to
currentClass = partGetter.getReturnType();


now it seems there is no problem. Is there a problem with this?

Thank you
Reply | Threaded
Open this post in threaded view
|

Re: TYPE_RESOLVER in ca.odell.glazedlists.impl.beans.BeanProperty

Jesse Wilson
On Thu, Jul 8, 2010 at 2:55 AM, engintekin <[hidden email]> wrote:
We are currently using GlazedLists v 1.7 and like to upgrade to version 1.8,
but we couldn't solve a problem
that it's saying "Expected ParameterizedType but found TypeVariable".

We modified a line in BeanProperty class

currentClass = TYPE_RESOLVER.getReturnType(currentClass, partGetter);
to
currentClass = partGetter.getReturnType();

now it seems there is no problem. Is there a problem with this?

Nope, but it suggests that I have a bug in TypeResolver. 

I suspect this is happening with a method whose return type is parameterized. Can you paste the signature of the offending getter in an email so that we can write a test? You'll be able to figure out which one by printing 'partGetter' before the call to getReturnType. Whichever getter is printed immediately before the stacktrace is our candidate.

Thanks.


Reply | Threaded
Open this post in threaded view
|

Re: TYPE_RESOLVER in ca.odell.glazedlists.impl.beans.BeanProperty

engintekin
This post was updated on .
Hi,

class A<T extends B> {

     public T getB(){}
}

The list is filled with "new A()", I think it's working if the list was filled with "new A<B>()"

Jesse Wilson wrote
On Thu, Jul 8, 2010 at 2:55 AM, engintekin <engin.tekin@gmail.com> wrote:

> We are currently using GlazedLists v 1.7 and like to upgrade to version
> 1.8,
> but we couldn't solve a problem
> that it's saying "Expected ParameterizedType but found TypeVariable".
>
> We modified a line in BeanProperty class
>
> currentClass = TYPE_RESOLVER.getReturnType(currentClass, partGetter);
> to
> currentClass = partGetter.getReturnType();
>
> now it seems there is no problem. Is there a problem with this?
>

Nope, but it suggests that I have a bug in TypeResolver.

I suspect this is happening with a method whose return type is
parameterized. Can you paste the signature of the offending getter in an
email so that we can write a test? You'll be able to figure out which one by
printing 'partGetter' before the call to getReturnType. Whichever getter is
printed immediately before the stacktrace is our candidate.

Thanks.
Reply | Threaded
Open this post in threaded view
|

Re: TYPE_RESOLVER in ca.odell.glazedlists.impl.beans.BeanProperty

engintekin
Here is the stack trace

java.lang.AssertionError: Unexpected type. Expected: java.lang.reflect.ParameterizedType, got: sun.reflect.generics.reflectiveObjects.TypeVariableImpl, for type literal: T.
        at ca.odell.glazedlists.impl.java15.MoreTypes.unexpectedType(MoreTypes.java:113)
        at ca.odell.glazedlists.impl.java15.MoreTypes.getRawType(MoreTypes.java:108)
        at ca.odell.glazedlists.impl.java15.TypeLiteral.<init>(TypeLiteral.java:61)
        at ca.odell.glazedlists.impl.java15.TypeLiteral.get(TypeLiteral.java:98)
        at ca.odell.glazedlists.impl.java15.TypeLiteral.resolve(TypeLiteral.java:122)
        at ca.odell.glazedlists.impl.java15.TypeLiteral.getReturnType(TypeLiteral.java:200)
        at ca.odell.glazedlists.impl.java15.J2SE50ReturnTypeResolver.getReturnType(J2SE50ReturnTypeResolver.java:18)
        at ca.odell.glazedlists.impl.beans.BeanProperty.<init>(BeanProperty.java:72)
        at ca.odell.glazedlists.impl.beans.BeanTableFormat.loadPropertyDescriptors(BeanTableFormat.java:106)
        at ca.odell.glazedlists.impl.beans.BeanTableFormat.getColumnValue(BeanTableFormat.java:136)
        at disat.fdn.infrastructure.view.table.decorated.GroupTableFormat.getColumnValue(GroupTableFormat.java:82)
        at ca.odell.glazedlists.swing.EventTableModel.getValueAt(EventTableModel.java:246)
        at org.jdesktop.swingx.JXTable.getValueAt(JXTable.java:1516)
        at javax.swing.JTable.prepareRenderer(JTable.java:5702)
        at org.jdesktop.swingx.JXTable.prepareRenderer(JXTable.java:3579)
        at org.jvnet.substance.SubstanceTableUI.paintCell(SubstanceTableUI.java:1081)
        at org.jvnet.substance.SubstanceTableUI.paintCells(SubstanceTableUI.java:714)
        at org.jvnet.substance.SubstanceTableUI.paint(SubstanceTableUI.java:588)
        at org.jvnet.substance.SubstanceTableUI.__org__jvnet__substance__SubstanceTableUI__update(SubstanceTableUI.java:2745)
        at org.jvnet.substance.SubstanceTableUI.update(SubstanceTableUI.java)
        at javax.swing.JComponent.paintComponent(JComponent.java:752)
        at javax.swing.JComponent.paint(JComponent.java:1029)
        at javax.swing.JComponent.paintChildren(JComponent.java:862)
        at javax.swing.JComponent.paint(JComponent.java:1038)
        at javax.swing.JViewport.paint(JViewport.java:747)
        at javax.swing.JComponent.paintChildren(JComponent.java:862)
        at javax.swing.JComponent.paint(JComponent.java:1038)
        at javax.swing.JComponent.paintChildren(JComponent.java:862)
        at javax.swing.JComponent.paint(JComponent.java:1038)
        at javax.swing.JComponent.paintChildren(JComponent.java:862)
        at javax.swing.JComponent.paint(JComponent.java:1038)
        at javax.swing.JComponent.paintChildren(JComponent.java:862)
        at javax.swing.JComponent.paint(JComponent.java:1038)
        at javax.swing.JComponent.paintChildren(JComponent.java:862)
        at javax.swing.JComponent.paint(JComponent.java:1038)
        at javax.swing.JComponent.paintChildren(JComponent.java:862)
        at javax.swing.JComponent.paint(JComponent.java:1038)
        at javax.swing.JLayeredPane.paint(JLayeredPane.java:567)
        at javax.swing.JComponent.paintChildren(JComponent.java:862)
        at javax.swing.JComponent.paintToOffscreen(JComponent.java:5131)
        at javax.swing.BufferStrategyPaintManager.paint(BufferStrategyPaintManager.java:278)
        at javax.swing.RepaintManager.paint(RepaintManager.java:1224)
        at javax.swing.JComponent.paint(JComponent.java:1015)
        at java.awt.GraphicsCallback$PaintCallback.run(GraphicsCallback.java:21)
        at sun.awt.SunGraphicsCallback.runOneComponent(SunGraphicsCallback.java:60)
        at sun.awt.SunGraphicsCallback.runComponents(SunGraphicsCallback.java:97)
        at java.awt.Container.paint(Container.java:1780)
        at java.awt.Window.paint(Window.java:3375)
        at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:796)
        at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:713)
        at javax.swing.RepaintManager.seqPaintDirtyRegions(RepaintManager.java:693)
        at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:125)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:178)
        at java.awt.Dialog$1.run(Dialog.java:1046)
        at java.awt.Dialog$3.run(Dialog.java:1098)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.awt.Dialog.show(Dialog.java:1096)
        at java.awt.Component.show(Component.java:1563)
        at java.awt.Component.setVisible(Component.java:1515)
        at java.awt.Window.setVisible(Window.java:842)
        at java.awt.Dialog.setVisible(Dialog.java:986)
        at disat.fdn.infrastructure.view.dialog.StandartDialog.showDialog(StandartDialog.java:220)
        at disat.fdn.fatura.view.FaturaKontrolDialog.showDialog(FaturaKontrolDialog.java:358)
        at disat.fdn.fatura.view.FaturaIcinVakaTable$2.execute(FaturaIcinVakaTable.java:93)
        at disat.fdn.infrastructure.view.ExceptionHandlingActionListener.actionPerformed(ExceptionHandlingActionListener.java:22)
        at disat.fdn.infrastructure.view.table.decorated.ZebraTable$1.mouseClicked(ZebraTable.java:83)
        at java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:253)
        at java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:252)
        at java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:252)
        at java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:252)
        at java.awt.Component.processMouseEvent(Component.java:6266)
        at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
        at java.awt.Component.processEvent(Component.java:6028)
        at java.awt.Container.processEvent(Container.java:2041)
        at java.awt.Component.dispatchEventImpl(Component.java:4630)
        at java.awt.Container.dispatchEventImpl(Container.java:2099)
        at java.awt.Component.dispatchEvent(Component.java:4460)
        at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4574)
        at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4247)
        at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
        at java.awt.Container.dispatchEventImpl(Container.java:2085)
        at java.awt.Window.dispatchEventImpl(Window.java:2478)
        at java.awt.Component.dispatchEvent(Component.java:4460)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)