From 622923ed86abb69569fd33c96334a2f581d8709f Mon Sep 17 00:00:00 2001 From: Andrew Gvozdev Date: Sat, 10 Jul 2010 02:18:57 +0000 Subject: [PATCH] bug 318581: Use of deprecated org.eclipse.core.runtime.PluginVersionIdentifier --- .../cdt/managedbuilder/core/ManagedBuildManager.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java index 45bb05e1dc2..dba0db378bc 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java @@ -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;