MCPcopy Index your code
hub / github.com/easymock/objenesis

github.com/easymock/objenesis @3.5

Chat with this repo
repository ↗ · DeepWiki ↗ · release 3.5 ↗ · + Follow
536 symbols 1,033 edges 109 files 166 documented · 31% 13 cross-repo links
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Objenesis

Objenesis is a library dedicated to bypass the constructor when creating an object. On any JVM there is.

You can find the website and user documentation at objenesis.org.

Developer information

Project status

Build Status Maven Central

Environment setup

I'm using: - Maven 3.9.11 - IntelliJ Ultimate 2025.3.1 (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 - Import the Eclipse formatting file objenesis-formatting.xml (usable in Eclipse or IntelliJ)

To build with Maven

There are two different levels of build.

Build without any active profile

It is a basic compilation of the application.

mvn install

Full build

This build will create the source and javadoc jars and run spotbugs.

mvn install -Pfull

To run special builds

Run the Android TCK

Install required tools:

MacOs / *nix
  • 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)))/../..")))
Windows
  • Install Android Studio
  • Launch studio and install SDK and emulator
  • Add an ANDROID_HOME to environmental variables (path used to install SDK on previous step)

Run

  • Configure a device (real or simulated) and launch it (use API 26, after that it asks for a signature, that isn't supported yet)
  • Activate the debug mode if it's a real device
  • mvn package -Pandroid

Run the benchmarks

mvn package -Pbenchmark
cd benchmark
./launch.sh

Generate the website

mvn package -Pwebsite

To update the versions

  • mvn versions:set -DnewVersion=X.Y -Pall
  • mvn versions:commit -Pall if everything is ok, mvn versions:revert -Pall otherwise

Configure to deploy to the Sonatype maven repository

  • You will first need to add something like this to your settings.xml
<servers>
   <server>
      <id>ossrh</id>
      <username>sonatypeuser</username>
      <password>sonatypepassword</password>
   </server>
</servers>
  • Then follow the instructions from the site below to create your key to sign the deployed items

To check dependencies and plugins versions

mvn versions:display-dependency-updates versions:display-plugin-updates -Pall

To upgrade the Maven wrapper

mvn wrapper:wrapper

To update the license

mvn validate license:format -Pall

To run modernizer

mvn modernizer:modernizer -Pall

Reproducible build

We make sure a build will always create the same result with done from the same sources. It follows these guidelines.

Useful commands:

# Checks that all plugins are compatible
mvn artifact:check-buildplan -Pfull,all
# Build and install the artifact
mvn clean install -Pfull,all
# Build and compare the artifact with the installed one
mvn clean verify artifact:compare -Pfull,all

To release

  • Add the release notes in website/site/content/notes.html You use this code to generate it. If you have more than 100 items, do it again with &page=2
# Get the milestone matching the version
version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout | cut -d'-' -f1)
milestone=$(curl -s "https://api.github.com/repos/easymock/objenesis/milestones" | jq ".[] | select(.title==\"$version\") | .number")
echo "<h1>Version $version ($(date '+%Y-%m-%d'))</h1>"
echo
echo "<ul>"  
curl -s "https://api.github.com/repos/easymock/objenesis/issues?milestone=${milestone}&state=all&per_page=100" | jq -r '.[] | "  <li>" + .title + " (#" + (.number|tostring) + ")</li>"'
echo "</ul>"
  • Make sure you have Java 9+ in the path
  • Launch ./deploy.sh
  • Answer the questions (normally, just acknowledge the proposed default)
  • Follow the instructions

If something fails, and you need to rollback a bit, the following commands might help:

mvn release:rollback -Pall
git tag -d $version
git push origin :refs/tags/$version
git reset --hard HEAD~2

If you find something went wrong you can drop the staging repository with mvn nexus-staging:drop.

Deploy the website

  • Make sure the pom is at the version you want to release
  • Launch ./deploy-website.sh

Extension points exported contracts — how you extend this code

Objenesis (Interface)
Common interface to all kind of Objenesis objects @author Henri Tremblay [7 implementers]
main/src/main/java/org/objenesis/Objenesis.java
Reporter (Interface)
Reports results from the TCK back to the user. The sequence these methods are called is described below: star [8 implementers]
tck/src/main/java/org/objenesis/tck/Reporter.java
ObjectInstantiator (Interface)
Instantiates a new object. @author Leonardo Mesquita [26 implementers]
main/src/main/java/org/objenesis/instantiator/ObjectInstantiator.java
Feature (Interface)
A feature is a behavior that we expect from an instantiator. For example, we expect a serializing instantiator to call t [9 …
tck/src/main/java/org/objenesis/tck/features/Feature.java
InstantiatorStrategy (Interface)
Defines a strategy to determine the best instantiator for a class. @author Henri Tremblay [9 implementers]
main/src/main/java/org/objenesis/strategy/InstantiatorStrategy.java
SearchWorkingInstantiatorListener (Interface)
@author Henri Tremblay [2 implementers]
tck/src/main/java/org/objenesis/tck/search/SearchWorkingInstantiatorListener.java
ErrorHandler (Interface)
Handler for reporting errors from the AbstractLoader. [1 implementers]
tck/src/main/java/org/objenesis/tck/AbstractLoader.java

Core symbols most depended-on inside this repo

newInstance
called by 26
main/src/main/java/org/objenesis/Objenesis.java
isThisJVM
called by 11
main/src/main/java/org/objenesis/strategy/PlatformDescription.java
registerCandidate
called by 11
tck/src/main/java/org/objenesis/tck/TCK.java
getSimpleName
called by 11
tck/src/main/java/org/objenesis/tck/search/ClassEnumerator.java
getInstantiatorOf
called by 10
main/src/main/java/org/objenesis/Objenesis.java
pad
called by 8
tck/src/main/java/org/objenesis/tck/TextReporter.java
newInstance
called by 7
main/src/main/java/org/objenesis/instantiator/ObjectInstantiator.java
equals
called by 7
tck/src/main/java/org/objenesis/tck/Candidate.java

Shape

Method 378
Class 149
Interface 7
Enum 2

Languages

Java100%

Modules by API surface

tck/src/test/java/org/objenesis/tck/SerializableTest.java44 symbols
exotic/src/test/java/org/objenesis/instantiator/exotic/ClassReader.java28 symbols
tck/src/test/java/org/objenesis/tck/TCKTest.java22 symbols
tck/src/main/java/org/objenesis/tck/TextReporter.java14 symbols
main/src/main/java/org/objenesis/strategy/PlatformDescription.java13 symbols
exotic/src/main/java/org/objenesis/instantiator/exotic/util/DefineClassHelper.java13 symbols
benchmark/src/main/java/org/objenesis/benchmark/CreateObject.java12 symbols
tck/src/main/java/org/objenesis/tck/AbstractLoader.java11 symbols
tck/src/test/java/org/objenesis/tck/OsgiTest.java10 symbols
tck/src/test/java/org/objenesis/tck/AbstractLoaderTest.java10 symbols
tck/src/main/java/org/objenesis/tck/Candidate.java10 symbols
main/src/test/java/org/objenesis/ExternalizableTest.java10 symbols

For agents

$ claude mcp add objenesis \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact