From fb42b621b369d1e2e056f0fb1e9f8bf31a901d84 Mon Sep 17 00:00:00 2001 From: Patrick Linskey Date: Sun, 8 Oct 2006 00:55:35 +0000 Subject: [PATCH] avoid duplicate alias key-value pairs. We really need to move this aliasing system to a map at some point. git-svn-id: https://svn.apache.org/repos/asf/incubator/openjpa/trunk@454053 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/openjpa/conf/BrokerFactoryValue.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/openjpa-kernel/src/main/java/org/apache/openjpa/conf/BrokerFactoryValue.java b/openjpa-kernel/src/main/java/org/apache/openjpa/conf/BrokerFactoryValue.java index 170bd3607..5691ab9f6 100644 --- a/openjpa-kernel/src/main/java/org/apache/openjpa/conf/BrokerFactoryValue.java +++ b/openjpa-kernel/src/main/java/org/apache/openjpa/conf/BrokerFactoryValue.java @@ -50,8 +50,12 @@ public class BrokerFactoryValue * of default aliases for new values created after this invocation. */ public static void addDefaultAlias(String alias, String cls) { - _aliases.add(alias); - _aliases.add(cls); + if (_aliases.contains(alias)) { + _aliases.set(_aliases.indexOf(alias), cls); + } else { + _aliases.add(alias); + _aliases.add(cls); + } } /**