Unverified Commit 55b639d6 authored by Jeffrey Phillips Freeman's avatar Jeffrey Phillips Freeman 💥
Browse files

fix: fixed several bugs found from the new unit tests.

parent 4d99f6f5
......@@ -23,10 +23,14 @@
* Removed the upper bound on traversal generics. The travese function's argument has changed from
`GraphTraversal<? extends Vertex, ? extends Vertex>` to `GraphTraversal<Vertex, Vertex>`.
* Expanded documentation to cover all the annotations availible in greater detail, including recent changes.
* `AnnotationFrameFactory` was redesigned to make it easier to inhereit from the class and add support for additional
* `AnnotationFrameFactory` was redesigned to make it easier to inherit from the class and add support for additional
custom annotations.
* `AbstractAnnotationFrameFactory` was created to help create custom annotations that replace the existing standard
annotations provided by `AnnotationFrameFactory`.
* Fixed a `NullPointerException` thrown any time `DelegatingFramedGraph.addFramedEdgeExplicit` was called.
* Fixed a `IllegalStateException` thrown anytime `DefaultTraversable.nextOrAdd()` was called.
* Fixed a `IllegalStateException` thrown when `PolymorphicTypeResolver.resolve()` is called on a class without type
information.
* Updated the following dependencies
* gson: 2.8.1 -> 2.8.2
......
......@@ -79,7 +79,7 @@ public class DefaultTraversable<PE, E> implements Traversable<PE, E>{
return this.parentGraph.frameElement((Element) baseTraversal.next(), VertexFrame.class);
}
catch (final NoSuchElementException e) {
return this.parentGraph.addFramedVertex(null, VertexFrame.class);
return this.parentGraph.addFramedVertex(TVertex.DEFAULT_INITIALIZER, null);
}
}
......
......@@ -313,8 +313,14 @@ public class DelegatingFramedGraph<G extends Graph> implements WrappedFramedGrap
@Override
public <T> T addFramedVertex(final ClassInitializer<T> initializer, final Object... keyValues) {
final T framedVertex = frameNewElement(this.getBaseGraph().addVertex(keyValues), initializer);
return framedVertex;
if( keyValues != null ) {
final T framedVertex = frameNewElement(this.getBaseGraph().addVertex(keyValues), initializer);
return framedVertex;
}
else {
final T framedVertex = frameNewElement(this.getBaseGraph().addVertex(), initializer);
return framedVertex;
}
}
@Override
......@@ -358,7 +364,7 @@ public class DelegatingFramedGraph<G extends Graph> implements WrappedFramedGrap
@Override
public <T> T addFramedEdgeExplicit(final VertexFrame source, final VertexFrame destination, final String label, final ClassInitializer<T> initializer) {
final T framedEdge = frameNewElementExplicit(source.getElement().addEdge(label, destination.getElement(), null), initializer);
final T framedEdge = frameNewElementExplicit(source.getElement().addEdge(label, destination.getElement()), initializer);
return framedEdge;
}
......
......@@ -26,6 +26,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal;
import org.apache.tinkerpop.gremlin.structure.Element;
import org.apache.tinkerpop.gremlin.structure.Property;
import java.util.Optional;
import java.util.Set;
import java.util.function.Predicate;
......@@ -111,11 +112,12 @@ public class PolymorphicTypeResolver implements TypeResolver {
@Override
public Class<?> resolve(final Element element) {
final String typeResolutionName = element.<String>property(this.typeResolutionKey).value();
if (typeResolutionName == null)
return null;
final Property<String> typeResolutionName = element.<String>property(this.typeResolutionKey);
return this.reflectionCache.forName(typeResolutionName);
if( typeResolutionName.isPresent() )
return this.reflectionCache.forName(typeResolutionName.value());
else
return null;
}
@Override
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment