247cff00883e150916df62aa9bb7d1fe80aca2a1
[org.ibex.gcclass.git] / src / org / ibex / gcclass / DumpCP.java
1 // Copyright (C) 2004 Brian Alliet
2
3 package org.ibex.gcclass;
4
5 import java.util.*;
6 import java.io.*;
7 import org.apache.bcel.util.*;
8 import org.apache.bcel.classfile.*;
9
10 public class DumpCP {
11     public static void main(String[] args) throws Exception {
12         if(args.length < 2) {
13             System.err.println("Usage DumpCP classpath class");
14             System.exit(1);
15         }
16         String classpath = ClassPath.SYSTEM_CLASS_PATH + File.pathSeparator + args[0];
17         Repository repo = SyntheticRepository.getInstance(new ClassPath(classpath));
18         
19         JavaClass c = repo.loadClass(args[1]);
20         ConstantPool cp = c.getConstantPool();
21         System.out.println(cp);
22     }
23 }