我想在 Intellij 中生成 java equals() 和 hashcode() 方法。我希望它以 eclipse 生成的方式生成。我创建了一个自定义模板来执行此操作。但是,在 intellij 生成的 hashcode 方法中,成员是按照它们列出的顺序排列的,而不是按字母顺序排列的。但是eclipse在生成equals和hashcode方法时是按字母顺序排序的。我需要在 Intellij 中实现这一点。我找不到要使用的任何排序功能。任何帮助或指示将不胜感激。 谢谢
最佳答案
此请求已提交给 IntelliJ IDEA,它是 declined with the following comment :
We assume that you have ordered your members in a meaningful order within the file, and that preserving this order would be more meaningful than alphabetic sorting.
关于java - 如何在其成员排序的intellij中生成java的hashcode方法?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46830499/