This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
testcase'll be attached
Created attachment 8209 [details] The diff by Gabriele Carcassi for issue #26996
That diff was to be applied to rev. 1.7.24.1 (or 1.7) of JavaFastImport.java file: http://www.netbeans.org/source/browse/editor/libsrc/org/netbeans/editor/ext/java/JavaFastImport.java?rev=1.7.24.1&content-type=text/x-cvsweb-markup
You're right! I was able to reproduce the problem.
Created attachment 8244 [details] The exception, that I got during the reproduction process.
The NPE was caused by the empty line at the end of the patch file. The fix is quite simple and works for me. /cvs/diff/src/org/netbeans/modules/diff/builtin/Patch.java,v <-- Patch.java new revision: 1.10; previous revision: 1.9 Can this be integrated into release341?
Eee, maybe you should simply undo the Applying of Unified diffs in 3.4.1 at all? I mean issue 24523 If it's that unstable ;-)
Ouch!, sorry for the last comment, I didn't read IZ to the end (some connection trouble). Tested the diff, it works now, thanks. Maybe I may act as veryfier? ;-) If anyone volunteers too, no problem
Sure, so can you verify this Max ?
I don't think, that applying unified diff patches is unstable. I've heavily tested the feature without problems. However this issue shows, that you can never be 100% sure. This NPE was caused by the editing of the diff in an editor (this is apparent from the ^M at the end of the diff). This introduced the last empty line, which does not occur if you redirect cvs diff into a file (this is why I didn't discover the bug earlier). So this fix adds more robustness to the patch algorithm. I don't think this is a reason to remove the whole feature. But you may disagree of course, you're the release coordinator.
2 Martin: I already said sorry for saying of unstableness ;-)
2 Jiri: Verified (I just applyied the Gabrielle's patch, huge Thanks!) Please commit to release341 branch
O.K. it's there: /cvs/diff/src/org/netbeans/modules/diff/builtin/Patch.java,v <-- Patch.java new revision: 1.6.16.3; previous revision: 1.6.16.2
Thank a lot, Martin. Double sorry for saying such wierd things about my favorite IDE's useful (I mean useful) module.
Okay, I am verifying this. Thank you both guys.
2 Maxym: it's O.K., nobody write 100% perfect code ;-( I'm sorry, that my commit to 3.4.1 introduced another bug. It's hard to test it throughoutfully enough ;-)
Resolved for 3.3.x or earlier, no new info since then -> closing.