You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by GitBox <gi...@apache.org> on 2021/03/17 14:00:26 UTC

[GitHub] [commons-lang] arturobernalg commented on pull request #731: LANG-1649 - Check if method is Overridable

arturobernalg commented on pull request #731:
URL: https://github.com/apache/commons-lang/pull/731#issuecomment-801104206


   > There are more rules to check here. You should also check the method is not **final** using `Modifier.isFinal` which prevents being overridden.
   > 
   > How to handle static methods is an issue. You cannot create an **instance** method in a subclass with the same signature as a **static** method from the super class. But you can create a **static** method with the same signature. The static methods are not dispatched on an object at runtime. The method to use is chosen by the compiler.
   > 
   > So perhaps this should return false for any method with the static or final modifiers.
   
   Hi @aherbert 
   I completely forgot about the final. I will check the static case.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org