corda/experimental
Tommy Lillehagen fe313951ea CORDA-1609 - Don't use reserved keyword as method name
As reported in [CORDA-1609](https://r3-cev.atlassian.net/browse/CORDA-1609),
`CordaRPCClientConfiguration.default` is not accessible from Java since
`default` is a reserved keyword.

As part of the refactor made in #2831, `CordaRPCClientConfiguration` went
from being a data class to an interface with a backing implementation of
type `CordaRPCClientConfigurationImpl`.

This resulted in Java users having to rewrite code that was on the form:

```java
final CordaRPCClient client = new CordaRPCClient(
    nodeAddress, CordaRPCClientConfiguration.DEFAULT
);
```

to something like this:

```java
final CordaRPCClient client = new CordaRPCClient(
    nodeAddress, CordaRPCClientConfiguration.Companion.default()
);
```

However, this does not work. The user would get a compilation error because
`default` is a reserved keyword in Java.

Since `CordaRPCClientConfiguration` has been made an interface, there is no
easy way of introducing a static final field on the interface from Kotlin.

Consequently, I've changed this back to using a `class` with a static field
named `DEFAULT` instead of the static method `default()`.

It should be noted that `default()` / `DEFAULT` is currently only used
internally to pass in default values in `CordaRPCClient.kt` and
`CordaRPCClientUtils.kt`. That said, it is exposed as part of our API
surface and consequently shouldn't be broken.

The latter means that in the above example, the user would actually not
have to provide the parameter at all:

```java
final CordaRPCClient client = new CordaRPCClient(nodeAddress);
```

As can be seen from the definition of `CordaRPCClient`:

```kotlin
class CordaRPCClient private constructor(...) {
    @JvmOverloads
    constructor(
        hostAndPort: NetworkHostAndPort,
        configuration: CordaRPCClientConfiguration = CordaRPCClientConfiguration.DEFAULT
    ) : this(hostAndPort, configuration, null)
```

The mentioned [refactor](7a077e76f0 (diff-0948c125db93a22263eb81eaf3161c17R65))
did not make it into the 3.1 release, so from an API-stability perspective,
this change can be applied without affecting our commitment to a
backwards compatible API..
2018-06-13 15:39:03 +01:00
..
avalanche Add simulation of the avalanche consensus protocol to experimental (#3283) 2018-06-04 13:33:34 +01:00
behave CORDA-1609 - Don't use reserved keyword as method name 2018-06-13 15:39:03 +01:00
corda-utils Replaced all uses of assert with require (#3309) 2018-06-06 00:31:41 +01:00
kryo-hook Re-enabled commented out test and fixed warnings in Finance. (#3206) 2018-05-21 17:00:30 +01:00
quasar-hook [CORDA-1472]: Crackdown on warnings. (#3136) 2018-05-14 21:15:52 +07:00
sandbox [CORDA-1472]: Crackdown on warnings. (#3136) 2018-05-14 21:15:52 +07:00
src Replaced all uses of assert with require (#3309) 2018-06-06 00:31:41 +01:00
build.gradle Spinoff driver into own project with demorun (#1401) 2017-09-05 09:50:51 +01:00
README.md Disable unit test for experimental projects (#2627) 2018-02-23 20:48:39 +00:00

Experimental module

The purpose of this module is to hold code that isn't yet ready for code review, but which still wants to be refactored and kept compiling as the underlying platform changes. Code placed into experimental must eventually either be moved into the main modules and go through code review, or be deleted.

Code placed here can be committed to directly onto master at any time as long as it doesn't break the build (no compile failures or unit test failures). Any commits here that break the build will simply be rolled back.

To help reduce the build times, unit tests for experimental projects have been disabled and will NOT run alongside the whole project tests run via Gradle. Add parameter experimental.test.enable (example command is gradlew test -Dexperimental.test.enable to enable those tests.