Skip to content

Commit

Permalink
log error on duplicate module
Browse files Browse the repository at this point in the history
  • Loading branch information
oniatus committed Aug 27, 2016
1 parent f45705c commit 82fb278
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import com.google.common.collect.Table;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.terasology.naming.Name;
import org.terasology.naming.Version;

Expand All @@ -37,6 +39,8 @@
*/
public class TableModuleRegistry implements ModuleRegistry {

private static final Logger LOG = LoggerFactory.getLogger(TableModuleRegistry.class);

private final Table<Name, Version, Module> modules = HashBasedTable.create();
private final Map<Name, Module> latestModules = Maps.newHashMap();

Expand All @@ -50,6 +54,12 @@ public boolean add(Module module) {
latestModules.put(module.getId(), module);
}
return true;
} else {
LOG.error("Module {}-{} already registered from {}, cannot register same module from {}",
module.getId(),
module.getVersion(),
modules.get(module.getId(), module.getVersion()).getLocations(),
module.getLocations());
}
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version=5.1.3-SNAPSHOT
version=5.1.2-SNAPSHOT

0 comments on commit 82fb278

Please sign in to comment.