SI-7151 Emit final in bytecode for final inner classes.

As we did before a regression in 18efdedfb / SI-5676.

This commit tightens up the condition in which the FINAL
modifier is omitted; it now *only* does this for the module
classes of nested objects.
SI-7364 Allow raw types in parent position in Java sources

To make this work, this commit simply restricts parent
type argument inference to Scala source files.

The surrounding code has also been refactored to avoid a var.
Merge pull request #2635 from retronym/ticket/7151

SI-7151 Emit final in bytecode for final inner classes.
Merge pull request #2628 from retronym/ticket/7364

SI-7364 Allow raw types in parent position in Java sources