Community
Participate
Working Groups
In J2EEFlexProjDeployable.members()... IVirtualComponent vc = ComponentCore.createComponent(getProject()); if (vc != null) { IVirtualFolder vFolder = vc.getRootFolder(); IModuleResource[] mr = getMembers(vFolder, Path.EMPTY); int size = mr.length; for (int j = 0; j < size; j++) { if (!members.contains(mr[j])) // <------- check for existence members.add(mr[j]); } } IContainer[] javaCont = getJavaOutputFolders(); int size = javaCont.length; for (int i = 0; i < size; i++) { IModuleResource[] mr = getMembers(javaCont[i], javaPath, javaPath, javaCont); int size2 = mr.length; for (int j = 0; j < size2; j++) { if (!members.contains(mr[j])) // <----- check for existence members.add(mr[j]); } } Any reason why we must check for existence of an resource before adding it to the member list? Do we expect the getMembers(...) methods to return duplicate resources? Reply from John: With respect to the J2EEFlexProjDeployable, good question, I'm pretty sure the getMembers() should not return duplicates because throughout the code we always try and find the existing folder before adding a new folder. So, those lines may be candidates for removal.
Adding the performance keyword
Changing priority to P2 because we want to consider this for WTP 1.5.1
These checks were put in unecessarily just to be "safe". However, they are causing a performance regression in larger workspaces. The only items we return in the getMembers() list to members() are those which we couldn't find an existing parent for, so there is no need for this check.
Created attachment 47955 [details] Proposed patch
This patch is ready for review. Just removed the contains() checks.
Approve An alternative if the check is ever needed is to switch to using a Set and not a List.
Approve. Don't use a hash; if duplicates are possible stop them from occuring elswhere.
This is released for the 081706 WTP 1.5.1 driver.
verified and close.