db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Knut Anders Hatlen (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (DERBY-6262) Simplify message-generating methods using varargs
Date Mon, 24 Jun 2013 14:04:20 GMT

     [ 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-04-a.diff

client.am.LogWriter has lots of methods for tracing method entry and exit.

For example, there are 30 different traceEntry() methods, but a single traceEntry() method
using varargs would suffice. The 5 different traceDeprecatedEntry() methods could be simplified
in a similar fashion.

There are also many traceExit() methods. They all take the same number of arguments, so varargs
won't help. However, many of them simply convert an argument from a primitive type to a string
and forward it to the generic traceExit() method that takes an Object. The same could be achieved
by removing the specialized traceExit() methods for primitive types and just rely on auto-boxing
to relay the calls directly to the method that takes an Object.

Attaching derby-6262-04-a.diff makes the suggested changes.

All regression tests ran cleanly.
                
> 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,
derby-6262-04-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

Mime
View raw message