-
Notifications
You must be signed in to change notification settings - Fork 4.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve configuration cache support for Java Object Serialization #13588
Comments
Types that implement `java.io.Externalizable` are very unlikely to serialize correctly to the configuration cache so failing eagerly on them is likely to produce a simpler and more meaningful report. See #13588
java.io.Externalizable
types
This issue has been automatically marked as stale because it has not had recent activity. Given the limited bandwidth of the team, it will be automatically closed if no further activity occurs. If you're interested in how we try to keep the backlog in a healthy state, please read our blog post on how we refine our backlog. If you feel this is something you could contribute, please have a look at our Contributor Guide. Thank you for your contribution. |
This is still relevant. |
Can we have some example code (in Kotlin) in the docs for how to create a custom class that is serializble by the configuration cache? Just having a minimal example with a few lines would be very helpful. |
Currently
|
JavaObjectSerializationCodec allows objects that support the Java Object Serialization protocol to be stored in the configuration cache.
The implementation is currently limited to serializable classes that implement the
java.io.Serializable
interfaceand define one of the following combination of methods:
writeObject
method combined with areadObject
method to control exactly which information to store;writeObject
method with no correspondingreadObject
;writeObject
must eventually callObjectOutputStream.defaultWriteObject
;readObject
method with no correspondingwriteObject
;readObject
must eventually callObjectInputStream.defaultReadObject
;writeReplace
method to allow the class to nominate a replacement to be written;readResolve
method to allow the class to nominate a replacement for the object just read;The following Java Object Serialization features are not supported:
java.io.Externalizable
interface; objects of such classes are discarded by the configuration cache during serialization and reported as problems;serialPersistentFields
member to explicitly declare which fields are serializable; the member, if present, is ignored; the configuration cache considers all buttransient
fields serializable;ObjectOutputStream
are not supported and will throwUnsupportedOperationException
:reset()
,writeFields()
,putFields()
,writeChars(String)
,writeBytes(String)
andwriteUnshared(Any?)
.ObjectInputStream
are not supported and will throwUnsupportedOperationException
:readLine()
,readFully(ByteArray)
,readFully(ByteArray, Int, Int)
,readUnshared()
,readFields()
,transferTo(OutputStream)
andreadAllBytes()
.ObjectInputStream.registerValidation
are simply ignored;readObjectNoData
method, if present, is never invoked;The text was updated successfully, but these errors were encountered: