Merge branch 'stable-2.14' into stable-2.15

* stable-2.14:
  Remove unused elasticsearch library from WORKSPACE
  Use Logger's built-in formatting

Change-Id: I2d3dca1036a1a1a1a6e00331cab31c244bd78bc6
This commit is contained in:
David Pursehouse
2018-05-30 08:53:05 +09:00
39 changed files with 103 additions and 126 deletions

View File

@@ -650,12 +650,6 @@ maven_jar(
# Test-only dependencies below. # Test-only dependencies below.
maven_jar(
name = "elasticsearch",
artifact = "org.elasticsearch:elasticsearch:2.4.4",
sha1 = "e69930bc794c539d34778e665d6f8ccbffd42c6f",
)
maven_jar( maven_jar(
name = "jimfs", name = "jimfs",
artifact = "com.google.jimfs:jimfs:1.1", artifact = "com.google.jimfs:jimfs:1.1",

View File

@@ -101,15 +101,15 @@ class H2CacheFactory implements PersistentCacheFactory, LifecycleListener {
try { try {
Files.createDirectories(loc); Files.createDirectories(loc);
} catch (IOException e) { } catch (IOException e) {
log.warn("Can't create disk cache: " + loc.toAbsolutePath()); log.warn("Can't create disk cache: {}", loc.toAbsolutePath());
return null; return null;
} }
} }
if (!Files.isWritable(loc)) { if (!Files.isWritable(loc)) {
log.warn("Can't write to disk cache: " + loc.toAbsolutePath()); log.warn("Can't write to disk cache: {}", loc.toAbsolutePath());
return null; return null;
} }
log.info("Enabling disk cache " + loc.toAbsolutePath()); log.info("Enabling disk cache {}", loc.toAbsolutePath());
return loc; return loc;
} }
@@ -134,7 +134,7 @@ class H2CacheFactory implements PersistentCacheFactory, LifecycleListener {
List<Runnable> pending = executor.shutdownNow(); List<Runnable> pending = executor.shutdownNow();
if (executor.awaitTermination(15, TimeUnit.MINUTES)) { if (executor.awaitTermination(15, TimeUnit.MINUTES)) {
if (pending != null && !pending.isEmpty()) { if (pending != null && !pending.isEmpty()) {
log.info(String.format("Finishing %d disk cache updates", pending.size())); log.info("Finishing {} disk cache updates", pending.size());
for (Runnable update : pending) { for (Runnable update : pending) {
update.run(); update.run();
} }

View File

@@ -70,9 +70,9 @@ public class WebSessionManager {
SECONDS)); SECONDS));
if (sessionMaxAgeMillis < MINUTES.toMillis(5)) { if (sessionMaxAgeMillis < MINUTES.toMillis(5)) {
log.warn( log.warn(
String.format( "cache.{}.maxAge is set to {} milliseconds; it should be at least 5 minutes.",
"cache.%s.maxAge is set to %d milliseconds; it should be at least 5 minutes.", CACHE_NAME,
CACHE_NAME, sessionMaxAgeMillis)); sessionMaxAgeMillis);
} }
} }

View File

@@ -53,8 +53,7 @@ public class WarDistribution implements PluginsDistribution {
try (InputStream in = zf.getInputStream(ze)) { try (InputStream in = zf.getInputStream(ze)) {
processor.process(pluginName, in); processor.process(pluginName, in);
} catch (IOException ioe) { } catch (IOException ioe) {
log.error( log.error("Error opening plugin {}: {}", ze.getName(), ioe.getMessage());
String.format("Error opening plugin %s: %s", ze.getName(), ioe.getMessage()));
} }
} }
} }

View File

@@ -266,9 +266,9 @@ public class ApprovalsUtil {
return permissionBackend.user(user).change(notes).database(db).test(ChangePermission.READ); return permissionBackend.user(user).change(notes).database(db).test(ChangePermission.READ);
} catch (PermissionBackendException e) { } catch (PermissionBackendException e) {
log.warn( log.warn(
String.format( "Failed to check if account {} can see change {}",
"Failed to check if account %d can see change %d", accountId.get(),
accountId.get(), notes.getChangeId().get()), notes.getChangeId().get(),
e); e);
return false; return false;
} }

View File

@@ -304,9 +304,9 @@ public class StarredChangesUtil {
return ref != null ? ref.getObjectId() : ObjectId.zeroId(); return ref != null ? ref.getObjectId() : ObjectId.zeroId();
} catch (IOException e) { } catch (IOException e) {
log.error( log.error(
String.format( "Getting star object ID for account {} on change {} failed",
"Getting star object ID for account %d on change %d failed", accountId.get(),
accountId.get(), changeId.get()), changeId.get(),
e); e);
return ObjectId.zeroId(); return ObjectId.zeroId();
} }

View File

@@ -67,9 +67,7 @@ public class AccountDeactivator implements Runnable {
if (delay == MISSING_CONFIG && interval == MISSING_CONFIG) { if (delay == MISSING_CONFIG && interval == MISSING_CONFIG) {
log.info("Ignoring missing accountDeactivator schedule configuration"); log.info("Ignoring missing accountDeactivator schedule configuration");
} else if (delay < 0 || interval <= 0) { } else if (delay < 0 || interval <= 0) {
log.warn( log.warn("Ignoring invalid accountDeactivator schedule configuration: {}", scheduleConfig);
String.format(
"Ignoring invalid accountDeactivator schedule configuration: %s", scheduleConfig));
} else { } else {
queue queue
.getDefaultQueue() .getDefaultQueue()

View File

@@ -94,8 +94,7 @@ public class AccountState {
try { try {
return HashedPassword.decode(hashedStr).checkPassword(password); return HashedPassword.decode(hashedStr).checkPassword(password);
} catch (DecoderException e) { } catch (DecoderException e) {
logger.error( logger.error("DecoderException for user {}: {}", username, e.getMessage());
String.format("DecoderException for user %s: %s ", username, e.getMessage()));
return false; return false;
} }
} }

View File

@@ -86,7 +86,7 @@ public class Accounts {
try { try {
accounts.add(read(repo, accountId)); accounts.add(read(repo, accountId));
} catch (Exception e) { } catch (Exception e) {
log.error(String.format("Ignoring invalid account %s", accountId.get()), e); log.error("Ignoring invalid account {}", accountId.get(), e);
} }
} }
} }

View File

@@ -112,7 +112,7 @@ public class GroupIncludeCacheImpl implements GroupIncludeCache {
try { try {
return groupsWithMember.get(memberId); return groupsWithMember.get(memberId);
} catch (ExecutionException e) { } catch (ExecutionException e) {
log.warn(String.format("Cannot load groups containing %d as member", memberId.get())); log.warn("Cannot load groups containing {} as member", memberId.get());
return ImmutableSet.of(); return ImmutableSet.of();
} }
} }

View File

@@ -140,7 +140,7 @@ public class ExternalIdReader {
try { try {
extIds.add(ExternalId.parse(note.getName(), raw, note.getData())); extIds.add(ExternalId.parse(note.getName(), raw, note.getData()));
} catch (Exception e) { } catch (Exception e) {
log.error(String.format("Ignoring invalid external ID note %s", note.getName()), e); log.error("Ignoring invalid external ID note {}", note.getName(), e);
} }
} }
return extIds; return extIds;

View File

@@ -64,9 +64,7 @@ public class ChangeCleanupRunner implements Runnable {
if (delay == MISSING_CONFIG && interval == MISSING_CONFIG) { if (delay == MISSING_CONFIG && interval == MISSING_CONFIG) {
log.info("Ignoring missing changeCleanup schedule configuration"); log.info("Ignoring missing changeCleanup schedule configuration");
} else if (delay < 0 || interval <= 0) { } else if (delay < 0 || interval <= 0) {
log.warn( log.warn("Ignoring invalid changeCleanup schedule configuration: {}", scheduleConfig);
String.format(
"Ignoring invalid changeCleanup schedule configuration: %s", scheduleConfig));
} else { } else {
@SuppressWarnings("unused") @SuppressWarnings("unused")
Future<?> possiblyIgnoredError = Future<?> possiblyIgnoredError =

View File

@@ -473,9 +473,9 @@ public class ChangeInserter implements InsertChangeOp {
.test(ChangePermission.READ); .test(ChangePermission.READ);
} catch (PermissionBackendException e) { } catch (PermissionBackendException e) {
log.warn( log.warn(
String.format( "Failed to check if account {} can see change {}",
"Failed to check if account %d can see change %d", accountId.get(),
accountId.get(), notes.getChangeId().get()), notes.getChangeId().get(),
e); e);
return false; return false;
} }
@@ -501,7 +501,7 @@ public class ChangeInserter implements InsertChangeOp {
cm.addExtraCC(extraCC); cm.addExtraCC(extraCC);
cm.send(); cm.send();
} catch (Exception e) { } catch (Exception e) {
log.error("Cannot send email for new change " + change.getId(), e); log.error("Cannot send email for new change {}", change.getId(), e);
} }
} }

View File

@@ -186,7 +186,7 @@ public class ChangeResource implements RestResource, HasETag {
try { try {
projectStateTree = projectCache.checkedGet(getProject()).tree(); projectStateTree = projectCache.checkedGet(getProject()).tree();
} catch (IOException e) { } catch (IOException e) {
log.error(String.format("could not load project %s while computing etag", getProject())); log.error("could not load project {} while computing etag", getProject());
projectStateTree = ImmutableList.of(); projectStateTree = ImmutableList.of();
} }

View File

@@ -217,9 +217,10 @@ public class MergeabilityCacheImpl implements MergeabilityCache {
}); });
} catch (ExecutionException | UncheckedExecutionException e) { } catch (ExecutionException | UncheckedExecutionException e) {
log.error( log.error(
String.format( "Error checking mergeability of {} into {} ({})",
"Error checking mergeability of %s into %s (%s)", key.commit.name(),
key.commit.name(), key.into.name(), key.submitType.name()), key.into.name(),
key.submitType.name(),
e.getCause()); e.getCause());
return false; return false;
} }

View File

@@ -69,10 +69,7 @@ public class RebaseUtil {
} catch (RestApiException e) { } catch (RestApiException e) {
return false; return false;
} catch (OrmException | IOException e) { } catch (OrmException | IOException e) {
log.warn( log.warn("Error checking if patch set {} on {} can be rebased", patchSet.getId(), dest, e);
String.format(
"Error checking if patch set %s on %s can be rebased", patchSet.getId(), dest),
e);
return false; return false;
} }
} }

View File

@@ -61,10 +61,8 @@ public class ListCapabilities implements RestReadView<ConfigResource> {
for (String pluginName : pluginCapabilities.plugins()) { for (String pluginName : pluginCapabilities.plugins()) {
if (!isPluginNameSane(pluginName)) { if (!isPluginNameSane(pluginName)) {
log.warn( log.warn(
String.format( "Plugin name {} must match [A-Za-z0-9-]+ to use capabilities;" + " rename the plugin",
"Plugin name %s must match [A-Za-z0-9-]+ to use capabilities;" pluginName);
+ " rename the plugin",
pluginName));
continue; continue;
} }
for (Map.Entry<String, Provider<CapabilityDefinition>> entry : for (Map.Entry<String, Provider<CapabilityDefinition>> entry :

View File

@@ -350,9 +350,7 @@ public class ProjectConfigEntry {
} }
} }
} catch (IOException | ConfigInvalidException e) { } catch (IOException | ConfigInvalidException e) {
log.error( log.error("Failed to check if plugin config of project {} was updated.", p.get(), e);
String.format("Failed to check if plugin config of project %s was updated.", p.get()),
e);
} }
} }

View File

@@ -504,7 +504,7 @@ public class EventFactory {
} catch (IOException | OrmException e) { } catch (IOException | OrmException e) {
log.error("Cannot load patch set data for {}", patchSet.getId(), e); log.error("Cannot load patch set data for {}", patchSet.getId(), e);
} catch (PatchListObjectTooLargeException e) { } catch (PatchListObjectTooLargeException e) {
log.warn(String.format("Cannot get size information for %s: %s", pId, e.getMessage())); log.warn("Cannot get size information for {}: {}", pId, e.getMessage());
} catch (PatchListNotAvailableException e) { } catch (PatchListNotAvailableException e) {
log.error("Cannot get size information for {}.", pId, e); log.error("Cannot get size information for {}.", pId, e);
} }

View File

@@ -105,8 +105,7 @@ public class UiActions {
try { try {
view = e.getProvider().get(); view = e.getProvider().get();
} catch (RuntimeException err) { } catch (RuntimeException err) {
log.error( log.error("error creating view {}.{}", e.getPluginName(), e.getExportName(), err);
String.format("error creating view %s.%s", e.getPluginName(), e.getExportName()), err);
return null; return null;
} }
@@ -123,8 +122,7 @@ public class UiActions {
try { try {
globalRequired = GlobalPermission.fromAnnotation(e.getPluginName(), view.getClass()); globalRequired = GlobalPermission.fromAnnotation(e.getPluginName(), view.getClass());
} catch (PermissionBackendException err) { } catch (PermissionBackendException err) {
log.error( log.error("exception testing view {}.{}", e.getPluginName(), e.getExportName(), err);
String.format("exception testing view %s.%s", e.getPluginName(), e.getExportName()), err);
return null; return null;
} }
if (!globalRequired.isEmpty()) { if (!globalRequired.isEmpty()) {

View File

@@ -46,9 +46,13 @@ public class ConfiguredMimeTypes {
add(typeName, path); add(typeName, path);
} catch (PatternSyntaxException | InvalidPatternException e) { } catch (PatternSyntaxException | InvalidPatternException e) {
log.warn( log.warn(
String.format( "Ignoring invalid {}.{}.{} = {} in project {}: {}",
"Ignoring invalid %s.%s.%s = %s in project %s: %s", MIMETYPE,
MIMETYPE, typeName, KEY_PATH, path, projectName, e.getMessage())); typeName,
KEY_PATH,
path,
projectName,
e.getMessage());
} }
} }
} }

View File

@@ -216,9 +216,9 @@ public class MultiProgressMonitor {
"(timeout %sms, cancelled)", "(timeout %sms, cancelled)",
TimeUnit.MILLISECONDS.convert(now - deadline, NANOSECONDS)); TimeUnit.MILLISECONDS.convert(now - deadline, NANOSECONDS));
log.warn( log.warn(
String.format( "MultiProgressMonitor worker killed after {}ms {}",
"MultiProgressMonitor worker killed after %sms" + detailMessage, // TimeUnit.MILLISECONDS.convert(now - overallStart, NANOSECONDS),
TimeUnit.MILLISECONDS.convert(now - overallStart, NANOSECONDS))); detailMessage);
} }
break; break;
} }

View File

@@ -359,9 +359,9 @@ public class VisibleRefFilter extends AbstractAdvertiseRefsHook {
return false; return false;
} catch (PermissionBackendException e) { } catch (PermissionBackendException e) {
log.error( log.error(
String.format( "Can't check permission for user {} on project {}",
"Can't check permission for user %s on project %s", user.get(),
user.get(), projectState.getName()), projectState.getName(),
e); e);
return false; return false;
} }

View File

@@ -267,9 +267,8 @@ public class AsyncReceiveCommits implements PreReceiveHook {
executor.submit(scopePropagator.wrap(w)), timeoutMillis, TimeUnit.MILLISECONDS); executor.submit(scopePropagator.wrap(w)), timeoutMillis, TimeUnit.MILLISECONDS);
} catch (ExecutionException e) { } catch (ExecutionException e) {
log.warn( log.warn(
String.format( "Error in ReceiveCommits while processing changes for project {}",
"Error in ReceiveCommits while processing changes for project %s", projectControl.getProject().getName(),
projectControl.getProject().getName()),
e); e);
rp.sendError("internal error while processing changes"); rp.sendError("internal error while processing changes");
// ReceiveCommits has tried its best to catch errors, so anything at this // ReceiveCommits has tried its best to catch errors, so anything at this

View File

@@ -67,9 +67,7 @@ public class ListSubgroups implements RestReadView<GroupResource> {
included.add(json.format(i.getGroup())); included.add(json.format(i.getGroup()));
} }
} catch (NoSuchGroupException notFound) { } catch (NoSuchGroupException notFound) {
log.warn( log.warn("Group {} no longer available, subgroup of {}", subgroupUuid, group.getName());
String.format(
"Group %s no longer available, subgroup of %s", subgroupUuid, group.getName()));
continue; continue;
} }
} }

View File

@@ -92,7 +92,7 @@ public class ReindexAfterRefUpdate implements GitReferenceUpdatedListener {
try { try {
accountCache.evict(accountId); accountCache.evict(accountId);
} catch (IOException e) { } catch (IOException e) {
log.error(String.format("Reindex account %s failed.", accountId), e); log.error("Reindex account {} failed.", accountId, e);
} }
} }
} }

View File

@@ -83,11 +83,10 @@ public enum GlobalPermission implements GlobalOrPluginPermission {
RequiresAnyCapability rac = findAnnotation(clazz, RequiresAnyCapability.class); RequiresAnyCapability rac = findAnnotation(clazz, RequiresAnyCapability.class);
if (rc != null && rac != null) { if (rc != null && rac != null) {
log.error( log.error(
String.format( "Class {} uses both @{} and @{}",
"Class %s uses both @%s and @%s", clazz.getName(),
clazz.getName(), RequiresCapability.class.getSimpleName(),
RequiresCapability.class.getSimpleName(), RequiresAnyCapability.class.getSimpleName());
RequiresAnyCapability.class.getSimpleName()));
throw new PermissionBackendException("cannot extract permission"); throw new PermissionBackendException("cannot extract permission");
} else if (rc != null) { } else if (rc != null) {
return Collections.singleton( return Collections.singleton(
@@ -154,16 +153,16 @@ public enum GlobalPermission implements GlobalOrPluginPermission {
if (scope == CapabilityScope.PLUGIN) { if (scope == CapabilityScope.PLUGIN) {
log.error( log.error(
String.format( "Class {} uses @{}(scope={}), but is not within a plugin",
"Class %s uses @%s(scope=%s), but is not within a plugin", clazz.getName(),
clazz.getName(), annotationClass.getSimpleName(), scope.name())); annotationClass.getSimpleName(),
scope.name());
throw new PermissionBackendException("cannot extract permission"); throw new PermissionBackendException("cannot extract permission");
} }
GlobalPermission perm = byName(capability); GlobalPermission perm = byName(capability);
if (perm == null) { if (perm == null) {
log.error( log.error("Class {} requires unknown capability {}", clazz.getName(), capability);
String.format("Class %s requires unknown capability %s", clazz.getName(), capability));
throw new PermissionBackendException("cannot extract permission"); throw new PermissionBackendException("cannot extract permission");
} }
return perm; return perm;

View File

@@ -135,10 +135,10 @@ class AutoRegisterModules {
} }
} catch (IOException e) { } catch (IOException e) {
log.warn( log.warn(
String.format( "Cannot access {} from plugin {}: "
"Cannot access %s from plugin %s: " + "JavaScript auto-discovered plugin will not be registered",
+ "JavaScript auto-discovered plugin will not be registered", STATIC_INIT_JS,
STATIC_INIT_JS, pluginName), pluginName,
e); e);
} }
} }
@@ -156,9 +156,10 @@ class AutoRegisterModules {
Export export = clazz.getAnnotation(Export.class); Export export = clazz.getAnnotation(Export.class);
if (export == null) { if (export == null) {
log.warn( log.warn(
String.format( "In plugin {} asm incorrectly parsed {} with @Export(\"{}\")",
"In plugin %s asm incorrectly parsed %s with @Export(\"%s\")", pluginName,
pluginName, clazz.getName(), def.annotationValue)); clazz.getName(),
def.annotationValue);
return; return;
} }
@@ -192,9 +193,7 @@ class AutoRegisterModules {
if (listen != null) { if (listen != null) {
listen(clazz, clazz); listen(clazz, clazz);
} else { } else {
log.warn( log.warn("In plugin {} asm incorrectly parsed {} with @Listen", pluginName, clazz.getName());
String.format(
"In plugin %s asm incorrectly parsed %s with @Listen", pluginName, clazz.getName()));
} }
} }

View File

@@ -92,9 +92,10 @@ public class JarScanner implements PluginContentScanner, AutoCloseable {
throw new InvalidPluginException("Cannot auto-register", err); throw new InvalidPluginException("Cannot auto-register", err);
} catch (RuntimeException err) { } catch (RuntimeException err) {
log.warn( log.warn(
String.format( "Plugin {} has invalid class file {} inside of {}",
"Plugin %s has invalid class file %s inside of %s", pluginName,
pluginName, entry.getName(), jarFile.getName()), entry.getName(),
jarFile.getName(),
err); err);
continue; continue;
} }
@@ -104,9 +105,11 @@ public class JarScanner implements PluginContentScanner, AutoCloseable {
rawMap.put(def.annotationName, def); rawMap.put(def.annotationName, def);
} else { } else {
log.warn( log.warn(
String.format( "Plugin {} tries to @{}(\"{}\") abstract class {}",
"Plugin %s tries to @%s(\"%s\") abstract class %s", pluginName,
pluginName, def.annotationName, def.annotationValue, def.className)); def.annotationName,
def.annotationValue,
def.className);
} }
} }
} }
@@ -151,9 +154,7 @@ public class JarScanner implements PluginContentScanner, AutoCloseable {
try { try {
new ClassReader(read(jarFile, entry)).accept(def, SKIP_ALL); new ClassReader(read(jarFile, entry)).accept(def, SKIP_ALL);
} catch (RuntimeException err) { } catch (RuntimeException err) {
log.warn( log.warn("Jar {} has invalid class file {}", jarFile.getName(), entry.getName(), err);
String.format("Jar %s has invalid class file %s", jarFile.getName(), entry.getName()),
err);
continue; continue;
} }

View File

@@ -59,9 +59,9 @@ class PluginCleanerTask implements Runnable {
if (0 < left) { if (0 < left) {
long waiting = TimeUtil.nowMs() - start; long waiting = TimeUtil.nowMs() - start;
log.warn( log.warn(
String.format( "{} plugins still waiting to be reclaimed after {} minutes",
"%d plugins still waiting to be reclaimed after %d minutes", pending,
pending, TimeUnit.MILLISECONDS.toMinutes(waiting))); TimeUnit.MILLISECONDS.toMinutes(waiting));
attempts = Math.min(attempts + 1, 15); attempts = Math.min(attempts + 1, 15);
ensureScheduled(); ensureScheduled();
} else { } else {

View File

@@ -178,9 +178,7 @@ public class ServerPlugin extends Plugin {
} else if ("restart".equalsIgnoreCase(v)) { } else if ("restart".equalsIgnoreCase(v)) {
return false; return false;
} else { } else {
log.warn( log.warn("Plugin {} has invalid Gerrit-ReloadMode {}; assuming restart", getName(), v);
String.format(
"Plugin %s has invalid Gerrit-ReloadMode %s; assuming restart", getName(), v));
return false; return false;
} }
} }

View File

@@ -116,7 +116,7 @@ public class CommitsCollection implements ChildCollection<ProjectResource, Commi
return true; return true;
} }
} catch (OrmException e) { } catch (OrmException e) {
log.error("Cannot look up change for commit " + commit.name() + " in " + project, e); log.error("Cannot look up change for commit {} in {}", commit.name(), project, e);
} }
} }
@@ -130,9 +130,9 @@ public class CommitsCollection implements ChildCollection<ProjectResource, Commi
return IncludedInResolver.includedInAny(repo, rw, commit, refs.values()); return IncludedInResolver.includedInAny(repo, rw, commit, refs.values());
} catch (IOException e) { } catch (IOException e) {
log.error( log.error(
String.format( "Cannot verify permissions to commit object {} in repository {}",
"Cannot verify permissions to commit object %s in repository %s", commit.name(),
commit.name(), state.getNameKey()), state.getNameKey(),
e); e);
return false; return false;
} }

View File

@@ -81,7 +81,7 @@ public class CreateRefControl {
try (RevWalk rw = new RevWalk(repo)) { try (RevWalk rw = new RevWalk(repo)) {
rw.parseBody(tag); rw.parseBody(tag);
} catch (IOException e) { } catch (IOException e) {
log.error(String.format("RevWalk(%s) parsing %s:", branch.getParentKey(), tag.name()), e); log.error("RevWalk({}) parsing {}:", branch.getParentKey(), tag.name(), e);
throw e; throw e;
} }

View File

@@ -142,9 +142,11 @@ public class ListDashboards implements RestReadView<ProjectResource> {
setDefault)); setDefault));
} catch (ConfigInvalidException e) { } catch (ConfigInvalidException e) {
log.warn( log.warn(
String.format( "Cannot parse dashboard {}:{}:{}: {}",
"Cannot parse dashboard %s:%s:%s: %s", definingProject.getName(),
definingProject.getName(), ref.getName(), tw.getPathString(), e.getMessage())); ref.getName(),
tw.getPathString(),
e.getMessage());
} }
} }
} }

View File

@@ -505,9 +505,7 @@ public class ListProjects implements RestReadView<TopLevelResource> {
if (projectCache.get(parent) != null) { if (projectCache.get(parent) != null) {
parents.add(parent); parents.add(parent);
} else { } else {
log.warn( log.warn("parent project {} of project {} not found", parent.get(), ps.getName());
String.format(
"parent project %s of project %s not found", parent.get(), ps.getName()));
} }
} }
} }

View File

@@ -142,7 +142,7 @@ public class ProjectCacheImpl implements ProjectCache {
return strictCheckedGet(projectName); return strictCheckedGet(projectName);
} catch (Exception e) { } catch (Exception e) {
if (!(e.getCause() instanceof RepositoryNotFoundException)) { if (!(e.getCause() instanceof RepositoryNotFoundException)) {
log.warn(String.format("Cannot read project %s", projectName.get()), e); log.warn("Cannot read project {}", projectName.get(), e);
Throwables.throwIfInstanceOf(e.getCause(), IOException.class); Throwables.throwIfInstanceOf(e.getCause(), IOException.class);
throw new IOException(e); throw new IOException(e);
} }

View File

@@ -382,9 +382,9 @@ public class ProjectControl {
return commits.isReachableFrom(state, repo, commit, refs); return commits.isReachableFrom(state, repo, commit, refs);
} catch (IOException e) { } catch (IOException e) {
log.error( log.error(
String.format( "Cannot verify permissions to commit object {} in repository {}",
"Cannot verify permissions to commit object %s in repository %s", commit.name(),
commit.name(), getProject().getNameKey()), getProject().getNameKey(),
e); e);
return false; return false;
} }

View File

@@ -76,7 +76,7 @@ public class InternalGroupQuery extends InternalQuery<InternalGroup> {
ImmutableList<AccountGroup.UUID> groupUuids = ImmutableList<AccountGroup.UUID> groupUuids =
groups.stream().map(InternalGroup::getGroupUUID).collect(toImmutableList()); groups.stream().map(InternalGroup::getGroupUUID).collect(toImmutableList());
log.warn(String.format("Ambiguous %s for groups %s.", groupDescription, groupUuids)); log.warn("Ambiguous {} for groups {}.", groupDescription, groupUuids);
return Optional.empty(); return Optional.empty();
} }
} }

View File

@@ -66,9 +66,8 @@ class SshPluginStarterCallback implements StartPluginListener, ReloadPluginListe
} catch (RuntimeException err) { } catch (RuntimeException err) {
if (!providesDynamicOptions(plugin)) { if (!providesDynamicOptions(plugin)) {
log.warn( log.warn(
String.format( "Plugin {} did not define its top-level command nor any DynamicOptions",
"Plugin %s did not define its top-level command nor any DynamicOptions", plugin.getName(),
plugin.getName()),
err); err);
} }
} }