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:
parent
f279673643
commit
622923ed86
1 changed files with 7 additions and 5 deletions
|
@ -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;
|
||||||
|
|
Loading…
Add table
Reference in a new issue