Example #1
0
 /**
  * Gets the class file corresponding to a given instance class. The <code>klass</code> must not
  * yet be converted and it must not be a {@link Klass#isSynthetic() synthetic} class.
  *
  * @param klass the instance class for which a class file is requested
  * @return the class file for <code>klass</code>
  */
 ClassFile getClassFile(Klass klass) {
   Assert.that(!klass.isSynthetic(), "synthethic class has no classfile");
   String name = klass.getName();
   ClassFile classFile = (ClassFile) classFiles.get(name);
   if (classFile == null) {
     classFile = new ClassFile(klass);
     classFiles.put(name, classFile);
   }
   return classFile;
 }
Example #2
0
 /**
  * Like <code>klass</code> must not yet be converted and it must not be a {@link
  * Klass#isSynthetic() synthetic} class.
  *
  * @param klass the instance class for which a class file is requested
  * @return the class file for <code>klass</code>, or null if that ClassFile has not been
  *     translated by this translator.
  */
 ClassFile lookupClassFile(Klass klass) {
   Assert.that(!klass.isSynthetic(), "synthethic class has no classfile");
   ClassFile classFile = (ClassFile) classFiles.get(klass.getInternalName());
   return classFile;
 }