Skip to content
Commits on Source (5)
<component name="CopyrightManager">
<copyright>
<option name="notice" value="Copyright 2006-&amp;#36;today.year the original author or authors.&#10;&#10;Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);&#10;you may not use this file except in compliance with the License.&#10;You may obtain a copy of the License at&#10;&#10; http://www.apache.org/licenses/LICENSE-2.0&#10;&#10;Unless required by applicable law or agreed to in writing, software&#10;distributed under the License is distributed on an &quot;AS IS&quot; BASIS,&#10;WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.&#10;See the License for the specific language governing permissions and&#10;limitations under the License." />
<option name="myName" value="Objenesis" />
</copyright>
</component>
\ No newline at end of file
<component name="CopyrightManager">
<settings default="Objenesis" />
</component>
\ No newline at end of file
......@@ -14,8 +14,8 @@ You can find the website and user documentation at [objenesis.org](http://objene
## Environment setup
I'm using:
- Maven 3.5.0
- IntelliJ Ultimate 2017.1.3 (thanks to JetBrains for the license) (it should also work with Eclipse)
- Maven 3.5.3
- IntelliJ Ultimate 2018.2 (thanks to JetBrains for the license) (it should also work with Eclipse)
To configure your local workspace:
- Import the Maven parent project to Eclipse or IntelliJ
......@@ -33,7 +33,7 @@ It is a basic compilation of the application.
### Full build
This build will create the source and javadoc jars and run findbugs.
This build will create the source and javadoc jars and run spotbugs.
`mvn install -Pfull`
......@@ -41,10 +41,10 @@ This build will create the source and javadoc jars and run findbugs.
### Run the Android TCK
- Install the Android SDK
- Configure a device (real or simulated)
- Add an `ANDROID_HOME` to target the Android SDK
- Add `$ANDROID_HOME/platform-tools` to your path
- Install the Android SDK (`brew cask install android-sdk`)
- Install `platform-tools` and `build-tools` using the sdkmanager (`sdkmanager "platform-tools" "build-tools"`)
- Add an `ANDROID_HOME` to target the Android SDK (`export ANDROID_HOME=$(realpath $(echo "$(dirname $(readlink $(which sdkmanager)))/../.."))`)
- Configure a device (real or simulated) and launch it
- Activate the debug mode if it's a real device
- `mvn package -Pandroid`
......@@ -96,7 +96,18 @@ http://www.sonatype.com/people/2010/01/how-to-generate-pgp-signatures-with-maven
## To release
* Add the release notes in `website/site/content/notes.html`
* Add the release notes in `website/site/content/notes.html` You use this code to generate it
```bash
# Get the milestone matching the version
milestone=$(curl -s -u "${github_user}:${github_password}" "https://api.github.com/repos/easymock/easymock/milestones" | jq ".[] | select(.title==\"$version\") | .number")
echo "<h1>Version $version ($(date '+%Y-%m-%d'))</h1>"
echo
echo "<ul>"
curl -s -u "${github_user}:${github_password}" "https://api.github.com/repos/easymock/objenesis/issues?milestone=11&state=all" | jq -r '.[] | (" <li>" + .title + " ("# +(.number|tostring) + ")</li>")'
echo "</ul>"
```
* Add these servers to your `settings.xml`
```xml
......@@ -128,4 +139,4 @@ git reset --hard HEAD~2
## Deploy the website
* Make sure the pom is at the version you want to release
* Launch `./deploy_website.sh`
* Launch `./deploy-website.sh`
# List of currently supported JVMs
* Sun Hotspot VM, versions 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 9
* OpenJDK 6, 7, 8, 9
* Sun Hotspot VM, versions 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 9, 10, 11
* OpenJDK 6, 7, 8, 9, 10, 11
* Android API level 8 to 26 (Serialization support starting from Honeycomb)
* Azul Zulu (tested on 1.8.0_45-b14)
* Azul Zing JDK 1.8 (tested on 1.8.0-zing_16.10.1.0-b2)
......@@ -10,6 +10,12 @@
* GCJ version 3.4.4 (tested on Windows/Cygwin)
* Aonix PERC (no serialization support), tested on version 5.0.0667
Support per Objenesis versions:
* 1.x supports Java 1.3 to 1.7
* 2.x supports Java 1.5 to 10
* 3.x supports Java 1.8 to 11
## Google App Engine
GAE is only really partially supported due to the constraints of the platform.
......
#!/usr/bin/env bash
#
# Copyright 2006-2017 the original author or authors.
# Copyright 2006-2018 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
......
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Copyright 2006-2018 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.objenesis</groupId>
<artifactId>objenesis-parent</artifactId>
<version>2.6</version>
<version>3.0</version>
</parent>
<artifactId>objenesis-benchmark</artifactId>
......@@ -15,7 +32,7 @@
<properties>
<!-- Minimum for this module is 1.8 -->
<javac.target>1.8</javac.target>
<jmh.version>1.19</jmh.version>
<jmh.version>1.21</jmh.version>
<uberjar.name>benchmarks</uberjar.name>
</properties>
......@@ -41,7 +58,7 @@
<dependency>
<groupId>cglib</groupId>
<artifactId>cglib-nodep</artifactId>
<version>3.2.5</version>
<version>3.2.8</version>
</dependency>
</dependencies>
......@@ -60,8 +77,8 @@
<artifactId>maven-timestamp-plugin</artifactId>
</plugin>
<plugin>
<groupId>com.mycila.maven-license-plugin</groupId>
<artifactId>maven-license-plugin</artifactId>
<groupId>com.mycila</groupId>
<artifactId>license-maven-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-remote-resources-plugin</artifactId>
......@@ -74,7 +91,6 @@
</plugin>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<version>2.4.3</version>
<executions>
<execution>
<phase>package</phase>
......
/**
* Copyright 2006-2017 the original author or authors.
/*
* Copyright 2006-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/**
* Copyright 2006-2017 the original author or authors.
/*
* Copyright 2006-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
objenesis (3.0-1) unstable; urgency=medium
* New upstream version 3.0.
* Drop all patches. They were merged upstream.
-- Markus Koschany <apo@debian.org> Fri, 12 Oct 2018 22:10:39 +0200
objenesis (2.6-3) unstable; urgency=medium
* Team upload.
......
......@@ -4,12 +4,12 @@ Upstream-Contact: Objenesis Team <http://groups.google.com/group/objenesis-dev>
Source: https://github.com/easymock/objenesis
Files: *
Copyright: 2006-2017 Joe Walnes, Henri Tremblay, Leonardo Mesquita
Copyright: 2006-2018 Joe Walnes, Henri Tremblay, Leonardo Mesquita
License: Apache-2.0
Files: debian/*
Copyright: 2010, Gabriele Giacone <1o5g4r8o@gmail.com>
2014-2017, Markus Koschany <apo@debian.org>
2014-2018, Markus Koschany <apo@debian.org>
License: Apache-2.0
License: Apache-2.0
......
Description: Ignore the magic test to Java 9 AND higher
Author: Henri Tremblay <henri.tremblay@gmail.com>
Origin: backport, https://github.com/easymock/objenesis/commit/2c1e411b9dd04a53290a761e7bbad90c3f7c344b.patch
--- a/main/src/main/java/org/objenesis/strategy/PlatformDescription.java
+++ b/main/src/main/java/org/objenesis/strategy/PlatformDescription.java
@@ -134,6 +134,11 @@
return bootClasspath != null && bootClasspath.toLowerCase().contains("core-oj.jar");
}
+ public static boolean isAfterJigsaw() {
+ String version = PlatformDescription.SPECIFICATION_VERSION;
+ return version.indexOf('.') < 0; // No dot means the version is 9, 10, 11, ... not 1.6, 1.7, 1.8
+ }
+
public static boolean isGoogleAppEngine() {
return GAE_VERSION != null;
}
--- a/main/src/test/java/org/objenesis/instantiator/sun/MagicInstantiatorTest.java
+++ b/main/src/test/java/org/objenesis/instantiator/sun/MagicInstantiatorTest.java
@@ -33,7 +33,7 @@
public void before() {
// I know it works on Hotspot and OpenJDK. Before JDK 9. Not sure on others
assumeTrue((PlatformDescription.isThisJVM(PlatformDescription.HOTSPOT) || PlatformDescription.isThisJVM(PlatformDescription.OPENJDK))
- && !PlatformDescription.SPECIFICATION_VERSION.equals("9")
+ && !PlatformDescription.isAfterJigsaw()
);
}
Description: Fixes the build failure with Java 11
Author: Emmanuel Bourg <ebourg@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());
01-java10-compatibility.patch
02-java11-compatibility.patch
......@@ -22,7 +22,7 @@ fi
version=$1
if [ "$(git branch | grep $version)" == "$version" ]; then
if [ "$(git branch | grep ${version)" == "${version}" ]; then
echo "A branch named $version clashes with the version tag"
exit 1
fi
......@@ -32,6 +32,9 @@ message="should be an environment variable"
[ -z "$bintray_api_key" ] && echo "bintray_api_key $message" && exit 1
[ -z "$bintray_user" ] && echo "bintray_user $message" && exit 1
# Weird fix required by GPG. See https://github.com/keybase/keybase-issues/issues/1712. You will have to enter the passphrase on screen
export GPG_TTY=$(tty)
mvn release:prepare -Pall,full,release
# Need to push now because release:perform will checkout the remote tag
......@@ -45,13 +48,14 @@ open "https://github.com/easymock/objenesis/tags"
pause
# Create the distribution in bintray
date=$(date "+%Y-%m-%d")
content="{ \"name\": \"$version\", \"desc\": \"$version\", \"released\": \"${date}T00:00:00.000Z\", \"github_use_tag_release_notes\": true, \"vcs_tag\": \"$version\" }"
curl -XPOST -H "Content-Type: application/json" -u$bintray_user:$bintray_api_key \
curl -XPOST -H "Content-Type: application/json" -u${bintray_user}:${bintray_api_key} \
-d "$content" https://api.bintray.com/packages/easymock/distributions/objenesis/versions
curl -v -H "X-GPG-PASSPHRASE: $gpg_passphrase" -u$bintray_user:$bintray_api_key -T "main/target/objenesis-${version}-bin.zip" https://api.bintray.com/content/easymock/distributions/objenesis/${version}/objenesis-${version}-bin.zip?publish=1
curl -v -H "X-GPG-PASSPHRASE: $gpg_passphrase" -u$bintray_user:$bintray_api_key -T "tck/target/objenesis-tck-${version}.jar" https://api.bintray.com/content/easymock/distributions/objenesis/${version}/objenesis-tck-${version}.jar?publish=1
curl -v -H "X-GPG-PASSPHRASE: $gpg_passphrase" -u$bintray_user:$bintray_api_key -T "tck-android/target/objenesis-tck-android-${version}.apk" https://api.bintray.com/content/easymock/distributions/objenesis/${version}/objenesis-tck-android-${version}.apk?publish=1
curl -v -H "X-GPG-PASSPHRASE: $gpg_passphrase" -u${bintray_user}:${bintray_api_key} -T "main/target/objenesis-${version}-bin.zip" https://api.bintray.com/content/easymock/distributions/objenesis/${version}/objenesis-${version}-bin.zip?publish=1
curl -v -H "X-GPG-PASSPHRASE: $gpg_passphrase" -u${bintray_user}:${bintray_api_key} -T "tck/target/objenesis-tck-${version}.jar" https://api.bintray.com/content/easymock/distributions/objenesis/${version}/objenesis-tck-${version}.jar?publish=1
curl -v -H "X-GPG-PASSPHRASE: $gpg_passphrase" -u${bintray_user}:${bintray_api_key} -T "tck-android/target/objenesis-tck-android-${version}.apk" https://api.bintray.com/content/easymock/distributions/objenesis/${version}/objenesis-tck-android-${version}.apk?publish=1
echo "Flag the bin, tck and tck-android as 'Show in download list' in bintray"
open "https://bintray.com/easymock/distributions/objenesis/${version}#files"
......
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2006-2018 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<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>
......@@ -6,7 +23,7 @@
<parent>
<artifactId>objenesis-parent</artifactId>
<groupId>org.objenesis</groupId>
<version>2.6</version>
<version>3.0</version>
</parent>
<artifactId>gae</artifactId>
......@@ -17,7 +34,7 @@
<properties>
<app.id>objenesis</app.id>
<app.version>2</app.version>
<appengine.version>1.9.54</appengine.version>
<appengine.version>1.9.65</appengine.version>
<gcloud.plugin.version>2.0.9.133.v201611104</gcloud.plugin.version>
</properties>
......@@ -77,13 +94,6 @@
<!-- for hot reload of the web application-->
<outputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF/classes</outputDirectory>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
......@@ -92,7 +102,6 @@
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>3.0.0</version>
<configuration>
<archiveClasses>true</archiveClasses>
<webResources>
......@@ -111,8 +120,8 @@
<artifactId>maven-timestamp-plugin</artifactId>
</plugin>
<plugin>
<groupId>com.mycila.maven-license-plugin</groupId>
<artifactId>maven-license-plugin</artifactId>
<groupId>com.mycila</groupId>
<artifactId>license-maven-plugin</artifactId>
</plugin>
<plugin>
......
/**
* Copyright 2006-2017 the original author or authors.
/*
* Copyright 2006-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/**
* Copyright 2006-2017 the original author or authors.
/*
* Copyright 2006-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......@@ -56,6 +56,17 @@ public class JspWriterListener implements SearchWorkingInstantiatorListener {
}
}
@Override
public void instantiatorNotFound(String className, Throwable t) {
ByteArrayOutputStream b = new ByteArrayOutputStream();
t.printStackTrace(new PrintStream(b));
try {
writer.println(String.format(PATTERN, className + " not found", "KO - " + t));
} catch (IOException e) {
throw new RuntimeException(e);
}
}
private Typology getTypology(Class<?> c) {
Instantiator instantiatorAnn = c.getAnnotation(Instantiator.class);
return instantiatorAnn == null ? Typology.UNKNOWN : instantiatorAnn.value();
......
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2006-2017 the original author or authors.
Copyright 2006-2018 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
......
#
# Copyright 2006-2017 the original author or authors.
# Copyright 2006-2018 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
......
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2006-2017 the original author or authors.
Copyright 2006-2018 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
......