Browse Source

Fix warnings

main
Tony Garnock-Jones 11 months ago
parent
commit
935b7ea5c3
  1. 4
      src/main/java/org/syndicate_lang/actors/AbstractProxy.java
  2. 2
      src/main/java/org/syndicate_lang/actors/ActorTerminated.java
  3. 2
      src/main/java/org/syndicate_lang/actors/AsyncProxy.java
  4. 2
      src/main/java/org/syndicate_lang/actors/BrokenPromise.java
  5. 2
      src/main/java/org/syndicate_lang/actors/PeriodicTimer.java
  6. 1
      src/main/java/org/syndicate_lang/actors/Promise.java
  7. 3
      src/main/java/org/syndicate_lang/actors/Remote.java
  8. 3
      src/main/java/org/syndicate_lang/actors/SyncProxy.java
  9. 2
      src/main/java/org/syndicate_lang/actors/ThrowingSupplier.java
  10. 1
      src/test/erlang/.gitignore
  11. 4
      src/test/java/org/syndicate_lang/actors/example/example1/IValueHolder.java
  12. 2
      src/test/java/org/syndicate_lang/actors/example/example1/ValueHolder.java
  13. 1
      src/test/java/org/syndicate_lang/actors/example/example2/Forwarder.java
  14. 1
      src/test/java/org/syndicate_lang/actors/example/example2/IForwarder.java

4
src/main/java/org/syndicate_lang/actors/AbstractProxy.java

@ -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);
}

2
src/main/java/org/syndicate_lang/actors/ActorTerminated.java

@ -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());

2
src/main/java/org/syndicate_lang/actors/AsyncProxy.java

@ -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 {

2
src/main/java/org/syndicate_lang/actors/BrokenPromise.java

@ -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());

2
src/main/java/org/syndicate_lang/actors/PeriodicTimer.java

@ -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;

1
src/main/java/org/syndicate_lang/actors/Promise.java

@ -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> {

3
src/main/java/org/syndicate_lang/actors/Remote.java

@ -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;

3
src/main/java/org/syndicate_lang/actors/SyncProxy.java

@ -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);

2
src/main/java/org/syndicate_lang/actors/ThrowingSupplier.java

@ -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

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

4
src/test/java/org/syndicate_lang/actors/example/example1/IValueHolder.java

@ -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);
}

2
src/test/java/org/syndicate_lang/actors/example/example1/ValueHolder.java

@ -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;

1
src/test/java/org/syndicate_lang/actors/example/example2/Forwarder.java

@ -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;

1
src/test/java/org/syndicate_lang/actors/example/example2/IForwarder.java

@ -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 {

Loading…
Cancel
Save