Index: trunk/src/org/openstreetmap/josm/data/osm/Changeset.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/Changeset.java (revision 12493)
+++ trunk/src/org/openstreetmap/josm/data/osm/Changeset.java (revision 12494)
@@ -10,4 +10,5 @@
import java.util.Map;
import java.util.Objects;
+import java.util.Optional;
import org.openstreetmap.josm.data.Bounds;
@@ -264,6 +265,15 @@
/**
- * Replies the number of comments for this changeset.
- * @return the number of comments for this changeset
+ * Replies this changeset comment.
+ * @return this changeset comment (empty string if missing)
+ * @since 12494
+ */
+ public String getComment() {
+ return Optional.ofNullable(get("comment")).orElse("");
+ }
+
+ /**
+ * Replies the number of comments for this changeset discussion.
+ * @return the number of comments for this changeset discussion
* @since 7700
*/
@@ -273,6 +283,6 @@
/**
- * Sets the number of comments for this changeset.
- * @param commentsCount the number of comments for this changeset
+ * Sets the number of comments for this changeset discussion.
+ * @param commentsCount the number of comments for this changeset discussion
* @since 7700
*/
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetCacheTableCellRenderer.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetCacheTableCellRenderer.java (revision 12493)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetCacheTableCellRenderer.java (revision 12494)
@@ -19,6 +19,6 @@
protected void renderUploadComment(Changeset cs) {
- String comment = cs.get("comment");
- if (comment == null || comment.trim().isEmpty()) {
+ String comment = cs.getComment();
+ if (comment.trim().isEmpty()) {
setText(trc("changeset.upload-comment", "empty"));
setFont(UIManager.getFont("Table.font").deriveFont(Font.ITALIC));
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetDetailPanel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetDetailPanel.java (revision 12493)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetDetailPanel.java (revision 12494)
@@ -221,6 +221,5 @@
if (cs == null) return;
tfID.setText(Integer.toString(cs.getId()));
- String comment = cs.get("comment");
- taComment.setText(comment == null ? "" : comment);
+ taComment.setText(cs.getComment());
if (cs.isOpen()) {
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetListCellRenderer.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetListCellRenderer.java (revision 12493)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetListCellRenderer.java (revision 12494)
@@ -42,9 +42,9 @@
sb.append(tr("{0} [incomplete]", cs.getId()));
} else {
- String comment = cs.get("comment");
+ String comment = cs.getComment();
sb.append(cs.getId())
.append(" - ")
.append(cs.isOpen() ? tr("open") : tr("closed"));
- if (comment != null) {
+ if (!comment.isEmpty()) {
sb.append(" - '").append(comment).append('\'');
}
Index: trunk/src/org/openstreetmap/josm/gui/io/ChangesetCellRenderer.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/io/ChangesetCellRenderer.java (revision 12493)
+++ trunk/src/org/openstreetmap/josm/gui/io/ChangesetCellRenderer.java (revision 12494)
@@ -43,6 +43,6 @@
DateUtils.formatDateTime(createdDate, DateFormat.SHORT, DateFormat.SHORT)).append("
");
}
- String comment = cs.get("comment");
- if (comment != null) {
+ String comment = cs.getComment();
+ if (!comment.isEmpty()) {
sb.append("").append(tr("Changeset comment:")).append("")
.append(Utils.escapeReservedCharactersHTML(comment)).append("
");
@@ -64,6 +64,6 @@
setIcon(icon);
StringBuilder sb = new StringBuilder();
- String comment = cs.get("comment");
- if (comment != null) {
+ String comment = cs.getComment();
+ if (!comment.isEmpty()) {
sb.append(cs.getId()).append(" - ").append(comment);
} else if (cs.get("name") != null) {
Index: trunk/src/org/openstreetmap/josm/gui/io/UploadParameterSummaryPanel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/io/UploadParameterSummaryPanel.java (revision 12493)
+++ trunk/src/org/openstreetmap/josm/gui/io/UploadParameterSummaryPanel.java (revision 12494)
@@ -8,5 +8,4 @@
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
-import java.util.Optional;
import javax.swing.BorderFactory;
@@ -52,5 +51,5 @@
msg.append(tr("Objects are uploaded to the open changeset {0} with upload comment ''{1}''.",
selectedChangeset.getId(),
- Optional.ofNullable(selectedChangeset.get("comment")).orElse("")
+ selectedChangeset.getComment()
));
}