OpenConcerto

Dépôt officiel du code source de l'ERP OpenConcerto
sonarqube

svn://code.openconcerto.org/openconcerto

Rev

Rev 144 | Rev 177 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 144 Rev 156
Line 23... Line 23...
23
import java.awt.Component;
23
import java.awt.Component;
24
import java.awt.Desktop;
24
import java.awt.Desktop;
25
import java.awt.Desktop.Action;
25
import java.awt.Desktop.Action;
26
import java.awt.Dialog;
26
import java.awt.Dialog;
27
import java.awt.Dimension;
27
import java.awt.Dimension;
-
 
28
import java.awt.FlowLayout;
28
import java.awt.Font;
29
import java.awt.Font;
29
import java.awt.Frame;
30
import java.awt.Frame;
30
import java.awt.GraphicsEnvironment;
31
import java.awt.GraphicsEnvironment;
31
import java.awt.GridBagConstraints;
32
import java.awt.GridBagConstraints;
32
import java.awt.GridBagLayout;
33
import java.awt.GridBagLayout;
Line 45... Line 46...
45
import java.net.HttpURLConnection;
46
import java.net.HttpURLConnection;
46
import java.net.URI;
47
import java.net.URI;
47
import java.net.URL;
48
import java.net.URL;
48
import java.nio.charset.Charset;
49
import java.nio.charset.Charset;
49
import java.util.Map;
50
import java.util.Map;
-
 
51
import java.util.concurrent.CompletableFuture;
50
import java.util.concurrent.Future;
52
import java.util.concurrent.Future;
51
import java.util.concurrent.FutureTask;
53
import java.util.concurrent.FutureTask;
-
 
54
import java.util.concurrent.atomic.AtomicInteger;
52
import java.util.logging.Level;
55
import java.util.logging.Level;
53
import java.util.logging.Logger;
56
import java.util.logging.Logger;
54
import java.util.regex.Pattern;
57
import java.util.regex.Pattern;
55
 
58
 
56
import javax.swing.AbstractAction;
59
import javax.swing.AbstractAction;
Line 64... Line 67...
64
import javax.swing.JSeparator;
67
import javax.swing.JSeparator;
65
import javax.swing.JTextArea;
68
import javax.swing.JTextArea;
66
import javax.swing.ScrollPaneConstants;
69
import javax.swing.ScrollPaneConstants;
67
import javax.swing.SwingUtilities;
70
import javax.swing.SwingUtilities;
68
import javax.swing.UIManager;
71
import javax.swing.UIManager;
69
import javax.swing.text.JTextComponent;
-
 
70
 
72
 
71
/**
73
/**
72
 * Allow to display an exception both on the GUI and on the console.
74
 * Allow to display an exception both on the GUI and on the console.
73
 * 
75
 * 
74
 * @author ILM Informatique 7 mai 2004
76
 * @author ILM Informatique 7 mai 2004
Line 79... Line 81...
79
    private static final String ILM_CONTACT = "http://www.ilm-informatique.fr/contact";
81
    private static final String ILM_CONTACT = "http://www.ilm-informatique.fr/contact";
80
    private static String forumURL = null;
82
    private static String forumURL = null;
81
    private static boolean showProbably = false;
83
    private static boolean showProbably = false;
82
    private static IFactory<String> softwareInfos = null;
84
    private static IFactory<String> softwareInfos = null;
83
    private static ThrowableHandler tHandler = null;
85
    private static ThrowableHandler tHandler = null;
-
 
86
    private static boolean safeToExit = false;
-
 
87
    private static final CompletableFuture<Boolean> FALSE_FUTURE = CompletableFuture.completedFuture(Boolean.FALSE);
-
 
88
    private static final CompletableFuture<Boolean> TRUE_FUTURE = CompletableFuture.completedFuture(Boolean.TRUE);
84
 
89
 
85
    public static void setThrowableHandler(ThrowableHandler handler) {
90
    public static void setThrowableHandler(ThrowableHandler handler) {
86
        tHandler = handler;
91
        tHandler = handler;
87
    }
92
    }
88
 
93
 
89
    public static void setForumURL(String url) {
94
    public static void setForumURL(String url) {
90
        forumURL = url;
95
        forumURL = url;
91
    }
96
    }
92
 
97
 
-
 
98
    public static void setSafeToExit(boolean b) {
-
 
99
        safeToExit = b;
-
 
100
    }
-
 
101
 
-
 
102
    public static void setSubmitErrorAutoEnabled(boolean b) {
-
 
103
        submitErrorAuto = b;
-
 
104
    }
-
 
105
 
93
    public synchronized static void setShowProbably(boolean showProbably) {
106
    public static synchronized void setShowProbably(boolean showProbably) {
94
        ExceptionHandler.showProbably = showProbably;
107
        ExceptionHandler.showProbably = showProbably;
95
    }
108
    }
96
 
109
 
97
    public synchronized static boolean isShowProbably() {
110
    public static synchronized boolean isShowProbably() {
98
        return ExceptionHandler.showProbably;
111
        return ExceptionHandler.showProbably;
99
    }
112
    }
100
 
113
 
101
    public synchronized static void setSoftwareInformations(final IFactory<String> f) {
114
    public synchronized static void setSoftwareInformations(final IFactory<String> f) {
102
        softwareInfos = f;
115
        softwareInfos = f;
Line 118... Line 131...
118
     * Display the passed message. Note: this method doesn't block.
131
     * Display the passed message. Note: this method doesn't block.
119
     * 
132
     * 
120
     * @param comp the modal parent of the error window.
133
     * @param comp the modal parent of the error window.
121
     * @param msg the message to display.
134
     * @param msg the message to display.
122
     * @param originalExn the cause, can be <code>null</code>.
135
     * @param originalExn the cause, can be <code>null</code>.
-
 
136
     * @return a future completed when the error is handled (e.g. the user clicked on the dialog),
123
     * @return an exception.
137
     *         <code>false</code> if the error couldn't be displayed to the user.
124
     */
138
     */
125
    static public ExceptionHandler handle(Component comp, String msg, Throwable originalExn) {
139
    static public Future<Boolean> handle(Component comp, String msg, Throwable originalExn) {
-
 
140
        final Future<Boolean> res;
126
        if (tHandler != null && tHandler.handle(msg, originalExn)) {
141
        if (tHandler != null && tHandler.handle(msg, originalExn)) {
-
 
142
            res = TRUE_FUTURE;
-
 
143
        } else {
127
            return new ExceptionHandler(msg, originalExn);
144
            res = new ExceptionHandler(comp, msg, originalExn, false).display();
128
        }
145
        }
129
        return new ExceptionHandler(comp, msg, originalExn, false);
146
        assert res != null;
130
 
-
 
-
 
147
        return res;
131
    }
148
    }
132
 
149
 
133
    static public RuntimeException handle(String msg, Throwable originalExn) {
150
    static public Future<Boolean> handle(String msg, Throwable originalExn) {
134
        return handle(null, msg, originalExn);
151
        return handle(null, msg, originalExn);
135
    }
152
    }
136
 
153
 
137
    static public RuntimeException handle(String msg) {
154
    static public Future<Boolean> handle(String msg) {
138
        return handle(msg, null);
155
        return handle(msg, null);
139
    }
156
    }
140
 
157
 
141
    /**
158
    /**
142
     * Display the passed message and quit. Note: this method blocks until the user closes the
159
     * Display the passed message and quit. Note: this method blocks until the user closes the
Line 145... Line 162...
145
     * @param msg the message to display.
162
     * @param msg the message to display.
146
     * @param originalExn the cause, can be <code>null</code>.
163
     * @param originalExn the cause, can be <code>null</code>.
147
     * @return an exception.
164
     * @return an exception.
148
     */
165
     */
149
    static public RuntimeException die(String msg, Throwable originalExn) {
166
    static public RuntimeException die(String msg, Throwable originalExn) {
150
        return new ExceptionHandler(null, msg, originalExn);
167
        final ExceptionHandler res = new ExceptionHandler(null, msg, originalExn);
-
 
168
        res.display();
-
 
169
        return res;
151
    }
170
    }
152
 
171
 
153
    static public RuntimeException die(String msg) {
172
    static public RuntimeException die(String msg) {
154
        return die(msg, null);
173
        return die(msg, null);
155
    }
174
    }
Line 158... Line 177...
158
        return Logger.getLogger(Logger.GLOBAL_LOGGER_NAME);
177
        return Logger.getLogger(Logger.GLOBAL_LOGGER_NAME);
159
    }
178
    }
160
 
179
 
161
    // the comp on which to display the popup, may be null
180
    // the comp on which to display the popup, may be null
162
    private final Component comp;
181
    private final Component comp;
163
    private final Future<?> future;
182
    private final boolean quit;
-
 
183
    protected static AtomicInteger openedWindows = new AtomicInteger(0);
164
    private static boolean forceUI;
184
    private static boolean forceUI;
-
 
185
    private static boolean submitErrorAuto = false;
165
 
186
 
166
    public static void setForceUI(boolean forceUI) {
187
    public static void setForceUI(boolean forceUI) {
167
        ExceptionHandler.forceUI = forceUI;
188
        ExceptionHandler.forceUI = forceUI;
168
    }
189
    }
169
 
190
 
170
    private Future<?> display(final boolean error) {
191
    private Future<Boolean> display() {
-
 
192
        final boolean error = this.quit;
171
        final String msg = this.getMessage();
193
        final String msg = this.getMessage();
172
        // write out the message as soon as possible
194
        // write out the message as soon as possible
173
        getLogger().log(error ? Level.SEVERE : Level.INFO, null, this);
195
        getLogger().log(error ? Level.SEVERE : Level.INFO, null, this);
174
        // then show it to the user
196
        // then show it to the user
175
        if (!GraphicsEnvironment.isHeadless() || forceUI) {
197
        if (!GraphicsEnvironment.isHeadless() || forceUI) {
-
 
198
            if (openedWindows.get() > 3) {
-
 
199
                return FALSE_FUTURE;
-
 
200
            }
-
 
201
            final FutureTask<Boolean> run = new FutureTask<>(() -> {
-
 
202
                return showMsgHardened(msg, error);
-
 
203
            });
176
            if (SwingUtilities.isEventDispatchThread()) {
204
            if (SwingUtilities.isEventDispatchThread()) {
177
                showMsgHardened(msg, error);
205
                run.run();
178
            } else {
206
            } else {
179
                final FutureTask<?> run = new FutureTask<Object>(new Runnable() {
-
 
180
                    public void run() {
-
 
181
                        showMsgHardened(msg, error);
-
 
182
                    }
-
 
183
                }, null);
-
 
184
                if (error) {
207
                if (error) {
185
                    try {
208
                    try {
186
                        SwingUtilities.invokeAndWait(run);
209
                        SwingUtilities.invokeAndWait(run);
187
                    } catch (Exception e) {
210
                    } catch (Exception e) {
188
                        e.printStackTrace();
211
                        e.printStackTrace();
189
                        System.exit(1);
212
                        System.exit(1);
190
                    }
213
                    }
191
                } else {
214
                } else {
192
                    SwingUtilities.invokeLater(run);
215
                    SwingUtilities.invokeLater(run);
193
                }
216
                }
194
                return run;
-
 
195
            }
-
 
196
        }
217
            }
197
        return null;
218
            return run;
198
    }
219
        }
199
 
-
 
200
    public final Future<?> getDialogFuture() {
-
 
201
        return this.future;
220
        return TRUE_FUTURE;
202
    }
221
    }
203
 
222
 
204
    protected final void showMsgHardened(final String msg, final boolean error) {
223
    protected final Boolean showMsgHardened(final String msg, final boolean error) {
205
        try {
224
        try {
206
            showMsg(msg, error);
225
            showMsg(msg, error);
-
 
226
            return Boolean.TRUE;
207
        } catch (Throwable e) {
227
        } catch (Throwable e) {
208
            // sometimes the VM cannot display the dialog, in that case don't crash the EDT as the
228
            // sometimes the VM cannot display the dialog, in that case don't crash the EDT as the
209
            // message has already been logged. Further if this class is used in
229
            // message has already been logged. Further if this class is used in
210
            // Thread.setDefaultUncaughtExceptionHandler(), it will create an infinite loop.
230
            // Thread.setDefaultUncaughtExceptionHandler(), it will create an infinite loop.
211
            e = new Exception("Couldn't display message", e);
231
            e = new Exception("Couldn't display message", e);
Line 215... Line 235...
215
                JOptionPane.showMessageDialog(null, e.getMessage() + " : " + msg);
235
                JOptionPane.showMessageDialog(null, e.getMessage() + " : " + msg);
216
            } catch (Throwable e2) {
236
            } catch (Throwable e2) {
217
                // nothing
237
                // nothing
218
            }
238
            }
219
        }
239
        }
-
 
240
        return Boolean.FALSE;
220
    }
241
    }
221
 
242
 
222
    protected final void showMsg(final String msg, final boolean quit) {
243
    protected final void showMsg(final String msg, final boolean quit) {
223
        final JPanel p = new JPanel();
244
        final JPanel p = new JPanel();
224
        p.setLayout(new GridBagLayout());
245
        p.setLayout(new GridBagLayout());
Line 318... Line 339...
318
            public void actionPerformed(ActionEvent e) {
339
            public void actionPerformed(ActionEvent e) {
319
                copyToClipboard(textArea.getText());
340
                copyToClipboard(textArea.getText());
320
            }
341
            }
321
        }));
342
        }));
322
 
343
 
323
        final javax.swing.Action submitAction = new AbstractAction("Soumettre l'erreur") {
-
 
324
            @Override
-
 
325
            public void actionPerformed(ActionEvent e) {
-
 
326
                submitError(p, textArea);
-
 
327
            }
-
 
328
 
-
 
329
            private void submitError(final JPanel p, final JTextComponent textArea) {
-
 
330
                final Charset cs = StringUtils.UTF8;
-
 
331
                try {
-
 
332
                    ProductInfo productInfo = ProductInfo.getInstance();
-
 
333
 
-
 
334
                    String name = "", version = "";
-
 
335
                    if (productInfo != null) {
-
 
336
                        name = productInfo.getName();
-
 
337
                        version = productInfo.getProperty(ProductInfo.VERSION, version);
-
 
338
                    }
-
 
339
 
-
 
340
                    final Map<Info, String> systemInfos = SystemInfo.get(false);
-
 
341
                    final String os = systemInfos.remove(Info.OS);
-
 
342
                    final String java = systemInfos.toString();
-
 
343
                    final String encodedData = "java=" + PercentEncoder.encode(java, cs) + "&os=" + PercentEncoder.encode(os, cs) + "&software=" + PercentEncoder.encode(name + version, cs) + "&stack="
-
 
344
                            + PercentEncoder.encode(computeSoftwareInformations() + "\n\n" + textArea.getText(), cs);
-
 
345
                    final String request = "http://bugreport.ilm-informatique.fr:5000/bugreport";
-
 
346
                    final URL url = new URL(request);
-
 
347
                    final HttpURLConnection connection = (HttpURLConnection) url.openConnection();
-
 
348
                    connection.setDoOutput(true);
-
 
349
                    connection.setRequestMethod("POST");
-
 
350
                    connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
-
 
351
                    connection.setRequestProperty("charset", cs.name());
-
 
352
                    final byte[] bytes = encodedData.getBytes(cs);
-
 
353
                    connection.setRequestProperty("Content-Length", String.valueOf(bytes.length));
-
 
354
 
-
 
355
                    final OutputStream outputStream = connection.getOutputStream();
-
 
356
                    outputStream.write(bytes);
-
 
357
                    outputStream.flush();
-
 
358
 
-
 
359
                    // Get the response
-
 
360
                    final StringBuilder answer = new StringBuilder();
-
 
361
                    BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));
-
 
362
                    String line;
-
 
363
                    while ((line = reader.readLine()) != null) {
-
 
364
                        answer.append(line);
-
 
365
                    }
-
 
366
                    outputStream.close();
-
 
367
                    reader.close();
-
 
368
                    connection.disconnect();
-
 
369
 
-
 
370
                    JOptionPane.showMessageDialog(p, "Merci d'avoir envoyé le rapport d'erreur au service technique.\nIl sera analysé prochainement.");
-
 
371
                } catch (Exception ex) {
-
 
372
                    ex.printStackTrace();
-
 
373
                }
-
 
374
            }
-
 
375
        };
-
 
376
 
-
 
377
        btnPanel.add(new JButton(submitAction));
-
 
378
 
-
 
379
        c.fill = GridBagConstraints.NONE;
344
        c.fill = GridBagConstraints.NONE;
380
        c.anchor = GridBagConstraints.EAST;
345
        c.anchor = GridBagConstraints.EAST;
381
        p.add(btnPanel, c);
346
        p.add(btnPanel, c);
382
 
347
 
383
        c.gridy++;
348
        c.gridy++;
Line 398... Line 363...
398
            message = msg;
363
            message = msg;
399
        } else {
364
        } else {
400
            message = msg + "\n\n" + message;
365
            message = msg + "\n\n" + message;
401
        }
366
        }
402
        message += "\n";
367
        message += "\n";
403
        message +=
368
        message += getTrace();
404
 
-
 
-
 
369
        if (submitErrorAuto) {
405
                getTrace();
370
            submitError(message);
-
 
371
        }
406
        textArea.setText(message);
372
        textArea.setText(message);
407
        textArea.setEditable(false);
373
        textArea.setEditable(false);
408
 
374
 
409
        // Scroll
375
        // Scroll
410
        JScrollPane scroll = new JScrollPane(textArea);
376
        JScrollPane scroll = new JScrollPane(textArea);
Line 418... Line 384...
418
 
384
 
419
        c.gridy++;
385
        c.gridy++;
420
        c.fill = GridBagConstraints.NONE;
386
        c.fill = GridBagConstraints.NONE;
421
        c.weighty = 0;
387
        c.weighty = 0;
422
        c.insets = new Insets(2, 4, 2, 4);
388
        c.insets = new Insets(2, 4, 2, 4);
-
 
389
        JPanel closePanel = new JPanel();
-
 
390
        closePanel.setLayout(new FlowLayout());
-
 
391
        if (safeToExit) {
-
 
392
            closePanel.add(new JButton(new AbstractAction("Quitter") {
-
 
393
 
-
 
394
                @Override
-
 
395
                public void actionPerformed(ActionEvent e) {
-
 
396
                    System.exit(2);
-
 
397
                }
-
 
398
            }));
-
 
399
        }
423
        final JButton buttonClose = new JButton("Fermer");
400
        final JButton buttonClose = new JButton("Fermer");
-
 
401
        closePanel.add(buttonClose);
-
 
402
 
424
        p.add(buttonClose, c);
403
        p.add(closePanel, c);
425
 
404
 
426
        final Window window = this.comp == null ? null : SwingUtilities.getWindowAncestor(this.comp);
405
        final Window window = this.comp == null ? null : SwingUtilities.getWindowAncestor(this.comp);
427
        final JDialog f;
406
        final JDialog f;
428
        if (window instanceof Frame) {
407
        if (window instanceof Frame) {
429
            f = new JDialog((Frame) window, "Erreur", true);
408
            f = new JDialog((Frame) window, "Erreur", true);
430
        } else {
409
        } else {
431
            f = new JDialog((Dialog) window, "Erreur", true);
410
            f = new JDialog((Dialog) window, "Erreur", true);
432
        }
411
        }
433
        f.setContentPane(p);
412
        f.setContentPane(p);
434
        f.pack();
413
        f.pack();
435
        f.setSize(580, 680);
414
        f.setSize(780, 580);
436
        f.setMinimumSize(new Dimension(380, 380));
415
        f.setMinimumSize(new Dimension(380, 380));
437
        f.setLocationRelativeTo(this.comp);
416
        f.setLocationRelativeTo(this.comp);
438
        final ActionListener al = new ActionListener() {
417
        final ActionListener al = new ActionListener() {
439
 
418
 
440
            @Override
419
            @Override
441
            public void actionPerformed(ActionEvent e) {
420
            public void actionPerformed(ActionEvent e) {
-
 
421
                openedWindows.decrementAndGet();
442
                if (quit) {
422
                if (quit) {
443
                    System.exit(1);
423
                    System.exit(1);
444
                } else {
424
                } else {
445
                    f.dispose();
425
                    f.dispose();
446
                }
426
                }
447
 
-
 
448
            }
427
            }
449
        };
428
        };
450
        buttonClose.addActionListener(al);
429
        buttonClose.addActionListener(al);
451
        // cannot set EXIT_ON_CLOSE on JDialog
430
        // cannot set EXIT_ON_CLOSE on JDialog
452
        f.addWindowListener(new WindowAdapter() {
431
        f.addWindowListener(new WindowAdapter() {
453
            @Override
432
            @Override
454
            public void windowClosing(WindowEvent e) {
433
            public void windowClosing(WindowEvent e) {
455
                al.actionPerformed(null);
434
                al.actionPerformed(null);
-
 
435
 
456
            }
436
            }
457
        });
437
        });
-
 
438
        openedWindows.incrementAndGet();
458
 
439
 
459
        f.setVisible(true);
440
        f.setVisible(true);
-
 
441
 
460
    }
442
    }
461
 
443
 
462
    private String getTrace() {
444
    private String getTrace() {
463
        return ExceptionUtils.getStackTrace(this);
445
        return ExceptionUtils.getStackTrace(this);
464
    }
446
    }
Line 483... Line 465...
483
     * @param quit if the VM must exit.
465
     * @param quit if the VM must exit.
484
     */
466
     */
485
    private ExceptionHandler(Component comp, String msg, Throwable cause, boolean quit) {
467
    private ExceptionHandler(Component comp, String msg, Throwable cause, boolean quit) {
486
        super(msg, cause);
468
        super(msg, cause);
487
        this.comp = comp;
469
        this.comp = comp;
488
        this.future = this.display(quit);
470
        this.quit = quit;
489
    }
471
    }
490
 
472
 
491
    public ExceptionHandler(String msg, Throwable cause) {
473
    private void submitError(String error) {
-
 
474
        final Charset cs = StringUtils.UTF8;
-
 
475
        try {
-
 
476
            ProductInfo productInfo = ProductInfo.getInstance();
-
 
477
 
-
 
478
            String name = "", version = "";
-
 
479
            if (productInfo != null) {
-
 
480
                name = productInfo.getName();
-
 
481
                version = productInfo.getProperty(ProductInfo.VERSION, version);
-
 
482
            }
-
 
483
 
-
 
484
            final Map<Info, String> systemInfos = SystemInfo.get(false);
-
 
485
            final String os = systemInfos.remove(Info.OS);
-
 
486
            final String java = systemInfos.toString();
-
 
487
            final String encodedData = "java=" + PercentEncoder.encode(java, cs) + "&os=" + PercentEncoder.encode(os, cs) + "&software=" + PercentEncoder.encode(name + version, cs) + "&stack="
-
 
488
                    + PercentEncoder.encode(computeSoftwareInformations() + "\n\n" + error, cs);
-
 
489
            Thread t = new Thread(new Runnable() {
-
 
490
 
-
 
491
                @Override
-
 
492
                public void run() {
-
 
493
                    final String request = "http://bugreport.ilm-informatique.fr:5000/bugreport";
492
        super(msg, cause);
494
                    try {
-
 
495
                        System.err.println("ExceptionHandler.submitError");
-
 
496
                        final URL url = new URL(request);
-
 
497
                        final HttpURLConnection connection = (HttpURLConnection) url.openConnection();
-
 
498
                        connection.setDoOutput(true);
-
 
499
                        connection.setRequestMethod("POST");
-
 
500
                        connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
-
 
501
                        connection.setRequestProperty("charset", cs.name());
-
 
502
                        final byte[] bytes = encodedData.getBytes(cs);
-
 
503
                        connection.setRequestProperty("Content-Length", String.valueOf(bytes.length));
-
 
504
 
-
 
505
                        final OutputStream outputStream = connection.getOutputStream();
-
 
506
                        outputStream.write(bytes);
-
 
507
                        outputStream.flush();
-
 
508
 
-
 
509
                        // Get the response
-
 
510
                        final StringBuilder answer = new StringBuilder();
-
 
511
                        BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));
-
 
512
                        String line;
-
 
513
                        while ((line = reader.readLine()) != null) {
-
 
514
                            answer.append(line);
493
        this.comp = null;
515
                        }
-
 
516
                        outputStream.close();
-
 
517
                        reader.close();
-
 
518
                        connection.disconnect();
-
 
519
                    } catch (Exception e) {
-
 
520
                        e.printStackTrace();
-
 
521
                    }
-
 
522
                }
-
 
523
            });
494
        this.future = null;
524
            t.start();
-
 
525
 
-
 
526
        } catch (Exception ex) {
-
 
527
            ex.printStackTrace();
-
 
528
        }
495
    }
529
    }
496
 
530
 
497
    public static void main(String[] args) throws Exception {
531
    public static void main(String[] args) throws Exception {
498
        UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
532
        UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
499
        ExceptionHandler.handle("Fichier de configuration corrompu\n\nmulti\nline", new IllegalStateException("Id manquant"));
533
        ExceptionHandler.handle("Fichier de configuration corrompu\n\nmulti\nline", new IllegalStateException("Id manquant"));
500
    }
534
    }
-
 
535
 
501
}
536
}