Object.st
branchjv
changeset 19811 65fec19facb0
parent 19691 5e613f6255d9
parent 19784 4b81dcd2d740
child 19812 0866264d6eed
--- a/Object.st	Thu May 05 06:48:19 2016 +0200
+++ b/Object.st	Thu May 12 09:30:28 2016 +0200
@@ -494,7 +494,6 @@
     InfoPrinting := aBoolean
 ! !
 
-
 !Object class methodsFor:'queries'!
 
 isAbstract
@@ -517,7 +516,6 @@
 ! !
 
 
-
 !Object methodsFor:'Compatibility-Dolphin'!
 
 stbFixup: anSTBInFiler at: newObjectIndex
@@ -693,7 +691,6 @@
     "
 ! !
 
-
 !Object methodsFor:'accessing'!
 
 _at:index
@@ -3308,8 +3305,8 @@
     |spec sender message|
 
     Smalltalk isSmalltalkDevelopmentSystem ifFalse:[
-	"ignore in production systems"
-	^ self.
+        "ignore in production systems"
+        ^ self.
     ].
 
     message := messageOrNil ? 'Obsolete method called'.
@@ -3320,28 +3317,28 @@
     ('         And may not be present in future ST/X versions.') infoPrintCR.
     ('         called from ' , sender printString) infoPrintCR.
     (sender selector startsWith:'perform:') ifTrue:[
-	sender := sender sender.
-	(sender selector startsWith:'perform:') ifTrue:[
-	    sender := sender sender.
-	].
-	('         called from ' , sender printString) infoPrintCR.
+        sender := sender sender.
+        (sender selector startsWith:'perform:') ifTrue:[
+            sender := sender sender.
+        ].
+        ('         called from ' , sender printString) infoPrintCR.
     ].
     message notNil ifTrue:[
-	'------>  ' infoPrint. message infoPrintCR
+        '------>  ' infoPrint. message infoPrintCR
     ].
 
     "CG: care for standalone non-GUI progs, which have no userPreferences class"
     (Smalltalk isInitialized
     and:[ UserPreferences notNil
     and:[ UserPreferences current haltInObsoleteMethod]]) ifTrue:[
-	"/ cg: nice try, stefan, but I don't want halts in system processes (fly by help and others)
-	Processor activeProcess isSystemProcess ifTrue:[
-	    (message , ' - please fix this now (no halt in system process)') infoPrintCR
-	] ifFalse:[
-	    "/ please check for the sender of the obsoleteMethodWarning,
-	    "/ and fix the code there.
-	    self halt:(message , ' - please fix this now!!')
-	].
+        "/ cg: nice try, stefan, but I don't want halts in system processes (fly by help and others)
+        Processor activeProcess isSystemProcess ifTrue:[
+            (message , ' - please fix this now (no halt in system process)') infoPrintCR
+        ] ifFalse:[
+            "/ please check for the sender of the obsoleteMethodWarning,
+            "/ and fix the code there.
+            ObsoleteMethodCallWarning raiseRequestErrorString:(message , ' - please fix this now!!')
+        ].
     ].
 
     "
@@ -7752,7 +7749,9 @@
     "{ Pragma: +optSpace }"
 
     "helper for error messages - evaluate aBlock,
-     passing it a stream on which to put error messages."
+     passing it a stream on which to put error messages.
+     Notice that the block might be called twice,
+     to print both on stderr and onto the Transcript"
 
     |stream stderr activeProcess|
 
@@ -7764,8 +7763,8 @@
     and:[ UserPreferences notNil
     and:[ UserPreferences current sendMessagesAlsoToTranscript]]) ifTrue:[
         stream := activeProcess isSystemProcess
-                        ifTrue:[stderr]
-                        ifFalse:[activeProcess transcript].
+                            ifTrue:[stderr]
+                            ifFalse:[activeProcess transcript].
     ].
     stream notNil ifTrue:[
         StreamError catch:[
@@ -7773,7 +7772,9 @@
         ].
     ].
     stream ~~ stderr ifTrue:[
-        aBlock value:stderr.
+        UserPreferences current sendMessagesOnlyToTranscript ifFalse:[
+            aBlock value:stderr.
+        ].
     ].
 
     "Created: / 21-04-2011 / 12:46:21 / cg"
@@ -9662,10 +9663,13 @@
 !
 
 isNotNil
+    <resource: #obsolete>
+
     "Return true, if the receiver not nil.
      Because isNotNil is redefined in UndefinedObject,
      the receiver is definitely not nil here, so unconditionally return true."
 
+    self obsoleteMethodWarning:'use #notNil'.
     ^ true
 
     "Created: / 26-10-2014 / 01:30:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"