[
https://issues.apache.org/jira/browse/TINKERPOP-2496?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17253472#comment-17253472
]
Stephen Mallette commented on TINKERPOP-2496:
---------------------------------------------
Thanks for reporting this and for providing an example. There was indeed
something wrong with the processor but it was easy enough to fix - just needed
to add a filter to only include {{GraphTraversal}} return types for that
section of the code generation (which should have been there given the
comments). Pushed as CTR:
https://github.com/apache/tinkerpop/commit/cce31cbb19f430aa5a2b7153331af0d55c670ddd
> GremlinDslProcessor fails when SocialTraversalSourceDsl overrides close
> -----------------------------------------------------------------------
>
> Key: TINKERPOP-2496
> URL: https://issues.apache.org/jira/browse/TINKERPOP-2496
> Project: TinkerPop
> Issue Type: Bug
> Components: process
> Affects Versions: 3.4.9
> Reporter: Faron Dutton
> Priority: Major
>
> It appears that GremlinDslProcessor assumes all declared methods return some
> value. This causes it to fail if the traversal source DSL overrides the close
> method.
> When compiling with Java 14, one receives the following error:
> {noformat}
> [ERROR] class com.sun.tools.javac.code.Type$JCVoidType cannot be cast to
> class javax.lang.model.type.DeclaredType
> (com.sun.tools.javac.code.Type$JCVoidType is in module jdk.compiler of loader
> 'app'; javax.lang.model.type.DeclaredType is in module java.compiler of
> loader 'platform')
> {noformat}
> h1. Example Code
> {code:java}
> public class MyTraversalSourceDsl extends GraphTraversalSource {
> private static final Logger logger =
> LoggerFactory.getLogger(MyTraversalSourceDsl.class);
> public MyTraversalSourceDsl(final Graph graph, final TraversalStrategies
> traversalStrategies) {
> super(graph, traversalStrategies);
> }
> public MyTraversalSourceDsl(final Graph graph) {
> super(graph);
> }
> public MyTraversalSourceDsl(final RemoteConnection connection) {
> super(connection);
> }
> @Override
> public void close() {
> try {
> super.close();
> } catch (Exception e) {
> logger.error("Unable to close connection: {}", e.getMessage());
> }
> }
> }
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)