2 Replies Latest reply on Aug 17, 2005 12:28 PM by chiba

    Error in javassist.compiler.TypeChecker

    mpresley

      Noticed that if a TypeChecker is ever created for java.lang.Object that it will throw a NullPointerException if TypeChecker.getSuperName(..) is ever called.

      Found this out 'cause I'm trying to create an implementation for hashCode() in an object that directly subclasses java.lang.Object. The body I'm creating for the overriding definition of hashCode invokes super.hashCode(). The javassist compiler is choking because a TypeChecker for java.lang.Object is created and TyperChecker.atKeyword(..) is finding the "super" keyword but somehow the "thisClass" attributte is set to java.lang.Object. This utlimately leads to NullPointerException. Seems like "thisClass" should not be java.lang.Object. Is there something I'm missing here?

      In any case, something more polite than NullPointerException might be considered.

      Thanks,
      Matt