struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug Breaux <bre...@us.ibm.com>
Subject Re: s:fielderror not working in Java 8, WebSphere
Date Wed, 23 May 2018 18:31:59 GMT


On 2018/05/23 18:11:34, Yasser Zamani <yasserzamani@apache.org> wrote: 

> Thanks. Could you also check if your IBM JDK 8 is able to run this:
> 
>         java.util.Map<String, List<String>> lhm = new
> java.util.LinkedHashMap<>();
>         Class<? extends LinkedHashMap> c = lhm.getClass();
>         Method m = c.getMethod("keySet");
>         Object ks = m.invoke(lhm);
>         Method m2 = m.getReturnType().getMethod("size");
>         Object s = m2.invoke(ks);
> 
>         System.out.println("COPY ME: " + s);
> 

That actually produces a compile error:

TestForStruts.java:10: error: incompatible types: Class<CAP#1> cannot be converted to
Class<? extends LinkedHashMap>
        Class<? extends LinkedHashMap> c = lhm.getClass();
                                                       ^
  where CAP#1 is a fresh type-variable:
    CAP#1 extends Map from capture of ? extends Map


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message