Skip to content

Commit d37bbdd

Browse files
author
Owen Jones
committed
Add brief documentation of overlay classes
It could be expanded in future, but it's better than what was there before
1 parent a6108ec commit d37bbdd

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

jbmc/src/java_bytecode/java_class_loader.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,16 @@ java_class_loadert::parse_tree_with_overlayst &java_class_loadert::operator()(
6969
}
7070

7171
/// Check if class is an overlay class by searching for `ID_overlay_class` in
72-
/// its list of annotations. TODO(nathan) give a short explanation about what
73-
/// overlay classes are.
72+
/// its list of annotations.
73+
///
74+
/// An overlay class is a class with the annotation @OverlayClassImplementation.
75+
/// They serve the following purpose. When the JVM searches the classpath for a
76+
/// particular class, it uses the first one it finds that matches, and ignores
77+
/// any other matching ones. JBMC, however, will take account of other matching
78+
/// ones which are overlay classes. The overlay classes can add or
79+
/// replace parts of the first matching class, e.g. adding a new method or
80+
/// changing the definition of a method.
81+
///
7482
/// \param c: a `classt` object from a java byte code parse tree
7583
/// \return true if parsed class is an overlay class, else false
7684
static bool is_overlay_class(const java_bytecode_parse_treet::classt &c)

0 commit comments

Comments
 (0)