Shiro
  1. Shiro
  2. SHIRO-208

Correct JDK 1.5 / 1.6 incompatibilities

    Details

    • Type: Task Task
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.0.0, 1.1.0, 1.2.0
    • Fix Version/s: 1.3.0
    • Component/s: None
    • Labels:
      None

      Description

      The current trunk is not JDK 1.5 compatible. Fix these incompatibilities until the dev team decides such a time that we wish to be only 1.6+ compliant.

        Activity

        Hide
        Les Hazlewood added a comment -

        Do you guys see a need for us to work on this now that JDK 1.5 is end-of-lifed? I mean - we require 1.6 to build, but all indications are that it runs fine on 1.5 still.

        Isn't this good enough? I'd like to resolve the issue if so...

        Show
        Les Hazlewood added a comment - Do you guys see a need for us to work on this now that JDK 1.5 is end-of-lifed? I mean - we require 1.6 to build, but all indications are that it runs fine on 1.5 still. Isn't this good enough? I'd like to resolve the issue if so...
        Hide
        Alan Cabrera added a comment -

        That's what I was thinking. A profile for this kind of testing so we don't fork the unit tests during normal test/development.

        Show
        Alan Cabrera added a comment - That's what I was thinking. A profile for this kind of testing so we don't fork the unit tests during normal test/development.
        Hide
        Kalle Korhonen added a comment -

        Syntax check != jdk library version check. We could use the enforcer plugin in a profile if you think it's needed.

        Show
        Kalle Korhonen added a comment - Syntax check != jdk library version check. We could use the enforcer plugin in a profile if you think it's needed.
        Hide
        Alan Cabrera added a comment -

        Apparently it does not check run-time libraries, only the code that's being compiled.

        The odd thing is that I put in @Override annotations on method implementation of interfaces, a 1.6 feature, and it still compiled.

        Maybe run forked unit tests under 1.5?

        Show
        Alan Cabrera added a comment - Apparently it does not check run-time libraries, only the code that's being compiled. The odd thing is that I put in @Override annotations on method implementation of interfaces, a 1.6 feature, and it still compiled. Maybe run forked unit tests under 1.5?
        Hide
        Les Hazlewood added a comment -

        I thought it was, based on this in the shiro-root POM (where $

        {jdk.version} is indeed '1.5'):

        <plugins>
        ...
        <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>2.0.2</version>
        <configuration>
        <source>${jdk.version}

        </source>
        <target>$

        {jdk.version}

        </target>
        <encoding>$

        {project.build.sourceEncoding}

        </encoding>
        </configuration>
        </plugin>
        ...
        </plugins>

        Any ideas what we might be missing?

        Show
        Les Hazlewood added a comment - I thought it was, based on this in the shiro-root POM (where $ {jdk.version} is indeed '1.5'): <plugins> ... <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>2.0.2</version> <configuration> <source>${jdk.version} </source> <target>$ {jdk.version} </target> <encoding>$ {project.build.sourceEncoding} </encoding> </configuration> </plugin> ... </plugins> Any ideas what we might be missing?
        Hide
        Alan Cabrera added a comment -

        Should we not update your root POM to force a 1.5 build?

        Show
        Alan Cabrera added a comment - Should we not update your root POM to force a 1.5 build?
        Hide
        Les Hazlewood added a comment -

        It was discovered that there were 3 incompatibilities:

        1. One call to String#isEmpty - this method is only available in 1.6. This call has been removed in favor of a StringUtils.hasText check.

        2. The SubjectAwareExecutorService fails to compile because the JDK 1.6 ExecutorService generics declarations are different on the invokeAll* and invokeAny* methods. They have the same source erasure, so this won't affect JDK 1.5 environments at runtime.

        3. The DelegatingSubjectTest#testRunAs test passes in the IDE using JDK 1.5, but fails on the command line for 1.5, and the reason is not known at the moment. It could be due to how the test is formed, but I don't perceive this as being a blocker for 1.5 runtime.

        So at the moment, 1.6 is required to build, but Shiro will work in 1.5 environments again.

        I'm moving this issue to 1.1.1 to address after the 1.1 release as this no longer constitutes a blocker.

        Show
        Les Hazlewood added a comment - It was discovered that there were 3 incompatibilities: 1. One call to String#isEmpty - this method is only available in 1.6. This call has been removed in favor of a StringUtils.hasText check. 2. The SubjectAwareExecutorService fails to compile because the JDK 1.6 ExecutorService generics declarations are different on the invokeAll* and invokeAny* methods. They have the same source erasure, so this won't affect JDK 1.5 environments at runtime. 3. The DelegatingSubjectTest#testRunAs test passes in the IDE using JDK 1.5, but fails on the command line for 1.5, and the reason is not known at the moment. It could be due to how the test is formed, but I don't perceive this as being a blocker for 1.5 runtime. So at the moment, 1.6 is required to build, but Shiro will work in 1.5 environments again. I'm moving this issue to 1.1.1 to address after the 1.1 release as this no longer constitutes a blocker.

          People

          • Assignee:
            Unassigned
            Reporter:
            Les Hazlewood
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:

              Development