StalenessChecker: URLDecode project name before checking staleness
When change is retrieved from the Lucene index, the project name is URLEncoded and needs to be decoded before checking if the refs are stale or not. Failing to decode the project name would result in an infinite loop trying to check for project staleness. Bug: Issue 9482 Change-Id: I422d3ecde1fa12d38ed508bed6982aef71c2330e
This commit is contained in:
		 Luca Milanesio
					Luca Milanesio
				
			
				
					committed by
					
						 David Pursehouse
						David Pursehouse
					
				
			
			
				
	
			
			
			 David Pursehouse
						David Pursehouse
					
				
			
						parent
						
							aa21c11f2a
						
					
				
				
					commit
					3f8a1b72ec
				
			| @@ -28,6 +28,7 @@ import com.google.common.collect.MultimapBuilder; | ||||
| import com.google.common.collect.SetMultimap; | ||||
| import com.google.common.collect.Sets; | ||||
| import com.google.gerrit.common.Nullable; | ||||
| import com.google.gerrit.extensions.restapi.Url; | ||||
| import com.google.gerrit.reviewdb.client.Change; | ||||
| import com.google.gerrit.reviewdb.client.Project; | ||||
| import com.google.gerrit.reviewdb.server.ReviewDb; | ||||
| @@ -181,7 +182,8 @@ public class StalenessChecker { | ||||
|       String s = new String(b, UTF_8); | ||||
|       List<String> parts = Splitter.on(':').splitToList(s); | ||||
|       RefStatePattern.check(parts.size() == 2, s); | ||||
|       result.put(new Project.NameKey(parts.get(0)), RefStatePattern.create(parts.get(1))); | ||||
|       result.put( | ||||
|           new Project.NameKey(Url.decode(parts.get(0))), RefStatePattern.create(parts.get(1))); | ||||
|     } | ||||
|     return result; | ||||
|   } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user