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 217145 - Project with existing sources - browser not refreshed
Summary: Project with existing sources - browser not refreshed
Status: VERIFIED FIXED
Alias: None
Product: web
Classification: Unclassified
Component: HTML Project (show other bugs)
Version: 7.3
Hardware: All All
: P3 normal (vote)
Assignee: Tomas Mysik
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-21 09:59 UTC by Jiri Skrivanek
Modified: 2012-11-19 09:10 UTC (History)
2 users (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 Jiri Skrivanek 2012-08-21 09:59:01 UTC
Project name is different than user supplied in new project with existing sources wizard. To reproduce:

- have a folder with one html file on local disk (e.g. Site1/index.html)
- open new project wizard
- select HTML/JavaScript|HTML 5 Application with Existing Sources" and click Next
- browse for Site1 folder as Site Root
- change project directory to ...\Site1Project
- leave unchanged project name Site1
- click Finish
- change default run config to "Chrome with NetBeans Integration"
- run project (F6)
- open index.html, modify it and save it
- nothing happens in browser. It shows previous content.

Product Version: NetBeans IDE Dev (Build EaselCSS-520-on-20120821)
Java: 1.7.0_06; Java HotSpot(TM) 64-Bit Server VM 23.2-b09
System: Windows 7 version 6.1 running on amd64; Cp1250; en_US (nb)
Comment 1 David Konecny 2012-08-22 00:13:33 UTC
This does not look related to "From Existing Sources" so assigning back to myself. I cannot reproduce. It just works for me. There is similar (and valid) issue for Embedded Browser.
Comment 2 Jiri Skrivanek 2012-08-22 10:32:07 UTC
Vlada reproduced it on Linux as well. Please, be careful to change project directory to something else than Site Root folder.
Comment 3 Tomas Mysik 2012-11-07 09:10:39 UTC
Marking as WORKSFORME since I cannot reproduce it. Can you guys verify? Thanks.

Product Version: NetBeans IDE Dev (Build 20121106-28f2059fb76f)
Java: 1.6.0_35; Java HotSpot(TM) 64-Bit Server VM 20.10-b01
Runtime: Java(TM) SE Runtime Environment 1.6.0_35-b10
System: Linux version 3.2.0-32-generic running on amd64; UTF-8; cs_CZ (nb)
Comment 4 Jiri Skrivanek 2012-11-07 10:38:59 UTC
Still reproducible in build 201211070001. Workaround is to change Autorefresh in properties to false and then to true.
Comment 5 Tomas Mysik 2012-11-14 05:24:24 UTC
Will fix it.
Comment 6 Tomas Mysik 2012-11-14 06:50:43 UTC
Sorry, still cannot reproduce - just found out that if the property is not set yet (our case), it is taken from the "browser integration" property itself [1]. Davide, have you any idea why this could be false for Jirka? Jirko, if you open Project Properties > Run, you see Chrome with NetBeans integration - right?

[1] ClientProjectConfigurationImpl.isAutoRefresh()

Product Version: NetBeans IDE Dev (Build 20121114-81d2ab562d59)
Java: 1.6.0_35; Java HotSpot(TM) 64-Bit Server VM 20.10-b01
Runtime: Java(TM) SE Runtime Environment 1.6.0_35-b10
System: Linux version 3.5.0-18-generic running on amd64; UTF-8; cs_CZ (nb)
Comment 7 Jiri Skrivanek 2012-11-14 09:49:04 UTC
Still reproducible with original steps. From the following lines in code it seems that FileChangeListener listens just on project root and not source/site root

        protected void projectOpened() {
            projectFileChangesListener = new ProjectFilesListener(p);
            FileUtil.addRecursiveListener(projectFileChangesListener, FileUtil.toFile(p.getProjectDirectory()));

Structure of project is the following

Site1/index.html
Site1Project/config
            /nbproject
            /test
Comment 8 Tomas Mysik 2012-11-14 09:57:02 UTC
Aaaah, sorry, now I see it. My project structure is:

.
├── config
├── nbproject
│   ├── project.properties
│   └── project.xml
├── Site1
│   └── index.html
└── test

I will fix it, thanks Jirko!
Comment 9 Tomas Mysik 2012-11-14 10:04:43 UTC
Davide, I plan to fix it this way - register FS listener just on Site Root. However, then we need to handle:
- Site Root changes,
- Site Root can be null (broken project).

Do you agree? Or is there any other reason why we should listen to project (or test or config) directory?

Please, reassign back to me, thanks.
Comment 10 David Konecny 2012-11-14 19:27:53 UTC
(In reply to comment #9)
> Davide, I plan to fix it this way - register FS listener just on Site Root.

Yes.

> However, then we need to handle:
> - Site Root changes,
> - Site Root can be null (broken project).

Yes, listening on ClientSideProjectConstants.PROJECT_SITE_ROOT_FOLDER changes in project's evaluator should do the trick, right?

> 
> Do you agree?

Yes. 

> Or is there any other reason why we should listen to project (or
> test or config) directory?

No. It's a leftover from times when project root used to be also site root.
Comment 11 Tomas Mysik 2012-11-15 11:26:30 UTC
Fixed I hope.

http://hg.netbeans.org/web-main/rev/a21b251e032b
Comment 12 Quality Engineering 2012-11-16 02:42:49 UTC
Integrated into 'main-golden', will be available in build *201211160001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/a21b251e032b
User: Tomas Mysik <tmysik@netbeans.org>
Log: #217145 - Project with existing sources - browser not refreshed
Comment 13 Jiri Skrivanek 2012-11-16 09:00:13 UTC
The fix caused bug 222251.
Comment 14 Tomas Mysik 2012-11-16 10:46:05 UTC
Closing back as FIXED, issue #222249 is fixed now. Please verify. Thanks.