From b421058708721e331429022d39ec30dcc3bbfe64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tibor=20Zim=C3=A1nyi?= Date: Thu, 3 Aug 2023 09:57:38 +0200 Subject: [PATCH] [kie-issues#394] Unnecessary warning when DRL file is placed in BOOT-INF/classes directory (#5410) * 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 2a6394d285c..bb6f45dba36 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 @@ -378,18 +378,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) {