Community
Participate
Working Groups
A maven project consists of both regular source and test source and a ton of ITDs. One of the ITDs declares a final implementation of equals/hashcode on some set of target types. This works fine when the source is built. Later the testcode is built. Some references in the testcode cause the source types to be pulled in - these types go through the createBinaryTypeFrom() logic (in AjLookupEnvironment) - which attempts to reapply the ITDs - these look to 'clash' with those already in the target type and the message comes out
this is because of the check at the statr of ResolvedType.checkLegalOverride() which checks whether the parent is final. If it is then it just fails immediately. The problem is how do we recognize that the reason the method is there is because the ITD put it there earlier...
there is code to handle this case (binarytypebinding seeing an ITD for the second time) but it only works *if* the ITD is on the exact type. Where the ITD is on an interface and the binarytypebinding is for a type that is the top most implementor, that logic doesn't execute.
fixed. the detection logic for whether it is an ITD clash is duplicated in the checkLegalOverride code