Details
-
Improvement
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
9.0
-
None
-
None
-
Linux
Description
The InstantiatingIterator contains following code:
String[] steps = createSteps();
for (int i = 0; i < panels.size(); i++) {
Component c = panels.get.getComponent();
if (steps[i] == null)
Here, "steps" is used as a zero-based array.
It uses following method:
private String[] createSteps() {
String[] beforeSteps = (String[])wizard.getProperty("WizardPanel_contentData");
assert beforeSteps != null : "This wizard may only be used embedded in the template wizard";
String[] res = new String[(beforeSteps.length - 1) + panels.size()];
for (int i = 0; i < res.length; i++) {
if (i < (beforeSteps.length - 1))
else
{ res[i] = panels.get(i - beforeSteps.length + 1).getComponent().getName(); } }
return res;
}
Here, "steps" has a bias-value (the size of beforeSteps - 1), which seems to be zero in most cases, but the different usage may cause errors if bias > 0.
Probably it should be made clear, what this bias value exactly is, and then it should also be used in the code above, if needed.