| Summary: | Content type lookup fails for extensions containing a dot "." | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [ECD] Orion | Reporter: | Mark Macdonald <mamacdon> | ||||
| Component: | Client | Assignee: | Curtis Windatt <curtis.windatt.public> | ||||
| Status: | RESOLVED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | curtis.windatt.public | ||||
| Version: | 5.0 | ||||||
| Target Milestone: | 7.0 | ||||||
| Hardware: | PC | ||||||
| OS: | Windows 7 | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
Mark Macdonald
Created attachment 247175 [details]
Fix
The attached patch fixes the problem and adds tests for it. However, I am getting numerous errors when self hosting. They should be unrelated, but I don't want to commit this change without testing the large existing suite of content types. I am updating the wiki to reflect the change. The logic used is: 1) Loop through all content types, if a filename match is found, break immediately, otherwise if an extension matches the longest possible extension (first dot in the filename), use it. 2) Reduce the extension size compared, segment by segment, each time looping through the content types, break if a match is found. We check the content type for every file visible in the navigator and for each we check every content type registered (>30). Add in checking extensions segment by segment (directories often use dots as package names), and this is a lot of iterations. 1) Short circuit when a filename match is found (this is done in my patch) 2) Recognize directories as such, and not query the content types. http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=41298cbaf822d0241f0ffdadcba1821b1ab3ac30 Fixed in master I was able to test correctly after logging out, logging back in, clearing the browser resources and restarting my site. No problems with the content types. I opened Bug 444531 to continue the discussion of content type checking for directories. |