首页> 外文OA文献 >JEqualityGen: Generating Equality and Hashing Methods
【2h】

JEqualityGen: Generating Equality and Hashing Methods

机译:JEQUalityGen:生成平等和哈希方法

代理获取
本网站仅为用户提供外文OA文献查询和代理获取服务,本网站没有原文。下单后我们将采用程序或人工为您竭诚获取高质量的原文,但由于OA文献来源多样且变更频繁,仍可能出现获取不到、文献不完整或与标题不符等情况,如果获取不到我们将提供退款服务。请知悉。

摘要

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.
机译:在大型软件项目中手动实现equals(用于对象比较)和hashCode(用于对象哈希)方法既繁琐又容易出错。这是由于许多特殊情况,例如字段阴影,不同类型之间的比较或循环对象图。在这里,我们介绍JEqualityGen,它是一种源代码生成器,可自动派生这些方法的实现。 JEqualityGen处于两种状态:首先使用MetaAspectJ中的源代码反射来生成包含方法实现的方面,然后再在字节码级别上进行编织以将这些实现插入目标应用程序中。 JEqualityGen不仅生成正确而且有效的源代码,与基于运行时反射的现有系统相比,在典型的大型Java应用程序上,JequalityGen在生成的相等操作中将性能提高了两个数量级以上。 JEqualityGen通过生成收集数据的运行时分析代码来实现这一目标。这使它能够在第二轮中生成优化的方法实现。

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号