This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 91141

Summary: Support Ant 1.7 IntrospectionHelper
Product: projects Reporter: loweryr <loweryr>
Component: AntAssignee: Jesse Glick <jglick>
Status: RESOLVED FIXED    
Severity: blocker Keywords: SIMPLEFIX
Priority: P3    
Version: 5.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Bug Depends on:    
Bug Blocks: 91142    
Attachments: Updated BridgeImpl.java
Corresponding patch against r551, after whitespace normalization (probably will not apply against trunk code)

Description loweryr 2006-12-15 22:33:31 UTC
The following code replacing lines 510-519 in
  org.apache.tools.ant.module.bridge.impl.BridgeImpl
     method gutProject(Project p)

  will support the change in ant's IntrospectionHelper (field "helpers" was
changed to "HELPERS").

  Added benefit... JUnit4 tests will function native with this patch, and
pointing ant directory to a 1.7.0RC1+ build of ant.

<CODE>
            boolean found16helpers = false;
            boolean found17helpers = false;
            try {
                Field helpersF = IntrospectionHelper.class.getDeclaredField
("helpers");
                helpersF.setAccessible (true);
                Object helpersO = helpersF.get (null);
                Map helpersM = (Map) helpersO;
                helpersM.clear ();
                found16helpers = true;
            } catch (NoSuchFieldException nsfe) {
                Field helpers17F = IntrospectionHelper.class.getDeclaredField
("HELPERS");
                helpers17F.setAccessible (true);
                Object helpers170 = helpers17F.get (null);
                Map helpers17M = (Map) helpers170;
                helpers17M.clear ();
                found17helpers = true;
            }
</CODE>
Comment 1 loweryr 2006-12-15 22:34:54 UTC
Created attachment 36698 [details]
Updated BridgeImpl.java
Comment 2 Jesse Glick 2006-12-15 22:42:47 UTC
Yes, I will do something like this. Thanks for pointing this out.

By the way, in the future please submit patches in diff (-u) format, rather than
a modified copy of the whole file. In this case I can easily write the necessary
code myself once I know it needs to be done, but in general a patch is much
easier to deal with.
Comment 3 Jesse Glick 2006-12-15 22:47:19 UTC
Created attachment 36699 [details]
Corresponding patch against r551, after whitespace normalization (probably will not apply against trunk code)
Comment 4 Jesse Glick 2006-12-20 21:43:53 UTC
Turns out I had already fixed this in trunk, just forgot about it.