[VW 7.5] [Bug] MethodDefinitionChange>>text

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[VW 7.5] [Bug] MethodDefinitionChange>>text

Stew MacLean

In 7.4 this answers a Text, as promised by the comment:

 

text

            "Answer the text displayed by the receiver."

 

            | m |

            m := self methodSources.

            ^m == nil

                        ifTrue: [nil]

                        ifFalse: [m source]

 

In 7.5 this answers a ByteString, contrary to the comment, as a result of using cleanSourceFrom:

 

text

            "Answer the text displayed by the receiver."

 

            | m |

            m := self methodSources.

            ^m == nil

                        ifTrue: [nil]

                        ifFalse: [self cleanSourceFrom: m source]

 

As a consequence, this breaks:

 

Change>> sameAsSystem

            "Return true if the receiver represents an object that is the same as the system."

 

            ^self hasVersionInSystem

            and: [self text = self systemText]

 

 

as systemText answers a Text, where as “self text” is now answering a ByteString, and they no longer compare equal.

 

To preserve the status quo I suspect the fix should be to coerce the result of cleanSourceFrom: to a Text.

 

Hopefully this won’t have any side effects.

 

Cheers,

 

Stewart

 

 

 

Reply | Threaded
Open this post in threaded view
|

RE: [VW 7.5] [Bug] MethodDefinitionChange>>text

Andres Valloud-6
Stewart,
 
We appreciate the time you took to fix and report this.  We will take a look at incorporating it shortly.
 
Thanks,
Andres.


From: Stewart MacLean [mailto:[hidden email]]
Sent: Thursday, July 05, 2007 11:08 PM
To: [hidden email]
Subject: [VW 7.5] [Bug] MethodDefinitionChange>>text

In 7.4 this answers a Text, as promised by the comment:

 

text

            "Answer the text displayed by the receiver."

 

            | m |

            m := self methodSources.

            ^m == nil

                        ifTrue: [nil]

                        ifFalse: [m source]

 

In 7.5 this answers a ByteString, contrary to the comment, as a result of using cleanSourceFrom:

 

text

            "Answer the text displayed by the receiver."

 

            | m |

            m := self methodSources.

            ^m == nil

                        ifTrue: [nil]

                        ifFalse: [self cleanSourceFrom: m source]

 

As a consequence, this breaks:

 

Change>> sameAsSystem

            "Return true if the receiver represents an object that is the same as the system."

 

            ^self hasVersionInSystem

            and: [self text = self systemText]

 

 

as systemText answers a Text, where as “self text” is now answering a ByteString, and they no longer compare equal.

 

To preserve the status quo I suspect the fix should be to coerce the result of cleanSourceFrom: to a Text.

 

Hopefully this won’t have any side effects.

 

Cheers,

 

Stewart

 

 

 

Reply | Threaded
Open this post in threaded view
|

Re: [VW 7.5] [Bug] MethodDefinitionChange>>text

Eliot Miranda-2
In reply to this post by Stew MacLean
When this code was written both text and systemText answered only strings (I know, I rewrote this code for vw3.0 when I enhanced the ChangeList).  text and systemText are simply misleading selectors.  I don' know when method source started returning texts instead of strings, but the Change hierarchy clearly hasn't been updated to handle it.  I suggest changing

Change>>
sameAsSystem
          "Return true if the receiver represents an object that is the same as the system."
           ^self hasVersionInSystem
           and: [self text = self systemText]

to

Change>>
sameAsSystem
          "Return true if the receiver represents an object that is the same as the system."
           ^self hasVersionInSystem
           and: [self text string = self systemText string]

etc...



On 7/5/07, Stewart MacLean <[hidden email]> wrote:

In 7.4 this answers a Text, as promised by the comment:

 

text

            "Answer the text displayed by the receiver."

 

            | m |

            m := self methodSources.

            ^m == nil

                        ifTrue: [nil]

                        ifFalse: [m source]

 

In 7.5 this answers a ByteString, contrary to the comment, as a result of using cleanSourceFrom:

 

text

            "Answer the text displayed by the receiver."

 

            | m |

            m := self methodSources.

            ^m == nil

                        ifTrue: [nil]

                        ifFalse: [self cleanSourceFrom: m source]

 

As a consequence, this breaks:

 

Change>> sameAsSystem

            "Return true if the receiver represents an object that is the same as the system."

 

            ^self hasVersionInSystem

            and: [self text = self systemText]

 

 

as systemText answers a Text, where as "self text" is now answering a ByteString, and they no longer compare equal.

 

To preserve the status quo I suspect the fix should be to coerce the result of cleanSourceFrom: to a Text.

 

Hopefully this won't have any side effects.

 

Cheers,

 

Stewart

 

 

 


Reply | Threaded
Open this post in threaded view
|

RE: [VW 7.5] [Bug] MethodDefinitionChange>>text

Stew MacLean

Yes, I thought the use of text here was a bit strange.

 

I’ll adopt your suggestions, as it’s more in keeping with the original intent (even if the selectors are misleading!).

 

Thanks,

 

Stewart

 

-----Original Message-----
From: Eliot Miranda [mailto:[hidden email]]
Sent: 11 July 2007 1:16 p.m.
To: Stewart MacLean
Cc: [hidden email]
Subject: Re: [VW 7.5] [Bug] MethodDefinitionChange>>text

 

When this code was written both text and systemText answered only strings (I know, I rewrote this code for vw3.0 when I enhanced the ChangeList).  text and systemText are simply misleading selectors.  I don' know when method source started returning texts instead of strings, but the Change hierarchy clearly hasn't been updated to handle it.  I suggest changing

Change>>
sameAsSystem
          "Return true if the receiver represents an object that is the same as the system."
           ^self hasVersionInSystem

           and: [self text = self systemText]

to

Change>>
sameAsSystem
          "Return true if the receiver represents an object that is the same as the system."
           ^self hasVersionInSystem

           and: [self text string = self systemText string]

etc...

 

On 7/5/07, Stewart MacLean <[hidden email]> wrote:

In 7.4 this answers a Text, as promised by the comment:

 

text

            "Answer the text displayed by the receiver."

 

            | m |

            m := self methodSources.

            ^m == nil

                        ifTrue: [nil]

                        ifFalse: [m source]

 

In 7.5 this answers a ByteString, contrary to the comment, as a result of using cleanSourceFrom:

 

text

            "Answer the text displayed by the receiver."

 

            | m |

            m := self methodSources.

            ^m == nil

                        ifTrue: [nil]

                        ifFalse: [self cleanSourceFrom: m source]

 

As a consequence, this breaks:

 

Change>> sameAsSystem

            "Return true if the receiver represents an object that is the same as the system."

 

            ^self hasVersionInSystem

            and: [self text = self systemText]

 

 

as systemText answers a Text, where as "self text" is now answering a ByteString, and they no longer compare equal.

 

To preserve the status quo I suspect the fix should be to coerce the result of cleanSourceFrom: to a Text.

 

Hopefully this won't have any side effects.

 

Cheers,

 

Stewart