Skip to content

Commit 8712202

Browse files
committed
Refactor module path cache to use Module as key for improved type safety
1 parent 8cb806b commit 8712202

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/kotlin/org/domaframework/doma/intellij/common/CommonPathParameter.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,15 @@ object CommonPathParameterUtil {
4747
)
4848

4949
// Cache for each module's directory information.
50-
private val modulePathCache = ConcurrentHashMap<String, ModulePaths>()
50+
private val modulePathCache = ConcurrentHashMap<Module, ModulePaths>()
5151

5252
/**
5353
* Returns the directory information for the specified module (uses cache if available).
5454
*
5555
* @param module The module to retrieve directory information for.
5656
* @return The cached or newly computed ModulePaths.
5757
*/
58-
fun getModulePaths(module: Module): ModulePaths? = modulePathCache[module.name]
58+
fun getModulePaths(module: Module): ModulePaths? = modulePathCache[module]
5959

6060
/**
6161
* Checks if a given path is a generated directory based on annotation processor settings.
@@ -129,7 +129,7 @@ object CommonPathParameterUtil {
129129
testSourceDirs,
130130
testResourceDirs,
131131
)
132-
modulePathCache[module.name] = paths
132+
modulePathCache[module] = paths
133133
}
134134

135135
/**

0 commit comments

Comments
 (0)