Skip to main content

Generic problems with Java SE (20+)

  • From: Werner Keil < >
  • To: " " < >
  • Subject: Generic problems with Java SE (20+)
  • Date: Mon, 13 Oct 2014 22:59:49 +0200

Hi,

I thought this could be of some interest.
Given exactly the same JDK upgrade e.g. caused severe issues to classes
using Unit.asType() and similar methods.

A few issues were already filed, some fixed, but at least a few matching
ones were "deferred" to Java 9 or beyond;-O

The SE 8+ port is clearly most affected by this, but there is reason to
believe, the more severe issue of ME 8 (SDK) no longer working with JARs
built by later Java versions (not just 8) could also be connected.

Regards,
Werner

 *From:* Martijn Verburg 
< >
*Sent:* Monday, October 13, 2014 2:01 PM
*To:* 

*Subject:* Re: [ljc] Unable to compile code using generics under 8u20 but
builds under 8u05

 Hi Will,

Interestingly my Eclipse IDE doesn't complain although it does fail on the
CL build.  In terms of getting an actual answer, I'd try the 8u-dev mailing
list at openjdk.java.net they'll be able to help.



Cheers,
Martijn

On 9 October 2014 09:08, Will May 
< >
 wrote:

>   Hi all,
>
> I've got a piece of code which will compile fine on JDK 8u05 but fails to
> compile [1] on JDK 8u20; a minimal test case is at the bottom of this email.
>
> I know that there were changes around generic wildcards in 8u20 but does
> anyone know if 8u05 is bugged and it has been fixed or if 8u20 is now
> bugged?
>
> For reference, the two bugs that I found were fixed around generic
> wildcards were 8042338 [2] and 8042803 [3].
>
> Cheers,
>
> Will.
>
> 1 The error message is "incompatible types:
> java.util.function.Consumer<capture#1 of ?> cannot be converted to
> java.util.function.Consumer<? super capture#1 of ?>"
> 2 https://bugs.openjdk.java.net/browse/JDK-8042338
> 3 https://bugs.openjdk.java.net/browse/JDK-8042803
>
> import java.util.List;
> import java.util.function.Consumer;
>
> public class Temp {
>
>     public void doWithList(final List<?> list) {
>         list.stream().forEach(consumer(System.out::println));
>     }
>
>     @FunctionalInterface
>     public static interface ExceptionThrowingConsumer<T> {
>         void accept(T input) throws Exception;
>     }
>
>     public static <T> Consumer<T> consumer(ExceptionThrowingConsumer<T>
> consumer) {
>         return i -> {
>             try {
>                 consumer.accept(i);
>             } catch (Exception e) {
>                 throw new RuntimeException(e);
>             }
>         };
>     }
>
> }
>
>
>
>
> --
> Please Note: If you hit "*REPLY*", your message will be sent to *everyone*
> on this mailing list 
> ( )
> This message was sent by Will May 
> ( )
>  from LJC -
> London Java Community <http://www.meetup.com/Londonjavacommunity/>.
> To learn more about Will May, visit his/her member profile
> <http://www.meetup.com/Londonjavacommunity/members/152117732/>
> To report this message or block the sender, please click here
> <http://www.meetup.com/Londonjavacommunity/abuse/152117732/?table_name=ml&table_id=74959662>
> Set my mailing list to email me As they are sent
> <http://www.meetup.com/Londonjavacommunity/list_prefs/?pref=1> | In one
> daily email <http://www.meetup.com/Londonjavacommunity/list_prefs/?pref=2>
> | Don't send me mailing list messages
> <http://www.meetup.com/Londonjavacommunity/list_prefs/?pref=0>
>
> Meetup, POB 4668 #37895 NY NY USA 10163
> <file:///C:/Users/Werner/AppData/Local/Temp/wlmail-433777574/95B164303B56/index.htm#148f3f3845ef4a83_>
> | 
> 
>





--
Please Note: If you hit "*REPLY*", your message will be sent to *everyone*
on this mailing list 
( )
This message was sent by Martijn Verburg 
( )
 from LJC
- London Java Community <http://www.meetup.com/Londonjavacommunity/>.
To learn more about Martijn Verburg, visit his/her member profile
<http://www.meetup.com/Londonjavacommunity/members/8139512/>
To report this message or block the sender, please click here
<http://www.meetup.com/Londonjavacommunity/abuse/8139512/?table_name=ml&table_id=75159392>
Set my mailing list to email me As they are sent
<http://www.meetup.com/Londonjavacommunity/list_prefs/?pref=1> | In one
daily email <http://www.meetup.com/Londonjavacommunity/list_prefs/?pref=2>
| Don't send me mailing list messages
<http://www.meetup.com/Londonjavacommunity/list_prefs/?pref=0>

Meetup, POB 4668 #37895 NY NY USA 10163
<file:///C:/Users/Werner/AppData/Local/Temp/wlmail-433777574/95B164303B56/index.htm#>




Generic problems with Java SE (20+)

Werner Keil 10/13/2014

Re: Generic problems with Java SE (20+)

Martin Desruisseaux 10/14/2014

Re: Generic problems with Java SE (20+)

Werner Keil 10/14/2014

Re: Generic problems with Java SE (20+)

Martin Desruisseaux 10/14/2014

Re: Generic problems with Java SE (20+)

Werner Keil 10/14/2014

Re: Generic problems with Java SE (20+)

Martin Desruisseaux 10/15/2014

Re: Generic problems with Java SE (20+)

Werner Keil 10/15/2014
 
 
Close
loading
Please Confirm
Close