Skip to content

Commit e3e48f8

Browse files
authored
refactor: remove reflections import (#858)
1 parent 8cb45bd commit e3e48f8

4 files changed

Lines changed: 1 addition & 20 deletions

File tree

core/flamingock-core/src/main/java/io/flamingock/internal/core/utils/ExecutionUtils.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,6 @@ public final class ExecutionUtils {
3434
private ExecutionUtils() {
3535
}
3636

37-
@SuppressWarnings("unchecked")
38-
public static Collection<Class<?>> loadExecutionClassesFromPackage(String packagePath) {
39-
return ReflectionUtil.loadAnnotatedClassesFromPackage(packagePath, ExecutionUtils.CHANGE_UNIT_CLASS);
40-
}
4137

4238
/**
4339
* We need this generic method, although currently it only calls `isChange`, but in the future there will

utils/general-util/build.gradle.kts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,8 @@ plugins {
55

66
val jacksonVersion = "2.16.0"
77
dependencies {
8-
9-
implementation("org.reflections:reflections:0.10.1")//todo remove
10-
// api("org.objenesis:objenesis:3.2")
118
api("org.yaml:snakeyaml:2.2")
12-
//
9+
1310
api("org.apache.httpcomponents:httpclient:4.5.14")
1411

1512
api("com.fasterxml.jackson.core:jackson-databind:$jacksonVersion")

utils/general-util/src/main/java/io/flamingock/internal/util/ReflectionUtil.java

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
*/
1616
package io.flamingock.internal.util;
1717

18-
import org.reflections.Reflections;
19-
2018
import javax.lang.model.element.Element;
2119
import javax.lang.model.element.ElementKind;
2220
import javax.lang.model.element.ExecutableElement;
@@ -256,15 +254,6 @@ public static Optional<Method> findFirstMethodByName(Class<?> source, String met
256254
.findFirst();
257255
}
258256

259-
//TODO expand this beyond Change
260-
@SuppressWarnings("unchecked")
261-
public static Collection<Class<?>> loadAnnotatedClassesFromPackage(String packagePath, Class<? extends Annotation>... annotations) {
262-
Reflections reflections = new Reflections(packagePath);
263-
return Stream.of(annotations)
264-
.map(reflections::getTypesAnnotatedWith)
265-
.flatMap(Set::stream)
266-
.collect(Collectors.toList());
267-
}
268257

269258
public static List<Class<?>> getParameters(Executable executable) {
270259
return Arrays.asList(executable.getParameterTypes());

utils/test-util/build.gradle.kts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ dependencies {
77
api(project(":core:flamingock-processor"))
88

99
api("javax.inject:javax.inject:1")
10-
api("org.reflections:reflections:0.10.1")
1110
api("org.objenesis:objenesis:3.2")
1211
api("org.yaml:snakeyaml:2.2")
1312

0 commit comments

Comments
 (0)