New generics on JComboBox in JDK7

223 views
Skip to first unread message

Jan Kotek

unread,
Oct 16, 2011, 1:18:59 PM10/16/11
to scala-user
Hi,

I tryed to compile my scala project with new JDK7, but it failed. JComboBox has changed, now it has generics (type of an item in combobox), while in JDK6 it had not. Introducing generics into existing class is not problem in java (since generics are optional), but for Scala it is problem.

So my question is: is it possible to compile Scala sources with both version of JComboBox with generics (in JDK7) and without generics (in JDK6).

So far I came up only with writing my own wrapper without generics in call it from scala (but this is too complicated). Other option is to just force JDK7.

Thanks,
Jan Kotek
https://github.com/jankotek/asterope


Adriaan Moors

unread,
Oct 17, 2011, 5:36:51 AM10/17/11
to Jan Kotek, scala-user
Hi,

So my question is: is it possible to compile Scala sources with both version of JComboBox with generics (in JDK7) and without generics (in JDK6).
Unfortunately, as far as I know, we haven't yet figured out how to target JDK6&7 from the same code base (I did spend some time on compiler support for this -- https://github.com/adriaanm/scala-dev/tree/openjdk_experiment_erasedoverride -- but it turned out to be pretty challenging). 

We have an openjdk branch on github (https://github.com/scala/scala/tree/openjdk) for building the Scala distribution on JDK7

cheers
adriaan
Reply all
Reply to author
Forward
0 new messages