Fix 'illegal format conversion' compilation error
Using '%d' to format `Change.Id` objects causes a compilation error.
Log the underlying change number instead.
Bug: Issue 15833
Change-Id: I14505a96f8952faad041afb027b0bc5a3e29c431
diff --git a/src/main/java/com/googlesource/gerrit/modules/gitrefsfilter/ChangesTsCache.java b/src/main/java/com/googlesource/gerrit/modules/gitrefsfilter/ChangesTsCache.java
index c371985..79a7fb4 100644
--- a/src/main/java/com/googlesource/gerrit/modules/gitrefsfilter/ChangesTsCache.java
+++ b/src/main/java/com/googlesource/gerrit/modules/gitrefsfilter/ChangesTsCache.java
@@ -56,7 +56,7 @@
.toEpochMilli();
} catch (NoSuchChangeException e) {
logger.atFine().withCause(e).log(
- "Change %d does not exist: returning zero epoch", key.changeId());
+ "Change %d does not exist: returning zero epoch", key.changeId().get());
return 0L;
}
}
diff --git a/src/main/java/com/googlesource/gerrit/modules/gitrefsfilter/ForProjectWrapper.java b/src/main/java/com/googlesource/gerrit/modules/gitrefsfilter/ForProjectWrapper.java
index 5347f2d..58a80b1 100644
--- a/src/main/java/com/googlesource/gerrit/modules/gitrefsfilter/ForProjectWrapper.java
+++ b/src/main/java/com/googlesource/gerrit/modules/gitrefsfilter/ForProjectWrapper.java
@@ -137,7 +137,7 @@
} catch (ExecutionException e) {
logger.atWarning().withCause(e).log(
"Error getting change '%d' from the cache. Do not hide from the advertised refs",
- changeId);
+ changeId.get());
return true;
}
}
@@ -155,7 +155,7 @@
} catch (ExecutionException e) {
logger.atWarning().withCause(e).log(
"Error getting change '%d' from the cache. Do not hide from the advertised refs",
- changeId);
+ changeId.get());
return true;
}
}
diff --git a/src/main/java/com/googlesource/gerrit/modules/gitrefsfilter/OpenChangesCache.java b/src/main/java/com/googlesource/gerrit/modules/gitrefsfilter/OpenChangesCache.java
index 8e1c371..73066d8 100644
--- a/src/main/java/com/googlesource/gerrit/modules/gitrefsfilter/OpenChangesCache.java
+++ b/src/main/java/com/googlesource/gerrit/modules/gitrefsfilter/OpenChangesCache.java
@@ -55,7 +55,7 @@
return changeNotes.getChange().getStatus().isOpen();
} catch (NoSuchChangeException e) {
logger.atFine().withCause(e).log(
- "Change %d does not exist: hiding from the advertised refs", key.changeId());
+ "Change %d does not exist: hiding from the advertised refs", key.changeId().get());
return false;
}
}