| Summary: | IllegalArgumentException when recording using a workspace with different URI schemes. | ||||||
|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | Paul Slauenwhite <paulslau> | ||||
| Component: | TPTP | Assignee: | Paul Slauenwhite <paulslau> | ||||
| Status: | CLOSED FIXED | QA Contact: | Kathy Chan <kathy> | ||||
| Severity: | critical | ||||||
| Priority: | P1 | CC: | ewchan, kathy, paulslau | ||||
| Version: | unspecified | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | All | ||||||
| OS: | All | ||||||
| Whiteboard: | adopter | ||||||
| Attachments: |
|
||||||
Kathy/Eugene: Please review the Platform/Trace project for calls of org.eclipse.core.resources.IResource.getRawLocationURI() and org.eclipse.core.resources.IResource.getLocationURI() that expect the file URI scheme. Created attachment 163008 [details]
Patch.
Added two new test cases to /org.eclipse.hyades.test.URLTest.tests/manual/basic_tests/Test.Agents.Recorder.testsuite. The attached patch checked in to CVS (HEAD). (In reply to comment #1) > Kathy/Eugene: Please review the Platform/Trace project for calls of > org.eclipse.core.resources.IResource.getRawLocationURI() and > org.eclipse.core.resources.IResource.getLocationURI() that expect the file URI > scheme. I scanned the Platform/Trace project code and there is no call on the api. Thanks Paul for pointing this out. Verified in consuming product. Closing. |
IllegalArgumentException when recording using a workspace with different URI schemes. When URL recording using a workspace with different URI schemes (for example, a Jazz client that uses sourcecontrol://jazz/default/<plug-in name>/...), the following exception is thrown: java.lang.IllegalArgumentException: URI scheme is not "file" at java.io.File.<init>(File.java:366) at org.eclipse.hyades.internal.execution.recorder.utilities.RecorderFileUtil.fileExists(RecorderFileUtil.java:149) at org.eclipse.tptp.test.provisional.recorder.ui.wizards.DefaultRecWizardProvider.doFinish(DefaultRecWizardProvider.java:80) ... The reason is that org.eclipse.hyades.internal.execution.recorder.utilities.RecorderFileUtil.fileExists(IFile) (and org.eclipse.hyades.internal.execution.recorder.utilities.RecorderFileUtil.deleteFiles(IFile, IFile)) use org.eclipse.core.resources.IResource.getRawLocationURI() to create a new java.io.File from the org.eclipse.core.resources.IFile. We need to remove all uses of org.eclipse.core.resources.IResource.getRawLocationURI() and org.eclipse.core.resources.IResource.getLocationURI() and use the following code for resolving java.io.Files from org.eclipse.core.resources.IFiles: IPath iFilePath = iFile.getLocation(); if (iFilePath != null){ File file = iFilePath.toFile(); }