tmf: Fix opening symbol config dialog for experiments
authorAlexandre Montplaisir <alexmonthy@efficios.com>
Sat, 9 Apr 2016 22:27:11 +0000 (18:27 -0400)
committerAlexandre Montplaisir <alexmonthy@efficios.com>
Mon, 11 Apr 2016 20:10:20 +0000 (16:10 -0400)
An ArrayIndexOutOfBounds exception could be thrown when opening
the symbol mapping configuration dialog in the context of a
multi-trace experiment. Index "-1" would be passed to
updateMessage(int).

When the window is first opened, the selection index is at -1,
simply skip the updateMessage() in this case.

Change-Id: I43b384016ec7dfff1b16b272b34155579bc101cc
Signed-off-by: Alexandre Montplaisir <alexmonthy@efficios.com>
Reviewed-on: https://git.eclipse.org/r/70314
Reviewed-by: Hudson CI
Reviewed-by: Robert Kiss <robert.kiss@gmail.com>
tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/symbols/SymbolProviderConfigDialog.java

index f85f4ef5bcca33a025433337126923bfe2267551..898e1598e18b98dbf4a071bd69698fa5f4e13214 100644 (file)
@@ -172,8 +172,11 @@ public class SymbolProviderConfigDialog extends TitleAreaDialog implements IPref
     public void updateMessage() {
         if (fTabFolder == null) {
             updateMessage(0);
-        } else {
-            updateMessage(fTabFolder.getSelectionIndex());
+            return;
+        }
+        int curSelectionIndex = fTabFolder.getSelectionIndex();
+        if (curSelectionIndex >= 0) {
+            updateMessage(curSelectionIndex);
         }
     }
 
This page took 0.026537 seconds and 5 git commands to generate.