-
Bug
-
Resolution: Fixed
-
P4
-
repo-valhalla
-
generic
-
generic
From http://cr.openjdk.java.net/~briangoetz/valhalla/sov/02-object-model.html
To distinguish between inline and identity classes at compile time and runtime, we introduce a pair of restricted interfaces: IdentityObject and InlineObject. Inline classes implicitly implement InlineObject; identity classes implicitly implement IdentityObject. (It is an error to attempt to implement both.) This enables us to write code that dynamically tests for object identity before performing identity-sensitive operations:
if (x instanceof IdentityObject)) {
synchronized(x) { ... }
}
as well as statically reflecting the requirement for identity in types (and generic type bounds):
static void runWithLock(IdentityObject lock, Runnable r) {
synchronized (lock) {
r.run();
}
}
This ticket is introduce the new top interfaces and wire them in
To distinguish between inline and identity classes at compile time and runtime, we introduce a pair of restricted interfaces: IdentityObject and InlineObject. Inline classes implicitly implement InlineObject; identity classes implicitly implement IdentityObject. (It is an error to attempt to implement both.) This enables us to write code that dynamically tests for object identity before performing identity-sensitive operations:
if (x instanceof IdentityObject)) {
synchronized(x) { ... }
}
as well as statically reflecting the requirement for identity in types (and generic type bounds):
static void runWithLock(IdentityObject lock, Runnable r) {
synchronized (lock) {
r.run();
}
}
This ticket is introduce the new top interfaces and wire them in
- relates to
-
JDK-8237952 [lworld] Examine Class::getAnnotatedInterfaces and other annotation-related API
- Resolved
-
JDK-8238895 [lworld] Serial Version UID should ignore IdentityClass interface
- Closed
-
JDK-8242612 [lworld] Javac should not expressly encode the new super interface types in class files
- Resolved
-
JDK-8241622 [lworld] Valhalla test failures in com/sun/jdi/GenericsTest.java
- Closed