Merge "Fix Java coding style warnings."
diff --git a/src/main/java/com/googlesource/gerrit/plugins/findowners/Action.java b/src/main/java/com/googlesource/gerrit/plugins/findowners/Action.java
index c7c4b7a..0821082 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/findowners/Action.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/findowners/Action.java
@@ -176,7 +176,7 @@
Collection<String> changedFiles = changeData.currentFilePaths();
Map<String, Set<String>> file2Owners = db.findOwners(changedFiles);
- Boolean addDebugMsg = (params.debug != null) ? params.debug : config.getAddDebugMsg();
+ boolean addDebugMsg = (params.debug != null) ? params.debug : config.getAddDebugMsg();
RestResult obj = new RestResult(config, projectState, changeData, addDebugMsg);
obj.patchset = patchset;
obj.ownerRevision = db.revision;
diff --git a/src/main/java/com/googlesource/gerrit/plugins/findowners/OwnerWeights.java b/src/main/java/com/googlesource/gerrit/plugins/findowners/OwnerWeights.java
index 6755eb3..9437fc0 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/findowners/OwnerWeights.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/findowners/OwnerWeights.java
@@ -79,8 +79,7 @@
void addFile(String path, int level) {
// If a file is added multiple times,
// it should be added with lowest level first.
- if (!files.contains(path)) {
- files.add(path);
+ if (files.add(path)) {
if (level <= 1) {
countL1++;
} else if (level <= 2) {
diff --git a/src/main/java/com/googlesource/gerrit/plugins/findowners/OwnersDb.java b/src/main/java/com/googlesource/gerrit/plugins/findowners/OwnersDb.java
index 34e9c1e..14869df 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/findowners/OwnersDb.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/findowners/OwnersDb.java
@@ -372,7 +372,7 @@
Set<String> patterns = dir2Globs.get(dirPath + "/");
for (String pat : patterns) {
PathMatcher matcher = fileSystem.getPathMatcher("glob:" + pat);
- if (matcher.matches(Paths.get(dirPath + "/" + baseName))) {
+ if (matcher.matches(Paths.get(dirPath, baseName))) {
foundStar |= findStarOwner(pat, distance, paths, distances);
foundNoParentGlob |= noParentGlobs.contains(pat);
// Do not break here, a file could match multiple globs