From: <fra...@us...> - 2009-08-13 22:09:53
|
Revision: 1826 http://javapathfinder.svn.sourceforge.net/javapathfinder/?rev=1826&view=rev Author: frankrimlinger Date: 2009-08-13 22:09:40 +0000 (Thu, 13 Aug 2009) Log Message: ----------- Completed the initialization of the localType map. The fact that a local variable slot can host mulitiple local variables of different names, and can take up one or two offsets, is a source of never ending anxiety. In this case, the issue is to get the method parameter names and bind them to their type and their offset. First, if the method is not static, offset 0 has "this", and the type of this is just the class of the method. Then, get the bcel list of parameter types. This is just obtained by parsing the signature, so it is a pretty safe bet. From the type, you can deduce whether you have category 1 or 2, i.e., one or two offsets. So now that you know the offset, and the fact that a parameter is defined at line 0, you can use bcel to get the name. Again, this is a safe bet, because the local variable table burned into the .class file is the final authority, and that is where bcel will go, given an offset and line number. Onward. Modified Paths: -------------- branches/mango/Mango/Mango/src/mango/worker/workFlow/model/HitemUtil.java branches/mango/Mango/Mango/src/mango/worker/workFlow/translate/agent/TranslateModuleAgent.java branches/mango/Mango/Mango/src/mango/worker/workFlow/translate/trap/ScriptedTranslateTrap.java branches/mango/Mango/Mango/src/mango/worker/workFlow/translate/trap/TranslateTrap.java branches/mango/Mango/javapathfinder-mango-bridge/mango/scanner/MangoMethodPeer.java This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |