Skip to content

Use StackWalker instread of sun.misc.SharedSecrets #24

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

Merged
merged 1 commit into from
May 6, 2018

Conversation

gayanW
Copy link
Collaborator

@gayanW gayanW commented May 2, 2018

Use StackWalking API instead of the non-standard sun.misc.SharedSecrets API to access caller information.

This fixes errors:

[javac]   error: cannot find symbol
[javac]   symbol:   class SharedSecrets
[javac]   location: package sun.misc

[javac]   error: cannot find symbol
[javac]   symbol:   class JavaLangAccess
[javac]   location: class HashedAllocationContext

Fixes: #22

Use StackWalking API instead of the non-standard sun.misc.SharedSecrets API to access caller information.

This fixes errors:
    [javac]   error: cannot find symbol
    [javac]   symbol:   class SharedSecrets
    [javac]   location: package sun.misc

    [javac]   error: cannot find symbol
    [javac]   symbol:   class JavaLangAccess
    [javac]   location: class HashedAllocationContext

Fixes: javapathfinder#22

StackTraceElement e = JLA.getStackTraceElement(throwable, 4); // see note below regarding fixed call depth fragility
// <2do> this sucks - MJIEnv.newObject/newArray/newString are used from a gazillion of places that might not differ in SUT state
if (e.getClassName() == ENV_CLSNAME && e.getMethodName().startsWith("new")){
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cyrille-artho is that ok that we use the == instead of equals()?

@cyrille-artho
Copy link
Member

cyrille-artho commented May 2, 2018 via email

@cyrille-artho cyrille-artho merged commit 9688cec into javapathfinder:java-10 May 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants