Hello everybody, i hope somebody can help me with my problem! I give into an Hashmap some objects so that the hashmap has a size of 4 as example. But when i try to get some information about the hashmap with an classmethode i can only get the first entry and the HashMap has the size of 1... The code: Code:java class[...] private HashMap<String, Integer> attributes = new HashMap<String,Integer>(); [...] private HashMap<String, String> loadRawData(List<String> data) { HashMap<String, String> map = new HashMap<String, String>(); if(data != null && !data.isEmpty()) { System.out.print("Länge der Liste:"+data.size()); for(int i=0;i<data.size();i++){ String dstring=data.get(i); dstring = ChatColor.stripColor(dstring); try { String[] kv = dstring.split(": "); map.put(kv[0], kv[1]); System.out.print(kv[0]+" "+ kv[1]); } catch (Exception e) { RPG.getPluginLogger().severe("Error....."); } } } System.out.print("Mapsize:"+map.size()); [...]public boolean hasAttribute(String type) { System.out.print("leer?"+attributes.isEmpty()); System.out.print("Test:"+attributes.get(type)); System.out.print("Groesse der Map:"+attributes.size()); return attributes.containsKey(type); } public int getAttribute(AttributeType type) { int back=0; if (hasAttribute(type.getName())) { back= attributes.get(type.getName()); }else{ back=-1; } System.out.print("back:"+back); return back; } About LoadRawData i put the Informations into the HashMap, about getAttribute i want to get them back... someone an idea why i only can get the first entry back? Thanks, i hope you can understand my English an my code....
"RPG.getPluginLogger().severe("Error.....");" just do e.printStackTrace(); then check on what line the error happened. if you don't know how, here's a tutorial:
There is no error... The only problem is that when i want to get the informations only the first entry is there...