Bug 39802

GemStone/S 64 Bit

2.3.1.6, 2.3.1, 2.3, 2.2.5.4, 2.2.5.3, 2.2.5.2, 2.2.5.1, 2.2.5, 2.2.4, 2.2.3, 2.2.2, 2.2.x, 2.1.4, 2.1.x, 2.0.4, 2.0.x, 1.2.5, 1.2.4, 1.1.14, 1.x

All

2.4

addAllToStoneLog: errors for large arguments

Calling the method System class >> addAllToStoneLog: with an argument of length greater than 16269 results in an error.

Workaround

File in the following as SystemUser and commit.


classmethod System
addAllToStoneLog: aString

"Appends text to the Stone's informational log file.  First, this method writes
a banner that identifies the session from which aString came.  It then appends
aString itself.  The argument must be a kind of String or DoubleByteString."

| logicalSize chunkSize offset endOffset |

aString basicSize <= 16270 "virtual machine constant" ifTrue:[
  ^ self _addAllToStoneLog: aString
  ].
aString _validateClasses:#[ String, DoubleByteString].
logicalSize := aString size .
chunkSize := 16270 "virtual machine constant" .
(aString isKindOf: DoubleByteString) ifTrue:[ chunkSize := 16270 / 2 ].

offset := 1.
[offset <= logicalSize] whileTrue:[
  endOffset := offset + chunkSize - 1 .
  endOffset > logicalSize ifTrue:[ endOffset := logicalSize ].
  self _addAllToStoneLog: (aString copyFrom: offset to: endOffset).
  offset := offset + chunkSize
  ].
%


                

Last updated: 4/10/09