Duplicate method selector, reliably reproduced

0 views
Skip to first unread message

Norbert

unread,
Oct 25, 2009, 3:27:06 PM10/25/09
to webve...@googlegroups.com
Here is how I can reliably reproduce this "Duplicate method selector
problem":
I have the attached parcels in my personal library, they are tow
slightly different versions of HelloWorld.
If these parcels are not easily loaded into a library, there is also my
personal library archive attached.

So we have HelloWorld and HelloWorld1 in the library, now:

Open WebVelocity
load HelloWorld
load HelloWorld1
with HelloWorld:
open in new tab,
open class Hello,
open source code
add breakpoint to renderContentOn:
same with HelloWorld1
run HelloWorld1 until breakpoint
run HelloWorld until breakpoint
in the source window of HelloWorld>Hello delete the space after
"renderContentOn: html"
Voilà

Obviously I do not know if that case is minimal but it seems pretty
small to me.
Hope it works for you too.

Norbert

Parcel Archive.zip
personal.db.zip

Michael Lucas-Smith

unread,
Oct 26, 2009, 6:38:31 PM10/26/09
to webve...@googlegroups.com
I got it to recreate the problem once - every other time it did the
right thing. So, not quite reliable. I wish it were more, because I'd
love to debug it and figure out what's really going on.

There is something you could do for me, if you're getting it reliably.
Change the following method:

SourceCode>>validate
| handler |
error := nil.
self hasChanged ifFalse: [^true].
handler := WebCompilerErrorHandler new.
self duplicate isNil ifFalse: [
Notifier current: DebuggerService.
self halt.
(error := handler) error: 'Duplicate method selector' with: self
sourceSelector at: (1 to: source size).
^ false ].

^ true

Any time you get a duplicate method when you shouldn't, you'll drop back
to the regular debugger and you can find out how #duplicate got picked
up. You'll have to reset the debugger back to the WV one after that code
triggers though if you want to get the web debugger again. You can do
that in settings.

Michael

fortyn

unread,
Oct 27, 2009, 5:21:10 PM10/27/09
to WebVelocity
Simpler way I could reproduce this:
Open WebVelocity
load HelloWorld from library
with HelloWorld:
    open in new tab,
    open class Hello,
    open source code
    add breakpoint to renderContentOn:
In the base window now
load HelloWorld1 from library (sometimes I get the problem here
already)
open class Hello,
open source code

When I now inspect: WebVelocityCodeEditor.SourceCode.Pending I see
that HelloWorld >renderContentOn: show up twice and if I inspect the
second copy it has as package HelloWorld1.
Changing HelloWorld >renderContentOn: by taking away the space after
the header in the HelloWorld source code window produces the error.
(This works with any number of breakpoint methods in HelloWorld)

A little debugging showed that
when the component changes in the UI (by loading HelloWorld1) this
triggers WebVelocity.BreakpointsUI> componentChanged where there is a
call to:
WebVelocity.BreakpointsUI> getBreakpoints which has a call to:
"WebVelocity.SourceCode class>package:protocol:class:selector:"
which creates a new Source code object for every method with a
Breakpoint that it does not find under its own name in the
"WebVelocityCodeEditor.SourceCode.Pending" list and then adds this new
Source code object to this Pending list.
This Source code object gets added with the new component
(HelloWorld1) as package but is otherwise a copy of the original
breakpoint method (which in my case has HelloWorld as package).
Hope that you can reproduce this.

On Oct 27, 12:38 am, Michael Lucas-Smith

Michael Lucas-Smith

unread,
Oct 27, 2009, 7:17:10 PM10/27/09
to webve...@googlegroups.com
Thank you for making a reproduceable variant as well as tracking down
the root cause of the bug.

Attached is the fix, copy it in to the autoload/ directory if you're
running in to this particular problem more than normal.

I'd like a show of hands, who feels this is annoying them enough that
you'd like us to make a new build?

Cheers,
Michael
BreakpointsUI-getBreakpoints.st

Ernest Micklei

unread,
Oct 28, 2009, 3:36:42 AM10/28/09
to webve...@googlegroups.com
Thank you for the fix. I will try that on our setup.
Until now, I had to unload and load the app to get rid of the
persistent warnings.

^Ernest
--
^ Ernest Micklei

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Objects in the Cloud - http://www.philemonworks.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Reply all
Reply to author
Forward
0 new messages