Skip to content

Commit

Permalink
Merge pull request #62 from oracle/develop
Browse files Browse the repository at this point in the history
Deliver version 5.3.0 to main for release
  • Loading branch information
jhalexand authored Jan 23, 2023
2 parents 5d1ab8d + 5b7ee59 commit 2fbd48a
Show file tree
Hide file tree
Showing 14 changed files with 897 additions and 32 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ Maven:
<dependency>
<groupId>com.oracle.labs.olcut</groupId>
<artifactId>olcut-core</artifactId>
<version>5.2.1</version>
<version>5.3.0</version>
</dependency>
```
or from Gradle:
```groovy
implementation 'com.oracle.labs.olcut:olcut-core:5.2.1'
implementation 'com.oracle.labs.olcut:olcut-core:5.3.0'
```

The `olcut-extras` artifact is designed as a small tool for developers, as such you should compile the appropriate
Expand Down Expand Up @@ -228,6 +228,7 @@ Pair | It's a pair class. The fields are final and it has equals and hash code s
Timers | `StopWatch` and `NanoWatch` provide handy timers, at millisecond or nanosecond granularity.
Sort Utilities | `SortUtil` rovides a sort function which returns the indices that the input elements should be rearranged. Very useful for finding the original position of a sorted object without zipping it yourself.
Stream Utilities | In Java 8 the stream API can run inside a Fork-Join Pool to bound the parallelism, but it does not bound the computation of the chunk size correctly. `StreamUtil` provides a bounded stream which knows how many threads are allocated, and so calculates the correct work chunk size. It also has methods for zipping two streams, and a special spliterator (`IOSpliterator`) which chunks work appropriately for reading from a IO system like a DB or a file.
SubprocessConnection | Provides a simple mechanism for communicating over stdio with a subprocess (e.g. python script or an executable).

## Contributing

Expand Down
8 changes: 4 additions & 4 deletions THIRD_PARTY_LICENSES.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
jline 3.21.0
jline 3.22.0

Copyright (c) 2002-2018, the original author or authors.
All rights reserved.
Expand Down Expand Up @@ -35,7 +35,7 @@ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
OF THE POSSIBILITY OF SUCH DAMAGE.

jackson-core, jackson-databind 2.13.2, 2.13.2.2
jackson-core, jackson-databind 2.14.1, 2.14.1


Apache License
Expand Down Expand Up @@ -240,7 +240,7 @@ jackson-core, jackson-databind 2.13.2, 2.13.2.2
See the License for the specific language governing permissions and
limitations under the License.

junit 5.8.2
junit 5.9.2

Copyright 2015-2021 the original author or authors.

Expand Down Expand Up @@ -576,7 +576,7 @@ this Agreement will bring a legal action under this Agreement more than
one year after the cause of action arose. Each party waives its rights to
a jury trial in any resulting litigation.

protobuf-java 3.19.4
protobuf-java 3.19.6

Copyright 2008 Google Inc. All rights reserved.

Expand Down
2 changes: 1 addition & 1 deletion olcut-config-edn/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.0</version>
<version>3.3.0</version>
<configuration>
<archive>
<manifestEntries>
Expand Down
2 changes: 1 addition & 1 deletion olcut-config-protobuf/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.0</version>
<version>3.3.0</version>
<configuration>
<archive>
<manifestEntries>
Expand Down
2 changes: 1 addition & 1 deletion olcut-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.0</version>
<version>3.3.0</version>
<configuration>
<archive>
<manifestEntries>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ private static String formattedProvenanceString(ObjectProvenance prov, int depth
*/
private static void formatProvenance(Provenance innerProv, StringBuilder builder, String tabs, int depth) {
if (innerProv instanceof PrimitiveProvenance) {
builder.append(((PrimitiveProvenance<?>)innerProv).getValue().toString());
builder.append(((PrimitiveProvenance<?>)innerProv).getValue());
} else if (innerProv instanceof ListProvenance) {
ListProvenance<?> listProv = (ListProvenance<?>) innerProv;
if (listProv.getList().isEmpty()) {
Expand Down Expand Up @@ -435,7 +435,7 @@ public static Map<String, Object> convertToMap(ObjectProvenance prov) {
*/
private static Object innerConvertToMap(Provenance prov) {
if (prov instanceof PrimitiveProvenance) {
return ((PrimitiveProvenance<?>)prov).getValue().toString();
return String.valueOf(((PrimitiveProvenance<?>)prov).getValue());
} else if (prov instanceof ListProvenance) {
ListProvenance<?> listProv = (ListProvenance<?>) prov;
if (listProv.getList().isEmpty()) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2004-2020, Oracle and/or its affiliates.
* Copyright (c) 2004, 2022, Oracle and/or its affiliates.
*
* Licensed under the 2-clause BSD license.
*
Expand Down Expand Up @@ -28,26 +28,43 @@

package com.oracle.labs.mlrg.olcut.util;

import java.util.Objects;

/**
* A mutable version of java.lang.Double.
*/
public final class MutableDouble extends MutableNumber {
public final class MutableDouble extends MutableNumber implements Comparable<MutableDouble> {
private static final long serialVersionUID = 1L;

private double value;

/**
* Constructs a mutable boxed double with the specified value.
* @param value The initial value.
*/
public MutableDouble(double value) {
this.value = value;
}

/**
* Constructs a mutable boxed double containing zero.
*/
public MutableDouble() {
value = 0L;
}

/**
* Constructs a copy of the supplied mutable double.
* @param other The value to copy.
*/
public MutableDouble(MutableDouble other) {
value = other.value;
}

/**
* Constructs a copy of the supplied number using {@link Number#doubleValue()}.
* @param other The value to copy.
*/
public MutableDouble(Number other) {
value = other.doubleValue();
}
Expand Down Expand Up @@ -125,4 +142,22 @@ public String toString() {
public MutableDouble copy() {
return new MutableDouble(value);
}

@Override
public int compareTo(MutableDouble o) {
return Double.compare(value,o.value);
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
MutableDouble that = (MutableDouble) o;
return Double.compare(that.value, value) == 0;
}

@Override
public int hashCode() {
return Objects.hash(value);
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2004-2020, Oracle and/or its affiliates.
* Copyright (c) 2004, 2022, Oracle and/or its affiliates.
*
* Licensed under the 2-clause BSD license.
*
Expand Down Expand Up @@ -28,26 +28,43 @@

package com.oracle.labs.mlrg.olcut.util;

import java.util.Objects;

/**
* A mutable version of java.lang.Long.
*/
public final class MutableLong extends MutableNumber {
public final class MutableLong extends MutableNumber implements Comparable<MutableLong> {
private static final long serialVersionUID = 1L;

private long value;

/**
* Constructs a mutable boxed long with the supplied value.
* @param value The initial value.
*/
public MutableLong(long value) {
this.value = value;
}

/**
* Constructs a mutable boxed long with initial value zero.
*/
public MutableLong() {
value = 0L;
}

/**
* Copies the supplied MutableLong.
* @param other The value to copy.
*/
public MutableLong(MutableLong other) {
value = other.value;
}

/**
* Copies the supplied Number using {@link Number#longValue()}.
* @param other The value to copy.
*/
public MutableLong(Number other) {
value = other.longValue();
}
Expand Down Expand Up @@ -121,8 +138,26 @@ public String toString() {
return ""+value;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
MutableLong that = (MutableLong) o;
return value == that.value;
}

@Override
public int hashCode() {
return Objects.hash(value);
}

@Override
public MutableLong copy() {
return new MutableLong(value);
}

@Override
public int compareTo(MutableLong o) {
return Long.compare(value,o.value);
}
}
Loading

0 comments on commit 2fbd48a

Please sign in to comment.