I’m not trying anything in particular. I’m using Hibernate bytecode enhancement with <enableAssociationManagement>true</enableAssociationManagement>. And I’m using SpotBugs to keep the code clean. SpotBugs’s specialty is that it scans class files (ie the bytecode) instead of the sources. So as I said, SpotBugs reported an error in the code generated by Hibernate. (see bug description) As you probably know this code is generated from templates residing in org.hibernate.bytecode.enhance.internal.bytebuddy.CodeTemplates. If you take a closer look at the code, you can see the line this faulty generated code stems from, and you can see that it makes no sense (see bug description - line 21 - marked with a comment) Since we have a clean code policy I tried to fix this by having a modified copy of CodeTemplate.class in one of our jars, which in turn is used as a dependency to hibernate-enhance-maven-plugin, so the modified CodeTemplate.class is in the class path before the original class from Hibernate. But this hack is not beautiful and needs to reviewed every time the Hibernate version changes, so I’d like you to fix this bug. I don’t see why you need a reproducer, just look at the code. |