1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 14:42:11 +02:00

bug 318581: Use of deprecated org.eclipse.core.runtime.PluginVersionIdentifier

This commit is contained in:
Andrew Gvozdev 2010-07-10 02:18:57 +00:00
parent f279673643
commit 622923ed86

View file

@ -3182,8 +3182,7 @@ public class ManagedBuildManager extends AbstractCExtension {
/**
* @return the version, if 'id' contains a valid version
* Returns null if 'id' does not contain a valid version
* Returns null if 'id' does not contain a version
* or {@code null} otherwise.
*/
public static String getVersionFromIdAndVersion(String idAndVersion) {
@ -3195,11 +3194,14 @@ public class ManagedBuildManager extends AbstractCExtension {
if ( index != -1) {
// Get the version number from tool id.
String version = idAndVersion.substring(index+1);
IStatus status = (IStatus) Version.parseVersion(version);
// If there is a valid version then return 'version'
if ( status.isOK())
try {
// If there is a valid version then return 'version'
Version.parseVersion(version);
return version;
} catch (IllegalArgumentException e) {
// ignore exception and return null
}
}
// If there is no version information or not a valid version, return null
return null;