Remove javax.inject usages - unnecessary (#1567)
Signed-off-by: BoykoAlex <alex.boyko@broadcom.com>
This commit is contained in:
@@ -48,6 +48,5 @@ Import-Package: org.eclipse.core.runtime,
|
||||
org.apache.commons.lang3,
|
||||
org.eclipse.osgi.util,
|
||||
org.osgi.framework,
|
||||
javax.inject,
|
||||
org.json
|
||||
Automatic-Module-Name: org.springframework.ide.eclipse.boot.wizard
|
||||
|
||||
@@ -12,8 +12,7 @@ package org.springframework.ide.eclipse.boot.wizard.guides;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
import javax.inject.Provider;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import org.eclipse.jface.dialogs.Dialog;
|
||||
import org.eclipse.jface.layout.GridDataFactory;
|
||||
@@ -223,7 +222,7 @@ public class ChooseTypedContentSection extends WizardPageSection {
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean match(Provider<String> provider) {
|
||||
private boolean match(Supplier<String> provider) {
|
||||
if (matcher == null) {
|
||||
return true; // Search term not set... anything is acceptable.
|
||||
} else {
|
||||
|
||||
@@ -12,7 +12,6 @@ Require-Bundle: org.eclipse.ui;bundle-version="3.115.0",
|
||||
org.apache.httpcomponents.httpclient,
|
||||
org.apache.httpcomponents.httpcore,
|
||||
org.eclipse.wildwebdeveloper.embedder.node
|
||||
Import-Package: javax.inject
|
||||
Bundle-ClassPath: .
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Export-Package: org.springframework.ide.eclipse.xterm,
|
||||
|
||||
@@ -13,8 +13,6 @@ package org.springframework.ide.eclipse.xterm.views;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import org.eclipse.core.resources.ResourcesPlugin;
|
||||
import org.eclipse.jface.action.Action;
|
||||
import org.eclipse.jface.action.IMenuManager;
|
||||
@@ -33,7 +31,6 @@ import org.eclipse.swt.widgets.Display;
|
||||
import org.eclipse.ui.IActionBars;
|
||||
import org.eclipse.ui.IMemento;
|
||||
import org.eclipse.ui.IViewSite;
|
||||
import org.eclipse.ui.IWorkbench;
|
||||
import org.eclipse.ui.PartInitException;
|
||||
import org.eclipse.ui.PlatformUI;
|
||||
import org.eclipse.ui.part.ViewPart;
|
||||
@@ -54,8 +51,6 @@ public class TerminalView extends ViewPart {
|
||||
*/
|
||||
public static final String ID = "org.springframework.ide.eclipse.xterm.views.TerminalView";
|
||||
|
||||
@Inject IWorkbench workbench;
|
||||
|
||||
private Action refreshAction;
|
||||
|
||||
private Browser browser;
|
||||
|
||||
@@ -49,5 +49,4 @@ Import-Package: org.eclipse.core.runtime,
|
||||
com.google.gson.annotations,
|
||||
com.google.gson.reflect,
|
||||
com.google.gson.stream,
|
||||
org.apache.commons.lang3,
|
||||
javax.inject
|
||||
org.apache.commons.lang3
|
||||
|
||||
@@ -15,24 +15,23 @@ import static org.springframework.ide.eclipse.editor.support.util.HtmlSnippet.ra
|
||||
import static org.springframework.ide.eclipse.editor.support.util.HtmlSnippet.text;
|
||||
|
||||
import java.io.InputStream;
|
||||
|
||||
import javax.inject.Provider;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import org.springframework.ide.eclipse.editor.support.EditorSupportActivator;
|
||||
import org.springframework.ide.eclipse.editor.support.util.HtmlSnippet;
|
||||
import org.springsource.ide.eclipse.commons.frameworks.core.util.IOUtil;
|
||||
|
||||
/**
|
||||
* Static methods and convenience constants for creating some 'description providers'.
|
||||
* Static methods and convenience constants for creating some 'description Suppliers'.
|
||||
*
|
||||
* @author Kris De Volder
|
||||
*/
|
||||
public class DescriptionProviders {
|
||||
|
||||
public static final Provider<HtmlSnippet> NO_DESCRIPTION = snippet(italic(text("no description")));
|
||||
public static final Supplier<HtmlSnippet> NO_DESCRIPTION = snippet(italic(text("no description")));
|
||||
|
||||
public static Provider<HtmlSnippet> snippet(final HtmlSnippet snippet) {
|
||||
return new Provider<HtmlSnippet>() {
|
||||
public static Supplier<HtmlSnippet> snippet(final HtmlSnippet snippet) {
|
||||
return new Supplier<HtmlSnippet>() {
|
||||
@Override
|
||||
public String toString() {
|
||||
return snippet.toString();
|
||||
@@ -44,8 +43,8 @@ public class DescriptionProviders {
|
||||
};
|
||||
}
|
||||
|
||||
public static Provider<HtmlSnippet> fromClasspath(final Class<?> klass, final String resourcePath) {
|
||||
return new Provider<HtmlSnippet>() {
|
||||
public static Supplier<HtmlSnippet> fromClasspath(final Class<?> klass, final String resourcePath) {
|
||||
return new Supplier<HtmlSnippet>() {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "HtmlSnippetFromClassPth(class="+klass.getSimpleName()+", "+resourcePath+")";
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
*******************************************************************************/
|
||||
package org.springframework.ide.eclipse.editor.support.util;
|
||||
|
||||
import javax.inject.Provider;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
@@ -18,13 +18,13 @@ import org.eclipse.ui.texteditor.ITextEditor;
|
||||
|
||||
/**
|
||||
* Convenience methods to addapt various types of objects representing a 'ui context'
|
||||
* to a Shell{@link Provider}
|
||||
* to a Shell{@link Supplier}
|
||||
*
|
||||
* @author Kris De Volder
|
||||
*/
|
||||
public class ShellProviders {
|
||||
public static Provider<Shell> from(final ITextEditor editor) {
|
||||
return new Provider<Shell>() {
|
||||
public static Supplier<Shell> from(final ITextEditor editor) {
|
||||
return new Supplier<Shell>() {
|
||||
@Override
|
||||
public Shell get() {
|
||||
return editor.getSite().getShell();
|
||||
@@ -32,8 +32,8 @@ public class ShellProviders {
|
||||
};
|
||||
}
|
||||
|
||||
public static Provider<Shell> from(final Composite composite) {
|
||||
return new Provider<Shell>() {
|
||||
public static Supplier<Shell> from(final Composite composite) {
|
||||
return new Supplier<Shell>() {
|
||||
@Override
|
||||
public Shell get() {
|
||||
return composite.getShell();
|
||||
|
||||
@@ -19,8 +19,7 @@ import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.inject.Provider;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
import org.springframework.ide.eclipse.editor.support.hover.DescriptionProviders;
|
||||
@@ -148,7 +147,7 @@ public class YTypeFactory {
|
||||
private List<YTypedProperty> propertyList = new ArrayList<>();
|
||||
private final List<YValueHint> hints = new ArrayList<>();
|
||||
private Map<String, YTypedProperty> cachedPropertyMap;
|
||||
private Provider<Collection<YValueHint>> hintProvider;
|
||||
private Supplier<Collection<YValueHint>> hintProvider;
|
||||
private List<Constraint> constraints = new ArrayList<>(2);
|
||||
|
||||
public boolean isSequenceable() {
|
||||
@@ -171,7 +170,7 @@ public class YTypeFactory {
|
||||
return null;
|
||||
}
|
||||
|
||||
public void addHintProvider(Provider<Collection<YValueHint>> hintProvider) {
|
||||
public void addHintProvider(Supplier<Collection<YValueHint>> hintProvider) {
|
||||
this.hintProvider = hintProvider;
|
||||
}
|
||||
|
||||
@@ -181,7 +180,7 @@ public class YTypeFactory {
|
||||
if (providerHints == null || providerHints.isEmpty()) {
|
||||
return hints.toArray(new YValueHint[hints.size()]);
|
||||
} else {
|
||||
// Only merge if there are provider hints to merge
|
||||
// Only merge if there are Supplier hints to merge
|
||||
Set<YValueHint> mergedHints = new LinkedHashSet<>();
|
||||
|
||||
// Add type hints first
|
||||
@@ -189,7 +188,7 @@ public class YTypeFactory {
|
||||
mergedHints.add(val);
|
||||
}
|
||||
|
||||
// merge the provider hints
|
||||
// merge the Supplier hints
|
||||
for (YValueHint val : providerHints) {
|
||||
mergedHints.add(val);
|
||||
}
|
||||
@@ -226,7 +225,7 @@ public class YTypeFactory {
|
||||
propertyList.add(p);
|
||||
}
|
||||
|
||||
public void addProperty(String name, YType type, Provider<HtmlSnippet> description) {
|
||||
public void addProperty(String name, YType type, Supplier<HtmlSnippet> description) {
|
||||
YTypedPropertyImpl prop;
|
||||
addProperty(prop = new YTypedPropertyImpl(name, type));
|
||||
prop.setDescriptionProvider(description);
|
||||
@@ -413,7 +412,7 @@ public class YTypeFactory {
|
||||
|
||||
final private String name;
|
||||
final private YType type;
|
||||
private Provider<HtmlSnippet> descriptionProvider = DescriptionProviders.NO_DESCRIPTION;
|
||||
private Supplier<HtmlSnippet> descriptionProvider = DescriptionProviders.NO_DESCRIPTION;
|
||||
private boolean isDeprecated;
|
||||
private String deprecationMessage;
|
||||
|
||||
@@ -442,7 +441,7 @@ public class YTypeFactory {
|
||||
return descriptionProvider.get();
|
||||
}
|
||||
|
||||
public void setDescriptionProvider(Provider<HtmlSnippet> descriptionProvider) {
|
||||
public void setDescriptionProvider(Supplier<HtmlSnippet> descriptionProvider) {
|
||||
this.descriptionProvider = descriptionProvider;
|
||||
}
|
||||
|
||||
|
||||
@@ -40,11 +40,6 @@
|
||||
<artifactId>guava</artifactId>
|
||||
<version>${guava-version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.inject</groupId>
|
||||
<artifactId>javax.inject</artifactId>
|
||||
<version>1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.projectreactor</groupId>
|
||||
<artifactId>reactor-core</artifactId>
|
||||
|
||||
@@ -13,8 +13,7 @@ package org.springframework.ide.vscode.commons.util;
|
||||
import java.util.Collection;
|
||||
import java.util.TreeSet;
|
||||
import java.util.concurrent.Callable;
|
||||
|
||||
import javax.inject.Provider;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
|
||||
@@ -27,7 +26,7 @@ public class EnumValueParser implements ValueParser {
|
||||
|
||||
private String typeName;
|
||||
|
||||
private Provider<PartialCollection<String>> values;
|
||||
private Supplier<PartialCollection<String>> values;
|
||||
private final boolean longRunning;
|
||||
|
||||
|
||||
@@ -39,19 +38,19 @@ public class EnumValueParser implements ValueParser {
|
||||
this(typeName, false /* not long running by default */, provider(values));
|
||||
}
|
||||
|
||||
private static <T> Provider<PartialCollection<T>> provider(Collection<T> values) {
|
||||
private static <T> Supplier<PartialCollection<T>> provider(Collection<T> values) {
|
||||
return () -> PartialCollection.compute(() -> values);
|
||||
}
|
||||
|
||||
private static <T> Provider<PartialCollection<T>> provider(Callable<Collection<T>> values) {
|
||||
private static <T> Supplier<PartialCollection<T>> supplier(Callable<Collection<T>> values) {
|
||||
return () -> PartialCollection.compute(() -> values.call());
|
||||
}
|
||||
|
||||
public EnumValueParser(String typeName, boolean longRunning, Callable<Collection<String>> values) {
|
||||
this(typeName, longRunning, provider(values));
|
||||
this(typeName, longRunning, supplier(values));
|
||||
}
|
||||
|
||||
public EnumValueParser(String typeName, boolean longRunning, Provider<PartialCollection<String>> values) {
|
||||
public EnumValueParser(String typeName, boolean longRunning, Supplier<PartialCollection<String>> values) {
|
||||
this.typeName = typeName;
|
||||
this.values = values;
|
||||
this.longRunning = longRunning;
|
||||
|
||||
@@ -11,15 +11,15 @@
|
||||
|
||||
package org.springframework.ide.vscode.commons.util;
|
||||
|
||||
import javax.inject.Provider;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
/**
|
||||
* An abstract class implementing {@link Provider}. The provided value
|
||||
* An abstract class implementing {@link Supplier}. The provided value
|
||||
* is computed on demand and cached once computed.
|
||||
* <p>
|
||||
* Subclass must implement the compute method.
|
||||
*/
|
||||
public abstract class LazyProvider<T> implements Provider<T> {
|
||||
public abstract class LazyProvider<T> implements Supplier<T> {
|
||||
|
||||
private boolean computed = false;
|
||||
private T cached = null;
|
||||
|
||||
@@ -28,11 +28,6 @@
|
||||
<artifactId>commons-language-server</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.inject</groupId>
|
||||
<artifactId>javax.inject</artifactId>
|
||||
<version>1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
|
||||
@@ -30,11 +30,10 @@ import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import java.util.function.Supplier;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import javax.inject.Provider;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.boot.convert.DurationStyle;
|
||||
@@ -810,21 +809,21 @@ public class TypeUtil {
|
||||
/**
|
||||
* Registers a strategy for providing value hints with a given typeName.
|
||||
*/
|
||||
public static void valueHints(String typeName, ValueProviderStrategy provider) {
|
||||
public static void valueHints(String typeName, ValueProviderStrategy Supplier) {
|
||||
Assert.isLegal(!VALUE_HINTERS.containsKey(typeName)); //Only one value hinter per type is supported at the moment
|
||||
ATOMIC_TYPES.add(typeName); //valueHints typically implies that the type should be treated as atomic as well.
|
||||
ASSIGNABLE_TYPES.add(typeName); //valueHints typically implies that the type should be treated as atomic as well.
|
||||
VALUE_HINTERS.put(typeName, provider);
|
||||
VALUE_HINTERS.put(typeName, Supplier);
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a strategy for providing value hints with a given typeName.
|
||||
*/
|
||||
public static void valueHints(String typeName, Provider<String[]> provider) {
|
||||
public static void valueHints(String typeName, Supplier<String[]> Supplier) {
|
||||
valueHints(typeName, new ValueProviderStrategy() {
|
||||
@Override
|
||||
public Flux<StsValueHint> getValues(IJavaProject javaProject, String query) {
|
||||
String[] values = provider.get();
|
||||
String[] values = Supplier.get();
|
||||
if (ArrayUtils.hasElements(values)) {
|
||||
return Flux.fromArray(values)
|
||||
.map(StsValueHint::create);
|
||||
|
||||
Reference in New Issue
Block a user