beehive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alejandro Ramirez (JIRA)" <>
Subject [jira] Closed: (BEEHIVE-1087) Controls with simple name conflicts not resolved correctly
Date Tue, 25 Jul 2006 15:28:14 GMT
     [ ]

Alejandro Ramirez closed BEEHIVE-1087.

    Assignee:     (was: Jacob Danner)

> Controls with simple name conflicts not resolved correctly
> ----------------------------------------------------------
>                 Key: BEEHIVE-1087
>                 URL:
>             Project: Beehive
>          Issue Type: Bug
>          Components: Controls
>    Affects Versions: 1.0.1
>            Reporter: Jess Garms
>             Fix For:
>         Attachments:
> I have two controls, both called FooControl, in separate packages. If I then refer to
one of them via their generated Bean class in a Controller, the annotation processor doesn't
always use the correct one. I'll attach source code that exhibits this problem, where a reference
to b.FooControlBean becomes a reference to a.FooControlBean in the generated code.
> This occurs because during a clean build the generated Bean class has not yet been generated,
so the annotation processor searches for all types that are annotated with @ControlInterface,
and looks for one with a matching simple name, ignoring the package. In this case, there are
two such types with matching simple names in different packages, and the annotation processor
cannot differentiate between the two, as APT provides no means for examining imports or resolving
the fully-qualified name of a type that has not been generated (in this case the Bean).
> A possible fix: add an optional value to the Control annotation like so:
> public @interface Control {
>     Class<?> interfaceClass default Object.class;
> }
> Then if @Control is used on a generated Bean class, the user could indicate what the
interface is (from the example I'll be attaching):
> ...
> import b.*;
> ...
> @Control(FooControl.class)
> private FooControlBean fooControl;
> ...
> This change is binary- and source-compatible with previous releases, as the new value
is optional.
> When processing the use of the control, the annotation processor could use the interfaceClass
value to determine which interface to use for the Bean instance.

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:


View raw message