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 228497 - C++ Creating new Header or Source files in a project always results in a Warning, Double click to open the containing project.
Summary: C++ Creating new Header or Source files in a project always results in a Warn...
Status: REOPENED
Alias: None
Product: cnd
Classification: Unclassified
Component: Project (show other bugs)
Version: 7.3
Hardware: Macintosh Mac OS X
: P3 normal with 1 vote (vote)
Assignee: ilia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-11 20:31 UTC by kevinava
Modified: 2015-08-24 10:52 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Image of error and what Im doing. (119.38 KB, image/png)
2013-04-13 19:21 UTC, kevinava
Details
A log showing the error when using Dropbox as storage. (55.90 KB, text/plain)
2013-05-22 18:53 UTC, kevinava
Details
Log file 2 from Dropbox showing a working project and a now working project. (42.87 KB, text/plain)
2013-05-23 20:48 UTC, kevinava
Details

Note You need to log in before you can comment on or make changes to this bug.
Description kevinava 2013-04-11 20:31:51 UTC
Hi,
When adding new .cpp or .h files in a newly created C++ Source and Application projects, they dont show up under Header files or Source Files. 

And it results in the following warning,
Double click to open the containing project (Project name) 

I can see the files under Files tab, but the newly created header and source files won´t show up under the Projects > Header Files or Projects > Source Files.

To get files/items and the project "working" again, I need to right click Project Header or Source Files and select add existing item.

Should not this happen automatically when creating new files from Project menu.
Eg. Right Click Source Files in Project and choose New > C++ Source File...

Details:
Product Version: NetBeans IDE 7.3 (Build 201302132200)
Java: 1.7.0_17; Java HotSpot(TM) 64-Bit Server VM 23.7-b01
Runtime: Java(TM) SE Runtime Environment 1.7.0_17-b02
Comment 1 soldatov 2013-04-12 07:20:24 UTC
Do you create new file in Files tab or use external tools (VCS, terminal)?
Comment 2 kevinava 2013-04-13 19:20:53 UTC
(In reply to comment #1)
> Do you create new file in Files tab or use external tools (VCS, terminal)?

Hi, As I´ve tried to describe above I create the files from within Netbeans IDE by Right clicking Source Files under Projects TAB, and selecting New> C++ Source File from within the IDE.

See attachment for more details.
Comment 3 kevinava 2013-04-13 19:21:49 UTC
Created attachment 133486 [details]
Image of error and what Im doing.
Comment 4 kevinava 2013-04-13 20:31:19 UTC
(In reply to comment #3)
> Created attachment 133486 [details]
> Image of error and what Im doing.

I found the source of the problem, I´ve Imported my 7.2 settings into 7.3 at first run.
To resolve the issue I had to remove both userdir and cachedir and start Netbeans IDE 7.3 with clean and default settings. 

Ref. 
http://wiki.netbeans.org/NetBeansUserFAQ
Comment 5 kevinava 2013-04-13 21:04:35 UTC
(In reply to comment #4)
> (In reply to comment #3)
> > Created attachment 133486 [details]
> > Image of error and what Im doing.
> 
> I found the source of the problem, I´ve Imported my 7.2 settings into 7.3 at
> first run.
> To resolve the issue I had to remove both userdir and cachedir and start
> Netbeans IDE 7.3 with clean and default settings. 
> 
> Ref. 
> http://wiki.netbeans.org/NetBeansUserFAQ

So I´ve narrowed it down even more.
The error described above is only appearing when you either,
Store a project under a Dropbox folder or using CLang as tools collection / compiler.

Also I noticed another "glitch" , 
when creating a class I would assume that files would appare under Header Files and Source Files.
But files does not get "placed" to their appropriate sections.
Eg. creating a Person class, only crates the files under Source Files, even if there is a Header (.h) file being created.
Comment 6 Egor Ushakov 2013-05-22 10:47:35 UTC
please start the IDE with these extra flags:
-J-Dorg.netbeans.modules.cnd.makeproject.MakeTemplateListener.level=ALL
reproduce the problem and attach here the IDE log
(can be found in Main menu/View/IDE log)
Thanks!
Comment 7 kevinava 2013-05-22 18:53:52 UTC
Created attachment 134764 [details]
A log showing the error when using Dropbox as storage.

I´ve run Netbeans with extra flags as requested.
I can see that the error is present when storing files under Dropbox, but not when using "local" paths with both MAC GNU and Clang tool collection.
And this error seems  to be very random sadly.... but I´m able to reproduce the error. 

Netbeans sometimes refuse to add files to a projects Source/Header files when creating a class.
The result is that files are not showing up under Projects Tab > Project > Source Files / Header files sections. NOTE! The files are created and can be found under Files tab for current project and "linked/added" manually to the project so they show up under Source and Header files.

When it does work, files show up under Projects Tab > Projects > Source files only. So if a header file is created its not automatically listed under Header files when we right click and create a C++ class which results in a cpp and .h file.
 

FINE [org.netbeans.modules.cnd.makeproject.MakeTemplateListener]: not adding: /Users/kevinava/Dropbox/Private files/NetBeansProjects/nbdebugtwodropbox/dropboxclass2.cpp@14711763:44464d68 because it is not owned by this project
Comment 8 Egor Ushakov 2013-05-23 09:07:33 UTC
thanks for the info, investigating
Comment 9 Egor Ushakov 2013-05-23 09:12:52 UTC
just a side note: I see Out of memory in the log, you may want to give more memory to the IDE - run it with
-J-Xmx2G
for example gives 2 gigs
Comment 10 Egor Ushakov 2013-05-23 09:17:37 UTC
How do you set up dropbox sharing, using official client?
Do you have any extra Netbeans plugins?
Comment 11 Egor Ushakov 2013-05-23 11:46:39 UTC
I tried it on my OSX 10.7.5 and it works fine.
So far I can see the only odd thing in your logs:

Name of the project folder is sometimes:
nbdebugtwodropbox
but sometimes is with capital letters:
NBDebugTwoDropbox


FINE [org.netbeans.modules.cnd.makeproject.MakeTemplateListener]: processing file=/Users/kevinava/Dropbox/Private files/NetBeansProjects/nbdebugtwodropbox/dropboxclass2.cpp@14711763:44464d68
FINE [org.netbeans.modules.cnd.makeproject.MakeTemplateListener]: FileUtil.toFile(file.getPrimaryFile())=/Users/kevinava/Dropbox/Private files/NetBeansProjects/NBDebugTwoDropbox/dropboxclass2.cpp
FINE [org.netbeans.modules.cnd.makeproject.MakeTemplateListener]: into folder = SourceFiles{[SourceFiles][SourceFiles]}
FINE [org.netbeans.modules.cnd.makeproject.MakeTemplateListener]: in project = /Users/kevinava/Dropbox/Private files/NetBeansProjects/nbdebugtwodropbox@550d2e47:424a33c2
FINE [org.netbeans.modules.cnd.makeproject.MakeTemplateListener]: not adding: /Users/kevinava/Dropbox/Private files/NetBeansProjects/nbdebugtwodropbox/dropboxclass2.cpp@14711763:44464d68 because it is not owned by this project

Can you try to name a project in lower case?
Comment 12 kevinava 2013-05-23 20:21:31 UTC
Hi,
Im using the official Dropbox client.
Yes, I also noticed that. This is the part that seems random,
I created another project, and the files is now mixed case for Project folder and files. 
But still the same issue.

FINE [org.netbeans.modules.cnd.makeproject.MakeTemplateListener]: into folder = SourceFiles{[SourceFiles][SourceFiles]}
FINE [org.netbeans.modules.cnd.makeproject.MakeTemplateListener]: in project = /Users/kevinava/Dropbox/Private files/NetBeansProjects/NBDebugTwoDropbox@550d2e47:791cce93
FINE [org.netbeans.modules.cnd.makeproject.MakeTemplateListener]: not adding: /Users/kevinava/Dropbox/Private files/NetBeansProjects/NBDebugTwoDropbox/tryingAnotherClass.cpp@373410bb:63331a94 because it is not owned by this project
INFO [org.netbeans.modules.cnd.api.project.NativeProjectRegistry]: Close native project NBDebugOne /Users/kevinava/NetBeansProjects/NBDebugOne
INFO [org.netbeans.modules.cnd.api.project.NativeProjectRegistry]: Close native project NBDebugTwoDropbox /Users/kevinava/Dropbox/Private files/NetBeansProjects/NBDebugTwoDropbox


(In reply to comment #11)
> I tried it on my OSX 10.7.5 and it works fine.
> So far I can see the only odd thing in your logs:
> 
> Name of the project folder is sometimes:
> nbdebugtwodropbox
> but sometimes is with capital letters:
> NBDebugTwoDropbox
> 
> 
> FINE [org.netbeans.modules.cnd.makeproject.MakeTemplateListener]: processing
> file=/Users/kevinava/Dropbox/Private
> files/NetBeansProjects/nbdebugtwodropbox/dropboxclass2.cpp@14711763:44464d68
> FINE [org.netbeans.modules.cnd.makeproject.MakeTemplateListener]:
> FileUtil.toFile(file.getPrimaryFile())=/Users/kevinava/Dropbox/Private
> files/NetBeansProjects/NBDebugTwoDropbox/dropboxclass2.cpp
> FINE [org.netbeans.modules.cnd.makeproject.MakeTemplateListener]: into folder =
> SourceFiles{[SourceFiles][SourceFiles]}
> FINE [org.netbeans.modules.cnd.makeproject.MakeTemplateListener]: in project =
> /Users/kevinava/Dropbox/Private
> files/NetBeansProjects/nbdebugtwodropbox@550d2e47:424a33c2
> FINE [org.netbeans.modules.cnd.makeproject.MakeTemplateListener]: not adding:
> /Users/kevinava/Dropbox/Private
> files/NetBeansProjects/nbdebugtwodropbox/dropboxclass2.cpp@14711763:44464d68
> because it is not owned by this project
> 
> Can you try to name a project in lower case?
Comment 13 kevinava 2013-05-23 20:48:07 UTC
Created attachment 134835 [details]
Log file 2 from Dropbox showing a working project and a now working project.

Hi, as I explained earlier the problem seems random.
This session is run with -J-Xmx2048m

I created the project xmx2040Project,
this project works "perfectly", as I can add new C++ classes with mixed case, lower case, upper case.
But it still does not add files under their right categories, eg. .h files is not placed under Header Files section automatically.

I then created the project Another2048XmxProject,
this project get the error and won´t add any new classes etc, 
and returns warning: 
Double Click to open containing project.

See attached log file for details.