diff --git a/org.eclipse.xtend.ide/src/org/eclipse/xtend/ide/formatting/preferences/FormatterModifyDialog.java b/org.eclipse.xtend.ide/src/org/eclipse/xtend/ide/formatting/preferences/FormatterModifyDialog.java index f65f12c2888..549532d577e 100644 --- a/org.eclipse.xtend.ide/src/org/eclipse/xtend/ide/formatting/preferences/FormatterModifyDialog.java +++ b/org.eclipse.xtend.ide/src/org/eclipse/xtend/ide/formatting/preferences/FormatterModifyDialog.java @@ -96,27 +96,11 @@ public FormatterModifyDialog(Shell parentShell, Profile profile, ProfileManager // @Override intentionally removed to ensure backward compatibility @SuppressWarnings({ "rawtypes", "unchecked" }) protected void addPages(final Map values) { - if (isOldAPIVersion()) { - try { - // use reflection to not break API - Method addTabPage = ModifyDialog.class.getDeclaredMethod("addTabPage", String.class, IModifyDialogTabPage.class); - // addTabPage("Indentation", tabFactory.createIndentationTab(this, values)); - addTabPage.invoke(this, "Braces", tabFactory.createBracesTab(this, values)); - addTabPage.invoke(this, "White Space", tabFactory.createWhiteSpaceTab(this, values)); - addTabPage.invoke(this, "Blank Lines", tabFactory.createBlankLinesTab(this, values)); - addTabPage.invoke(this, "New Lines", tabFactory.createNewLineTab(this, values)); - addTabPage.invoke(this, "Line Wrapping", tabFactory.createLineWrapTab(this, values)); - } catch (NoSuchMethodException | SecurityException | IllegalAccessException | IllegalArgumentException - | InvocationTargetException e) { - XtendActivator.getInstance().getLog().log(new Status(IStatus.ERROR, XtendActivator.PLUGIN_ID, e.getMessage(), e)); - } - } else { - addTabPageNewAPI("Braces", tabFactory.createBracesTab(this, values)); - addTabPageNewAPI("White Space", tabFactory.createWhiteSpaceTab(this, values)); - addTabPageNewAPI("Blank Lines", tabFactory.createBlankLinesTab(this, values)); - addTabPageNewAPI("New Lines", tabFactory.createNewLineTab(this, values)); - addTabPageNewAPI("Line Wrapping", tabFactory.createLineWrapTab(this, values)); - } + addTabPageNewAPI("Braces", tabFactory.createBracesTab(this, values)); + addTabPageNewAPI("White Space", tabFactory.createWhiteSpaceTab(this, values)); + addTabPageNewAPI("Blank Lines", tabFactory.createBlankLinesTab(this, values)); + addTabPageNewAPI("New Lines", tabFactory.createNewLineTab(this, values)); + addTabPageNewAPI("Line Wrapping", tabFactory.createLineWrapTab(this, values)); } // copied from Eclipse Oxygen to support old dialog in Eclipse Photon @@ -131,10 +115,6 @@ private final void addTabPageNewAPI(String title, IModifyDialogTabPage tabPage) @Override public void create() { - if (isOldAPIVersion()) { - super.create(); - return; - } // copied from Eclipse Oxygen to support old dialog in Eclipse Photon super.create(); int lastFocusNr = 0; @@ -164,9 +144,6 @@ public void create() { @Override @SuppressWarnings("rawtypes") protected Control createDialogArea(Composite parent) { - if (isOldAPIVersion()) { - return super.createDialogArea(parent); - } try { // copied from Eclipse Oxygen to support old dialog in Eclipse Photon final Composite composite = new Composite(parent, SWT.NONE); @@ -257,18 +234,4 @@ protected String getHelpContextId() { return null; } - /** - * Check if the old (<= Eclipse Oxygen) API is used or not. - * - * @return true if the Eclipse API is Eclipse Oxygen or older, true for Eclipse Photon or newer. - */ - private boolean isOldAPIVersion() { - try { - ModifyDialog.class.getDeclaredMethod("addPages", Map.class); - return true; - } catch (NoSuchMethodException | SecurityException e) { - return false; - } - } - } diff --git a/org.eclipse.xtext.util/src/org/eclipse/xtext/util/Exceptions.java b/org.eclipse.xtext.util/src/org/eclipse/xtext/util/Exceptions.java index 8f91da81a5e..a1de0cf0a6d 100644 --- a/org.eclipse.xtext.util/src/org/eclipse/xtext/util/Exceptions.java +++ b/org.eclipse.xtext.util/src/org/eclipse/xtext/util/Exceptions.java @@ -34,7 +34,9 @@ public static T throwUncheckedException(Throwable e) { * It is not available on JRE < 1.7 * * @since 2.8 + * @deprecated addSuppressed method is exposed in JRE 1.8 and above. */ + @Deprecated(forRemoval = true) public static void addSuppressed(Throwable owner, Throwable add) { try { Method method = owner.getClass().getMethod("addSuppressed", Throwable.class); diff --git a/org.eclipse.xtext/src/org/eclipse/xtext/formatting2/internal/ConflictingRegionsException.java b/org.eclipse.xtext/src/org/eclipse/xtext/formatting2/internal/ConflictingRegionsException.java index 797f9b7f114..0cd59a7368f 100644 --- a/org.eclipse.xtext/src/org/eclipse/xtext/formatting2/internal/ConflictingRegionsException.java +++ b/org.eclipse.xtext/src/org/eclipse/xtext/formatting2/internal/ConflictingRegionsException.java @@ -30,7 +30,7 @@ public ConflictingRegionsException(String message, Throwable cause, Collection