Skip to content

Commit

Permalink
HV-1480 Getting reference to parent node in a simpler way
Browse files Browse the repository at this point in the history
  • Loading branch information
gunnarmorling committed Sep 18, 2017
1 parent 3b79cdd commit bf7b5c0
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public PathImpl getPathWithoutLeafNode() {
public NodeImpl addPropertyNode(String nodeName) {
requiresWriteableNodeList();

NodeImpl parent = nodeList.isEmpty() ? null : (NodeImpl) nodeList.get( nodeList.size() - 1 );
NodeImpl parent = currentLeafNode;
currentLeafNode = NodeImpl.createPropertyNode( nodeName, parent );
nodeList.add( currentLeafNode );
hashCode = -1;
Expand All @@ -125,7 +125,7 @@ public NodeImpl addPropertyNode(String nodeName) {
public NodeImpl addContainerElementNode(String nodeName) {
requiresWriteableNodeList();

NodeImpl parent = nodeList.isEmpty() ? null : (NodeImpl) nodeList.get( nodeList.size() - 1 );
NodeImpl parent = currentLeafNode;
currentLeafNode = NodeImpl.createContainerElementNode( nodeName, parent );
nodeList.add( currentLeafNode );
hashCode = -1;
Expand All @@ -135,7 +135,7 @@ public NodeImpl addContainerElementNode(String nodeName) {
public NodeImpl addParameterNode(String nodeName, int index) {
requiresWriteableNodeList();

NodeImpl parent = nodeList.isEmpty() ? null : (NodeImpl) nodeList.get( nodeList.size() - 1 );
NodeImpl parent = currentLeafNode;
currentLeafNode = NodeImpl.createParameterNode( nodeName, parent, index );
nodeList.add( currentLeafNode );
hashCode = -1;
Expand All @@ -145,7 +145,7 @@ public NodeImpl addParameterNode(String nodeName, int index) {
public NodeImpl addCrossParameterNode() {
requiresWriteableNodeList();

NodeImpl parent = nodeList.isEmpty() ? null : (NodeImpl) nodeList.get( nodeList.size() - 1 );
NodeImpl parent = currentLeafNode;
currentLeafNode = NodeImpl.createCrossParameterNode( parent );
nodeList.add( currentLeafNode );
hashCode = -1;
Expand All @@ -155,7 +155,7 @@ public NodeImpl addCrossParameterNode() {
public NodeImpl addBeanNode() {
requiresWriteableNodeList();

NodeImpl parent = nodeList.isEmpty() ? null : (NodeImpl) nodeList.get( nodeList.size() - 1 );
NodeImpl parent = currentLeafNode;
currentLeafNode = NodeImpl.createBeanNode( parent );
nodeList.add( currentLeafNode );
hashCode = -1;
Expand All @@ -165,7 +165,7 @@ public NodeImpl addBeanNode() {
public NodeImpl addReturnValueNode() {
requiresWriteableNodeList();

NodeImpl parent = nodeList.isEmpty() ? null : (NodeImpl) nodeList.get( nodeList.size() - 1 );
NodeImpl parent = currentLeafNode;
currentLeafNode = NodeImpl.createReturnValue( parent );
nodeList.add( currentLeafNode );
hashCode = -1;
Expand All @@ -175,7 +175,7 @@ public NodeImpl addReturnValueNode() {
private NodeImpl addConstructorNode(String name, Class<?>[] parameterTypes) {
requiresWriteableNodeList();

NodeImpl parent = nodeList.isEmpty() ? null : (NodeImpl) nodeList.get( nodeList.size() - 1 );
NodeImpl parent = currentLeafNode;
currentLeafNode = NodeImpl.createConstructorNode( name, parent, parameterTypes );
nodeList.add( currentLeafNode );
hashCode = -1;
Expand All @@ -185,7 +185,7 @@ private NodeImpl addConstructorNode(String name, Class<?>[] parameterTypes) {
private NodeImpl addMethodNode(String name, Class<?>[] parameterTypes) {
requiresWriteableNodeList();

NodeImpl parent = nodeList.isEmpty() ? null : (NodeImpl) nodeList.get( nodeList.size() - 1 );
NodeImpl parent = currentLeafNode;
currentLeafNode = NodeImpl.createMethodNode( name, parent, parameterTypes );
nodeList.add( currentLeafNode );
hashCode = -1;
Expand Down

0 comments on commit bf7b5c0

Please sign in to comment.