--- old/src/jdk.jextract/share/classes/com/sun/tools/jextract/tree/HeaderTree.java 2018-09-18 19:08:03.000000000 +0530 +++ new/src/jdk.jextract/share/classes/com/sun/tools/jextract/tree/HeaderTree.java 2018-09-18 19:08:03.000000000 +0530 @@ -31,12 +31,21 @@ private final Path path; private final List declarations; - public HeaderTree(Cursor c, Path path, List declarations) { - super(c); + HeaderTree(Cursor c, Path path, List declarations) { + this(c, path, declarations, c.spelling()); + } + + private HeaderTree(Cursor c, Path path, List declarations, String name) { + super(c, name); this.path = path; this.declarations = Collections.unmodifiableList(declarations); } + @Override + public HeaderTree withName(String newName) { + return name().equals(newName)? this : new HeaderTree(cursor(), path, declarations, newName); + } + public Path path() { return path; }