apache / apache/maven-filtering

escapeWindowsPath() can produce ambiguous output and misses relative paths

Open
#355 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Java
Stars
9
Forks
36
Avg merge
8h 47m
Merged PRs (30d)
4

Description

In `src/main/java/org/apache/maven/shared/filtering/FilteringUtils.java`, lines 81–100:

The regex `^(.*)[a-zA-Z]:\\\\\\(.*)` only matches absolute Windows paths containing a drive letter. Relative paths with backslashes (e.g., `src\\main\\java`) are never escaped. The single/double backslash deduplication logic at line 90 (`if (val.indexOf('\\', end + 1) == end + 1)`) also means that `C:\\foo\\bar` and `C:\\foo\\\\bar` both produce the same output `C:\\\\\\\\foo\\\\\\\\bar` — information is lost about whether the original had single or double backslashes.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in src/main/java/org/apache/maven/shared/filtering/FilteringUtils.java, especially lines 81–100 and the condition at line 90. Trace the current handling of absolute and relative Windows paths using the examples in the issue, then verify that relative backslashes are escaped and single versus double backslashes remain distinguishable.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.