Skip to content

Commit

Permalink
Use a Clener Substitution rather than reporting unsupported elements …
Browse files Browse the repository at this point in the history
…at runtime
  • Loading branch information
Sanne committed Oct 6, 2020
1 parent faa5650 commit e13b66e
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
5 changes: 5 additions & 0 deletions extensions/tika/runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@
<groupId>org.jboss.logging</groupId>
<artifactId>commons-logging-jboss-logging</artifactId>
</dependency>
<dependency>
<groupId>org.graalvm.nativeimage</groupId>
<artifactId>svm</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package io.quarkus.tika.graalvm;

@com.oracle.svm.core.annotate.Substitute
@com.oracle.svm.core.annotate.TargetClass(className = "org.apache.poi.poifs.nio.CleanerUtil")
public final class CleanerNotSupportedSubstitution {

/**
* <code>true</code>, if this platform supports unmapping mmapped files.
*/
public static final boolean UNMAP_SUPPORTED = false;

/**
* if {@link #UNMAP_SUPPORTED} is {@code false}, this contains the reason
* why unmapping is not supported.
*/
public static final String UNMAP_NOT_SUPPORTED_REASON = "Not supported on GraalVM native-image";

private static final org.apache.poi.poifs.nio.CleanerUtil.BufferCleaner CLEANER = null;

/**
* Reference to a BufferCleaner that does unmapping.
*
* @return {@code null} if not supported.
*/
public static org.apache.poi.poifs.nio.CleanerUtil.BufferCleaner getCleaner() {
return CLEANER;
}

}
1 change: 0 additions & 1 deletion integration-tests/tika/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@
<cleanupServer>true</cleanupServer>
<enableHttpUrlHandler>true</enableHttpUrlHandler>
<graalvmHome>${graalvmHome}</graalvmHome>
<additionalBuildArgs>--report-unsupported-elements-at-runtime</additionalBuildArgs>
</configuration>
</execution>
</executions>
Expand Down

0 comments on commit e13b66e

Please sign in to comment.