I was specifically answering the J2CL part: you cannot use shadowing with J2CL, only with GWT.
More accurately, J2CL itself is rather low-level and will translate any file you give it; the "issue" here is rather the Closure Compiler (IIRC), that will error if it finds more than one file declaring the same Closure module (each Java class is translated to a Closure module).
You should however (IIRC and IIUC) be able to patch the Java Runtime Emulation (JRE) used by J2CL, similar to how you could patch it in GWT by using your own "fork" of the gwt-user.jar.
TL;DR: try hard to avoid using any class or method that's not part of the "built-in" emulation library. Refactor code to use an intermediate class (e.g. MyStringFormatter.format()) that you can then super-source. If compiling a third-party library, it might not be that bad of an idea to patch it (fork it) with that kind of refactoring.
I'll let Colin confirm though, as I've been away from J2CL for some time now.