@@ -2425,6 +2425,7 @@ ClazzLoader.removeFromArray = function (node, arr) {
24252425} ;
24262426
24272427/* private */
2428+ /*-# destroyClassNode -> dCN #-*/
24282429ClazzLoader . destroyClassNode = function ( node ) {
24292430 var parents = node . parents ;
24302431 if ( parents != null ) {
@@ -2476,7 +2477,7 @@ ClazzLoader.unloadClassExt = function (qClazzName) {
24762477 ClazzLoader . classUnloaded ( qClazzName ) ;
24772478} ;
24782479
2479- /* private */
2480+ /* protected */ /* Clazz#assureInnerClass */
24802481ClazzLoader . assureInnerClass = function ( clzz , fun ) {
24812482 var clzzName = clzz . __CLASS_NAME__ ;
24822483 if ( Clazz . unloadedClasses [ clzzName ] ) {
@@ -2517,7 +2518,9 @@ ClazzLoader.assureInnerClass = function (clzz, fun) {
25172518 }
25182519} ;
25192520
2521+ /*-# lastHotspotUpdated -> ltUd #-*/
25202522ClazzLoader . lastHotspotUpdated = new Date ( ) . getTime ( ) ;
2523+ /*-# lastHotspotSessionID -> ltSI #-*/
25212524ClazzLoader . lastHotspotSessionID = 0 ;
25222525
25232526/*
@@ -2536,7 +2539,9 @@ ClazzLoader.updateHotspot = function () {
25362539 }
25372540 var length = ( arguments . length - 1 ) / 3 ;
25382541 var lastID = 0 ;
2542+ /*-# lastUpdated -> lUd #-*/
25392543 var lastUpdated = 0 ;
2544+ /*-# toUpdateClasses -> tUs #-*/
25402545 var toUpdateClasses = new Array ( ) ;
25412546 for ( var i = 0 ; i < length ; i ++ ) {
25422547 var time = arguments [ i * 3 ] ;
@@ -2553,6 +2558,7 @@ ClazzLoader.updateHotspot = function () {
25532558 if ( toUpdateClasses . length > 0 ) {
25542559 ClazzLoader . lastHotspotUpdated = lastUpdated ;
25552560 ClazzLoader . lastHotspotSessionID = lastID ;
2561+ /*-# needUpdateClasses -> nUC #-*/
25562562 var needUpdateClasses = new Array ( ) ;
25572563 for ( var i = 0 ; i < toUpdateClasses . length ; i ++ ) {
25582564 needUpdateClasses [ i ] = Clazz . unloadClass ( toUpdateClasses [ i ] ) ;
@@ -2574,6 +2580,7 @@ ClazzLoader.updateHotspot = function () {
25742580} ;
25752581
25762582/* private */
2583+ /*-# removeHotspotScriptNode -> rtSN #-*/
25772584ClazzLoader . removeHotspotScriptNode = function ( n ) {
25782585 // lazily remove script nodes.
25792586 window . setTimeout ( ( function ( node ) {
@@ -2594,23 +2601,33 @@ ClazzLoader.removeHotspotScriptNode = function (n) {
25942601 }
25952602} ;
25962603
2604+ /*-# lastHotspotScriptLoaded -> ltSL #-*/
25972605ClazzLoader . lastHotspotScriptLoaded = true ;
2598- ClazzLoader . hotspotMonitoringTimeout = null ;
2606+ /*-# hotspotJSTimeout -> hJSt #-*/
2607+ ClazzLoader . hotspotJSTimeout = null ;
2608+ /*-# lastHotspotJSFailed -> ltJF #-*/
25992609ClazzLoader . lastHotspotJSFailed = false ;
26002610
26012611/* protected */
2612+ /*-# hotspotMonitoring -> htMr #-*/
26022613ClazzLoader . hotspotMonitoring = function ( ) {
2603- if ( ClazzLoader . lastHotspotScriptLoaded ) {
2614+ if ( ClazzLoader . lastHotspotScriptLoaded
2615+ && ! ClazzLoader . lastHotspotJSFailed ) {
26042616 var port = window [ "j2s.hotspot.port" ] ;
26052617 if ( port == null ) {
26062618 port = 1725 ;
26072619 }
26082620 var hotspotURL = "http://127.0.0.1:" + port ;
26092621 if ( ClazzLoader . lastHotspotSessionID == 0 ) {
2610- hotspotURL += "/hotspot.js" ;
2622+ hotspotURL += "/hotspot.js?" + Math . random ( ) ;
26112623 } else {
2612- hotspotURL += "/" + ClazzLoader . lastHotspotSessionID + ".js" ;
2624+ hotspotURL += "/" + ClazzLoader . lastHotspotSessionID + ".js?"
2625+ + Math . random ( ) ;
26132626 }
2627+
2628+ ClazzLoader . lastHotspotJSFailed = true ;
2629+ ClazzLoader . lastHotspotScriptLoaded = false ;
2630+
26142631 var script = document . createElement ( "SCRIPT" ) ;
26152632 script . type = "text/javascript" ;
26162633 script . src = hotspotURL ;
@@ -2633,19 +2650,19 @@ ClazzLoader.hotspotMonitoring = function () {
26332650 } ;
26342651 }
26352652
2636- ClazzLoader . lastHotspotJSFailed = true ;
2637- ClazzLoader . lastHotspotScriptLoaded = false ;
26382653 var head = document . getElementsByTagName ( "HEAD" ) [ 0 ] ;
26392654 head . appendChild ( script ) ;
2640- }
2641-
2642- window . setTimeout ( ClazzLoader . hotspotMonitoring , 250 ) ;
2643- if ( ClazzLoader . hotspotMonitoringTimeout == null ) {
2644- ClazzLoader . hotspotMonitoringTimeout = window . setTimeout ( function ( ) {
2655+ if ( ClazzLoader . hotspotJSTimeout != null ) {
2656+ window . clearTimeout ( ClazzLoader . hotspotJSTimeout ) ;
2657+ ClazzLoader . hotspotJSTimeout = null ;
2658+ }
2659+ ClazzLoader . hotspotJSTimeout = window . setTimeout ( function ( ) {
26452660 ClazzLoader . lastHotspotScriptLoaded = true ; // timeout
2646- window . setTimeout ( ClazzLoader . hotspotMonitoring , 50 ) ;
2661+ ClazzLoader . lastHotspotJSFailed = false ; // timeout
26472662 } , 7500 ) ; // 7.5 seconds to time out
26482663 }
2664+
2665+ window . setTimeout ( ClazzLoader . hotspotMonitoring , 250 ) ;
26492666} ;
26502667
26512668/*
0 commit comments