GnuPG class throwing null pointer exception
Robert J. Hansen
rjh at sixdemonbag.org
Wed May 28 02:15:29 CEST 2014
On 5/27/2014 7:07 PM, Robert J. Hansen wrote:
> So let's say you've got this thread running, and it's cheerfully
> spinning along adding data to stream. While it's doing this, you call
> its getString() method... and bam, immediate race condition, because the
> call to stream.append() is neither atomic nor locked by a mutex, and
> there's no guarantee that when you read the stream's contents the stream
> will be in a consistent state!
Mea culpa: someone just pointed out to me that as of Java 7,
StringBuffer is innately threadsafe and all the accessors/modifiers are
locked in synchronized blocks. However, since this code dates back to
the Java 1.4 error, it would be an error under the JVM spec that existed
My error -- thanks to the (wishing-anonymity) person who corrected me!
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 455 bytes
Desc: OpenPGP digital signature
More information about the Gnupg-users