Issue Type: Bug Bug
Affects Versions: 2.6.1
Assignee: Unassigned
Created: 15/Jan/14 9:43 AM
Description:

Given

An API going from:

ConnectionFactory newHeartBeatConnectionFactory(ConnectionFactory, long, TimeUnit, SearchRequest, ScheduledExecutorService)

to:

ConnectionFactory newHeartBeatConnectionFactory(ConnectionFactory, long, long, TimeUnit, SearchRequest)

will trigger the following error report:

[ERROR] 7005: Connections: Parameter 3 of 'public ConnectionFactory newHeartBeatConnectionFactory(ConnectionFactory, long, TimeUnit, SearchRequest, ScheduledExecutorService)' has changed its type to long
[ERROR] 7005: Connections: Parameter 4 of 'public ConnectionFactory newHeartBeatConnectionFactory(ConnectionFactory, long, TimeUnit, SearchRequest, ScheduledExecutorService)' has changed its type to TimeUnit
[ERROR] 7005: Connections: Parameter 5 of 'public ConnectionFactory newHeartBeatConnectionFactory(ConnectionFactory, long, TimeUnit, SearchRequest, ScheduledExecutorService)' has changed its type to SearchRequest

When

when trying to ignore this difference with the following code:

  <difference>
    <className>org/forgerock/opendj/ldap/Connections</className>
    <differenceType>7005</differenceType>
    <method>%regex[ConnectionFactory newHeartBeatConnectionFactory\(ConnectionFactory, long, .*\)]</method>
    <to>%regex[ConnectionFactory newHeartBeatConnectionFactory\(ConnectionFactory, long, long, .*\)]</to>
  </difference>

Then

Actual

This difference still gets reported.

Expected

This difference is ignored and not reported anymore.

Explanation

This is because the code in Difference.replaceNthArgumentType() is not trimming the type before appending to the StringBuilder.
While the <method> matches, the <to> does not match, because code ends up testing the following which returns false:

"ConnectionFactory newHeartBeatConnectionFactory(ConnectionFactory,    long,   long,  TimeUnit, SearchRequest)"
    .matches("ConnectionFactory newHeartBeatConnectionFactory\(ConnectionFactory, long, long, .*\)")

Notice how undesired extra spaces have been added to the new method signature.

A workaround is possible by using \s+ instead of a simple space ' ', but it makes the regex harder to read than necessary.

Please consider fixing this issue with the attached patch.

Project: Mojo's Clirr Maven Plugin
Priority: Minor Minor
Reporter: Jean-Noel Rouvignac
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
--------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email

Reply via email to