diff --git a/src/test/resources/blame/blameTestWithLocalRepo4.txt b/src/test/resources/blame/blameTestWithLocalRepo4.txt index b551c3dee71..541e8a8f4e5 100644 --- a/src/test/resources/blame/blameTestWithLocalRepo4.txt +++ b/src/test/resources/blame/blameTestWithLocalRepo4.txt @@ -195,14 +195,14 @@ cc13f68e3 javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpre a25f53f88 javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Thomas Leu 2018-05-19 01:15:57 +0000 195) if (diffElement instanceof Reshuffled) { 996b78486 javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Thomas Leu 2018-06-07 20:54:17 +0000 196) Reshuffled reshuffled = (Reshuffled) diffElement; 197) -b7bd15d12 javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Thomas Leu 2018-05-19 01:34:00 +0000 198) // First, let's see how many tokens we need to attribute to the previous version of the of the CsmMix +f8d5e2fda javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Federico Tomassetti 2017-05-21 11:26:14 +0000 198) // First, let's see how many tokens we need to attribute to the previous version of the of the CsmMix a25f53f88 javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Thomas Leu 2018-05-19 01:15:57 +0000 199) CsmMix elementsFromPreviousOrder = reshuffled.getPreviousOrder(); a25f53f88 javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Thomas Leu 2018-05-19 01:15:57 +0000 200) CsmMix elementsFromNextOrder = reshuffled.getNextOrder(); 201) -b7bd15d12 javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Thomas Leu 2018-05-19 01:34:00 +0000 202) // This contains indexes from elementsFromNextOrder to indexes from elementsFromPreviousOrder +f8d5e2fda javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Federico Tomassetti 2017-05-21 11:26:14 +0000 202) // This contains indexes from elementsFromNextOrder to indexes from elementsFromPreviousOrder 7f177dcaa javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Thomas Leu 2018-05-18 21:48:21 +0000 203) Map correspondanceBetweenNextOrderAndPreviousOrder = getCorrespondanceBetweenNextOrderAndPreviousOrder(elementsFromPreviousOrder, elementsFromNextOrder); 204) -b7bd15d12 javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Thomas Leu 2018-05-19 01:34:00 +0000 205) // We now find out which Node Text elements corresponds to the elements in the original CSM +f8d5e2fda javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Federico Tomassetti 2017-05-21 11:26:14 +0000 205) // We now find out which Node Text elements corresponds to the elements in the original CSM 2ae6f779c javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Thomas Leu 2018-05-18 20:05:42 +0000 206) List nodeTextIndexOfPreviousElements = findIndexOfCorrespondingNodeTextElement(elementsFromPreviousOrder.getElements(), nodeText, originalIndex, node); 207) f8d5e2fda javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Federico Tomassetti 2017-05-21 11:26:14 +0000 208) Map nodeTextIndexToPreviousCSMIndex = new HashMap<>(); @@ -214,16 +214,16 @@ f8d5e2fda javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpre f8d5e2fda javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Federico Tomassetti 2017-05-21 11:26:14 +0000 214) } f8d5e2fda javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Federico Tomassetti 2017-05-21 11:26:14 +0000 215) int lastNodeTextIndex = nodeTextIndexOfPreviousElements.stream().max(Integer::compareTo).orElse(-1); 216) -b7bd15d12 javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Thomas Leu 2018-05-19 01:34:00 +0000 217) // Elements to be added at the end +f8d5e2fda javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Federico Tomassetti 2017-05-21 11:26:14 +0000 217) // Elements to be added at the end f8d5e2fda javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Federico Tomassetti 2017-05-21 11:26:14 +0000 218) List elementsToBeAddedAtTheEnd = new LinkedList<>(); 7f177dcaa javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Thomas Leu 2018-05-18 21:48:21 +0000 219) List nextOrderElements = elementsFromNextOrder.getElements(); 220) f8d5e2fda javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Federico Tomassetti 2017-05-21 11:26:14 +0000 221) Map> elementsToAddBeforeGivenOriginalCSMElement = new HashMap<>(); 7f177dcaa javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Thomas Leu 2018-05-18 21:48:21 +0000 222) for (int ni = 0; ni < nextOrderElements.size(); ni++) { -b7bd15d12 javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Thomas Leu 2018-05-19 01:34:00 +0000 223) // If it has a mapping, then it is kept +f8d5e2fda javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Federico Tomassetti 2017-05-21 11:26:14 +0000 223) // If it has a mapping, then it is kept f8d5e2fda javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Federico Tomassetti 2017-05-21 11:26:14 +0000 224) if (!correspondanceBetweenNextOrderAndPreviousOrder.containsKey(ni)) { -b7bd15d12 javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Thomas Leu 2018-05-19 01:34:00 +0000 225) // Ok, it is something new. Where to put it? Let's see what is the first following -b7bd15d12 javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Thomas Leu 2018-05-19 01:34:00 +0000 226) // element that has a mapping +f8d5e2fda javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Federico Tomassetti 2017-05-21 11:26:14 +0000 225) // Ok, it is something new. Where to put it? Let's see what is the first following +f8d5e2fda javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Federico Tomassetti 2017-05-21 11:26:14 +0000 226) // element that has a mapping f8d5e2fda javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Federico Tomassetti 2017-05-21 11:26:14 +0000 227) int originalCsmIndex = -1; 7f177dcaa javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Thomas Leu 2018-05-18 21:48:21 +0000 228) for (int nj = ni + 1; nj < nextOrderElements.size() && originalCsmIndex == -1; nj++) { f8d5e2fda javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Federico Tomassetti 2017-05-21 11:26:14 +0000 229) if (correspondanceBetweenNextOrderAndPreviousOrder.containsKey(nj)) { @@ -234,20 +234,20 @@ f8d5e2fda javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpre 7f177dcaa javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Thomas Leu 2018-05-18 21:48:21 +0000 234) elementsToAddBeforeGivenOriginalCSMElement.get(originalCsmIndex).add(nextOrderElements.get(ni)); f8d5e2fda javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Federico Tomassetti 2017-05-21 11:26:14 +0000 235) } f8d5e2fda javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Federico Tomassetti 2017-05-21 11:26:14 +0000 236) } -b7bd15d12 javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Thomas Leu 2018-05-19 01:34:00 +0000 237) // it does not preceed anything, so it goes at the end +f8d5e2fda javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Federico Tomassetti 2017-05-21 11:26:14 +0000 237) // it does not preceed anything, so it goes at the end f8d5e2fda javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Federico Tomassetti 2017-05-21 11:26:14 +0000 238) if (originalCsmIndex == -1) { 7f177dcaa javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Thomas Leu 2018-05-18 21:48:21 +0000 239) elementsToBeAddedAtTheEnd.add(nextOrderElements.get(ni)); f8d5e2fda javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Federico Tomassetti 2017-05-21 11:26:14 +0000 240) } f8d5e2fda javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Federico Tomassetti 2017-05-21 11:26:14 +0000 241) } f8d5e2fda javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Federico Tomassetti 2017-05-21 11:26:14 +0000 242) } 243) -b7bd15d12 javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Thomas Leu 2018-05-19 01:34:00 +0000 244) // We go over the original node text elements, in the order they appear in the NodeText. -b7bd15d12 javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Thomas Leu 2018-05-19 01:34:00 +0000 245) // Considering an original node text element (ONE) -b7bd15d12 javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Thomas Leu 2018-05-19 01:34:00 +0000 246) // * we verify if it corresponds to a CSM element. If it does not we just move on, otherwise -b7bd15d12 javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Thomas Leu 2018-05-19 01:34:00 +0000 247) // we find the correspond OCE (Original CSM Element) -b7bd15d12 javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Thomas Leu 2018-05-19 01:34:00 +0000 248) // * we first add new elements that are marked to be added before OCE -b7bd15d12 javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Thomas Leu 2018-05-19 01:34:00 +0000 249) // * if OCE is marked to be present also in the "after" CSM we add a kept element, -b7bd15d12 javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Thomas Leu 2018-05-19 01:34:00 +0000 250) // otherwise we add a removed element +f8d5e2fda javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Federico Tomassetti 2017-05-21 11:26:14 +0000 244) // We go over the original node text elements, in the order they appear in the NodeText. +f8d5e2fda javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Federico Tomassetti 2017-05-21 11:26:14 +0000 245) // Considering an original node text element (ONE) +f8d5e2fda javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Federico Tomassetti 2017-05-21 11:26:14 +0000 246) // * we verify if it corresponds to a CSM element. If it does not we just move on, otherwise +f8d5e2fda javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Federico Tomassetti 2017-05-21 11:26:14 +0000 247) // we find the correspond OCE (Original CSM Element) +f8d5e2fda javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Federico Tomassetti 2017-05-21 11:26:14 +0000 248) // * we first add new elements that are marked to be added before OCE +f8d5e2fda javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Federico Tomassetti 2017-05-21 11:26:14 +0000 249) // * if OCE is marked to be present also in the "after" CSM we add a kept element, +f8d5e2fda javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Federico Tomassetti 2017-05-21 11:26:14 +0000 250) // otherwise we add a removed element 251) 996b78486 javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Thomas Leu 2018-06-07 20:54:17 +0000 252) // Remove the whole Reshuffled element 996b78486 javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Thomas Leu 2018-06-07 20:54:17 +0000 253) diffElements.remove(index); @@ -272,12 +272,12 @@ f8d5e2fda javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpre a25f53f88 javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Thomas Leu 2018-05-19 01:15:57 +0000 272) diffElements.add(diffElIterator++, new Removed(originalCSMElement)); f8d5e2fda javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Federico Tomassetti 2017-05-21 11:26:14 +0000 273) } f8d5e2fda javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Federico Tomassetti 2017-05-21 11:26:14 +0000 274) } -b7bd15d12 javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Thomas Leu 2018-05-19 01:34:00 +0000 275) // else we have a simple node text element, without associated csm element, just keep ignore it +516947a3d javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Federico Tomassetti 2017-07-19 15:34:45 +0000 275) // else we have a simple node text element, without associated csm element, just keep ignore it f8d5e2fda javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Federico Tomassetti 2017-05-21 11:26:14 +0000 276) } f8d5e2fda javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Federico Tomassetti 2017-05-21 11:26:14 +0000 277) } 278) -b7bd15d12 javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Thomas Leu 2018-05-19 01:34:00 +0000 279) // Finally we look for the remaining new elements that were not yet added and -b7bd15d12 javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Thomas Leu 2018-05-19 01:34:00 +0000 280) // add all of them +f8d5e2fda javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Federico Tomassetti 2017-05-21 11:26:14 +0000 279) // Finally we look for the remaining new elements that were not yet added and +f8d5e2fda javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Federico Tomassetti 2017-05-21 11:26:14 +0000 280) // add all of them f8d5e2fda javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Federico Tomassetti 2017-05-21 11:26:14 +0000 281) for (CsmElement elementToAdd : elementsToBeAddedAtTheEnd) { a25f53f88 javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Thomas Leu 2018-05-19 01:15:57 +0000 282) diffElements.add(diffElIterator++, new Added(elementToAdd)); f8d5e2fda javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Federico Tomassetti 2017-05-21 11:26:14 +0000 283) } @@ -340,8 +340,8 @@ b7bd15d12 javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpre 2ae6f779c javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Thomas Leu 2018-05-18 20:05:42 +0000 340) if (removed.isChild() && originalElementIsChild) { 7f177dcaa javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Thomas Leu 2018-05-18 21:48:21 +0000 341) ChildTextElement originalElementChild = (ChildTextElement) originalElement; 7f177dcaa javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Thomas Leu 2018-05-18 21:48:21 +0000 342) if (originalElementChild.isComment()) { -b7bd15d12 javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Thomas Leu 2018-05-19 01:34:00 +0000 343) // We expected to remove a proper node but we found a comment in between. -b7bd15d12 javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Thomas Leu 2018-05-19 01:34:00 +0000 344) // If the comment is associated to the node we want to remove we remove it as well, otherwise we keep it +3a31705ba javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Federico Tomassetti 2017-11-13 19:21:11 +0000 343) // We expected to remove a proper node but we found a comment in between. +3a31705ba javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Federico Tomassetti 2017-11-13 19:21:11 +0000 344) // If the comment is associated to the node we want to remove we remove it as well, otherwise we keep it 7f177dcaa javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Thomas Leu 2018-05-18 21:48:21 +0000 345) Comment comment = (Comment) originalElementChild.getChild(); 7f177dcaa javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Thomas Leu 2018-05-18 21:48:21 +0000 346) if (!comment.isOrphan() && comment.getCommentedNode().isPresent() && comment.getCommentedNode().get().equals(removed.getChild())) { 2ae6f779c javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Thomas Leu 2018-05-18 20:05:42 +0000 347) nodeText.removeElement(originalIndex); @@ -355,11 +355,11 @@ b7bd15d12 javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpre 2d3f5e219 javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Thomas Leu 2018-06-07 20:54:17 +0000 355) && !removedGroup.isACompleteLine()) { 2ae6f779c javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Thomas Leu 2018-05-18 20:05:42 +0000 356) originalIndex = considerEnforcingIndentation(nodeText, originalIndex); ed7f4a653 javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Federico Tomassetti 2017-02-23 16:19:33 +0000 357) } -b7bd15d12 javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Thomas Leu 2018-05-19 01:34:00 +0000 358) // If in front we have one space and before also we had space let's drop one space +74dc0e58a javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Federico Tomassetti 2017-05-21 11:26:14 +0000 358) // If in front we have one space and before also we had space let's drop one space 2ae6f779c javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Thomas Leu 2018-05-18 20:05:42 +0000 359) if (originalElements.size() > originalIndex && originalIndex > 0) { 2ae6f779c javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Thomas Leu 2018-05-18 20:05:42 +0000 360) if (originalElements.get(originalIndex).isWhiteSpace() 2ae6f779c javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Thomas Leu 2018-05-18 20:05:42 +0000 361) && originalElements.get(originalIndex - 1).isWhiteSpace()) { -b7bd15d12 javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Thomas Leu 2018-05-19 01:34:00 +0000 362) // However we do not want to do that when we are about to adding or removing elements +a3359354b javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Federico Tomassetti 2017-05-21 11:26:14 +0000 362) // However we do not want to do that when we are about to adding or removing elements a25f53f88 javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Thomas Leu 2018-05-19 01:15:57 +0000 363) if ((diffIndex + 1) == diffElements.size() || (diffElements.get(diffIndex + 1) instanceof Kept)) { 2ae6f779c javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Thomas Leu 2018-05-18 20:05:42 +0000 364) originalElements.remove(originalIndex--); 74dc0e58a javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Federico Tomassetti 2017-05-21 11:26:14 +0000 365) } @@ -460,7 +460,7 @@ b2625a83a javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpre de5c17c37 javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Thomas Leu 2018-05-17 22:47:50 +0000 460) } else if (kept.isIndent()) { a31908d22 javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Federico Tomassetti 2017-05-21 11:26:14 +0000 461) diffIndex++; de5c17c37 javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Thomas Leu 2018-05-17 22:47:50 +0000 462) } else if (kept.isUnindent()) { -b7bd15d12 javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Thomas Leu 2018-05-19 01:34:00 +0000 463) // Nothing to do, beside considering indentation +7d55cf4c1 javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Federico Tomassetti 2017-05-21 11:34:27 +0000 463) // Nothing to do, beside considering indentation a31908d22 javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Federico Tomassetti 2017-05-21 11:26:14 +0000 464) diffIndex++; 2ae6f779c javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Thomas Leu 2018-05-18 20:05:42 +0000 465) for (int i = 0; i < STANDARD_INDENTATION_SIZE && originalIndex >= 1 && nodeText.getTextElement(originalIndex - 1).isSpaceOrTab(); i++) { 2ae6f779c javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java (Thomas Leu 2018-05-18 20:05:42 +0000 466) nodeText.removeElement(--originalIndex);