Saturday, July 17, 2010

Many problems with betterbeansbinding - one solution :)

If your binding expressions contain errors or data sources are not available you can get several warnings from EL resolver. But no one of BBB developers thought about good debbuging feedback in such situations. All you get are some of these

[sourcecode type="java"]

2010-07-17 14:10:24 org.jdesktop.beansbinding.util.logging.Logger log
WARNING: isReadable(): expression is unresolvable

2010-07-17 14:10:24 org.jdesktop.beansbinding.util.logging.Logger log
WARNING: updateCache(): expression is unresolvable

2010-07-17 14:10:26 org.jdesktop.beansbinding.util.logging.Logger log
WARNING: isWriteable(): expression is unresolvable

[/sourcecode]

But where? In which class? What binding expression? Damn it! How could I work with this tool?!

I've made very simple changes in CLProperty class of BBB src code. One of them

[sourcecode type="java"]

logger.warning("updateCache(): expression is unresolvable: " +
expression + " for source " + source);

[/sourcecode]

Simple, huh? Now I get

[sourcecode type="java"]

2010-07-17 14:27:10 org.jdesktop.beansbinding.util.logging.Logger log
WARNING: updateCache(): expression is unresolvable: ValueExpression[${rootModel.currentRouteTemplate.inRoutePointTemplates}] for source pl.autoguard.ac21.ptir.mvc.view.TransportRouteView[,0,0,856x612,invalid...

[/sourcecode]

Now I can clearly see that ${rootModel.currentRouteTemplate.inRoutePointTemplates} expression failed for visual element in pl.autoguard.ac21.ptir.mvc.view.TransportRouteView class.

Downloads

Altered ELProperty class.

Altered betterbeansbinding-core-1.3.0b1.jar and betterbeansbinding-core-1.3.0b1.pom (note version 1.3.0b1). This jar should be used instead 1.3.0 version. Update your dependencies today! :)

2 comments:

  1. links are dead. also wanted to know if there is any maven repo for this fix ?

    ReplyDelete
  2. the download links for betterbeansbinding-core-1.3.0b1.jar and betterbeansbinding-core-1.3.0b1.pom are both deads.

    i am having a hard time finding the source code for the BBB project online.

    ReplyDelete