Fix warnings

This commit is contained in:
Tony Garnock-Jones 2020-12-09 20:54:47 +01:00
parent 49f2b81dc6
commit 935b7ea5c3
14 changed files with 11 additions and 19 deletions

View File

@ -27,12 +27,12 @@ public abstract class AbstractProxy<T> implements InvocationHandler {
}
@Override
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
public Object invoke(Object proxy, Method method, Object[] args) {
if (method.equals(toStringMethod)) {
return this._ref.toString();
}
return dispatch(method, args);
}
abstract Object dispatch(Method method, Object[] args) throws Throwable;
abstract Object dispatch(Method method, Object[] args);
}

View File

@ -1,7 +1,7 @@
package org.syndicate_lang.actors;
public class ActorTerminated extends Exception {
private Actor _actor;
private final Actor _actor;
public ActorTerminated(Actor actor) {
super("Actor terminated: " + actor, actor.getExitReason());

View File

@ -9,7 +9,7 @@ public class AsyncProxy<T> extends AbstractProxy<T> {
}
@Override
public Object dispatch(Method method, Object[] args) throws Throwable {
public Object dispatch(Method method, Object[] args) {
if (method.getReturnType().equals(void.class)) {
this._ref.async((v) -> {
try {

View File

@ -1,7 +1,7 @@
package org.syndicate_lang.actors;
public class BrokenPromise extends RuntimeException {
private Promise<?> _promise;
private final Promise<?> _promise;
public BrokenPromise(Promise<?> promise) {
super(promise.getReason());

View File

@ -3,7 +3,7 @@ package org.syndicate_lang.actors;
import java.util.concurrent.ScheduledFuture;
public class PeriodicTimer {
private ScheduledFuture<?> _future;
private final ScheduledFuture<?> _future;
protected PeriodicTimer(ScheduledFuture<?> future) {
this._future = future;

View File

@ -5,7 +5,6 @@ import java.util.List;
import java.util.concurrent.*;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.Supplier;
public class Promise<T> implements Future<T> {

View File

@ -1,8 +1,5 @@
package org.syndicate_lang.actors;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.util.function.Consumer;
import java.util.function.Function;

View File

@ -1,6 +1,5 @@
package org.syndicate_lang.actors;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
@ -10,7 +9,7 @@ public class SyncProxy<T> extends AbstractProxy<T> {
}
@Override
public Object dispatch(Method method, Object[] args) throws Throwable {
public Object dispatch(Method method, Object[] args) {
return this._ref.sync((v) -> {
try {
return method.invoke(v, args);

View File

@ -1,5 +1,5 @@
package org.syndicate_lang.actors;
public interface ThrowingSupplier<T> {
public T get() throws Throwable;
T get() throws Throwable;
}

1
src/test/erlang/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
ring.beam

View File

@ -1,6 +1,6 @@
package org.syndicate_lang.actors.example.example1;
public interface IValueHolder<T> {
public T get();
public void set(T newValue);
T get();
void set(T newValue);
}

View File

@ -1,7 +1,5 @@
package org.syndicate_lang.actors.example.example1;
import java.util.concurrent.Future;
public class ValueHolder<T> implements IValueHolder<T> {
private T value;

View File

@ -1,7 +1,6 @@
package org.syndicate_lang.actors.example.example2;
import org.syndicate_lang.actors.Remote;
// import java.util.Random;
public class Forwarder implements IForwarder {
private final Remote<IForwarder> _main;

View File

@ -1,6 +1,5 @@
package org.syndicate_lang.actors.example.example2;
import org.syndicate_lang.actors.Actor;
import org.syndicate_lang.actors.Remote;
public interface IForwarder {