@Test @Ignore public void largeNumberOfClasses() { for(int i = 0; i <= Short.MAX_VALUE;i++) { int cid = Registry.registerClass("class" + i, getClass().getClassLoader(), "class" + i + ".java"); ArrayList<String> methodNames = new ArrayList<String>(); methodNames.add("<init>"); methodNames.add("main"); ArrayList<String> methodDescs = new ArrayList<String>(); methodDescs.add(""); methodDescs.add(""); Registry.registerMethods(0, methodNames, methodDescs, new HashMap<Integer, List<Integer>>()); } final Class clazz = SimpleClass.class; CoverageClassVisitor visitor = new InstrumentationTemplate(clazz).run(); assertEquals(Short.MAX_VALUE +1, visitor.getClassId()); }
public int getClassId() { return classId; }
CoverageClassVisitor extends ClassVisitor implements Opcodes { public int getClassId() { return classId; } }
CoverageClassVisitor extends ClassVisitor implements Opcodes { public int getClassId() { return classId; } CoverageClassVisitor(ClassVisitor classVisitor, int classId); }
CoverageClassVisitor extends ClassVisitor implements Opcodes { public int getClassId() { return classId; } CoverageClassVisitor(ClassVisitor classVisitor, int classId); @Override void visit(int version, int access, String name, String signature, String superName, String[] interfaces); @Override void visitInnerClass(String name, String outerName, String innerName, int access); @Override void visitSource(String source, String debug); @Override MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions); @Override void visitEnd(); int getClassId(); void setTrackTime(boolean trackTime); void setTrackBranches(boolean trackBranches); Map<Integer, List<Integer>> getMethodLineNumbers(); BitSet getExistingLines(); int[] getLineIndexes(); List<BranchPoint> getBranchPoints(); String getSource(); String getClassName(); boolean isInterface(); boolean isEnum(); List<String> getInnerClasses(); List<String> getMethodNames(); List<String> getMethodDescs(); }
CoverageClassVisitor extends ClassVisitor implements Opcodes { public int getClassId() { return classId; } CoverageClassVisitor(ClassVisitor classVisitor, int classId); @Override void visit(int version, int access, String name, String signature, String superName, String[] interfaces); @Override void visitInnerClass(String name, String outerName, String innerName, int access); @Override void visitSource(String source, String debug); @Override MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions); @Override void visitEnd(); int getClassId(); void setTrackTime(boolean trackTime); void setTrackBranches(boolean trackBranches); Map<Integer, List<Integer>> getMethodLineNumbers(); BitSet getExistingLines(); int[] getLineIndexes(); List<BranchPoint> getBranchPoints(); String getSource(); String getClassName(); boolean isInterface(); boolean isEnum(); List<String> getInnerClasses(); List<String> getMethodNames(); List<String> getMethodDescs();  }