private static boolean locationNeedsParentheses(StructuralPropertyDescriptor locationInParent) { if (locationInParent instanceof ChildListPropertyDescriptor && locationInParent != InfixExpression.EXTENDED_OPERANDS_PROPERTY) { // e.g. argument lists of MethodInvocation, ClassInstanceCreation, dimensions of ArrayCreation ... return false; } if (locationInParent == VariableDeclarationFragment.INITIALIZER_PROPERTY || locationInParent == SingleVariableDeclaration.INITIALIZER_PROPERTY || locationInParent == ReturnStatement.EXPRESSION_PROPERTY || locationInParent == EnhancedForStatement.EXPRESSION_PROPERTY || locationInParent == ForStatement.EXPRESSION_PROPERTY || locationInParent == WhileStatement.EXPRESSION_PROPERTY || locationInParent == DoStatement.EXPRESSION_PROPERTY || locationInParent == AssertStatement.EXPRESSION_PROPERTY || locationInParent == AssertStatement.MESSAGE_PROPERTY || locationInParent == IfStatement.EXPRESSION_PROPERTY || locationInParent == SwitchStatement.EXPRESSION_PROPERTY || locationInParent == SwitchCase.EXPRESSION_PROPERTY || locationInParent == ArrayAccess.INDEX_PROPERTY || locationInParent == ThrowStatement.EXPRESSION_PROPERTY || locationInParent == SynchronizedStatement.EXPRESSION_PROPERTY || locationInParent == ParenthesizedExpression.EXPRESSION_PROPERTY) { return false; } return true; }
private static boolean locationNeedsParentheses(StructuralPropertyDescriptor locationInParent) { if (locationInParent instanceof ChildListPropertyDescriptor && locationInParent != InfixExpression.EXTENDED_OPERANDS_PROPERTY) { // e.g. argument lists of MethodInvocation, ClassInstanceCreation, dimensions of ArrayCreation // ... return false; } if (locationInParent == VariableDeclarationFragment.INITIALIZER_PROPERTY || locationInParent == SingleVariableDeclaration.INITIALIZER_PROPERTY || locationInParent == ReturnStatement.EXPRESSION_PROPERTY || locationInParent == EnhancedForStatement.EXPRESSION_PROPERTY || locationInParent == ForStatement.EXPRESSION_PROPERTY || locationInParent == WhileStatement.EXPRESSION_PROPERTY || locationInParent == DoStatement.EXPRESSION_PROPERTY || locationInParent == AssertStatement.EXPRESSION_PROPERTY || locationInParent == AssertStatement.MESSAGE_PROPERTY || locationInParent == IfStatement.EXPRESSION_PROPERTY || locationInParent == SwitchStatement.EXPRESSION_PROPERTY || locationInParent == SwitchCase.EXPRESSION_PROPERTY || locationInParent == ArrayAccess.INDEX_PROPERTY || locationInParent == ThrowStatement.EXPRESSION_PROPERTY || locationInParent == SynchronizedStatement.EXPRESSION_PROPERTY || locationInParent == ParenthesizedExpression.EXPRESSION_PROPERTY) { return false; } return true; }
@Override public void endVisit(SynchronizedStatement node) { if (skipNode(node)) { return; } GenericSequentialFlowInfo info = processSequential(node, node.getExpression()); process(info, node.getBody()); }
@Override public void endVisit(SynchronizedStatement node) { ASTNode firstSelectedNode = getFirstSelectedNode(); if (getSelection().getEndVisitSelectionMode(node) == Selection.SELECTED) { if (firstSelectedNode == node.getBody()) { invalidSelection(RefactoringCoreMessages.StatementAnalyzer_synchronized_statement); } } super.endVisit(node); }
@Override protected ResultVisitor createResultVisitor() { return new ResultVisitor() { @Override public boolean visit(final SynchronizedStatement node) { setMatch(true); //synchronized statement gefunden setMatchedNode(node); return true; } }; }
/** * We don't really need anything in particular from this statement, * but since it has an expression and a body, we only want to * investigate the expression part to determine if it needs to * be in the slice. */ public boolean visit(SynchronizedStatement node){ if(this.options.contains(Slicer.Options.CONTROL_EXPRESSIONS_ONLY)){ /* Visit the expression part. */ node.getExpression().accept(this); /* Don't visit the children. */ return false; } else return true; }
/** * We want to track the variables from the expression only. */ public boolean visit(SynchronizedStatement node){ /* Visit the expression part. */ node.getExpression().accept(this); /* Don't visit the children. */ return false; }
@Override public void endVisit(SynchronizedStatement node) { if (skipNode(node)) return; GenericSequentialFlowInfo info= processSequential(node, node.getExpression()); process(info, node.getBody()); }
@Override public void endVisit(SynchronizedStatement node) { ASTNode firstSelectedNode= getFirstSelectedNode(); if (getSelection().getEndVisitSelectionMode(node) == Selection.SELECTED) { if (firstSelectedNode == node.getBody()) { invalidSelection(RefactoringCoreMessages.StatementAnalyzer_synchronized_statement); } } super.endVisit(node); }
@Override public boolean visit(SynchronizedStatement node) { this.fBuffer.append("synchronized (");//$NON-NLS-1$ node.getExpression().accept(this); this.fBuffer.append(") ");//$NON-NLS-1$ node.getBody().accept(this); return false; }
public boolean visit(SynchronizedStatement node) { this.buffer.append("synchronized (");//$NON-NLS-1$ node.getExpression().accept(this); this.buffer.append(") ");//$NON-NLS-1$ node.getBody().accept(this); return false; }
/** * 'synchronized' '(' Expression ')' Block */ @Override public boolean visit(final SynchronizedStatement node) { visitControlNode(LK_SYNCHRONIZED, lineStart(node), node.getExpression(), node.getBody()); // do not visit children return false; }
@Override public boolean visit(SynchronizedStatement node) { //System.out.println("Found: " + node.getClass()); print("synchronized ("); node.getExpression().accept(this); println(") {"); indent++; node.getBody().accept(this); indent--; println("}"); return false; }
public DOMSynchronizedStatement(SynchronizedStatement statement) { this.statement = statement; }
/** {@inheritDoc} */ @Override public void endVisit(SynchronizedStatement node) { logger.warn("Method endVisitSynchronizedStatement for " + node + " for " + node + " not implemented!"); super.endVisit(node); }
/** {@inheritDoc} */ @Override public boolean visit(SynchronizedStatement node) { logger.warn("Method visitSynchronizedStatement for " + node + " not implemented!"); return super.visit(node); }
@Override public boolean visit(final SynchronizedStatement node) { return false; }
@Override public boolean visit(final SynchronizedStatement node) { // not instrumentable, may contain instrumentable nodes return true; }
/** * Handles * synchronized(a) {} */ @Override public boolean visit(SynchronizedStatement node) { importer.createAccessFromExpression((Expression) node.getExpression()); return true; }
@Override public boolean visit(SynchronizedStatement node) { if (node.subtreeMatch(fMatcher, fNodeToMatch)) return matches(node); return super.visit(node); }
@Override public boolean visit(SynchronizedStatement node) { add(fCreator.create(node)); return true; }
@Override public void endVisit(SynchronizedStatement node) { endVisitNode(node); }
@Override public boolean visit(SynchronizedStatement node) { return visitNode(node); }
@Override public boolean visit(SynchronizedStatement node) { return visit((Statement)node); }
@Override public void endVisit(SynchronizedStatement node) { endVisit((Statement)node); }
@Override public boolean visit(final SynchronizedStatement node) { return this.internalVisit(node); }
/** * @param node the AST node * @return array of type constraints, may be empty * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.SynchronizedStatement) */ public ITypeConstraint[] create(SynchronizedStatement node) { return EMPTY_ARRAY; }
public boolean visit(SynchronizedStatement node){return this.visitStatement(node);}