Changeset 14380 in josm for trunk/src/org


Ignore:
Timestamp:
2018-10-28T20:30:47+01:00 (6 years ago)
Author:
Don-vip
Message:

fix #16906 - RelationEditorActionsTest: fix for non-headless mode (patch by ris)

Location:
trunk/src/org/openstreetmap/josm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/ConditionalOptionPaneUtil.java

    r14052 r14380  
    55
    66import java.awt.Component;
    7 import java.awt.GraphicsEnvironment;
    87import java.awt.GridBagLayout;
    98import java.util.HashMap;
     
    116115     * @return the option selected by user.
    117116     *         {@link JOptionPane#CLOSED_OPTION} if the dialog was closed.
    118      *         {@link JOptionPane#YES_OPTION} if <code>GraphicsEnvironment.isHeadless</code> returns <code>true</code>
    119117     */
    120118    public static int showOptionDialog(String preferenceKey, Component parent, Object message, String title, int optionType,
     
    124122            return ret;
    125123        MessagePanel pnl = new MessagePanel(message, isInBulkOperation(preferenceKey));
    126         if (GraphicsEnvironment.isHeadless()) {
    127             // for unit tests
    128             ret = JOptionPane.YES_OPTION;
    129         } else {
    130             ret = JOptionPane.showOptionDialog(parent, pnl, title, optionType, messageType, null, options, defaultOption);
    131         }
     124        ret = JOptionPane.showOptionDialog(parent, pnl, title, optionType, messageType, null, options, defaultOption);
    132125        if (isYesOrNo(ret)) {
    133126            pnl.getNotShowAgain().store(preferenceKey, ret);
     
    162155     *
    163156     * @return true, if the selected option is equal to <code>trueOption</code>, otherwise false.
    164      *         {@code trueOption} if <code>GraphicsEnvironment.isHeadless</code> returns <code>true</code>
    165157     *
    166158     * @see JOptionPane#INFORMATION_MESSAGE
     
    174166            return ret == trueOption;
    175167        MessagePanel pnl = new MessagePanel(message, isInBulkOperation(preferenceKey));
    176         if (GraphicsEnvironment.isHeadless()) {
    177             // for unit tests
    178             ret = trueOption;
    179         } else {
    180             ret = JOptionPane.showConfirmDialog(parent, pnl, title, optionType, messageType);
    181         }
     168        ret = JOptionPane.showConfirmDialog(parent, pnl, title, optionType, messageType);
    182169        if (isYesOrNo(ret)) {
    183170            pnl.getNotShowAgain().store(preferenceKey, ret);
  • trunk/src/org/openstreetmap/josm/tools/bugreport/ReportedException.java

    r14095 r14380  
    4949    private String methodWarningFrom;
    5050
    51     ReportedException(Throwable exception) {
     51    /**
     52     * Constructs a new {@code ReportedException}.
     53     * @param exception the cause (which is saved for later retrieval by the {@link #getCause()} method)
     54     * @since 14380
     55     */
     56    public ReportedException(Throwable exception) {
    5257        this(exception, Thread.currentThread());
    5358    }
    5459
    55     ReportedException(Throwable exception, Thread caughtOnThread) {
     60    /**
     61     * Constructs a new {@code ReportedException}.
     62     * @param exception the cause (which is saved for later retrieval by the {@link #getCause()} method)
     63     * @param caughtOnThread thread where the exception was caugth
     64     * @since 14380
     65     */
     66    public ReportedException(Throwable exception, Thread caughtOnThread) {
    5667        super(exception);
    5768
Note: See TracChangeset for help on using the changeset viewer.