• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pantsbuild / pants / 19581575426

21 Nov 2025 07:40PM UTC coverage: 80.296% (+0.001%) from 80.295%
19581575426

push

github

web-flow
Java fix bug with inner class inference (#22889)

In Java, it's perfectly valid for a class in one package to reference
another class in the same package without importing it. The current Java
dependency inference code works fine for top level references, but
doesn't work when inner classes are involved. Suppose we have class A in
A.java and class B in B.java with a static inner class InnerB. All of
these classes are in the same package. A uses B.InnerB, but doesn't
explicitly import B. This is valid practice in Java, but with our Pants
Java dependency inference logic, the backend won't figure out on its own
that A.java depends on B.java without an explicit dependency reference.

This PR contains the changes for fixing this bug as seen in #22817 I've
split it into its own PR to make things easier to review and land

21 of 27 new or added lines in 2 files covered. (77.78%)

78406 of 97646 relevant lines covered (80.3%)

3.36 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

47.67
/src/python/pants/backend/java/dependency_inference/rules.py


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc