Description of problem:
attempting to println() any string ending in an exclamation point crashes the REPL
Version-Release number of selected component (if applicable):
Every time attempted
Steps to Reproduce:
1. start scala interpreter
2. type in -> println("Hello World!")
3. press <enter>
Welcome to Scala version 2.9.2-unknown-unknown (Java HotSpot(TM) 64-Bit Server VM, Java 1.7.0_10).
Type in expressions to have them evaluated.
Type :help for more information.
scala> println("Hello World!")
java.lang.IllegalArgumentException: !"): event not found
That entry seems to have slain the compiler. Shall I replay
your session? I can re-run each line except the last one.
This, however will print normally:
scala> println("I have 9! kinds! of crazy going on.")
I have 9! kinds! of crazy going on.
This will not:
scala> println("I have 9! kinds! of crazy going on!")
So it seems an exclamation point at the end of the string crashes the REPL. Occurs whether the jvm scala is using is from oracle's jdk 1.7 or openjdk 1.7
This bug was out of scope for the scala people(this bug was posted there first). They say that a different version of Jlines is being used for this fedora distribution than what they use for scala 2.9.2, if that's any help.
All other functionality seems to be intact as I go through the "Programming in Scala" examples.
I can confirm that this bug is a problem. It also shows up when you are using the ! logical operator or the != operator. For example !true will cause a problem. One possible work around for the logical operator is to put a space between the ! and the thing you are working with, for example ! true works. However the only workaround I have found for != is to replace a != b with ! (a==b).
It was suggested to me that other distros use a modified jline package whereas the fedora one does not. If I learn anything more I will try to post it here.
One possible work around that I have found is to make scala unable to find the jline2.jar which makes it just fall back to what it calls the "simple reader". You can do this by running `mv /usr/share/java/jline2.jar /usr/share/java/jline2.jar.old` as root. However I have no idea what else this breaks but it does make the command !true and println("hello world!") work.
Becouse the scala package in fedora use the system jline2 package
in opposite of the upstream distribution I have reassign this bug to jline2.
It seems like the original jline package is still installed, is there an easy way to just point scala toward that instead of jline2?
I have tried to change all occurance of jline.jar in jline2.jar in the
whole source tree of scala. But unfortunately after a build and remove of the
jline package the complaint issue still exists.
I believe this is set in the source code and defined via class paths. For example import org.blah.jline2 instead of import org.blah.jline. Unfortunately my java fu isn't good enough to know if I can fix this without recompiling.
This message is a reminder that Fedora 17 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 17. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora
'version' of '17'.
Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version prior to Fedora 17's end of life.
Bug Reporter: Thank you for reporting this issue and we are sorry that
we may not be able to fix it before Fedora 17 is end of life. If you
would still like to see this bug fixed and are able to reproduce it
against a later version of Fedora, you are encouraged change the
'version' to a later Fedora version prior to Fedora 17's end of life.
Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.
Fedora 17 changed to end-of-life (EOL) status on 2013-07-30. Fedora 17 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.
If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version.
Thank you for reporting this bug and we are sorry it could not be fixed.
Issue stell exist with scala-2.10.3 and jline2-2.10 on F-19.
I have found a fix in scala-2.10.3. the soultion is to call
consoleReader.setExpandEvents(false) before you call consoleRealder.readLine.
So the issue should fixed in scala-2.10.3-2.