From cd9422f239d74264f2e3ee0c9fe1e0aaae0061a5 Mon Sep 17 00:00:00 2001 From: Matthias Sohn Date: Thu, 29 Aug 2019 09:21:04 +0200 Subject: [PATCH] Silence warnings for non-externalized strings These warnings were missed to address in a0048208 which introduced them. Change-Id: Ia2d15fdce72c10378d020682b80fe7fc548c0d4c Signed-off-by: Matthias Sohn --- .../internal/storage/pack/PackWriter.java | 6 ++--- .../eclipse/jgit/transport/UploadPack.java | 24 ++++++++++--------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriter.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriter.java index 02cfe9049..43067d364 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriter.java @@ -654,7 +654,7 @@ public class PackWriter implements AutoCloseable { } /** - * @param config configuration related to packfile URIs + * @param config configuration related to packfile URIs * @since 5.5 */ public void setPackfileUriConfig(PackfileUriConfig config) { @@ -1223,7 +1223,7 @@ public class PackWriter implements AutoCloseable { CachedPackUriProvider p = packfileUriConfig.cachedPackUriProvider; PacketLineOut o = packfileUriConfig.pckOut; - o.writeString("packfile-uris\n"); + o.writeString("packfile-uris\n"); //$NON-NLS-1$ for (CachedPack pack : cachedPacks) { CachedPackUriProvider.PackInfo packInfo = p.getInfo( pack, packfileUriConfig.protocolsSupported); @@ -1235,7 +1235,7 @@ public class PackWriter implements AutoCloseable { } } packfileUriConfig.pckOut.writeDelim(); - packfileUriConfig.pckOut.writeString("packfile\n"); + packfileUriConfig.pckOut.writeString("packfile\n"); //$NON-NLS-1$ } else { unwrittenCachedPacks = cachedPacks; } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java index 1e49c7b01..20b45882d 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java @@ -1285,20 +1285,22 @@ public class UploadPack { .format(JGitText.get().unknownTransportCommand, command)); } + @SuppressWarnings("nls") private List getV2CapabilityAdvertisement() { ArrayList caps = new ArrayList<>(); - caps.add("version 2"); //$NON-NLS-1$ + caps.add("version 2"); caps.add(COMMAND_LS_REFS); - boolean advertiseRefInWant = transferConfig.isAllowRefInWant() && - db.getConfig().getBoolean("uploadpack", null, //$NON-NLS-1$ - "advertiserefinwant", true); //$NON-NLS-1$ - caps.add( - COMMAND_FETCH + '=' + - (transferConfig.isAllowFilter() ? OPTION_FILTER + ' ' : "") + //$NON-NLS-1$ - (advertiseRefInWant ? CAPABILITY_REF_IN_WANT + ' ' : "") + //$NON-NLS-1$ - (transferConfig.isAllowSidebandAll() ? OPTION_SIDEBAND_ALL + ' ' : "") + //$NON-NLS-1$ - (cachedPackUriProvider != null ? "packfile-uris " : "") + // $NON-NLS-1$ - OPTION_SHALLOW); + boolean advertiseRefInWant = transferConfig.isAllowRefInWant() + && db.getConfig().getBoolean("uploadpack", null, + "advertiserefinwant", true); + caps.add(COMMAND_FETCH + '=' + + (transferConfig.isAllowFilter() ? OPTION_FILTER + ' ' : "") + + (advertiseRefInWant ? CAPABILITY_REF_IN_WANT + ' ' : "") + + (transferConfig.isAllowSidebandAll() + ? OPTION_SIDEBAND_ALL + ' ' + : "") + + (cachedPackUriProvider != null ? "packfile-uris " : "") + + OPTION_SHALLOW); caps.add(CAPABILITY_SERVER_OPTION); return caps; }