Uploaded image for project: 'TinkerPop'
  1. TinkerPop
  2. TINKERPOP-2496

GremlinDslProcessor fails when SocialTraversalSourceDsl overrides close

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.4.9
    • 3.5.0, 3.4.10
    • process
    • None

    Description

      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:

      [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')
      

      Example Code

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

      Attachments

        Activity

          People

            spmallette Stephen Mallette
            fgdutton Faron Dutton
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: