public void setName(String name) { this.name = name; setNodeProperty(getASTNode(), name, getASTNode().getNameProperty(), ASTNode.SIMPLE_NAME); }
public void setName(String name) { this.name = name; setNodeProperty(getASTNode(), name, getASTNode().getNameProperty(), ASTNode.SIMPLE_NAME); }
private boolean isRealConstructorReferenceNode(ASTNode node){ String typeName= fConstructors[0].getDeclaringType().getElementName(); if (node.getParent() instanceof AbstractTypeDeclaration && ((AbstractTypeDeclaration) node.getParent()).getNameProperty().equals(node.getLocationInParent())) { //Example: // class A{ // A(){} // } // class B extends A {} //==> "B" is found as reference to A() return false; } if (node.getParent() instanceof MethodDeclaration && MethodDeclaration.NAME_PROPERTY.equals(node.getLocationInParent())) { MethodDeclaration md= (MethodDeclaration)node.getParent(); if (md.isConstructor() && ! md.getName().getIdentifier().equals(typeName)) { //Example: // class A{ // A(){} // } // class B extends A{ // B(){} // } //==> "B" in "B(){}" is found as reference to A() return false; } } return true; }
private boolean isRealConstructorReferenceNode(ASTNode node){ String typeName= fConstructors[0].getDeclaringType().getElementName(); if (node.getParent() instanceof AbstractTypeDeclaration && ((AbstractTypeDeclaration) node.getParent()).getNameProperty().equals(node.getLocationInParent())) { //Example: // class A{ // A(){} // } // class B extends A {} //==> "B" is found as reference to A() return false; } if (node.getParent() instanceof MethodDeclaration && MethodDeclaration.NAME_PROPERTY.equals(node.getLocationInParent())) { MethodDeclaration md= (MethodDeclaration)node.getParent(); if (md.isConstructor() && ! md.getName().getIdentifier().equals(typeName)) { //Example: // class A{ // A(){} // } // class B extends A{ // B(){} // } //==> "B" in "B(){}" is found as reference to A() return false; } } return true; }
private boolean isRealConstructorReferenceNode(ASTNode node){ String typeName= fConstructors[0].getDeclaringType().getElementName(); if (node.getParent() instanceof AbstractTypeDeclaration && ((AbstractTypeDeclaration) node.getParent()).getNameProperty().equals(node.getLocationInParent())) { //Example: // class A{ // A(){} // } // class B extends A {} //==> "B" is found as reference to A() return false; } if (node.getParent() instanceof MethodDeclaration && MethodDeclaration.NAME_PROPERTY.equals(node.getLocationInParent())) { MethodDeclaration md= (MethodDeclaration)node.getParent(); if (md.isConstructor() && ! md.getName().getIdentifier().equals(typeName)) { //Example: // class A{ // A(){} // } // class B extends A{ // B(){} // } //==> "B" in "B(){}" is found as reference to A() return false; } } return true; }