From: <th...@us...> - 2009-03-30 23:36:21
|
Revision: 9800 http://pcgen.svn.sourceforge.net/pcgen/?rev=9800&view=rev Author: thpr Date: 2009-03-30 23:36:12 +0000 (Mon, 30 Mar 2009) Log Message: ----------- For Trunk CHOOSE:CLASS|TYPE=x improper list [_exp 12527] - ID: 2700662 This is a "minimal" fix that is at least non-controvertial (ignores whether CHOOSE:CLASS should return subclasses, this just recognizes that the base class should be legal if ALLOWBASECLASS is true) Issue#: 2700662 Modified Paths: -------------- Trunk/pcgen/code/src/java/pcgen/core/chooser/ClassChoiceManager.java Modified: Trunk/pcgen/code/src/java/pcgen/core/chooser/ClassChoiceManager.java =================================================================== --- Trunk/pcgen/code/src/java/pcgen/core/chooser/ClassChoiceManager.java 2009-03-30 23:34:26 UTC (rev 9799) +++ Trunk/pcgen/code/src/java/pcgen/core/chooser/ClassChoiceManager.java 2009-03-30 23:36:12 UTC (rev 9800) @@ -29,6 +29,7 @@ import java.util.StringTokenizer; import pcgen.cdom.enumeration.ListKey; +import pcgen.cdom.enumeration.ObjectKey; import pcgen.cdom.enumeration.Type; import pcgen.core.Globals; import pcgen.core.PCClass; @@ -88,13 +89,14 @@ { availableList.add(aSubClass); } - } else + } + if (aClass.getSafe(ObjectKey.ALLOWBASECLASS)) { availableList.add(aClass); } } - } else - if(choice.startsWith("TYPE=")) + } + else if (choice.startsWith("TYPE=")) { StringTokenizer tok2 = new StringTokenizer(choice.substring(5), "."); List<Type> typeList = new ArrayList<Type>(); @@ -113,14 +115,16 @@ { availableList.add(aSubClass); } - } else + } + if (aClass.getSafe(ObjectKey.ALLOWBASECLASS)) { availableList.add(aClass); } } } - } else - { + } + else + { int dotLoc = choice.indexOf("."); if(dotLoc == -1) { @@ -136,8 +140,9 @@ } } } - } else - { + } + else + { String substring = choice.substring(0, dotLoc); PCClass aClass = refContext.silentlyGetConstructedCDOMObject(PCClass.class, substring); if(aClass != null) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |