|
View:
New views
2 Messages
—
Rating Filter:
Alert me
|
|
|
CommandGene bugI think there is a bug in the CommandGene code about the subChildType
management. The constructor never sets m_subChildTypes if specialCase is false and a_childSubTypes exists, so the subChildTypes is never set. public CommandGene(final GPConfiguration a_conf, final int a_arity, final Class a_returnType, final int a_subReturnType, final int[] a_childSubTypes) throws InvalidConfigurationException { this(a_conf, a_arity, a_returnType); if (a_childSubTypes != null) { boolean specialCase = false; // Special case from convenient construction. // ------------------------------------------ if (a_childSubTypes.length == 1) { if (a_childSubTypes[0] == 0) { m_subChildTypes = null; specialCase = true; } } if (!specialCase) { if (a_childSubTypes.length != a_arity) { throw new IllegalArgumentException( "Length of child sub types must equal" + " the given arity (or set the former to null)"); } } else { m_subChildTypes = a_childSubTypes; } } else { m_subChildTypes = a_childSubTypes; } m_subReturnType = a_subReturnType; } should become public CommandGene(final GPConfiguration a_conf, final int a_arity, final Class a_returnType, final int a_subReturnType, final int[] a_childSubTypes) throws InvalidConfigurationException { this(a_conf, a_arity, a_returnType); if (a_childSubTypes != null) { boolean specialCase = false; // Special case from convenient construction. // ------------------------------------------ if (a_childSubTypes.length == 1) { if (a_childSubTypes[0] == 0) { m_subChildTypes = null; specialCase = true; } } if (!specialCase) { if (a_childSubTypes.length != a_arity) { throw new IllegalArgumentException( "Length of child sub types must equal" + " the given arity (or set the former to null)"); } else { m_subChildTypes = a_childSubTypes; } } } else { m_subChildTypes = a_childSubTypes; } m_subReturnType = a_subReturnType; } Do u agree? -- Simone Bronzin Unitary Executive mobile: +39.3939459672 ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ jgap-users mailing list jgap-users@... https://lists.sourceforge.net/lists/listinfo/jgap-users |
|
|
Re: CommandGene bugSimone,
sems as if you are right. Thanx for your detailled report and solution. I will adapt the JGAP core to fix the bug. Best Klaus www.klaus-meffert.com > -----Original Message----- > From: Simone Bronzin [mailto:simone.bronzin@...] > Sent: Monday, August 31, 2009 11:50 AM > To: jgap-users@... > Subject: [jgap-users] CommandGene bug > > I think there is a bug in the CommandGene code about the > subChildType management. > > The constructor never sets m_subChildTypes if specialCase is > false and a_childSubTypes exists, so the subChildTypes is never set. > > public CommandGene(final GPConfiguration a_conf, final int a_arity, > final Class a_returnType, final int > a_subReturnType, > final int[] a_childSubTypes) > throws InvalidConfigurationException { > this(a_conf, a_arity, a_returnType); > if (a_childSubTypes != null) { > boolean specialCase = false; > // Special case from convenient construction. > // ------------------------------------------ > if (a_childSubTypes.length == 1) { > if (a_childSubTypes[0] == 0) { > m_subChildTypes = null; > specialCase = true; > } > } > if (!specialCase) { > if (a_childSubTypes.length != a_arity) { > throw new IllegalArgumentException( > "Length of child sub types must equal" > + " the given arity (or set the former to null)"); > } > } > else { > m_subChildTypes = a_childSubTypes; > } > > } > else { > m_subChildTypes = a_childSubTypes; > } > m_subReturnType = a_subReturnType; > } > > > should become > > public CommandGene(final GPConfiguration a_conf, final int a_arity, > final Class a_returnType, final int > a_subReturnType, > final int[] a_childSubTypes) > throws InvalidConfigurationException { > this(a_conf, a_arity, a_returnType); > if (a_childSubTypes != null) { > boolean specialCase = false; > // Special case from convenient construction. > // ------------------------------------------ > if (a_childSubTypes.length == 1) { > if (a_childSubTypes[0] == 0) { > m_subChildTypes = null; > specialCase = true; > } > } > if (!specialCase) { > if (a_childSubTypes.length != a_arity) { > throw new IllegalArgumentException( > "Length of child sub types must equal" > + " the given arity (or set the former to null)"); > } > else { > m_subChildTypes = a_childSubTypes; > } > } > > } > else { > m_subChildTypes = a_childSubTypes; > } > m_subReturnType = a_subReturnType; > } > > Do u agree? > > > -- > > Simone Bronzin > Unitary > Executive > > mobile: +39.3939459672 > > > > -------------------------------------------------------------- > ---------------- > Let Crystal Reports handle the reporting - Free Crystal > Reports 2008 30-Day trial. Simplify your report design, > integration and deployment - and focus on what you do best, > core application coding. Discover what's new with Crystal > Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > jgap-users mailing list > jgap-users@... > https://lists.sourceforge.net/lists/listinfo/jgap-users ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ jgap-users mailing list jgap-users@... https://lists.sourceforge.net/lists/listinfo/jgap-users |
| Free embeddable forum powered by Nabble | Forum Help |