diff -ru php-java-bridge-3.2.1/ChangeLog php-java-bridge-3.2.1a/ChangeLog
--- php-java-bridge-3.2.1/ChangeLog	2007-04-03 19:49:32.000000000 +0200
+++ php-java-bridge-3.2.1a/ChangeLog	2007-04-03 19:49:32.000000000 +0200
@@ -1,3 +1,16 @@
+2007-04-04  Jost Boekemeier  <jostb@intern>
+
+	* server/php/java/bridge/JavaBridge.java
+	(Invoke): Corrected bug introduced with PR616498. Fix backported
+	from 4.0.x
+
+	* server/php/java/bridge/MethodCache.java
+	(Entry,equals,getEntry): Corrected bug introduced with
+	PR616498. Fix backported from 4.0.x
+	
+	* VERSION, php-java-bridge.spec: Version 3.2.1a released.
+	
+	
 2006-12-16  Jost Boekemeier  <jostb@intern>
 
 	* server/php/java/bridge/IllegalArgumentException.java: Removed,
diff -ru php-java-bridge-3.2.1/php-java-bridge.spec php-java-bridge-3.2.1a/php-java-bridge.spec
--- php-java-bridge-3.2.1/php-java-bridge.spec	2007-04-03 19:49:32.000000000 +0200
+++ php-java-bridge-3.2.1a/php-java-bridge.spec	2007-04-03 19:49:32.000000000 +0200
@@ -1,5 +1,5 @@
 #-*- mode: rpm-spec; tab-width:4 -*-
-%define version 3.2.1
+%define version 3.2.1a
 %define release 1
 %define PHP_MAJOR_VERSION %(((LANG=C rpm -q --queryformat "%{VERSION}" php) || echo "4.0.0") | tail -1 | sed 's/\\\..*$//')
 %define PHP_MINOR_VERSION %(((LANG=C rpm -q --queryformat "%{VERSION}" php) || echo "4.0.0") | tail -1 | LANG=C cut -d. -f2)
diff -ru php-java-bridge-3.2.1/server/php/java/bridge/JavaBridge.java php-java-bridge-3.2.1a/server/php/java/bridge/JavaBridge.java
--- php-java-bridge-3.2.1/server/php/java/bridge/JavaBridge.java	2007-04-03 19:49:32.000000000 +0200
+++ php-java-bridge-3.2.1a/server/php/java/bridge/JavaBridge.java	2007-04-03 19:49:32.000000000 +0200
@@ -1071,7 +1071,7 @@
 	    if(object==null) {object = Request.PHPNULL;throw new NullPointerException("call object is null, check the server log file(s).");}
 	    /* PR1616498: Do not use Util.getClass(): if object is a class, we must pass the class class.  
 	     * All VM, including gcc >= 3.3.3, return the class class for class.getClass(), not null. This is okay for the cache implementation. */
-	    MethodCache.Entry entry = methodCache.getEntry(method, object.getClass(), args);
+	    MethodCache.Entry entry = methodCache.getEntry(method, object, args);
 	    selected = (Method) methodCache.get(entry);
 	    
 	    // gather
diff -ru php-java-bridge-3.2.1/server/php/java/bridge/MethodCache.java php-java-bridge-3.2.1a/server/php/java/bridge/MethodCache.java
--- php-java-bridge-3.2.1/server/php/java/bridge/MethodCache.java	2007-04-03 19:49:32.000000000 +0200
+++ php-java-bridge-3.2.1a/server/php/java/bridge/MethodCache.java	2007-04-03 19:49:32.000000000 +0200
@@ -3,7 +3,7 @@
 package php.java.bridge;
 
 /*
- * Copyright (C) 2006 Jost Boekemeier
+ * Copyright (C) 2003-2007 Jost Boekemeier
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
@@ -66,14 +66,17 @@
      * A cache entry.
      */
     public static class Entry {
+	boolean isStatic;
 	String name;
 	Class clazz;
 	Class params[];
 		
 	protected Entry () {}
-	protected Entry (String name, Class clazz, Class params[]) {
+	protected Entry (String name, Object obj, Class params[]) {
 	    this.name = name; // intern() is ~10% slower than lazy string comparison
-	    this.clazz = clazz;
+	    boolean isStatic = obj instanceof Class;
+	    this.clazz = isStatic?(Class)obj:obj.getClass();
+	    this.isStatic = isStatic;
 	    this.params = params;
 	}
 	private boolean hasResult = false;
@@ -85,12 +88,14 @@
 	    }
 	    result = result * 31 + clazz.hashCode();
 	    result = result * 31 + name.hashCode();
+	    result = result * 31 + (isStatic? 1231 : 1237);
 	    hasResult = true;
 	    return result;
 	}
 	public boolean equals(Object o) {
 	    Entry that = (Entry) o;
 	    if(clazz != that.clazz) return false;
+	    if(isStatic != that.isStatic) return false;
 	    if(params.length != that.params.length) return false;
 	    if(!name.equals(that.name)) return false;
 	    for(int i=0; i<params.length; i++) {
@@ -141,18 +146,18 @@
     /**
      * Get a cache entry from a name, class and arguments.
      * @param name The method name
-     * @param clazz The class
+     * @param obj The object or class
      * @param args The arguments
      * @return A cache entry.
      */
-    public Entry getEntry (String name, Class clazz, Object args[]){
+    public Entry getEntry (String name, Object obj, Object args[]){
     	Class params[] = new Class[args.length];
     	for (int i=0; i<args.length; i++) {
 	    Class c = args[i] == null ? null : args[i].getClass();
 	    if(c == PhpArray.class) return noCache;
 	    params[i] = c;
     	}
-	return new Entry(name, clazz, params);
+	return new Entry(name, obj, params);
     }
     
     /**
diff -ru php-java-bridge-3.2.1/VERSION php-java-bridge-3.2.1a/VERSION
--- php-java-bridge-3.2.1/VERSION	2007-04-03 19:49:32.000000000 +0200
+++ php-java-bridge-3.2.1a/VERSION	2007-04-03 19:49:32.000000000 +0200
@@ -1 +1 @@
-3.2.1
+3.2.1a
