Skip to content

Commit

Permalink
fix MappingsNester 's handling of classes without mappings
Browse files Browse the repository at this point in the history
  • Loading branch information
SpaceWalkerRS committed Nov 19, 2024
1 parent cfc0a93 commit cfe0d69
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,18 @@ private String translate(String className) {
}

private String findTranslation(String className) {
ClassMapping c = mappings.getClass(className);
Nest nest = nests.get(className);
String mappedName = (c == null) ? className : c.getName(nsid);
String mappedName = mappings.mapClassName(className, nsid);

return (nest == null) ? mappedName : applyNest(c, nest);
return (nest == null) ? mappedName : applyNest(mappedName, nest);
}

private String applyNest(ClassMapping c, Nest nest) {
private String applyNest(String mappedName, Nest nest) {
// this allows for mappings for nested classes to be
// saved mostly intact, which makes translation here
// easier
String enclTranslation = translate(nest.enclClassName);
String translation = c.getName(nsid).replace("__", "$");
String translation = mappedName.replace("__", "$");
int idx = translation.lastIndexOf('$');

if (idx > 0) {
Expand Down

0 comments on commit cfe0d69

Please sign in to comment.