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.
Created attachment 146310 [details] sample project. Bugs #190668, #155054, #100325 and #92138 are complaints about template specializations that are highlighted as errors in the ide. All are marked fixed, so perhaps this is a regression. Attached is a small, complete project that compiles correctly, but the ide shows errors on the template specializations in tools.cc. Attached also is a screen shot of the editor. Interestingly, when I remove the template insantiations using the enum and the enum declarations, some unrelated errors in other specializations disappear. Product Version: NetBeans IDE Dev (Build 201403100001) Updates: Updates available Java: 1.7.0_45; Java HotSpot(TM) Client VM 24.45-b08 Runtime: Java(TM) SE Runtime Environment 1.7.0_45-b18 System: Linux version 3.12.6-200.fc19.x86_64 running on i386; UTF-8; en_US (nb) User directory: /home/toddb/.netbeans/dev Cache directory: /home/toddb/.cache/netbeans/dev
Created attachment 146311 [details] shot of ide errors
Seems that it is already fixed in dev version.
Please look a little more closely. The declaration of NodeOption ctor in header.h has an error. Note also that this sample project is a distillation of a much larger project. The original errors I see (re new attached screenshot) hit each of the parse() method name and the mName and mValue usages.
Created attachment 146843 [details] snapshot of original errors.
I should note that you are partly correct: The current version, netbeans-trunk-nightly-201404190001-cpp-linux.sh, has fewer errors.
Hmm in my ide there were no errors. What happens after reparsing of the project?
Actually, you are absolutely right, there is a problem after opening the project again. Interesting thing is that in fact all highlighted errors are resolved - you can navigate at them. After reparsing and closing/opening file, there are no red highlighting.
Well, I have long used the three-step process to convince NB to do the right thing: (a) clean and build, (b) configure project using build output, (c) reparse project. This does work in most cases, although I would hope you would agree that it is a bug that that process is require. But that's a different subject. In this case the process does not work, and my code is nicely decorated with red spots, as illustrated in the last attached screenshot. Presumably you are a very smart guy because you got assigned this bug. So the question is: can you figure out what is broken? I should note that there are a few differences between the demo project and my collection of projects. First is that the project properties for bug4 does not have a 'Configure Code Assistance' menu item. My project (which contains the code with the errors) does have a 'Configure Code Assistance' menu item, and under the properties dialog there is a configure code assistance item where I have unchecked 'Use Build analyzer'. The reason for this is that I have 40 separate projects, one for each library, and if I use the build analyzer, it (wrongly) begins to add duplicate directories to all the projects after each build. So... we could talk about the 2 million lines of code that I maintain with netbeans... There is something else I just thought of that could be a hint. In my project, as shown, the parse method, the mName and mValue members are all underlined in red and the flyover says that they do not have a definition. But I can actually use Navigate-->go to declaration on 'parse', but not on the member variables. So clearly there is some confusion in the code. What logs or analysis can I send you that will reveal the problem?
Of cause, this is a bug, and I will not close it, don't worry:). Thanks for assistance, but since I could reproduce it on your sample project, I don't think that I need to see any logs or know details of configuration of your real project right now.
Integrated into 'main-silver', will be available in build *201404240001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/a972b5360b0a User: Petr Kudryavtsev <petrk@netbeans.org> Log: Fixing #243262 - regression: template specializations parsed incorrectly
I needed to remove ~/.cache/netbeans/dev/cnd/model (as usual for version changes) but this patch fixed a long-time problem! Very nice.
I spoke too soon. The sample project appears to be fine now, but my code still displays with errors. Here's the order of events: - I removed ~/.cache/netbeans/dev/cnd/model - started the ide, allowed projects to be parsed - looked at the code and all the errors marked in the ide were gone. But... - I noticed it could not resolve any of the symbols; e.g. click on 'parse' in NodeOptionT<uint>::parse(const char* value) and click 'go to declaration' which failed. - again, I exited the ide, removed ~/.cache/netbeans/dev/cnd/model - started the ide, allowed projects to be parsed - clean & build, configure project using build output, reparse project. - the errors returned as illustrated in the 'snapshot of original errors' attachment, but all of the symbols except for mValue can be navigated. Any ideas what could be different? The structure of the project? The use of multiple projects? Some kind of disconnect between the navigable state of variables and the ide's ability to resolve variables?
I've always noticed that NB has trouble with multiple projects. What about this: let's say that there are two projects A and B. Project A is a library, just like the attached demo project, and project B is an application that links with project A. So if I were to open tools.cc in the editor, could it be that the navigation of variables is handled by the (correct) state of project A, but the editor's display of variables is handled by the (incorrect) state of project B?
Created attachment 146926 [details] two projects that demonstrate the problem Well, I think the new attachment demonstrates the problem. Two projects: a library and an app. This is very similar to the way I have constructed the netbeans projects on top of existing code. tools.cc in bug5a now shows the ide errors but the member variables are still navigable.
Thank you for test case again, and, yes, the problem could be if you have move than one opened project. I've pushed some more changes and the second test case works normally now, so, please, check the next dev version (will be available tomorrow) on your main project. BTW, don't forget to remove cachedir :)
Another small note - the problem is not in multiple opened projects, it is in way we handling specializations in instantiated classes. Opening a couple of projects just changes the parse queue (I suppose), so the problem appears.
Integrated into 'main-silver', will be available in build *201404290001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/6e576da6a38d User: Petr Kudryavtsev <petrk@netbeans.org> Log: Additional fix for #243262 - regression: template specializations parsed incorrectly
Not sure what you are looking at but using the build below (and, yes, removing the cache) the last sample pair of projects now shows a parse error on stl string and I can't navigate to the string declaration. And in my projects, it is just as bad as ever: I can navigate the methods but not the members, and the ide is still sprinkled with red markers. I am going to bet that you see something different... a different error or a different location for the error, or something. Which suggests that this is more driven by the state of the state machine in the ide. Perhaps the parse queue as you suggested or something more nefarious. Product Version: NetBeans IDE Dev (Build 201404290001) Java: 1.7.0_51; Java HotSpot(TM) Client VM 24.51-b03 Runtime: Java(TM) SE Runtime Environment 1.7.0_51-b13 System: Linux version 3.12.11-201.fc19.x86_64 running on i386; UTF-8; en_US (nb) User directory: /home/toddb/.netbeans/dev Cache directory: /home/toddb/.cache/netbeans/dev
Integrated into 'main-silver', will be available in build *201404300001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/3ae719cda496 User: Petr Kudryavtsev <petrk@netbeans.org> Log: Additional fix for #243262 - regression: template specializations parsed incorrectly
Maybe not all changes were in build 201404290001? Please, check both samples in 201404300001 and if there would be any errors, describe each step you make (I suggest you to try samples with not only clean cachedir but clean userdir as well (you can use --userdir <path> command line parameter)).
Briefly: this build201404300001 fixes the ide errors and all the members and methods are navigable. However, the similar code in my projects still has the ide errors on the 'parse' method name and 'mValue' member variables. 'parse' is navigable and mValue is not. 1. mv ~/.cache/netbeans/dev aside 2. start netbeans --userdir ~/tmp/.netbeans 3. load/build bug5a and bug5b projects; all c++ files show without errors 4. load/build my projects; NodeOptionT<>::parse() and NodeOptionT<>::mValue are underlined in red. I can navigate parse() back to the declaration, but not mValue. 5. restart netbeans without --userdir 6. repeat 3 & 4 with the same results. So.... how can I capture the state of the ide that can reveal the problem? I'd give you the code, but it is proprietary.
For now log is not very useful, so I will add more logging to reveal this problem, but a little bit later.
Integrated into 'releases/release80', will be available in build *201406041415* or newer. Wait for official and publicly available build. Changeset: http://hg.netbeans.org/releases/rev/6f5dd03943f0 User: Petr Kudryavtsev <petrk@netbeans.org> Log: Fixing #243262 - regression: template specializations parsed incorrectly (transplanted from a972b5360b0af1bf5b18772b7bcb9a9174aa8b96)