Skip to content

Improve incremental tracking of method references and lambdas - #10323

Open
niloc132 wants to merge 15 commits into
gwtproject:mainfrom
niloc132:9670-method-ref-error
Open

Improve incremental tracking of method references and lambdas#10323
niloc132 wants to merge 15 commits into
gwtproject:mainfrom
niloc132:9670-method-ref-error

Conversation

@niloc132

Copy link
Copy Markdown
Member

Ensures that all GWT JDeclaredTypes are correctly marked as changed, including method references and lambdas.

Changes naming convention for method reference types - this slightly degrades debugability, but better ensures that fresh compiles and incremental compiles will result in the same output for a given class, improving how much testing we can do.

Note that adding/removing inner classes results in different incremental/initial output, so one of the new tests must opt out of that check.

Fixes #9670

@niloc132 niloc132 added this to the 2.14 milestone May 27, 2026
Comment on lines +1035 to +1037
if (incrementalCompile) {
compilerContext.getMinimalRebuildCache().recordNestedTypeNamesPerType(unit, types);
}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change lets us only deserialize the set of GWT types once. This is the only call to CompilationUnit.getTypes() and also the only call to recordNestedTypeNamesPerType.

@niloc132
niloc132 requested a review from vegegoku June 10, 2026 18:45
recordNestedTypeName(compilationUnitTypeName, typeName);
}
}
}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

THis pair of loops could probably be more efficient if we didn't remove-all and add-all, but just looked for the actual added/removed changes. GWT UI classes tend to have lambdas, anon inner classes, so this usually isn't a very short list, but it probably isn't long enough to really matter - but its also pretty likely most of the classes that were present last time are still there.

Comment thread dev/core/src/com/google/gwt/dev/MinimalRebuildCache.java
Comment thread dev/core/src/com/google/gwt/dev/MinimalRebuildCache.java Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Method references cached incorrectly in superdevmode 2.8.2

2 participants