Try passing the value of getClass() to super().

--jason


Scott M Stark wrote:

>>getClass() can not be called until the superclass finishes initializing.
>>
>>Why not use Thread.currentThread().getContextClassLoader() here?
>>
>>--jason
>>
>
>That is not true. In Java you are the most derived class from the
>start. Even when executing ctors in classes you extend you are
>the most derived type and any overriden methods executed in the
>parent ctor use the overriden method. Example:
>
>Java 669>cat tstABC.java
>class A
>{
>   A()
>   {
>      System.out.println("Class: "+getClass()+", A.ctor, "+toString());
>   }
>   public String toString() { return "I'm A"; }
>}
>
>class B extends A
>{
>   B()
>   {
>      System.out.println("Class: "+getClass()+", B.ctor, "+toString());
>   }
>   public String toString() { return "I'm B"; }
>}
>
>class C extends B
>{
>   C()
>   {
>      System.out.println("Class: "+getClass()+", C.ctor, "+toString());
>   }
>   public String toString() { return "I'm C"; }
>}
>
>class tstABC
>{
>   public static void main(String[] args)
>   {
>      C c = new C();
>   }
>}
>Java 670>java tstABC
>Class: class C, A.ctor, I'm C
>Class: class C, B.ctor, I'm C
>Class: class C, C.ctor, I'm C
>
>xxxxxxxxxxxxxxxxxxxxxxxx
>Scott Stark
>Chief Technology Officer
>JBoss Group, LLC
>xxxxxxxxxxxxxxxxxxxxxxxx
>
>
>
>_______________________________________________
>Jboss-development mailing list
>[EMAIL PROTECTED]
>https://lists.sourceforge.net/lists/listinfo/jboss-development
>



_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to