tika-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jukka Zitting (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (TIKA-585) AudioParser Fails with NPE on fileFormat.properties
Date Wed, 19 Jan 2011 12:54:46 GMT

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

Jukka Zitting resolved TIKA-585.
--------------------------------

       Resolution: Fixed
    Fix Version/s: 0.9
         Assignee: Jukka Zitting

Good point, thanks! Fixed in revision 1060797.

> AudioParser Fails with NPE on fileFormat.properties
> ---------------------------------------------------
>
>                 Key: TIKA-585
>                 URL: https://issues.apache.org/jira/browse/TIKA-585
>             Project: Tika
>          Issue Type: Bug
>          Components: parser
>    Affects Versions: 0.8
>         Environment: ALL
>            Reporter: Cyriel Vringer
>            Assignee: Jukka Zitting
>            Priority: Minor
>             Fix For: 0.9
>
>   Original Estimate: 0.08h
>  Remaining Estimate: 0.08h
>
> AudioParserTests fail because the AudioParser does not check for existence of properties
on the fileFormat. (In the parse method, about line 110. The code is:
>                 for (Entry<String, Object> entry : fileFormat.properties().entrySet())
{
>                     metadata.set(entry.getKey(), entry.getValue().toString());
>                 }
>                 for (Entry<String, Object> entry : audioFormat.properties().entrySet())
{
>                     metadata.set(entry.getKey(), entry.getValue().toString());
>                 }
> Method throws NPE on fileFormat.properties().entrySet() when there are no properties.
> should be something like:
>             if( fileFormat.properties() != null && fileFormat.properties().size()
> 0) {
>                 for (Entry<String, Object> entry : fileFormat.properties().entrySet())
{
>                     metadata.set(entry.getKey(), entry.getValue().toString());
>                 }
>             }
>             if( audioFormat.properties() != null && audioFormat.properties().size()
> 0) {
>                 for (Entry<String, Object> entry : audioFormat.properties().entrySet())
{
>                     metadata.set(entry.getKey(), entry.getValue().toString());
>                 }
>             }
> Or am i missing something?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message