You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@polygene.apache.org by Niclas Hedhman <ni...@hedhman.org> on 2017/05/15 12:57:53 UTC

Massive bug...

Gang,

By mistake I found a big bug...


@Concerns( DefaultMethodsGenericSideEffect.class )
public interface DefaultMethodsGenericSideEffects extends DefaultMethods
{
    @Override
    default String sayHello( String name )
    {
        return greeting().get() + ", " + name + '!';
    }
}

@AppliesTo( DefaultMethodsFilter.class )
public static class DefaultMethodsGenericSideEffect extends
SideEffectOf<InvocationHandler>
    implements InvocationHandler
{



Do you see it?? Point is that there is no warning or anything, but the
SideEffect is applied as a Concern, and the value returned from the
SideEffect is the result of the method call.

The description of the bug should be something like; "Concerns lacking
@ConcernFor injection field is not rejected as a Concern" and the same
thing is like for SideEffects, but I haven't tested that yet.


Cheers
-- 
Niclas Hedhman, Software Developer
http://polygene.apache.org - New Energy for Java

Re: Massive bug...

Posted by Niclas Hedhman <ni...@hedhman.org>.
I agree...

On Tue, May 16, 2017 at 12:49 AM, Paul Merlin <pa...@apache.org> wrote:

> Nice find.
>
> As I understand it, it's not a blocker.
> It doesn't work as expected when you make a mistake.
> We should fix this anyway!
>
> But I wouldn't hold 3.0 and fix this afterwards.
>
> Niclas, could you please fill issues to capture this?
>
>
> Niclas Hedhman a écrit :
> > Gang,
> >
> > By mistake I found a big bug...
> >
> >
> > @Concerns( DefaultMethodsGenericSideEffect.class )
> > public interface DefaultMethodsGenericSideEffects extends DefaultMethods
> > {
> >     @Override
> >     default String sayHello( String name )
> >     {
> >         return greeting().get() + ", " + name + '!';
> >     }
> > }
> >
> > @AppliesTo( DefaultMethodsFilter.class )
> > public static class DefaultMethodsGenericSideEffect extends
> > SideEffectOf<InvocationHandler>
> >     implements InvocationHandler
> > {
> >
> >
> >
> > Do you see it?? Point is that there is no warning or anything, but the
> > SideEffect is applied as a Concern, and the value returned from the
> > SideEffect is the result of the method call.
> >
> > The description of the bug should be something like; "Concerns lacking
> > @ConcernFor injection field is not rejected as a Concern" and the same
> > thing is like for SideEffects, but I haven't tested that yet.
> >
> >
> > Cheers
>



-- 
Niclas Hedhman, Software Developer
http://polygene.apache.org - New Energy for Java

Re: Massive bug...

Posted by Paul Merlin <pa...@apache.org>.
Nice find.

As I understand it, it's not a blocker.
It doesn't work as expected when you make a mistake.
We should fix this anyway!

But I wouldn't hold 3.0 and fix this afterwards.

Niclas, could you please fill issues to capture this?


Niclas Hedhman a écrit :
> Gang,
>
> By mistake I found a big bug...
>
>
> @Concerns( DefaultMethodsGenericSideEffect.class )
> public interface DefaultMethodsGenericSideEffects extends DefaultMethods
> {
>     @Override
>     default String sayHello( String name )
>     {
>         return greeting().get() + ", " + name + '!';
>     }
> }
>
> @AppliesTo( DefaultMethodsFilter.class )
> public static class DefaultMethodsGenericSideEffect extends
> SideEffectOf<InvocationHandler>
>     implements InvocationHandler
> {
>
>
>
> Do you see it?? Point is that there is no warning or anything, but the
> SideEffect is applied as a Concern, and the value returned from the
> SideEffect is the result of the method call.
>
> The description of the bug should be something like; "Concerns lacking
> @ConcernFor injection field is not rejected as a Concern" and the same
> thing is like for SideEffects, but I haven't tested that yet.
>
>
> Cheers