commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jon Harper <jon.harpe...@gmail.com>
Subject [digester] MultiVariableExpander Using upper bounded wildcards
Date Fri, 04 Nov 2016 16:09:37 GMT
Hello,

Apologies if this has already been discussed. I searched the mailing lists
and issue tracker but couldn't find any references.

I'm using MultiVariableExpander, and the compilation of my code, which was
working with 1.8.1, starting failing with digester 2.0 (it also fails with
digester3):
incompatible types: java.util.Map<java.lang.String,java.lang.String> cannot
be converted to java.util.Map<java.lang.String,java.lang.Object>

Since the source maps in the MultiVariableExpander are read only, it is
possible to use upper bounded wildcards ("? extends Object") to avoid
breaking existing code (and more generally support more input types). See
the following patch: http://pastebin.com/vJE69CiV

There are probably other places where this would be useful.

Has this already been examined ? Is this something you want to fix ? Is
there a problem with using upper bounded wildcards ?

Cheers,
Jon

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message