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 26876 - Bytecode patching that allows to rename a member
Summary: Bytecode patching that allows to rename a member
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Module System (show other bugs)
Version: 3.x
Hardware: PC Linux
: P2 blocker (vote)
Assignee: Jesse Glick
URL:
Keywords:
Depends on:
Blocks: 26790
  Show dependency tree
 
Reported: 2002-08-29 13:32 UTC by Jaroslav Tulach
Modified: 2008-12-23 08:37 UTC (History)
0 users

See Also:
Issue Type: TASK
Exception Reporter:


Attachments
Patching with ability to rename members (32.42 KB, patch)
2002-08-29 13:33 UTC, Jaroslav Tulach
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jaroslav Tulach 2002-08-29 13:32:12 UTC
While working on issue 26790 I realized that it
would be very useful if the bytecode patching
could handle rename of methods (and fields).
Something like the old postprocessing task that
changed r3fr3shRoot to refreshRoot so there could
be two methods with different return type.

In the current system this was handled by moving
of one of the methods into a superclass
($SystemAction$Patch$.getIcon for example), but
the problem is that this does not work for static
methods and also, that even the generated patched
version of SystemAction (with $SA$Patch$
superclass) cannot be subclassed by someone who
overrides the old method (ImageIcon getIcon).

For this reason I decided to enhance the patching
system to be able to rename members during runtime.
Comment 1 Jaroslav Tulach 2002-08-29 13:33:01 UTC
Created attachment 7250 [details]
Patching with ability to rename members
Comment 2 Jaroslav Tulach 2002-08-29 13:36:39 UTC
The patch does not look too complicated. Actually I just copied method
markMemberPublic into renameMember and mangle it a bit, moreover the
rename ability allowed me to delete two fake superclasses.
$AbstractFileSystem$Patch$ and $SystemAction$Patch$

All tests seem to work, but remembering all the problems that you
(Jesse) found last time, it is definitivelly better to wait for your
review.

Can you review & apply or review & give me permision to apply?
Comment 3 Jesse Glick 2002-08-30 02:44:15 UTC
Will apply this.
Comment 4 Jesse Glick 2002-08-30 02:58:48 UTC
Applied:

committed   * Up-To-Date  1.9        
core/src/org/netbeans/PatchByteCode.java
committed   * Up-To-Date  1.7        
core/test/unit/src/org/netbeans/PatchByteCodeTest.java
committed   * Up-To-Date  1.3        
nbbuild/antsrc/org/netbeans/nbbuild/NbEnhanceClass.java
committed   * Up-To-Date  1.111       openide/build.xml
removed     * Up-To-Date  1.3        
openide/compat/src/org/openide/filesystems/$AbstractFileSystem$Patch$.java
removed     * Up-To-Date  1.2        
openide/compat/src/org/openide/util/actions/$SystemAction$Patch$.java
committed   * Up-To-Date  1.48       
openide/src/org/openide/filesystems/AbstractFileSystem.java
committed   * Up-To-Date  1.60       
openide/src/org/openide/util/actions/SystemAction.java