Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0002878 [Hessian] minor always 08-28-08 14:24 09-11-08 15:50
Reporter ferg View Status public  
Assigned To ferg
Priority normal Resolution fixed  
Status closed   Product Version
Summary 0002878: Hessian proxy equals
Description (rep by Christian Campo)

just today I fell across a piece of code in Hessian that I dont quite get. Its in the HessianProxy line 103ff

  public Object invoke(Object proxy, Method method, Object []args)
    throws Throwable
    String mangleName;

    synchronized (_mangleMap) {
      mangleName = _mangleMap.get(method);

    if (mangleName == null) {
      String methodName = method.getName();
      Class []params = method.getParameterTypes();

      // equals and hashCode are special cased
      if (methodName.equals("equals")
      && params.length == 1 && params[0].equals(Object.class)) {
    Object value = args[0];
    if (value == null || ! Proxy.isProxyClass(value.getClass()))
      return new Boolean(false);

    HessianProxy handler = (HessianProxy) Proxy.getInvocationHandler(value);

It happens when the "equals" is called on a HessianProxy object. The implementation seems to assume that when argument is not null but is also a Proxy it has to be of type HessianProxy. That can be true, but it does not have to be.

I fully agree that this is a very specific case, but the ClassCastException that you get in the equals still sounds like a bug to me.

Additional Information
Attached Files

- Relationships

There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
08-28-08 14:24 ferg New Issue
09-11-08 15:50 ferg Assigned To  => ferg
09-11-08 15:50 ferg Status new => closed
09-11-08 15:50 ferg Resolution open => fixed
09-11-08 15:50 ferg Fixed in Version  => 3.2.1

Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
26 total queries executed.
24 unique queries executed.
Powered by Mantis Bugtracker