Compare string objects with .equals method rather than ==

Change-Id: I6dfcd9e84e3d3519a34f27b2f24196359717b72e
This commit is contained in:
David Pursehouse
2013-08-23 14:57:06 +09:00
parent 7fe140e744
commit e850ef5271
3 changed files with 3 additions and 3 deletions

View File

@@ -306,7 +306,7 @@ public class PublishCommentScreen extends AccountScreen implements
if (lastState != null && patchSetId.equals(lastState.patchSetId)
&& lastState.approvals.containsKey(label.name())) {
b.setValue(lastState.approvals.get(label.name()) == value);
b.setValue(lastState.approvals.get(label.name()).equals(value));
} else {
b.setValue(b.parseValue() == (prior != null ? prior : 0));
}

View File

@@ -108,7 +108,7 @@ public abstract class Screen extends View {
headerText.setText(text);
header.setVisible(true);
}
if (windowTitle == null || windowTitle == old) {
if (windowTitle == null || windowTitle.equals(old)) {
setWindowTitle(text);
}
}

View File

@@ -96,7 +96,7 @@ public class Section {
final boolean nullIfDefault) {
final String ov = get(name);
String nv = ui.readString(ov != null ? ov : dv, "%s", title);
if (nullIfDefault && nv == dv) {
if (nullIfDefault && nv.equals(dv)) {
nv = null;
}
if (!eq(ov, nv)) {