Bug 224125 - Clean up target platform helper stripPathInformation method
Summary: Clean up target platform helper stripPathInformation method
Status: RESOLVED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.4 M7   Edit
Assignee: Curtis Windatt CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2008-03-26 11:36 EDT by Curtis Windatt CLA
Modified: 2008-03-30 18:59 EDT (History)
1 user (show)

See Also:


Attachments
Patch (5.93 KB, patch)
2008-03-26 11:36 EDT, Curtis Windatt CLA
no flags Details | Diff
mylyn/context/zip (1.80 KB, application/octet-stream)
2008-03-30 18:59 EDT, Chris Aniszczyk CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Curtis Windatt CLA 2008-03-26 11:36:29 EDT
Created attachment 93619 [details]
Patch

While working on bug 221859, I made some changes to TargetPlatformHelper.stripPathInformation, allowing the helper method to be used in multiple locations.  When making the changes, I made some test cases.

I fleshed out those test cases into a unit test.  Running my tests, I found a couple of problems including a possible NPE.

Changes I made to stripPathInformation, please let me know if these are not valid:
1) If the id ends with '.jar' I remove it since it is not part of the id.
2) If the path is absolute, but the file does not exist (can't get the symbolic name), the method will just use the last segment (we already do the same thing for relative paths).

Patch with test and changes is attached.

More tests for TargetPlatformHelper should be added over time.
Comment 1 Chris Aniszczyk CLA 2008-03-26 11:56:34 EDT
thanks, will get in for M7
Comment 2 Chris Aniszczyk CLA 2008-03-30 18:59:49 EDT
thank you Curtis, this will be in M7

I love people who write test cases.
Comment 3 Chris Aniszczyk CLA 2008-03-30 18:59:51 EDT
Created attachment 94154 [details]
mylyn/context/zip