diff --git a/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/util/io/InputStreamSource.java b/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/util/io/InputStreamSource.java index 2ac3644a4e8..af6e59f9b2a 100644 --- a/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/util/io/InputStreamSource.java +++ b/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/util/io/InputStreamSource.java @@ -32,7 +32,7 @@ public class InputStreamSource implements StreamSource { // re-read it. protected BufferedInputStream inputStream; - protected byte[] bytes; + protected byte[] byteArray; public InputStreamSource(InputStream inputStream) { this.inputStream = new BufferedInputStream(inputStream); @@ -40,14 +40,14 @@ public InputStreamSource(InputStream inputStream) { @Override public InputStream getInputStream() { - if (bytes == null) { + if (byteArray == null) { try { - bytes = getBytesFromInputStream(inputStream); + byteArray = getBytesFromInputStream(inputStream); } catch (IOException e) { throw new FlowableException("Could not read from inputstream", e); } } - return new BufferedInputStream(new ByteArrayInputStream(bytes)); + return new BufferedInputStream(new ByteArrayInputStream(byteArray)); } @Override @@ -55,13 +55,13 @@ public String toString() { return "InputStream"; } - public byte[] getBytesFromInputStream(InputStream inStream) throws IOException { - long length = inStream.available(); + public byte[] getBytesFromInputStream(InputStream inputStream) throws IOException { + long length = inputStream.available(); byte[] bytes = new byte[(int) length]; int offset = 0; int numRead = 0; - while (offset < bytes.length && (numRead = inStream.read(bytes, offset, bytes.length - offset)) >= 0) { + while (offset < bytes.length && (numRead = inputStream.read(bytes, offset, bytes.length - offset)) >= 0) { offset += numRead; } @@ -70,7 +70,7 @@ public byte[] getBytesFromInputStream(InputStream inStream) throws IOException { } // Close the input stream and return bytes - inStream.close(); + inputStream.close(); return bytes; } diff --git a/modules/flowable-engine-common/src/test/java/org/flowable/common/engine/impl/ServiceConfiguratorTest.java b/modules/flowable-engine-common/src/test/java/org/flowable/common/engine/impl/ServiceConfiguratorTest.java index db533055493..b85134d42f8 100644 --- a/modules/flowable-engine-common/src/test/java/org/flowable/common/engine/impl/ServiceConfiguratorTest.java +++ b/modules/flowable-engine-common/src/test/java/org/flowable/common/engine/impl/ServiceConfiguratorTest.java @@ -11,14 +11,14 @@ public class ServiceConfiguratorTest { @Test public void testNoServiceConfigurators() { - AtomicBoolean beforeInit = new AtomicBoolean(false); - AtomicBoolean afterInit = new AtomicBoolean(false); + AtomicBoolean beforeInitialization = new AtomicBoolean(false); + AtomicBoolean afterInitialization = new AtomicBoolean(false); TestServiceConfiguration serviceConfig = new TestServiceConfiguration("test"); serviceConfig.init(); - assertThat(beforeInit.get()).isFalse(); - assertThat(afterInit.get()).isFalse(); + assertThat(beforeInitialization.get()).isFalse(); + assertThat(afterInitialization.get()).isFalse(); } @Test @@ -26,8 +26,8 @@ public void testSetServiceConfigurators() { AtomicBoolean beforeInit = new AtomicBoolean(false); AtomicBoolean afterInit = new AtomicBoolean(false); - TestServiceConfiguration serviceConfig = new TestServiceConfiguration("test"); - serviceConfig.setConfigurators(List.of(new ServiceConfigurator() { + TestServiceConfiguration serviceConfiguration = new TestServiceConfiguration("test"); + serviceConfiguration.setConfigurators(List.of(new ServiceConfigurator() { @Override public void beforeInit(TestServiceConfiguration service) { @@ -40,7 +40,7 @@ public void afterInit(TestServiceConfiguration service) { } })); - serviceConfig.init(); + serviceConfiguration.init(); assertThat(beforeInit.get()).isTrue(); assertThat(afterInit.get()).isTrue(); diff --git a/modules/flowable5-test/src/test/java/org/activiti/examples/bpmn/executionlistener/ExecutionListenerTest.java b/modules/flowable5-test/src/test/java/org/activiti/examples/bpmn/executionlistener/ExecutionListenerTest.java index 66e132e2b95..e61453613bd 100644 --- a/modules/flowable5-test/src/test/java/org/activiti/examples/bpmn/executionlistener/ExecutionListenerTest.java +++ b/modules/flowable5-test/src/test/java/org/activiti/examples/bpmn/executionlistener/ExecutionListenerTest.java @@ -111,12 +111,12 @@ public void testExecutionListenerFieldInjection() { ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("executionListenersProcess", variables); - Object varSetByListener = runtimeService.getVariable(processInstance.getId(), "var"); - assertNotNull(varSetByListener); - assertTrue(varSetByListener instanceof String); + Object variableSetByListener = runtimeService.getVariable(processInstance.getId(), "var"); + assertNotNull(variableSetByListener); + assertTrue(variableSetByListener instanceof String); // Result is a concatenation of fixed injected field and injected expression - assertEquals("Yes, I am listening!", varSetByListener); + assertEquals("Yes, I am listening!", variableSetByListener); } @Deployment(resources = { "org/activiti/examples/bpmn/executionlistener/ExecutionListenersCurrentActivity.bpmn20.xml" })