unsurprisingly?
An Entity that directly implements Transaction (that extends Serializable) doesn't have errors either.
But I still don't know why an indirection shows that error.
Printable View
unsurprisingly?
An Entity that directly implements Transaction (that extends Serializable) doesn't have errors either.
But I still don't know why an indirection shows that error.
I meant it's unsurprising to me that an abstract class can implement Serializable.
It has not to be abstract, as long as it is a direct child, that's surprising for me.
There's a Serialization chapter 11 in Joshuas Blochs' Effective Java that probably can shed some light on this.
Search for Serialization and check out page 291 specifically for your situation.
Done, thanks MiB.
According Joshua Bloch...
That's my case. I'm not very convinced with this paragraph, but the remains of the chapter contains a lot of reason for NOT making the hierarchy Serializable.Quote:
Classes designed for inheritance should rarely implement Serializable, and interfaces should rarely extend it
However, it doesn't explain the problem with Eclipse, but I've found this: Eclipse bug: The hierarchy of the type AbstractSubClass is inconsistent
The last comment, Anttix 2011-11-12 08:31:46 EST, talks about Roo.
I assume you also read that Joshua acknoledges there are circumstances when it is appropriate to override that specific rule.
That's interesting of course, but Olivier Thomanns comment was also interesting in that he noted this issue was reproduceable using the plain compiler. I don't have the problem with maven from the command line but I didn't use the -X or -e flags.
I haven't had the need before for such a solution like this one, so I haven't fully analyzed why this seems to be so.
OK, so I reran "mvn clean install -X -e" and out of the thousands lines resulting from this "inconsistent" isn't mentioned. If this was a problem with any compiler, then maven would also display a problem somewhere no? I have logging set to WARNING at the project level.
What happen when you run "mvn clean install -X -e" from the command line in your project? Am I wrong that this error message should be displayed within maven or in one of the logs? Maybe maven just sidesteps this issue somehow.