Got me curious too, String concatenation beats equality. The explicit parentheses leading to an NPE would be here, whereupon it becomes immediately visible.
System.out.println(("setting to: " + adapterMemento) != null ? adapterMemento.toString() : null); Thanks! On Thu, Feb 1, 2018 at 2:12 PM, Andreas Huber <a.hu...@corax.at> wrote: > Will be solved with release 1.16.1. > Issue: ISIS-1858 [1] > > Thanks again! > > [1] https://issues.apache.org/jira/browse/ISIS-1858 > > On 2018/02/01 06:55:51, Andreas Huber <a...@corax.at> wrote: > > Hi Martin,> > > > > thanks for this nice little Java puzzler. It got me curious and I had to> > > lookup Java operator precedence to solve this one, we need parentheses!> > > > > Cheers!> > > > > On 2018/02/01 03:23:09, Martin Hesse <m....@gmail.com> wrote:> > > > Hi,>> > > >> > > > Don't know if this qualifies as Heisenbug [0], since debugging and > debug>> > > > logging are not the same thing, but this NPE seems to only show when > I>> > > > switch logging to DEBUG. Using 1.16.0. Didn't go further into it.>> > > >> > > > Caused by:>> > > > java.lang.NullPointerException>> > > >> > > > org.apache.isis.viewer.wicket.model.models.ScalarModelWithPending$Util$1# > setObject(ScalarModelWithPending.java:75)>> > > > > > >> > > > -- ScalarModelWithPending.java lines 74-76 -->> > > > if (LOG.isDebugEnabled()) {>> > > > LOG.debug("setting to: " +>> > > > adapterMemento!=null?adapterMemento.toString():null);>> > > > }>> > > >> > > > Thanks and regards>> > > > Martin>> > > >> > > >> > > > [0] https://en.wikipedia.org/wiki/Heisenbug>> > > >> > > -- > > > Andreas Huber> > > *early corax KG*> > > Hofzeile 11/3/11, A-1190 Wien, mobile: +43 699 19468928, web:> > > www.corax.at <http://www.corax.at>> > > Firmensitz Wien FN 343630 p, Handelsgericht Wien> > > > -- > Andreas Huber > *early corax KG* > Hofzeile 11/3/11, A-1190 Wien, mobile: +43 699 19468928, web: > www.corax.at <http://www.corax.at> > Firmensitz Wien FN 343630 p, Handelsgericht Wien >