Andrew S. Townley wrote: > Admittedly, this one didn't take me as long to figure out the root > cause, but it still wasn't very helpful in identifying the actual cause. > Given that the behavior of "name mapping" isn't 100% consistent (that it > does it during calls, but not during definition), it might actually > cause problems for more people than just me. > > I know that JRuby isn't the only implementation that does this (so does > IronRuby), but it might be something to put on the "todo" list to at > least provide some kind of warning or more automatic fixup. > > While convenient, and certainly "more ruby-like", I'm not really sure > that doing all of the automagic method translation stuff is actually all > that necessary, and, since it's difficult to do for all cases without > adding even more overhead, maybe might just be simpler to avoid. Yes, we did make a modification in JRuby 1.1.5 or so to allow implementing interface methods with underscore names, but that never got into the class-extending code (which is way more complicated). We're really tight on resources to work on this stuff, but we're hoping to do another pass over the summer to complete the already-started rewrite of the whole Java integration layer. This sort of gap will be remedied then as well. > Glad it did turn out to be just me, but a more accurate error message > would be nice. > > Actually, as I was going to write the rest, I just figured out why I hit > the problem. Action is an accessor of JButton. Since I used the same > name, silent collision, the compiler's happy, but it's obviously still > somewhat confused. Not really sure what message I'd expect, but I still > think the current message is misleading. There's actually a bug in our tracker to improve error messages throughout Java integration code, since I know it can be very frustrating. The current code is unfortunately the product of almost 8 years of people poking it this way and that without ever completing a full refactoring. But we're untangling it bit by bit and making improvements with every release. We're also more than willing to help folks like you sort out remaining issues. And probably the biggest thing you could do to help us would be to contribute simple specs/tests for behaviors you discover and behaviors that aren't working like you expect, so we can continue to build out a set of expectations we need to meet. - Charlie