You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Tilman Hausherr (Jira)" <ji...@apache.org> on 2020/10/17 17:32:00 UTC

[jira] [Resolved] (PDFBOX-4991) say when GlyphList is not found what was sought for

     [ https://issues.apache.org/jira/browse/PDFBOX-4991?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tilman Hausherr resolved PDFBOX-4991.
-------------------------------------
    Fix Version/s: 3.0.0 PDFBox
                   2.0.22
         Assignee: Tilman Hausherr
       Resolution: Fixed

Done. I used different code because I didn't want to have a second RuntimeException.

> say when GlyphList is not found what was sought for
> ---------------------------------------------------
>
>                 Key: PDFBOX-4991
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-4991
>             Project: PDFBox
>          Issue Type: Improvement
>    Affects Versions: 2.0.21
>            Reporter: Ralf Hauser
>            Assignee: Tilman Hausherr
>            Priority: Minor
>             Fix For: 2.0.22, 3.0.0 PDFBox
>
>
> ### Eclipse Workspace Patch 1.0
> #P pdfbox
> Index: pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/encoding/GlyphList.java
> ===================================================================
> --- pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/encoding/GlyphList.java	(revision 1882597)
> +++ pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/encoding/GlyphList.java	(working copy)
> @@ -49,8 +49,12 @@
>      {
>          String path = "/org/apache/pdfbox/resources/glyphlist/";
>          //no need to use a BufferedInputSteam here, as GlyphList uses a BufferedReader
> -        try (InputStream resourceAsStream = GlyphList.class.getResourceAsStream(path + filename))
> +        String fullFileName = path + filename;
> +        try (InputStream resourceAsStream = GlyphList.class.getResourceAsStream(fullFileName))
>          {
> +        	if (null == resourceAsStream) {
> +        		throw new RuntimeException("GlyphList '"+fullFileName+"' not found");
> +        	}
>              return new GlyphList(resourceAsStream, numberOfEntries);
>          }
>          catch (IOException e)



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org