diff --git a/docs/runtime/ir-caching.md b/docs/runtime/ir-caching.md index 152cdbe6ba8..b4a8a6c07e5 100644 --- a/docs/runtime/ir-caching.md +++ b/docs/runtime/ir-caching.md @@ -171,6 +171,10 @@ Every `Persistance` class has a unique identifier. In order to keep definitions consistent one should not attempt to use smaller `id`s than previously assigned. One should also not delete any `Persistance` classes. +Additionally, `PerMap.serialVersionUID` version provides a seed to the version +stamp calculated from all `Persistance` classes. Increasing the +`serialVersionUID` will invalidate all caches. + ## Loading the IR Loading the IR is a multi-stage process that involves performing integrity diff --git a/engine/runtime-compiler/src/main/scala/org/enso/compiler/data/BindingsMap.scala b/engine/runtime-compiler/src/main/scala/org/enso/compiler/data/BindingsMap.scala index 1ac00671850..ed8010912e6 100644 --- a/engine/runtime-compiler/src/main/scala/org/enso/compiler/data/BindingsMap.scala +++ b/engine/runtime-compiler/src/main/scala/org/enso/compiler/data/BindingsMap.scala @@ -21,10 +21,6 @@ import scala.annotation.unused * @param definedEntities the list of entities defined in the current module * @param currentModule the module holding these bindings */ - -@SerialVersionUID( - 9057L // Use BindingsMap -) case class BindingsMap( definedEntities: List[DefinedEntity], currentModule: ModuleReference diff --git a/engine/runtime-parser/src/main/java/org/enso/compiler/core/IR.java b/engine/runtime-parser/src/main/java/org/enso/compiler/core/IR.java index f209b534de0..1f446a948fc 100644 --- a/engine/runtime-parser/src/main/java/org/enso/compiler/core/IR.java +++ b/engine/runtime-parser/src/main/java/org/enso/compiler/core/IR.java @@ -1,6 +1,5 @@ package org.enso.compiler.core; -import java.io.Serializable; import java.util.UUID; import java.util.function.Function; import org.enso.compiler.core.ir.DiagnosticStorage; @@ -28,9 +27,7 @@ import scala.collection.immutable.List; * *
See also: Note [IR Equality and hashing] */ -public interface IR extends Serializable { - - long serialVersionUID = 9057L; // Scala to Java +public interface IR { /** * Storage for metadata that the node has been tagged with as the result of various compiler diff --git a/engine/runtime-parser/src/main/scala/org/enso/compiler/core/ir/Module.scala b/engine/runtime-parser/src/main/scala/org/enso/compiler/core/ir/Module.scala index 3bf03f2465f..6c02caccbce 100644 --- a/engine/runtime-parser/src/main/scala/org/enso/compiler/core/ir/Module.scala +++ b/engine/runtime-parser/src/main/scala/org/enso/compiler/core/ir/Module.scala @@ -19,9 +19,6 @@ import java.util.UUID * @param passData the pass metadata associated with this node * @param diagnostics compiler diagnostics for this node */ -@SerialVersionUID( - 9057L // Use BindingsMap -) // prevents reading broken caches, see PR-3692 for details final case class Module( imports: List[Import], exports: List[Export], diff --git a/lib/java/persistance/src/main/java/org/enso/persist/PerMap.java b/lib/java/persistance/src/main/java/org/enso/persist/PerMap.java index fd640994c1f..253884d825e 100644 --- a/lib/java/persistance/src/main/java/org/enso/persist/PerMap.java +++ b/lib/java/persistance/src/main/java/org/enso/persist/PerMap.java @@ -7,6 +7,8 @@ import java.util.Map; import org.openide.util.lookup.Lookups; final class PerMap { + + private static final int serialVersionUID = 8689; // Use PR number private static final Collection extends Persistance> ALL; static { @@ -20,7 +22,7 @@ final class PerMap { final int versionStamp; private PerMap() { - int hash = 0; + int hash = serialVersionUID; for (var orig : ALL) { var p = orig.newClone(); var prevId = ids.put(p.id, p);