OK, that approach won't quite work, as it doesn't make sense to try and rename the 
Constructors as is done with the Methods.

I have succeeded in "hard intercepting" the construction by calling (on 
CtConstructor): insertBeforeBody("return;");, which is handy as it retains the correct 
(implicit or explicit) super(..) call to the superclass constructor, and blocks the 
remainder of the constructor from executing.  It does however prevent the real 
original code in the Constructor body from being executed later if required.

Since renaming is probably not on, I see a couple of other options:

1) Before inserting the "return;", copy the Constructor body (after any super(...)), 
converting it into a factory method.
2) Try and make the execution of "return;" conditional in some way, based on a field.

I'm thinking that the second one may be the simplest.

Brett Randall


View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3841296#3841296

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3841296


-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to