Community
Participate
Working Groups
Start RSE on fresh, clean workspace. Create a new dstore-windows connection to localhost with daemon in Team profile. No filters are created (see bug 142712). Select file subsystem, right-click > New > Filter - filter path = "." - filter name = "My Home" - filter profile = "Team" Press Next, Finish. The filter is shown twice. This may be related to bug 160394. -----------Enter bugs above this line----------- TM 2.0M5 Testing installation : eclipse-SDK-3.3M5 (I20070209-1006), cdt-4.0M5, emf-2.3M5 RSE install : RSE-SDK I20070219-1645 + discovery + efs java.runtime : Sun 1.4.2_13 os.name: : Windows XP 5.1, Service Pack 1 ------------------------------------------------ systemtype : Unix-ssh / Linux-dstore-processes targetos : Red Hat Enterprise Linux WS release 4 (Nahant Update 3) targetuname : Linux parser.takefive.co.at 2.6.9-34.EL #1 Fri Feb 24 16:44:51 EST 2006 i686 athlon i386 GNU/Linux targetvm : Sun Java HotSpot(TM) Client VM (build 1.4.2_13-b06, mixed mode) ------------------------------------------------
Seen the issue again on Linux. After it was possible to create several filters ok without duplicates, suddenly one was shown twice. This was in the private profile, local file subsystem. After refreshing, the filter was shown once only. Changed the summary accordingly (old value was:) first created filter shown twice on dstore-windows connection in Team profile The reason for this issue might be concurrency issue with multiple refresh jobs at the same time. See bug 160394 for a previous similar issue.
I tried reproducing this today but it seemed okay. Is this still something you see?
Haven't seen this for a while now but haven't tried creating a lot of filters either.
I haven't seen duplicated filters when creating filters normally, but I just tried this and it messed stuff up. Create a new workspace. Create a new filter and give it the name "My Home". It won't say filter name is in use and will let you continue. You will have 2 Drives filters, but they will both point to the same thing. Double clicking on one will open the other. Same thing happens with Drives if you do it before creating any other filter. if you create a new filter first then try to create one with the name Drives it won't let you.
Created attachment 68582 [details] Vector existing lists passed to ValidatorUniqueString are now sorted to be in sync with passing String array existing lists. This patch fixes the issue of being able to create filters with a name that is previously used. I changed ValidatorUniqueString.setExistingNamesList(Vector) to call the init function which sorts the list. This needed to be done because Arrays.binarySearch requires a sorted list and the vector provided was not sorted. It was just in the order that you see in the RSE where My Home is always before Drives. Legal Message: I, Kevin Doyle, declare that I developed attached code from scratch, without referencing any 3rd party materials except material licensed under the EPL. I am authorized by my employer, IBM Canada Ltd. to make this contribution under the EPL.
The patch itself looks fine, but there is another problem in that we are reordering the user passed array in the init method of ValidatorUniqueString. This is not good practice and can have very unintended consequences. It should be fixed as well. Basically a copy of the passed array needs to be made up front in the method. Note that the validators have all been updated to take Collection arguments instead of Vectors - be sure to resynch prior to fixing.
Kevin are there any updates you can make in response to Dave Dykstal's comments?
Setting target milestone RC2 since we have an approved patch.
The array that is sorted is a copy of the original array. String newList[] = new String[existingList.length]; for (int idx=0; idx<existingList.length; idx++) { String string = existingList[idx]; boolean quoted = (string.indexOf(QUOTE) != -1); if (!quoted) newList[idx] = string.toLowerCase(); else newList[idx] = quotedToLowerCase(string); } existingList = newList; } Arrays.sort(existingList); This needs to be done because for determining if a name is in use we use binarySearch and if the array isn't sorted it's not going to work.
(In reply to comment #9) > The array that is sorted is a copy of the original array. > > String newList[] = new String[existingList.length]; > for (int idx=0; idx<existingList.length; idx++) > { > String string = existingList[idx]; > boolean quoted = (string.indexOf(QUOTE) != -1); > if (!quoted) > newList[idx] = string.toLowerCase(); > else > newList[idx] = quotedToLowerCase(string); > } > existingList = newList; > } > Arrays.sort(existingList); > > This needs to be done because for determining if a name is in use we use > binarySearch and if the array isn't sorted it's not going to work. > A copy of the array is made only if the comparison is supposed to be case insensitive, otherwise it sorts the orginal array. It should make a copy regardless and sort that. I'll attached a patch that incorporates your change and the changes to init. Dave M - you'll need to review and commit. Don't forget to update the tm-log.csv file.
Created attachment 69414 [details] sort Collection arguments so they can be binary searched Also rewrote the init method to create a copy of the input array prior to sorting.
The patch looks good to me. I guess I need to log Kevin's original contribution when I apply the patch.
I've applied the patch.
Right if you pass in a String array it doesn't create a copy of the array unless it's not case sensitive, but if you pass in a Collection you convert it into a String array, and then we now make a copy of it again in init. Shouldn't we just make a copy in the setExistingNames(String[]), so that we aren't doing unnecessary copies?
Copying arrays is less expensive than one might think, so I'd like to just keep this as it is for now given that we've got more important things to do.
When checking for bug #197101, I noticed that this bug has actually been turned into tracking a different issue, so I renamed the SUmmary (old value was: [refresh] new filter is shown twice until refreshed)
[target cleanup] 2.0 RC2 was the original target milestone for this bug
Comment on attachment 68582 [details] Vector existing lists passed to ValidatorUniqueString are now sorted to be in sync with passing String array existing lists. Patch ended up being used.