diff --git a/ant/build.properties b/ant/build.properties index e09625a3b..3054cc32a 100644 --- a/ant/build.properties +++ b/ant/build.properties @@ -3,10 +3,9 @@ eclipse.home=${env.ECLIM_ECLIPSE_HOME} eclim.gvim=/usr/bin/gvim eclim.gvim.embed=true -javac.target=1.8 +javac.target=11 javac.deprecation=false -javac.compilerargs= -test.javac.target=1.8 +test.javac.target=11 build.classes=build/temp/classes build.features=build/temp/eclipse/features diff --git a/doc/content/changes.rst b/doc/content/changes.rst index 7b0794062..280841216 100644 --- a/doc/content/changes.rst +++ b/doc/content/changes.rst @@ -21,6 +21,10 @@ History of Changes x.x.x (Xxx. xx, 2020) --------------------- +Eclim: + - Eclim updated for Eclipse 4.17 (2020-09), so java 11 or newer is also + required. + Removals: .. note:: diff --git a/installer/install.bin b/installer/install.bin index 95d3580ed..f960acb1c 100644 --- a/installer/install.bin +++ b/installer/install.bin @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright (C) 2017 - 2018 Eric Van Dewoestine +# Copyright (C) 2017 - 2020 Eric Van Dewoestine # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -52,7 +52,7 @@ fi # validate minimum java version # Note: see eclimd as well -JAVA_REQUIRED=8 +JAVA_REQUIRED=11 if [[ $JAVA_VERSION -lt $JAVA_REQUIRED ]] ; then echo "You must have at least java $JAVA_REQUIRED installed to run eclimd." echo "Note: you can still target previous java versions on a per project basis." diff --git a/org.eclim.core/java/org/eclim/plugin/core/PluginResources.java b/org.eclim.core/java/org/eclim/plugin/core/PluginResources.java index 3020b17cc..4036fbaf8 100644 --- a/org.eclim.core/java/org/eclim/plugin/core/PluginResources.java +++ b/org.eclim.core/java/org/eclim/plugin/core/PluginResources.java @@ -50,7 +50,9 @@ public void initialize(String name) "General/Project org.eclim.project.copyright" ); - PreferencesOptionHandler handler = new PreferencesOptionHandler( + // FIXME: Eclipse may have smartly removed this annoying feature, so remove + // this block if the nagging dialog never shows up. + /*PreferencesOptionHandler handler = new PreferencesOptionHandler( Preferences.CORE, false); handler.addSupportedPreferences( "org.eclipse.recommenders.news.rcp", @@ -61,7 +63,7 @@ public void initialize(String name) Preferences.addOptionHandler(handler); PreferenceFactory.addOptions(Preferences.CORE, "General org.eclipse.recommenders.news.rcp.newsEnabled ^(true|false)" - ); + );*/ } @Override diff --git a/org.eclim.core/java/org/eclim/plugin/core/command/refactoring/AbstractRefactorCommand.java b/org.eclim.core/java/org/eclim/plugin/core/command/refactoring/AbstractRefactorCommand.java index 9f7c8c5cf..789fc2bbb 100644 --- a/org.eclim.core/java/org/eclim/plugin/core/command/refactoring/AbstractRefactorCommand.java +++ b/org.eclim.core/java/org/eclim/plugin/core/command/refactoring/AbstractRefactorCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2005 - 2017 Eric Van Dewoestine + * Copyright (C) 2005 - 2020 Eric Van Dewoestine * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -37,7 +37,7 @@ import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.SubProgressMonitor; +import org.eclipse.core.runtime.SubMonitor; import org.eclipse.ltk.core.refactoring.Change; import org.eclipse.ltk.core.refactoring.CompositeChange; @@ -81,14 +81,14 @@ public Object execute(CommandLine commandLine) Refactoring refactoring = refactor.refactoring; RefactoringStatus status = refactoring.checkAllConditions( - new SubProgressMonitor(monitor, 4)); + SubMonitor.convert(monitor, 4)); int stopSeverity = RefactoringCore.getConditionCheckingFailedSeverity(); if (status.getSeverity() >= stopSeverity) { throw new RefactorException(status); } - Change change = refactoring.createChange(new SubProgressMonitor(monitor, 2)); - change.initializeValidationData(new SubProgressMonitor(monitor, 1)); + Change change = refactoring.createChange(SubMonitor.convert(monitor, 2)); + change.initializeValidationData(SubMonitor.convert(monitor, 1)); // preview if (commandLine.hasOption(PREVIEW_OPTION)){ @@ -144,7 +144,7 @@ public Object execute(CommandLine commandLine) changeOperation.setUndoManager( RefactoringCore.getUndoManager(), change.getName()); - changeOperation.run(new SubProgressMonitor(monitor, 4)); + changeOperation.run(SubMonitor.convert(monitor, 4)); return rcl.getChangedFiles(); }finally{ workspace.removeResourceChangeListener(rcl); diff --git a/org.eclim/java/org/eclim/eclipse/ui/EclimEditorSite.java b/org.eclim/java/org/eclim/eclipse/ui/EclimEditorSite.java index 21c3b87bd..750003665 100644 --- a/org.eclim/java/org/eclim/eclipse/ui/EclimEditorSite.java +++ b/org.eclim/java/org/eclim/eclipse/ui/EclimEditorSite.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2005 - 2017 Eric Van Dewoestine + * Copyright (C) 2005 - 2020 Eric Van Dewoestine * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -40,7 +40,6 @@ * * @author Eric Van Dewoestine */ -@SuppressWarnings("rawtypes") public class EclimEditorSite implements IEditorSite { @@ -125,21 +124,19 @@ public void setSelectionProvider(ISelectionProvider provider) } @Override - @SuppressWarnings("unchecked") - public Object getAdapter(Class arg0) + public T getAdapter(Class arg0) { return null; } @Override - @SuppressWarnings("unchecked") - public Object getService(Class arg0) + public T getService(Class arg0) { return null; } @Override - public boolean hasService(Class arg0) + public boolean hasService(Class arg0) { return false; } diff --git a/org.eclim/java/org/eclim/plugin/AbstractPluginResources.java b/org.eclim/java/org/eclim/plugin/AbstractPluginResources.java index 3677a1dfd..2b6b60e23 100644 --- a/org.eclim/java/org/eclim/plugin/AbstractPluginResources.java +++ b/org.eclim/java/org/eclim/plugin/AbstractPluginResources.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2005 - 2017 Eric Van Dewoestine + * Copyright (C) 2005 - 2020 Eric Van Dewoestine * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,6 +19,8 @@ import java.io.File; import java.io.InputStream; +import java.lang.reflect.InvocationTargetException; + import java.net.URL; import java.text.MessageFormat; @@ -96,11 +98,14 @@ public Command getCommand(String name) } Class cc = commands.get(name); try{ - return cc.newInstance(); - }catch(IllegalAccessException iae){ - throw new RuntimeException(iae); - }catch(InstantiationException ie){ - throw new RuntimeException(ie); + return cc.getDeclaredConstructor().newInstance(); + }catch( + IllegalAccessException| + InstantiationException| + InvocationTargetException| + NoSuchMethodException e) + { + throw new RuntimeException(e); } } diff --git a/org.eclim/java/org/eclim/plugin/Plugin.java b/org.eclim/java/org/eclim/plugin/Plugin.java index 2f4ed8a79..3dcee8ac5 100644 --- a/org.eclim/java/org/eclim/plugin/Plugin.java +++ b/org.eclim/java/org/eclim/plugin/Plugin.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2005 - 2017 Eric Van Dewoestine + * Copyright (C) 2005 - 2020 Eric Van Dewoestine * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -115,7 +115,7 @@ public void activate(BundleContext context) Bundle bundle = this.getBundle(); try{ PluginResources resources = (PluginResources) - bundle.loadClass(resourceClass).newInstance(); + bundle.loadClass(resourceClass).getDeclaredConstructor().newInstance(); logger.debug("{}: initializing resources", name); resources.initialize(name); Services.addPluginResources(resources); diff --git a/org.eclim/java/org/eclim/util/file/FileOffsets.java b/org.eclim/java/org/eclim/util/file/FileOffsets.java index 0a1b6eb82..f280cc9bf 100644 --- a/org.eclim/java/org/eclim/util/file/FileOffsets.java +++ b/org.eclim/java/org/eclim/util/file/FileOffsets.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2005 - 2014 Eric Van Dewoestine + * Copyright (C) 2005 - 2020 Eric Van Dewoestine * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -95,7 +95,7 @@ private void compileOffsets(InputStream in) reader = new BufferedReader(new InputStreamReader(in)); ArrayList lines = new ArrayList(); - lines.add(new Integer(0)); + lines.add(Integer.valueOf(0)); ArrayList byteLines = new ArrayList(); byteLines.add(null); @@ -103,7 +103,7 @@ private void compileOffsets(InputStream in) String line = null; while((line = reader.readLine()) != null){ offset += line.length(); - lines.add(new Integer(offset)); + lines.add(Integer.valueOf(offset)); if (line.length() != line.getBytes().length){ byteLines.add(line); }else{