Skip to content

Commit 3d928fd

Browse files
Sopot Celavogella
authored andcommitted
Change string comparison from == to equals
1 parent c8068d2 commit 3d928fd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

de.vogella.xml.stax.reader/src/de/vogella/xml/stax/read/StaXParser.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public List<Item> readConfig(String configFile) {
4343
if (event.isStartElement()) {
4444
StartElement startElement = event.asStartElement();
4545
// If we have a item element we create a new item
46-
if (startElement.getName().getLocalPart() == (ITEM)) {
46+
if (startElement.getName().getLocalPart().equals(ITEM)) {
4747
item = new Item();
4848
// We read the attributes from this tag and add the date
4949
// attribute to our object
@@ -90,7 +90,7 @@ public List<Item> readConfig(String configFile) {
9090
// If we reach the end of an item element we add it to the list
9191
if (event.isEndElement()) {
9292
EndElement endElement = event.asEndElement();
93-
if (endElement.getName().getLocalPart() == (ITEM)) {
93+
if (endElement.getName().getLocalPart().equals(ITEM)) {
9494
items.add(item);
9595
}
9696
}

0 commit comments

Comments
 (0)