ContextMapper / context-mapper-dsl

ContextMapper DSL: A Domain-specific Language for Context Mapping & Service Decomposition
https://contextmapper.org/
Apache License 2.0
215 stars 28 forks source link

Optional.isEmpty() does not exist in Java 8 #310

Closed kanru closed 2 years ago

kanru commented 2 years ago

Describe the bug Using Java8, generating PlantUML diagram throws exception java.lang.NoSuchMethodError: java.util.Optional.isEmpty()Z

To Reproduce Steps to reproduce the behavior:

  1. Install JDK version 1.8.0_302
  2. Run Context Mapper CLI v6.6.0 with the test.cml file (or using VSCode extension)
  3. See error

Expected behavior UML diagram is generated with no errors

Screenshots / Exceptions Exceptions:

Exception in thread "main" java.lang.NoSuchMethodError: java.util.Optional.isEmpty()Z
    at org.contextmapper.dsl.generator.PlantUMLGenerator.getAggregatesWithStatesAndTransitions(PlantUMLGenerator.java:120)
    at org.contextmapper.dsl.generator.PlantUMLGenerator.generateFromContextMappingModel(PlantUMLGenerator.java:76)
    at org.contextmapper.dsl.generator.AbstractContextMappingModelGenerator.doGenerate(AbstractContextMappingModelGenerator.java:54)
    at org.contextmapper.dsl.standalone.StandaloneContextMapper.callGenerator(StandaloneContextMapper.java:61)
    at org.contextmapper.cli.commands.GenerateCommand.run(GenerateCommand.java:55)
    at org.contextmapper.cli.ContextMapperCLI.run(ContextMapperCLI.java:49)
    at org.contextmapper.cli.ContextMapperCLI.main(ContextMapperCLI.java:38)

Input files to reproduce

BoundedContext Test {
  Aggregate Test {
    Entity Test {
    }
  }
}

ContextMap TestMap {
  contains Test
}

IDE and Plugin (please complete the following information):

Additional context Java 11 works fine.

stefan-ka commented 2 years ago

Hi @kanru

Thanks for reporting this one! We fixed this with the bugfix release v6.6.1.

I'll close the issue. Let us know in case you still have problems with Java 8.

Best regards, Stefan

FYI @socadk