Issue 229 in glassdb: ScaledDecimal class>>readFrom: returns Number not ScaledDecimal

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

Issue 229 in glassdb: ScaledDecimal class>>readFrom: returns Number not ScaledDecimal

glassdb
Status: Accepted
Owner: [hidden email]
Labels: Type-Defect Priority-Medium GLASS-Server Version-1.0-beta.8.5  
Milestone-1.0-beta.8.6

New issue 229 by [hidden email]: ScaledDecimal class>>readFrom: returns  
Number not ScaledDecimal
http://code.google.com/p/glassdb/issues/detail?id=229

While debugging Max Leske's report about test failures that hadn't  
reproduced in my test environment:

   http://forum.world.st/failing-tests-td3244020.html

specifically, SqueakTests>>#testReadFrom. I discovered that the readFrom:  
method is inherited from Number, so instances of ScaledDecimals aren't  
returned ... interestingly enough the following expression returns true  
even though we're comparing a Float and a ScaledDecimal:

     | obj float1 float2 |
     obj := ScaledDecimal fromString: '34.23'.
     (ScaledDecimal readFrom: obj printString readStream) asFloat = obj


Reply | Threaded
Open this post in threaded view
|

Re: Issue 229 in glassdb: ScaledDecimal class>>readFrom: returns Number not ScaledDecimal

glassdb

Comment #1 on issue 229 by [hidden email]: ScaledDecimal  
class>>readFrom: returns Number not ScaledDecimal
http://code.google.com/p/glassdb/issues/detail?id=229

The fix should be something like this:


readFrom: stringOrStream

        ^self fromString:
                ((stringOrStream isString)
                        ifTrue: [stringOrStream]

need tests, too...
                        ifFalse: [stringOrStream contents]).


Reply | Threaded
Open this post in threaded view
|

Re: Issue 229 in glassdb: ScaledDecimal class>>readFrom: returns Number not ScaledDecimal

glassdb
Updates:
        Labels: -Milestone-1.0-beta.8.6 Milestone-1.0-beta.9

Comment #2 on issue 229 by [hidden email]: ScaledDecimal  
class>>readFrom: returns Number not ScaledDecimal
http://code.google.com/p/glassdb/issues/detail?id=229

Upon further review ... the right answer (to read a scaled decimal off of  
Stream, whether or not the $s notation is used) will require porting  
SqNumberParser to GemStone....which can be done in the fullness of time ...

Reply | Threaded
Open this post in threaded view
|

Re: Issue 229 in glassdb: ScaledDecimal class>>readFrom: returns Number not ScaledDecimal

glassdb
Updates:
        Labels: -Milestone-1.0-beta.9 Milestone-1.0-beta.8.7

Comment #3 on issue 229 by [hidden email]: ScaledDecimal  
class>>readFrom: returns Number not ScaledDecimal
http://code.google.com/p/glassdb/issues/detail?id=229

hold the phone ... SqNumberParser is already ported to GemStone ... okay it  
is loaded into GLASS ... need to blow the dust off of it ... bring in some  
unit tests and then start using it :)



Reply | Threaded
Open this post in threaded view
|

Re: Issue 229 in glassdb: ScaledDecimal class>>readFrom: returns Number not ScaledDecimal

glassdb
In reply to this post by glassdb
Issue 229: ScaledDecimal class>>readFrom: returns Number not ScaledDecimal
http://code.google.com/p/glassdb/issues/detail?id=229

This issue is now blocking issue 230.
See http://code.google.com/p/glassdb/issues/detail?id=230

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings
Reply | Threaded
Open this post in threaded view
|

Re: Issue 229 in glassdb: ScaledDecimal class>>readFrom: returns Number not ScaledDecimal

glassdb
In reply to this post by glassdb
Updates:
        Status: Fixed
        Labels: Fixed-1.0-beta.8.7

Comment #5 on issue 229 by [hidden email]: ScaledDecimal  
class>>readFrom: returns Number not ScaledDecimal
http://code.google.com/p/glassdb/issues/detail?id=229

Ported SqNumberParser to GLASS from Pharo 1.2 and using it to parse all  
numbers (readFrom metods)

Name: ConfigurationOfGsCore-dkh.185
Author: dkh
Time: 03/25/2011, 14:02:33
UUID: 9b0249eb-a255-45d9-8ccd-99fdf9fb964c
Ancestors: ConfigurationOfGsCore-dkh.184