Well, there is always a reflection.
class Foo extends javax.swing.undo.UndoManager { def edits(): java.util.Vector[javax.swing.undo.UndoableEdit] = classOf[javax.swing.undo.CompoundEdit]. getDeclaredField("edits").get(this). asInstanceOf[java.util.Vector[javax.swing.undo.UndoableEdit]] }
You can also eliminate two calls by nesting, although this is ugly:
class PreFoo extends javax.swing.undo.UndoManager { protected def editz = edits } class RealFoo extends PreFoo { def edits() = editz }
You need () , although this does not contradict the field itself (and you cannot override val with def ).
source share