Java – copy of Lombok @ getter and collections

Using @ getter on the list field works normally, but concurrent modificationexceptions are encountered when trying to upgrade to Java 8, because the getter generated by Lombok does not execute a copy of the field. This is essential if you want to prevent external modification of the state of the instance

Any idea, how can I make Longmu Island copy the getter on the collection, or can I just write my own?

Solution

From @ getter and @ setter documents:

Since you need more functionality, you must write your own default getter

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>