<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent changes to bugs</title><link href="https://sourceforge.net/p/dvorcode/bugs/" rel="alternate"/><link href="https://sourceforge.net/p/dvorcode/bugs/feed.atom" rel="self"/><id>https://sourceforge.net/p/dvorcode/bugs/</id><updated>2008-08-19T01:23:56Z</updated><subtitle>Recent changes to bugs</subtitle><entry><title>NPE when transcoding data that contains un-mapped chars</title><link href="https://sourceforge.net/p/dvorcode/bugs/1/" rel="alternate"/><published>2008-08-19T01:23:56Z</published><updated>2008-08-19T01:23:56Z</updated><author><name>Michael Lockhart</name><uri>https://sourceforge.net/u/sinewalker/</uri></author><id>https://sourceforge.net445acf9c6be7370ddacfc2ccbbcd16827b76b479</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;When testing the filter function using an input file, the program crashed with Null Pointer Exception.&lt;/p&gt;
&lt;p&gt;-- Condition&lt;br /&gt;
run dvorcode to decode or encode an input file&lt;br /&gt;
-- Expected Result&lt;br /&gt;
output produced either encoded or decoded as requested&lt;br /&gt;
-- Actual Result&lt;br /&gt;
Null Pointer Exception in call to String.replace()&lt;/p&gt;
&lt;p&gt;-- Investigation&lt;/p&gt;
&lt;p&gt;This is due to the replace call being supplied a Null String reference. When the Map is asked to retrieve a character which is not a key, it returns Null.&lt;/p&gt;
&lt;p&gt;-- Resolution&lt;/p&gt;
&lt;p&gt;Rather than have a COMMON_STRING that contains all characters in common between encodings, use the Map's own predicates to guard string replacement.&lt;/p&gt;
&lt;p&gt;That is, replace the guarding code that does a String.contains() with a call to Map.containsKey()&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>