mirror of
https://github.com/lightbend/config.git
synced 2025-02-23 17:50:30 +08:00
add some missing serialVersionUID
All the most-derived classes need to have it, not just base classes. Update expected serializations in the tests to reflect new serialVersionUID.
This commit is contained in:
parent
dc2f52aa24
commit
71d209070a
@ -25,6 +25,8 @@ import com.typesafe.config.ConfigValueType;
|
||||
final class ConfigDelayedMerge extends AbstractConfigValue implements
|
||||
Unmergeable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
// earlier items in the stack win
|
||||
final private List<AbstractConfigValue> stack;
|
||||
final private boolean ignoresFallbacks;
|
||||
|
@ -18,9 +18,11 @@ import com.typesafe.config.ConfigValue;
|
||||
|
||||
// This is just like ConfigDelayedMerge except we know statically
|
||||
// that it will turn out to be an object.
|
||||
class ConfigDelayedMergeObject extends AbstractConfigObject implements
|
||||
final class ConfigDelayedMergeObject extends AbstractConfigObject implements
|
||||
Unmergeable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
final private List<AbstractConfigValue> stack;
|
||||
final private boolean ignoresFallbacks;
|
||||
|
||||
|
@ -18,6 +18,8 @@ import com.typesafe.config.ConfigValueType;
|
||||
|
||||
final class SimpleConfigList extends AbstractConfigValue implements ConfigList {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
final private List<AbstractConfigValue> value;
|
||||
final private boolean resolved;
|
||||
|
||||
|
@ -365,7 +365,7 @@ class ConfigSubstitutionTest extends TestUtils {
|
||||
"257400046f626a427371007e00177371007e000700000007000000077071007e000c71007e000f70" +
|
||||
"00000000007371007e001a7704000000017371007e001c007371007e001f740001617371007e001f" +
|
||||
"74000162707874000361727273720029636f6d2e74797065736166652e636f6e6669672e696d706c" +
|
||||
"2e53696d706c65436f6e6669674c697374ef9443c7c6af330d0200025a00087265736f6c7665644c" +
|
||||
"2e53696d706c65436f6e6669674c69737400000000000000010200025a00087265736f6c7665644c" +
|
||||
"000576616c756571007e00087871007e00047371007e00070000000a0000000a7071007e000c7100" +
|
||||
"7e000f70007371007e001a7704000000067371007e00177371007e00070000000a0000000a707100" +
|
||||
"7e000c71007e000f7000000000007371007e001a7704000000017371007e001c007371007e001f74" +
|
||||
|
@ -204,7 +204,7 @@ class ConfigValueTest extends TestUtils {
|
||||
def configListSerializable() {
|
||||
val expectedSerialization = "" +
|
||||
"aced000573720029636f6d2e74797065736166652e636f6e6669672e696d706c2e53696d706c6543" +
|
||||
"6f6e6669674c697374ef9443c7c6af330d0200025a00087265736f6c7665644c000576616c756574" +
|
||||
"6f6e6669674c69737400000000000000010200025a00087265736f6c7665644c000576616c756574" +
|
||||
"00104c6a6176612f7574696c2f4c6973743b7872002c636f6d2e74797065736166652e636f6e6669" +
|
||||
"672e696d706c2e4162737472616374436f6e66696756616c756500000000000000010200014c0006" +
|
||||
"6f726967696e74002d4c636f6d2f74797065736166652f636f6e6669672f696d706c2f53696d706c" +
|
||||
@ -288,7 +288,7 @@ class ConfigValueTest extends TestUtils {
|
||||
def configDelayedMergeSerializable() {
|
||||
val expectedSerialization = "" +
|
||||
"aced00057372002b636f6d2e74797065736166652e636f6e6669672e696d706c2e436f6e66696744" +
|
||||
"656c617965644d657267656d8c8e0e0c0145760200025a001069676e6f72657346616c6c6261636b" +
|
||||
"656c617965644d6572676500000000000000010200025a001069676e6f72657346616c6c6261636b" +
|
||||
"734c0005737461636b7400104c6a6176612f7574696c2f4c6973743b7872002c636f6d2e74797065" +
|
||||
"736166652e636f6e6669672e696d706c2e4162737472616374436f6e66696756616c756500000000" +
|
||||
"000000010200014c00066f726967696e74002d4c636f6d2f74797065736166652f636f6e6669672f" +
|
||||
@ -338,7 +338,7 @@ class ConfigValueTest extends TestUtils {
|
||||
def configDelayedMergeObjectSerializable() {
|
||||
val expectedSerialization = "" +
|
||||
"aced000573720031636f6d2e74797065736166652e636f6e6669672e696d706c2e436f6e66696744" +
|
||||
"656c617965644d657267654f626a65637401fa1552304cae900200025a001069676e6f7265734661" +
|
||||
"656c617965644d657267654f626a65637400000000000000010200025a001069676e6f7265734661" +
|
||||
"6c6c6261636b734c0005737461636b7400104c6a6176612f7574696c2f4c6973743b7872002d636f" +
|
||||
"6d2e74797065736166652e636f6e6669672e696d706c2e4162737472616374436f6e6669674f626a" +
|
||||
"65637400000000000000010200014c0006636f6e6669677400274c636f6d2f74797065736166652f" +
|
||||
|
@ -116,15 +116,12 @@ abstract trait TestUtils {
|
||||
|
||||
val why = failure.map({ e => ": " + e.getClass.getSimpleName + ": " + e.getMessage }).getOrElse("")
|
||||
|
||||
assertEquals("Can no longer deserialize the old format of " + o.getClass.getSimpleName + why,
|
||||
o, deserialized)
|
||||
assertFalse(failure.isDefined) // should have thrown if we had a failure
|
||||
|
||||
val byteStream = new ByteArrayOutputStream()
|
||||
val objectStream = new ObjectOutputStream(byteStream)
|
||||
objectStream.writeObject(o)
|
||||
objectStream.close()
|
||||
val hex = Hex.encodeHexString(byteStream.toByteArray())
|
||||
def showCorrectResult(): Unit = {
|
||||
if (expectedHex != hex) {
|
||||
@tailrec
|
||||
def outputStringLiteral(s: String): Unit = {
|
||||
@ -139,7 +136,20 @@ abstract trait TestUtils {
|
||||
System.err.println("\"\" + ") // line up all the lines by using empty string on first line
|
||||
outputStringLiteral(hex)
|
||||
}
|
||||
assertEquals(o.getClass.getSimpleName + " serialization has changed (though we still deserialized the old serialization)", expectedHex, hex)
|
||||
}
|
||||
|
||||
try {
|
||||
assertEquals("Can no longer deserialize the old format of " + o.getClass.getSimpleName + why,
|
||||
o, deserialized)
|
||||
assertFalse(failure.isDefined) // should have thrown if we had a failure
|
||||
|
||||
assertEquals(o.getClass.getSimpleName + " serialization has changed (though we still deserialized the old serialization)",
|
||||
expectedHex, hex)
|
||||
} catch {
|
||||
case e: Throwable =>
|
||||
showCorrectResult()
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
protected def checkSerializable[T: Manifest](expectedHex: String, o: T): T = {
|
||||
|
Loading…
Reference in New Issue
Block a user