Bug 125905 - Exceptions and instability after setting a File content type for file without extension ("*.") in Preferences -> Team->File Content
Summary: Exceptions and instability after setting a File content type for file without...
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Team (show other bugs)
Version: 3.1   Edit
Hardware: Macintosh Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: 3.3 RC1   Edit
Assignee: Krzysztof Daniel CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2006-01-31 14:40 EST by Francois Granade CLA
Modified: 2007-07-29 09:18 EDT (History)
2 users (show)

See Also:
Michael.Valenta: review+


Attachments
Exception stacks copied from the Error Log view. (18.19 KB, text/plain)
2006-01-31 14:43 EST, Francois Granade CLA
no flags Details
Validator added (2.87 KB, patch)
2007-05-08 10:22 EDT, Krzysztof Daniel CLA
no flags Details | Diff
Fix (2.93 KB, patch)
2007-05-09 03:06 EDT, Krzysztof Daniel CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Francois Granade CLA 2006-01-31 14:40:44 EST
Nothing prevented me from setting a File Content for files without extension (*.) in the Team -> File Content. But it caused all sorts of exception (JFace Steps to reproduce:

- select Preferences -> Team -> File Content
- press "Add Extension"
- enter "*" (star), "OK"
- click "Apply" or "OK"
- See exception dialog

A workaround is to quit Eclipse, delete a few files (the ones with "team") in <workspace>/.metadata/plugins/org.eclipse.core.runtime/.settings, and restart eclipse

Note that this is 3.1, I haven't tried on more recent builds.
Comment 1 Francois Granade CLA 2006-01-31 14:43:19 EST
Created attachment 33879 [details]
Exception stacks copied from the Error Log view.
Comment 2 Michael Valenta CLA 2007-05-07 15:11:43 EDT
The problem is in how the extensions are read from the preference setting. I think the proper solution for 3.3 is to prevent * from being entered as a file extension. I don't think that wildcards are even supported so we could even detect and prevent any value that contains a *.
Comment 3 Krzysztof Daniel CLA 2007-05-08 04:38:46 EDT
WORKSFORME.

Wildcards are supported :).

But if we have dirty projects (uncommited files) and we ignore all using * filter, project still are marked as dirty...
Comment 4 Michael Valenta CLA 2007-05-08 09:06:44 EDT
I think the steps in the original description aren't quite right. Try this:

1) select Preferences -> Team -> File Content
2) press "Add Extension"
3) enter "*" (star), "OK"
4) click "Apply" or "OK"
5) Restart Eclipse
6) select Preferences -> Team -> File Content

You should get an exception in this scenario. We need to prevent the file extsnion from being a * (star).
Comment 5 Krzysztof Daniel CLA 2007-05-08 10:22:50 EDT
Created attachment 66289 [details]
Validator added

I still cannot reproduce - everything works just fine.

But I have added validator.
Comment 6 Michael Valenta CLA 2007-05-08 12:46:19 EDT
You added the check to the Add Name dialog. The problem occurs for the Add Extension button. I think we should have the check for both.
Comment 7 Krzysztof Daniel CLA 2007-05-09 03:06:51 EDT
Created attachment 66407 [details]
Fix

 I have checked this once more and I was obviously looking in the wrong place - sorry for the problem.

The problem was, that extension could be entered in 3 formats:
*.extension, .extension or extension.
The start characters * and . was removed, so when the user entered *, empty string was written to preferences and this is the root cause.

Now the patch is correct - * and *. and . are not completed pattern.
Comment 8 Michael Valenta CLA 2007-05-09 09:51:03 EDT
Patch reviewed and released.
Comment 9 Eclipse Webmaster CLA 2007-07-29 09:18:53 EDT
Changing OS from Mac OS to Mac OS X as per bug 185991