Skip to content

Commit

Permalink
Prevent GraalVM from figuring out the method name through inlining
Browse files Browse the repository at this point in the history
  • Loading branch information
zakkak committed Sep 28, 2021
1 parent 681d6fd commit b9e22a5
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
import org.postgresql.xml.DefaultPGXmlFactoryFactory;
import org.postgresql.xml.PGXmlFactoryFactory;

import com.oracle.svm.core.annotate.NeverInline;

/**
* Used by PgSQLXML: easier to keep the actual code separated from the substitutions.
*/
Expand Down Expand Up @@ -48,10 +50,9 @@ public static String maybeProcessAsDomResult(DOMResult domResult, BaseConnection
}
}

//When GraalVM can figure out a constant name for the target method to be invoked reflectively,
//it automatically registers it for reflection. We don't want that to happen in this particular case.
@NeverInline("Prevent GraalVM from figuring out the target method to be invoked reflectively, so that it can't automatically register it for reflection")
private static String obfuscatedMethodName() {
return "reallyProcessDom" + "Result";
return "reallyProcessDomResult";
}

public static String reallyProcessDomResult(DOMResult domResult, BaseConnection conn) throws SQLException {
Expand Down

0 comments on commit b9e22a5

Please sign in to comment.