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 230126 - /net/yourip/export/.../f.cpp is not equal /export/.../f.cpp (IDE opens new tab)
Summary: /net/yourip/export/.../f.cpp is not equal /export/.../f.cpp (IDE opens new tab)
Alias: None
Product: platform
Classification: Unclassified
Component: Text (show other bugs)
Version: 7.4
Hardware: All Unix
: P2 normal (vote)
Assignee: igor_nikiforov
: 216041 (view as bug list)
Depends on: 234795
Blocks: 241991
  Show dependency tree
Reported: 2013-05-22 14:58 UTC by igor_nikiforov
Modified: 2014-02-17 09:19 UTC (History)
6 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:

Proposed patch (11.00 KB, patch)
2013-05-27 11:47 UTC, Andrew Krasny
Details | Diff
Proposed patch with CloneableOpenSupportRedirector (7.52 KB, patch)
2013-05-28 17:39 UTC, Andrew Krasny
Details | Diff
A patch without OpenSupport.findDataObject (8.46 KB, patch)
2013-07-02 12:05 UTC, Andrew Krasny
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description igor_nikiforov 2013-05-22 14:58:16 UTC
- Create C/C++ Application on /export/
- Open file in editor via double click in Projects tab
- Push File|Open File...
- Type /net/your_ip/export/CppApplication_1/main.cpp in dialog window
- Press OK button
now: IDE opens second tab
previous builds: IDE activates first file
Comment 1 Vladimir Voskresensky 2013-05-22 15:38:11 UTC
What we technically need is analogue or version of CloneableEditorSupportRedirector which will be called only during opening of document when algorith tries to understand if file is in list of already opened TCs or not.
Comment 2 Vladimir Voskresensky 2013-05-23 09:14:06 UTC
It is data lost. We will try to propose a patch.
Comment 3 Andrew Krasny 2013-05-27 11:47:48 UTC
Created attachment 134945 [details]
Proposed patch

A simple patch what allows SPI implementers to setup filter on specific requests only... This could minimize number of redirect() calls.
Comment 4 Vladimir Voskresensky 2013-05-27 12:38:23 UTC
Jarda, what do you think?
Comment 5 Jaroslav Tulach 2013-05-27 12:43:20 UTC
Interesting approach. If that works for you, polish it as an API request and it can (imho) be applied.
Comment 6 Andrew Krasny 2013-05-28 17:39:29 UTC
Created attachment 135020 [details]
Proposed patch with CloneableOpenSupportRedirector

Looks like the proposed approach still is not perfect - it allows to reduce the number of redirection queries, but introduces other problems:
- SPI implementers don't really know what events are important..
- there is no way to 'forget' about 'redirected' editor

How about this approach?
I have introduced a CloneableOpenSupportRedirector that invokes 'redirect' on opening component only. It also gets notifications about closed components.
And.. it gets notification about opened components as well - this is needed for 'restored' opened TCs (when IDE starts)...
Comment 7 Vladimir Voskresensky 2013-05-29 08:09:46 UTC
Andrew, I like COS redirector more than CES. 

Btw, patch contains public findDataObject in OpenSupport. Is it really needed?
Comment 8 Andrew Krasny 2013-05-29 09:57:16 UTC
This was the easiest way to get the DataObject (and IMO not *that* bad)...
I have no problem removing this... But that will require clients (COSRedirectorImpl) to do more tricks.
Comment 9 Andrew Krasny 2013-05-30 15:40:34 UTC
looks like I was too optimistic ;)

Jarda, Vladimir, 

I don't see a way of getting DataObject from OpenSupport.Env other than using reflection (which I don't like).
Do you have ideas? 

And... maybe we can just introduced the proposed findDataObject()?
Comment 10 Andrew Krasny 2013-06-20 14:56:04 UTC

could you, please, take a look?
Comment 11 Jaroslav Tulach 2013-06-24 16:25:35 UTC
You can't modify OpenSupport to reference to DataObject. Sorry.
Comment 12 Vladimir Voskresensky 2013-06-25 05:20:21 UTC
Bug itself is not invalid your comment is about patch, right?

method in OpenSupport is introduced, but not used.
So, what about other parts of patch? Are they ok?

Comment 13 Andrew Krasny 2013-07-02 12:05:15 UTC
Created attachment 136592 [details]
A patch without OpenSupport.findDataObject
Comment 14 Jaroslav Tulach 2013-07-08 07:04:30 UTC
The previous patch looks like an API change request to me. Why don't you guys follow the API review guidelines?
Comment 15 Vladimir Voskresensky 2013-08-13 10:26:07 UTC
If no objections, Igor, please, integrate
Comment 16 igor_nikiforov 2013-08-13 12:49:06 UTC
The patch together with required apichanges.xml modifications is integrated:
Comment 17 Quality Engineering 2013-08-14 14:38:45 UTC
Integrated into 'main-silver', will be available in build *201308141142* on (upload may still be in progress)

User: igor_nikiforov <>
Log: Bug 230126 - /net/yourip/export/.../f.cpp is not equal /export/.../f.cpp (IDE opens new tab) - fix.
Comment 18 igor_nikiforov 2013-08-15 14:20:09 UTC
COSRedirecctor implementation, based on CESRedirector:

Stat usage is replaced by Java 7 File API usage. The implementation doesn't look optimal, and it's better to refactor/re-implement it.
Comment 19 Quality Engineering 2013-08-16 02:40:26 UTC
Integrated into 'main-silver', will be available in build *201308152300* on (upload may still be in progress)

User: igor_nikiforov <>
Log: Bug 230126 - /net/yourip/export/.../f.cpp is not equal /export/.../f.cpp (IDE opens new tab) - additional fix.
Comment 20 Vladimir Voskresensky 2013-08-23 14:49:39 UTC
*** Bug 234795 has been marked as a duplicate of this bug. ***
Comment 21 Vladimir Voskresensky 2013-08-26 07:25:17 UTC
*** Bug 234795 has been marked as a duplicate of this bug. ***
Comment 22 Alexander Simon 2013-08-28 11:01:07 UTC
*** Bug 216041 has been marked as a duplicate of this bug. ***
Comment 23 igor_nikiforov 2013-09-09 09:43:38 UTC
Reflection cache added:
Comment 24 Marian Mirilovic 2013-11-04 13:19:43 UTC
Feedback from reporter : 
Dear developers,
the issue was indeed resolved in the pre-release build 201310110001. But in the final release of NB 7.4 the issue still persists... Please, clarity this problem.
Kind regards,
Oleh Sobeyko
Comment 25 Quality Engineering 2013-11-11 20:12:14 UTC
Integrated into 'releases/release74', will be available in build *201311111738* or newer. Wait for official and publicly available build.

User: igor_nikiforov <>
Log: Bug 230126 - /net/yourip/export/.../f.cpp is not equal /export/.../f.cpp (IDE opens new tab) - additional fix.
(transplanted from 407e58e8cbd1139eaf3a1a340507649a526a9a7e)
(transplanted from 705484352212f3ac566f99d540b863289ac9baca)
Comment 26 soldatov 2013-11-12 08:46:19 UTC
verified in NetBeans IDE 7.4 (Build 201311111738)