xmlgraphics-fop-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andreas Delmelle <andreas.delme...@telenet.be>
Subject Re: svn commit: r1067533 - /xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java
Date Sat, 05 Feb 2011 23:18:15 GMT
On 05 Feb 2011, at 22:49, adelmelle@apache.org wrote:

> Author: adelmelle
> Date: Sat Feb  5 21:49:58 2011
> New Revision: 1067533
> 
> URL: http://svn.apache.org/viewvc?rev=1067533&view=rev
> Log:
> Code cleanup
> 
> Modified:
>    xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java

In preparation of decommissioning its StackingIter, I noticed I had some minor cleanups ready
for this class. Checking closer, the code was still way too messy for my taste, so I went
further --and further... Quite far, actually, so a bit of explanation needed in case someone
goes looking for code that I removed.

I noticed there was quite a lot of code that, in fact, was never, ever used. It seemed like
an experiment from Luca, that likely should have been kept in a branch instead of being committed
to the trunk in an incomplete state. All it did here was confuse people, in a class which
is quite heavily used.
I first spent quite some time cleaning up commented log.debug() statements in the method createUnitElements(),
then decided to check where the method was called, and found it was only used in one place,
in getChangedKnuthElements():

> -/* estensione: conversione complessiva */
> -/*LF*/  if (bpUnit > 0) {
> -/*LF*/      storedList = returnedList;
> -/*LF*/      returnedList = createUnitElements(returnedList);
> -/*LF*/  }

Now, that bpUnit member is written *only* in BlockLayoutManager and BlockContainerLayoutManager,
where it is set to 0 in the initialize() method. In effect, the method was unused, so I decided
to bite the bullet and remove it.

Additionally, given the above, I have also removed similar references to this bpUnit member
in other places, which eliminates some conditional branches. I have not yet removed the variable
itself, since it is still read in a few subclasses.


Regards,

Andreas
---


Mime
View raw message