gt:             if (conditionString.equals(condition.getName())) {
context: package games.strategy.triplea.ui;
  
  import com.google.common.base.Splitter;
  import com.google.common.collect.Iterables;
  import games.strategy.engine.data.Change;
  import games.strategy.engine.data.GameData;
  import games.strategy.engine.data.GamePlayer;
  import games.strategy.engine.data.events.GameDataChangeListener;
  import games.strategy.engine.delegate.IDelegateBridge;
  import games.strategy.triplea.attachments.AbstractConditionsAttachment;
  import games.strategy.triplea.attachments.AbstractPlayerRulesAttachment;
  import games.strategy.triplea.attachments.AbstractTriggerAttachment;
  import games.strategy.triplea.attachments.ICondition;
  import games.strategy.triplea.attachments.RulesAttachment;
  import games.strategy.triplea.attachments.TriggerAttachment;
  import java.awt.Color;
  import java.awt.Component;
  import java.time.Instant;
  import java.util.Enumeration;
  import java.util.HashMap;
  import java.util.HashSet;
  import java.util.Iterator;
  import java.util.LinkedHashMap;
  import java.util.List;
  import java.util.Map;
  import java.util.Map.Entry;
  import java.util.Set;
  import java.util.TreeSet;
  import javax.swing.BorderFactory;
  import javax.swing.Box;
  import javax.swing.BoxLayout;
  import javax.swing.DefaultCellEditor;
  import javax.swing.JButton;
  import javax.swing.JEditorPane;
  import javax.swing.JLabel;
  import javax.swing.JScrollPane;
  import javax.swing.JTable;
  import javax.swing.JTextField;
  import javax.swing.SwingConstants;
  import javax.swing.SwingUtilities;
  import javax.swing.table.AbstractTableModel;
  import javax.swing.table.DefaultTableCellRenderer;
  import javax.swing.table.TableCellRenderer;
  import javax.swing.table.TableColumn;
  import javax.swing.table.TableColumnModel;
  import lombok.extern.slf4j.Slf4j;
  import org.triplea.swing.SwingAction;
  import org.triplea.util.FileNameUtils;
  
  /**
   * A panel that will show all objectives for all players, including if the objective is filled or
   * not.
   */
  @Slf4j
  public class ObjectivePanel extends AbstractStatPanel {
    private static final long serialVersionUID = 3759819236905645520L;
    private Map<String, Map<ICondition, String>> statsObjective;
    private ObjectiveTableModel objectiveModel;
    private IDelegateBridge dummyDelegate;
  
    ObjectivePanel(final GameData data) {
      super(data);
      dummyDelegate = new ObjectiveDummyDelegateBridge(data);
      initLayout();
    }
  
    @Override
    public String getName() {
      return ObjectiveProperties.getInstance().getName();
    }
  
    public boolean isEmpty() {
      return statsObjective.isEmpty();
    }
  
    public void removeDataChangeListener() {
      objectiveModel.removeDataChangeListener();
    }
  
    protected void initLayout() {
      setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
      objectiveModel = new ObjectiveTableModel();
      final JTable table = new JTable(objectiveModel);
      table.getTableHeader().setReorderingAllowed(false);
      final TableColumn column0 = table.getColumnModel().getColumn(0);
      column0.setPreferredWidth(34);
      column0.setWidth(34);
      column0.setMaxWidth(34);
      column0.setCellRenderer(new ColorTableCellRenderer());
      final TableColumn column1 = table.getColumnModel().getColumn(1);
      column1.setCellEditor(new EditorPaneCellEditor());
      column1.setCellRenderer(new EditorPaneTableCellRenderer());
      final JScrollPane scroll = new JScrollPane(table);
      final JButton refresh = new JButton("Refresh Objectives");
      refresh.setAlignmentY(Component.CENTER_ALIGNMENT);
      refresh.addActionListener(
          SwingAction.of(
              "Refresh Objectives",
              e -> {
                objectiveModel.loadData();
                SwingUtilities.invokeLater(table::repaint);
              }));
      add(Box.createVerticalStrut(6));
      add(refresh);
      add(Box.createVerticalStrut(6));
      add(scroll);
    }
  
    class ObjectiveTableModel extends AbstractTableModel implements GameDataChangeListener {
      private static final long serialVersionUID = 2259315408905271333L;
      private static final int COLUMNS_TOTAL = 2;
      private boolean isDirty = true;
      private String[][] collectedData;
      private final Map<String, List<String>> sections = new LinkedHashMap<>();
      private Instant timestamp = Instant.EPOCH;
  
      ObjectiveTableModel() {
        setObjectiveStats();
        gameData.addDataChangeListener(this);
      }
  
      public void removeDataChangeListener() {
        gameData.removeDataChangeListener(this);
      }
  
      private void setObjectiveStats() {
        statsObjective = new LinkedHashMap<>();
        final ObjectiveProperties op = ObjectiveProperties.getInstance();
        final String gameName =
            FileNameUtils.replaceIllegalCharacters(gameData.getGameName(), '_')
                .replaceAll(" ", "_")
                .concat(".");
        final Map<String, List<String>> sectionsUnsorted = new HashMap<>();
        final Set<String> sectionsSorters = new TreeSet<>();
        // do sections first
        for (final Entry<Object, Object> entry : op.entrySet()) {
          final String fileKey = (String) entry.getKey();
          if (!fileKey.startsWith(gameName)) {
            continue;
          }
          final List<String> key = Splitter.on(';').splitToList(fileKey.substring(gameName.length()));
          final String value = (String) entry.getValue();
          if (key.size() != 2) {
            log.error(
                "objective.properties keys must be 2 parts: <game_name>."
                    + ObjectiveProperties.GROUP_PROPERTY
                    + ".<#>;player  OR  <game_name>.player;attachmentName");
            continue;
          }
          if (!key.get(0).startsWith(ObjectiveProperties.GROUP_PROPERTY)) {
            continue;
          }
          final List<String> sorter = Splitter.on('.').splitToList(key.get(0));
          if (sorter.size() != 2) {
            log.error(
                "objective.properties "
                    + ObjectiveProperties.GROUP_PROPERTY
                    + "must have .<sorter> after it: "
                    + key.get(0));
            continue;
          }
          sectionsSorters.add(sorter.get(1) + ";" + key.get(1));
          sectionsUnsorted.put(key.get(1), List.of(value.split(";")));
        }
        final Map<String, Map<ICondition, String>> statsObjectiveUnsorted = new HashMap<>();
        for (final String section : sectionsSorters) {
          final String key = Iterables.get(Splitter.on(';').split(section), 1);
          sections.put(key, sectionsUnsorted.get(key));
          statsObjective.put(key, new LinkedHashMap<>());
          statsObjectiveUnsorted.put(key, new HashMap<>());
        }
        // now do the stuff in the sections
        for (final Entry<Object, Object> entry : op.entrySet()) {
          final String fileKey = (String) entry.getKey();
          if (!fileKey.startsWith(gameName)) {
            continue;
          }
          final List<String> key = Splitter.on(';').splitToList(fileKey.substring(gameName.length()));
          final String value = (String) entry.getValue();
          if (key.size() != 2) {
            log.error(
                "objective.properties keys must be 2 parts: <game_name>."
                    + ObjectiveProperties.GROUP_PROPERTY
                    + ".<#>;player  OR  <game_name>.player;attachmentName");
            continue;
          }
          if (key.get(0).startsWith(ObjectiveProperties.GROUP_PROPERTY)) {
            continue;
          }
          final ICondition condition =
              AbstractPlayerRulesAttachment.getCondition(key.get(0), key.get(1), gameData);
          if (condition == null) {
            continue;
          }
          final GamePlayer player = gameData.getPlayerList().getPlayerId(key.get(0));
  
          // find which section
          boolean found = false;
          if (sections.containsKey(player.getName())
              && sections.get(player.getName()).contains(key.get(1))) {
            final Map<ICondition, String> map = statsObjectiveUnsorted.get(player.getName());
            if (map == null) {
              throw new IllegalStateException(
                  "objective.properties group has nothing: " + player.getName());
            }
            map.put(condition, value);
            statsObjectiveUnsorted.put(player.getName(), map);
            found = true;
          }
          if (!found) {
            for (final Entry<String, List<String>> sectionEntry : sections.entrySet()) {
              if (sectionEntry.getValue().contains(key.get(1))) {
                final Map<ICondition, String> map = statsObjectiveUnsorted.get(sectionEntry.getKey());
                if (map == null) {
                  throw new IllegalStateException(
                      "objective.properties group has nothing: " + sectionEntry.getKey());
                }
                map.put(condition, value);
                statsObjectiveUnsorted.put(sectionEntry.getKey(), map);
                break;
              }
            }
          }
        }
        for (final Entry<String, Map<ICondition, String>> entry : statsObjective.entrySet()) {
          final Map<ICondition, String> mapUnsorted = statsObjectiveUnsorted.get(entry.getKey());
          final Map<ICondition, String> mapSorted = entry.getValue();
          for (final String conditionString : sections.get(entry.getKey())) {
            final Iterator<ICondition> conditionIter = mapUnsorted.keySet().iterator();
            while (conditionIter.hasNext()) {
              final ICondition condition = conditionIter.next();
  