How does Intellij IDEA generate serialVersionUID

By default, Intellij IDEA will not prompt a warning for serialVersionUID generation for classes that inherit the Serializable interface. If you need to generate serialVersionUID, you need to set it in Preferences.

As shown below: Preferences -> Inspections -> Serialization issues -> Serialization class without 'serialVersionUID' tick

 

At this time, in javabean, you can see a yellow prompt on the right side of the editor, you can click it to see

 

Put the cursor on the class name, press atl+enter, you will be prompted to generate serialVersionUID

 



Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326297712&siteId=291194637