diff options
author | Brett Kail <bjkail@gmail.com> | 2016-12-14 01:48:49 +0100 |
---|---|---|
committer | Evgeny Mandrikov <Godin@users.noreply.github.com> | 2016-12-14 02:22:14 +0100 |
commit | 055e8e4c209673f96581b723fcc6295852bf997e (patch) | |
tree | b58c9875f4af8e6a3513810af10c03fc332b12a3 /org.jacoco.core.test | |
parent | eeb3aa8826450205ba413098605c37fe0b9e34d3 (diff) | |
download | jacoco-055e8e4c209673f96581b723fcc6295852bf997e.tar.gz |
Make FORMAT_VERSION non-constant
If a constant expression is assigned to a static final variable, javac
will inline the constant value in the caller, which means constants
should only be used for values that will never change. Otherwise,
calling code must be recompiled when upgrading to a new version of the
library even if the caller would otherwise not require any changes.
Diffstat (limited to 'org.jacoco.core.test')
-rw-r--r-- | org.jacoco.core.test/src/org/jacoco/core/data/ExecutionDataReaderWriterTest.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/org.jacoco.core.test/src/org/jacoco/core/data/ExecutionDataReaderWriterTest.java b/org.jacoco.core.test/src/org/jacoco/core/data/ExecutionDataReaderWriterTest.java index cbf52902..e623dd11 100644 --- a/org.jacoco.core.test/src/org/jacoco/core/data/ExecutionDataReaderWriterTest.java +++ b/org.jacoco.core.test/src/org/jacoco/core/data/ExecutionDataReaderWriterTest.java @@ -142,7 +142,7 @@ public class ExecutionDataReaderWriterTest { buffer.write(ExecutionDataWriter.BLOCK_HEADER); buffer.write(0xC0); buffer.write(0xC0); - final char version = ExecutionDataWriter.FORMAT_VERSION - 1; + final char version = (char) (ExecutionDataWriter.FORMAT_VERSION - 1); buffer.write(version >> 8); buffer.write(version & 0xFF); createReader().read(); |