Login
Home
Products
Download
Documentation
Community
Company
Forum
Documentation
Bugzilla
FAQ
Register
November 20, 2008, 03:28:55 pm
News
:
Home
Help
Search
Login
Register
Community Forums
>
Share Queries
>
Cool queries
>
Abstract serializable classes without a serialVersionUID field
Pages: [
1
]
« previous
next »
Print
Author
Topic: Abstract serializable classes without a serialVersionUID field (Read 1146 times)
Johan Stuyts
Newbie
Posts: 5
Abstract serializable classes without a serialVersionUID field
«
on:
August 16, 2007, 09:18:17 am »
Eclipse provides a warning for serializable classes that don't have a serialVersionUID. Unfortunately it does not do this for abstract classes, but they must have a serialVersionUID too as I found out the hard way.
The query below finds all abstract serializable classes without a serialVersionUID:
from Class c
where c.fromSource()
and c.hasModifier("abstract")
and exists(Interface s | s.hasQualifiedName("java.io", "Serializable") and c.hasSupertype+(s))
and not c.declaresField("serialVersionUID")
select c
Thanks for the great plugin!
Kind regards,
Johan Stuyts
Logged
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General
-----------------------------
=> General board
-----------------------------
Share Queries
-----------------------------
=> Cool queries
-----------------------------
Feature requests
-----------------------------
=> New SemmleCode features
-----------------------------
Installation
-----------------------------
=> SemmleCode installation
-----------------------------
Troubleshooting
-----------------------------
=> SemmleCode Problems
Loading...