KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Please refer to the following method : public Set<LIMSGridCell> getCellsInColumn(String columnIndex){ Map<String,LIMSGridCell> cellsMap = getCellsMap(); Set<LIMSGridCell> cells = new HashSet<LIMSGridCell>(); Set<String> keySet = cellsMap.keySet(); for(String key: keySet){ if(key.startsWith(columnIndex)){ cells.add(cellsMap.get(key)); } } return cells; } FindBugs give this waring message : " Inefficient use of keySet iterator instead of entrySet iterator This method accesses the value of a Map entry, using a key that was retrieved from a keySet iterator. It is more efficient to use an iterator on the entrySet of the map, to avoid the Map.get(key) lookup."
Tags (comma-separated)
Save Edits
Cancel