TNG / ArchUnit

A Java architecture test library, to specify and assert architecture rules in plain Java
http://archunit.org
Apache License 2.0
3.18k stars 288 forks source link

instantiation of a local variable adds a class reference #1327

Closed ttho closed 1 month ago

ttho commented 2 months ago

First, this is work in progress. Created a PR for easier reviewing and commenting. This simple approach allows including the instantiation of local variables in the dependency checks (which I need). Questions:

  1. is such a limited extension acceptable? I would say yes. I know, extending the model (graph) to include local variables would open up a lot of more possibilities, but also be a lot of more work.
  2. the line numbers for the new references are wrong/inaccurate. They always point to the closing } of the method. Why is that? Is there an easy fix? Thanks for any help!