lahodaj commented on a change in pull request #2791: URL: https://github.com/apache/netbeans/pull/2791#discussion_r605024476
########## File path: java/java.source.base/src/org/netbeans/modules/java/source/save/CasualDiff.java ########## @@ -1954,6 +1961,14 @@ protected int diffCase(JCCase oldT, JCCase newT, int[] bounds) { endpos = endPos(oldPatterns.get(oldPatterns.size() - 1)); if (newPatterns.isEmpty()) { + if(copyTo > localPointer){ Review comment: I guess you might need to use the lexer (there is a tokensequence in this class that can be used, IIRC) to find the end offset to copy. The code below will copy only spaces - but indent may be done using tabs, or even may contain comments. Finding the keyword using lexical tokens is probably easiest. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@netbeans.apache.org For additional commands, e-mail: notifications-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists