[
https://issues.apache.org/jira/browse/FOP-2893?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16995696#comment-16995696
]
Olivier Cailloux commented on FOP-2893:
---------------------------------------
Then this bug report is only about this request: the loader of the hyphenation
resources should be changed to make it look at (something like)
{{org.apache.fop.hyphenation}} and only then, if not found, {{hyph}}.
Benefits:
- when incorporating the hyph files to one’s own project (as I do, as the jar
is not to be found in Maven central), they can be put in their proper folder,
for clean sorting of files and for [unique
naming|https://github.com/oliviercailloux/java-course/blob/master/Best%20practices/Resources.adoc#use-unique-names]
- if one day the hyph jar gets updated, the manager will be able to change the
folder without anyone needing to change FOP source code to keep compatibility.
Means:
>From a cursory look at the source code, it seems it should be sufficient to
>change
>[getResourceStream|https://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/hyphenation/Hyphenator.java?revision=1862365&view=markup#l110]
> and add {{Hyphenator.class.getResourceAsStream(key + ".hyp");}} at the right
>place in order to also search into the {{org.apache.fop.hyphenation}} (that
>is, the package name of {{Hyphenator}}) resource folder.
While we’re there, I suggest to change the reflection call in that same method,
because I can’t find a reason for such a complex call. The code would be more
readable if it would simply do: {{ClassLoader contextClassLoader =
Thread.currentThread().getContextClassLoader();}}. Unless I missed some
subtelty.
> hyph resources in jar should have unique names and should be in Maven central
> -----------------------------------------------------------------------------
>
> Key: FOP-2893
> URL: https://issues.apache.org/jira/browse/FOP-2893
> Project: FOP
> Issue Type: Bug
> Reporter: Olivier Cailloux
> Priority: Minor
>
> Please consider adding the jar containing the hyphenation resources
> ({{fop-hyph.jar}}) to Maven central, so that it can be easily added to a
> third-party application using fop to build PDFs.
> Please also consider giving those resources [unique
> names|https://github.com/oliviercailloux/java-course/blob/master/Best%20practices/Resources.adoc#use-unique-names]
> to avoid conflicts and easily identify them. (This means the loader of those
> resources should also be changed to make it look at the right places.)
--
This message was sent by Atlassian Jira
(v8.3.4#803005)