#13 java5 patch

Unstable (example)

As mentioned via email some time ago, here is a patch that makes epic source java5 compliant. It's basically removal of the old assert statement and an organize imports run.


  • Jan Ploski

    Jan Ploski - 2010-11-29

    Can you explain why removing the occurrences of assert keyword would make the code Java 5 compliant? AFAIK, assert was introduced as a keyword in JDK 1.4 and has not been deprecated since. In fact Eclipse's own Assert facility predates the language-level assert keyword. It is arguable whether or not we should use the language-level assert in Eclipse plug-ins - language-level assertions are disabled by default and if enabled they throw AssertionError, which would be hard for Eclipse to deal with. However, it is also true that these assertions are not there for Eclipse or normal users to handle, but only to aid developers' debugging of the code.

    In summary, I'm not sure what improvement you have in mind with these patches? Is it just about making it simpler for developers to work on EPIC code without tweaking their compiler preferences (in order to support 1.4 assert keyword)?

    Also, simply reorganizing imports everywhere creates noise in CVS. I'm generally in favor of minimal, semantically cohesive changes. On the other hand, global refactorings or even big-bang reformatting of code to adhere to a single convention are sometimes also necessary, and then it's better to commit all of the changes in one go. I'd just recommend to keep the different changes separate and documented, for the sake of keeping a log of who changed what and why.

  • Oliver Trosien

    Oliver Trosien - 2010-12-01

    The old code didn't compile on my machine in java 1.5, but maybe that was a local configuration issue. I would prefer using Assert() anyway, as this seems the more Eclipse-way to do.
    Regarding the imports, you're right, this is CVS noise, and if there's a top-10 of useless checkins, this could be one of them. But it's only needed once. If you keep to the convention that Eclipse organizes your imports, they are always clean and well-organized. So this could be seen as a refactoring, which will not break any code, because of the nature of Java, and helps for the future.

  • Jan Ploski

    Jan Ploski - 2010-12-01

    Organize imports is already applied to (most of?) EPIC code base. They are just differently organized :-) compared to your own Eclipse instance. In Preferences > Java > Code Style > Organize Imports I see 3 for "Number of imports needed for .*" in my configuration, which is admittedly non-default (but sensible?).

  • Oliver Trosien

    Oliver Trosien - 2016-05-12
    • status: open --> closed-fixed
    • Group: --> Unstable (example)

Log in to post a comment.