<div dir="ltr"><div dir="ltr">On Sun, Feb 19, 2023 at 9:04 PM David Alayachew <<a href="mailto:davidalayachew@gmail.com" target="_blank">davidalayachew@gmail.com</a>> wrote:</div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto">Maybe I am naive, but why not add a signifier/suffix to the resulting .class file name to differentiate? Java already does this. Going back to my local classes example, if 2 local classes have the exact same name (where even the cases are the same), javac will call them Abc.java and Abc$1.java, or something like that. The point is, appending a signifier at the end is apparently good enough for the compiler to be able to tell which class to load when we run the compiled code. Would that not be an effective solution here too?<br></div></blockquote><div><br></div><div>That would work for synthetic inner classes. It still doesn't solve the larger problem though.<br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto"><div dir="auto"></div><div dir="auto">> So fixing this is do-able but not trivial</div><div dir="auto"><br></div><div dir="auto">I see what you mean. One thing that may be helpful as an intermediate goal would be to emit a warning/error on compile when running into this. At least then, we can minimize the impact of developers unexpectedly running into this during runtime. In the meantime, a more complex and long term solution can be developed.</div></div></blockquote><div> </div></div><div>Even a warning is non-trivial. It's normal to overwrite existing class files, so you couldn't rely on checking whether the file already existed. The file manager would have to keep track of every class file that it has written out so it could detect when a clash occurs, or something like that.<br></div><div><br></div><div>Also note that what exactly case-insensitive means depends on your choice of Locale (see also <a href="https://stackoverflow.com/q/8899929/263801">this link</a>). That may or may not matter depending on the approach.<br></div><div><br></div><div>-Archie<br></div><div><br>-- <br><div dir="ltr">Archie L. Cobbs<br></div></div></div>