This is an automated email from the ASF dual-hosted git repository.

jlahoda pushed a commit to branch release90
in repository https://gitbox.apache.org/repos/asf/incubator-netbeans.git

commit 917196cdf42731d69f396e3426457f2c25556a98
Author: Arunava Sinha <[email protected]>
AuthorDate: Wed Apr 25 10:13:16 2018 +0100

    netbeans-481: Refactored code of CasualDiff class
---
 .../src/org/netbeans/modules/java/source/save/CasualDiff.java      | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git 
a/java.source.base/src/org/netbeans/modules/java/source/save/CasualDiff.java 
b/java.source.base/src/org/netbeans/modules/java/source/save/CasualDiff.java
index 933af52..9a41714 100644
--- a/java.source.base/src/org/netbeans/modules/java/source/save/CasualDiff.java
+++ b/java.source.base/src/org/netbeans/modules/java/source/save/CasualDiff.java
@@ -1500,11 +1500,11 @@ public class CasualDiff {
 
                     //adding back all 
whitespaces/block-comment/javadoc-comments present in OldTree before variable 
type token.
                     while ((tokenId == JavaTokenId.WHITESPACE || tokenId == 
JavaTokenId.BLOCK_COMMENT || tokenId == JavaTokenId.JAVADOC_COMMENT) && offset 
< oldT.sym.pos) {
-                        printer.print(tokenSequence.token().text().toString());
                         tokenSequence.moveNext();
                         offset = tokenSequence.offset();
                         tokenId = tokenSequence.token().id();
                     }
+                    copyTo(localPointer, localPointer = offset);
 
                     // Correcting lower/upper bounds for oldT.vartype tree.
                     vartypeBounds[1] = oldT.sym.pos;
@@ -1536,10 +1536,7 @@ public class CasualDiff {
 
                     // copying tokens from vartype bounds after excluding 
variable type token.
                     int offset = tokenSequence.offset();
-                    if (offset < vartypeBounds[1]) {
-                        copyTo(offset, vartypeBounds[1]);
-                    }
-                    localPointer = vartypeBounds[1];
+                    copyTo(offset, localPointer = vartypeBounds[1]);
                 }
             }
         }

-- 
To stop receiving notification emails like this one, please contact
[email protected].

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to