Skip to content
Commits on Source (7)
## 1.2.1
* Don't throw an NPE when Clojure isn't on the classloader's effective
classpath
## 1.2.0 (2015-10-23)
* Add `close()` that shuts down the agent pool
* Clear `Var.dvals` at the top of the call stack
## 1.1.0 (2015-01-09)
* Pre-history
......@@ -12,8 +12,8 @@ and for calling in to the runtimes from the app.
## Usage
The project provides two artifacts: `shimdandy-api.jar` and
`shimdandy-impl.jar`. `shimdandy-api` can be on the boot classpath of
your app, but `shimdandy-impl` should not be on the boot classpath or
`shimdandy-impl.jar`. `shimdandy-api` can be on the classpath of
your app, but `shimdandy-impl` should not be on the classpath or
exposed to any ClassLoader initially. Nor should any Clojure jars -
having a Clojure jar on the classpath will cause the RT from that jar
(and only that RT) to be loaded, preventing isolation.
......
<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.projectodd.shimdandy</groupId>
<artifactId>shimdandy-parent</artifactId>
<version>1.2.0</version>
</parent>
<groupId>org.projectodd.shimdandy</groupId>
<artifactId>shimdandy-api</artifactId>
<version>1.2.0</version>
<version>1.2.1</version>
<name>shimdandy-api</name>
<description>shimdandy API</description>
</project>
shimdandy (1.2.1-1) unstable; urgency=medium
* New upstream version
-- Tom Marble <tmarble@info9.net> Wed, 17 Jul 2019 13:32:03 -0500
shimdandy (1.2.0-3) unstable; urgency=medium
* Build with Clojure 1.10 (Closes: #924495)
-- Tom Marble <tmarble@info9.net> Tue, 19 Mar 2019 07:42:34 -0500
-- Tom Marble <tmarble@info9.net> Tue, 19 Mar 2019 08:42:47 -0500
shimdandy (1.2.0-2) unstable; urgency=medium
......
......@@ -5,8 +5,8 @@ Maintainer: Debian Java Maintainers <pkg-java-maintainers@lists.alioth.debian.or
Uploaders: Tom Marble <tmarble@info9.net>
Build-Depends: debhelper (>= 11), default-jdk, maven-debian-helper (>= 2.1), libclojure-java (>= 1.9~)
Standards-Version: 4.1.3
Vcs-Git: https://anonscm.debian.org/git/pkg-java/shimdandy.git
Vcs-Browser: https://anonscm.debian.org/cgit/pkg-java/shimdandy.git
Vcs-Git: https://salsa.debian.org/java-team/shimdandy
Vcs-Browser: https://salsa.debian.org/java-team/shimdandy
Homepage: https://github.com/projectodd/shimdandy
Package: libshimdandy-java
......
Index: shimdandy/api/pom.xml
===================================================================
--- shimdandy.orig/api/pom.xml 2017-08-11 13:15:02.222056043 -0500
+++ shimdandy/api/pom.xml 2017-08-11 13:35:43.564909406 -0500
--- shimdandy.orig/api/pom.xml 2019-07-17 14:59:39.054787058 -0500
+++ shimdandy/api/pom.xml 2019-07-17 15:05:00.545645602 -0500
@@ -1,11 +1,6 @@
<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
......@@ -9,15 +9,15 @@ Index: shimdandy/api/pom.xml
- <parent>
- <groupId>org.projectodd.shimdandy</groupId>
- <artifactId>shimdandy-parent</artifactId>
- <version>1.2.0</version>
- <version>1.2.1</version>
- </parent>
<groupId>org.projectodd.shimdandy</groupId>
<artifactId>shimdandy-api</artifactId>
<version>1.2.0</version>
<version>1.2.1</version>
Index: shimdandy/impl/pom.xml
===================================================================
--- shimdandy.orig/impl/pom.xml 2017-08-11 13:15:02.222056043 -0500
+++ shimdandy/impl/pom.xml 2017-08-11 13:35:59.044943526 -0500
--- shimdandy.orig/impl/pom.xml 2019-07-17 14:59:39.054787058 -0500
+++ shimdandy/impl/pom.xml 2019-07-17 15:05:01.021649335 -0500
@@ -1,11 +1,6 @@
<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
......@@ -25,8 +25,8 @@ Index: shimdandy/impl/pom.xml
- <parent>
- <groupId>org.projectodd.shimdandy</groupId>
- <artifactId>shimdandy-parent</artifactId>
- <version>1.2.0</version>
- <version>1.2.1</version>
- </parent>
<groupId>org.projectodd.shimdandy</groupId>
<artifactId>shimdandy-impl</artifactId>
<version>1.2.0</version>
<version>1.2.1</version>
<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.projectodd.shimdandy</groupId>
<artifactId>shimdandy-parent</artifactId>
<version>1.2.0</version>
</parent>
<groupId>org.projectodd.shimdandy</groupId>
<artifactId>shimdandy-impl</artifactId>
<version>1.2.0</version>
<version>1.2.1</version>
<name>shimdandy-impl</name>
<description>shimdandy Implementation</description>
......
......@@ -14,7 +14,6 @@ import java.util.concurrent.atomic.AtomicLong;
public class ClojureRuntimeShimImpl extends ClojureRuntimeShim {
public void init() {
ClassLoader origLoader = preInvoke();
Exception ex = null;
try {
Field dvalField = Var.class.getDeclaredField("dvals");
dvalField.setAccessible(true);
......@@ -23,17 +22,11 @@ public class ClojureRuntimeShimImpl extends ClojureRuntimeShim {
this.require = RT.var("clojure.core", "require");
this.resolve = RT.var("clojure.core", "resolve");
clojure.lang.Compiler.LOADER.bindRoot(this.classLoader);
} catch (IllegalAccessException e) {
ex = e;
} catch (NoSuchFieldException e) {
ex = e;
} catch (Exception e) {
throw new RuntimeException("Failed to initialize ClojureRuntimeShimImpl", e);
} finally {
postInvoke(origLoader);
}
if (ex != null) {
throw new RuntimeException("Failed to access Var.dvals", ex);
}
}
protected ClassLoader preInvoke() {
......@@ -46,7 +39,9 @@ public class ClojureRuntimeShimImpl extends ClojureRuntimeShim {
protected void postInvoke(ClassLoader loader) {
if (this.callDepth.get().decrementAndGet() == 0) {
this.dvals.remove();
if (this.dvals != null) {
this.dvals.remove();
}
this.callDepth.remove();
}
Thread.currentThread().setContextClassLoader(loader);
......
......@@ -4,7 +4,7 @@
<groupId>org.projectodd.shimdandy</groupId>
<artifactId>shimdandy-parent</artifactId>
<version>1.2.0</version>
<version>1.2.1</version>
<packaging>pom</packaging>
<description>Shimdandy parent POM</description>
......@@ -59,17 +59,33 @@
<module>impl</module>
</modules>
<distributionManagement>
<repository>
<id>sonatype-nexus-staging</id>
<name>Nexus Staging Repo</name>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
<snapshotRepository>
<id>sonatype-nexus-snapshots</id>
<name>Nexus Snapshot Repo</name>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
</snapshotRepository>
</distributionManagement>
<build>
<plugins>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.3</version>
<extensions>true</extensions>
<configuration>
<serverId>sonatype-nexus-staging</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
</plugins>
</build>
<distributionManagement>
<repository>
<id>sonatype-nexus-staging</id>
<name>Nexus Staging Repo</name>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
<snapshotRepository>
<id>sonatype-nexus-snapshots</id>
<name>Nexus Snapshot Repo</name>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
</snapshotRepository>
</distributionManagement>
</project>