Diana / SEAM: completion on outjected components

Hi.

In our project we use outjecting extensively. However, IDEA does not resolve the names being outjected with @Out annotations when writing EL expressions.

Resolving names defined within @Factory works fine.

For example in a conversation component doing the following:

...
@Out
private MyClass thatClass;
...

results in thatClass being outjected into the conversation scope when running seam on our jboss server, but IDEA cannot complete the names, and gives me the following warning:
Undefined context variable 'thatClass'.

I'd think that the @Out annotation would define a new variable?

./Daniel

2 comments
Comment actions Permalink

Daniel,

I've created new issue http://www.jetbrains.net/jira/browse/IDEADEV-26945.

thank you for feedback.

Serega.


0
Comment actions Permalink

Good point - that behavior used to be different in ancient version of Seam.
Starting with Seam 1.1 the scope of an @Out-jected variables that is not a
component itself, defaults to the scope of the component that contains the @Out declaration.
(and EVENT if that containing component is stateless).

Still I think there should be an inspection (maybe a different one) that highlights this
scenario. IMHO a coding style should be preferred that declares the component at the class itself.
Otherwise context variables are much too scattered around in the code (of course Diana helps here A LOT).
Maybe that new inspection should be named "Implicit (or undeclared?) context variable" and it
should have warning level by default.

Also the Seam "reference" is misleading here, too:

"@Out
Specifies that a component attribute that is a Seam component is to be outjected to its context
variable at the end of the invocation."


Daniel Nielsen wrote:

Hi.

In our project we use outjecting extensively. However, IDEA does not resolve the names being outjected with @Out annotations when writing EL expressions.

Resolving names defined within @Factory works fine.

For example in a conversation component doing the following:

..
@Out
private MyClass thatClass;
..

results in thatClass being outjected into the conversation scope when running seam on our jboss server, but IDEA cannot complete the names, and gives me the following warning:
Undefined context variable 'thatClass'.

I'd think that the @Out annotation would define a new variable?

/Daniel

0

Please sign in to leave a comment.