< prev index next >

src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/jcore/ClassWriter.java

Print this page
*** 350,15 ***
          }
      }
      protected void writeInterfaces() throws IOException {
          KlassArray interfaces = klass.getLocalInterfaces();
          final int len = interfaces.length();
  
!         if (DEBUG) debugMessage("number of interfaces = " + len);
  
          // write interfaces count
!         dos.writeShort((short) len);
          for (int i = 0; i < len; i++) {
             Klass k = interfaces.getAt(i);
             Short index = classToIndex.get(k.getName().asString());
             dos.writeShort(index.shortValue());
             if (DEBUG) debugMessage("\t" + index);
--- 350,16 ---
          }
      }
      protected void writeInterfaces() throws IOException {
          KlassArray interfaces = klass.getLocalInterfaces();
          final int len = interfaces.length();
+         int nb_interfaces = len;
  
!         if (DEBUG) debugMessage("number of interfaces = " + nb_interfaces);
  
          // write interfaces count
!         dos.writeShort((short) nb_interfaces);
          for (int i = 0; i < len; i++) {
             Klass k = interfaces.getAt(i);
             Short index = classToIndex.get(k.getName().asString());
             dos.writeShort(index.shortValue());
             if (DEBUG) debugMessage("\t" + index);
< prev index next >