Hi Les,

jira seems to be down last two hours so I will add this mail content to it
when it is up again.

I experimented with SubjectAwareExecutorService again. Turns out, that the
problem is in the used java library. I compiled Shiro in both Java 1.5 and
1.6 used default JRE in each case.

Compile Shiro in 1.5:
>From trunk: does not compile
My patch: compile

Compile Shiro in 1.6 with backward compatibility set to 1.5:
>From trunk: compile
My patch: does not compile

The problem is that the class SubjectAwareExecutorService implements
java.util.concurrent.ExecutorService which changed in between JDK 1.5 and
JDK 1.6.

JDK 1.5 version: <T> T invokeAny(Collection<Callable<T>> tasks)
JDK 1.6 version: <T> T invokeAny(Collection<? extends Callable<T>> tasks)

It is not possible to write an implementation that satisfy both interfaces.
ExecutorService in JDK 1.6 is not backward compatible with JDK 1.5 see [1].
They are binary compatible, but not source code compatible.

There is no perfect solution. Java 1.5 is not supported for 'standard'
users, but it is supported for 'business' users. It is still in use and as
far as I know a lot of projects are still written in it. As they are binary
compatible, compiled Shiro should be usable in all three Java 1.5, 1.6 and
1.7 versions anyway.

We can document the issue, so people will not loose time with the same
problem.

Links:
[1] Bug report in sun bug tracker:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6267833
[2] Java 1.5 ExcecutorService API:
http://docs.oracle.com/javase/1.5.0/docs/api/java/util/concurrent/ExecutorService.html
[3] Java 1.6 ExcecutorService API:
http://docs.oracle.com/javase/6/docs/api/java/util/concurrent/ExecutorService.html

With Regards,
Maria Jurcovicova

On Wed, Dec 28, 2011 at 4:50 PM, Les Hazlewood (Commented) (JIRA) <
[email protected]> wrote:

>
>    [
> https://issues.apache.org/jira/browse/SHIRO-315?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13176692#comment-13176692]
>
> Les Hazlewood commented on SHIRO-315:
> -------------------------------------
>
> Applying this patch causes the build to fail.
>
> Maria, could you please try it locally again?
>
> Thanks,
>
> Les
>
> > SubjectAwareExecutorService in shiro-core does not compile
> > ----------------------------------------------------------
> >
> >                 Key: SHIRO-315
> >                 URL: https://issues.apache.org/jira/browse/SHIRO-315
> >             Project: Shiro
> >          Issue Type: Bug
> >          Components: Authentication (log-in)
> >    Affects Versions: 1.2.0
> >            Reporter: Maria Jurcovicova
> >            Assignee: Kalle Korhonen
> >         Attachments: extendingGenerics.patch
> >
> >
> > The method invokeAny in SubjectAwareExecutorService has wrong type.
> SubjectAwareExecutorService implements ExecutorService interface.
> > ExecutorService:
> >     <T> T invokeAny(Collection<Callable<T>> tasks)
> > SubjectAwareExecutorService:
> >     public <T> T invokeAny(Collection<? extends Callable<T>> tasks)
> throws InterruptedException, ExecutionException {
> > Reason: It is not possible to override Collection<Callable<T>> tasks
> with Collection<? extends Callable<T>> tasks. Such override would not be
> typesafe.
>
> --
> This message is automatically generated by JIRA.
> If you think it was sent incorrectly, please contact your JIRA
> administrators:
> https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
> For more information on JIRA, see: http://www.atlassian.com/software/jira
>
>
>

Reply via email to