Closed GoogleCodeExporter closed 9 years ago
You should use Java 6. String.isEmpty doesn't exist on Java5.
Original comment by etorrebo...@gmail.com
on 6 May 2010 at 4:06
This has been a bit fuzzy in the past but I actually think that I'm going to
deliver
specs on Java 6 by default from now on (especially since Java 5 has been
end-of-lifed)
and I will push a Java 5 compatible release on demand. Do you need one?
Original comment by etorrebo...@gmail.com
on 6 May 2010 at 4:41
on mac 10.5, you can select either 1.5 or 1.6, I made the change to 1.6 and now
nothing prints to stdout. And if I
run it under ant and junit (changing the extend part), I still get the same
error.
Original comment by fmpwiz...@gmail.com
on 6 May 2010 at 12:26
I think that you've touched the limit of 20 characters after which the detailed
differences algorithm kicks in to try to show the differences between 2 objects.
I think that this issue should be reproducible just by adding this example:
"this throws an error" in {
"".isEmpty
}
But I also think that this is a Java 5 vs Java 6 issue (it works ok for me).
I'm
pretty sure you're still somehow running Java 5 when you see the same error.
Can you please do more investigation and see if you can reproduce with the
other
example I gave you?
Thanks.
Original comment by etorrebo...@gmail.com
on 6 May 2010 at 12:59
Thanks for looking into this. See this sequence:
$ cat bug.scala
package com.fmpwizard.robot
import org.specs._
import org.specs.runner._
class ParseServerListTest extends Specification {
"this throws an error" in {
"".isEmpty
}
}
$ java -version
java version "1.6.0_17"
Java(TM) SE Runtime Environment (build 1.6.0_17-b04-248-9M3125)
Java HotSpot(TM) 64-Bit Server VM (build 14.3-b01-101, mixed mode)
$ java -cp lib/specs-1.6.2.1.jar:/opt/local/share/scala/lib/scala-library.jar
run
com.fmpwizard.robot.ParseServerList
$
As you see, I get no output, but see this:
$ cat bug.scala
package com.fmpwizard.robot
import org.specs._
import org.specs.runner._
class ParseServerListTest extends Specification {
"this throws an error" in {
"".isEmpty
}
}
$ java -version
java version "1.5.0_22"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_22-b03-333-9M3125)
Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_22-147, mixed mode)
$ java -cp lib/specs-1.6.2.1.jar:/opt/local/share/scala/lib/scala-library.jar
run
com.fmpwizard.robot.ParseServerList
Exception in thread "main" java.lang.NoSuchMethodError:
java.lang.String.isEmpty()Z
at org.specs.runner.ClassRunner.fullClassName(ClassRunner.scala:83)
at org.specs.runner.ClassRunner.createSpecification(ClassRunner.scala:80)
at org.specs.runner.ClassRunner$$anonfun$3$$anonfun$apply$1.apply(ClassRunner.scala:76)
at org.specs.runner.ClassRunner$$anonfun$3$$anonfun$apply$1.apply(ClassRunner.scala:75)
at scala.List.map(List.scala:812)
at org.specs.runner.ClassRunner$$anonfun$3.apply(ClassRunner.scala:75)
at org.specs.runner.ClassRunner$$anonfun$3.apply(ClassRunner.scala:74)
at scala.List.flatMap(List.scala:1132)
at org.specs.runner.ClassRunner.getSpecifications(ClassRunner.scala:74)
at org.specs.runner.ClassRunner.specs(ClassRunner.scala:44)
at org.specs.runner.ClassRunner.main(ClassRunner.scala:51)
at run.main(run.scala)
$
So, using java5 I get the error, using java6 I do not see anything (not even a
"test pass/fail"
And thanks for explaining why increasing the text length causes an error / no
error
Original comment by fmpwiz...@gmail.com
on 6 May 2010 at 2:33
So the issue is really now the question of understanding why you get no output.
Can you
please re-run your spec like this:
$ java -cp lib/specs-1.6.2.1.jar:/opt/local/share/scala/lib/scala-library.jar -
DdebugCreateObject=true run
com.fmpwizard.robot.ParseServerList -v
That may print more information.
Original comment by etorrebo...@gmail.com
on 6 May 2010 at 8:49
Thanks for all your help, It turns out I got no output because I forgot to run
scalac first.
After I did that, using java6 worked fine and java5 gives the error I reported.
Is there a way to use something different that isEmpty, maybe checking the
.length instead ?
And even though I set java to be 1.6 as the default, ant was still using java5,
I ended up setting $JAVA_HOME
to an invalid path to get ant to use the correct one :P
Thanks
Original comment by fmpwiz...@gmail.com
on 7 May 2010 at 1:27
> Is there a way to use something different that isEmpty, maybe checking the
.length
instead ?
It is possible but it gives me bad vibes,... Actually the issue really is in
the
implementation of isEmpty in the Scala library itself (it is not implemented in
the
regular distribution but provided as a RichString method in the Java 5
distribution).
You can get more information on that debate from that thread: http://scala-
programming-language.1934581.n4.nabble.com/Targetting-different-JVMs-was-scala-
internals-First-candidate-for-2-8-0-beta-td2006918.html
Original comment by etorrebo...@gmail.com
on 7 May 2010 at 4:15
Just got bit by this bug. Use case: The applications that I am a developer for
have to target WebSphere Application Server 6.1 at the earliest. WebSphere
Application Server 6.1 uses IBM's 1.5 JVM.
Are there plans to continue a 2.7.7 line of code with bug fixes which will run
properly on a 1.5 JVM?
Original comment by nairb...@gmail.com
on 6 Aug 2010 at 4:23
As a side note: I would be happier with a 2.8.0 line of code that works with
1.5. I am also willing to go through the specs source and make the patches to
make this a reality.
Original comment by nairb...@gmail.com
on 6 Aug 2010 at 4:37
Hi, I've had some troubles with the jdk on my machine. I'll try to redeploy
1.5.0 versions for both releases during the week-end if I can fix that.
Original comment by etorrebo...@gmail.com
on 7 Aug 2010 at 8:53
Let me know if there is anything I can do to help. Brian.
Original comment by nairb...@gmail.com
on 7 Aug 2010 at 4:44
Thanks for your help. I've just uploaded a 1.5.0 release for 2.7.7:
http://scala-tools.org/repo-releases/org/scala-tools/testing/specs/1.6.2.2_1.5.0
/
I'll try to do another one for 2.8.0 today.
Original comment by etorrebo...@gmail.com
on 7 Aug 2010 at 11:19
There is now a java 1.5.0 compiled version here:
http://www.scala-tools.org/repo-snapshots/org/scala-tools/testing/specs_2.8.0/1.
6.6_1.5.0-SNAPSHOT/
Please try it out.
Original comment by etorrebo...@gmail.com
on 8 Aug 2010 at 11:17
Original issue reported on code.google.com by
fmpwiz...@gmail.com
on 6 May 2010 at 3:56