Hi,

found some time to investigate the "NPE while running freenet 
under gcj/gij/classpath" issue. The attached java snippet's output is
different:

[EMAIL PROTECTED]:/media/hdd/PVR/src/test# update-java-alternatives -s java-gcj 
> /dev/null 2>&1
[EMAIL PROTECTED]:/media/hdd/PVR/src/test# java Hashme
next(-5625102382211955399)
remove(-5625102382211955399)
remove(-5625102382211955398)
next(-8661044121393429580)
next(null)
[EMAIL PROTECTED]:/media/hdd/PVR/src/test# update-java-alternatives -s 
java-6-sun > /dev/null 2>&1
[EMAIL PROTECTED]:/media/hdd/PVR/src/test# java Hashme
next(-5625102382211955399)
remove(-5625102382211955399)
remove(-5625102382211955398)
next(-8661044121393429580)

As a temporaray fix, the 007*.patch works.

// Sven-Ola
import java.util.Hashtable;
import java.util.Enumeration;

class Hashme
{
  public static void main ( String[] args )
  {
    Hashtable recentlyForwardedIDs =  new Hashtable();
    Long l1 = new Long(-5625102382211955399L);
    Long l2 = new Long(-5625102382211955398L);
    Long l3 = new Long(-8661044121393429580L);
    recentlyForwardedIDs.put(l1, "tic");
    recentlyForwardedIDs.put(l2, "tac");
    recentlyForwardedIDs.put(l3, "toe");
    Enumeration e = recentlyForwardedIDs.keys();
    while(e.hasMoreElements())
    {
      Long l = (Long)e.nextElement();
      System.out.println("next("+l+")");
      if (l1 == l)
      {
        Long r1 = new Long(-5625102382211955399L);
        Long r2 = new Long(-5625102382211955398L);
        System.out.println("remove("+r1+")");
        recentlyForwardedIDs.remove(r1);
        System.out.println("remove("+r2+")");
        recentlyForwardedIDs.remove(r2);
      }
    }
  }
}
--- freenet/freenet/src/freenet/node/LocationManager.java~	2008-04-13 10:27:44.000000000 +0200
+++ freenet/freenet/src/freenet/node/LocationManager.java	2008-04-13 10:27:44.000000000 +0200
@@ -1220,6 +1220,7 @@
             Enumeration e = recentlyForwardedIDs.keys();
             while(e.hasMoreElements()) {
                 Long l = (Long)e.nextElement();
+                if (null == l) continue;
                 RecentlyForwardedItem item = (RecentlyForwardedItem)recentlyForwardedIDs.get(l);
                 if(item == null) {
                 	Logger.error(this, "Key is "+l+" but no value on recentlyForwardedIDs - shouldn't be possible");
_______________________________________________
Devl mailing list
[email protected]
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl

Reply via email to