private BlockStatement transformBlock(final Block block) { final BlockStatement astBlock = new BlockStatement(); if (block != null) { final List<Node> children = block.getChildren(); for (int i = 0; i < children.size(); i++) { final Node node = children.get(i); final Statement statement = transformNode( node, i < children.size() - 1 ? children.get(i + 1) : null ); astBlock.getStatements().add(statement); if (statement instanceof SynchronizedStatement) { i++; } } } return astBlock; }
private BlockStatement transformBlock(final Block block) { final BlockStatement astBlock = new BlockStatement(); if (block != null) { final List<Node> children = block.getChildren(); for (int i = 0; i < children.size(); i++) { final Node node = children.get(i); final Statement statement = transformNode( node, i < children.size() - 1 ? children.get(i + 1) : null ); astBlock.getStatements().add(statement); if (statement instanceof SynchronizedStatement) { i++; } } } return astBlock; }
private BlockStatement transformBlock(final Block block) { final BlockStatement astBlock = new BlockStatement(); if (block != null) { final List<Node> children = block.getChildren(); for (int i = 0; i < children.size(); i++) { final Node node = children.get(i); final Statement statement = transformNode( node, i < children.size() - 1 ? children.get(i + 1) : null ); astBlock.getStatements().add(statement); if (statement instanceof SynchronizedStatement) { i++; } } } return astBlock; }
private SynchronizedStatement transformSynchronized(final com.strobel.decompiler.ast.Expression expression, final TryCatchBlock tryCatch) { final SynchronizedStatement s = new SynchronizedStatement( expression.getOffset()); s.setExpression((Expression) transformExpression(expression.getArguments().get(0), false)); if (tryCatch.getCatchBlocks().isEmpty()) { s.setEmbeddedStatement(transformBlock(tryCatch.getTryBlock())); } else { tryCatch.setFinallyBlock(null); s.setEmbeddedStatement(new BlockStatement(transformNode(tryCatch, null))); } return s; }
private SynchronizedStatement transformSynchronized(final com.strobel.decompiler.ast.Expression expression, final TryCatchBlock tryCatch) { final SynchronizedStatement s = new SynchronizedStatement( expression.getOffset()); s.setExpression((Expression) transformExpression(expression.getArguments().get(0), false)); if (tryCatch.getCatchBlocks().isEmpty()) { s.setEmbeddedStatement(transformBlock(tryCatch.getTryBlock())); } else { tryCatch.setFinallyBlock(null); s.setEmbeddedStatement(new BlockStatement(transformNode(tryCatch, null))); } return s; }
private SynchronizedStatement transformSynchronized(final com.strobel.decompiler.ast.Expression expression, final TryCatchBlock tryCatch) { final SynchronizedStatement s = new SynchronizedStatement( expression.getOffset()); s.setExpression((Expression) transformExpression(expression.getArguments().get(0), false)); if (tryCatch.getCatchBlocks().isEmpty()) { s.setEmbeddedStatement(transformBlock(tryCatch.getTryBlock())); } else { tryCatch.setFinallyBlock(null); s.setEmbeddedStatement(new BlockStatement(transformNode(tryCatch, null))); } return s; }
@Override public Void visitLabelStatement(final LabelStatement node, final Void data) { super.visitLabelStatement(node, data); final Statement next = node.getNextStatement(); if (next == null) { return null; } if (next instanceof LabelStatement || next instanceof LabeledStatement) { // // We have back-to-back labels; dump the first and redirect its references to the second. // final String nextLabel = next.getChildByRole(Roles.LABEL).getName(); redirectLabels(node.getParent(), node.getLabel(), nextLabel); node.remove(); } else { // // Replace LabelStatement with LabeledStatement. // next.remove(); node.replaceWith( new LabeledStatement( node.getLabel(), AstNode.isLoop(next) ? next : new BlockStatement(next) ) ); } return null; }
@Override public Void visitLabelStatement(final LabelStatement node, final Void data) { super.visitLabelStatement(node, data); final Statement next = node.getNextStatement(); if (next == null) { return null; } if (next instanceof LabelStatement || next instanceof LabeledStatement) { // // We have back-to-back labels; dump the first and redirect its references to the second. // final String nextLabel = next.getChildByRole(Roles.LABEL).getName(); redirectLabels(node.getParent(), node.getLabel(), nextLabel); node.remove(); } else { // // Replace LabelStatement with LabeledStatement. // next.remove(); node.replaceWith( new LabeledStatement( node.getLabel(), AstNode.isLoop(next) ? next : new BlockStatement(next) ) ); } return null; }
@Override public Void visitLabelStatement(final LabelStatement node, final Void data) { super.visitLabelStatement(node, data); final Statement next = node.getNextStatement(); if (next == null) { return null; } if (next instanceof LabelStatement || next instanceof LabeledStatement) { // // We have back-to-back labels; dump the first and redirect its references to the second. // final String nextLabel = next.getChildByRole(Roles.LABEL).getName(); redirectLabels(node.getParent(), node.getLabel(), nextLabel); node.remove(); } else { // // Replace LabelStatement with LabeledStatement. // next.remove(); node.replaceWith( new LabeledStatement( node.getLabel(), AstNode.isLoop(next) ? next : new BlockStatement(next) ) ); } return null; }
final BlockStatement initializerBody = new BlockStatement();
private Statement canInlineInitializerDeclarations(final ForStatement forLoop) { TypeReference variableType = null; final BlockStatement tempOuter = new BlockStatement(); final BlockStatement temp = new BlockStatement(); final Statement[] initializers = forLoop.getInitializers().toArray(new Statement[forLoop.getInitializers().size()]); final Set<String> variableNames = new HashSet<>();
final BlockStatement initializerBody = new BlockStatement();
private Statement canInlineInitializerDeclarations(final ForStatement forLoop) { TypeReference variableType = null; final BlockStatement tempOuter = new BlockStatement(); final BlockStatement temp = new BlockStatement(); final Statement[] initializers = forLoop.getInitializers().toArray(new Statement[forLoop.getInitializers().size()]); final Set<String> variableNames = new HashSet<>();
private Statement canInlineInitializerDeclarations(final ForStatement forLoop) { TypeReference variableType = null; final BlockStatement tempOuter = new BlockStatement(); final BlockStatement temp = new BlockStatement(); final Statement[] initializers = forLoop.getInitializers().toArray(new Statement[forLoop.getInitializers().size()]); final Set<String> variableNames = new HashSet<>();
final BlockStatement initializerBody = new BlockStatement();
final Throwable t) { final BlockStatement block = new BlockStatement();
final BlockStatement initializerBody = new BlockStatement();
final BlockStatement initializerBody = new BlockStatement();
final BlockStatement initializerBody = new BlockStatement();
pattern.getModifiers().add(new JavaModifierToken(Modifier.STATIC)); pattern.setBody( new BlockStatement( new ReturnStatement( Expression.MYSTERY_OFFSET,