OSDN Git Service

update
[stigmata/stigmata-plugins.git] / wsp / src / main / java / jp / sourceforge / stigmata / birthmarks / wsp / StackPatternBasedBirthmarkExtractor.java
index 68cfeb9..af08551 100644 (file)
@@ -6,7 +6,6 @@ package jp.sourceforge.stigmata.birthmarks.wsp;
 
 import java.util.ArrayList;
 import java.util.HashMap;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
@@ -22,7 +21,7 @@ import jp.sourceforge.stigmata.birthmarks.Opcode;
 import jp.sourceforge.stigmata.birthmarks.OpcodeExtractVisitor;
 import jp.sourceforge.stigmata.spi.BirthmarkSpi;
 
-import org.objectweb.asm.ClassWriter;
+import org.objectweb.asm.ClassVisitor;
 import org.objectweb.asm.Label;
 
 /**
@@ -36,8 +35,8 @@ public class StackPatternBasedBirthmarkExtractor extends ASMBirthmarkExtractor{
     }
 
     @Override
-    public BirthmarkExtractVisitor createExtractVisitor(ClassWriter writer, Birthmark birthmark, BirthmarkContext context){
-        return new OpcodeExtractVisitor(writer, birthmark, context, new WSPBirthmarkElementBuilder());
+    public BirthmarkExtractVisitor createExtractVisitor(ClassVisitor visitor, Birthmark birthmark, BirthmarkContext context){
+        return new OpcodeExtractVisitor(visitor, birthmark, context, new WSPBirthmarkElementBuilder());
     }
 
     @Override
@@ -89,8 +88,7 @@ public class StackPatternBasedBirthmarkExtractor extends ASMBirthmarkExtractor{
 
                     pattern.add(new CurrentDepth(currentDepth, wspOpcode));
                     if(opcode.getCategory() == Opcode.Category.BRANCH){
-                        for(Iterator<Label> i = opcode.labels(); i.hasNext(); ){
-                            Label label = i.next();
+                        for(Label label: opcode.getLabels()){
                             tableMap.put(label, currentDepth);
                         }
                     }