-
Notifications
You must be signed in to change notification settings - Fork 13
NullPointerException on Save #84
Comments
Here is the faulting line 208:
Maybe just put the "checker.addFile(file);" into the try could solve it? |
The try is actually slow and if we know that the problem is of the checker being null, we can just test it with the if statement. My guess is that this is only symptoms of a different problem and we are only suppressing symptoms now, but not solving it. Probably something 'not-right' happened in the initChecker. And by suppressing it here might cause a problem somewhere else anyway. BTW when you are posting a code, the markdown syntax is disabled for obvious reasons. I made quick fix in my fork: And compiled it quickly here: https://github.com/AntonKrug/cppcheclipse/releases/tag/1.1.0 |
@AntonKrug: thx a lot for the fast workaround/fix. I will test/see if i'll experience other issue/s and report back to you. |
@AntonKrug: worked the rest of the day until now (~5h) with your new version and eclipse never crashed with the NullPointerException. Also i havent noticed any drawbacks (other issues) -> does not mean there are no. thx a lot |
You are welcome. Still keep monitoring if the change didn't break anything else. And let's wait for comment from @kwin and I will make it into a pull request. |
Let's don't just guard around |
Yes, silent fail most of the times is worse. I could increase verbosity in the initChecker so the log would be more detailed. |
@kwin @AntonKrug you are right, for a quick and dirty fix i can use it :-) but you are right the root cause is not fixed. @AntonKrug Can you please upload the version with more verbose logging and without the workaround? i can then use this until ill have the NullPointerException again and post logs. BTW: where do ill find these logs on ubuntu 16.04? |
I think running eclipse with the --consoleLog will open new window so you will see logs as they are happening |
Bit more verbosity is in this commit: Compiled jar: https://github.com/AntonKrug/cppcheclipse/releases/tag/1.1.0-verbose make a bat file which will start the eclipse with --consoleLog and I think you should be able to see the prints I did there. |
Sorry guys for the delay. Just for info: it's reproduceable after opening a file from the left tree, just make an whitespace at any place in the code and press save -> exception (Run on build) is activated. |
Hey guys, did you had a look at the logs? thx |
Not really, when I had time you didn't send them and now I got caught in different project and deadlines, I might have time in the middle of next month. :/ |
no problem, take your time :-) |
@AntonKrug is this fix already in the newest version? Thank you |
I'm not sure to be honest now. If something is working it might be fluke. |
ok, thx. Will test the new version when ill find time and come back to you. |
Hey guys.
steps to reproduce:
Using cppcheclipse in eclipse 4.5.2 on Ubuntu 16.04 and a cross compiling arm toolchain for imx.233.
Sometimes when i'll save a file (the file will be checked by cppcheclipse) it throws a NullPointerException.
Also it does'nt check any new saved files until i'll restart eclipse.
Here is the crash from the error log:
Would be nice if you could look into it.
thx
The text was updated successfully, but these errors were encountered: