refactor: final var
This commit is contained in:
parent
83bc00aebe
commit
153d666b78
2 changed files with 7 additions and 4 deletions
|
@ -24,13 +24,13 @@ public class RandomNameFetcher {
|
|||
try (BufferedReader reader = new BufferedReader(new InputStreamReader(resource))) {
|
||||
String line;
|
||||
while ((line = reader.readLine()) != null) {
|
||||
String[] values = line.split("\n");
|
||||
final String[] values = line.split("\n");
|
||||
records.add(Arrays.asList(values));
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
return records.get(new Random().nextInt(records.size() -1)).get(0);
|
||||
return records.get(new Random().nextInt(records.size() - 1)).get(0);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue