Unhandled exception type when I add throws exception in getter method

298 views
Skip to first unread message

Ivy Ho

unread,
Dec 19, 2013, 9:23:06 PM12/19/13
to project...@googlegroups.com
I have @Data in the beginning of class and I overrides one getter function which throws Exception. But it gets error "unhandled exception type" and underline @data. How can I solve this problem?

Marius Kruger

unread,
Dec 20, 2013, 8:20:45 AM12/20/13
to project...@googlegroups.com, ivyh...@gmail.com
One reason it happens is probably that the generated toString method uses the getter and doesn't allow an exception.

This behaviour can be suppressed by adding:
@ToString(doNotUseGetters = true)



On 20 December 2013 04:23, Ivy Ho <ivyh...@gmail.com> wrote:
I have @Data in the beginning of class and I overrides one getter function which throws Exception. But it gets error "unhandled exception type" and underline @data. How can I solve this problem?

--
You received this message because you are subscribed to the Google Groups "Project Lombok" group.
To unsubscribe from this group and stop receiving emails from it, send an email to project-lombo...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
✝ Marius
Reply all
Reply to author
Forward
0 new messages