[prev in list] [next in list] [prev in thread] [next in thread] 

List:       jedit-users
Subject:    Re: [ jEdit-users ] Re: [ jEdit-devel ] Patch for Bug 1303461 Exception when removing a node from hy
From:       Matthieu Casanova <chocolat.mou () gmail ! com>
Date:       2005-12-18 21:53:54
Message-ID: cdeda75f0512181353n501a55f8l () mail ! gmail ! com
[Download RAW message or body]

Hi, a simple fix would be to replace in method
HyperSearchOperationNode.removeNodeFromCache line 114
operNode.resultNodes.remove(node);
by
if (operNode.resultNodes != null)
  operNode.resultNodes.remove(node);

since if the nodes aren't cached there is no need to remove the node from
cache isn't it ?

Matthieu

2005/12/18, Slava Pestov <slava@jedit.org>:
>
> Hi Peter,
>
> Its better to fix the root cause of a problem rather than work around it.
>
> Slava
>
> Peter Cox wrote:
> > This bug was caused by a accessing the instance variable resultNodes
> > which had not been initialised.
> >
> > The class accesses this variable in multiple places with checks for
> > null. So, possible solutions:
> >
> > (1) place null checks around variable access
> > (2) Lazy init the variable
> > (3) init in constructor
> >
> > I've done the third option which may unnecessarily increase memory
> > consumption. But without thoroughly understanding the usage of the
> > instance variable, it's the easiest path with least code change.
> >
> > unified diff attached...
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep through log
> files
> for problems?  Stop!  Download the new AJAX search engine that makes
> searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
> http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
> --
> -----------------------------------------------
> jEdit Users' List
> jEdit-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jedit-users
>

[Attachment #3 (text/html)]

Hi, a simple fix would be to replace in method \
HyperSearchOperationNode.removeNodeFromCache line \
114<br>operNode.resultNodes.remove(node);<br>by<br>if (operNode.resultNodes != \
null)<br>&nbsp; operNode.resultNodes.remove(node);<br> <br>since if the nodes aren't \
cached there is no need to remove the node from cache isn't it \
?<br><br>Matthieu<br><br><div><span class="gmail_quote">2005/12/18, Slava Pestov \
&lt;<a href="mailto:slava@jedit.org">slava@jedit.org </a>&gt;:</span><blockquote \
class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt \
0pt 0.8ex; padding-left: 1ex;">Hi Peter,<br><br>Its better to fix the root cause of a \
problem rather than work around it. <br><br>Slava<br><br>Peter Cox wrote:<br>&gt; \
This bug was caused by a accessing the instance variable resultNodes<br>&gt; which \
had not been initialised.<br>&gt;<br>&gt; The class accesses this variable in \
multiple places with checks for <br>&gt; null. So, possible \
solutions:<br>&gt;<br>&gt; (1) place null checks around variable access<br>&gt; (2) \
Lazy init the variable<br>&gt; (3) init in constructor<br>&gt;<br>&gt; I've done the \
third option which may unnecessarily increase memory <br>&gt; consumption. But \
without thoroughly understanding the usage of the<br>&gt; instance variable, it's the \
easiest path with least code change.<br>&gt;<br>&gt; unified diff \
attached...<br><br><br><br>------------------------------------------------------- \
<br>This SF.net email is sponsored by: Splunk Inc. Do you grep through log \
files<br>for problems?&nbsp;&nbsp;Stop!&nbsp;&nbsp;Download the new AJAX search \
engine that makes<br>searching your log files as easy as surfing \
the&nbsp;&nbsp;web.&nbsp;&nbsp;DOWNLOAD SPLUNK! <br><a \
href="http://ads.osdn.com/?ad_id=7637&amp;alloc_id=16865&amp;op=click">http://ads.osdn \
.com/?ad_id=7637&amp;alloc_id=16865&amp;op=click</a><br>--<br>-----------------------------------------------<br>jEdit \
Users' List <br><a href="mailto:jEdit-users@lists.sourceforge.net">jEdit-users@lists.sourceforge.net</a><br><a \
href="https://lists.sourceforge.net/lists/listinfo/jedit-users">https://lists.sourceforge.net/lists/listinfo/jedit-users</a>
 <br></blockquote></div><br>


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
-- 
-----------------------------------------------
jEdit Users' List
jEdit-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jedit-users

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic