How to extend 'Malformed format string' inspection to inspect more classes

Hi.

Is there any way that I can extend the inspection 'Malformed format string' so that it doesn't work only the four classes it currently uses (java.util.Formatter, java.lang.String, java.io.PrintWriter java.io.PrintStream)? I have some logging implementation I'm using which do not conform to any of these classes (I can't extend them for my purposes, either), but I would still like to have this inspection go over all my calls.
If the inspection cannot be extended to other classes, can you direct to how I may add inspections (and find the source code for this inspection, assuming it's not copyrighted)?

Thanks,
Oz

1 comment
Comment actions Permalink

Hello,

Unfortunately there is no way to extend it now.

You can write Structural Search pattern (and include it in the corresponding inspection) to highlight your specific problems. On the other hand you can patch existing inspection (com.siyeh.ig.bugs.MalformedFormatStringInspection) with configuration UI (as it done e.g. for "method call result is skiped" inspection).

Thank you

0

Please sign in to leave a comment.