| Summary: | CharsetManager#getCharsetFor can't return null, if 'recurse' is true | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Deepak Azad <deepakazad> | ||||||
| Component: | Resources | Assignee: | Szymon Brandys <Szymon.Brandys> | ||||||
| Status: | VERIFIED FIXED | QA Contact: | |||||||
| Severity: | major | ||||||||
| Priority: | P3 | CC: | daniel_megert, markus.kell.r, sptaszkiewicz | ||||||
| Version: | 3.7 | ||||||||
| Target Milestone: | 3.7 M5 | ||||||||
| Hardware: | All | ||||||||
| OS: | All | ||||||||
| Whiteboard: | |||||||||
| Bug Depends on: | |||||||||
| Bug Blocks: | 333416 | ||||||||
| Attachments: |
|
||||||||
|
Description
Deepak Azad
The suite already timed out earlier (N20101202-2000), see http://dev.eclipse.org/mhonarc/lists/platform-releng-dev/msg17739.html , but in later builds, it worked again. I've now downloaded the test framework and ran the tests like they are run at eclipse.org. The test hangs in RenamePackageTests.test2 with an "Undo Problem" dialog. I'm looking for a solution. Error message: 'Rename Package' cannot be undone. Reason: Cannot determine the character encoding of 'TestProject3272168128112312/src/r/A.java'. Stacktrace: "main" prio=6 tid=0x007aa000 nid=0x13bc runnable [0x0024e000] java.lang.Thread.State: RUNNABLE at org.eclipse.swt.internal.win32.OS.WaitMessage(Native Method) at org.eclipse.swt.widgets.Display.sleep(Display.java:4576) at org.eclipse.jface.window.Window.runEventLoop(Window.java:826) at org.eclipse.jface.window.Window.open(Window.java:801) at org.eclipse.jface.dialogs.MessageDialog.open(MessageDialog.java:334) at org.eclipse.ui.internal.operations.AdvancedValidationUserApprover.reportAndInterpretStatus(AdvancedValidationUserApprover.java:385) at org.eclipse.ui.internal.operations.AdvancedValidationUserApprover.access$2(AdvancedValidationUserApprover.java:283) at org.eclipse.ui.internal.operations.AdvancedValidationUserApprover$1.run(AdvancedValidationUserApprover.java:211) at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:179) at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:150) at org.eclipse.swt.widgets.Display.syncExec(Display.java:4607) at org.eclipse.ui.internal.operations.AdvancedValidationUserApprover.proceedWithOperation(AdvancedValidationUserApprover.java:201) at org.eclipse.ui.internal.operations.AdvancedValidationUserApprover.proceedUndoing(AdvancedValidationUserApprover.java:159) at org.eclipse.core.commands.operations.DefaultOperationHistory.getUndoApproval(DefaultOperationHistory.java:824) at org.eclipse.core.commands.operations.DefaultOperationHistory.doUndo(DefaultOperationHistory.java:413) at org.eclipse.core.commands.operations.DefaultOperationHistory.undoOperation(DefaultOperationHistory.java:1298) at org.eclipse.ltk.internal.core.refactoring.UndoManager2.performUndo(UndoManager2.java:188) at org.eclipse.jdt.ui.tests.refactoring.RenamePackageTests.performUndo(RenamePackageTests.java:439) at org.eclipse.jdt.ui.tests.refactoring.RenamePackageTests.test2(RenamePackageTests.java:1117) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at junit.framework.TestCase.runTest(TestCase.java:168) at junit.framework.TestCase.runBare(TestCase.java:134) at junit.framework.TestResult$1.protect(TestResult.java:110) RenamePackageTests works fine with v20101213 of org.eclipse.core.resources but fails with HEAD. The problem is caused by the fix for bug 207510. Szymon, please investigate. The bug is in org.eclipse.core.internal.resources.CharsetManager.getCharsetFor(IPath, boolean): The call to "workspace.getRoot().findMember(resourcePath)" is bad. If 'recurse' is true, the method must recurse up to the workspace root and must not return null. Call stack from the test (we call "file.getCharset(true)"): CharsetManager.getCharsetFor(IPath, boolean) line: 277 File.getCharset(boolean) line: 214 ModificationStampValidationState(BufferValidationState).<init>(IFile) line: 150 ... > Call stack from the test (we call "file.getCharset(true)"):
... where 'file' does *not* exist.
Created attachment 185739 [details]
The simples patch
Created attachment 185858 [details]
Fix v02
The fix and test is in HEAD. Verified by code inspection. |