[ 
https://issues.apache.org/jira/browse/DERBY-6262?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Knut Anders Hatlen updated DERBY-6262:
--------------------------------------

    Attachment: derby-6262-03-a.diff

Attaching derby-6262-03-a.diff, which collapses many message formatting methods 
in the tools.

Since all of the methods had the message arguments at the end, they mapped 
nicely to varargs, and no callers of the methods had to be changed. I couldn't 
resist changing one caller, though: NetworkServerControlImpl.localizeMessage() 
had a big switch statement to choose which of the five overloads of 
LocalizedResource.getTextMessage() to call. The patch replaces that code with a 
single call to getTextMessage().

All tests ran cleanly with the patch.
                
> Simplify message-generating methods using varargs
> -------------------------------------------------
>
>                 Key: DERBY-6262
>                 URL: https://issues.apache.org/jira/browse/DERBY-6262
>             Project: Derby
>          Issue Type: Improvement
>          Components: Miscellaneous
>    Affects Versions: 10.11.0.0
>            Reporter: Knut Anders Hatlen
>            Assignee: Knut Anders Hatlen
>            Priority: Minor
>         Attachments: derby-6262-01-a.diff, derby-6262-02-a.diff, 
> derby-6262-03-a.diff
>
>
> I've found that many methods that generate messages could be collapsed into a 
> single method using varargs. Right now, many of them exist in multiple 
> variants, typically for zero up to three or four message arguments.
> Examples:
>   Monitor.logTextMessage()
>   MessageService.getTextMessage()
>   Constructors in SqlException and SqlWarning

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to