From c9dd8290be198dcc92bf0d193e0b0649926f742a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tibor=20Zim=C3=A1nyi?= Date: Fri, 4 Aug 2023 09:32:35 +0200 Subject: [PATCH] [7.67.x][kie-issues#394] Unnecessary warning when DRL file is placed in BOOT-INF/classes directory (#5412) * Fix package name comparison in Spring Boot * Fix package name comparison in Spring Boot --- .../drools/compiler/kie/builder/impl/KieBuilderImpl.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drools-compiler/src/main/java/org/drools/compiler/kie/builder/impl/KieBuilderImpl.java b/drools-compiler/src/main/java/org/drools/compiler/kie/builder/impl/KieBuilderImpl.java index c87ad1e53f0..979b2b4375c 100644 --- a/drools-compiler/src/main/java/org/drools/compiler/kie/builder/impl/KieBuilderImpl.java +++ b/drools-compiler/src/main/java/org/drools/compiler/kie/builder/impl/KieBuilderImpl.java @@ -374,18 +374,13 @@ private static boolean isFileInKieBase( KieBaseModel kieBase, String fileName, S return true; } else { String folderNameForFile = lastSep > 0 ? fileName.substring( 0, lastSep ) : ""; - int resourcesPos = folderNameForFile.indexOf( RESOURCES_ROOT ); - if (resourcesPos >= 0) { - folderNameForFile = folderNameForFile.substring( resourcesPos + RESOURCES_ROOT.length() ); - } String pkgNameForFile = packageNameForFile( fileName, folderNameForFile, !useFolders, file ); return isPackageInKieBase( kieBase, pkgNameForFile ); } } private static String packageNameForFile( String fileName, String folderNameForFile, boolean discoverPackage, Supplier file ) { - String packageNameFromFolder = folderNameForFile.replace( '/', '.' ); - + String packageNameFromFolder = getRelativePackageName(folderNameForFile.replace( '/', '.' )); if (discoverPackage) { String packageNameForFile = packageNameFromAsset(fileName, file.get()); if (packageNameForFile != null) {