I am getting some weird results and can't explain them. Do you have an Idea, why I get
> {Level=1 - Normal, Name=IT/Java}
> {Level=2 - Medium, Name=IT/Ruby}
> [{Level=2 - Medium, Name=IT/Ruby}, {Level=2 - Medium, Name=IT/Ruby}]
from the sysos? when it should actually be
> {Level=1 - Normal, Name=IT/Java}
> {Level=2 - Medium, Name=IT/Ruby}
> [{Level=1 - Normal, Name=IT/Java}, {Level=2 - Medium, Name=IT/Ruby}]
Here's my Code.
public List<Map<String, Object>> getMapsforTables() {
levelList = this.getSkilllevel();
description = this.getSkillnames();
Map<String, Object> rm = new HashMap<String, Object>();
List<Map<String, Object>> l = new LinkedList<Map<String, Object>>();
for(int i=0; i < levelList.size(); i++){
rm.clear();
rm.put("Name", description.get(i));
rm.put("Level", levelList.get(i));
System.out.println(rm);
l.add(rm);
}
System.out.println(l);
return l;
}