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.

View | Details | Raw Unified | Return to bug 169160
Collapse All | Expand All

(-)a/php.project/src/org/netbeans/modules/php/project/util/PhpProjectUtils.java (+14 lines)
Lines 95-100 Link Here
95
     */
95
     */
96
    public static PhpProject getPhpProject(FileObject fo) {
96
    public static PhpProject getPhpProject(FileObject fo) {
97
        assert fo != null;
97
        assert fo != null;
98
        if (!fastCheckIsPossibleProject(fo)) {
99
            return null;
100
        }
98
101
99
        Project project = FileOwnerQuery.getOwner(fo);
102
        Project project = FileOwnerQuery.getOwner(fo);
100
        if (project == null) {
103
        if (project == null) {
Lines 103-108 Link Here
103
        return project.getLookup().lookup(PhpProject.class);
106
        return project.getLookup().lookup(PhpProject.class);
104
    }
107
    }
105
108
109
    private static boolean fastCheckIsPossibleProject(FileObject fo) {
110
        while (fo != null) {
111
            FileObject projDir = fo.getFileObject("nbproject"); //NOI18N
112
            if (projDir != null) {
113
                return true;
114
            }
115
            fo = fo.getParent();
116
        }
117
        return false;
118
    }
119
106
    public static XMLReader createXmlReader() throws SAXException {
120
    public static XMLReader createXmlReader() throws SAXException {
107
        SAXParserFactory factory = SAXParserFactory.newInstance();
121
        SAXParserFactory factory = SAXParserFactory.newInstance();
108
        factory.setValidating(false);
122
        factory.setValidating(false);

Return to bug 169160