Examples of Analyzer


Examples of org.objectweb.asm.tree.analysis.Analyzer

public class NullDereferenceAnalyzer {

  public List<AbstractInsnNode> findNullDereferences(String owner,
      MethodNode mn) throws AnalyzerException {
    List<AbstractInsnNode> result = new ArrayList<AbstractInsnNode>();
    Analyzer a = new Analyzer(new IsNullInterpreter());
    a.analyze(owner, mn);
    Frame[] frames = a.getFrames();
    AbstractInsnNode[] insns = mn.instructions.toArray();
    for (int i = 0; i < insns.length; ++i) {
      AbstractInsnNode insn = insns[i];
      if (frames[i] != null) {
        Value v = getTarget(insn, frames[i]);
View Full Code Here

Examples of org.objectweb.asm.tree.analysis.Analyzer

    super(mt);
    this.owner = owner;
  }

  public void transform(MethodNode mn) {
    Analyzer a = new Analyzer(new SimpleVerifier());
    try {
      a.analyze(owner, mn);
      Frame[] frames = a.getFrames();
      AbstractInsnNode[] insns = mn.instructions.toArray();
      for (int i = 0; i < insns.length; ++i) {
        AbstractInsnNode insn = insns[i];
        if (insn.getOpcode() == CHECKCAST) {
          Frame f = frames[i];
View Full Code Here

Examples of org.objectweb.asm.tree.analysis.Analyzer

    next = mv;
  }

  public void visitEnd() {
    MethodNode mn = (MethodNode) mv;
    Analyzer a = new Analyzer(new BasicVerifier());
    try {
      a.analyze(owner, mn);
    } catch (AnalyzerException e) {
      throw new RuntimeException(e.getMessage());
    }
    mn.accept(next);
  }
View Full Code Here

Examples of org.objectweb.asm.tree.analysis.Analyzer

        cr.accept(cn, 0);
        List methods = cn.methods;
        for (int k = 0; k < methods.size(); ++k) {
          MethodNode method = (MethodNode) methods.get(k);
          if (method.instructions.size() > 0) {
            Analyzer a = new Analyzer(new BasicInterpreter());
            try {
              a.analyze(cn.name, method);
            } catch (Throwable th) {
              ++errors;
            }
          }
        }
      }
      t = System.currentTimeMillis() - t;
      times[13] = Math.min(t, times[13]);
      System.out.println("Time to analyze " + classes.size() / 10
          + " classes with BasicInterpreter = " + t + " ms (" + errors
          + " errors)");
    }

    for (int i = 0; i < 10; ++i) {
      int errors = 0;
      long t = System.currentTimeMillis();
      for (int j = 0; j < classes.size() / 10; ++j) {
        byte[] b = (byte[]) classes.get(j);
        ClassReader cr = new ClassReader(b);
        ClassNode cn = new ClassNode();
        cr.accept(cn, 0);
        List methods = cn.methods;
        for (int k = 0; k < methods.size(); ++k) {
          MethodNode method = (MethodNode) methods.get(k);
          if (method.instructions.size() > 0) {
            Analyzer a = new Analyzer(new SimpleVerifier());
            try {
              a.analyze(cn.name, method);
            } catch (Throwable th) {
              ++errors;
            }
          }
        }
View Full Code Here

Examples of org.ow2.easybeans.asm.tree.analysis.Analyzer

        cr.accept(new CheckClassAdapter(cn), ClassReader.SKIP_DEBUG);
        List methods = cn.methods;
        for (int i = 0; i < methods.size(); ++i) {
            MethodNode method = (MethodNode) methods.get(i);
            if (method.instructions.size() > 0) {
                Analyzer a = new Analyzer(new SimpleVerifier(Type.getType("L" + cn.name + ";"), Type.getType("L" + cn.superName
                        + ";"), (cn.access & Opcodes.ACC_INTERFACE) != 0));
                AnalyzerException throwE = null;
                try {
                    a.analyze(cn.name, method);
                    continue;
                } catch (AnalyzerException e) {
                    throwE = e;
                }
                final Frame[] frames = a.getFrames();

                if (throwE != null) {
                    System.out.println(method.name + method.desc);

                    TraceMethodVisitor mv = new TraceMethodVisitor() {
View Full Code Here

Examples of org.owasp.dependencycheck.analyzer.Analyzer

        }

        final AnalyzerService service = new AnalyzerService(serviceClassLoader);
        final Iterator<Analyzer> iterator = service.getAnalyzers();
        while (iterator.hasNext()) {
            final Analyzer a = iterator.next();
            analyzers.get(a.getAnalysisPhase()).add(a);
            if (a instanceof FileTypeAnalyzer) {
                this.fileTypeAnalyzers.add((FileTypeAnalyzer) a);
            }
        }
    }
View Full Code Here

Examples of org.yinwang.pysonar.Analyzer

            rootPath = _.unifyPath(rootDir);
        } catch (Exception e) {
            _.die("File not found: " + f);
        }

        analyzer = new Analyzer(options);
        _.msg("Loading and analyzing files");
        analyzer.analyze(f.getPath());
        analyzer.finish();

        generateHtml();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.