[Pharo-project] Issue 4028 in pharo: Possible infinite loop in ImageSegment >> #uniqueFileNameFor:
Status: Accepted Owner: ryd...@gmail.com Labels: Milestone-1.3 New issue 4028 by ryd...@gmail.com: Possible infinite loop in ImageSegment
#uniqueFileNameFor: http://code.google.com/p/pharo/issues/detail?id=4028
I guess noone's ever needed more than 99 versions of a segment... ImageSegment >> uniqueFileNameFor: segName "Choose a unique file name for the segment with this name." | segDir fileName listOfFiles | segDir := self segmentDirectory. listOfFiles := segDir fileNames. BiggestFileNumber ifNil: [BiggestFileNumber := 1]. BiggestFileNumber > 99 ifTrue: [BiggestFileNumber := 1]. "wrap" [fileName := segName, BiggestFileNumber printString, '.seg'. (listOfFiles includes: fileName)] whileTrue: [ BiggestFileNumber := BiggestFileNumber + 1]. "force a unique file name" ^ fileName
Updates: Cc: adrian.l...@gmail.com Comment #1 on issue 4028 by marianopeck: Possible infinite loop in ImageSegment >> #uniqueFileNameFor: http://code.google.com/p/pharo/issues/detail?id=4028 (No comment was entered for this change.)
Comment #2 on issue 4028 by marianopeck: Possible infinite loop in ImageSegment >> #uniqueFileNameFor: http://code.google.com/p/pharo/issues/detail?id=4028 hehehehehehheheh At least that only happens when yo DO NOT specify a fileName.... And I don't see any reason about that limit. Cannot we just remove this line? BiggestFileNumber > 99 ifTrue: [BiggestFileNumber := 1]. "wrap" And then an explicit message to reset it ? So that the developer that really understand the problem, can explicirtly and savely reset it?
Updates: Labels: -Milestone-1.3 Comment #3 on issue 4028 by marcus.d...@gmail.com: Possible infinite loop in ImageSegment >> #uniqueFileNameFor: http://code.google.com/p/pharo/issues/detail?id=4028 Not a showstopper for 1.3
participants (1)
-
pharo@googlecode.com