This page is no longer maintained — Please continue to the home page at www.scala-lang.org

New generics on JComboBox in JDK7

1 reply
Jan Kotek 2
Joined: 2011-04-09,
User offline. Last seen 42 years 45 weeks ago.
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


adriaanm
Joined: 2010-02-08,
User offline. Last seen 31 weeks 4 days ago.
Re: New generics on JComboBox in JDK7
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
cheersadriaan

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland