Examples of JCIf


Examples of com.sun.tools.javac.tree.JCTree.JCIf

    if (!SUPPLY_FIX) {
      return describeMatch(tree);
    }

    // if -> while case
    JCIf enclosingIf =
        ASTHelpers.findEnclosingNode(state.getPath().getParentPath(), JCIf.class);
    if (enclosingIf != null && enclosingIf.getElseStatement() == null) {
      // Assume first 2 characters of the IfTree are "if", replace with while.
      int startPos = enclosingIf.getStartPosition();
      return describeMatch(tree, SuggestedFix.replace(startPos, startPos + 2, "while"));
    }

    // loop outside synchronized block -> move synchronized outside
    List<Class<? extends StatementTree>> loopClasses = Arrays.asList(WhileLoopTree.class, ForLoopTree.class,
View Full Code Here

Examples of com.sun.tools.javac.tree.JCTree.JCIf

                            getDefiniteSwitchExpressionType(stmt),
                            true,
                            BoxingStrategy.UNBOXED,
                            getDefiniteSwitchExpressionType(stmt)));
            // Now wrap it with a null test
            JCIf ifElse = null;
            for (Tree.CaseClause caseClause : getCaseClauses(stmt)) {
                Tree.Term term = getSingletonNullCase(caseClause);
                if (term != null) {
                    ifElse  = make().If(make().Binary(JCTree.EQ, selectorAlias.makeIdent(), makeNull()),
                            transform(caseClause.getBlock()),
View Full Code Here

Examples of com.sun.tools.javac.tree.JCTree.JCIf

                JCExpression resVar2 = expressionGen().applyErasureAndBoxing(makeUnquotedIdent(resVarName), resVarType, true, BoxingStrategy.BOXED, resVarExpectedType);
                JCMethodInvocation closeCall2 = make().Apply(null, makeQualIdent(resVar2, isDestroyable ? "destroy" : "release"), List.<JCExpression>of(exarg2));
               
                // if ($tmpex != null) { ... } else { ... }
                JCBinary closeCatchCond = make().Binary(JCTree.NE, makeUnquotedIdent(innerExTmpVarName), makeNull());
                JCIf closeCatchIf = make().If(closeCatchCond, closeTry, make().Exec(closeCall2));
   
                // try { .... } catch (Exception ex) { $tmpex=ex; throw ex; }
                // finally { try { $var.close() } catch (Exception closex) { } }
                JCExpression innerCatchExType = makeJavaType(typeFact().getThrowableDeclaration().getType(), JT_CATCH);
                JCVariableDecl innerCatchVar = make().VarDef(make().Modifiers(Flags.FINAL), innerCatchVarName, innerCatchExType, null);
View Full Code Here

Examples of com.sun.tools.javac.tree.JCTree.JCIf

            List<JCStatement> catchStmts;
            if(isDeferredInitError()){
                JCStatement rethrow = owner.make().Exec(owner.utilInvocation().rethrow(
                        owner.makeUnquotedIdent(Naming.getToplevelAttributeSavedExceptionName())));
                // rethrow the init exception if we have one
                JCIf ifThrow = owner.make().If(owner.make().Binary(JCTree.NE, owner.makeUnquotedIdent(Naming.getToplevelAttributeSavedExceptionName()),
                        owner.makeNull()), rethrow, null);
                catchStmts = List.<JCTree.JCStatement>of(ifThrow, throwStmt);
            }else{
                catchStmts = List.<JCTree.JCStatement>of(throwStmt);
            }
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.