[ https://issues.apache.org/jira/browse/TRINIDAD-2250?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13236685#comment-13236685 ]
Andy Schwartz commented on TRINIDAD-2250: ----------------------------------------- This patch: https://issues.apache.org/jira/secure/attachment/12519643/trinidad-2250.patch Solves the problem by adding two new methods to Version: + /** + * Converts this Version to the previous version just before this + * version. For example, new Version("1.9").toPreviousVersion() + * results in the version "1.8". + * + * The resulting version is guaranteed to be "concrete" - ie. + * will contain no wildcards. + * + * Calling toPreviousVersion() on Version.MIN_VERSION returns + * Version.MIN_VERSION. + * + * @return the Version instance corresponding to the version just + * before this version. + */ + public Version toPreviousVersion() + /** + * Converts this Version to the next version just after this + * version. For example, new Version("1.9").toPreviousVersion() + * results in the version "1.10". + * + * The resulting version is guaranteed to be "concrete" - ie. + * will contain no wildcards. + * + * Calling toNextVersion() on Version.MAX_VERSION returns + * Version.MAX_VERSION. + * + * @return the Version instance corresponding to the version just + * after this version. + */ + public Version toNextVersion() We use these to expand the set of agent versions that we pregenerate - ie. in addition to the start/end of each @agent version range, we also attempt to pregenerate: - The version just previous to the start of the range. - The version just after the end of the range. Looking back at the example above, this means that we would pregenerate for: - 0 (start of #2) - 1 (start of #1 - 3 (end of #2) - 4 (end.toNextVersion() of #2) - 7 (start.toPreviousVersion() of #3) - 8 (start of #3) - Integer.MAX_VALUE (end of #1 and #3) And thus cover the case where we match range #1 but not #2 or #3. > Skin pregeneration missing agent versions > ----------------------------------------- > > Key: TRINIDAD-2250 > URL: https://issues.apache.org/jira/browse/TRINIDAD-2250 > Project: MyFaces Trinidad > Issue Type: Bug > Components: Skinning > Affects Versions: 2.0.2-core > Reporter: Andy Schwartz > Assignee: Andy Schwartz > Attachments: trinidad-2250.patch > > > In cases where skins specify overlapping version ranges, skin pregeneration > may fail to generate certain style sheets. > For example, imagine the skin specifies @agent rules for the following > version ranges: > 1. min-version:1 > 2. max:version:3 > 3. min-version:8 > With our current implementation, we only attempt to generate style sheets for > the start and end of each version range. > For the above example, this would be: > - 0 (start of #2) > - 1 (start of #1 > - 3 (end of #2) > - 8 (start of #3) > - Integer.MAX_VALUE (end of #1 and #3) > If the actual agent version is 7, we should use a style sheet that matches > #1, but not #2 or #3. However, we since we only use the start/end points of > each version range to determine which style sheets to pregenerate, we fail to > pregenerate such a style sheet. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira