Skip to content

Commit

Permalink
factory registration duplicates ignored
Browse files Browse the repository at this point in the history
  • Loading branch information
laforge49 committed Dec 15, 2012
1 parent 195f515 commit dca57ce
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


<groupId>org.agilewiki.jactor</groupId> <groupId>org.agilewiki.jactor</groupId>
<artifactId>jactor</artifactId> <artifactId>jactor</artifactId>
<version>4.5.0</version> <version>4.5.1</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>JActor</name> <name>JActor</name>
<description>Lock-free Java Actors</description> <description>Lock-free Java Actors</description>
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/org/agilewiki/jactor/factory/JAFactory.java
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -194,7 +194,8 @@ public void defineActorType(String actorType, Class clazz)
public void registerActorFactory(ActorFactory actorFactory) public void registerActorFactory(ActorFactory actorFactory)
throws Exception { throws Exception {
String actorType = actorFactory.actorType; String actorType = actorFactory.actorType;
if (types.containsKey(actorType)) ActorFactory old = types.get(actorType);
if (old != null && !old.equals(actorFactory))
throw new IllegalArgumentException("Actor type is already defined: " + actorType); throw new IllegalArgumentException("Actor type is already defined: " + actorType);
types.put(actorType, actorFactory); types.put(actorType, actorFactory);
} }
Expand Down

0 comments on commit dca57ce

Please sign in to comment.