I noticed that since r1021563 (2010-10-11), Shiro's stopped being Java
1.5 compatible. The following change in Ini.java only compiles and
runs with Java 1.6:

protected static boolean isContinued(String line) {
    if (line == null || line.isEmpty()) {
        return false;

http://download.oracle.com/javase/6/docs/api/java/lang/String.html#isEmpty()
Note it says "Since: 1.6".

If I try to use any of the jars available in
http://repository.apache.org/snapshots/org/apache/shiro/shiro-core/1.1.0-SNAPSHOT/
with Java 1.5 I receive "java.lang.NoSuchMethodError:
java.lang.String.isEmpty()" (see below).
I need to know if Shiro will stop supporting Java 1.5 so I start
looking for an alternative.

Thank you.

$ java -version
java version "1.5.0_12"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_12-b04)
Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_12-b04, mixed mode)

$ 
CLASSPATH=logback-core-0.9.25.jar:logback-classic-0.9.25.jar:slf4j-api-1.6.1.jar:junit-4.8.1.jar:shiro-core-1.1.0-20101019.190915-12.jar:shiro-core-1.1.0-20101019.190915-12-tests.jar

$ java org.junit.runner.JUnitCore org.apache.shiro.config.IniTest
JUnit version 4.8.1
.E.E...09:38:25.397 [main] DEBUG org.apache.shiro.config.Ini - Parsing [main]
E
Time: 0.225
There were 3 failures:
1) testNoSections(org.apache.shiro.config.IniTest)
java.lang.NoSuchMethodError: java.lang.String.isEmpty()Z
        at org.apache.shiro.config.Ini$Section.isContinued(Ini.java:483)
        at org.apache.shiro.config.Ini$Section.toMapProps(Ini.java:557)
        at org.apache.shiro.config.Ini$Section.<init>(Ini.java:464)
        at org.apache.shiro.config.Ini$Section.<init>(Ini.java:445)
        at org.apache.shiro.config.Ini.addSection(Ini.java:302)
        at org.apache.shiro.config.Ini.load(Ini.java:351)
        at org.apache.shiro.config.Ini.load(Ini.java:254)
        at org.apache.shiro.config.IniTest.testNoSections(IniTest.java:42)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[...]

Reply via email to