JEqualityGen: Generating Equality and Hashing Methods
Grech, Neville, Fischer, Bernd and Rathke, Julian (2010) JEqualityGen: Generating Equality and Hashing Methods. At Generative Programming and Component Engineering,, Eindhoven, The , Netherlands, 10 - 13 Oct 2010. Association for Computing Machinery, 177-186.
Download
|
PDF
- Published Version
Download (291Kb) |
Description/Abstract
Manually implementing equals (for object comparisons) and hashCode (for object hashing) methods in large software projects is tedious and error-prone. This is due to many special cases, such as field shadowing, comparison between different types, or cyclic object graphs. Here, we present JEqualityGen, a source code generator that automatically derives implementations of these methods. JEqualityGen proceeds in two states: it first uses source code reflection in MetaAspectJ to generate aspects that contain the method implementations, before it uses weaving on the bytecode level to insert these into the target application. JEqualityGen generates not only correct, but efficient source code that on a typical large-scale Java application exhibits a performance improvement of more than two orders of magnitude in the equality operations generated, compared to an existing system based on runtime reflection. JEqualityGen achieves this by generating runtime profiling code that collects data. This enables it to generate optimised method implementations in a second round.
| Item Type: | Conference or Workshop Item (Speech) |
|---|---|
| Additional Information: | Event Dates: October 10-13, 2010 |
| ISBNs: | 9781450301541 |
| Keywords: | meta-programming, equality, hashing, code generation, Java, Scala, AspectJ, AOP |
| Divisions: | Faculty of Physical and Applied Science > Electronics and Computer Science > Electronic & Software Systems |
| Item ID: | 271893 |
| Date Deposited: | 11 Jan 2011 13:09 |
| Last Modified: | 24 Jul 2012 03:59 |
| Contributors: | Grech, Neville (Author) Fischer, Bernd (Author) Rathke, Julian (Author) |
| Date: | 10 October 2010 |
| Additional Information: | Event Dates: October 10-13, 2010 |
| Status: | Published |
| Publisher: | Association for Computing Machinery |
| Contact Email Address: | n.grech@ecs.soton.ac.uk |
| Further Information: | Google Scholar |
| ISI Citation Count: | 0 |
| URI: | http://eprints.soton.ac.uk/id/eprint/271893 |
Actions (login required)
![]() |
View Item |


