Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fix: Fixed the wrong comparison of two strings

In the "lookUp" method of the "Feed" class, two id's (String values) are compared by the "==" operator. This checks if the two String objects are the same objects, not if they have the same value. (needed to use ".equals" instead)
  • Loading branch information...
commit 3fe7a55944645699b3ce975f4856ed624a6d78d6 1 parent 9d3791e
Frederick Gaens authored May 03, 2012
2  src/main/java/com/pachube/jpachube/Feed.java
@@ -195,7 +195,7 @@ public String getGraph(String id, int width, int height, Color c){
195 195
 	 */
196 196
 	private Data lookup(String id) {
197 197
 		for (int i = 0; i < this.data.size(); i++) {
198  
-			if (this.data.get(i).getId() == id) {
  198
+			if (this.data.get(i).getId().equals(id)) {
199 199
 				return this.data.get(i);
200 200
 			}
201 201
 		}

0 notes on commit 3fe7a55

Please sign in to comment.
Something went wrong with that request. Please try again.