Open mximp opened 1 year ago
@yegor256 please assisgn
@mximp I think we can stay with inner objects, but do something with their names. Why not?
@Graur please, help with this one
@mximp I think we can stay with inner objects, but do something with their names. Why not?
@yegor256 The issues is that it's Java compiler who is generating the names for inner classes: it prepends inner class name with the outer classes. No matter what names we pick for them with certain level of nesting the compiler will produce long enough .class
name to fail.
For example the following is the result of 40 nesting classes:
EOorg.EOeolang.EOexamples.EOtestTest.EOĻ1blah0.EOĻ2blah1.EOĻ3blah2.EOĻ4blah3.EOĻ5blah4.EOĻ6blah5.EOĻ7blah6.EOĻ8blah7.EOĻ9blah8.EOĻ10blah9.EOĻ11blah10.EOĻ12blah11.EOĻ13blah12.EOĻ14blah13.EOĻ15blah14.EOĻ16blah15.EOĻ17blah16.EOĻ18blah17.EOĻ19blah18.EOĻ20blah19.EOĻ21blah20.EOĻ22blah21.EOĻ23blah22.EOĻ24blah23.EOĻ25blah24.EOĻ26blah25.EOĻ27blah26.EOĻ28blah27.EOĻ29blah28.EOĻ30blah29.EOĻ31blah30.EOĻ32blah31.EOĻ33blah32.EOĻ34blah33.EOĻ35blah34.EOĻ36blah35.EOĻ37blah36.EOĻ38blah37.EOĻ39blah38.EOĻ40blah39
So the only solution I see here is to avoid nesting... Or at least nest classes into the same outer not into each other so we have names like: EOorg.EOeolang.EOexamples.EOtestTest.EOĻ1blah0
, EOorg.EOeolang.EOexamples.EOtestTest.EOĻ2blah1
, etc.
@mximp got it. I like the second option: keep all classes in the same file, but reposition them to avoid nesting.
@mximp let's do this?
@Graur I believe it was with you.
@maxonfjvipon please assign me
When
+junit
exists in eo code separate mechanism of Java code generation is enabled. It's driven byjunit.xsl
andrename-junit-inners.xsl
. It generates inner Java classes for each inner EO object which leads to long class names during Java compilation. The only option is to re-design how we generate Java code for tests. Probably we need to generate normal (not inner) Java class for each object just like it's done for normal objects.