问题
I am trying to read the last value corresponding to a duplicate key in my mail.properties file. The properties file body looks like :
//other key/values properties
mail.body=body1
mail.subject=Reminder
mail.body=body2
mail.body=body3
//other key/values properties
The mail.properties is a result of the concatenation of many properties files at build time. The present evolution requires that I read the last mail.subject
and mail.body
key/value entries. Thus the normal behavior of my resourceBundle.getString("mail.body")
should return body3 but it returns body2 instead. I have double checked if I am reading the right file and it seems that everything is correct. What could be the reason behind this abnormal behavior ?
来源:https://stackoverflow.com/questions/49366941/unable-to-read-the-last-duplicate-key-of-a-properties-file