Consistently use character encoding constants
Use the java.nio.charset.StandardCharsets.{ISO_8859_1,UTF_8} constants'
name() methods instead of hard-coding the strings.
Where possible, use method variants that take a Charset rather than
a String. This removes the need to catch UnsupportedEncodingException
in some cases.
Change-Id: I4ac1ba0a753de715e1f38ce631842f527b9e127c
			
			
This commit is contained in:
		| @@ -14,6 +14,8 @@ | ||||
|  | ||||
| package com.google.gerrit.common; | ||||
|  | ||||
| import static java.nio.charset.StandardCharsets.UTF_8; | ||||
|  | ||||
| import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | ||||
|  | ||||
| @@ -39,7 +41,7 @@ public class Version { | ||||
|       if (in == null) { | ||||
|         return "(dev)"; | ||||
|       } | ||||
|       try (BufferedReader r = new BufferedReader(new InputStreamReader(in, "UTF-8"))) { | ||||
|       try (BufferedReader r = new BufferedReader(new InputStreamReader(in, UTF_8))) { | ||||
|         String vs = r.readLine(); | ||||
|         if (vs != null && vs.startsWith("v")) { | ||||
|           vs = vs.substring(1); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 David Pursehouse
					David Pursehouse