JavaClassReloader.st
changeset 3627 5d22435da54d
parent 3508 622620308fee
equal deleted inserted replaced
3626:7be362f041a8 3627:5d22435da54d
     1 "{ Encoding: utf8 }"
       
     2 
       
     3 "
     1 "
     4  COPYRIGHT (c) 1996-2015 by Claus Gittinger
     2  COPYRIGHT (c) 1996-2015 by Claus Gittinger
     5 
     3 
     6  New code and modifications done at SWING Research Group [1]:
     4  New code and modifications done at SWING Research Group [1]:
     7 
     5 
   474     ].
   472     ].
   475 
   473 
   476     oldClass isInitialized ifTrue:[ newClass classInit ].
   474     oldClass isInitialized ifTrue:[ newClass classInit ].
   477 
   475 
   478     newMethods do:[:m|m setJavaClass: oldClass].
   476     newMethods do:[:m|m setJavaClass: oldClass].
       
   477     oldClass setAccessFlags: newClass accessFlags.    
   479     oldClass setAttributes: newClass attributes.
   478     oldClass setAttributes: newClass attributes.
   480     oldClass annotations: newClass annotations.
   479     oldClass annotations: newClass annotations.
   481     oldClass setMethodDictionary: newMethods constantPool: newClass constantPool.
   480     oldClass setMethodDictionary: newMethods constantPool: newClass constantPool.
   482     oldClass setSource: newClass sourceString.
   481     oldClass setSource: newClass sourceString.
   483     oldClass setFields: newClass fields.
   482     oldClass setFields: newClass fields.
   484     oldClass setStaticFields: newClass staticFields.
   483     oldClass setStaticFields: newClass staticFields.
   485     "Flush all proxies, they mau refer to old static methods"
   484     "Flush all proxies, they may refer to old static methods"
   486     oldClass class setMethodDictionary: MethodDictionary new.
   485     oldClass class setMethodDictionary: MethodDictionary new.
   487 
   486 
   488     oldMethodsRemoved do:[:oldMRemoved |
   487     oldMethodsRemoved do:[:oldMRemoved |
   489         oldMRemoved isJavaMethod ifTrue:[
   488         oldMRemoved isJavaMethod ifTrue:[
   490             self requestRecompileSendersOf: oldMRemoved.
   489             self requestRecompileSendersOf: oldMRemoved.
   509         ]
   508         ]
   510     ].
   509     ].
   511 
   510 
   512     "Created: / 16-12-2012 / 17:36:52 / Marcel Hlopko <marcel.hlopko@fit.cvut.cz>"
   511     "Created: / 16-12-2012 / 17:36:52 / Marcel Hlopko <marcel.hlopko@fit.cvut.cz>"
   513     "Modified: / 12-10-2013 / 19:20:03 / Marcel Hlopko <marcel.hlopko@fit.cvut.cz>"
   512     "Modified: / 12-10-2013 / 19:20:03 / Marcel Hlopko <marcel.hlopko@fit.cvut.cz>"
   514     "Modified: / 02-04-2015 / 08:46:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   513     "Modified: / 21-09-2016 / 09:40:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   515 ! !
   514 ! !
   516 
   515 
   517 !JavaClassReloader::SingleClassReloader methodsFor:'private-helpers'!
   516 !JavaClassReloader::SingleClassReloader methodsFor:'private-helpers'!
   518 
   517 
   519 withAllSuperclassesAndInterfacesOf: aJavaClass do: aBlock
   518 withAllSuperclassesAndInterfacesOf: aJavaClass do: aBlock