Re: Naming Arrays
Ray Blaak <[email protected]>
| Newsgroups | gmane.comp.jakarta.bcel.devel |
|---|---|
| Message-ID | <[email protected]> |
Shrinivas Joshi wrote: >Hi, > Is there any way by which some sort of special attribute can be >assigned to instructions. like for e.g. is it possible to assign a name to >array created using InstructionFactory.createNewArray(). > If at generation time, then you simply store it in a local var in your generation code and hang on to it. If you are loading and need to distinguish it then, you could prefix it with a specially named string constant, e.g.: final String mySpecialArrayIsNext = "my special array is next"; ... But why do you need to do this? Code just runs. Do you need to mark the class file as being marked up in some way? You could simply insert a constant attribute to indicate that, perhaps storing the code location in it if you need to know where. I would try instead to restructure your problem so that you don't need to do this at all.