Two new abstract methods is necessary to be added to
for the sake of performance enhancement
public void checkChildrenPopulated();
public void getChildrenCount();
Method getChildren() makes copy of children's list and it can be time consuming in case of big amount of children.
The method is called very frequently in order to be sure that children are populated. But the output of the method
isn't used at all. Another case is request of the children's count. In both cases it doesn't make sense to make
children's copy. So it's suggested to introduce two new methods.
The AbstractComponent is an abstract implementation of the Component interface. I put the methods to the class but not
to the interface at first because the performance experiments proofed that it is sufficient. And also it should reduce
impact to backward compatibility. Though I'm quite sure AbstractComponent class is the only direct implementation of
Created attachment 85498 [details]
The diff with the main changes is going to be applied
The diff shows the new methods concrete, not abstract. (Which is good.)
Created attachment 85721 [details]
The corrected diff. I mainly improved javadoc comments and made the version change smaller
Adding new methods doesn't prevent using old style approach - getChildren() or getChildren().size()
So the it doesn't affect any code, which remains unchanged.
Fixed in trunk http://hg.netbeans.org/main/rev/13a148091090
Verified with JUnit tests + verifying different BPEL projects
Integrated into 'main-golden', will be available in build *200908060201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Log: #169510 - Schema model optimization by avoiding array copying
The fix has been ported into the release67_fixes repository.
Verified by Michael Nazarov.