Uploaded image for project: 'PUBLIC - Liferay Faces'
  1. PUBLIC - Liferay Faces
  2. FACES-2964

Remove "implements Serializable" and serialVersionUID from @RequestScoped beans

    Details

      Description

      Some of the demo portlets have managed beans declared like the following:

      @Named
      @RequestScoped
      public class ApplicantBackingBean implements Serializable {
      
      	// serialVersionUID
      	private static final long serialVersionUID = 2947548873495692163L;
      
      	// Injections
      	@ManagedProperty(value = "#{applicantModelBean}")
      	private transient ApplicantModelBean applicantModelBean;
      	...
      }
      

      It is not necessary for a @RequestScoped bean to implement the java.io.Serializable interface, nor is it necessary to define a serialVersionUID. It also means that the transient keyword is not necessary on @ManagedProperty injection properties.

      The reason why this happened is because FACES-1543 introduced a @ViewScoped ApplicantViewBean class (which needs to be Serializable) with commit 3f6ca5c2 but we neglected to remove the serializable functionality from the ApplicantBackingBean.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: