Skip to content

Commit

Permalink
https://github.com/manifold-systems/manifold/issues/645
Browse files Browse the repository at this point in the history
- revise fix for #627, use reflection to enable compiling manifold itself with jdk 11+ only for building Xxx_11.java11+ source files
  • Loading branch information
rsmckinney committed Dec 14, 2024
1 parent ec40f68 commit 57185cc
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,17 @@ private void hackToFixJava8Issue( TypeName tn )
{
if( JreUtil.isJava8() && tn.name.equals( "java.util.Map" ) )
{
// ensure top-level Map class loads before inner class Entry, see https://github.com/manifold-systems/manifold/issues/627
Annotate.instance( _ctx ).normal( () -> ClassReader.instance( _ctx ).loadClass( Names.instance( _ctx ).fromString( tn.name ) ) );
try
{
// ensure top-level Map class loads before inner class Entry, see https://github.com/manifold-systems/manifold/issues/627
// (using reflection to compile here to enable compiling with jdk 11+ only for building Xxx_11.java11+ source files)
Annotate.instance( _ctx ).normal(
() -> ReflectUtil.method( ClassReader.instance( _ctx ), "loadClass", Name.class )
.invoke( Names.instance( _ctx ).fromString( tn.name ) ) );
}
catch( Throwable ignore )
{
}
}
}

Expand Down

0 comments on commit 57185cc

Please sign in to comment.