[CALCITE-3745] CompileException in UnitCompiler when using multiple class loaders

Janino is not able to determine the correct compiler for loading a
given class thus it fails with CompileException.

1. Use the class loader of the calling class instead of the default.
2. Upgrade Janino to 3.1.6 version which contains the fix for
https://github.com/janino-compiler/janino/pull/150 necessary for
passing correctly the class loader to the underlying methods.
3. Add/Update CheckerFramework .astub files for setParentClassLoader
method based on the changes in the Janino APIs. Methods have moved in
the new version so it is necessary to reflect the changes in the stub
files.
4. Enforce class loader is not null before calling
CompilerFactoryFactory#getDefaultCompilerFactory method. The parameter
does not have a nullability annotation so by default CheckerFramework
considers it as not-null. Indeed, if null is given as parameter a NPE
will be raised from within that method.

Close apache/calcite#2449
9 files changed
tree: b9e1505f21c2b91f5728ada2edcc98f23c671e89
  1. .github/
  2. .idea/
  3. babel/
  4. bom/
  5. buildSrc/
  6. cassandra/
  7. core/
  8. druid/
  9. elasticsearch/
  10. example/
  11. file/
  12. geode/
  13. gradle/
  14. innodb/
  15. kafka/
  16. linq4j/
  17. mongodb/
  18. pig/
  19. piglet/
  20. plus/
  21. redis/
  22. release/
  23. server/
  24. site/
  25. spark/
  26. splunk/
  27. src/
  28. testkit/
  29. ubenchmark/
  30. .asf.yaml
  31. .editorconfig
  32. .gitattributes
  33. .gitignore
  34. .ratignore
  35. .travis.yml
  36. appveyor.yml
  37. build.gradle.kts
  38. gradle.properties
  39. gradlew
  40. gradlew.bat
  41. LICENSE
  42. NOTICE
  43. README
  44. README.md
  45. settings.gradle.kts
  46. sqlline
  47. sqlline.bat
  48. sqlsh
  49. sqlsh.bat
README.md

Maven Central Travis Build Status CI Status AppVeyor Build Status

Apache Calcite

Apache Calcite is a dynamic data management framework.

It contains many of the pieces that comprise a typical database management system but omits the storage primitives. It provides an industry standard SQL parser and validator, a customisable optimizer with pluggable rules and cost functions, logical and physical algebraic operators, various transformation algorithms from SQL to algebra (and the opposite), and many adapters for executing SQL queries over Cassandra, Druid, Elasticsearch, MongoDB, Kafka, and others, with minimal configuration.

For more details, see the home page.