private void set(JCTree node, Node value) { if (result != null) throw new IllegalStateException("result is already set"); if (value != null && value.getPosition().isUnplaced()) setPos(node, value); java.util.List<Node> result = Lists.newArrayList(); if (value != null) result.add(value); this.result = result; }
private void set(JCTree node, Node value) { if (result != null) throw new IllegalStateException("result is already set"); if (value != null && value.getPosition().isUnplaced()) setPos(node, value); java.util.List<Node> result = Lists.newArrayList(); if (value != null) result.add(value); this.result = result; }
private void set(JCTree node, Node value) { if (result != null) throw new IllegalStateException("result is already set"); if (value != null && value.getPosition().isUnplaced()) setPos(node, value); java.util.List<Node> result = Lists.newArrayList(); if (value != null) result.add(value); this.result = result; }
private boolean isUndocumented(lombok.ast.Node block) { if (block == null) return false; if (rawInput == null) return false; lombok.ast.Position pos = block.getPosition(); if (pos.isUnplaced() || pos.size() < 3) return true; String content = rawInput.substring(pos.getStart() + 1, pos.getEnd() - 1); return content.trim().isEmpty(); } };
private boolean isUndocumented(lombok.ast.Node block) { if (block == null) return false; if (rawInput == null) return false; lombok.ast.Position pos = block.getPosition(); if (pos.isUnplaced() || pos.size() < 3) return true; String content = rawInput.substring(pos.getStart() + 1, pos.getEnd() - 1); return content.trim().isEmpty(); } };
private boolean isUndocumented(lombok.ast.Node block) { if (block == null) return false; if (rawInput == null) return false; lombok.ast.Position pos = block.getPosition(); if (pos.isUnplaced() || pos.size() < 3) return true; String content = rawInput.substring(pos.getStart() + 1, pos.getEnd() - 1); return content.trim().isEmpty(); } };
private static int start(lombok.ast.Node node) { if (node == null || node.getPosition().isUnplaced()) return 0; return node.getPosition().getStart(); }
private static int end(lombok.ast.Node node) { if (node == null || node.getPosition().isUnplaced()) return 0; return node.getPosition().getEnd() - 1; }
private static int end(lombok.ast.Node node) { if (node == null || node.getPosition().isUnplaced()) return 0; return node.getPosition().getEnd() - 1; }
private void posParen(Node node, int iteration, java.util.List<Position> parenPositions, JCTree jcTree) { Position p = null; if (parenPositions.size() > iteration) p = parenPositions.get(iteration); int start = (p == null || p.isUnplaced() || p.getStart() < 0) ? node.getPosition().getStart() - 1 - iteration : p.getStart(); int end = (p == null || p.isUnplaced() || p.getEnd() < 0) ? node.getPosition().getEnd() + 1 + iteration : p.getEnd(); setPos(start, end, jcTree); }
private void posParen(Node node, int iteration, java.util.List<Position> parenPositions, JCTree jcTree) { Position p = null; if (parenPositions.size() > iteration) p = parenPositions.get(iteration); int start = (p == null || p.isUnplaced() || p.getStart() < 0) ? node.getPosition().getStart() - 1 - iteration : p.getStart(); int end = (p == null || p.isUnplaced() || p.getEnd() < 0) ? node.getPosition().getEnd() + 1 + iteration : p.getEnd(); setPos(start, end, jcTree); }
private static int start(lombok.ast.Node node) { if (node == null || node.getPosition().isUnplaced()) return 0; return node.getPosition().getStart(); }
private static int start(lombok.ast.Node node) { if (node == null || node.getPosition().isUnplaced()) return 0; return node.getPosition().getStart(); }
private static int end(lombok.ast.Node node) { if (node == null || node.getPosition().isUnplaced()) return 0; return node.getPosition().getEnd() - 1; }
private void posParen(Node node, int iteration, java.util.List<Position> parenPositions, JCTree jcTree) { Position p = null; if (parenPositions.size() > iteration) p = parenPositions.get(iteration); int start = (p == null || p.isUnplaced() || p.getStart() < 0) ? node.getPosition().getStart() - 1 - iteration : p.getStart(); int end = (p == null || p.isUnplaced() || p.getEnd() < 0) ? node.getPosition().getEnd() + 1 + iteration : p.getEnd(); setPos(start, end, jcTree); }
public Node createUnaryPostfixExpression(Node operand, List<org.parboiled.Node<Node>> nodes, List<String> operators) { if (operators == null) return operand; Node current = operand; for (int i = 0; i < operators.size(); i++) { String op = operators.get(i); if (op == null) continue; op = op.trim(); Node prev = current; if (op.equals("++")) current = new UnaryExpression().rawOperand(current).astOperator(UnaryOperator.POSTFIX_INCREMENT); else if (op.equals("--")) current = new UnaryExpression().rawOperand(current).astOperator(UnaryOperator.POSTFIX_DECREMENT); org.parboiled.Node<Node> p = nodes.get(i); if (prev != null && !prev.getPosition().isUnplaced() && p != null) { current.setPosition(new Position(prev.getPosition().getStart(), p.getEndIndex())); } } return current; }
public Node createUnaryPostfixExpression(Node operand, List<org.parboiled.Node<Node>> nodes, List<String> operators) { if (operators == null) return operand; Node current = operand; for (int i = 0; i < operators.size(); i++) { String op = operators.get(i); if (op == null) continue; op = op.trim(); Node prev = current; if (op.equals("++")) current = new UnaryExpression().rawOperand(current).astOperator(UnaryOperator.POSTFIX_INCREMENT); else if (op.equals("--")) current = new UnaryExpression().rawOperand(current).astOperator(UnaryOperator.POSTFIX_DECREMENT); org.parboiled.Node<Node> p = nodes.get(i); if (prev != null && !prev.getPosition().isUnplaced() && p != null) { current.setPosition(new Position(prev.getPosition().getStart(), p.getEndIndex())); } } return current; }
private void attachJavadocToNode(CommentInfo javadoc, JavadocContainer node) { String content = javadoc.content; if (content.startsWith("/*") && content.endsWith("*/")) content = content.substring(2, content.length() - 2); Comment comment = new Comment().astBlockComment(true).astContent(content); comment.setPosition(new Position(javadoc.pos, javadoc.endPos)); node.astJavadoc(comment); if (!node.getPosition().isUnplaced()) { int oldStart = node.getPosition().getStart(); if (oldStart == -1 || comment.getPosition().getStart() < oldStart) { node.setPosition(new Position(comment.getPosition().getStart(), node.getPosition().getEnd())); } } }
private void attachJavadocToNode(CommentInfo javadoc, JavadocContainer node) { String content = javadoc.content; if (content.startsWith("/*") && content.endsWith("*/")) content = content.substring(2, content.length() - 2); Comment comment = new Comment().astBlockComment(true).astContent(content); comment.setPosition(new Position(javadoc.pos, javadoc.endPos)); node.astJavadoc(comment); if (!node.getPosition().isUnplaced()) { int oldStart = node.getPosition().getStart(); if (oldStart == -1 || comment.getPosition().getStart() < oldStart) { node.setPosition(new Position(comment.getPosition().getStart(), node.getPosition().getEnd())); } } }
private void attachJavadocToNode(CommentInfo javadoc, JavadocContainer node) { String content = javadoc.content; if (content.startsWith("/*") && content.endsWith("*/")) content = content.substring(2, content.length() - 2); Comment comment = new Comment().astBlockComment(true).astContent(content); comment.setPosition(new Position(javadoc.pos, javadoc.endPos)); node.astJavadoc(comment); if (!node.getPosition().isUnplaced()) { int oldStart = node.getPosition().getStart(); if (oldStart == -1 || comment.getPosition().getStart() < oldStart) { node.setPosition(new Position(comment.getPosition().getStart(), node.getPosition().getEnd())); } } }