Skip to content
This repository has been archived by the owner on Mar 31, 2023. It is now read-only.

Commit

Permalink
GEODE-10404: Fix javaobject compilation for Java 11
Browse files Browse the repository at this point in the history
 - After merging apache#973, javaobject compilation was broken for Java 11.
   The build passed since packer images uses Java 8, but as docker build
   images uses Java 11, compilation is failing there.
 - Root cause of the compilation issue is the difference in UTF-8 string
   handling between Java 8 and Java 11.
 - So, the issue was fixed by specifying UTF-8 encoding while compiling.
  • Loading branch information
gaussianrecurrence committed Aug 11, 2022
1 parent 26fe727 commit 2909250
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cppcache/integration/test/PdxInstanceTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -458,10 +458,10 @@ TEST(PdxInstanceTest, comparePdxInstanceWithStringWithJavaPdxInstance) {
cache.createPdxInstanceFactory("PdxTests.MyTestClass", false);

pdxInstanceFactory.writeString("asciiField", "value");
pdxInstanceFactory.writeString("utf8Field", u8"value");
pdxInstanceFactory.writeString("utf8Field", u8"value\u20AC");
pdxInstanceFactory.writeString("asciiHugeField", std::string(70000, 'x'));
pdxInstanceFactory.writeString("utfHugeField",
std::string(70000, 'x') + u8"");
std::string(70000, 'x') + u8"\u20AC");
entry = pdxInstanceFactory.create();
}

Expand Down
2 changes: 2 additions & 0 deletions tests/javaobject/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ find_package(Java REQUIRED)
include(UseJava)
include(CheckJavaClassExists)

set(CMAKE_JAVA_COMPILE_FLAGS -encoding utf8)

check_java_class_exists(org.apache.geode.security.AuthenticationExpiredException ${Geode_CLASSPATH} hasAuthenticationExpiredException)

file(GLOB_RECURSE SOURCES "*.java")
Expand Down

0 comments on commit 2909250

Please sign in to comment.