Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

PackageMatcher wildcards don't match package names with non-ASCII letters

Open
#1,776 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@StefanPenndorf is already working on this.

Since Oct 30, 2026.

  • #1777 by @StefanPenndorf — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
25/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
java
Domain
testing-qa

Research direction

Start with PackageMatcher.java, especially the wildcard-to-regex conversion and pattern compilation cited in the issue. Add regression coverage for the listed matcher and slice checks using a package name with non-ASCII letters; done means the matcher recognizes it and the cycle check detects the cycle. A linked pull request is already open, so check its status before starting.

Written by the indexing model from the issue text.

Description

Package identifiers with wildcards don't match packages whose names contain non-ASCII letters, e.g. German umlauts. For slices().matching(..) this means that classes in such packages silently belong to no slice, so beFreeOfCycles() never sees their cycles. As long as other packages do match, failOnEmptyShould doesn't catch it either.

Reproduction

ArchUnit 1.4.2; PackageMatcher has only Javadoc changes since then, up to 1.5.1 and main.

package com.example.a;         public class A { com.example.übersicht.B b; }
package com.example.übersicht; public class B { com.example.a.A a; }
Check Actual Expected
PackageMatcher.of("com.example.*").matches("com.example.übersicht") false true
JavaClass.Predicates.resideInAPackage("com.example..") for B false true
slices().matching("com.example.(*)..").should().beFreeOfCycles() 0 cycles 1 cycle
slices().matching("com.example.(**)").should().beFreeOfCycles() 0 cycles 1 cycle

The Javadoc says that * "stands for any non-empty sequence of characters but not the dot".

Cause

PackageMatcher turns the package identifier into a regular expression and uses \w for every wildcard (L81–L87, L162). For example, com.example.* becomes com\.example\.\w+.

The pattern is compiled without flags (L106), and then \w only matches a–z, A–Z, 0–9 and _. So übersicht fails at its very first letter and the package doesn't match, although Java allows any Unicode letter in package names.

Suggested fix

Compile the pattern with Pattern.UNICODE_CHARACTER_CLASS. With that flag patched into 1.4.2, all four checks above give the expected result. Alternatively, a character class closer to the Javadoc, such as "anything but a dot", would do.

Thanks for ArchUnit, we use it a lot.

Dominant language
Java
Stars
3.9k
Forks
350
Avg merge
1d 12h
Merged PRs (30d)
13

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from TNG/ArchUnit

All issues in TNG/ArchUnit

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.