[jira] [Commented] (FOP-2307) Weird border color inheritance (hashCode collisions)

2013-10-25 Thread Alexios Giotis (JIRA)

[ 
https://issues.apache.org/jira/browse/FOP-2307?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13805302#comment-13805302
 ] 

Alexios Giotis commented on FOP-2307:
-

I was not able to reproduce this in FOP 1.1 or trunk by executing
fop -fo _border.fo -pdf _border.pdf

What do you reproduce it ?

I assume that many PDFs are created since there are "hashCode() collisions". 
This is an INFO message to inform that a FOP internal cache is not optimally 
used and it should not be related to any color problems.


In more details, this means that the FOP internal cache is filled with 
org.apache.fop.fo.properties.ColorProperty objects that have the same hashCode 
but are not equal. The key of the cache is the hashCode so only one of them can 
be cached. New instances are created for the other ones, so there is a 
suboptimal use of the cache.

Having a look at the code, this happens when ColorProperty objects (put in the 
cache) have a color that is an instance of  
org.apache.xmlgraphics.java2d.color.ColorWithAlternatives. In that case, the 
hashCode is generated using only the RGB value of the java.awt.Color and not 
taking into account the alternativeColors.

I could submit a patch to avoid collisions and make better use of the cache but 
I don't think it will resolve the main issue reported here.

> Weird border color inheritance (hashCode collisions)
> 
>
> Key: FOP-2307
> URL: https://issues.apache.org/jira/browse/FOP-2307
> Project: Fop
>  Issue Type: Bug
>  Components: pdf
>Affects Versions: 1.1
> Environment: Windows 7/64-bit, Oracle JDK 7.0.45 64-bit
>Reporter: Jan Tošovský
>  Labels: border, cmyk, color
>
> When I define an object with a specific border and the thickness of this 
> border matches with the one defined in the static-content, the latter color 
> is used instead. But it appears only if my object color is specified using 
> the pseudo #CMYK profile.
> It can be tested with this simplified test case:
> http://drifted.in/other/_border.fo
> http://drifted.in/other/_border.pdf
> The first object border uses the standard color so it is unaffected.
> The second is affected.
> The third uses a different thickness (3.5pt instead of 2.5) so it is also 
> unaffected.
> In the generating log there are lot of following hashCode collisions so I 
> suppose it relates together:
> X 23, 2013 5:09:34 ODP. org.apache.fop.fo.properties.PropertyCache fetch
> INFO: 60 hashCode() collisions for org.apache.fop.fo.properties.ColorProperty
> X 23, 2013 5:09:34 ODP. org.apache.fop.fo.properties.PropertyCache fetch
> INFO: 70 hashCode() collisions for org.apache.fop.fo.properties.ColorProperty



--
This message was sent by Atlassian JIRA
(v6.1#6144)


[jira] [Commented] (FOP-2307) Weird border color inheritance (hashCode collisions)

2013-10-25 Thread JIRA

[ 
https://issues.apache.org/jira/browse/FOP-2307?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13805434#comment-13805434
 ] 

Jan Tošovský commented on FOP-2307:
---

This log comes from the original file which I later reduced to the test case. 
Indeed, in this case the log is empty. Sorry for misleading info.

> Weird border color inheritance (hashCode collisions)
> 
>
> Key: FOP-2307
> URL: https://issues.apache.org/jira/browse/FOP-2307
> Project: Fop
>  Issue Type: Bug
>  Components: pdf
>Affects Versions: 1.1
> Environment: Windows 7/64-bit, Oracle JDK 7.0.45 64-bit
>Reporter: Jan Tošovský
>  Labels: border, cmyk, color
>
> When I define an object with a specific border and the thickness of this 
> border matches with the one defined in the static-content, the latter color 
> is used instead. But it appears only if my object color is specified using 
> the pseudo #CMYK profile.
> It can be tested with this simplified test case:
> http://drifted.in/other/_border.fo
> http://drifted.in/other/_border.pdf
> The first object border uses the standard color so it is unaffected.
> The second is affected.
> The third uses a different thickness (3.5pt instead of 2.5) so it is also 
> unaffected.
> In the generating log there are lot of following hashCode collisions so I 
> suppose it relates together:
> X 23, 2013 5:09:34 ODP. org.apache.fop.fo.properties.PropertyCache fetch
> INFO: 60 hashCode() collisions for org.apache.fop.fo.properties.ColorProperty
> X 23, 2013 5:09:34 ODP. org.apache.fop.fo.properties.PropertyCache fetch
> INFO: 70 hashCode() collisions for org.apache.fop.fo.properties.ColorProperty



--
This message was sent by Atlassian JIRA
(v6.1#6144)


[jira] [Commented] (FOP-2307) Weird border color inheritance (hashCode collisions)

2013-10-26 Thread Alexios Giotis (JIRA)

[ 
https://issues.apache.org/jira/browse/FOP-2307?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13806153#comment-13806153
 ] 

Alexios Giotis commented on FOP-2307:
-

Jan, could you please attach an XSL:FO file that reproduces at least the 
hashCode collisions message ?

The log message is written to discover objects with inconsistent 
hashCode/equals methods that could not be found at development time. Here, we 
found such an object.

> Weird border color inheritance (hashCode collisions)
> 
>
> Key: FOP-2307
> URL: https://issues.apache.org/jira/browse/FOP-2307
> Project: Fop
>  Issue Type: Bug
>  Components: pdf
>Affects Versions: 1.1
> Environment: Windows 7/64-bit, Oracle JDK 7.0.45 64-bit
>Reporter: Jan Tošovský
>  Labels: border, cmyk, color
>
> When I define an object with a specific border and the thickness of this 
> border matches with the one defined in the static-content, the latter color 
> is used instead. But it appears only if my object color is specified using 
> the pseudo #CMYK profile.
> It can be tested with this simplified test case:
> http://drifted.in/other/_border.fo
> http://drifted.in/other/_border.pdf
> The first object border uses the standard color so it is unaffected.
> The second is affected.
> The third uses a different thickness (3.5pt instead of 2.5) so it is also 
> unaffected.
> In the generating log there are lot of following hashCode collisions so I 
> suppose it relates together:
> X 23, 2013 5:09:34 ODP. org.apache.fop.fo.properties.PropertyCache fetch
> INFO: 60 hashCode() collisions for org.apache.fop.fo.properties.ColorProperty
> X 23, 2013 5:09:34 ODP. org.apache.fop.fo.properties.PropertyCache fetch
> INFO: 70 hashCode() collisions for org.apache.fop.fo.properties.ColorProperty



--
This message was sent by Atlassian JIRA
(v6.1#6144)


[jira] [Commented] (FOP-2307) Weird border color inheritance (hashCode collisions)

2014-07-21 Thread Luis Bernardo (JIRA)

[ 
https://issues.apache.org/jira/browse/FOP-2307?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14068590#comment-14068590
 ] 

Luis Bernardo commented on FOP-2307:


I am able to reproduce with FOP 1.1 but not with trunk. The "fix", which I 
think was accidental, is traced to this commit: 
http://svn.apache.org/viewvc?view=revision&revision=1401607.

I think Alexios analysis is correct and the hashCode needs to take into account 
the alternativeColors.

> Weird border color inheritance (hashCode collisions)
> 
>
> Key: FOP-2307
> URL: https://issues.apache.org/jira/browse/FOP-2307
> Project: Fop
>  Issue Type: Bug
>  Components: renderer/pdf
>Affects Versions: 1.1
> Environment: Windows 7/64-bit, Oracle JDK 7.0.45 64-bit
>Reporter: Jan Tošovský
>  Labels: border, cmyk, color
>
> When I define an object with a specific border and the thickness of this 
> border matches with the one defined in the static-content, the latter color 
> is used instead. But it appears only if my object color is specified using 
> the pseudo #CMYK profile.
> It can be tested with this simplified test case:
> http://drifted.in/other/_border.fo
> http://drifted.in/other/_border.pdf
> The first object border uses the standard color so it is unaffected.
> The second is affected.
> The third uses a different thickness (3.5pt instead of 2.5) so it is also 
> unaffected.
> In the generating log there are lot of following hashCode collisions so I 
> suppose it relates together:
> X 23, 2013 5:09:34 ODP. org.apache.fop.fo.properties.PropertyCache fetch
> INFO: 60 hashCode() collisions for org.apache.fop.fo.properties.ColorProperty
> X 23, 2013 5:09:34 ODP. org.apache.fop.fo.properties.PropertyCache fetch
> INFO: 70 hashCode() collisions for org.apache.fop.fo.properties.ColorProperty



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (FOP-2307) Weird border color inheritance (hashCode collisions)

2014-07-22 Thread Luis Bernardo (JIRA)

[ 
https://issues.apache.org/jira/browse/FOP-2307?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14070170#comment-14070170
 ] 

Luis Bernardo commented on FOP-2307:


The original issue does not happen in current trunk due to changes to 
CommonBorderPaddingBackground.equals(), which now, incorrectly, compares two 
colors by comparing that they are the same instance. This effectively disables 
caching since a cached color property will be replaced by a new instance of the 
same color (whether that has practical performance implications is another 
question...).

> Weird border color inheritance (hashCode collisions)
> 
>
> Key: FOP-2307
> URL: https://issues.apache.org/jira/browse/FOP-2307
> Project: Fop
>  Issue Type: Bug
>  Components: renderer/pdf
>Affects Versions: 1.1
> Environment: Windows 7/64-bit, Oracle JDK 7.0.45 64-bit
>Reporter: Jan Tošovský
>  Labels: border, cmyk, color
>
> When I define an object with a specific border and the thickness of this 
> border matches with the one defined in the static-content, the latter color 
> is used instead. But it appears only if my object color is specified using 
> the pseudo #CMYK profile.
> It can be tested with this simplified test case:
> http://drifted.in/other/_border.fo
> http://drifted.in/other/_border.pdf
> The first object border uses the standard color so it is unaffected.
> The second is affected.
> The third uses a different thickness (3.5pt instead of 2.5) so it is also 
> unaffected.
> In the generating log there are lot of following hashCode collisions so I 
> suppose it relates together:
> X 23, 2013 5:09:34 ODP. org.apache.fop.fo.properties.PropertyCache fetch
> INFO: 60 hashCode() collisions for org.apache.fop.fo.properties.ColorProperty
> X 23, 2013 5:09:34 ODP. org.apache.fop.fo.properties.PropertyCache fetch
> INFO: 70 hashCode() collisions for org.apache.fop.fo.properties.ColorProperty



--
This message was sent by Atlassian JIRA
(v6.2#6252)