Commit Graph

15 Commits

Author SHA1 Message Date
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