changeset 450:a0bc675db202

ASMClassInfo should read declared class.
author shade
date Sat, 01 Mar 2014 01:24:06 +0400
parents 1485959814af
children d1f2c90bd7f6
files jmh-core/src/main/java/org/openjdk/jmh/generators/bytecode/ASMClassInfo.java
diffstat 1 files changed, 12 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/jmh-core/src/main/java/org/openjdk/jmh/generators/bytecode/ASMClassInfo.java	Sat Mar 01 01:13:16 2014 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/generators/bytecode/ASMClassInfo.java	Sat Mar 01 01:24:06 2014 +0400
@@ -56,6 +56,7 @@
     private final Map<String, AnnHandler> annotations = new HashMap<String, AnnHandler>();
     private final ClassInfoRepo classInfos;
     private String superName;
+    private String declaringClass;
 
     public ASMClassInfo(ClassInfoRepo classInfos) {
         super(Opcodes.ASM4);
@@ -156,9 +157,18 @@
     }
 
     @Override
+    public void visitOuterClass(String owner, String name, String desc) {
+        declaringClass = name;
+        super.visitOuterClass(owner, name, desc);
+    }
+
+    @Override
     public ClassInfo getEnclosingClass() {
-        // TODO: FIXME
-        return null;
+        if (declaringClass != null) {
+            return classInfos.get(declaringClass);
+        } else {
+            return null;
+        }
     }
 
     @Override