Uploaded image for project: 'Arquillian'
  1. Arquillian
  2. ARQ-201

Primitive fields annotated with @Resource are not assigned

XMLWordPrintable

    • Workaround Exists
    • Hide

      Use the nullable wrapper type and rely on autoboxing.

      Show
      Use the nullable wrapper type and rely on autoboxing.

      Fields which are not null are skipped when performing @Resource injections. However, primitive fields are never null and therefore injections do not occur on those fields.

      Example:

      @Resource(name = "port") int port;

              aslak@redhat.com Aslak Knutsen
              dan.j.allen Dan Allen (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: