Skip to content

Commit 396cb19

Browse files
authored
Merge pull request #670 from SentryMan/tidy-deprecations
Remove Deprecated Interfaces
2 parents d8cc06d + 05f0a32 commit 396cb19

File tree

15 files changed

+1
-589
lines changed

15 files changed

+1
-589
lines changed

inject-generator/src/main/java/io/avaje/inject/generator/InjectProcessor.java

-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ public synchronized void init(ProcessingEnvironment processingEnv) {
9797
* Loads provider files generated by avaje-inject-maven-plugin
9898
*/
9999
void loadProvidedFiles() {
100-
pluginFileProvided.addAll(lines("avaje-plugin-provides.txt"));
101100
lines("avaje-module-dependencies.csv").stream()
102101
.filter(s -> s.contains("|") && !s.startsWith("External Module Type"))
103102
.distinct()

inject-generator/src/main/java/io/avaje/inject/generator/LoadServices.java

-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package io.avaje.inject.generator;
22

3-
import io.avaje.inject.spi.Module;
43
import io.avaje.inject.spi.*;
54

65
import java.util.ArrayList;
@@ -14,8 +13,6 @@ private LoadServices() {}
1413

1514
static List<AvajeModule> loadModules(ClassLoader classLoader) {
1615
List<AvajeModule> modules = new ArrayList<>();
17-
// load using older Module
18-
ServiceLoader.load(Module.class, classLoader).forEach(modules::add);
1916
// load newer AvajeModule
2017
final var iterator = ServiceLoader.load(InjectExtension.class, classLoader).iterator();
2118
while (iterator.hasNext()) {
@@ -33,8 +30,6 @@ static List<AvajeModule> loadModules(ClassLoader classLoader) {
3330

3431
static List<InjectPlugin> loadPlugins(ClassLoader classLoader) {
3532
List<InjectPlugin> plugins = new ArrayList<>();
36-
ServiceLoader.load(Plugin.class, classLoader).forEach(plugins::add);
37-
3833
final var iterator = ServiceLoader.load(InjectExtension.class, classLoader).iterator();
3934
while (iterator.hasNext()) {
4035
try {

inject-generator/src/main/java/module-info.java

-4
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@
1010
requires static io.avaje.spi;
1111

1212
uses io.avaje.inject.spi.InjectExtension;
13-
uses io.avaje.inject.spi.Plugin;
14-
uses io.avaje.inject.spi.Module;
15-
uses io.avaje.inject.spi.InjectPlugin;
16-
uses io.avaje.inject.spi.AvajeModule;
1713

1814
provides javax.annotation.processing.Processor with io.avaje.inject.generator.InjectProcessor;
1915
}

inject-gradle-plugin/src/main/java/io/avaje/inject/plugin/AvajeInjectPlugin.java

-4
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
import io.avaje.inject.spi.AvajeModule;
77
import io.avaje.inject.spi.InjectPlugin;
88
import io.avaje.inject.spi.InjectExtension;
9-
import io.avaje.inject.spi.Module;
10-
import io.avaje.inject.spi.Plugin;
119

1210
import org.gradle.api.Project;
1311
import org.gradle.api.Task;
@@ -65,7 +63,6 @@ private FileWriter createFileWriter(String dir, String file) throws IOException
6563

6664
private void writeProvidedPlugins(ClassLoader classLoader, FileWriter pluginWriter) throws IOException {
6765
final List<InjectPlugin> plugins = new ArrayList<>();
68-
ServiceLoader.load(Plugin.class, classLoader).forEach(plugins::add);
6966
ServiceLoader.load(InjectExtension.class, classLoader).stream()
7067
.map(Provider::get)
7168
.filter(InjectPlugin.class::isInstance)
@@ -122,7 +119,6 @@ private static URL[] createClassPath(Project project) {
122119
private void writeModuleCSV(ClassLoader classLoader, FileWriter moduleWriter) throws IOException {
123120

124121
final List<AvajeModule> avajeModules = new ArrayList<>();
125-
ServiceLoader.load(Module.class, classLoader).forEach(avajeModules::add);
126122
ServiceLoader.load(InjectExtension.class, classLoader).stream()
127123
.map(Provider::get)
128124
.filter(AvajeModule.class::isInstance)

inject-maven-plugin/src/main/java/io/avaje/inject/mojo/AutoProvidesMojo.java

-4
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@
3131
import io.avaje.inject.spi.AvajeModule;
3232
import io.avaje.inject.spi.InjectExtension;
3333
import io.avaje.inject.spi.InjectPlugin;
34-
import io.avaje.inject.spi.Module;
35-
import io.avaje.inject.spi.Plugin;
3634

3735
/**
3836
* Plugin that generates <code>target/avaje-module-provides.txt</code> and <code>
@@ -98,7 +96,6 @@ private void writeProvidedPlugins(URLClassLoader newClassLoader, FileWriter plug
9896
final Log log = getLog();
9997

10098
final List<InjectPlugin> plugins = new ArrayList<>();
101-
ServiceLoader.load(Plugin.class, newClassLoader).forEach(plugins::add);
10299
ServiceLoader.load(InjectExtension.class, newClassLoader).stream()
103100
.map(Provider::get)
104101
.filter(InjectPlugin.class::isInstance)
@@ -132,7 +129,6 @@ private void writeProvidedPlugins(URLClassLoader newClassLoader, FileWriter plug
132129
private void writeModuleCSV(ClassLoader newClassLoader, FileWriter moduleWriter) throws IOException {
133130
final Log log = getLog();
134131
final List<AvajeModule> avajeModules = new ArrayList<>();
135-
ServiceLoader.load(Module.class, newClassLoader).forEach(avajeModules::add);
136132
ServiceLoader.load(InjectExtension.class, newClassLoader).stream()
137133
.map(Provider::get)
138134
.filter(AvajeModule.class::isInstance)

inject/src/main/java/io/avaje/inject/BeanScopeBuilder.java

-10
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
import io.avaje.inject.spi.AvajeModule;
1010
import io.avaje.inject.spi.ConfigPropertyPlugin;
11-
import io.avaje.inject.spi.PropertyRequiresPlugin;
1211

1312
/**
1413
* Build a bean scope with options for shutdown hook and supplying external dependencies.
@@ -79,15 +78,6 @@ public interface BeanScopeBuilder {
7978
*/
8079
BeanScopeBuilder modules(AvajeModule... modules);
8180

82-
/**
83-
* Return the PropertyRequiresPlugin used for this scope. This is useful for plugins that want to
84-
* use the scopes wiring properties.
85-
*
86-
* @deprecated use {@link #configPlugin()} instead
87-
*/
88-
@Deprecated(forRemoval = true)
89-
PropertyRequiresPlugin propertyPlugin();
90-
9181
/**
9282
* Set the ConfigPropertyPlugin used for this scope. This is serviceloaded automatically of not set
9383
*

inject/src/main/java/io/avaje/inject/DBeanScopeBuilder.java

-9
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import io.avaje.inject.spi.ConfigPropertyPlugin;
2626
import io.avaje.inject.spi.EnrichBean;
2727
import io.avaje.inject.spi.ModuleOrdering;
28-
import io.avaje.inject.spi.PropertyRequiresPlugin;
2928
import io.avaje.inject.spi.SuppliedBean;
3029
import jakarta.inject.Provider;
3130

@@ -68,14 +67,6 @@ public BeanScopeBuilder modules(AvajeModule... modules) {
6867
return this;
6968
}
7069

71-
@Override
72-
public PropertyRequiresPlugin propertyPlugin() {
73-
if (propertyPlugin == null) {
74-
propertyPlugin = defaultPropertyPlugin();
75-
}
76-
return propertyPlugin;
77-
}
78-
7970
@Override
8071
public void configPlugin(ConfigPropertyPlugin propertyPlugin) {
8172
this.propertyPlugin = propertyPlugin;

inject/src/main/java/io/avaje/inject/DServiceLoader.java

-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package io.avaje.inject;
22

33
import io.avaje.inject.spi.*;
4-
import io.avaje.inject.spi.Module;
54

65
import java.util.ArrayList;
76
import java.util.List;
@@ -30,9 +29,6 @@ final class DServiceLoader {
3029
propertyPlugin = (ConfigPropertyPlugin) spi;
3130
}
3231
}
33-
// older plugins and modules
34-
ServiceLoader.load(Plugin.class, classLoader).forEach(plugins::add);
35-
ServiceLoader.load(Module.class, classLoader).forEach(modules::add);
3632
}
3733

3834
List<InjectPlugin> plugins() {

inject/src/main/java/io/avaje/inject/spi/Builder.java

-16
Original file line numberDiff line numberDiff line change
@@ -56,22 +56,6 @@ default boolean isBeanAbsent(Type... types) {
5656
return isBeanAbsent(null, types);
5757
}
5858

59-
/**
60-
* @deprecated use {@link #isBeanAbsent(String, Type...)}
61-
*/
62-
@Deprecated(forRemoval = true)
63-
default boolean isAddBeanFor(String name, Type... types) {
64-
return isBeanAbsent(name, types);
65-
}
66-
67-
/**
68-
* @deprecated use {@link #isBeanAbsent(Type...)} instead
69-
*/
70-
@Deprecated(forRemoval = true)
71-
default boolean isAddBeanFor(Type... types) {
72-
return isBeanAbsent(types);
73-
}
74-
7559
/**
7660
* Register the next bean as having Primary priority.
7761
* Highest priority, will be used over any other matching beans.

inject/src/main/java/io/avaje/inject/spi/ConfigPropertyPlugin.java

+1-6
Original file line numberDiff line numberDiff line change
@@ -12,32 +12,27 @@
1212
* System#getProperty(String)} and {@link System#getenv(String)}.
1313
*/
1414
@NullMarked
15-
public interface ConfigPropertyPlugin extends InjectExtension, PropertyRequiresPlugin {
15+
public interface ConfigPropertyPlugin extends InjectExtension {
1616

1717
/**
1818
* Return a configuration value that might not exist.
1919
*/
20-
@Override
2120
Optional<String> get(String property);
2221

2322
/**
2423
* Return true if the property is defined.
2524
*/
26-
@Override
2725
boolean contains(String property);
2826

2927
/** Return true if the property is not defined. */
30-
@Override
3128
default boolean missing(String property) {
3229
return !contains(property);
3330
}
3431

3532
/** Return true if the property is equal to the given value. */
36-
@Override
3733
boolean equalTo(String property, String value);
3834

3935
/** Return true if the property is not defined or not equal to the given value. */
40-
@Override
4136
default boolean notEqualTo(String property, String value) {
4237
return !equalTo(property, value);
4338
}

inject/src/main/java/io/avaje/inject/spi/Module.java

-103
This file was deleted.

inject/src/main/java/io/avaje/inject/spi/Plugin.java

-39
This file was deleted.

0 commit comments

Comments
 (0)