diff --git a/src/main/java/com/syncleus/grail/graph/AbstractSignalMultiplyingEdge.java b/src/main/java/com/syncleus/grail/graph/AbstractSignalMultiplyingEdge.java index 8e27cf49e4afb00dbfed61ba245e80a93e0637e9..b394b000ba0e880add66405eb038fbe2b9041e48 100644 --- a/src/main/java/com/syncleus/grail/graph/AbstractSignalMultiplyingEdge.java +++ b/src/main/java/com/syncleus/grail/graph/AbstractSignalMultiplyingEdge.java @@ -26,7 +26,7 @@ public abstract class AbstractSignalMultiplyingEdge implements SignalMultiplying private static final Random RANDOM = new Random(); private static final double RANGE = 2.0; private static final double OFFSET = -1.0; - private static final double SCALE = 1.0 / 10.0; + private static final double SCALE = 0.1; @Initializer public void init() { diff --git a/src/main/java/com/syncleus/grail/graph/TypedAdjacencyMethodHandler.java b/src/main/java/com/syncleus/grail/graph/TypedAdjacencyMethodHandler.java index d6e5ef3608bddf48ef684061f96ffb39bc70203c..4f6145b2b07f5fad1e05c8a341d82af931b23900 100644 --- a/src/main/java/com/syncleus/grail/graph/TypedAdjacencyMethodHandler.java +++ b/src/main/java/com/syncleus/grail/graph/TypedAdjacencyMethodHandler.java @@ -52,10 +52,10 @@ public class TypedAdjacencyMethodHandler implements MethodHandler<TypedAdjacency if( ClassUtilities.isAddMethod(method) ) { if( arguments == null ) - throw new IllegalStateException("method " + method.getName() + " was annotated with @TypedAdjacency but had no arguments."); + throw new IllegalStateException(method.getName() + " was annotated with @TypedAdjacency but had no arguments."); else if( arguments.length == 1 ) { if( !(arguments[0] instanceof Class) ) - throw new IllegalStateException("method " + method.getName() + " was annotated with @TypedAdjacency, had a single argument, but that argument was not of the type Class"); + throw new IllegalStateException(method.getName() + " was annotated with @TypedAdjacency, had a single argument, but that argument was not of the type Class"); final Class type = (Class) arguments[0]; @@ -64,14 +64,14 @@ public class TypedAdjacencyMethodHandler implements MethodHandler<TypedAdjacency return TypedAdjacencyMethodHandler.addNode(type, annotation.direction(), annotation.label(), framedGraph, vertex); } else - throw new IllegalStateException("method " + method.getName() + " was annotated with @TypedAdjacency but had more than 1 arguments."); + throw new IllegalStateException(method.getName() + " was annotated with @TypedAdjacency but had more than 1 arguments."); } else if( ClassUtilities.isGetMethod(method) ) { if( arguments == null ) - throw new IllegalStateException("method " + method.getName() + " was annotated with @TypedAdjacency but had no arguments."); + throw new IllegalStateException(method.getName() + " was annotated with @TypedAdjacency but had no arguments."); else if( arguments.length == 1 ) { if( !(arguments[0] instanceof Class) ) - throw new IllegalStateException("method " + method.getName() + " was annotated with @TypedAdjacency, had a single argument, but that argument was not of the type Class"); + throw new IllegalStateException(method.getName() + " was annotated with @TypedAdjacency, had a single argument, but that argument was not of the type Class"); final Class type = (Class) arguments[0]; @@ -82,10 +82,10 @@ public class TypedAdjacencyMethodHandler implements MethodHandler<TypedAdjacency return this.getNode(type, annotation.direction(), annotation.label(), framedGraph, vertex); } else - throw new IllegalStateException("method " + method.getName() + " was annotated with @TypedAdjacency but had more than 1 arguments."); + throw new IllegalStateException(method.getName() + " was annotated with @TypedAdjacency but had more than 1 arguments."); } else - throw new IllegalStateException("method " + method.getName() + " was annotated with @TypedAdjacency but did not begin with either of the following keywords: add, get"); + throw new IllegalStateException(method.getName() + " was annotated with @TypedAdjacency but did not begin with either of the following keywords: add, get"); } private Iterable getNodes(final Class type, final Direction direction, final String label, final FramedGraph<?> framedGraph, final Vertex vertex) { diff --git a/src/main/java/com/syncleus/grail/graph/TypedIncidenceMethodHandler.java b/src/main/java/com/syncleus/grail/graph/TypedIncidenceMethodHandler.java index c2a36f131defabb07163514fa66e841a573f6ecd..782d45faca2eea5e156d3a7fabf03d7edd28b411 100644 --- a/src/main/java/com/syncleus/grail/graph/TypedIncidenceMethodHandler.java +++ b/src/main/java/com/syncleus/grail/graph/TypedIncidenceMethodHandler.java @@ -50,10 +50,10 @@ public class TypedIncidenceMethodHandler implements MethodHandler<TypedIncidence if( ClassUtilities.isGetMethod(method) ) { if( arguments == null ) - throw new IllegalStateException("method " + method.getName() + " was annotated with @TypedIncidence but had no arguments."); + throw new IllegalStateException(method.getName() + " was annotated with @TypedIncidence but had no arguments."); else if( arguments.length == 1 ) { if( !(arguments[0] instanceof Class) ) - throw new IllegalStateException("method " + method.getName() + " was annotated with @TypedIncidence, had a single argument, but that argument was not of the type Class"); + throw new IllegalStateException(method.getName() + " was annotated with @TypedIncidence, had a single argument, but that argument was not of the type Class"); final Class type = (Class) arguments[0]; @@ -66,10 +66,10 @@ public class TypedIncidenceMethodHandler implements MethodHandler<TypedIncidence return this.getEdge(type, annotation.direction(), annotation.label(), framedGraph, vertex); } else - throw new IllegalStateException("method " + method.getName() + " was annotated with @TypedIncidence but had more than 1 arguments."); + throw new IllegalStateException(method.getName() + " was annotated with @TypedIncidence but had more than 1 arguments."); } else - throw new IllegalStateException("method " + method.getName() + " was annotated with @TypedIncidence but did not begin with either of the following keywords: add, get"); + throw new IllegalStateException(method.getName() + " was annotated with @TypedIncidence but did not begin with either of the following keywords: add, get"); } private Iterable getEdges(final Class type, final Direction direction, final String label, final FramedGraph<?> framedGraph, final Vertex vertex) { diff --git a/src/main/java/com/syncleus/grail/graph/action/AbstractActionTrigger.java b/src/main/java/com/syncleus/grail/graph/action/AbstractActionTrigger.java index 16e3f35c038418068426d96f32084af957294680..933905d9aefc1c3ed78c7f70da3630924676ffdf 100644 --- a/src/main/java/com/syncleus/grail/graph/action/AbstractActionTrigger.java +++ b/src/main/java/com/syncleus/grail/graph/action/AbstractActionTrigger.java @@ -22,7 +22,7 @@ import java.lang.reflect.Method; import java.util.*; public abstract class AbstractActionTrigger implements ActionTrigger { - private final static Map<Class<?>, Map<String, Set<Method>>> ACTION_METHOD_CACHE = new HashMap<>(); + private static final Map<Class<?>, Map<String, Set<Method>>> ACTION_METHOD_CACHE = new HashMap<>(); protected static final Map<String, Set<Method>> populateCache(final Class<?> parentClass) { Map<String, Set<Method>> actionMethods = AbstractActionTrigger.ACTION_METHOD_CACHE.get(parentClass);