@PrintFormat Argument vis. a vis. Object... args

Hi,

I occasionally write methods that are intermediary to the stock format(String, Object...) methods in String or one of the java.io classes. As with the stock format(...) methods, these methods of my own take a format string and an variable-length (array) of Objects as values to be formatted.

I always use the @PrintFormat annotation on the formatting control string argument and I'd like to get the same kind of format spec vs. args validation that's done when the stock format(...) methods are used. Is that possible? Are there furthter IntelliLang annotations I can use to achieve this? I couldn't find anything to that effect in the documentation.


Thanks

Randall Schulz

1 comment
Comment actions Permalink

Hello Randall,

IntelliLang does not provide any checks for the correct "usage context" of a pattern it
validates, such as the correct number and type of format-parameters passed as varargs.

The only solution I see right now would be to make the corresponding inspection provided
by Inspection Gadgets aware of the annotation.

Sascha

Hi,

I occasionally write methods that are intermediary to the stock format(String, Object...) methods in String or one of the java.io classes. As with the stock format(...) methods, these methods of my own take a format string and an variable-length (array) of Objects as values to be formatted.

I always use the @PrintFormat annotation on the formatting control string argument and I'd like to get the same kind of format spec vs. args validation that's done when the stock format(...) methods are used. Is that possible? Are there furthter IntelliLang annotations I can use to achieve this? I c
ouldn't find anything to that effect in the documentation.


Thanks

Randall Schulz


---
Original message URL: http://www.jetbrains.net/devnet/message/5229531#5229531

0

Please sign in to leave a comment.