Skip to content

Commit

Permalink
#1477 refinements after PR
Browse files Browse the repository at this point in the history
  • Loading branch information
elucash committed Aug 27, 2023
1 parent 27850d8 commit c643bef
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
Expand Up @@ -3,9 +3,8 @@
import org.immutables.fixture.module.Module;
import org.immutables.value.Value;


@Value.Immutable
@Value.Style(headerComments = true)
public interface HasModuleField {
Module getModule();
Module getModule();
}
Expand Up @@ -174,13 +174,19 @@ private void appendResolved(DeclaredType type) {
}

hasMaybeUnresolvedYetAfter |= importsResolver.unresolved;
} else if (typeName.equals("java.lang." + typeElement.getSimpleName())) {
// Because java.lang is automatically imported, you can have type names that are "resolved,"
} else if (typeName.startsWith("java.lang.")) {// saves on concat & other ops
// Because java.lang is automatically imported,
// you can have type names that are "resolved,"
// but aren't the names that are actually imported in the source file
String simpleName = type.asElement().getSimpleName().toString();
String guessedName = importsResolver.apply(simpleName);
if (!importsResolver.unresolved) {
typeName = guessedName;
String simpleName = typeElement.getSimpleName().toString();
// The only problem I might worry about is
// if we have java.lang.Something.Inner.InThere, however unlikely,
// and my brain is unable to understand if that is relevant or not for this case
if (typeName.equals("java.lang." + simpleName)) {
String guessedName = importsResolver.apply(simpleName);
if (!importsResolver.unresolved) {
typeName = guessedName;
}
}
}

Expand Down

0 comments on commit c643bef

Please sign in to comment.