Skip to content

Commit 1fb027a

Browse files
author
Neha Burnwal
committed
Caught the exception when a version is malformed in target file
1 parent 753c00b commit 1fb027a

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
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
@@ -3218,6 +3218,8 @@ public class PDEUIMessages extends NLS {
32183218

32193219
public static String TargetEditor_6;
32203220

3221+
public static String TargetEditor_7;
3222+
32213223
public static String FeatureImportWizardPage_importHasInvalid;
32223224

32233225
public static String ProductInfoSection_plugins;

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

Lines changed: 5 additions & 1 deletion
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

@@ -557,7 +561,7 @@ private ITargetDefinition loadTargetDefinition() throws CoreException {
557561
ITargetHandle externalTarget = service.getTarget(((IURIEditorInput) fInput).getURI());
558562
fTarget = externalTarget.getTargetDefinition();
559563
}
560-
} catch (CoreException e) {
564+
} catch (CoreException | IllegalArgumentException e) {
561565
fTarget = service.newTarget();
562566
throw e;
563567
}

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
@@ -1998,6 +1998,7 @@ TargetEditor_3=Unable to perform save
19981998
TargetEditor_4=Target Editor
19991999
TargetEditor_5=Unable to load target definition model. Fix the target definition model in Source View.
20002000
TargetEditor_6=The editor input ''{0}'' is not supported.
2001+
TargetEditor_7=Unable to parse the IU version. Fix the target definition model in Source View.
20012002
TargetCreationPage_0=Initialize the target definition with:
20022003
TargetCreationPage_1=Nothing: Start &with an empty target definition
20032004
TargetCreationPage_2=&Default: Default target for the running platform

0 commit comments

Comments
 (0)