Package com.subhajit.codeanalysis.reflection

Examples of com.subhajit.codeanalysis.reflection.InvokeInstruction


    }

    for (Instruction line : code) {
      if (line instanceof InvokeInstruction) {
        sLog.fine("InvokeInstruction - " + line.toString());
        InvokeInstruction destInvokeInstruction = (InvokeInstruction) line;
        final String invokedClassName = destInvokeInstruction
            .getInvokedClass();

        // Check if this is a class of interest.
        if (filters != null) {
          if (!checkPackageMatch(filters, invokedClassName)) {
            sLog
                .fine("Returning, since this class is not interesting.");
            continue;
          }
        }

        final ImmutableActor destActor = new ImmutableActor(
            generateSequenceDiagramActorRef(destInvokeInstruction),
            CommonUtils
                .getClassNameSansPackage(destInvokeInstruction
                    .getInvokedClass())
                + "."
                + destInvokeInstruction.getInvokedMethod());
        model.addMessage(new ImmutableMessage(srcActor, destActor,
            generateSequenceDiagramMessage(destInvokeInstruction),
            destInvokeInstruction.getInvokedMethodReturnType()));

        // Experimentally, at this point, add a sequence diagram model
        // for the destActor's invoked method.
        if (followMethodCalls) {
          sLog.fine(" method calls");
          try {
            MethodInfo destMethod = new MethodInfo(
                invokedClassName, destInvokeInstruction
                    .getInvokedMethod(),
                Utility.methodSignatureArgumentTypes(
                    destInvokeInstruction
                        .getInvokedMethodSignature(),
                    false),
                Utility.methodSignatureReturnType(
                    destInvokeInstruction
                        .getInvokedMethodSignature(),
                    false), null);

            if (!methodStack.contains(destMethod)) {
              // methodStack.add(destMethod);
View Full Code Here


      lineNumbers = lineNumberTable.getLineNumberTable();
    }

    for (Instruction line : code) {
      if (line instanceof InvokeInstruction) {
        InvokeInstruction destInvokeInstruction = (InvokeInstruction) line;
        final String invokedClassName = destInvokeInstruction
            .getInvokedClass();

        // Check if this is a class of interest.
        if (filters != null) {
          if (!checkPackageMatch(filters, invokedClassName)) {
            sLog.fine("Not analyzing - " + invokedClassName);
            continue;
          }
        }

        final ImmutableActor destActor = new ImmutableActor(
            generateSequenceDiagramActorRef(destInvokeInstruction),
            CommonUtils
                .getClassNameSansPackage(destInvokeInstruction
                    .getInvokedClass())
                + "."
                + destInvokeInstruction.getInvokedMethod());
        model.addMessage(new ImmutableMessage(srcActor, destActor,
            generateSequenceDiagramMessage(destInvokeInstruction),
            destInvokeInstruction.getInvokedMethodReturnType()));

        // Experimentally, at this point, add a sequence diagram model
        // for the destActor's invoked method.
        if (followInvokedMethods) {
          try {
            MethodInfo destMethod = new MethodInfo(
                invokedClassName, destInvokeInstruction
                    .getInvokedMethod(),
                Utility.methodSignatureArgumentTypes(
                    destInvokeInstruction
                        .getInvokedMethodSignature(),
                    false),
                Utility.methodSignatureReturnType(
                    destInvokeInstruction
                        .getInvokedMethodSignature(),
                    false), null);

            if (!methodStack.contains(destMethod)) {
              // methodStack.add(destMethod);
View Full Code Here

TOP

Related Classes of com.subhajit.codeanalysis.reflection.InvokeInstruction

Copyright © 2018 www.massapicom. 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.