You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by jl...@apache.org on 2021/03/26 16:55:02 UTC

[tomee-patch-plugin] 02/02: Make sure to be as fine as possible in checking the class names so we don't mess up in case classes share the same prefix

This is an automated email from the ASF dual-hosted git repository.

jlmonteiro pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomee-patch-plugin.git

commit 8428a1b5301c47694f20668c5ec2b1f479ea92ef
Author: Jean-Louis Monteiro <jl...@tomitribe.com>
AuthorDate: Fri Mar 26 17:51:49 2021 +0100

    Make sure to be as fine as possible in checking the class names so we don't mess up in case classes share the same prefix
---
 .../src/main/java/org/apache/tomee/patch/core/Transformation.java     | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tomee-patch-core/src/main/java/org/apache/tomee/patch/core/Transformation.java b/tomee-patch-core/src/main/java/org/apache/tomee/patch/core/Transformation.java
index fc59495..a49c061 100644
--- a/tomee-patch-core/src/main/java/org/apache/tomee/patch/core/Transformation.java
+++ b/tomee-patch-core/src/main/java/org/apache/tomee/patch/core/Transformation.java
@@ -383,7 +383,9 @@ public class Transformation {
 
     private boolean isPatched(final String path, final Jar jar) {
         for (final Clazz clazz : classes) {
-            if (path.startsWith(clazz.getPrefix())) {
+            if (path.equals(clazz.getName()) ||
+                    path.startsWith(clazz.getPrefix() + "$")) {
+
                 jar.patch(clazz, classes);
                 return true;
             }