Summary: | Possibly broken code in TeamContentProviderDescriptor.readExtension(IExtension) | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] Platform | Reporter: | Dani Megert <daniel_megert> | ||||||||
Component: | Team | Assignee: | Szymon Brandys <Szymon.Brandys> | ||||||||
Status: | RESOLVED FIXED | QA Contact: | |||||||||
Severity: | normal | ||||||||||
Priority: | P3 | CC: | Michael.Valenta, tomasz.zarna | ||||||||
Version: | 3.5 | Keywords: | polish | ||||||||
Target Milestone: | 3.5 M4 | ||||||||||
Hardware: | All | ||||||||||
OS: | All | ||||||||||
Whiteboard: | |||||||||||
Attachments: |
|
Description
Dani Megert
2008-11-26 04:05:08 EST
This fancy trick looks like an alternative for the if statement ;-) >This fancy trick looks like an alternative for the if statement ;-)
Does it LOOK LIKE or IS IT?
If it is, then it is a polish bug but otherwise it's simply broken code that needs work and isn't polish.
It looks like. During M5 I'll take a closer look at it. To me, it looks like the code loops through all the elements of the extension until it finds one that is a team content provider. I don't have access to the schema at the moment but it seems to me that the code is valid if the schema allow for multiple unordered elements in the extension, one of which can be a team content provider (or am I missing something?). >To me, it looks like the code loops
The point is that it DOES NOT loop as the first iteration hits the 'break'
Ah, missed that one (and clearly I missed it when I wrote the code too ;-) The intent was what I described in comment 4. >Ah, missed that one
Yeah, we had such code too in our plug-ins. The Dead code analysis is cool!
(In reply to comment #6) > Ah, missed that one (and clearly I missed it when I wrote the code too ;-) The > intent was what I described in comment 4. > Confusing was that break; was added during API cleaning. This is what the commit comment says at least. Thanks Michael. Created attachment 118981 [details]
Fix v01
Created attachment 118982 [details]
Fix v02
Slightly modified fix, added a message shown in a situation when the number of elements is different then 1.
Created attachment 118983 [details]
mylyn/context/zip
Released to HEAD. |