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.
In release 3.4 textual diff works O.K., but in recent dev builds (i.e. #200208060100) the textual diff window is whole grey. Graphical diff works O.K.
I have just found that it's not true. It's some kind of regression between RC1 and RC2 of NetBeans 3.4. Therefore changing version field.
Yes, you're unfortunately right. The Text Diff stopped working after the fix of issue #26136. It was almost a hack in the diff module, which called componentShowing() method by reflection to force the editor to initialize. After componentShowing() changed access from protected to public, it was not possible to call this method any more.
Since any two files can't be textually compared, it's significant impact and serious regression in Diff module functionality. Increasing priority to P2.
Fixed in the main trunk. Because CloneableEditor does not have method componentShowing() public any more, I've created subclass DiffCloneableEditor with the public componentShowing() method, that delegates to the CloneableEditor's protected one. Diff: http://diff.netbeans.org/source/browse/diff/src/org/netbeans/modules/diff/builtin/visualizer/TextDiffEditorSupport.java.diff?r1=1.4&r2=1.5
The real problem is using reflectio code in this case/ Please remove that at least from [trunk]. You just disabled compile-time check needlessly, not mentioning other drawbacks. (Check for your component instance, cast it and call directly the method). If you woudn't use the reflection, problem was detected when integrating issue #26136.
Well, the Peter's suggestion requires to introduce a new interface, but it's a more transpatent solution. I've fixed it this was in trunk (a ShowingNotifier interface was introduced).
So which version do you plan to integrate in 3.4?
Both versions should be quite safe. However IMHO for 3.4 it's sufficient to integrate the first version in the attached diff. It's shorter, than the latest trunk version. Thus the diff for 3.4 review is: http://diff.netbeans.org/source/browse/diff/src/org/netbeans/modules/diff/builtin/visualizer/TextDiffEditorSupport.java.diff?r1=1.4&r2=1.5 Thanks.
Okay, this patch looks quite good. In fact, it could be also fixed in DiffPresenter instead, not needing to create new class (you would use Class.getDeclaredMethod and Method.setAccessible(true)).
Thanks for review. It's right, that it can be solved by Method.setAccessible(true), but I hope that this will not be necessary after the new fix applied in the main trunk. The Method.setAccessible(true) would be necessary in case of displaying a 3rd party TopComponent, that can not be extended. However, it's true, that reflection is dangerous and should not be used if possible. Fixed in release34 branch by applying the referred diff.
Textual diff window is okay now. Verified in development build #200211080100 of NetBeans 4.0.
Resolved for 3.3.x or earlier, no new info since then -> closing.