From 9341bf3dc38b2cc117ffbe12ff057511ed6e046d Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 16 Oct 2014 12:19:14 +0200 Subject: java: when rethrowing, store the original exception Change-Id: I34ce000c48d2d79bfec854c8dd55d12f2bee29c7 --- odk/examples/DevelopersGuide/GUI/DialogDocument.java | 6 ++---- odk/examples/DevelopersGuide/GUI/ImageControlSample.java | 2 +- odk/examples/DevelopersGuide/GUI/UnoDialogSample.java | 2 +- odk/examples/DevelopersGuide/GUI/UnoDialogSample2.java | 2 +- odk/examples/DevelopersGuide/GUI/UnoMenu.java | 4 ++-- 5 files changed, 7 insertions(+), 9 deletions(-) (limited to 'odk/examples/DevelopersGuide/GUI') diff --git a/odk/examples/DevelopersGuide/GUI/DialogDocument.java b/odk/examples/DevelopersGuide/GUI/DialogDocument.java index 570f5b2a78f5..fd5df052b05b 100644 --- a/odk/examples/DevelopersGuide/GUI/DialogDocument.java +++ b/odk/examples/DevelopersGuide/GUI/DialogDocument.java @@ -134,11 +134,9 @@ public class DialogDocument extends UnoDialogSample { aPropertyValues[1] = aPropertyValue; xComponentLoader.loadComponentFromURL(_sUrl, "_self", 0, aPropertyValues); } catch (com.sun.star.lang.IllegalArgumentException ex) { - ex.printStackTrace(); - throw new java.lang.RuntimeException("cannot happen..."); + throw new java.lang.RuntimeException("cannot happen...", ex); } catch (com.sun.star.uno.Exception ex) { - ex.printStackTrace(); - throw new java.lang.RuntimeException("cannot happen..."); + throw new java.lang.RuntimeException("cannot happen...", ex); } } diff --git a/odk/examples/DevelopersGuide/GUI/ImageControlSample.java b/odk/examples/DevelopersGuide/GUI/ImageControlSample.java index 7415b055bb92..d808b78af69a 100644 --- a/odk/examples/DevelopersGuide/GUI/ImageControlSample.java +++ b/odk/examples/DevelopersGuide/GUI/ImageControlSample.java @@ -158,6 +158,6 @@ public class ImageControlSample extends UnoDialogSample{ xGraphic = xGraphicProvider.queryGraphic(aPropertyValues); return xGraphic; }catch (com.sun.star.uno.Exception ex){ - throw new java.lang.RuntimeException("cannot happen..."); + throw new java.lang.RuntimeException("cannot happen...", ex); }} } diff --git a/odk/examples/DevelopersGuide/GUI/UnoDialogSample.java b/odk/examples/DevelopersGuide/GUI/UnoDialogSample.java index 6fa8055d3a11..d2730e0f3e54 100644 --- a/odk/examples/DevelopersGuide/GUI/UnoDialogSample.java +++ b/odk/examples/DevelopersGuide/GUI/UnoDialogSample.java @@ -1240,7 +1240,7 @@ public class UnoDialogSample implements XTextListener, XSpinListener, XActionLis // finally set the created pointer at the windowpeer of the control xControl.getPeer().setPointer(xPointer); } catch (com.sun.star.uno.Exception ex) { - throw new java.lang.RuntimeException("cannot happen..."); + throw new java.lang.RuntimeException("cannot happen...", ex); } } diff --git a/odk/examples/DevelopersGuide/GUI/UnoDialogSample2.java b/odk/examples/DevelopersGuide/GUI/UnoDialogSample2.java index f3ba77ac6206..27c578ba4270 100644 --- a/odk/examples/DevelopersGuide/GUI/UnoDialogSample2.java +++ b/odk/examples/DevelopersGuide/GUI/UnoDialogSample2.java @@ -223,7 +223,7 @@ public class UnoDialogSample2 extends UnoDialogSample { new Object[] {Boolean.FALSE, Integer.valueOf(_nHeight), sName, Integer.valueOf(_nPosX), Integer.valueOf(_nPosY), Boolean.TRUE, Integer.valueOf(_nStep), _sStringItemList, Integer.valueOf(_nWidth)}); m_xDlgModelNameContainer.insertByName(sName, xLBModelMPSet); }catch (com.sun.star.uno.Exception ex) { - throw new java.lang.RuntimeException("cannot happen..."); + throw new java.lang.RuntimeException("cannot happen...", ex); } return xListBox; } diff --git a/odk/examples/DevelopersGuide/GUI/UnoMenu.java b/odk/examples/DevelopersGuide/GUI/UnoMenu.java index 5dbb0154484c..b6e9533ecb8a 100644 --- a/odk/examples/DevelopersGuide/GUI/UnoMenu.java +++ b/odk/examples/DevelopersGuide/GUI/UnoMenu.java @@ -84,7 +84,7 @@ public UnoMenu(XComponentContext _xContext, XMultiComponentFactory _xMCF) { xPopupMenu.addMenuListener(this); }catch( Exception e ) { - throw new java.lang.RuntimeException("cannot happen..."); + throw new java.lang.RuntimeException("cannot happen...", e); } return xPopupMenu; } @@ -102,7 +102,7 @@ public UnoMenu(XComponentContext _xContext, XMultiComponentFactory _xMCF) { xMenuBar.addMenuListener(_xMenuListener); _xTopWindow.setMenuBar(xMenuBar); }catch( Exception e ) { - throw new java.lang.RuntimeException("cannot happen..."); + throw new java.lang.RuntimeException("cannot happen...", e); }} protected void closeDialog(){ -- cgit