[
https://issues.redhat.com/browse/DROOLS-5681?page=com.atlassian.jira.plug...
]
Sylvain Lemoine updated DROOLS-5681:
------------------------------------
Description:
When using Java standard serialization mechanism, we can see that ByteArrayResource is now
written twice
in ByteArrayResource
{code:java}
@Override
public void writeExternal(ObjectOutput out) throws IOException {
super.writeExternal( out );
out.writeObject( bytes );
out.writeObject(this.encoding);
}{code}
And super class writeExternal:
{code:java}
public void writeExternal(ObjectOutput out) throws IOException {
//...
out.writeObject( bytes );
}{code}
It works as it also read twice in ByteArrayResource#readExternal and
ByteArrayResource#readExternal.
Anyway, moving the bytes attribute from child class to super class
in [[bb5e421df|https://github.com/kiegroup/drools/commit/bb5e421df8950cb2...
|
[
https://github.com/kiegroup/drools/commit/bb5e421df8950cb2355071863b2c478...
broke our project serialization as we rely on java serialization for our KieBase
resources. Seems ok as we'll address it by some tweaking on serialVersionUID, but
fixing this issue (read/write once instead of twice) will also break deserialization for
projects which rely on it from 7.34.0.Final.
Don't know if it's ok to fix it in the next version. I can make a PR for this
case.
was:
When using Java standard serialization mechanism, we can see that ByteArrayResource is now
written twice
in ByteArrayResource
{code:java}
@Override
public void writeExternal(ObjectOutput out) throws IOException {
super.writeExternal( out );
out.writeObject( bytes );
out.writeObject(this.encoding);
}{code}
And super class writeExternal:
{code:java}
public void writeExternal(ObjectOutput out) throws IOException {
//...
out.writeObject( bytes );
}{code}
It works as it also read twice in ByteArrayResource#readExternal and
ByteArrayResource#readExternal.
Anyway, moving the bytes attribute from child class to super class
in [[bb5e421df|https://github.com/kiegroup/drools/commit/bb5e421df8950cb2...
broke our project serialization as we rely on java serialization for our KieBase
resources. Seems ok as we'll address it by some tweaking on serialVersionUID, but
fixing this issue (read/write once instead of twice) will also break deserialization for
projects which rely on it from 7.34.0.Final.
Don't know if it's ok to fix it in the next version. I can make a PR for this
case.
ByteArrayResource bytes attribute read/write twice
--------------------------------------------------
Key: DROOLS-5681
URL:
https://issues.redhat.com/browse/DROOLS-5681
Project: Drools
Issue Type: Bug
Components: core engine
Affects Versions: 7.43.1.Final
Reporter: Sylvain Lemoine
Assignee: Mario Fusco
Priority: Major
When using Java standard serialization mechanism, we can see that ByteArrayResource is
now written twice
in ByteArrayResource
{code:java}
@Override
public void writeExternal(ObjectOutput out) throws IOException {
super.writeExternal( out );
out.writeObject( bytes );
out.writeObject(this.encoding);
}{code}
And super class writeExternal:
{code:java}
public void writeExternal(ObjectOutput out) throws IOException {
//...
out.writeObject( bytes );
}{code}
It works as it also read twice in ByteArrayResource#readExternal and
ByteArrayResource#readExternal.
Anyway, moving the bytes attribute from child class to super class
in [[bb5e421df|https://github.com/kiegroup/drools/commit/bb5e421df8950cb2...
|
[
https://github.com/kiegroup/drools/commit/bb5e421df8950cb2355071863b2c478...
broke our project serialization as we rely on java serialization for our KieBase
resources. Seems ok as we'll address it by some tweaking on serialVersionUID, but
fixing this issue (read/write once instead of twice) will also break deserialization for
projects which rely on it from 7.34.0.Final.
Don't know if it's ok to fix it in the next version. I can make a PR for this
case.
--
This message was sent by Atlassian Jira
(v7.13.8#713008)