Then I don’t understand why you modified MapMessage to be

public class MapMessage<M extends MapMessage<M, V>, V>
and the getData method returns has the signature

public Map<String, V> getData()

If you are putting arbitrary stuff in the Map then this signature is wrong.

Ralph


> On Jan 11, 2018, at 11:29 PM, Gary Gregory <garydgreg...@gmail.com> wrote:
> 
> Hi Ralph,
> 
> I will have to look at the generics in the morning but my requirement from
> day one is that a MapMessage allow values of any type (String keys are
> fine.) where each value in a MapMessage can be of a different types. A
> specific Appender can decide what to do with the values. Having all Strings
> as values would not be good for all of the use cases I have (JMS, JDBC, and
> MongoDB.) JDBC should pass values down to its prepared statement with
> PreparedStatement.setObject(int,Object) for example. Same idea for MongoDB.
> All this works now, which is nice.
> 
> Gary
> 
> On Thu, Jan 11, 2018 at 9:24 PM, Ralph Goers <ralph.go...@dslextreme.com>
> wrote:
> 
>> In looking at the history MapMessage only supported Strings until you
>> modified it last June. It appears to me you did it incorrectly. You made
>> MapMessage generic but left the put and putAll methods as only supporting
>> String values. I am not sure why you would have done that instead of having
>> them use the same generic.  It also seems to be a problem that you added
>> all these with methods that allow arbitrary crap to be added to the Map
>> despite what the generic declaration says.
>> 
>> Ralph
>> 
>>> On Jan 11, 2018, at 4:28 PM, Gary Gregory <garydgreg...@gmail.com>
>> wrote:
>>> 
>>> I can use one of the with() methods so no big deal.
>>> 
>>> Gary
>>> 
>>> On Thu, Jan 11, 2018 at 4:23 PM, Ralph Goers <ralph.go...@dslextreme.com
>>> 
>>> wrote:
>>> 
>>>> I will have to look but as I recall I did that for a reason.
>>>> 
>>>> Sent from my iPhone
>>>> 
>>>>> On Jan 11, 2018, at 3:37 PM, Gary Gregory <garydgreg...@gmail.com>
>>>> wrote:
>>>>> 
>>>>> It seems to me that:
>>>>> 
>>>>> org.apache.logging.log4j.message.MapMessage.put(String, String)
>>>>> 
>>>>> should really be:
>>>>> 
>>>>> org.apache.logging.log4j.message.MapMessage.put(String, Object)
>>>>> 
>>>>> Thoughts?
>>>>> 
>>>>> Gary
>>>> 
>>>> 
>> 
>> 
>> 

Reply via email to