Remove deprecated Factory.create methods with classLoader
MODIFY
asciidoctorj-core/src/main/java/org/asciidoctor/Asciidoctor.java
asciidoctorj-core/src/main/java/org/asciidoctor/Asciidoctor.java
@@ -810,32 +810,6 @@ public interface Asciidoctor {
return JRubyAsciidoctor.create(loadPaths);
}
- /**
- * Creates a new instance of Asciidoctor and sets a specific classloader for the JRuby runtime to use. This method is mostly
- * used in environments where different threads may have different classloaders, like build tools sbt or ANT.
- *
- * @param classloader
- * @return Asciidoctor instance which uses JRuby to wraps Asciidoctor
- * Ruby calls.
- * @deprecated Please use {@link #create()} and set the TCCL before or {@link #create(List)} passing the paths
- * that you would have used to create the ClassLoader.
- */
- public static Asciidoctor create(ClassLoader classloader) {
- return JRubyAsciidoctor.create(classloader);
- }
-
- /**
- * Cerates a new instance of Asciidoctor and sets a specific classloader and gempath for the JRuby runtime to use.
- * @param classloader
- * @param gemPath
- * @return Asciidoctor instance which uses JRuby to wraps Asciidoctor
- * @deprecated Please use {@link #create(String)} and set the TCCL before or {@link #create(List, String)}
- * passing the paths that you would have used to create the ClassLoader.
- */
- public static Asciidoctor create(ClassLoader classloader, String gemPath) {
- return JRubyAsciidoctor.create(classloader, gemPath);
- }
-
/**
* Creates a new instance of Asciidoctor and sets loadPath to provided paths.
* The gem path of the Ruby instance is set to the gemPath parameter.

MODIFY
asciidoctorj-core/src/test/java/org/asciidoctor/internal/WhenClassloaderIsRequired.java
asciidoctorj-core/src/test/java/org/asciidoctor/internal/WhenClassloaderIsRequired.java
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;
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
class AsciiDoctorJClassloaderTestRunnable implements Runnable {
private boolean loadingsucceeded = false;
private ClassLoader classloader = null;
@@ -23,7 +24,8 @@ import org.junit.Test;
if (classloader == null) {
Asciidoctor.Factory.create();
} else {
- Asciidoctor.Factory.create(classloader);
+ Thread.currentThread().setContextClassLoader(classloader);
+ Asciidoctor.Factory.create();
}
loadingsucceeded = true;
} catch (org.jruby.exceptions.RaiseException exp) {

Remove deprecated Factory.create methods with classLoader