Fixes Fix issues with JRuby 9.1.15.0 on Java 9
MODIFY
asciidoctorj-core/src/main/java/org/asciidoctor/extension/MacroProcessor.java
asciidoctorj-core/src/main/java/org/asciidoctor/extension/MacroProcessor.java
@@ -30,6 +30,6 @@ public abstract class MacroProcessor extends Processor {
return new HashMap<Object, Object>();
}
- protected abstract Object process(AbstractBlock parent, String target, Map<String, Object> attributes);
+ public abstract Object process(AbstractBlock parent, String target, Map<String, Object> attributes);
}

MODIFY
asciidoctorj-core/src/test/java/org/asciidoctor/extension/ManpageMacro.java
asciidoctorj-core/src/test/java/org/asciidoctor/extension/ManpageMacro.java
@@ -12,7 +12,7 @@ public class ManpageMacro extends InlineMacroProcessor {
}
@Override
- protected String process(AbstractBlock parent, String target,
+ public String process(AbstractBlock parent, String target,
Map<String, Object> attributes) {
Map<String, Object> options = new HashMap<String, Object>();
options.put("type", ":link");

MODIFY
asciidoctorj-core/src/test/java/org/asciidoctor/extension/WhenRubyExtensionIsRegistered.java
asciidoctorj-core/src/test/java/org/asciidoctor/extension/WhenRubyExtensionIsRegistered.java
@@ -25,7 +25,7 @@ public class WhenRubyExtensionIsRegistered {
public void ruby_extension_should_be_registered() {
RubyExtensionRegistry rubyExtensionRegistry = this.asciidoctor.rubyExtensionRegistry();
- rubyExtensionRegistry.loadClass(Class.class.getResourceAsStream("/YellRubyBlock.rb")).block("rubyyell", "YellRubyBlock");
+ rubyExtensionRegistry.loadClass(getClass().getResourceAsStream("/YellRubyBlock.rb")).block("rubyyell", "YellRubyBlock");
String content = asciidoctor.renderFile(
classpath.getResource("sample-with-ruby-yell-block.ad"),
@@ -42,7 +42,7 @@ public class WhenRubyExtensionIsRegistered {
public void ruby_extension_should_be_unregistered() {
ExtensionGroup extensionGroup = this.asciidoctor.createGroup()
- .loadRubyClass(Class.class.getResourceAsStream("/YellRubyBlock.rb"))
+ .loadRubyClass(getClass().getResourceAsStream("/YellRubyBlock.rb"))
.rubyBlock("rubyyell", "YellRubyBlock");
{

MODIFY
asciidoctorj-core/src/test/java/org/asciidoctor/internal/WhenClassloaderIsRequired.java
asciidoctorj-core/src/test/java/org/asciidoctor/internal/WhenClassloaderIsRequired.java
@@ -3,6 +3,7 @@ package org.asciidoctor.internal;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
import org.asciidoctor.Asciidoctor;
+import org.junit.Ignore;
import org.junit.Test;
class AsciiDoctorJClassloaderTestRunnable implements Runnable {
@@ -46,6 +47,7 @@ public class WhenClassloaderIsRequired {
inside the runnable to verify we have created the same error as happens inside sbt.
*/
@Test
+ @Ignore("Behavior changed in JRuby 9000. It no longer only uses the TCCL by default")
public void contentsOfJRubyCompleteShouldFailToLoadWithoutPassingClassloader() throws Exception{
ClassLoader currentclassloader = this.getClass().getClassLoader();
ClassLoader rootclassloader = currentclassloader.getParent();

Fixes #624. Fix issues with JRuby 9.1.15.0 on Java 9