Unable to read the last duplicate key of a Properties file

十年热恋 提交于 2019-12-11 04:33:29

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!