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.

Bug 26308 - Textual diff is a grey window
Summary: Textual diff is a grey window
Status: CLOSED FIXED
Alias: None
Product: utilities
Classification: Unclassified
Component: Diff (show other bugs)
Version: 3.x
Hardware: All All
: P2 blocker (vote)
Assignee: Martin Entlicher
URL:
Keywords: UI
Depends on:
Blocks:
 
Reported: 2002-08-06 11:15 UTC by Martin Entlicher
Modified: 2003-06-30 17:41 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Entlicher 2002-08-06 11:15:54 UTC
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.
Comment 1 Jiri Kovalsky 2002-08-09 15:42:14 UTC
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.
Comment 2 Martin Entlicher 2002-08-09 16:19:14 UTC
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.
Comment 3 Jiri Kovalsky 2002-08-09 16:24:31 UTC
Since any two files can't be textually compared, it's significant
impact and serious regression in Diff module functionality. Increasing
priority to P2.
Comment 4 Martin Entlicher 2002-08-09 17:16:11 UTC
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
Comment 5 Peter Zavadsky 2002-08-12 08:47:22 UTC
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.

Comment 6 Martin Entlicher 2002-08-12 12:36:23 UTC
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).
 
Comment 7 Tomas Pavek 2002-08-12 13:31:18 UTC
So which version do you plan to integrate in 3.4?
Comment 8 Martin Entlicher 2002-08-12 13:37:04 UTC
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.
Comment 9 Tomas Pavek 2002-08-12 13:44:19 UTC
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)). 
Comment 10 Martin Entlicher 2002-08-12 16:35:35 UTC
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.
Comment 11 Jiri Kovalsky 2002-11-08 10:47:59 UTC
Textual diff window is okay now. Verified in development build
#200211080100 of NetBeans 4.0.
Comment 12 Quality Engineering 2003-06-30 17:41:12 UTC
Resolved for 3.3.x or earlier, no new info since then -> closing.