Page 2 of 2 FirstFirst 12
Results 11 to 17 of 17

Thread: Is there any problem in making a Roo Entity Serializable?

  1. #11
    Join Date
    May 2006
    Location
    Madrid
    Posts
    382

    Default

    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.

  2. #12
    Join Date
    Aug 2010
    Location
    Goteborg, Sweden
    Posts
    434

    Default

    I meant it's unsurprising to me that an abstract class can implement Serializable.

  3. #13
    Join Date
    May 2006
    Location
    Madrid
    Posts
    382

    Default

    It has not to be abstract, as long as it is a direct child, that's surprising for me.

  4. #14
    Join Date
    Aug 2010
    Location
    Goteborg, Sweden
    Posts
    434

    Default

    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.

  5. #15
    Join Date
    May 2006
    Location
    Madrid
    Posts
    382

    Default

    Done, thanks MiB.

    According Joshua Bloch...

    Classes designed for inheritance should rarely implement Serializable, and interfaces should rarely extend it
    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.

    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.

  6. #16
    Join Date
    Aug 2010
    Location
    Goteborg, Sweden
    Posts
    434

    Default

    Quote Originally Posted by jbbarquero View Post
    the remains of the chapter contains a lot of reason for NOT making the hierarchy Serializable.
    I assume you also read that Joshua acknoledges there are circumstances when it is appropriate to override that specific rule.
    Quote Originally Posted by jbbarquero View Post
    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.
    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.
    Last edited by MiB; Jun 5th, 2012 at 01:46 PM.

  7. #17
    Join Date
    Aug 2010
    Location
    Goteborg, Sweden
    Posts
    434

    Default

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •