From db432a910dff4ae52a9525f3c7bded70181becc2 Mon Sep 17 00:00:00 2001 From: Georgios Andrianakis Date: Wed, 30 Nov 2022 13:42:56 +0200 Subject: [PATCH 1/3] Introduce common forbiddenapis configuration --- .forbiddenapis/banned-signatures-common.txt | 2 ++ build-parent/pom.xml | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 .forbiddenapis/banned-signatures-common.txt diff --git a/.forbiddenapis/banned-signatures-common.txt b/.forbiddenapis/banned-signatures-common.txt new file mode 100644 index 0000000000000..1f79769044ecd --- /dev/null +++ b/.forbiddenapis/banned-signatures-common.txt @@ -0,0 +1,2 @@ +@defaultMessage Never use Type#toString() as it's almost always the wrong thing to do. Usually org.jboss.jandex.DotName#toString() is what is needed +org.jboss.jandex.Type#toString() diff --git a/build-parent/pom.xml b/build-parent/pom.xml index 4a86fa60338ad..592803b005192 100644 --- a/build-parent/pom.xml +++ b/build-parent/pom.xml @@ -698,6 +698,24 @@ de.thetaphi forbiddenapis ${forbiddenapis-maven-plugin.version} + + + verify-forbidden-apis + + + false + + ${maven.multiModuleProjectDirectory}/.forbiddenapis/banned-signatures-common.txt + + false + true + + compile + + check + + + From 683a24d56be817bc5c2fa5cee94191e0e223c9ab Mon Sep 17 00:00:00 2001 From: Georgios Andrianakis Date: Wed, 30 Nov 2022 13:57:31 +0200 Subject: [PATCH 2/3] Use common forbiddenapis configuration in core deployment module --- core/deployment/pom.xml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/core/deployment/pom.xml b/core/deployment/pom.xml index 5f83ba4df0811..181f5b9fc2c05 100644 --- a/core/deployment/pom.xml +++ b/core/deployment/pom.xml @@ -203,18 +203,11 @@ verify-forbidden-apis - - false ./banned-signatures.txt + ${maven.multiModuleProjectDirectory}/.forbiddenapis/banned-signatures-common.txt - false - true - compile - - check - From 7fbd56569eb5ee360ac12d45a135c5e939291eb0 Mon Sep 17 00:00:00 2001 From: Georgios Andrianakis Date: Wed, 30 Nov 2022 13:43:18 +0200 Subject: [PATCH 3/3] Introduce forbiddenapis to RESTEasy Reactive --- .../jaxrs-client-reactive/deployment/pom.xml | 4 +++ .../deployment/pom.xml | 4 +++ .../deployment/pom.xml | 4 +++ .../client/processor/pom.xml | 9 +++++++ .../common/processor/pom.xml | 9 +++++++ .../reactive/common/processor/JandexUtil.java | 26 ------------------- .../resteasy-reactive/pom.xml | 26 +++++++++++++++++++ .../server/processor/pom.xml | 9 +++++++ 8 files changed, 65 insertions(+), 26 deletions(-) diff --git a/extensions/resteasy-reactive/jaxrs-client-reactive/deployment/pom.xml b/extensions/resteasy-reactive/jaxrs-client-reactive/deployment/pom.xml index ea2efd111a5df..2cda18fcc4c5e 100644 --- a/extensions/resteasy-reactive/jaxrs-client-reactive/deployment/pom.xml +++ b/extensions/resteasy-reactive/jaxrs-client-reactive/deployment/pom.xml @@ -132,6 +132,10 @@ + + de.thetaphi + forbiddenapis + diff --git a/extensions/resteasy-reactive/quarkus-resteasy-reactive-common/deployment/pom.xml b/extensions/resteasy-reactive/quarkus-resteasy-reactive-common/deployment/pom.xml index 897bafb30329a..9ad099852a72a 100644 --- a/extensions/resteasy-reactive/quarkus-resteasy-reactive-common/deployment/pom.xml +++ b/extensions/resteasy-reactive/quarkus-resteasy-reactive-common/deployment/pom.xml @@ -87,6 +87,10 @@ + + de.thetaphi + forbiddenapis + diff --git a/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/pom.xml b/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/pom.xml index 3807caaaff689..c133493289748 100644 --- a/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/pom.xml +++ b/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/pom.xml @@ -131,6 +131,10 @@ + + de.thetaphi + forbiddenapis + diff --git a/independent-projects/resteasy-reactive/client/processor/pom.xml b/independent-projects/resteasy-reactive/client/processor/pom.xml index 513306efc372b..98a7ae2206e86 100644 --- a/independent-projects/resteasy-reactive/client/processor/pom.xml +++ b/independent-projects/resteasy-reactive/client/processor/pom.xml @@ -60,6 +60,15 @@ + + + + de.thetaphi + forbiddenapis + + + + jakarta-rewrite diff --git a/independent-projects/resteasy-reactive/common/processor/pom.xml b/independent-projects/resteasy-reactive/common/processor/pom.xml index 69fed04ce862a..e67cc7816daf5 100644 --- a/independent-projects/resteasy-reactive/common/processor/pom.xml +++ b/independent-projects/resteasy-reactive/common/processor/pom.xml @@ -54,6 +54,15 @@ + + + + de.thetaphi + forbiddenapis + + + + jakarta-rewrite diff --git a/independent-projects/resteasy-reactive/common/processor/src/main/java/org/jboss/resteasy/reactive/common/processor/JandexUtil.java b/independent-projects/resteasy-reactive/common/processor/src/main/java/org/jboss/resteasy/reactive/common/processor/JandexUtil.java index d906cdd2cdef7..1e2f2f6fc29ad 100644 --- a/independent-projects/resteasy-reactive/common/processor/src/main/java/org/jboss/resteasy/reactive/common/processor/JandexUtil.java +++ b/independent-projects/resteasy-reactive/common/processor/src/main/java/org/jboss/resteasy/reactive/common/processor/JandexUtil.java @@ -364,30 +364,4 @@ public static boolean isSubclassOf(IndexView index, ClassInfo info, DotName pare return isSubclassOf(index, superClass, parentName); } - @SuppressWarnings("incomplete-switch") - public static String getBoxedTypeName(Type type) { - switch (type.kind()) { - case PRIMITIVE: - switch (type.asPrimitiveType().primitive()) { - case BOOLEAN: - return "java.lang.Boolean"; - case BYTE: - return "java.lang.Byte"; - case CHAR: - return "java.lang.Character"; - case DOUBLE: - return "java.lang.Double"; - case FLOAT: - return "java.lang.Float"; - case INT: - return "java.lang.Integer"; - case LONG: - return "java.lang.Long"; - case SHORT: - return "java.lang.Short"; - } - } - return type.toString(); - } - } diff --git a/independent-projects/resteasy-reactive/pom.xml b/independent-projects/resteasy-reactive/pom.xml index ac543a5bbd098..a3655066d920b 100644 --- a/independent-projects/resteasy-reactive/pom.xml +++ b/independent-projects/resteasy-reactive/pom.xml @@ -68,6 +68,9 @@ 1.0.2 4.2.0 2.25.0 + + + 3.1 @@ -484,6 +487,29 @@ + + de.thetaphi + forbiddenapis + ${forbiddenapis-maven-plugin.version} + + + verify-forbidden-apis + + + false + + ${maven.multiModuleProjectDirectory}/.forbiddenapis/banned-signatures-common.txt + + false + true + + compile + + check + + + + diff --git a/independent-projects/resteasy-reactive/server/processor/pom.xml b/independent-projects/resteasy-reactive/server/processor/pom.xml index c4623210140c9..e98a6d4058c3a 100644 --- a/independent-projects/resteasy-reactive/server/processor/pom.xml +++ b/independent-projects/resteasy-reactive/server/processor/pom.xml @@ -72,6 +72,15 @@ + + + + de.thetaphi + forbiddenapis + + + + jakarta-rewrite