Every time I use the bulb hint for adding try-catch blocks in Netbeans, it automatically adds these lines:
import java.util.logging.Level;
import java.util.logging.Logger
...
catch(...) {
Logger.getLogger(ClassName.class.getName()).log(Level.SEVERE, null, ex);
}
I found it sort of annoying, because it also adds the necessary imports and since I'm using different logger (slf4j), I'm forced to overwrite it all the time.
Is there a way of customizing that code snippet?
In Netbeans, go to menu option Tools -> Options -> Editor -> Hints (Tab) -> Make Sure Language Java is selected -> in the tree select "Error Fixes" - "Surround with try-catch".
And in that screen, to the right, disable the checkbox: "Use java.util.logging.Logger"
Hopefully the below screenshot makes it easier to understand these steps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With