commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Showalter, Jim" <>
Subject Missing type information (not seen in visitor)
Date Mon, 25 Sep 2017 23:05:26 GMT
We have two classes like this:


public class Foo {

public class FooHolder {
               private List<Foo> foos = new ArrayList<>();

After visiting both classes and dumping out the info, I see this:

  class, lines 0 to ~2, deletable, public

  class, lines 0 to ~2, not-deletable, public
  type references
  field declarations

Note that the type Foo is not seen in when visiting the Foos. Because there are no other references
to Foo anywhere, this results in a false-positive delete of

I collect all of the referred-to types in the visitor like this:

               public void visitConstantClass(final ConstantClass obj) {
                              String className = JavaUtils.dotsToSlashes(javaClass().getConstantPool().getConstant(obj.getNameIndex()).toString().replace("\")",
"").replaceAll("^.*\"", ""));
                              if (ignore(className)) {

What am I doing wrong?

Jim Showalter
Intuit, 2003H-265Z
Garcia Avenue
Mountain View, CA 94043
(408) 353-4954 [home]
(408) 204-1661 [personal cell]
(669) 271-2257 [work cell]

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message