On Mar 13, 1:37 pm, "marcelomorales.n...@gmail.com"
<marcelomorales.n...@gmail.com> wrote:
> Arround min 36:10 - 38:00, there is a discussion on override methods.
>
> Non-overrideable is on the language today. isn't it?.
> Listening to ep 234 seemed that they forgot final methods, the 'final'
> keyword. I am missing something?

Yes - I'm the one who brought it up in that discussion, and what I'm
talking about is not @NotOverridABLE, but @NotOverridING.

In other words, let's say you have

public class LibraryClass { // Some class in some cool library
}

public class Donkey extends LibraryClass {
   @New public void run() {
   }
}

Compile that, no problem.

Now let's say you go and upgrade from version 1.0 of the library to
version 1.1.  What if the developer in version 1.1 had done this:

public class LibraryClass implements Runnable { // Some class in some
cool library
    public void run() {
       // Some important piece of functionality here that other parts
of the class depend upon
    }
}

Now your method is accidentally overriding the run method. It wasn't
intended to - when you wrote your subclass of the library class, this
method wasn't present.

With the @New (or @NotOverride etc) annotations the compiler would
complain because it sees that your method which wasn't intended to
override anything suddenly is.

-- Tor

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "The 
Java Posse" group.
To post to this group, send email to javaposse@googlegroups.com
To unsubscribe from this group, send email to 
javaposse+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/javaposse?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to