1 /**********************************************************************/
2 /* Method Info class for J2CPS */
4 /* (c) copyright QUT */
5 /**********************************************************************/
8 import java
.io
.DataInputStream
;
9 import java
.io
.IOException
;
11 public class MethodInfo
extends MemberInfo
{
13 public TypeDesc
[] parTypes
;
14 public TypeDesc retType
;
15 public String userName
;
16 public boolean deprecated
= false;
17 public int retTypeFixUp
= 0;
18 public int[] parFixUps
;
19 public boolean overridding
= false;
20 public boolean isInitProc
= false;
21 public boolean isCLInitProc
= false;
23 public MethodInfo(ConstantPool cp
,DataInputStream stream
,
24 ClassDesc thisClass
) throws IOException
{
25 super(cp
,stream
,thisClass
);
26 parTypes
= TypeDesc
.GetParTypes(signature
);
27 retType
= TypeDesc
.GetType(signature
,signature
.indexOf(')')+1);
28 if (name
.equals("<init>")) {
31 if (!ConstantPool
.isStatic(accessFlags
)) {
32 accessFlags
= (accessFlags
+ ConstantPool
.ACC_STATIC
);
34 if ((parTypes
.length
== 0) && (!ConstantPool
.isPrivate(accessFlags
))) {
35 thisClass
.hasNoArgConstructor
= true;
38 } else if (name
.equals("<clinit>")) {
42 if (ClassDesc
.verbose
) {
43 System
.out
.println("Method has " + parTypes
.length
+ " parameters");
45 //AddImport(thisClass);
46 for (int i
=0; i
< parTypes
.length
; i
++)
47 thisClass
.TryImport(parTypes
[i
]);
48 thisClass
.TryImport(retType
);
51 public MethodInfo(ClassDesc thisClass
,String name
,String jName
,int acc
) {
52 super(thisClass
,acc
,jName
);
54 if (name
.equals("<init>")) {
55 if (userName
== null) { userName
= "Init";}
60 // public void AddImport(ClassDesc thisClass) {
61 // for (int i=0; i < parTypes.length; i++)
62 // thisClass.TryImport(parTypes[i]);
63 // thisClass.TryImport(retType);
67 public String
toString() {
68 return ConstantPool
.GetAccessString(accessFlags
) + " " + name
+ " " +