[
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-01-a.diff
The attached patch, derby-6262-01-a.diff, makes the following changes:
1) SqlException.java: Replace five constructors with a single one using
varargs. No changes needed in the callers.
2) SqlWarning.java: Replace three constructors with a single one using varargs.
No changes needed in the callers.
3) SQLWarningFactory.java: Replace four methods with a single one using
varargs. No changes needed in the callers.
4) MessageService.java: Replace seven methods with a single one using varargs.
Since the seven methods didn't have the exact same names, some callers had to
be updated to call a message with a different name.
5) Monitor.java: Replace five methods with a single one using varargs. No
changes needed in the callers.
6) Util.java: Replace six methods with two varargs methods. One of the varargs
methods had to change the parameter order to get the varargs parameter at the
end of the parameter list. Callers of that method had to be updated with
correctly ordered arguments. This also revealed a minor bug in
EmbedClob.position() where an exception was passed as a message argument
instead of the position. That is, the patch changes the error message created
for this code:
Connection conn =
DriverManager.getConnection("jdbc:derby:memory:db;create=true");
Clob c = conn.createClob();
c.position("test", 65);
from
The position argument 'java.io.EOFException' exceeds the size of the
BLOB/CLOB.
to
The position argument '65' exceeds the size of the BLOB/CLOB.
7) MessageUtil.java: Replace five methods with a single one using varargs. No
changes needed in the callers.
All regression tests passed 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
>
>
> 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