Hi !
I have been happily hacking web sites with T5 for a year and half now and is
more then pleased!
Kudos to all of you for this excellent web framework that makes coding fun
again.
And I have never ever encountered any defect in the T5 code.
Now to my problem.
I just got an error in an
Hum .. sorry .. too early in the morning for me .. Ledger is a hibernate
entity class and T5 should not be involved.
I'll be right back ...
2011/9/3 Gunnar Eketrapp gunnar.eketr...@gmail.com
Hi !
I have been happily hacking web sites with T5 for a year and half now and
is more then pleased!
BUT it is also a T5 property so that could be T5 related.
The instance seems to created but the T5 property ledger is null after the
assignment.
2011/9/3 Gunnar Eketrapp gunnar.eketr...@gmail.com
Hum .. sorry .. too early in the morning for me .. Ledger is a hibernate
entity class and T5
Tapestry may not go wrong!
It must has to do with autoboxing in method isClosed() in Ledger.
I was fooled by the debugger and that ledger was shown as null but when
adding log statements I can see that it isn't.
So I have to read a little bit about aoutoboxing but for sure it was NOT a
T5
Cool, glad you found your error
I found it funny watching you do what I do as a first reaction - blame tapestry
:)
I'm still a tapestry noob after one and a half years of part-time deving on my
own projects :)
Can't wait for the tapestry 5 in action book to help me in my part-time ways .
Have a
Yeah, autoboxing is evil - it's just a compiler convenience thing. If you have:
Boolean closed = null;
boolean isClosed() {
return closed;
}
The compiler transforms it to
boolean isClosed() {
return closed.booleanValue();
}
which of course throws an NPE.
Steve.
--
Steve Eynon
On 3
Yea for sure that was exactly the problem.
I changed closed to a closedDate and isClosed to
@Transient
public boolean isClosed() {
return closedDate != null;
}
so now I also now when the ledger was closed.
Thank you for bearing with me ...
2011/9/3 Steve Eynon
If you wanted to keep the closed variable, I often use something like:
return Boolean.TRUE.equals(closed);
which returns false should closed by null;
On 3 September 2011 16:30, Gunnar Eketrapp gunnar.eketr...@gmail.com wrote:
Yea for sure that was exactly the problem.
I changed closed to a