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 257757 - FileOwner.getOwner(), ProjectManager.findProject(), WebModule.getModule() metods unexpected behavour
Summary: FileOwner.getOwner(), ProjectManager.findProject(), WebModule.getModule() met...
Status: NEW
Alias: None
Product: platform
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 8.1
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Antonin Nebuzelsky
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-01-29 10:52 UTC by Valery-Sh
Modified: 2016-02-10 12:15 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
A simple NetBeans Project Suite source code (1.01 MB, application/x-zip-compressed)
2016-01-29 10:52 UTC, Valery-Sh
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Valery-Sh 2016-01-29 10:52:20 UTC
Created attachment 158283 [details]
A simple NetBeans Project Suite source code

Suppose I have a web application and I put into the src/main/webapp a file named package.json.

If i  write in a NetBeans module:

    Project webProject = FileOwnerQuery.getOwner(
          <any-web-project-file-object-inside-project-dir>);

or 

    Project webProject = Projectmanager.getDefault.findProject(
            <any-web-project-file-object-inside-project-dir>);


than webProject is an instance of ConvertorProject. 
(org.netbeans.modules.project.ui.convertor.ProjectConvertorFactory$ConvertorProject)

And the code:

    WebModule.getModule(<any-web-project-file-object-inside-project-dir>) 

produces null value.

But if an object of type  FileObject points to the root project directory the everything works as expected.



I have:
Windows 7 (64)
jdk-1.8.0_72
NetBeans 8.1