Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

SI-6784 Localize feature imports in scala.swing.

These were inadvertantly added to the public API in f15dc74 for anyone
importing scala.swing._, which unintentionally enabled reflectiveCalls
and implicitConversions for clients of the API.

This change breaks the source compatibiliy poilicy, rather than
deprecating these, based on the extremely low chance that someone is
using these in something like:

    import scala.swing._; println(implicitConversions)
  • Loading branch information...
commit 2e5c7b96fa836b0a716a86a377e9ece3bdf5068c 1 parent 464c9fe
@retronym retronym authored
View
7 src/swing/scala/swing/Action.scala
@@ -35,7 +35,12 @@ object Action {
// TODO: we need an action cache
private var _action: Action = Action.NoAction
def action: Action = _action
- def action_=(a: Action) { _action = a; peer.setAction(a.peer) }
+ def action_=(a: Action) {
+ _action = a;
+
+ import scala.language.reflectiveCalls
+ peer.setAction(a.peer)
+ }
//1.6: def hideActionText: Boolean = peer.getHideActionText
//def hideActionText_=(b: Boolean) = peer.setHideActionText(b)
View
1  src/swing/scala/swing/ComboBox.scala
@@ -11,6 +11,7 @@ package scala.swing
import event._
import javax.swing.{JList, JComponent, JComboBox, JTextField, ComboBoxModel, AbstractListModel, ListCellRenderer}
import java.awt.event.ActionListener
+import scala.language.implicitConversions
object ComboBox {
/**
View
1  src/swing/scala/swing/GridBagPanel.scala
@@ -9,6 +9,7 @@
package scala.swing
import java.awt.{GridBagConstraints, GridBagLayout}
+import scala.language.implicitConversions
object GridBagPanel {
object Fill extends Enumeration {
View
5 src/swing/scala/swing/Orientable.scala
@@ -12,7 +12,10 @@ package scala.swing
object Orientable {
trait Wrapper extends Oriented.Wrapper with Orientable {
- def orientation_=(o: Orientation.Value) { peer.setOrientation(o.id) }
+ def orientation_=(o: Orientation.Value) {
+ import scala.language.reflectiveCalls
+ peer.setOrientation(o.id)
+ }
}
}
View
1  src/swing/scala/swing/Oriented.scala
@@ -22,6 +22,7 @@ object Oriented {
def getOrientation(): Int
def setOrientation(n: Int)
}
+ import scala.language.reflectiveCalls
def orientation: Orientation.Value = Orientation(peer.getOrientation)
}
}
View
1  src/swing/scala/swing/Swing.scala
@@ -14,6 +14,7 @@ import java.awt.event._
import javax.swing.event._
import javax.swing.border._
import javax.swing.{JComponent, Icon, BorderFactory, SwingUtilities}
+import scala.language.implicitConversions
/**
View
3  src/swing/scala/swing/package.scala
@@ -14,9 +14,6 @@ package object swing {
type Image = java.awt.Image
type Font = java.awt.Font
- implicit lazy val reflectiveCalls = scala.language.reflectiveCalls
- implicit lazy val implicitConversions = scala.language.implicitConversions
-
private[swing] def ifNull[A](o: Object, a: A): A = if(o eq null) a else o.asInstanceOf[A]
private[swing] def toOption[A](o: Object): Option[A] = if(o eq null) None else Some(o.asInstanceOf[A])
private[swing] def toAnyRef(x: Any): AnyRef = x.asInstanceOf[AnyRef]
Please sign in to comment.
Something went wrong with that request. Please try again.