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 Andreas Delmelle <an...@telenet.be> on 2011/02/22 22:56:33 UTC

Re: svn commit: r1073518 - /xmlgraphics/fop/trunk/src/java/org/apache/fop/util/ColorUtil.java

On 22 Feb 2011, at 22:38, adelmelle@apache.org wrote:

> Author: adelmelle
> Date: Tue Feb 22 21:38:28 2011
> New Revision: 1073518
> <snip />
> @@ -402,7 +398,6 @@ public final class ColorUtil {
> 
>                 /* Ask FOP factory to get ColorSpace for the specified ICC profile source */
>                 if (foUserAgent != null && iccProfileSrc != null) {
> -                    assert colorSpace == null;
> 

To revisit my earlier point about assertions: 
Note that this is a fine example of how assert should *not* be used, IMO. 
It is meant to test for conditions assumed to be true for as far as we understand/intend the code to work, but for which this 'guarantee' is, strictly speaking, non-verifiable at compile-time. 

If you look 10 lines up, you see that, if iccProfileSrc has been assigned a value, that means the assignment of colorSpace did not take place, hence it is redundant to explicitly re-assert this.
It would be the same as hard-coding 'assert true;'.


Regards,

Andreas
---