Skip to content
Browse files

More meaningful error when mapping modules to heatmap with repeated r…

…ow names.
  • Loading branch information...
1 parent 6b3d9c5 commit ae61205b10bb5d2e609a4fc3ca28a166dcada3a6 @mpschr mpschr committed Apr 18, 2012
View
10 gitools-core/src/main/java/org/gitools/persistence/text/ModuleMapText2CPersistence.java
@@ -54,9 +54,13 @@ public ModuleMap read(File file, IProgressMonitor monitor) throws PersistenceExc
if (isItemNamesFilterEnabled()) {
String[] itemNames = getItemNames();
- for (int i = 0; i < itemNames.length; i++)
- itemNameToRowMapping.put(itemNames[i], i);
- }
+ for (int i = 0; i < itemNames.length; i++) {
+ if (itemNameToRowMapping.containsKey(itemNames[i]))
+ throw new PersistenceException("Modules not mappable to heatmap due to duplicated row: " + itemNames[i]);
+ else
+ itemNameToRowMapping.put(itemNames[i], i);
+ }
+ }
// map between modules and item indices

0 comments on commit ae61205

Please sign in to comment.
Something went wrong with that request. Please try again.