--- old/src/jdk.jextract/share/classes/com/sun/tools/jextract/HeaderFile.java 2018-04-02 20:55:38.000000000 -0700 +++ new/src/jdk.jextract/share/classes/com/sun/tools/jextract/HeaderFile.java 2018-04-02 20:55:38.000000000 -0700 @@ -112,11 +112,23 @@ ctx.err.println(Main.format("warn.symbol.not.found", name)); } } + JType jt = dict.computeIfAbsent(t, type -> { logger.fine(() -> "PH: Compute type for " + type.spelling()); return define(type); }); assert (jt instanceof JType2); + + if (t.kind() == TypeKind.Typedef) { + // Enum is already an TypeAlias for int with proper name + // In case of typedef has a different name with enum, do we care? + // Typedef is a type annotation, has no real use case + if (t.canonicalType().kind() == TypeKind.Enum) { + logger.finest("Skip enum typedef for " + t.spelling()); + return; + } + } + // Only main file can define interface if (cf != null && this.main == main) { cf.addType(jt, c);