[Bug 56425] Unable to find unambiguous method in class String

2014-10-23 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56425

Violeta Georgieva violet...@apache.org changed:

   What|Removed |Added

  Attachment #32137|0   |1
is obsolete||

--- Comment #6 from Violeta Georgieva violet...@apache.org ---
Created attachment 32140
  -- https://issues.apache.org/bugzilla/attachment.cgi?id=32140action=edit
Test

The first problem in the attached test - testBug56425a is:


java.lang.ClassCastException: java.lang.Long cannot be cast to
[Ljava.lang.Object;
at org.apache.el.lang.ELSupport.coerceToArray(ELSupport.java:497)
at org.apache.el.lang.ELSupport.coerceToType(ELSupport.java:484)
at
org.apache.el.ExpressionFactoryImpl.coerceToType(ExpressionFactoryImpl.java:47)
at javax.el.Util.isCoercibleFrom(Util.java:493)
at javax.el.Util.findWrapper(Util.java:293)
at javax.el.Util.findMethod(Util.java:213)
at javax.el.BeanELResolver.invoke(BeanELResolver.java:157)
at javax.el.CompositeELResolver.invoke(CompositeELResolver.java:84)
at org.apache.el.parser.AstValue.getValue(AstValue.java:157)
at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:187)
at javax.el.ELProcessor.getValue(ELProcessor.java:61)
at javax.el.ELProcessor.eval(ELProcessor.java:54)
at javax.el.TestUtil.testBug56425a(TestUtil.java:48)



I'm attaching possible fix for this ClassCastException.

The second problem in the test - testBug56425b still failes with:

javax.el.MethodNotFoundException: Unable to find unambiguous method: class
javax.el.TesterBean.setValueInt(java.lang.Long)
at javax.el.Util.findWrapper(Util.java:343)
at javax.el.Util.findMethod(Util.java:213)
at javax.el.BeanELResolver.invoke(BeanELResolver.java:157)
at javax.el.CompositeELResolver.invoke(CompositeELResolver.java:84)
at org.apache.el.parser.AstValue.getValue(AstValue.java:157)
at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:187)
at javax.el.ELProcessor.getValue(ELProcessor.java:61)
at javax.el.ELProcessor.eval(ELProcessor.java:54)
at javax.el.TestUtil.testBug56425b(TestUtil.java:55)

-- 
You are receiving this mail because:
You are the assignee for the bug.

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 56425] Unable to find unambiguous method in class String

2014-10-23 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56425

Violeta Georgieva violet...@apache.org changed:

   What|Removed |Added

  Attachment #32140|0   |1
   is patch||

-- 
You are receiving this mail because:
You are the assignee for the bug.

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 56425] Unable to find unambiguous method in class String

2014-10-23 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56425

--- Comment #7 from Mark Thomas ma...@apache.org ---
The array handling fix looks lood to me. I'm looking into the second issue now.

-- 
You are receiving this mail because:
You are the assignee for the bug.

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 56425] Unable to find unambiguous method in class String

2014-10-23 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56425

--- Comment #8 from Mark Thomas ma...@apache.org ---
The second test case is not valid. Numeric literals are treated as instances of
Long (as per the EL spec). There are two matching methods. One with a paremeter
of int and one with a parameter of Integer. There is no way for EL to
differentiate bewtween them. The match is ambiguous (both matches would require
co-ercion). Therefore Tomcat's behaviour here is correct.

I'll get the fix for the first issue committed shortly.

-- 
You are receiving this mail because:
You are the assignee for the bug.

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 56425] Unable to find unambiguous method in class String

2014-10-23 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56425

Mark Thomas ma...@apache.org changed:

   What|Removed |Added

 Status|REOPENED|RESOLVED
 Resolution|--- |FIXED

--- Comment #9 from Mark Thomas ma...@apache.org ---
The additional array issue has been fixed in Tomcat 8.0.x in 8.0.15 onwards. It
does not occur in earlier versions.

-- 
You are receiving this mail because:
You are the assignee for the bug.

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 56425] Unable to find unambiguous method in class String

2014-10-22 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56425

--- Comment #5 from Violeta Georgieva violet...@apache.org ---
Created attachment 32137
  -- https://issues.apache.org/bugzilla/attachment.cgi?id=32137action=edit
Test

The following test reproduces the issue.

-- 
You are receiving this mail because:
You are the assignee for the bug.

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 56425] Unable to find unambiguous method in class String

2014-10-15 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56425

--- Comment #4 from Violeta Georgieva violet...@apache.org ---
Hi,

This is the revision r1590121. Can you provide a test where you see the issue?

Regards,
Violeta

-- 
You are receiving this mail because:
You are the assignee for the bug.

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 56425] Unable to find unambiguous method in class String

2014-10-14 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56425

lafleche lafle...@amazon.com changed:

   What|Removed |Added

 Status|RESOLVED|REOPENED
Version|7.0.53  |7.0.55
 Resolution|FIXED   |---

--- Comment #3 from lafleche lafle...@amazon.com ---
Can I see the commit where this bug was fixed?

I ran into this bug when upgrading from 7.0.50 to 7.0.55.

I was looking at the latest code for BeanELResolver.java and Util.java.

At a glance, it looks like:

getWrapper() does a bunch of fancy things including type coercion
getMethod() only looks for a perfect match.

I don't see BeanELResolver calling getWrapper() anywhere, only getMethod().

This matches the behaviour I'm seeing, where I get MethodNotFoundExceptions
forr mappings like:

doFoo(Integer bar) - doFoo(int bar)

-- 
You are receiving this mail because:
You are the assignee for the bug.

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 56425] Unable to find unambiguous method in class String

2014-04-25 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56425

Mark Thomas ma...@apache.org changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #2 from Mark Thomas ma...@apache.org ---
Thanks for the report. This has been fixed in 8.0.x for 8.0.6 onwards and in
7.0.x for 7.0.54 onwards.

-- 
You are receiving this mail because:
You are the assignee for the bug.

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 56425] Unable to find unambiguous method in class String

2014-04-18 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56425

--- Comment #1 from Konstantin Kolinko knst.koli...@gmail.com ---
In the String class there is no such method as replace(String, String)

The methods are
replace(CharSequence, CharSequence)
replace(char, char)

Method matching was changed in 7.0.53 (implementing fix for bug 55483).

Apparently when searching for a method in Util.findWrapper() there is no
distinction between isAssignableFrom and isCoercibleFrom parameters when
weighting potential matches.

I do not see any place in EL specification that clarifies how method matching
is performed.


By the way, for your use case I can suggest to use fn:replace() function from
JSTL tag library,
http://tomcat.apache.org/taglibs/standard/

-- 
You are receiving this mail because:
You are the assignee for the bug.

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org