From 98f579e0c12dadabf44f3a01f20b915df2a0c257 Mon Sep 17 00:00:00 2001 From: jpdahlke Date: Wed, 24 Jul 2024 15:02:43 -0400 Subject: [PATCH] errorprone :: MemberName - pickup package (#854) --- .../java/emissary/pickup/PickUpPlace.java | 2 +- src/main/java/emissary/pickup/WorkBundle.java | 24 +++++++++---------- src/main/java/emissary/pickup/WorkUnit.java | 8 +++---- src/main/java/emissary/spi/ObjectTracing.java | 2 +- .../java/emissary/pickup/WorkBundleTest.java | 10 ++++---- 5 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/main/java/emissary/pickup/PickUpPlace.java b/src/main/java/emissary/pickup/PickUpPlace.java index 50d5463b46..ae8a50c63d 100755 --- a/src/main/java/emissary/pickup/PickUpPlace.java +++ b/src/main/java/emissary/pickup/PickUpPlace.java @@ -297,7 +297,7 @@ public boolean processDataFile(File theFile, String fixedName, boolean isOversiz boolean success = true; logger.debug("Starting processDataFile in PickUpPlace for {}", theFile); - ObjectTracingService.emitLifecycleEvent(null, fixedName, ObjectTracing.Stage.PickUp, useObjectTraceLogger); + ObjectTracingService.emitLifecycleEvent(null, fixedName, ObjectTracing.Stage.PICK_UP, useObjectTraceLogger); // Handle oversize data quickly without reading the file if (isOversize) { diff --git a/src/main/java/emissary/pickup/WorkBundle.java b/src/main/java/emissary/pickup/WorkBundle.java index 20d9661bf7..377ca78fb1 100644 --- a/src/main/java/emissary/pickup/WorkBundle.java +++ b/src/main/java/emissary/pickup/WorkBundle.java @@ -124,11 +124,11 @@ public WorkBundle(WorkBundle that) { */ public static WorkBundle readFromStream(DataInputStream in) throws IOException { WorkBundle wb = new WorkBundle(); - wb.bundleId = readUTFOrNull(in); - wb.outputRoot = readUTFOrNull(in); - wb.eatPrefix = readUTFOrNull(in); - wb.caseId = readUTFOrNull(in); - wb.sentTo = readUTFOrNull(in); + wb.bundleId = readUtfOrNull(in); + wb.outputRoot = readUtfOrNull(in); + wb.eatPrefix = readUtfOrNull(in); + wb.caseId = readUtfOrNull(in); + wb.sentTo = readUtfOrNull(in); wb.errorCount = in.readInt(); wb.priority = in.readInt(); wb.simpleMode = in.readBoolean(); @@ -153,11 +153,11 @@ public static WorkBundle readFromStream(DataInputStream in) throws IOException { * @throws IOException if there is a problem writing to the stream. */ public void writeToStream(DataOutputStream out) throws IOException { - writeUTFOrNull(bundleId, out); - writeUTFOrNull(outputRoot, out); - writeUTFOrNull(eatPrefix, out); - writeUTFOrNull(caseId, out); - writeUTFOrNull(sentTo, out); + writeUtfOrNull(bundleId, out); + writeUtfOrNull(outputRoot, out); + writeUtfOrNull(eatPrefix, out); + writeUtfOrNull(caseId, out); + writeUtfOrNull(sentTo, out); out.writeInt(errorCount); out.writeInt(priority); out.writeBoolean(simpleMode); @@ -175,14 +175,14 @@ public void writeToStream(DataOutputStream out) throws IOException { } @Nullable - static String readUTFOrNull(DataInputStream in) throws IOException { + static String readUtfOrNull(DataInputStream in) throws IOException { if (in.readBoolean()) { return in.readUTF(); } return null; } - static void writeUTFOrNull(@Nullable String s, DataOutputStream out) throws IOException { + static void writeUtfOrNull(@Nullable String s, DataOutputStream out) throws IOException { out.writeBoolean(s != null); if (s != null) { out.writeUTF(s); diff --git a/src/main/java/emissary/pickup/WorkUnit.java b/src/main/java/emissary/pickup/WorkUnit.java index 1a13da23b1..7df14e3223 100644 --- a/src/main/java/emissary/pickup/WorkUnit.java +++ b/src/main/java/emissary/pickup/WorkUnit.java @@ -43,16 +43,16 @@ public final class WorkUnit { public static WorkUnit readFromStream(DataInputStream in) throws IOException { final WorkUnit u = new WorkUnit(null); - u.fileName = WorkBundle.readUTFOrNull(in); - u.transactionId = WorkBundle.readUTFOrNull(in); + u.fileName = WorkBundle.readUtfOrNull(in); + u.transactionId = WorkBundle.readUtfOrNull(in); u.failedToParse = in.readBoolean(); u.failedToProcess = in.readBoolean(); return u; } public void writeToStream(DataOutputStream out) throws IOException { - WorkBundle.writeUTFOrNull(fileName, out); - WorkBundle.writeUTFOrNull(transactionId, out); + WorkBundle.writeUtfOrNull(fileName, out); + WorkBundle.writeUtfOrNull(transactionId, out); out.writeBoolean(failedToParse); out.writeBoolean(failedToProcess); } diff --git a/src/main/java/emissary/spi/ObjectTracing.java b/src/main/java/emissary/spi/ObjectTracing.java index 61ff7177a9..68a651a37f 100644 --- a/src/main/java/emissary/spi/ObjectTracing.java +++ b/src/main/java/emissary/spi/ObjectTracing.java @@ -7,7 +7,7 @@ public interface ObjectTracing { enum Stage { - PickUp, DropOff + PICK_UP, DROP_OFF } /** diff --git a/src/test/java/emissary/pickup/WorkBundleTest.java b/src/test/java/emissary/pickup/WorkBundleTest.java index 9e098655e5..828b562f74 100644 --- a/src/test/java/emissary/pickup/WorkBundleTest.java +++ b/src/test/java/emissary/pickup/WorkBundleTest.java @@ -293,11 +293,11 @@ void testLimitSerDe() throws IOException { wul.add(new WorkUnit(fileName)); } - WorkBundle.writeUTFOrNull(wb1.bundleId, out); - WorkBundle.writeUTFOrNull(wb1.outputRoot, out); - WorkBundle.writeUTFOrNull(wb1.eatPrefix, out); - WorkBundle.writeUTFOrNull(wb1.caseId, out); - WorkBundle.writeUTFOrNull(wb1.sentTo, out); + WorkBundle.writeUtfOrNull(wb1.bundleId, out); + WorkBundle.writeUtfOrNull(wb1.outputRoot, out); + WorkBundle.writeUtfOrNull(wb1.eatPrefix, out); + WorkBundle.writeUtfOrNull(wb1.caseId, out); + WorkBundle.writeUtfOrNull(wb1.sentTo, out); out.writeInt(wb1.errorCount); out.writeInt(wb1.priority); out.writeBoolean(wb1.simpleMode);