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.
Summary: | Module PHP Refactoring threw java.lang.NullPointerException. | ||
---|---|---|---|
Product: | php | Reporter: | amit147 |
Component: | Refactoring | Assignee: | Petr Pisl <ppisl> |
Status: | VERIFIED FIXED | ||
Severity: | normal | CC: | pjiricka, tmysik, vriha |
Priority: | P2 | ||
Version: | 7.0.1 | ||
Hardware: | PC | ||
OS: | Linux | ||
Issue Type: | DEFECT | Exception Reporter: | |
Attachments: |
messages.log
a source file with the utf-8 problem (see attachment default.tpl) |
Description
amit147
2011-09-21 08:46:33 UTC
(In reply to comment #0) > Please report a bug against PHP Refactoring module Thanks for doing that. > attach your var/log/messages.log. Please, do so otherwise we are not able to fix the problem. Thanks. Created attachment 110968 [details]
messages.log
messages.log with nullpointer exception
Sorry, thought already had attached it... :) Thanks a lot, reopening. From the log file, it looks like there are files that are not in UTF-8 encoding and VM is not able to read them in UTF-8. Your project has UTF-8 encoding, i'm right? Is it possible that there are not UTF-8 files? Yes that is possible. Before opening some files, I got a message saying that they were not utf-8. I do not know if it was related to the null pointer exception though. I think that this is possible, because for creating preview there is need to create a swing document. I'm afraid that the reading of the document fails, so the initialization fails and some property of the project are not initialized correctly. Could you please find such file and attach here if it's possible. This is my guess and I would like to confirm it. I'm sorry, I mean property of the visual element not the project from my last comment:). Created attachment 111024 [details]
a source file with the utf-8 problem (see attachment default.tpl)
I found a source file with the utf-8 problem (see attachment default.tpl)
Thanks for the file. Now it's clear and I can reproduce it, that the problem is caused with the files in an encoding, which is not compatible with the project encoding. The right solution would be to have all files in one encoding. I will try to workaround somehow this situation on NetBeans site, but the refactoring doesn't have to work correctly for these cases, because the reading of such file will not be correct. It can be solved by introducing encoding property per file as well, but I'm not sure, whether we want it. I'm curious about your case. Why you have some files in different encoding? Hi thx for your explanation. We have a fairly large code base, about 500K lines, some of them very old and I think those old filed were made with different IDE's maybe with different encodings... Changing back the original summary, because the issue is really about the NPE in refactoring. Fixed in web main. http://hg.netbeans.org/web-main/rev/35c9c30aad81 The current behavior is that if the usage is find in a file, that can not be safely open for writing, the preview window contains error message for the file. Integrated into 'main-golden' Changeset: http://hg.netbeans.org/main-golden/rev/35c9c30aad81 User: Petr Pisl <ppisl@netbeans.org> Log: #202396 - Module PHP Refactoring threw java.lang.NullPointerException. Verified, no problem occurred with attached tpl file Product Version: NetBeans IDE 7.1 Beta (Build 201109252201) Product Version: NetBeans IDE Dev (Build 201109260601) Java: 1.7.0; Java HotSpot(TM) Client VM 21.0-b17 System: Linux version 2.6.38-11-generic running on i386; UTF-8; en_US (nb) Thank you, much appreciated! |