sixlegs.com / blog / java / exclude-tree-fix.html

Root Beer Logo Root Beer

Chris Nokleberg's Fizzy Weblog

March 2005
Su M Tu W Th F Sa
    1 2 3 4
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31
Previous  |  Next  |  More...
#  Bugfix for Javadoc Tree view when using @exclude

It was recently discovered that use of the ExcludeDoclet would screw up the "Tree" javadoc view. I luckily guessed that it might be due to proxy instances being compared with unwrapped instances as javadoc searched for common superclasses. Here is a patch:

*** ExcludeDoclet.java.~1.4.~	Tue Jan 18 20:46:07 2005
--- ExcludeDoclet.java	Sat Mar  5 22:32:49 2005
***************
*** 83,88 ****
--- 83,89 ----
              if (args != null) {
                  String methodName = method.getName();
                  if (methodName.equals("compareTo") ||
+                     methodName.equals("equals") ||
                      methodName.equals("overrides") ||
                      methodName.equals("subclassOf")) {
                      args[0] = unwrap(args[0] );
***************
*** 97,103 ****
  
          private Object unwrap(Object proxy)
          {
!             return ((ExcludeHandler)Proxy.getInvocationHandler(proxy)).target;
          }
      }
  }
--- 98,106 ----
  
          private Object unwrap(Object proxy)
          {
!             if (proxy instanceof Proxy)
!                 return ((ExcludeHandler)Proxy.getInvocationHandler(proxy)).target;
!             return proxy;
          }
      }
  }

The full source for ExcludeDoclet has also been updated.

[Powered By FreeMarker]  [Valid Atom 1.0]  [Weblog Commenting by HaloScan.com]