@Override @SuppressWarnings({ "rawtypes", "unchecked" }) public Type<O> getType() { return new TypeImpl(parent, param.getType()); }
@Override public boolean visit(SingleVariableDeclaration node) { final String type = node.getType().toString(); if (topMethod != null && methodsAsRoot) { types.put(topMethod, type); } else if (topClass != null) { types.put(topClass, type); } return false; }
private boolean isEnhancedForStatementVariable(Statement statement, SimpleName name) { if (statement instanceof EnhancedForStatement) { EnhancedForStatement forStatement= (EnhancedForStatement) statement; SingleVariableDeclaration param= forStatement.getParameter(); return param.getType() == name.getParent(); // strange recovery, see https://bugs.eclipse.org/180456 } return false; }
@Override public boolean visit(final SingleVariableDeclaration node) { boolean _equals = node.getName().getIdentifier().equals(simpleName.getIdentifier()); if (_equals) { matchesFound.add(node.getType()); } return false; } });
private boolean isEnhancedForStatementVariable(Statement statement, SimpleName name) { if (statement instanceof EnhancedForStatement) { EnhancedForStatement forStatement= (EnhancedForStatement) statement; SingleVariableDeclaration param= forStatement.getParameter(); return param.getType() == name.getParent(); // strange recovery, see https://bugs.eclipse.org/180456 } return false; }
public boolean visit(org.eclipse.jdt.core.dom.CatchClause node) { Type catchType = node.getException().getType(); processType(catchType, "Catching", SourceType.TYPE); return true; }
public void endVisit(SingleVariableDeclaration node) { ownValue = scopeManager.pop(); IConstructor type = bindingsResolver.resolveType(node.getType().resolveBinding(), false); insert(types, ownValue, type); }
private void addDeclaration(CFGBasicBlock basicBlock, SingleVariableDeclaration varDecl, int flags) { basicBlock.addVariableAccess(new VariableAccess(varDecl, varDecl .getName(), varDecl.getType(), flags)); }
@Override public boolean visit(CatchClause node) { if (node.getException().getType() instanceof SimpleType) { pushNode(node, ((SimpleType) node.getException().getType()).getName().getFullyQualifiedName()); } else { pushNode(node, ((UnionType) node.getException().getType()).toString()); } // since exception type is used as value, visit children by hand node.getBody().accept(this); return false; }
@Override public boolean visit(CatchClause node) { if (node.getException().getType() instanceof SimpleType) { pushNode(node, ((SimpleType) node.getException().getType()).getName().getFullyQualifiedName()); } else { pushNode(node, ((UnionType) node.getException().getType()).toString()); } // since exception type is used as value, visit children by hand node.getBody().accept(this); return false; }
private void addLinkedRanges(ASTRewrite rewrite, MethodDeclaration newStub) { List parameters= newStub.parameters(); for (int i= 0; i < parameters.size(); i++) { SingleVariableDeclaration curr= (SingleVariableDeclaration) parameters.get(i); String name= curr.getName().getIdentifier(); addLinkedPosition(rewrite.track(curr.getType()), false, "arg_type_" + name); //$NON-NLS-1$ addLinkedPosition(rewrite.track(curr.getName()), false, "arg_name_" + name); //$NON-NLS-1$ } }
private void addLinkedRanges(ASTRewrite rewrite, MethodDeclaration newStub) { List<SingleVariableDeclaration> parameters= newStub.parameters(); for (int i= 0; i < parameters.size(); i++) { SingleVariableDeclaration curr= parameters.get(i); String name= curr.getName().getIdentifier(); addLinkedPosition(rewrite.track(curr.getType()), false, "arg_type_" + name); //$NON-NLS-1$ addLinkedPosition(rewrite.track(curr.getName()), false, "arg_name_" + name); //$NON-NLS-1$ } }
@Override public boolean visit(SingleVariableDeclaration node) { boolean isNotParam = !getCurrentParent().getLabel().equals(EntityType.PARAMETERS.toString());// @inria pushNode(node, node.getName().getIdentifier()); node.getType().accept(this); return false; }
private CSProperty newPropertyFor(MethodDeclaration node, final String propName) { final CSTypeReferenceExpression propertyType = isGetter(node) ? mappedReturnType(node) : mappedTypeReference(lastParameter(node).getType()); CSProperty p = new CSProperty(propName, propertyType); return p; }
@Override protected void changeParamgumentType(ParameterInfo info) { VariableDeclaration oldParam= getParameter(info.getOldIndex()); if (oldParam instanceof SingleVariableDeclaration) { getASTRewrite().set(oldParam, SingleVariableDeclaration.VARARGS_PROPERTY, Boolean.valueOf(info.isNewVarargs()), fDescription); SingleVariableDeclaration oldSVDParam= (SingleVariableDeclaration) oldParam; replaceTypeNode(oldSVDParam.getType(), ParameterInfo.stripEllipsis(info.getNewTypeName()), info.getNewTypeBinding()); removeExtraDimensions(oldSVDParam); } }
int treeSize() { return memSize() + (this.modifiers == null ? 0 : this.modifiers.listSize()) + (this.type == null ? 0 : getType().treeSize()) + (this.variableName == null ? 0 : getName().treeSize()) + (this.optionalInitializer == null ? 0 : getInitializer().treeSize()); } }
int treeSize() { return memSize() + (this.modifiers == null ? 0 : this.modifiers.listSize()) + (this.type == null ? 0 : getType().treeSize()) + (this.varargsAnnotations == null ? 0 : this.varargsAnnotations.listSize()) + (this.variableName == null ? 0 : getName().treeSize()) + (this.extraDimensions == null ? 0 : this.extraDimensions.listSize()) + (this.optionalInitializer == null ? 0 : getInitializer().treeSize()); } }
int treeSize() { return memSize() + (this.modifiers == null ? 0 : this.modifiers.listSize()) + (this.type == null ? 0 : getType().treeSize()) + (this.varargsAnnotations == null ? 0 : this.varargsAnnotations.listSize()) + (this.variableName == null ? 0 : getName().treeSize()) + (this.extraDimensions == null ? 0 : this.extraDimensions.listSize()) + (this.optionalInitializer == null ? 0 : getInitializer().treeSize()); } }
public boolean visit(org.eclipse.jdt.core.dom.CatchClause node) { Type catchType = node.getException().getType(); processType(catchType, TypeReferenceLocation.CATCH_EXCEPTION_STATEMENT, compilationUnit.getLineNumber(node.getStartPosition()), compilationUnit.getColumnNumber(catchType.getStartPosition()), catchType.getLength(), node.toString()); return super.visit(node); }
@Override int treeSize() { return memSize() + (this.modifiers == null ? 0 : this.modifiers.listSize()) + (this.type == null ? 0 : getType().treeSize()) + (this.varargsAnnotations == null ? 0 : this.varargsAnnotations.listSize()) + (this.variableName == null ? 0 : getName().treeSize()) + (this.extraDimensions == null ? 0 : this.extraDimensions.listSize()) + (this.optionalInitializer == null ? 0 : getInitializer().treeSize()); } }