|
37 | 37 | import java.util.Collection;
|
38 | 38 | import java.util.Collections;
|
39 | 39 | import java.util.Enumeration;
|
| 40 | +import java.util.HashMap; |
40 | 41 | import java.util.Iterator;
|
41 | 42 | import java.util.LinkedHashMap;
|
42 | 43 | import java.util.LinkedList;
|
@@ -208,6 +209,8 @@ private void addModuleFiles(
|
208 | 209 |
|
209 | 210 | List<String> allFiles = FileUtils.getFileNames(moduleBasedir, "**/*", excludes, false);
|
210 | 211 |
|
| 212 | + Map<String, String> caseInsensitiveFiles = new HashMap<>(); |
| 213 | + |
211 | 214 | for (String extension : module.getExtensions()) {
|
212 | 215 | String fullExtension = "." + extension;
|
213 | 216 |
|
@@ -243,23 +246,22 @@ private void addModuleFiles(
|
243 | 246 | // -----------------------------------------------------------------------
|
244 | 247 | // Handle key without case differences
|
245 | 248 | // -----------------------------------------------------------------------
|
246 |
| - for (Map.Entry<String, DocumentRenderer> entry : files.entrySet()) { |
247 |
| - if (entry.getKey().equalsIgnoreCase(key)) { |
248 |
| - DocumentRenderingContext originalDocRenderingContext = |
249 |
| - entry.getValue().getRenderingContext(); |
| 249 | + String originalKey = caseInsensitiveFiles.put(key.toLowerCase(Locale.ROOT), key); |
| 250 | + if (originalKey != null) { |
| 251 | + DocumentRenderingContext originalDocRenderingContext = |
| 252 | + files.get(originalKey).getRenderingContext(); |
250 | 253 |
|
251 |
| - File originalDoc = new File( |
252 |
| - originalDocRenderingContext.getBasedir(), originalDocRenderingContext.getInputName()); |
| 254 | + File originalDoc = new File( |
| 255 | + originalDocRenderingContext.getBasedir(), originalDocRenderingContext.getInputName()); |
253 | 256 |
|
254 |
| - if (Os.isFamily(Os.FAMILY_WINDOWS)) { |
255 |
| - throw new RendererException("File '" + module.getSourceDirectory() + File.separator + doc |
256 |
| - + "' clashes with existing '" + originalDoc + "'."); |
257 |
| - } |
| 257 | + if (Os.isFamily(Os.FAMILY_WINDOWS)) { |
| 258 | + throw new RendererException("File '" + module.getSourceDirectory() + File.separator + doc |
| 259 | + + "' clashes with existing '" + originalDoc + "'."); |
| 260 | + } |
258 | 261 |
|
259 |
| - if (LOGGER.isWarnEnabled()) { |
260 |
| - LOGGER.warn("File '" + module.getSourceDirectory() + File.separator + doc |
261 |
| - + "' could clash with existing '" + originalDoc + "'."); |
262 |
| - } |
| 262 | + if (LOGGER.isWarnEnabled()) { |
| 263 | + LOGGER.warn("File '" + module.getSourceDirectory() + File.separator + doc |
| 264 | + + "' could clash with existing '" + originalDoc + "'."); |
263 | 265 | }
|
264 | 266 | }
|
265 | 267 |
|
|
0 commit comments