You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by Simon Pepping <sp...@leverkruid.eu> on 2011/09/28 21:38:33 UTC

Revision 1175754 introduces a findbugs error

Revision 1175754 introduces a significant findbugs error:

VERY confusing to have methods
org.apache.fop.fonts.MultiByteFont.getdefaultwidth() and
org.apache.fop.fonts.CIDFont.getDefaultWidth()

Simon

Re: Revision 1175754 introduces a findbugs error

Posted by mehdi houshmand <me...@gmail.com>.
Hi Simon,

Well, obviously a unit test would be the ideal solution here, but alas...

Funnily, I just checked and the method signature is correct on our
branch, just a silly merge error. There is another way to ensure this
doesn't happen again, by prefixing all overriding methods with
"@Override". This way the compiler will throw an error if said method
doesn't actually override any super class.

Mehdi

On 29 September 2011 09:20, Simon Pepping <sp...@leverkruid.eu> wrote:
> I will fix it. It is a good habit to run findbugs.
>
> This error means that CIDFont.getDefaultWidth() is not overwritten in
> MultiByteFont, and that therefore MultiByteFont.getDefaultWidth()
> returns the wrong value. Can there be a test that reveals such an
> error?
>
> Simon
>
> On Wed, Sep 28, 2011 at 08:53:26PM +0100, mehdi houshmand wrote:
>> Hi,
>>
>> This is my fault, I think this was a merge conflict here, it should be
>> MultiByteFont.getDefaultWidth().
>>
>> My apologies.
>>
>> Mehdi
>>
>> On 28 September 2011 20:38, Simon Pepping <sp...@leverkruid.eu> wrote:
>> > Revision 1175754 introduces a significant findbugs error:
>> >
>> > VERY confusing to have methods
>> > org.apache.fop.fonts.MultiByteFont.getdefaultwidth() and
>> > org.apache.fop.fonts.CIDFont.getDefaultWidth()
>> >
>> > Simon
>> >
>

Re: Revision 1175754 introduces a findbugs error

Posted by Simon Pepping <sp...@leverkruid.eu>.
I will fix it. It is a good habit to run findbugs.

This error means that CIDFont.getDefaultWidth() is not overwritten in
MultiByteFont, and that therefore MultiByteFont.getDefaultWidth()
returns the wrong value. Can there be a test that reveals such an
error?

Simon

On Wed, Sep 28, 2011 at 08:53:26PM +0100, mehdi houshmand wrote:
> Hi,
> 
> This is my fault, I think this was a merge conflict here, it should be
> MultiByteFont.getDefaultWidth().
> 
> My apologies.
> 
> Mehdi
> 
> On 28 September 2011 20:38, Simon Pepping <sp...@leverkruid.eu> wrote:
> > Revision 1175754 introduces a significant findbugs error:
> >
> > VERY confusing to have methods
> > org.apache.fop.fonts.MultiByteFont.getdefaultwidth() and
> > org.apache.fop.fonts.CIDFont.getDefaultWidth()
> >
> > Simon
> >

Re: Revision 1175754 introduces a findbugs error

Posted by mehdi houshmand <me...@gmail.com>.
Hi,

This is my fault, I think this was a merge conflict here, it should be
MultiByteFont.getDefaultWidth().

My apologies.

Mehdi

On 28 September 2011 20:38, Simon Pepping <sp...@leverkruid.eu> wrote:
> Revision 1175754 introduces a significant findbugs error:
>
> VERY confusing to have methods
> org.apache.fop.fonts.MultiByteFont.getdefaultwidth() and
> org.apache.fop.fonts.CIDFont.getDefaultWidth()
>
> Simon
>