Hi!

The problem is that I can`t merge the bytecodes of two or more methods into a 
single one. A combination of these methods in a single methode is striven. 
(With additional "connector"-code between the Method blocks).

Here's my code-sample:

(Classes A and B are merged within Class C)

public class A {
  | 
  |     public int doIt() {
  |             int a = 5;
  |             a = a*5;
  | 
  |             return a;
  |     }
  | }
  | 
  | public class B {
  | 
  |     public int doIt() {
  |             int a = 10;
  |             a = a / 10;
  | 
  |             return a;
  |     }
  | }
  | 
  | public class C {
  |     private static final int ID_A = 1;
  |     private static final int ID_B = 2;
  | 
  |     private int id;
  | 
  |     public C (int id) {
  |             this.id = id;
  |     }
  | 
  |     public int doIt() {
  |             switch (id) {
  |                     case ID_A:
  |                             int a = 5;
  |                             a = a*5;
  | 
  |                             return a;
  |                     case ID_B:
  |                             int a = 10;
  |                             a = a / 10;
  | 
  |                             return a;
  |             }
  | 
  |             return -1;
  |     }
  | 
  | }
I could use auxiliary methods and call them within the "case" but is there 
another way to archieve the desired functionality?

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

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


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to