1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 22:52: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 * @return the version, if 'id' contains a valid version
* Returns null if 'id' does not contain a valid version * or {@code null} otherwise.
* Returns null if 'id' does not contain a version
*/ */
public static String getVersionFromIdAndVersion(String idAndVersion) { public static String getVersionFromIdAndVersion(String idAndVersion) {
@ -3195,11 +3194,14 @@ public class ManagedBuildManager extends AbstractCExtension {
if ( index != -1) { if ( index != -1) {
// Get the version number from tool id. // Get the version number from tool id.
String version = idAndVersion.substring(index+1); String version = idAndVersion.substring(index+1);
IStatus status = (IStatus) Version.parseVersion(version);
// If there is a valid version then return 'version' try {
if ( status.isOK()) // If there is a valid version then return 'version'
Version.parseVersion(version);
return version; return version;
} catch (IllegalArgumentException e) {
// ignore exception and return null
}
} }
// If there is no version information or not a valid version, return null // If there is no version information or not a valid version, return null
return null; return null;