This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 34925
Collapse All | Expand All

(-)Main.java (-1 / +2 lines)
Lines 96-105 Link Here
96
  /** Starts TopThreadGroup which properly overrides uncaughtException
96
  /** Starts TopThreadGroup which properly overrides uncaughtException
97
   * Further - new thread in the group execs main
97
   * Further - new thread in the group execs main
98
   */
98
   */
99
  public static void main (String[] argv) {
99
  public static void main (String[] argv) throws Exception {
100
    TopThreadGroup tg = new TopThreadGroup ("IDE Main", argv); // NOI18N - programatic name
100
    TopThreadGroup tg = new TopThreadGroup ("IDE Main", argv); // NOI18N - programatic name
101
    StartLog.logStart ("Forwarding to topThreadGroup"); // NOI18N
101
    StartLog.logStart ("Forwarding to topThreadGroup"); // NOI18N
102
    tg.start ();
102
    tg.start ();
103
    System.out.println("FINISHED!!!!");
103
  }
104
  }
104
105
105
106
(-)TopThreadGroup.java (-1 / +12 lines)
Lines 23-28 Link Here
23
final class TopThreadGroup extends ThreadGroup implements Runnable {
23
final class TopThreadGroup extends ThreadGroup implements Runnable {
24
    /** The command line args */
24
    /** The command line args */
25
    private String[] args;
25
    private String[] args;
26
    /** flag that indicates whether the main thread had finished or not */
27
    private boolean finished;
26
        
28
        
27
    /** Constructs a new thread group. The parent of this new group is
29
    /** Constructs a new thread group. The parent of this new group is
28
    * the thread group of the currently running thread.
30
    * the thread group of the currently running thread.
Lines 70-78 Link Here
70
        }
72
        }
71
    }
73
    }
72
    
74
    
73
    public void start () {
75
    public synchronized void start () throws InterruptedException {
74
        Thread t = new Thread (this, this, "main"); // NOI18N
76
        Thread t = new Thread (this, this, "main"); // NOI18N
75
        t.start ();
77
        t.start ();
78
        
79
        while (!finished) {
80
            wait ();
81
        }
76
    }
82
    }
77
83
78
    public void run() {
84
    public void run() {
Lines 81-86 Link Here
81
        } catch (Throwable t) {
87
        } catch (Throwable t) {
82
            // XXX is this not handled by uncaughtException?
88
            // XXX is this not handled by uncaughtException?
83
            ErrorManager.getDefault().notify(t);
89
            ErrorManager.getDefault().notify(t);
90
        } finally {
91
            synchronized (this) {
92
                finished = true;
93
                notify ();
94
            }
84
        }
95
        }
85
    }
96
    }
86
}
97
}

Return to bug 34925