-
Notifications
You must be signed in to change notification settings - Fork 61
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
8253243: Investigate ways to make MemorySegment::ofNativeRestricted more composable #328
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -29,8 +29,8 @@ | |||||
*/ | ||||||
|
||||||
import jdk.incubator.foreign.MemoryAddress; | ||||||
import jdk.incubator.foreign.MemorySegment; | ||||||
|
||||||
import jdk.incubator.foreign.MemorySegment; | ||||||
import org.testng.annotations.Test; | ||||||
|
||||||
public class TestNoForeignUnsafeOverride { | ||||||
|
@@ -40,6 +40,6 @@ public class TestNoForeignUnsafeOverride { | |||||
|
||||||
@Test(expectedExceptions = IllegalAccessError.class) | ||||||
public void testUnsafeAccess() { | ||||||
MemorySegment.ofNativeRestricted(MemoryAddress.ofLong(42), 10, null, null, null); | ||||||
MemorySegment.ofNativeRestricted(); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should be:
Suggested change
Right? To retain the same behaviour? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This test is, if I understand correctly, simply testing that you can't calla restricted method if the JDK property has not been set on the command line. It's not important WHICH restricted method is called. At the time the test was written we didn't have the more succint ofNativeRestricted - now we do, so I thought to just use that, for brevity. |
||||||
} | ||||||
} |
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.
Maybe the exception should be re-thrown after doing critical cleanup?
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.
We could do that - but I'd prefer to leave this as is.