Re: Instance java.lang.Object.getClass() of Class Java Method on OO Tumia
 
Paka Small wrote:
Example code proving beyond any doubt that a method is an instance of
the class java.lang.reflect.Method in Java:
No, it doesn't. Again, the Java Language Specification defines methods and 
objects, and they are not the same thing. I have pointed you to it.
  public final void setValue(BaseObject baseObject, Object value) {
    java.lang.reflect.Method setMethod = null;
'setMethod' is a variable, not a method.
    try {
      setMethod =
baseObjectClass.getJavaClass().getMethod(this.getSetMethodName(), new
Class[]{this.type});
      } catch (NoSuchMethodException ex) {
 
Logger.getLogger(BaseObjectAttribute.class.getName()).log(Level.SEVERE,
null, ex);
      } catch (SecurityException ex) {
 
Logger.getLogger(BaseObjectAttribute.class.getName()).log(Level.SEVERE,
null, ex);
      }
    try {
      setMethod.invoke(baseObject, new Object[]{value});
'invoke()' is a method.
    } catch (IllegalAccessException ex) {
 
Logger.getLogger(BaseObjectAttribute.class.getName()).log(Level.SEVERE,
null, ex);
    } catch (IllegalArgumentException ex) {
 
Logger.getLogger(BaseObjectAttribute.class.getName()).log(Level.SEVERE,
null, ex);
    } catch (InvocationTargetException ex) {
 
Logger.getLogger(BaseObjectAttribute.class.getName()).log(Level.SEVERE,
null, ex);
    }
  }
How exactly do you imagine that this proves a method is a class instance? 
All your code proves is that there exists a class instance that can describe 
and invoke a particular method. There is nothing in your code that shows, let 
alone proves "beyond any doubt", that a method is an instance of a class. It 
couldn't, because a Java method is not an instance of a class.
-- 
Lew