Skip to content

Commit 9494c5d

Browse files
committed
docs about backslash parsing
Signed-off-by: Christoph Rueger <[email protected]>
1 parent b5818d1 commit 9494c5d

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

docs/_chapters/125-tour-features.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,28 @@ Though lines can be as long as you want, it is better for your brains to keep th
7171

7272
Since bnd files are property files, you cannot repeat a property. Later properties will completely overwrite earlier ones and there is no order between properties.
7373

74+
**Notes on backslashes in .bnd files:** Be aware that [Java properties parsing](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Properties.html) **silently drops** single backslashes (or more precisely odd numbers of consecutive backslashes). In the past, this was a common source of confusion, but since bnd 7.2.0, a warning is issued when such cases are detected.
75+
76+
For example consider this `.bnd` file:
77+
78+
```
79+
a: 42
80+
a0: ${a}
81+
a1: \${a}
82+
a2: \\${a}
83+
```
84+
85+
This produces the following output:
86+
87+
```
88+
a: 42
89+
a0: 42
90+
a1: 42
91+
a2: ${a}
92+
```
93+
94+
Notice that `a0` and `a1` resolve to the same value because the single backslash in a1 is silently dropped by Java’s property parser.
95+
7496
## Running bnd
7597

7698
We can now wrap the source JAR with the following command:

0 commit comments

Comments
 (0)