Commit Graph

26 Commits

Author SHA1 Message Date
Chris Rankin
9ebe464f63 CORDA-2775: Simplify SourceClassLoader logic for DJVM. (#4913) 2019-03-22 09:27:32 +00:00
Chris Rankin
e6804aead6 CORDA-2750: Fix published names for DJVM artifacts. (#4911) 2019-03-21 14:13:15 +00:00
Chris Rankin
abbf2562c2 CORDA-2750: Modularise the DJVM build. (#4897)
* CORDA-2750: Modularise the DJVM build.

* CORDA-2750: Update documentation and scripts for modular DJVM.
2019-03-17 06:06:51 +00:00
Chris Rankin
03967742e4 CORDA-2747: Package DJVM CLI for delivery. (#4893)
* Modify DJVM CLI so that it runs as executable JAR.
 * Package DJVM CLI as a distributable ZIP.
 * Add djvm.bat file for Windows.
2019-03-14 17:42:39 +00:00
Chris Rankin
b6fe3b2a81 CORDA-2725: Include DEBUG in DJVM CLI help's list of logging levels. (#4868) 2019-03-10 14:39:22 +00:00
Chris Rankin
ec5cbc2971 CORDA-2721: Update djvm check documentation, and fix CLI tool installation. (#4865)
* CORDA-2721: Fix DJVM CLI installation and runtime scripts.

* Update DJVM documentation to explain about `RuleViolationError`.

* CORDA-2721: Add comment about constants.properties being parsed by DJVM CLI scripts.
2019-03-09 18:27:45 +00:00
Chris Rankin
9648b16ff1 CORDA-2725: Set DJVM CLI logging threshold to "TRACE". (#4867)
- Configure root logging level programmatically.
- Support DEBUG logging level.
2019-03-09 18:26:20 +00:00
Chris Rankin
46909feef9 Remove some unused classes from the DJVM. (#4809)
Simplify DJVM Gradle files.
2019-02-25 13:15:32 +00:00
Chris Rankin
136f6a6be6 CORDA-2667: Fix DJVM SourceClassLoader so that ASM will use it only to load classes from outside the sandbox. (#4804) 2019-02-22 14:03:54 +00:00
Chris Rankin
800697a907 CORDA-2654: Repair the DJVM CLI tool. (#4796)
* Replace SandboxedRunnable with Function interface.
Remove DJVM from "Key Concepts" release notes.
Update installation of shell tool.
Fix broken sandbox package names.
Make sure we only resolve each class once when loading.
Also remove some unused default parameter values.
Don't discard "bootstrap" sandbox.* classes because SourceClassLoader may need them.

* Restore DJVM to the "Key Concepts" docs.

* Remove all mention of "whitelisting" from the DJVM CLI.
2019-02-21 15:27:08 +00:00
Vitalij Reicherdt
67eb9fec43 fix unit test for different decimal separator for different locales (#4459)
* fix unit test for different decimal separator for different locales

* unused import removed
2018-12-31 07:51:49 +00:00
Chris Rankin
ff9061b968
ENT-1906: Don't transform java.Object[] to sandbox.Object[]. (#4115)
* Don't transform java.Object[] to sandbox.Object[] because an array is still java.Object inside the sandbox.
* Add extra test for sandboxing an array of int[].
* Ensure hashCode() is deterministic for Java arrays.
* Remove some information about DJVM from some exception stack traces.
2018-10-29 16:32:40 +00:00
Chris Rankin
01799cfc2d
ENT-1906: Allow sandboxes to share a parent classloader. (#4103)
* Allow sandboxes to share a parent classloader.
* Tidy up DJVM test code.
* Add review fixes.
* Declare SandboxClassLoadingException as a RuntimeException. This preserves the SandboxClassLoader.loadClass(String) contract from Java.
* Also add extra test cases.
2018-10-25 11:12:20 +01:00
Chris Rankin
e10119031c
ENT-1906: Allow DJVM code to throw and catch sandbox exceptions. (#4088)
* First phase of supporting exceptions within the DJVM.
* Suppress unwanted inspection warnings about Kotlin/Java Map.
* Add support for exception stack traces within the sandbox.
* Simple review fixes.
* Extra fixes after review.
* Add DJVM support for String.intern().
* Partially restore implementation of SandboxClassLoader.loadClass().
* More review fixes.
2018-10-19 17:23:14 +01:00
Chris Rankin
af48612d46
ENT-1906: Fix JavaDoc error for DJVM. (#4063) 2018-10-15 10:40:58 +01:00
Shams Asari
aced03df54
CORDA-1274: Migrated usage of FastClasspathScanner to ClassGraph (#4060)
FastClasspathScanner was renamed to ClassGraph for the version 4 release
2018-10-11 19:50:26 +01:00
Chris Rankin
825c544cac
ENT-1906: Modify the DJVM to wrap Java primitive types. (#4035)
* WIP - sandbox classloading
* Fix handling of Appendable in the sandbox.
* WIP - Load wrapped Java types into SandboxClassLoader.
* Add explicit toDJVM() invocation after invoking Object.toString().
* Add simple ThreadLocal to the sandbox to complete AbstractStringBuilder.
* Add support for Enum types inside the sandbox.
* Simplify type conversions into and out of the sandbox.
* Small refactors and comments to tidy up code.
* Fix Enum support to include EnumSet and EnumMap.
* Fix use of "$" in whitelist regexps.
* Add extra methods (i.e. bridges) to stitched interfaces.
* Rename ToDJVMStringWrapper to StringReturnTypeWrapper.
* Support lambdas within the sandbox.
* Fix mapping of java.lang.System into the sandbox.
* Don't remap exception classes that we catch into sandbox classes.
* Remove unnecessary "bootstrap" classes from the DJVM jar.
* Ensure that Character.UnicodeScript is available inside the sandbox.
* Tweak sandboxed implementations of System and Runtime.
* Ensure that Character.UnicodeScript is loaded correctly as Enum type.
* Disallow invoking methods of ClassLoader inside the sandbox.
* Apply updates after review.
* More review fixes.
2018-10-11 13:48:32 +01:00
Chris Rankin
b3b327c135
ENT-1906: Upgrade DJVM to use ASM 6.2.1. (#4000) 2018-09-28 11:53:25 +01:00
Chris Rankin
d35a47bc82
ENT-1906: Update DJVM to load deterministic rt.jar into sandbox. (#3973)
* Update DJVM to load deterministic rt.jar into sandbox.
* Disallow invocations of notify(), notifyAll() and wait() APIs.
* Pass entire derivedMember to MemberVisitorImpl.
* Updates after review.
* Refactor MethodBody handlers to use EmitterModule.
2018-09-27 17:28:22 +01:00
Chris Rankin
1c7dfd4b7b
CORDA-1964: Unify versioning of the shadow plugin, and resolve more issues for Gradle 5.0. (#3918) 2018-09-13 10:55:52 +01:00
Chris Rankin
4183d55650
ENT-1906: Publish corda-deterministic-verifier artifact for testing cordapps. (#3910) 2018-09-07 15:07:06 +01:00
Chris Rankin
e3ece00bea ENT-1906: Publish DJVM artifact with its dependency information. (#3897)
Also migrate enclavelet code into testing:common jar.
2018-09-05 15:57:12 +01:00
Chris Rankin
541a0d7d5b
ENT-1906: Remove SLF4J's JUL logging bridge from DJVM. (#3895)
* Remove SLF4J's JUL logging bridge from DJVM.
* Refactor SLF4J's Log4J back end into the CLI.
2018-09-05 14:05:52 +01:00
Chris Rankin
5b255c81a8
ENT-1906: Trivial tweaks to DJVM code. (#3890)
* Trivial tweaks to DJVM code.
  - Use ASM Type.getInternalName()
  - Use @JvmDefault annotation
  - Declare test base class as abstract
  - Ensure test Log4J configuration has precedence
  - Replace assert() with require()
  - Replace simple lambdas with function references
* Publish corda-djvm artifact.
* Migrate Utilities class into the CLI tool.
* Configure unit tests for console logging.
2018-09-05 10:12:48 +01:00
Chris Rankin
329c9da0a9
CID-251: Integrate DJVM with Corda's existing deterministic-rt. (#3846)
* Integrate DJVM with Corda's existing deterministic-rt.
* Remove generated whitelists from DJVM.
* Fix Manifest attributes, disable jar tasks and attach shadowJar to assemble task.
2018-08-24 15:51:40 +01:00
Tommy Lillehagen
d2ef16cbfd
Deterministic JVM (#3386)
* CID-251 - Deterministic JVM

* CID-251 - Add DJVM documentation

* CID-251 - Address review comments from @chrisr3

* CID-251 - Address further review comments from @chrisr3

* CID-251 - Use shadowJar to generate fat JAR

* CID-251 - Address review comments from @exFalso

* CID-251 - Improve naming in ReferenceMap

* CID-251 - Add test for Kotlin meta-class behaviour

* CID-251 - Address review comments from @shamsasari

* CID-251 - Add description of high-level flow

* CID-251 - Refactoring

* CID-251 - Rename package to net.corda.djvm

* CID-251 - Include deterministic-rt.jar as runtime dependency

* CID-251 - Add Gradle task for generating whitelist from deterministic rt.jar

* CID-251 - Error messages for StackOverflow/OutOfMemory, update whitelist

* CID-251 - Reduce set definition of pinned classes

* CID-251 - Tidy up logic around pinned classes

* CID-251 - Shade ASM dependency and split out CLI tool

* CID-251 - Address review comments from @mikehearn (part 1)

* CID-251 - Address review comments from @mikehearn (part 2)

* CID-251 - Address review comments from @mikehearn (part 3)

* CID-251 - Address review comments from @exFalso

* CID-251 - Address review comments from @mikehearn (part 4)

* CID-251 - Address review comments from @exFalso and @mikehearn

* CID-251 - Address review comments from @mikehearn (part 5)
2018-08-22 16:01:39 +01:00