[Git][java-team/objenesis][master] 4 commits: Disabled ClassDefinitionUtils.defineClass() to work around the build failure…

Emmanuel Bourg gitlab at salsa.debian.org
Wed Oct 3 12:38:13 BST 2018


Emmanuel Bourg pushed to branch master at Debian Java Maintainers / objenesis


Commits:
f99daaef by Emmanuel Bourg at 2018-10-03T11:30:09Z
Disabled ClassDefinitionUtils.defineClass() to work around the build failure with Java 11 (Closes: #909258)

- - - - -
678a7eab by Emmanuel Bourg at 2018-10-03T11:30:43Z
Standards-Version updated to 4.2.1

- - - - -
316ebe0e by Emmanuel Bourg at 2018-10-03T11:31:11Z
Wrap and sort

- - - - -
a075f158 by Emmanuel Bourg at 2018-10-03T11:31:48Z
Upload to unstable

- - - - -


4 changed files:

- debian/changelog
- debian/control
- + debian/patches/02-java11-compatibility.patch
- debian/patches/series


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,13 @@
+objenesis (2.6-3) unstable; urgency=medium
+
+  * Team upload.
+  * Disabled the ClassDefinitionUtils.defineClass() method (which is never
+    used in Debian) to work around the build failure with Java 11
+    (Closes: #909258)
+  * Standards-Version updated to 4.2.1
+
+ -- Emmanuel Bourg <ebourg at apache.org>  Wed, 03 Oct 2018 13:31:41 +0200
+
 objenesis (2.6-2) unstable; urgency=medium
 
   * Team upload.


=====================================
debian/control
=====================================
@@ -2,8 +2,7 @@ Source: objenesis
 Section: java
 Priority: optional
 Maintainer: Debian Java Maintainers <pkg-java-maintainers at lists.alioth.debian.org>
-Uploaders:
- Markus Koschany <apo at debian.org>
+Uploaders: Markus Koschany <apo at debian.org>
 Build-Depends:
  debhelper (>= 11),
  default-jdk,
@@ -12,20 +11,16 @@ Build-Depends:
  libmaven-bundle-plugin-java,
  libmaven-javadoc-plugin-java,
  maven-debian-helper (>= 1.4)
-Standards-Version: 4.1.4
+Standards-Version: 4.2.1
 Vcs-Git: https://salsa.debian.org/java-team/objenesis.git
 Vcs-Browser: https://salsa.debian.org/java-team/objenesis
 Homepage: http://www.objenesis.org/
 
 Package: libobjenesis-java
 Architecture: all
-Depends:
- ${maven:Depends},
- ${misc:Depends}
-Recommends:
- ${maven:OptionalDepends}
-Suggests:
- libobjenesis-java-doc
+Depends: ${maven:Depends}, ${misc:Depends}
+Recommends: ${maven:OptionalDepends}
+Suggests: libobjenesis-java-doc
 Description: Java library to instantiate a new object of a particular class
  Objenesis is a small Java library that serves one purpose: to instantiate a
  new object of a particular class.
@@ -44,13 +39,9 @@ Description: Java library to instantiate a new object of a particular class
 Package: libobjenesis-java-doc
 Architecture: all
 Section: doc
-Depends:
- ${maven:DocDepends},
- ${misc:Depends}
-Recommends:
- ${maven:DocOptionalDepends}
-Suggests:
- libobjenesis-java
+Depends: ${maven:DocDepends}, ${misc:Depends}
+Recommends: ${maven:DocOptionalDepends}
+Suggests: libobjenesis-java
 Description: Documentation for Objenesis
  Objenesis is a small Java library that serves one purpose: to instantiate a
  new object of a particular class.


=====================================
debian/patches/02-java11-compatibility.patch
=====================================
@@ -0,0 +1,27 @@
+Description: Fixes the build failure with Java 11
+Author: Emmanuel Bourg <ebourg at apache.org>
+Forwarded: https://github.com/easymock/objenesis/issues/61
+--- a/main/src/main/java/org/objenesis/instantiator/util/ClassDefinitionUtils.java
++++ b/main/src/main/java/org/objenesis/instantiator/util/ClassDefinitionUtils.java
+@@ -97,10 +97,7 @@
+    @SuppressWarnings("unchecked")
+    public static <T> Class<T> defineClass(String className, byte[] b, ClassLoader loader)
+       throws Exception {
+-      Class<T> c = (Class<T>) UnsafeUtils.getUnsafe().defineClass(className, b, 0, b.length, loader, PROTECTION_DOMAIN);
+-      // Force static initializers to run.
+-      Class.forName(className, true, loader);
+-      return c;
++      throw new UnsupportedOperationException("ClassDefinitionUtils.defineClass() relies on com.sun.misc.Unsafe.defineClass() which was removed in Java 11");
+    }
+ 
+    /**
+--- a/main/src/test/java/org/objenesis/instantiator/util/ClassDefinitionUtilsTest.java
++++ b/main/src/test/java/org/objenesis/instantiator/util/ClassDefinitionUtilsTest.java
+@@ -28,6 +28,7 @@
+    String className = "org.objenesis.EmptyClassBis";
+ 
+    @Test
++   @org.junit.Ignore
+    public void testDefineClass() throws Exception {
+       byte[] b = ClassDefinitionUtils.readClass(className);
+       Class<?> c = ClassDefinitionUtils.defineClass(className, b, getClass().getClassLoader());


=====================================
debian/patches/series
=====================================
@@ -1 +1,2 @@
 01-java10-compatibility.patch
+02-java11-compatibility.patch



View it on GitLab: https://salsa.debian.org/java-team/objenesis/compare/a431236e22d77deb8ea1af8f6e57cc42d80476ac...a075f158db7f0d1c3d46b7cf9a66ee71e4440120

-- 
View it on GitLab: https://salsa.debian.org/java-team/objenesis/compare/a431236e22d77deb8ea1af8f6e57cc42d80476ac...a075f158db7f0d1c3d46b7cf9a66ee71e4440120
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-commits/attachments/20181003/81251e91/attachment.html>


More information about the pkg-java-commits mailing list