Skip to content

Fix VM.getSavedProperty('os.name') not supported#577

Open
HritikRaj2 wants to merge 1 commit into
javapathfinder:masterfrom
HritikRaj2:fix-os-name-property
Open

Fix VM.getSavedProperty('os.name') not supported#577
HritikRaj2 wants to merge 1 commit into
javapathfinder:masterfrom
HritikRaj2:fix-os-name-property

Conversation

@HritikRaj2
Copy link
Copy Markdown
Contributor

  • Add 'os.name' to system properties list in JPF_java_lang_System.java
  • Implement jdk.internal.misc.VM class with native methods
  • Add VM peer with saved property management in JPF_jdk_internal_misc_VM.java
  • Initialize VM saved properties from system properties during VM init
  • Add compilation exports for examples in source-sets.gradle
  • Include test case VMPropertyTest.java to verify functionality

Resolves GitHub issue #495

- Add 'os.name' to system properties list in JPF_java_lang_System.java
- Implement jdk.internal.misc.VM class with native methods
- Add VM peer with saved property management in JPF_jdk_internal_misc_VM.java
- Initialize VM saved properties from system properties during VM init
- Add compilation exports for examples in source-sets.gradle
- Include test case VMPropertyTest.java to verify functionality

Resolves GitHub issue javapathfinder#495
Copy link
Copy Markdown
Member

@cyrille-artho cyrille-artho left a comment

Choose a reason for hiding this comment

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

Thank you for your effort. Your changes look good, aside minor formatting issues.
Unfortunately, several unit tests now fail. Please look into that.
Perhaps we can include a subset of your changes so the unit tests still pass and work on other features later.

Comment thread gradle/source-sets.gradle
]
compileExamplesJava.options.compilerArgs += [
'--add-exports', 'java.base/jdk.internal.misc=ALL-UNNAMED'
] No newline at end of file
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please keep the newline character at the end of the file.

// <2do> - most if this isn't supported yet
SharedSecrets.setJavaLangAccess( createJavaLangAccess());

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Revert this change (whitespace) so we can merge this change more easily with other branches in the future.

static {
initialize();
}
} No newline at end of file
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Newline.

public static void main(String[] args) {
System.out.println(jdk.internal.misc.VM.getSavedProperty("os.name"));
}
} No newline at end of file
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Newline.

@@ -0,0 +1 @@
target=VMPropertyTest No newline at end of file
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Newline.

return (value != null) ? env.newString(value) : MJIEnv.NULL;
}

@MJI
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please revert this change (which only reformats code) as to facilitate merging code with other branches.

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