DEADSOFTWARE

Remove batch
[gpcp-linux.git] / J2CPS / MethodInfo.java
1 /**********************************************************************/
2 /* Method Info class for J2CPS */
3 /* */
4 /* (c) copyright QUT */
5 /**********************************************************************/
6 package J2CPS;
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>")) {
29 userName = "Init";
30 isInitProc = true;
31 if (!ConstantPool.isStatic(accessFlags)) {
32 accessFlags = (accessFlags + ConstantPool.ACC_STATIC);
33 }
34 if ((parTypes.length == 0) && (!ConstantPool.isPrivate(accessFlags))) {
35 thisClass.hasNoArgConstructor = true;
36 }
37 retType = thisClass;
38 } else if (name.equals("<clinit>")) {
39 userName="CLInit";
40 isCLInitProc = true;
41 }
42 if (ClassDesc.verbose) {
43 System.out.println("Method has " + parTypes.length + " parameters");
44 }
45 //AddImport(thisClass);
46 for (int i=0; i < parTypes.length; i++)
47 thisClass.TryImport(parTypes[i]);
48 thisClass.TryImport(retType);
49 }
51 public MethodInfo(ClassDesc thisClass,String name,String jName,int acc) {
52 super(thisClass,acc,jName);
53 userName = name;
54 if (name.equals("<init>")) {
55 if (userName == null) { userName = "Init";}
56 isInitProc = true;
57 }
58 }
60 // public void AddImport(ClassDesc thisClass) {
61 // for (int i=0; i < parTypes.length; i++)
62 // thisClass.TryImport(parTypes[i]);
63 // thisClass.TryImport(retType);
64 // }
66 @Override
67 public String toString() {
68 return ConstantPool.GetAccessString(accessFlags) + " " + name + " " +
69 signature;
70 }
72 }