New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
8237073: [lworld] Need special handling of jlO constructor invocation #481
Conversation
|
@sadayapalam This change now passes all automated pre-integration checks. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 2 new commits pushed to the
Please see this link for an up-to-date comparison between the source branch of this pull request and the
|
Webrevs
|
For
|
Thanks Mandy, I will include your changes. I assume you have taken a look at the test/jdk/ changes too |
They are dynalink tests that I'm not familiar with. I suspect it can be replaced with an instance of other class. I will take a look. |
@@ -183,7 +183,7 @@ public void afterTest() { | |||
public void getPropertyTest(final boolean publicLookup) throws Throwable { | |||
final MethodType mt = MethodType.methodType(Object.class, Object.class, String.class); | |||
final CallSite cs = createCallSite(publicLookup, GET_PROPERTY, mt); | |||
Assert.assertEquals(cs.getTarget().invoke(new Object(), "class"), Object.class); | |||
Assert.assertEquals(cs.getTarget().invoke(new Object(), "class"), java.util.Objects.newIdentity().getClass()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change looks okay but this may be unclear to the reader why the returned class is not Object.class.
An alternative fix is to define an explicit TestObject
class:
diff --git a/test/jdk/jdk/dynalink/BeanLinkerTest.java b/test/jdk/jdk/dynalink/BeanLinkerTest.java
index fafc1be447f..f22aab8f026 100644
--- a/test/jdk/jdk/dynalink/BeanLinkerTest.java
+++ b/test/jdk/jdk/dynalink/BeanLinkerTest.java
@@ -179,11 +179,13 @@ public class BeanLinkerTest {
this.linker = null;
}
+ static class TestObject {}
+
@Test(dataProvider = "flags")
public void getPropertyTest(final boolean publicLookup) throws Throwable {
final MethodType mt = MethodType.methodType(Object.class, Object.class, String.class);
final CallSite cs = createCallSite(publicLookup, GET_PROPERTY, mt);
- Assert.assertEquals(cs.getTarget().invoke(new Object(), "class"), Object.class);
+ Assert.assertEquals(cs.getTarget().invoke(new TestObject(), "class"), TestObject.class);
Assert.assertEquals(cs.getTarget().invoke(new Date(), "class"), Date.class);
}
@@ -191,14 +193,14 @@ public class BeanLinkerTest {
public void getPropertyNegativeTest(final boolean publicLookup) throws Throwable {
final MethodType mt = MethodType.methodType(Object.class, Object.class, String.class);
final CallSite cs = createCallSite(publicLookup, GET_PROPERTY, mt);
- Assert.assertNull(cs.getTarget().invoke(new Object(), "DOES_NOT_EXIST"));
+ Assert.assertNull(cs.getTarget().invoke(new TestObject(), "DOES_NOT_EXIST"));
}
@Test(dataProvider = "flags")
public void getPropertyTest2(final boolean publicLookup) throws Throwable {
final MethodType mt = MethodType.methodType(Object.class, Object.class);
final CallSite cs = createCallSite(publicLookup, GET_PROPERTY, "class", mt);
- Assert.assertEquals(cs.getTarget().invoke(new Object()), Object.class);
+ Assert.assertEquals(cs.getTarget().invoke(new TestObject()), TestObject.class);
Assert.assertEquals(cs.getTarget().invoke(new Date()), Date.class);
}
@@ -208,7 +210,7 @@ public class BeanLinkerTest {
final CallSite cs = createCallSite(publicLookup, GET_PROPERTY, "DOES_NOT_EXIST", mt);
try {
- cs.getTarget().invoke(new Object());
+ cs.getTarget().invoke(new TestObject());
throw new RuntimeException("Expected NoSuchDynamicMethodException");
} catch (final Throwable th) {
Assert.assertTrue(th instanceof NoSuchDynamicMethodException);
/integrate |
Going to push as commit 4609bad.
Your commit was automatically rebased without conflicts. |
@sadayapalam Pushed as commit 4609bad. |
Translate new Object() instantiations down to invovations of java.util.Objects.newIdentity() call with an informational message at compie time
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/valhalla pull/481/head:pull/481
$ git checkout pull/481
Update a local copy of the PR:
$ git checkout pull/481
$ git pull https://git.openjdk.java.net/valhalla pull/481/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 481
View PR using the GUI difftool:
$ git pr show -t 481
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/valhalla/pull/481.diff