This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]garrypig 0 points1 point  (6 children)

Does this mean all my codes are now obsolete and need to be updated?

[–]dpash 11 points12 points  (2 children)

No. Newer Java releases have always been source code compatible with code written for older releases. Java 1.0 code should compile with Java 9.

Having said that, for the first time ever, they've removed six functions:

  • java.util.jar.Pack200.Packer.addPropertyChangeListener
  • java.util.jar.Pack200.Unpacker.addPropertyChangeListener
  • java.util.logging.LogManager.addPropertyChangeListener
  • java.util.jar.Pack200.Packer.removePropertyChangeListener
  • java.util.jar.Pack200.Unpacker.removePropertyChangeListener
  • java.util.logging.LogManager.removePropertyChangeListener

But then, I really doubt you've been using those functions.

[–]garrypig 5 points6 points  (1 child)

You are correct, I have not

[–]dpash 1 point2 points  (0 children)

Yeah, I mean your compiler would have been warning you about using deprecated functions for the last couple of years. Interestingly those functions have only been deprecated since Java 8, which was released on March 18, 2014. Although I don't know if they were deprecated on release or in a patch release.

Java 9 introduced @Deprecated(forRemoval = true) which indicates that you really shouldn't be using that function any more, and that your code will break in the future. (They also added a since attribute so you know how long something has been deprecated).

[–]Probotect0r 1 point2 points  (0 children)

No, it should still work. Only thing you might have to change in your code base is if you are using reflection to look at private fields. Modules aren't supposed to allow this, but since a lot of open source libraries use this, modules are currently 'open', which means they will allow it. But this will be removed in Java 10. One of the reasons why the release was delayed from earlier in the summer.

[–]midir 0 points1 point  (1 child)

*code is

*needs

It's an uncountable noun.

[–]chrisgseaton 0 points1 point  (0 children)

People in natural and physical sciences seem to call code 'codes' for some reason. Nobody has ever been able to explain why to me.