You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Simone Tripodi <si...@apache.org> on 2011/10/16 12:53:39 UTC

[dbutils] Clirr false positive?

Hi all guys,
while fixing the violations emerged in last DbUtils RC, I noticed that
the bigger part of QueryRunner code has been moved to
AbstractQueryRunner and Clirr now complains that the 'ds' field in
QueryRunner disappeared[1], but it would be available anyway!
Is that acceptable in order to submit a new RC or we have to find a
way to fix the violation?
TIA!
Simo

[1] http://people.apache.org/builds/commons/dbutils/1.4/RC2/site/clirr-report.html

http://people.apache.org/~simonetripodi/
http://simonetripodi.livejournal.com/
http://twitter.com/simonetripodi
http://www.99soft.org/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [dbutils] Clirr false positive?

Posted by sebb <se...@gmail.com>.
On 16 October 2011 12:31, Simone Tripodi <si...@apache.org> wrote:
> it is now protected[1] but Clirr still complains...
>
> [1] $ svn annotate
> src/main/java/org/apache/commons/dbutils/AbstractQueryRunner.java
> ...
> 1184792 simonetripodi     protected final DataSource ds;
> ...

Not sure why that is.

Looks like it may be a Clirr bug, but seems such an obvious one that
I'm sure it would have been fixed.

[Later] I think the problem is that the field is final, and final
fields can be moved into the referencing class.

Certainly that's what happened when I tried with a String field - the
grandchild did not see the updated field (unless recompiled).

Parent.java
public abstract class Parent {
//      protected final String c="parent";
}

Child.java
public class Child extends Parent {
    protected final String c="child";
}

GrandChild.java
public class GrandChild extends Child {
    public static void main(String args[]) {
        Child ch = new GrandChild();
        System.out.println(ch.c);
    }
}

Compile GrandChild and run - it prints "child"

Now comment c in Child and uncomment c in Parent; recompile Child (not
GrandChild).

Run GrandChild - it prints "child"

Recompile and run GrandChild => "parent"

> http://people.apache.org/~simonetripodi/
> http://simonetripodi.livejournal.com/
> http://twitter.com/simonetripodi
> http://www.99soft.org/
>
>
>
> On Sun, Oct 16, 2011 at 1:03 PM, sebb <se...@gmail.com> wrote:
>> On 16 October 2011 11:53, Simone Tripodi <si...@apache.org> wrote:
>>> Hi all guys,
>>> while fixing the violations emerged in last DbUtils RC, I noticed that
>>> the bigger part of QueryRunner code has been moved to
>>> AbstractQueryRunner and Clirr now complains that the 'ds' field in
>>> QueryRunner disappeared[1], but it would be available anyway!
>>
>> AbstractQueryRunner has:
>>    private final DataSource ds;
>> which is not accessible.
>>
>>> Is that acceptable in order to submit a new RC or we have to find a
>>> way to fix the violation?
>>
>> This change to using a private field is an improvement; however it
>> will break any applications that rely on using it.
>>
>> What is the likelihood that applications will have been using the field?
>>
>>> TIA!
>>> Simo
>>>
>>> [1] http://people.apache.org/builds/commons/dbutils/1.4/RC2/site/clirr-report.html
>>>
>>> http://people.apache.org/~simonetripodi/
>>> http://simonetripodi.livejournal.com/
>>> http://twitter.com/simonetripodi
>>> http://www.99soft.org/
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>>> For additional commands, e-mail: dev-help@commons.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>> For additional commands, e-mail: dev-help@commons.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [dbutils] Clirr false positive?

Posted by Simone Tripodi <si...@apache.org>.
it is now protected[1] but Clirr still complains...

[1] $ svn annotate
src/main/java/org/apache/commons/dbutils/AbstractQueryRunner.java
...
1184792 simonetripodi     protected final DataSource ds;
...

http://people.apache.org/~simonetripodi/
http://simonetripodi.livejournal.com/
http://twitter.com/simonetripodi
http://www.99soft.org/



On Sun, Oct 16, 2011 at 1:03 PM, sebb <se...@gmail.com> wrote:
> On 16 October 2011 11:53, Simone Tripodi <si...@apache.org> wrote:
>> Hi all guys,
>> while fixing the violations emerged in last DbUtils RC, I noticed that
>> the bigger part of QueryRunner code has been moved to
>> AbstractQueryRunner and Clirr now complains that the 'ds' field in
>> QueryRunner disappeared[1], but it would be available anyway!
>
> AbstractQueryRunner has:
>    private final DataSource ds;
> which is not accessible.
>
>> Is that acceptable in order to submit a new RC or we have to find a
>> way to fix the violation?
>
> This change to using a private field is an improvement; however it
> will break any applications that rely on using it.
>
> What is the likelihood that applications will have been using the field?
>
>> TIA!
>> Simo
>>
>> [1] http://people.apache.org/builds/commons/dbutils/1.4/RC2/site/clirr-report.html
>>
>> http://people.apache.org/~simonetripodi/
>> http://simonetripodi.livejournal.com/
>> http://twitter.com/simonetripodi
>> http://www.99soft.org/
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>> For additional commands, e-mail: dev-help@commons.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [dbutils] Clirr false positive?

Posted by sebb <se...@gmail.com>.
On 16 October 2011 11:53, Simone Tripodi <si...@apache.org> wrote:
> Hi all guys,
> while fixing the violations emerged in last DbUtils RC, I noticed that
> the bigger part of QueryRunner code has been moved to
> AbstractQueryRunner and Clirr now complains that the 'ds' field in
> QueryRunner disappeared[1], but it would be available anyway!

AbstractQueryRunner has:
    private final DataSource ds;
which is not accessible.

> Is that acceptable in order to submit a new RC or we have to find a
> way to fix the violation?

This change to using a private field is an improvement; however it
will break any applications that rely on using it.

What is the likelihood that applications will have been using the field?

> TIA!
> Simo
>
> [1] http://people.apache.org/builds/commons/dbutils/1.4/RC2/site/clirr-report.html
>
> http://people.apache.org/~simonetripodi/
> http://simonetripodi.livejournal.com/
> http://twitter.com/simonetripodi
> http://www.99soft.org/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org