Uploaded image for project: 'Byteman'
  1. Byteman
  2. BYTEMAN-251

Byteman does not recognise Class instance literals

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 2.1.4
    • 2.1.3
    • Parser/Type Checker
    • None
    • Documentation (Ref Guide, User Guide, etc.)
    • Workaround Exists
    • Hide

      If a suitable constructor is available you can create an instance of the desired class and then call it's getClass method e.g. instead of

      HibernateValidator.class

      you could try to use

      new HibernateValidator().getClass()

      Show
      If a suitable constructor is available you can create an instance of the desired class and then call it's getClass method e.g. instead of HibernateValidator.class you could try to use new HibernateValidator().getClass()

    Description

      Mention a Class instance literal by name and Byteman goes duh? For example if you specify

      BIND
      config:org.hibernate.validator.HibernateValidatorConfiguration = javax.validation.Validation.byProvider(HibernateValidator.class).configure();
      tmp:javax.validation.ValidatorFactory = config.buildValidatorFactory();

      Byetman will throw the following type error

      stdOut: org.jboss.byteman.rule.exception.TypeException: FieldExpression.typeCheck : invalid path HibernateValidator to static field class file . . .

      (n.b. that should probably read 'to static field "class" file ...'). In other words even though Byteman knows that the path prefix to ".class" is a static type reference it thinks the ".class" term at the end denotes a static field access. So, mentions of .class need checking for as a special case.

      n.b. the obvious case is where ".class" terminates the expression but it will also be necessary to deal with the case where a method of the Class instance is invoked.

      Attachments

        Activity

          People

            rhn-engineering-adinn Andrew Dinn
            rhn-engineering-adinn Andrew Dinn
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: