#FindBugs vulnerable to finalizer attack
1 messages ยท Page 1 of 1 (latest)
<@&987246883653156906> please have a look, thanks.
all of them?
yeah
ok thx
yes im using inheritance
subclasses are inherting methods from parent class, should i prociede with finalizing my classes still @solar wren
Well, not the ones being inherited but at least all the other ones
You should never use finalize
I think they mean making them final and not using finalize method
I have implementer final method inside the parent class, and now im not gettong any errors from findbugs ๐๐ฝ
do you really override the Object#finalize method?
Wdym
Final or finalize?
no that's findbugs
findbugs is noticing an issue that might crop up with certain finalize methods and reflection if you're not consistent and make things final when they should be
I meant to say i added finalize method like this: protect final void finalize with an empty body
It worked
Cause of findbugs
don't use finalize
remove it
Make findbugs behave, or look up what the issue is and how you can fix it
Probably need some decent object design and it won't happen
Like it said, initialize all fields in the constructor for example
Using finalize is a problem in itself, don't use it
You should have a warning appearing
There is no way you would listen to findbugs but ignore basic warnings
Finalize has been deprecated since java 9, and is up for removal. So you should indeed get a warning, and you really shouldn't be using it.