Closed boq closed 7 years ago
@LexManos can you look this over? This bug broke a PR earlier today, and it was tough to figure out since the gradle daemon just kills itself.
@boq what needs to be researched so we can take out the guesswork and be confident in these changes?
There are no known examples of local classes in MC codebase, so I wasn't sure how to name them.
My proposal generates something like pkgA.pkgB.Class.Inner$1Local
, i.e. package part with dots, and .
instead of $
to separate named inner classes from top-level. This is neither qualified name (since both anonymous and local classes don't have one - you can't use them in import statement) nor binary name (which would be pkgA/pkgB/Class$Inner$1Local
), but concatenation of both.
This was based on existing scheme for anonymous ones (pkgA.pkgB.Class.Inner$1
vs pkgA.pkgB.Class$Inner$1
). Extra substring weirdness is workaround for local classes with $
in simple name.
Is see you have referenced this issue from Forestry. I'm not sure if it's same issue - anonymous inner classes were already explicitly supported before (see here)
Thanks, I wanted to rule it out and now I agree it was not the same issue. After removing all anonymous inner classes I still had the problem. The issue does not seem to be deterministic, and it resolved itself before this PR was accepted. If it happens again I should be able to gather some more information now.
Without this change declaration of local class triggers call to
System.exit(1)
. This PR:System.exit(1)
call with error throw, to simplify debugging (AssertionError is used, since there is no point in catching this)MinecraftTest
). Nested classes inside local types are not considered (though they look likepkg.Outer$1Local.Inner
). Maintaners: Are there any rules for naming such cases in SRG files?Pushing as three commits to make review/commenting easier, will squash if accepted.