[scala/f19] Fix REPL crash issue when entering an exclaimation mark (#890069)

Jochen Schmitt s4504kr at fedoraproject.org
Sun Oct 13 14:53:36 UTC 2013


commit efff4b18d56d98fe199efdf5ded689015ad6f251
Author: Jochen Schmitt <Jochen at herr-schmitt.de>
Date:   Sun Oct 13 16:11:39 2013 +0200

    Fix REPL crash issue when entering an exclaimation mark (#890069)

 scala-2.10.2-use_system_jline.patch |   98 -------------------------------
 scala-2.10.3-use_system_jline.patch |  109 +++++++++++++++++++++++++++++++++++
 scala.spec                          |    7 ++-
 3 files changed, 114 insertions(+), 100 deletions(-)
---
diff --git a/scala-2.10.3-use_system_jline.patch b/scala-2.10.3-use_system_jline.patch
new file mode 100644
index 0000000..c8a43eb
--- /dev/null
+++ b/scala-2.10.3-use_system_jline.patch
@@ -0,0 +1,109 @@
+diff -up scala-2.10.3/src/compiler/scala/tools/nsc/interpreter/ConsoleReaderHelper.scala.sysjline scala-2.10.3/src/compiler/scala/tools/nsc/interpreter/ConsoleReaderHelper.scala
+--- scala-2.10.3/src/compiler/scala/tools/nsc/interpreter/ConsoleReaderHelper.scala.sysjline	2013-10-10 21:03:24.000000000 +0200
++++ scala-2.10.3/src/compiler/scala/tools/nsc/interpreter/ConsoleReaderHelper.scala	2013-10-13 15:28:24.478283303 +0200
+@@ -6,8 +6,8 @@
+ package scala.tools.nsc
+ package interpreter
+ 
+-import scala.tools.jline.console.{ ConsoleReader, CursorBuffer }
+-import scala.tools.jline.console.completer.CompletionHandler
++import jline.console.{ ConsoleReader, CursorBuffer }
++import jline.console.completer.CompletionHandler
+ import Completion._
+ 
+ trait ConsoleReaderHelper extends ConsoleReader {
+diff -up scala-2.10.3/src/compiler/scala/tools/nsc/interpreter/Delimited.scala.sysjline scala-2.10.3/src/compiler/scala/tools/nsc/interpreter/Delimited.scala
+--- scala-2.10.3/src/compiler/scala/tools/nsc/interpreter/Delimited.scala.sysjline	2013-10-10 21:03:24.000000000 +0200
++++ scala-2.10.3/src/compiler/scala/tools/nsc/interpreter/Delimited.scala	2013-10-13 15:28:24.483282990 +0200
+@@ -6,7 +6,7 @@
+ package scala.tools.nsc
+ package interpreter
+ 
+-import scala.tools.jline.console.completer.ArgumentCompleter.{ ArgumentDelimiter, ArgumentList }
++import jline.console.completer.ArgumentCompleter.{ ArgumentDelimiter, ArgumentList }
+ 
+ class JLineDelimiter extends ArgumentDelimiter {
+   def toJLine(args: List[String], cursor: Int) = args match {
+diff -up scala-2.10.3/src/compiler/scala/tools/nsc/interpreter/JLineCompletion.scala.sysjline scala-2.10.3/src/compiler/scala/tools/nsc/interpreter/JLineCompletion.scala
+--- scala-2.10.3/src/compiler/scala/tools/nsc/interpreter/JLineCompletion.scala.sysjline	2013-10-10 21:03:24.000000000 +0200
++++ scala-2.10.3/src/compiler/scala/tools/nsc/interpreter/JLineCompletion.scala	2013-10-13 15:28:24.487282739 +0200
+@@ -6,8 +6,8 @@
+ package scala.tools.nsc
+ package interpreter
+ 
+-import scala.tools.jline._
+-import scala.tools.jline.console.completer._
++import jline._
++import jline.console.completer._
+ import Completion._
+ import scala.collection.mutable.ListBuffer
+ 
+diff -up scala-2.10.3/src/compiler/scala/tools/nsc/interpreter/JLineReader.scala.sysjline scala-2.10.3/src/compiler/scala/tools/nsc/interpreter/JLineReader.scala
+--- scala-2.10.3/src/compiler/scala/tools/nsc/interpreter/JLineReader.scala.sysjline	2013-10-10 21:03:24.000000000 +0200
++++ scala-2.10.3/src/compiler/scala/tools/nsc/interpreter/JLineReader.scala	2013-10-13 15:30:16.619034744 +0200
+@@ -6,8 +6,8 @@
+ package scala.tools.nsc
+ package interpreter
+ 
+-import scala.tools.jline.console.ConsoleReader
+-import scala.tools.jline.console.completer._
++import jline.console.ConsoleReader
++import jline.console.completer._
+ import session._
+ import scala.collection.JavaConverters._
+ import Completion._
+@@ -71,6 +71,9 @@ class JLineReader(_completion: => Comple
+   def eraseLine() = consoleReader.eraseLine()
+   // Alternate implementation, not sure if/when I need this.
+   // def eraseLine() = while (consoleReader.delete()) { }
+-  def readOneLine(prompt: String) = consoleReader readLine prompt
++  def readOneLine(prompt: String) = {
++      consoleReader.setExpandEvents(false)
++      consoleReader readLine prompt
++      }
+   def readOneKey(prompt: String)  = consoleReader readOneKey prompt
+ }
+diff -up scala-2.10.3/src/compiler/scala/tools/nsc/interpreter/Parsed.scala.sysjline scala-2.10.3/src/compiler/scala/tools/nsc/interpreter/Parsed.scala
+--- scala-2.10.3/src/compiler/scala/tools/nsc/interpreter/Parsed.scala.sysjline	2013-10-10 21:03:24.000000000 +0200
++++ scala-2.10.3/src/compiler/scala/tools/nsc/interpreter/Parsed.scala	2013-10-13 15:28:24.496282176 +0200
+@@ -6,7 +6,7 @@
+ package scala.tools.nsc
+ package interpreter
+ 
+-import scala.tools.jline.console.completer.ArgumentCompleter.{ ArgumentDelimiter, ArgumentList }
++import jline.console.completer.ArgumentCompleter.{ ArgumentDelimiter, ArgumentList }
+ import util.returning
+ 
+ /** One instance of a command buffer.
+diff -up scala-2.10.3/src/compiler/scala/tools/nsc/interpreter/ReplProps.scala.sysjline scala-2.10.3/src/compiler/scala/tools/nsc/interpreter/ReplProps.scala
+--- scala-2.10.3/src/compiler/scala/tools/nsc/interpreter/ReplProps.scala.sysjline	2013-10-10 21:03:24.000000000 +0200
++++ scala-2.10.3/src/compiler/scala/tools/nsc/interpreter/ReplProps.scala	2013-10-13 15:28:24.500281925 +0200
+@@ -13,8 +13,8 @@ class ReplProps {
+   private def bool(name: String) = BooleanProp.keyExists(name)
+   private def int(name: String) = IntProp(name)
+ 
+-  val jlineDebug = bool("scala.tools.jline.internal.Log.debug")
+-  val jlineTrace = bool("scala.tools.jline.internal.Log.trace")
++  val jlineDebug = bool("jline.internal.Log.debug")
++  val jlineTrace = bool("jline.internal.Log.trace")
+ 
+   val info  = bool("scala.repl.info")
+   val debug = bool("scala.repl.debug")
+diff -up scala-2.10.3/src/compiler/scala/tools/nsc/interpreter/session/package.scala.sysjline scala-2.10.3/src/compiler/scala/tools/nsc/interpreter/session/package.scala
+--- scala-2.10.3/src/compiler/scala/tools/nsc/interpreter/session/package.scala.sysjline	2013-10-10 21:03:24.000000000 +0200
++++ scala-2.10.3/src/compiler/scala/tools/nsc/interpreter/session/package.scala	2013-10-13 15:28:24.504281675 +0200
+@@ -14,10 +14,10 @@ package object session {
+   type JIterator[T]       = java.util.Iterator[T]
+   type JListIterator[T]   = java.util.ListIterator[T]
+ 
+-  type JEntry             = scala.tools.jline.console.history.History.Entry
+-  type JHistory           = scala.tools.jline.console.history.History
+-  type JMemoryHistory     = scala.tools.jline.console.history.MemoryHistory
+-  type JPersistentHistory = scala.tools.jline.console.history.PersistentHistory
++  type JEntry             = jline.console.history.History.Entry
++  type JHistory           = jline.console.history.History
++  type JMemoryHistory     = jline.console.history.MemoryHistory
++  type JPersistentHistory = jline.console.history.PersistentHistory
+ 
+   private[interpreter] implicit def charSequenceFix(x: CharSequence): String = x.toString
+ }
diff --git a/scala.spec b/scala.spec
index d003758..c36ca0f 100644
--- a/scala.spec
+++ b/scala.spec
@@ -10,7 +10,7 @@
 
 Name:           scala
 Version:        2.10.3
-Release:        1%{?dist}
+Release:        2%{?dist}
 Summary:        A hybrid functional/object-oriented language for the JVM
 BuildArch:      noarch
 Group:          Development/Languages
@@ -29,7 +29,7 @@ Source2:        scala-%{version}-bootstrap.tgz
 # Change the default classpath (SCALA_HOME)
 Patch1:		scala-2.10.0-tooltemplate.patch
 # Use system jline2 instead of bundled jline2
-Patch2:	        scala-2.10.2-use_system_jline.patch
+Patch2:	        scala-2.10.3-use_system_jline.patch
 # change org.scala-lang jline in org.sonatype.jline jline
 Patch3:	        scala-2.10.0-compiler-pom.patch
 # Patch Swing module for JDK 1.7
@@ -273,6 +273,9 @@ update-mime-database %{_datadir}/mime &> /dev/null || :
 %doc docs/LICENSE
 
 %changelog
+* Sun Oct 13 2013 Jochen Schmitt <Jochen herr-schmitt de> - 2.10.3-2
+- Fix REPL crash issue when entering an exclaimation mark (#890069)
+
 * Thu Oct 10 2013 Jochen Schmitt <Jochen herr-schmitt de> - 2.10.3-1
 - New upstream release
 


More information about the scm-commits mailing list