andy007
andy007

Reputation: 917

Wicket: can I safely ignore serializable warnings?

Almost all of the Wicket components need a line like this

private static final long serialVersionUID = 1L;

And sometimes there are too many those distracting lines... In which cases we can safely ignore serializable warnings? For example:

@SuppressWarnings("serial")
public class CheckOut extends WebPage {
    //private static final long serialVersionUID = 1L;
    public CheckOut() {
        ...

    @Override
    protected void populateItem(ListItem<Cheese> item) {
        //private static final long serialVersionUID = 1L;
        ...

Upvotes: 0

Views: 371

Answers (1)

martin-g
martin-g

Reputation: 17513

These are needed only if you want to support persistent sessions [1]. You can ignore them otherwise.

  1. https://tomcat.apache.org/tomcat-7.0-doc/config/manager.html#Persistence_Across_Restarts

Upvotes: 3

Related Questions