Uploaded image for project: 'Weld'
  1. Weld
  2. WELD-1558

Proxy naming conflict when using static nested classes with the same name and package.

XMLWordPrintable

    • Hide

      Create two classes in the same package, for example A and B.
      Create nested static classes with name C in classes A and B.
      Write test class, which has injectable fields of classes A.C and B.C.
      Access fields to force bean access.
      You should get an exception (don't remember exact class).

      As workaround you can use unique names for nested static classes.

      Show
      Create two classes in the same package, for example A and B. Create nested static classes with name C in classes A and B. Write test class, which has injectable fields of classes A.C and B.C. Access fields to force bean access. You should get an exception (don't remember exact class). As workaround you can use unique names for nested static classes.

      Weld unable to distinguish beans, then it's nested static classes with the same class name and package, but different enclosing classes. Weld generates the same proxy name for such classes and tries to inject incorrect bean.

            bafco Matus Abaffy (Inactive)
            ylepikhov Юрий Лепихов (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: