Skip to content

Commit a606e61

Browse files
author
Neha Burnwal
committed
Caught the exception when a version is malformed in target file
1 parent 7444c3f commit a606e61

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/PDEUIMessages.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3212,6 +3212,8 @@ public class PDEUIMessages extends NLS {
32123212

32133213
public static String TargetEditor_6;
32143214

3215+
public static String TargetEditor_7;
3216+
32153217
public static String FeatureImportWizardPage_importHasInvalid;
32163218

32173219
public static String ProductInfoSection_plugins;

ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/targetdefinition/TargetEditor.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,10 @@ protected void pageChange(int newPageIndex) {
195195
setActivePage(fSourceTabIndex);
196196
CoreException ce = new CoreException(Status.error(e.getMessage(), e));
197197
showError(PDEUIMessages.TargetEditor_5, ce);
198+
} catch (IllegalArgumentException e) {
199+
setActivePage(fSourceTabIndex);
200+
CoreException ce = new CoreException(Status.error(e.getMessage(), e));
201+
showError(PDEUIMessages.TargetEditor_7, ce);
198202
}
199203
}
200204

@@ -560,6 +564,9 @@ private ITargetDefinition loadTargetDefinition() throws CoreException {
560564
} catch (CoreException e) {
561565
fTarget = service.newTarget();
562566
throw e;
567+
} catch (IllegalArgumentException e) {
568+
fTarget = service.newTarget();
569+
throw new CoreException(Status.error(e.getMessage(), e));
563570
}
564571
PlatformUI.getWorkbench().getDisplay().asyncExec(
565572
() -> TargetEditor.this.getTargetChangedListener().contentsChanged(fTarget, this, true, false));

ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/pderesources.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1994,6 +1994,7 @@ TargetEditor_3=Unable to perform save
19941994
TargetEditor_4=Target Editor
19951995
TargetEditor_5=Unable to load target definition model. Fix the target definition model in Source View.
19961996
TargetEditor_6=The editor input ''{0}'' is not supported.
1997+
TargetEditor_7=Unable to parse the IU version
19971998
TargetCreationPage_0=Initialize the target definition with:
19981999
TargetCreationPage_1=Nothing: Start &with an empty target definition
19992000
TargetCreationPage_2=&Default: Default target for the running platform

0 commit comments

Comments
 (0)