com.github.javaparser.ast.stmt.Statement Java Examples

The following examples show how to use com.github.javaparser.ast.stmt.Statement. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: QueryEndpointGenerator.java    From kogito-runtimes with Apache License 2.0 6 votes vote down vote up
private String getReturnType(ClassOrInterfaceDeclaration clazz) {
    MethodDeclaration toResultMethod = clazz.getMethodsByName("toResult").get(0);
    String returnType;
    if (query.getBindings().size() == 1) {
        Map.Entry<String, Class<?>> binding = query.getBindings().entrySet().iterator().next();
        String name = binding.getKey();
        returnType = binding.getValue().getCanonicalName();

        Statement statement = toResultMethod
                .getBody()
                .orElseThrow(() -> new NoSuchElementException("A method declaration doesn't contain a body!"))
                .getStatement(0);

        statement.findFirst(CastExpr.class).orElseThrow(() -> new NoSuchElementException("CastExpr not found in template.")).setType(returnType);
        statement.findFirst(StringLiteralExpr.class).orElseThrow(() -> new NoSuchElementException("StringLiteralExpr not found in template.")).setString(name);
    } else {
        returnType = "Result";
        generateResultClass(clazz, toResultMethod);
    }

    toResultMethod.setType(returnType);
    return returnType;
}
 
Example #2
Source File: DecisionContainerGenerator.java    From kogito-runtimes with Apache License 2.0 6 votes vote down vote up
@Override
public List<Statement> setupStatements() {
    return Collections.singletonList(
            new IfStmt(
                    new BinaryExpr(
                            new MethodCallExpr(new MethodCallExpr(null, "config"), "decision"),
                            new NullLiteralExpr(),
                            BinaryExpr.Operator.NOT_EQUALS
                    ),
                    new BlockStmt().addStatement(new ExpressionStmt(new MethodCallExpr(
                            new NameExpr("decisionModels"), "init", NodeList.nodeList(new ThisExpr())
                    ))),
                    null
            )
    );
}
 
Example #3
Source File: ClassCodeAnalyser.java    From CodeDefenders with GNU Lesser General Public License v3.0 6 votes vote down vote up
private void extractResultsFromIfStmt(IfStmt ifStmt, CodeAnalysisResult result) {
    Statement then = ifStmt.getThenStmt();
    Statement otherwise = ifStmt.getElseStmt().orElse(null);
    if (then instanceof BlockStmt) {

        List<Statement> thenBlockStmts = ((BlockStmt) then).getStatements();
        if (otherwise == null) {
            /*
             * This takes only the non-coverable one, meaning
             * that if } is on the same line of the last stmt it
             * is not considered here because it is should be already
             * considered
             */
            if (!thenBlockStmts.isEmpty()) {
                Statement lastInnerStatement = thenBlockStmts.get(thenBlockStmts.size() - 1);
                if (lastInnerStatement.getEnd().get().line < ifStmt.getEnd().get().line) {
                    result.closingBracket(Range.between(then.getBegin().get().line, ifStmt.getEnd().get().line));
                    result.nonCoverableCode(ifStmt.getEnd().get().line);
                }
            }
        } else {
            result.closingBracket(Range.between(then.getBegin().get().line, then.getEnd().get().line));
            result.nonCoverableCode(otherwise.getBegin().get().line);
        }
    }
}
 
Example #4
Source File: PrettyPrintVisitor.java    From stategen with GNU Affero General Public License v3.0 6 votes vote down vote up
@Override
public void visit(final SwitchEntryStmt n, final Void arg) {
    printJavaComment(n.getComment(), arg);
    if (n.getLabel().isPresent()) {
        printer.print("case ");
        n.getLabel().get().accept(this, arg);
        printer.print(":");
    } else {
        printer.print("default:");
    }
    printer.println();
    printer.indent();
    if (n.getStatements() != null) {
        for (final Statement s : n.getStatements()) {
            s.accept(this, arg);
            printer.println();
        }
    }
    printer.unindent();
}
 
Example #5
Source File: RuleUnitMetaModel.java    From kogito-runtimes with Apache License 2.0 6 votes vote down vote up
public Statement injectCollection(
        String targetUnitVar, String sourceProcVar) {
    BlockStmt blockStmt = new BlockStmt();
    RuleUnitVariable v = ruleUnitDescription.getVar(targetUnitVar);
    String appendMethod = appendMethodOf(v.getType());
    blockStmt.addStatement(assignVar(v));
    blockStmt.addStatement(
            iterate(new VariableDeclarator()
                            .setType("Object").setName("it"),
                    new NameExpr(sourceProcVar))
                    .setBody(new ExpressionStmt(
                            new MethodCallExpr()
                                    .setScope(new NameExpr(localVarName(v)))
                                    .setName(appendMethod)
                                    .addArgument(new NameExpr("it")))));
    return blockStmt;
}
 
Example #6
Source File: PrettyPrintVisitor.java    From stategen with GNU Affero General Public License v3.0 6 votes vote down vote up
@Override
public void visit(final BlockStmt n, final Void arg) {
    printOrphanCommentsBeforeThisChildNode(n);
    printJavaComment(n.getComment(), arg);
    printer.println("{");
    if (n.getStatements() != null) {
        printer.indent();
        for (final Statement s : n.getStatements()) {
            s.accept(this, arg);
            printer.println();
        }
        printer.unindent();
    }
    printOrphanCommentsEnding(n);
    printer.print("}");
}
 
Example #7
Source File: RuleUnitMetaModel.java    From kogito-runtimes with Apache License 2.0 5 votes vote down vote up
public Statement extractIntoCollection(String sourceUnitVar, String targetProcessVar) {
    BlockStmt blockStmt = new BlockStmt();
    RuleUnitVariable v = ruleUnitDescription.getVar(sourceUnitVar);
    String localVarName = localVarName(v);
    blockStmt.addStatement(assignVar(v))
            .addStatement(new ExpressionStmt(
                    new MethodCallExpr(new NameExpr(localVarName), "subscribe")
                            .addArgument(new MethodCallExpr(
                                    new NameExpr(DataObserver.class.getCanonicalName()), "of")
                                                 .addArgument(parseExpression(targetProcessVar + "::add")))));
    return blockStmt;
}
 
Example #8
Source File: MigrateJCas.java    From uima-uimaj with Apache License 2.0 5 votes vote down vote up
private void addCastExpr(Statement stmt, Type castType) {
  ReturnStmt rstmt = (ReturnStmt) stmt;
  Optional<Expression> o_expr = rstmt.getExpression(); 
  Expression expr = o_expr.isPresent() ? o_expr.get() : null;
  CastExpr ce = new CastExpr(castType, expr);
  rstmt.setExpression(ce);  // removes the parent link from expr
  if (expr != null) {
    expr.setParentNode(ce); // restore it
  }
}
 
Example #9
Source File: MigrateJCas.java    From uima-uimaj with Apache License 2.0 5 votes vote down vote up
/**
 * Unwrap (possibly nested) 1 statement blocks
 * @param stmt -
 * @return unwrapped (non- block) statement
 */
private Statement getStmtFromStmt(Statement stmt) {
  while (stmt instanceof BlockStmt) {
    NodeList<Statement> stmts = ((BlockStmt) stmt).getStatements();
    if (stmts.size() == 1) {
      stmt = stmts.get(0);
      continue;
    }
    return null;
  }
  return stmt;
}
 
Example #10
Source File: MigrateJCas.java    From uima-uimaj with Apache License 2.0 5 votes vote down vote up
private Expression getExpressionFromStmt(Statement stmt) {
  stmt = getStmtFromStmt(stmt);
  if (stmt instanceof ExpressionStmt) {
    return getUnenclosedExpr(((ExpressionStmt)stmt).getExpression());
  }
  return null;
}
 
Example #11
Source File: MigrateJCas.java    From uima-uimaj with Apache License 2.0 5 votes vote down vote up
/**
   * Visitor for if stmts
   *   - removes feature missing test
   */
  @Override
  public void visit(IfStmt n, Object ignore) {
    do {
      // if (get_set_method == null) break;  // sometimes, these occur outside of recogn. getters/setters
      
      Expression c = n.getCondition(), e;
      BinaryExpr be, be2; 
      List<Statement> stmts;
      if ((c instanceof BinaryExpr) &&
          ((be = (BinaryExpr)c).getLeft() instanceof FieldAccessExpr) &&
          ((FieldAccessExpr)be.getLeft()).getNameAsString().equals("featOkTst")) {
        // remove the feature missing if statement
        
        // verify the remaining form 
        if (! (be.getRight() instanceof BinaryExpr) 
         || ! ((be2 = (BinaryExpr)be.getRight()).getRight() instanceof NullLiteralExpr) 
         || ! (be2.getLeft() instanceof FieldAccessExpr)

         || ! ((e = getExpressionFromStmt(n.getThenStmt())) instanceof MethodCallExpr)
         || ! (((MethodCallExpr)e).getNameAsString()).equals("throwFeatMissing")) {
          reportDeletedCheckModified("The featOkTst was modified:\n" + n.toString() + '\n');
        }
              
        BlockStmt parent = (BlockStmt) n.getParentNode().get();
        stmts = parent.getStatements();
        stmts.set(stmts.indexOf(n), new EmptyStmt()); //dont remove
                                            // otherwise iterators fail
//        parent.getStmts().remove(n);
        return;
      }
    } while (false);
    
    super.visit(n,  ignore);
  }
 
Example #12
Source File: MigrateJCas.java    From uima-uimaj with Apache License 2.0 5 votes vote down vote up
/***************
 * Constructors
 *   - modify the 2 arg constructor - changing the args and the body
 * @param n - the constructor node
 * @param ignored -
 */
@Override
public void visit(ConstructorDeclaration n, Object ignored) {
  super.visit(n, ignored);  // processes the params 
  if (!isConvert2v3) {  // for enums, annotations
    return;
  }
  List<Parameter> ps = n.getParameters();
  
  if (ps.size() == 2 && 
      getParmTypeName(ps, 0).equals("int") &&
      getParmTypeName(ps, 1).equals("TOP_Type")) {
      
    /** public Foo(TypeImpl type, CASImpl casImpl) {
     *   super(type, casImpl);
     *   readObject();
     */
    setParameter(ps, 0, "TypeImpl", "type");
    setParameter(ps, 1, "CASImpl", "casImpl");
    
    // Body: change the 1st statement (must be super)
    NodeList<Statement> stmts = n.getBody().getStatements();
    if (!(stmts.get(0) instanceof ExplicitConstructorInvocationStmt)) {
      recordBadConstructor("missing super call");
      return;
    }
    NodeList<Expression> args = ((ExplicitConstructorInvocationStmt)(stmts.get(0))).getArguments();
    args.set(0, new NameExpr("type"));
    args.set(1,  new NameExpr("casImpl"));
   
    // leave the rest unchanged.
  }      
}
 
Example #13
Source File: Sources.java    From sundrio with Apache License 2.0 5 votes vote down vote up
public Block apply(BlockStmt block) {
    List<io.sundr.codegen.model.Statement> statements = new ArrayList<io.sundr.codegen.model.Statement>();
    if (block != null) {
        for (Statement stmt : block.getStmts()) {
            statements.add(STATEMENT.apply(stmt));
        }
    }
    return new BlockBuilder().withStatements(statements).build();
}
 
Example #14
Source File: PrettyPrintVisitor.java    From stategen with GNU Affero General Public License v3.0 5 votes vote down vote up
@Override
public void visit(LambdaExpr n, Void arg) {
    printJavaComment(n.getComment(), arg);

    final NodeList<Parameter> parameters = n.getParameters();
    final boolean printPar = n.isEnclosingParameters();

    if (printPar) {
        printer.print("(");
    }
    for (Iterator<Parameter> i = parameters.iterator(); i.hasNext(); ) {
        Parameter p = i.next();
        p.accept(this, arg);
        if (i.hasNext()) {
            printer.print(", ");
        }
    }
    if (printPar) {
        printer.print(")");
    }

    printer.print(" -> ");
    final Statement body = n.getBody();
    if (body instanceof ExpressionStmt) {
        // Print the expression directly
        ((ExpressionStmt) body).getExpression().accept(this, arg);
    } else {
        body.accept(this, arg);
    }
}
 
Example #15
Source File: RuleUnitMetaModel.java    From kogito-runtimes with Apache License 2.0 5 votes vote down vote up
public Statement extractIntoScalar(String sourceUnitVar, String targetProcessVar) {
    BlockStmt blockStmt = new BlockStmt();
    RuleUnitVariable v = ruleUnitDescription.getVar(sourceUnitVar);
    String localVarName = localVarName(v);
    blockStmt.addStatement(assignVar(v))
            .addStatement(new ExpressionStmt(
                    new MethodCallExpr(new NameExpr(localVarName), "subscribe")
                            .addArgument(new MethodCallExpr(
                                    new NameExpr(DataObserver.class.getCanonicalName()), "ofUpdatable")
                                                 .addArgument(parseExpression("o -> kcontext.setVariable(\"" + targetProcessVar + "\", o)")))));

    return blockStmt;
}
 
Example #16
Source File: RuleUnitMetaModel.java    From kogito-runtimes with Apache License 2.0 5 votes vote down vote up
public Statement injectScalar(String targetUnitVar, Expression sourceExpression) {
    BlockStmt blockStmt = new BlockStmt();
    RuleUnitVariable v = ruleUnitDescription.getVar(targetUnitVar);
    String appendMethod = appendMethodOf(v.getType());
    blockStmt.addStatement(assignVar(v));
    blockStmt.addStatement(
            new MethodCallExpr()
                    .setScope(new NameExpr(localVarName(v)))
                    .setName(appendMethod)
                    .addArgument(sourceExpression));
    return blockStmt;
}
 
Example #17
Source File: RuleUnitMetaModel.java    From kogito-runtimes with Apache License 2.0 5 votes vote down vote up
public NodeList<Statement> hoistVars() {
    NodeList<Statement> statements = new NodeList<>();
    for (RuleUnitVariable v : ruleUnitDescription.getUnitVarDeclarations()) {
        statements.add(new ExpressionStmt(assignVar(v)));
    }
    return statements;
}
 
Example #18
Source File: AbstractNodeVisitor.java    From kogito-runtimes with Apache License 2.0 5 votes vote down vote up
protected Statement makeAssignmentFromModel(Variable v, String name) {
    ClassOrInterfaceType type = parseClassOrInterfaceType(v.getType().getStringType());
    // `type` `name` = (`type`) `model.get<Name>
    AssignExpr assignExpr = new AssignExpr(
            new VariableDeclarationExpr(type, name),
            new CastExpr(
                    type,
                    new MethodCallExpr(
                            new NameExpr("model"),
                            "get" + StringUtils.capitalize(name))),
            AssignExpr.Operator.ASSIGN);

    return new ExpressionStmt(assignExpr);
}
 
Example #19
Source File: AbstractNodeVisitor.java    From kogito-runtimes with Apache License 2.0 5 votes vote down vote up
public static Statement makeAssignment(String targetLocalVariable, Variable processVariable) {
    ClassOrInterfaceType type = parseClassOrInterfaceType(processVariable.getType().getStringType());
    // `type` `name` = (`type`) `kcontext.getVariable
    AssignExpr assignExpr = new AssignExpr(
            new VariableDeclarationExpr(type, targetLocalVariable),
            new CastExpr(
                    type,
                    new MethodCallExpr(
                            new NameExpr(KCONTEXT_VAR),
                            "getVariable")
                            .addArgument(new StringLiteralExpr(targetLocalVariable))),
            AssignExpr.Operator.ASSIGN);
    return new ExpressionStmt(assignExpr);
}
 
Example #20
Source File: DMNRestResourceGenerator.java    From kogito-runtimes with Apache License 2.0 5 votes vote down vote up
private void addMonitoringToMethod(MethodDeclaration method, String nameURL) {
    BlockStmt body = method.getBody().orElseThrow(() -> new NoSuchElementException("This method should be invoked only with concrete classes and not with abstract methods or interfaces."));
    NodeList<Statement> statements = body.getStatements();
    ReturnStmt returnStmt = body.findFirst(ReturnStmt.class).orElseThrow(() -> new NoSuchElementException("Return statement not found: can't add monitoring to endpoint. Template was modified."));
    statements.addFirst(parseStatement("double startTime = System.nanoTime();"));
    statements.addBefore(parseStatement("double endTime = System.nanoTime();"), returnStmt);
    statements.addBefore(parseStatement("SystemMetricsCollector.registerElapsedTimeSampleMetrics(\"" + nameURL + "\", endTime - startTime);"), returnStmt);
    statements.addBefore(parseStatement(String.format("DMNResultMetricsBuilder.generateMetrics(result, \"%s\");", nameURL)), returnStmt);
}
 
Example #21
Source File: DMNRestResourceGenerator.java    From kogito-runtimes with Apache License 2.0 5 votes vote down vote up
private void addExceptionMetricsLogging(ClassOrInterfaceDeclaration template, String nameURL) {
    MethodDeclaration method = template.findFirst(MethodDeclaration.class, x -> "toResponse".equals(x.getNameAsString()))
            .orElseThrow(() -> new NoSuchElementException("Method toResponse not found, template has changed."));

    BlockStmt body = method.getBody().orElseThrow(() -> new NoSuchElementException("This method should be invoked only with concrete classes and not with abstract methods or interfaces."));
    ReturnStmt returnStmt = body.findFirst(ReturnStmt.class).orElseThrow(() -> new NoSuchElementException("Check for null dmn result not found, can't add monitoring to endpoint."));
    NodeList<Statement> statements = body.getStatements();
    String methodArgumentName = method.getParameters().get(0).getNameAsString();
    statements.addBefore(parseStatement(String.format("SystemMetricsCollector.registerException(\"%s\", %s.getStackTrace()[0].toString());", nameURL, methodArgumentName)), returnStmt);
}
 
Example #22
Source File: QueryEndpointGenerator.java    From kogito-runtimes with Apache License 2.0 5 votes vote down vote up
private void addMonitoringToResource(CompilationUnit cu, MethodDeclaration[] methods, String nameURL) {
    cu.addImport(new ImportDeclaration(new Name("org.kie.kogito.monitoring.system.metrics.SystemMetricsCollector"), false, false));

    for (MethodDeclaration md : methods) {
        BlockStmt body = md.getBody().orElseThrow(() -> new NoSuchElementException("A method declaration doesn't contain a body!"));
        NodeList<Statement> statements = body.getStatements();
        ReturnStmt returnStmt = body.findFirst(ReturnStmt.class).orElseThrow(() -> new NoSuchElementException("A method declaration doesn't contain a return statement!"));
        statements.addFirst(parseStatement("double startTime = System.nanoTime();"));
        statements.addBefore(parseStatement("double endTime = System.nanoTime();"), returnStmt);
        statements.addBefore(parseStatement("SystemMetricsCollector.registerElapsedTimeSampleMetrics(\"" + nameURL + "\", endTime - startTime);"), returnStmt);
        md.setBody(wrapBodyAddingExceptionLogging(body, nameURL));
    }
}
 
Example #23
Source File: QueryEndpointGenerator.java    From kogito-runtimes with Apache License 2.0 5 votes vote down vote up
private void generateQueryMethods(CompilationUnit cu, ClassOrInterfaceDeclaration clazz, String returnType) {
    boolean hasDI = annotator != null;
    MethodDeclaration queryMethod = clazz.getMethodsByName("executeQuery").get(0);
    queryMethod.getParameter(0).setType(ruleUnit.getCanonicalName() + (hasDI ? "" : "DTO"));
    setGeneric(queryMethod.getType(), returnType);

    Statement statement = queryMethod
            .getBody()
            .orElseThrow(() -> new NoSuchElementException("A method declaration doesn't contain a body!"))
            .getStatement(0);
    statement.findAll(VariableDeclarator.class).forEach(decl -> setUnitGeneric(decl.getType()));
    statement.findAll( MethodCallExpr.class ).forEach( m -> m.addArgument( hasDI ? "unitDTO" : "unitDTO.get()" ) );

    Statement returnStatement = queryMethod
            .getBody()
            .orElseThrow(() -> new NoSuchElementException("A method declaration doesn't contain a body!"))
            .getStatement(1);
    returnStatement.findAll(VariableDeclarator.class).forEach(decl -> setGeneric(decl.getType(), returnType));

    MethodDeclaration queryMethodSingle = clazz.getMethodsByName("executeQueryFirst").get(0);
    queryMethodSingle.getParameter(0).setType(ruleUnit.getCanonicalName() + (hasDI ? "" : "DTO"));
    queryMethodSingle.setType(toNonPrimitiveType(returnType));

    Statement statementSingle = queryMethodSingle
            .getBody()
            .orElseThrow(() -> new NoSuchElementException("A method declaration doesn't contain a body!"))
            .getStatement(0);
    statementSingle.findAll(VariableDeclarator.class).forEach(decl -> setGeneric(decl.getType(), returnType));

    Statement returnMethodSingle = queryMethodSingle
            .getBody()
            .orElseThrow(() -> new NoSuchElementException("A method declaration doesn't contain a body!"))
            .getStatement(1);
    returnMethodSingle.findAll(VariableDeclarator.class).forEach(decl -> decl.setType(toNonPrimitiveType(returnType)));

    if (useMonitoring) {
        addMonitoringToResource(cu, new MethodDeclaration[]{queryMethod, queryMethodSingle}, endpointName);
    }
}
 
Example #24
Source File: ApplicationSection.java    From kogito-runtimes with Apache License 2.0 4 votes vote down vote up
default List<Statement> setupStatements() {
    return Collections.emptyList();
}
 
Example #25
Source File: Sources.java    From sundrio with Apache License 2.0 4 votes vote down vote up
public StringStatement apply(Statement stmt) {
    return new StringStatementBuilder().withProvider(() -> stmt.toString()).build();
}
 
Example #26
Source File: AbstractNodeVisitor.java    From kogito-runtimes with Apache License 2.0 4 votes vote down vote up
protected Statement makeAssignmentFromModel(Variable v) {
    return makeAssignmentFromModel(v, v.getSanitizedName());
}
 
Example #27
Source File: AbstractNodeVisitor.java    From kogito-runtimes with Apache License 2.0 4 votes vote down vote up
public static Statement makeAssignment(Variable v) {
    String name = v.getSanitizedName();
    return makeAssignment(name, v);
}
 
Example #28
Source File: MigrateJCas.java    From uima-uimaj with Apache License 2.0 4 votes vote down vote up
/** 
 * visitor for method calls
 */
@Override
public void visit(MethodCallExpr n, Object ignore) {
  Optional<Node> p1, p2, p3 = null; 
  Node updatedNode = null;
  NodeList<Expression> args;
  
  do {
    if (get_set_method == null) break;
   
    /** remove checkArraybounds statement **/
    if (n.getNameAsString().equals("checkArrayBounds") &&
        ((p1 = n.getParentNode()).isPresent() && p1.get() instanceof ExpressionStmt) &&
        ((p2 = p1.get().getParentNode()).isPresent() && p2.get() instanceof BlockStmt) &&
        ((p3 = p2.get().getParentNode()).isPresent() && p3.get() == get_set_method)) {
      NodeList<Statement> stmts = ((BlockStmt)p2.get()).getStatements();
      stmts.set(stmts.indexOf(p1.get()), new EmptyStmt());
      return;
    }
         
    // convert simpleCore expression ll_get/setRangeValue
    boolean useGetter = isGetter || isArraySetter;
    if (n.getNameAsString().startsWith("ll_" + (useGetter ? "get" : "set") + rangeNameV2Part + "Value")) {
      args = n.getArguments();
      if (args.size() != (useGetter ? 2 : 3)) break;
      String suffix = useGetter ? "Nc" : rangeNamePart.equals("Feature") ? "NcWj" : "Nfc";
      String methodName = "_" + (useGetter ? "get" : "set") + rangeNamePart + "Value" + suffix; 
      args.remove(0);    // remove the old addr arg
      // arg 0 converted when visiting args FieldAccessExpr 
      n.setScope(null);
      n.setName(methodName);
    }
    
    // convert array sets/gets
    String z = "ll_" + (isGetter ? "get" : "set");
    String nname = n.getNameAsString();
    if (nname.startsWith(z) &&
        nname.endsWith("ArrayValue")) {
      
      String s = nname.substring(z.length());
      s = s.substring(0,  s.length() - "Value".length()); // s = "ShortArray",  etc.
      if (s.equals("RefArray")) s = "FSArray";
      if (s.equals("IntArray")) s = "IntegerArray";
      EnclosedExpr ee = new EnclosedExpr(
          new CastExpr(new ClassOrInterfaceType(s), n.getArguments().get(0)));
      
      n.setScope(ee);    // the getter for the array fs
      n.setName(isGetter ? "get" : "set");
      n.getArguments().remove(0);
    }
    
    /** remove ll_getFSForRef **/
    /** remove ll_getFSRef **/
    if (n.getNameAsString().equals("ll_getFSForRef") ||
        n.getNameAsString().equals("ll_getFSRef")) {
      updatedNode = replaceInParent(n, n.getArguments().get(0));        
    }
    
    
    
  } while (false);
      
  if (updatedNode != null) {
    updatedNode.accept(this,  null);
  } else {
    super.visit(n, null);
  }
}