licensing update to APSL 2.0
[org.ibex.gcclass.git] / src / org / ibex / gcclass / DumpCP.java
1 // Copyright 2000-2005 the Contributors, as shown in the revision logs.
2 // Licensed under the Apache Public Source License 2.0 ("the License").
3 // You may not use this file except in compliance with the License.
4
5 package org.ibex.gcclass;
6
7 import java.util.*;
8 import java.io.*;
9 import org.apache.bcel.util.*;
10 import org.apache.bcel.classfile.*;
11
12 public class DumpCP {
13     public static void main(String[] args) throws Exception {
14         if(args.length < 2) {
15             System.err.println("Usage DumpCP classpath class");
16             System.exit(1);
17         }
18         String classpath = ClassPath.SYSTEM_CLASS_PATH + File.pathSeparator + args[0];
19         Repository repo = SyntheticRepository.getInstance(new ClassPath(classpath));
20         
21         JavaClass c = repo.loadClass(args[1]);
22         ConstantPool cp = c.getConstantPool();
23         System.out.println(cp);
24     }
25 }