When starting to work with agents and the java.lang.instrument package I found it hard to develop and test the agent in an IDE (like Eclipse) because of the need to package the agent code in a jar file with a special manifest file.
The process was
To get around this process the idea was to have an agent which delegates it's work to other agents.
The code of the delegating agent would never change. So you build the delegating agent jar once, put it in your classpath, develop your own agent and configure the delegating agent to invoke your agent and run the unit test.
There is no need to package your agent code before testing.
The next agent was the ToStringEnhancerAgent. The need for such an agent arose when I worked with other peoples classes for which I needed a string representation. If some class did not implement the toString method the solution was to write some own method which creates the objects string representation.
It would be nicer if I could use the ToStringBuilder of the commons-lang library from Jakarta. But using e.g. the method reflectionToString of the ToStringBuilder was not satisfactory since the attributes of the object printed with this method were again printed using the attributes' toString method.
Another solution is to use instrumentation to change the toString method. The ToStringEnhancerAgent using the ASM framework to change the toString methods of some classes to use the ToStringBuilder.
This project was introduced to be a collection of useful agents.
Any feedback, requests and code are welcome.