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 2010/11/17 21:29:06 UTC

Re: svn commit: r1036179 [1/2] - in /xmlgraphics/fop/trunk: ./ examples/embedding/java/embedding/ src/java/org/apache/fop/afp/ src/java/org/apache/fop/afp/modca/ src/java/org/apache/fop/apps/ src/java/org/apache/fop/area/ src/java/org/apache/fop/area/inlin...

On Wed, Nov 17, 2010 at 07:45:31PM -0000, spepping@apache.org wrote:
> Author: spepping
> Date: Wed Nov 17 19:45:27 2010
> New Revision: 1036179
> 
> URL: http://svn.apache.org/viewvc?rev=1036179&view=rev
> Log:
> findbugs-reported bug squashing; 959 bugs left (findbugs 1.3.9)

findbugs reports naming problems in public methods, such as setters
and getters. I resolved those problems. But in doing so, in principle
I am changing the public API. I do not think that every public method
is really in use by other applications. Let me know when I go too far
in those changes, harming applications that depend on fop.

Simon


Re: svn commit: r1036179 [1/2] - in /xmlgraphics/fop/trunk

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
Thanks!!!

On 19.11.2010 11:33:21 Simon Pepping wrote:
> I will revert the renaming of public methods. It was not a good idea.
> Sorry for the noise.
> 
> Simon
> 
> On Thu, Nov 18, 2010 at 05:03:34PM +0100, Simon Pepping wrote:
> > It breaks org.krysalis.barcode4j.fop.BarcodeXMLHandler: getNamespace
> > -> getNameSpace (from render.xml.XMLXMLHandler.getNamespace ->
> > getNameSpace
> > 
> > On Thu, Nov 18, 2010 at 04:42:44PM +0100, Simon Pepping wrote:
> > > render.AbstractGenericSVGHandler.getNamespace -> getNameSpace
> > > render.intermediate.extensions.AbstractAction.setID -> setId
> > > render.intermediate.extensions.AbstractAction.getID -> getId
> > > render.intermediate.extensions.AbstractAction.hasID -> hasId
> > > render.intermediate.extensions.AbstractAction.getIDPrefix -> getIdPrefix
> > > render.intermediate.extensions.URIAction.getIDPrefix -> getIdPrefix
> > > render.XMLHandler.getNamespace -> getNameSpace
> > > render.ps.PSImageFormResource.getImageURI -> getImageUri
> > > render.xml.XMLXMLHandler.getNamespace -> getNameSpace
> > > render.afp.AFPRendererImageInfo.getURI -> getUri
> > > fonts.type1.PFMFile.getPostscriptName -> getPostScriptName
> > > tools.TestConverter.setBaseDir -> setBasedir
> > > tools.anttasks.Fop.setUserconfig -> setUserConfig
> > > tools.anttasks.Fop.getUserconfig -> getUserConfig()
> > > tools.anttasks.Fop.setFofile -> setFoFile
> > > tools.anttasks.Fop.getFofile -> getFoFile
> > > tools.anttasks.Fop.setThrowexceptions -> setThrowExceptions
> > > tools.anttasks.Fop.getThrowexceptions -> getThrowExceptions
> > > apps.PageSequenceResults.getID -> getId
> > > fo.FOText.getBaseLineShift -> getBaselineShift
> > > cli.CommandLineOptions.getFOFile -> getFoFile
> > > cli.CommandLineOptions.getXMLFile -> getXmlFile
> > > cli.CommandLineOptions.getXSLFile -> getXslFile
> > > 
> > > On Wed, Nov 17, 2010 at 09:29:06PM +0100, Simon Pepping wrote:
> > > > On Wed, Nov 17, 2010 at 07:45:31PM -0000, spepping@apache.org wrote:
> > > > > Author: spepping
> > > > > Date: Wed Nov 17 19:45:27 2010
> > > > > New Revision: 1036179
> > > > > 
> > > > > URL: http://svn.apache.org/viewvc?rev=1036179&view=rev
> > > > > Log:
> > > > > findbugs-reported bug squashing; 959 bugs left (findbugs 1.3.9)
> > > > 
> > > > findbugs reports naming problems in public methods, such as setters
> > > > and getters. I resolved those problems. But in doing so, in principle
> > > > I am changing the public API. I do not think that every public method
> > > > is really in use by other applications. Let me know when I go too far
> > > > in those changes, harming applications that depend on fop.
> > > > 
> > > > Simon
> > > > 




Jeremias Maerki


Re: svn commit: r1036179 [1/2] - in /xmlgraphics/fop/trunk

Posted by Simon Pepping <sp...@leverkruid.eu>.
I will revert the renaming of public methods. It was not a good idea.
Sorry for the noise.

Simon

On Thu, Nov 18, 2010 at 05:03:34PM +0100, Simon Pepping wrote:
> It breaks org.krysalis.barcode4j.fop.BarcodeXMLHandler: getNamespace
> -> getNameSpace (from render.xml.XMLXMLHandler.getNamespace ->
> getNameSpace
> 
> On Thu, Nov 18, 2010 at 04:42:44PM +0100, Simon Pepping wrote:
> > render.AbstractGenericSVGHandler.getNamespace -> getNameSpace
> > render.intermediate.extensions.AbstractAction.setID -> setId
> > render.intermediate.extensions.AbstractAction.getID -> getId
> > render.intermediate.extensions.AbstractAction.hasID -> hasId
> > render.intermediate.extensions.AbstractAction.getIDPrefix -> getIdPrefix
> > render.intermediate.extensions.URIAction.getIDPrefix -> getIdPrefix
> > render.XMLHandler.getNamespace -> getNameSpace
> > render.ps.PSImageFormResource.getImageURI -> getImageUri
> > render.xml.XMLXMLHandler.getNamespace -> getNameSpace
> > render.afp.AFPRendererImageInfo.getURI -> getUri
> > fonts.type1.PFMFile.getPostscriptName -> getPostScriptName
> > tools.TestConverter.setBaseDir -> setBasedir
> > tools.anttasks.Fop.setUserconfig -> setUserConfig
> > tools.anttasks.Fop.getUserconfig -> getUserConfig()
> > tools.anttasks.Fop.setFofile -> setFoFile
> > tools.anttasks.Fop.getFofile -> getFoFile
> > tools.anttasks.Fop.setThrowexceptions -> setThrowExceptions
> > tools.anttasks.Fop.getThrowexceptions -> getThrowExceptions
> > apps.PageSequenceResults.getID -> getId
> > fo.FOText.getBaseLineShift -> getBaselineShift
> > cli.CommandLineOptions.getFOFile -> getFoFile
> > cli.CommandLineOptions.getXMLFile -> getXmlFile
> > cli.CommandLineOptions.getXSLFile -> getXslFile
> > 
> > On Wed, Nov 17, 2010 at 09:29:06PM +0100, Simon Pepping wrote:
> > > On Wed, Nov 17, 2010 at 07:45:31PM -0000, spepping@apache.org wrote:
> > > > Author: spepping
> > > > Date: Wed Nov 17 19:45:27 2010
> > > > New Revision: 1036179
> > > > 
> > > > URL: http://svn.apache.org/viewvc?rev=1036179&view=rev
> > > > Log:
> > > > findbugs-reported bug squashing; 959 bugs left (findbugs 1.3.9)
> > > 
> > > findbugs reports naming problems in public methods, such as setters
> > > and getters. I resolved those problems. But in doing so, in principle
> > > I am changing the public API. I do not think that every public method
> > > is really in use by other applications. Let me know when I go too far
> > > in those changes, harming applications that depend on fop.
> > > 
> > > Simon
> > > 

Re: svn commit: r1036179 [1/2] - in /xmlgraphics/fop/trunk

Posted by Simon Pepping <sp...@leverkruid.eu>.
It breaks org.krysalis.barcode4j.fop.BarcodeXMLHandler: getNamespace
-> getNameSpace (from render.xml.XMLXMLHandler.getNamespace ->
getNameSpace

On Thu, Nov 18, 2010 at 04:42:44PM +0100, Simon Pepping wrote:
> render.AbstractGenericSVGHandler.getNamespace -> getNameSpace
> render.intermediate.extensions.AbstractAction.setID -> setId
> render.intermediate.extensions.AbstractAction.getID -> getId
> render.intermediate.extensions.AbstractAction.hasID -> hasId
> render.intermediate.extensions.AbstractAction.getIDPrefix -> getIdPrefix
> render.intermediate.extensions.URIAction.getIDPrefix -> getIdPrefix
> render.XMLHandler.getNamespace -> getNameSpace
> render.ps.PSImageFormResource.getImageURI -> getImageUri
> render.xml.XMLXMLHandler.getNamespace -> getNameSpace
> render.afp.AFPRendererImageInfo.getURI -> getUri
> fonts.type1.PFMFile.getPostscriptName -> getPostScriptName
> tools.TestConverter.setBaseDir -> setBasedir
> tools.anttasks.Fop.setUserconfig -> setUserConfig
> tools.anttasks.Fop.getUserconfig -> getUserConfig()
> tools.anttasks.Fop.setFofile -> setFoFile
> tools.anttasks.Fop.getFofile -> getFoFile
> tools.anttasks.Fop.setThrowexceptions -> setThrowExceptions
> tools.anttasks.Fop.getThrowexceptions -> getThrowExceptions
> apps.PageSequenceResults.getID -> getId
> fo.FOText.getBaseLineShift -> getBaselineShift
> cli.CommandLineOptions.getFOFile -> getFoFile
> cli.CommandLineOptions.getXMLFile -> getXmlFile
> cli.CommandLineOptions.getXSLFile -> getXslFile
> 
> On Wed, Nov 17, 2010 at 09:29:06PM +0100, Simon Pepping wrote:
> > On Wed, Nov 17, 2010 at 07:45:31PM -0000, spepping@apache.org wrote:
> > > Author: spepping
> > > Date: Wed Nov 17 19:45:27 2010
> > > New Revision: 1036179
> > > 
> > > URL: http://svn.apache.org/viewvc?rev=1036179&view=rev
> > > Log:
> > > findbugs-reported bug squashing; 959 bugs left (findbugs 1.3.9)
> > 
> > findbugs reports naming problems in public methods, such as setters
> > and getters. I resolved those problems. But in doing so, in principle
> > I am changing the public API. I do not think that every public method
> > is really in use by other applications. Let me know when I go too far
> > in those changes, harming applications that depend on fop.
> > 
> > Simon
> > 

Re: svn commit: r1036179 [1/2] - in /xmlgraphics/fop/trunk

Posted by Glenn Adams <gl...@skynav.com>.
I agree with Vincent that common acronyms should not be changed to words
(initial cap only) just to satisfy findbugs; this is a case where exclusions
to findbugs should be used, or even a blanket exclusion; furthermore, the
term "Namespace" in XML is well established as a single word and should not
be divided into two words "NameSpace" to satisfy findbugs;

the problem here (and with checkstyle) is that some policy rules having to
do with style or design do not have sufficient universal consensus to simply
adopt without question; in this case, I do not believe there is a consensus
(at least Vincent and I do not agree with the renaming), so I suggest
another way be found to eliminate these findbugs "warnings".

regards,
glenn

On Thu, Nov 18, 2010 at 8:42 AM, Simon Pepping <sp...@leverkruid.eu>wrote:

> render.AbstractGenericSVGHandler.getNamespace -> getNameSpace
> render.intermediate.extensions.AbstractAction.setID -> setId
> render.intermediate.extensions.AbstractAction.getID -> getId
> render.intermediate.extensions.AbstractAction.hasID -> hasId
> render.intermediate.extensions.AbstractAction.getIDPrefix -> getIdPrefix
> render.intermediate.extensions.URIAction.getIDPrefix -> getIdPrefix
> render.XMLHandler.getNamespace -> getNameSpace
> render.ps.PSImageFormResource.getImageURI -> getImageUri
> render.xml.XMLXMLHandler.getNamespace -> getNameSpace
> render.afp.AFPRendererImageInfo.getURI -> getUri
> fonts.type1.PFMFile.getPostscriptName -> getPostScriptName
> tools.TestConverter.setBaseDir -> setBasedir
> tools.anttasks.Fop.setUserconfig -> setUserConfig
> tools.anttasks.Fop.getUserconfig -> getUserConfig()
> tools.anttasks.Fop.setFofile -> setFoFile
> tools.anttasks.Fop.getFofile -> getFoFile
> tools.anttasks.Fop.setThrowexceptions -> setThrowExceptions
> tools.anttasks.Fop.getThrowexceptions -> getThrowExceptions
> apps.PageSequenceResults.getID -> getId
> fo.FOText.getBaseLineShift -> getBaselineShift
> cli.CommandLineOptions.getFOFile -> getFoFile
> cli.CommandLineOptions.getXMLFile -> getXmlFile
> cli.CommandLineOptions.getXSLFile -> getXslFile
>
> On Wed, Nov 17, 2010 at 09:29:06PM +0100, Simon Pepping wrote:
> > On Wed, Nov 17, 2010 at 07:45:31PM -0000, spepping@apache.org wrote:
> > > Author: spepping
> > > Date: Wed Nov 17 19:45:27 2010
> > > New Revision: 1036179
> > >
> > > URL: http://svn.apache.org/viewvc?rev=1036179&view=rev
> > > Log:
> > > findbugs-reported bug squashing; 959 bugs left (findbugs 1.3.9)
> >
> > findbugs reports naming problems in public methods, such as setters
> > and getters. I resolved those problems. But in doing so, in principle
> > I am changing the public API. I do not think that every public method
> > is really in use by other applications. Let me know when I go too far
> > in those changes, harming applications that depend on fop.
> >
> > Simon
> >
>

Re: svn commit: r1036179 [1/2] - in /xmlgraphics/fop/trunk

Posted by Simon Pepping <sp...@leverkruid.eu>.
render.AbstractGenericSVGHandler.getNamespace -> getNameSpace
render.intermediate.extensions.AbstractAction.setID -> setId
render.intermediate.extensions.AbstractAction.getID -> getId
render.intermediate.extensions.AbstractAction.hasID -> hasId
render.intermediate.extensions.AbstractAction.getIDPrefix -> getIdPrefix
render.intermediate.extensions.URIAction.getIDPrefix -> getIdPrefix
render.XMLHandler.getNamespace -> getNameSpace
render.ps.PSImageFormResource.getImageURI -> getImageUri
render.xml.XMLXMLHandler.getNamespace -> getNameSpace
render.afp.AFPRendererImageInfo.getURI -> getUri
fonts.type1.PFMFile.getPostscriptName -> getPostScriptName
tools.TestConverter.setBaseDir -> setBasedir
tools.anttasks.Fop.setUserconfig -> setUserConfig
tools.anttasks.Fop.getUserconfig -> getUserConfig()
tools.anttasks.Fop.setFofile -> setFoFile
tools.anttasks.Fop.getFofile -> getFoFile
tools.anttasks.Fop.setThrowexceptions -> setThrowExceptions
tools.anttasks.Fop.getThrowexceptions -> getThrowExceptions
apps.PageSequenceResults.getID -> getId
fo.FOText.getBaseLineShift -> getBaselineShift
cli.CommandLineOptions.getFOFile -> getFoFile
cli.CommandLineOptions.getXMLFile -> getXmlFile
cli.CommandLineOptions.getXSLFile -> getXslFile

On Wed, Nov 17, 2010 at 09:29:06PM +0100, Simon Pepping wrote:
> On Wed, Nov 17, 2010 at 07:45:31PM -0000, spepping@apache.org wrote:
> > Author: spepping
> > Date: Wed Nov 17 19:45:27 2010
> > New Revision: 1036179
> > 
> > URL: http://svn.apache.org/viewvc?rev=1036179&view=rev
> > Log:
> > findbugs-reported bug squashing; 959 bugs left (findbugs 1.3.9)
> 
> findbugs reports naming problems in public methods, such as setters
> and getters. I resolved those problems. But in doing so, in principle
> I am changing the public API. I do not think that every public method
> is really in use by other applications. Let me know when I go too far
> in those changes, harming applications that depend on fop.
> 
> Simon
> 

Re: svn commit: r1036179 [1/2] - in /xmlgraphics/fop/trunk

Posted by Simon Pepping <sp...@leverkruid.eu>.
On Thu, Nov 18, 2010 at 11:25:10AM +0000, Vincent Hennebert wrote:
> Hi Simon,
> 
> On 17/11/10 20:29, Simon Pepping wrote:
> > On Wed, Nov 17, 2010 at 07:45:31PM -0000, spepping@apache.org wrote:
> >> Author: spepping
> >> Date: Wed Nov 17 19:45:27 2010
> >> New Revision: 1036179
> >>
> >> URL: http://svn.apache.org/viewvc?rev=1036179&view=rev
> >> Log:
> >> findbugs-reported bug squashing; 959 bugs left (findbugs 1.3.9)
> > 
> > findbugs reports naming problems in public methods, such as setters
> > and getters. I resolved those problems. But in doing so, in principle
> > I am changing the public API. I do not think that every public method
> > is really in use by other applications. Let me know when I go too far
> > in those changes, harming applications that depend on fop.
> 
> Good work, thanks for that. There are a few renamings that I’m not sure
> I agree with, though:
> 
> • an ID is written ID, all upper case. Id is something else [1] that
>   I believe is outside the scope of FOP ;-)
>   So I would keep the names setID and getID, and not rename them into
>   setId/getId. Affected classes are o.a.f.apps.PageSequenceResults,
>   o.a.f.render.intermediate.extensions.AbstractAction and
>   o.a.f.render.intermediate.extensions.URIAction
> 
>   [1] http://www.thefreedictionary.com/ID
> 
> • likewise, URI is an acronym that’s always written upper case, and
>   I think that should remain so. FWIW, the Java standard library uses
>   names like toURI, toURL, etc. Affected classes are
>   o.a.f.render.afp.AFPRendererImageInfo and
>   o.a.f.render.ps.PSImageFormResource
> 
> • namespace is not theoretically an English word but its use has been so
>   pervasive (in the W3C Namespaces recommendation, to start with), that
>   I would keep it like this. Affected classes are
>   o.a.f.render.XMLHandler and descendants.

Findbugs reports inconsistencies in naming. That means that there is
Id and ID, Uri and URI, NameSpace and Namespace, in the Fop code. I
chose for the starting capital with lc as a pattern, but I do not have
a strong preference.

Simon


Re: svn commit: r1036179 [1/2] - in /xmlgraphics/fop/trunk: ./ examples/embedding/java/embedding/ src/java/org/apache/fop/afp/ src/java/org/apache/fop/afp/modca/ src/java/org/apache/fop/apps/ src/java/org/apache/fop/area/ src/java/org/apache/fop/area/inlin...

Posted by Vincent Hennebert <vh...@gmail.com>.
Hi Simon,

On 17/11/10 20:29, Simon Pepping wrote:
> On Wed, Nov 17, 2010 at 07:45:31PM -0000, spepping@apache.org wrote:
>> Author: spepping
>> Date: Wed Nov 17 19:45:27 2010
>> New Revision: 1036179
>>
>> URL: http://svn.apache.org/viewvc?rev=1036179&view=rev
>> Log:
>> findbugs-reported bug squashing; 959 bugs left (findbugs 1.3.9)
> 
> findbugs reports naming problems in public methods, such as setters
> and getters. I resolved those problems. But in doing so, in principle
> I am changing the public API. I do not think that every public method
> is really in use by other applications. Let me know when I go too far
> in those changes, harming applications that depend on fop.

Good work, thanks for that. There are a few renamings that I’m not sure
I agree with, though:

• an ID is written ID, all upper case. Id is something else [1] that
  I believe is outside the scope of FOP ;-)
  So I would keep the names setID and getID, and not rename them into
  setId/getId. Affected classes are o.a.f.apps.PageSequenceResults,
  o.a.f.render.intermediate.extensions.AbstractAction and
  o.a.f.render.intermediate.extensions.URIAction

  [1] http://www.thefreedictionary.com/ID

• likewise, URI is an acronym that’s always written upper case, and
  I think that should remain so. FWIW, the Java standard library uses
  names like toURI, toURL, etc. Affected classes are
  o.a.f.render.afp.AFPRendererImageInfo and
  o.a.f.render.ps.PSImageFormResource

• namespace is not theoretically an English word but its use has been so
  pervasive (in the W3C Namespaces recommendation, to start with), that
  I would keep it like this. Affected classes are
  o.a.f.render.XMLHandler and descendants.

WDYT?
Thanks,
Vincent