mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-15 12:14:31 +00:00
added memoization to config lookup in eclipse. This should help make it (much) faster.
This commit is contained in:
1 parent
071fa6835a
commit
3131e93b92
1 file changed
+11
@@ -70,7 +70,18 @@ public class EclipseAST extends AST<EclipseAST, EclipseNode, ASTNode> {
|
||||
}
|
||||
|
||||
private static volatile boolean skipEclipseWorkspaceBasedFileResolver = false;
|
||||
private static final URI NOT_CALCULATED_MARKER = URI.create("http://projectlombok.org/not/calculated");
|
||||
private URI memoizedAbsoluteFileLocation = NOT_CALCULATED_MARKER;
|
||||
|
||||
public URI getAbsoluteFileLocation() {
|
||||
if (memoizedAbsoluteFileLocation != NOT_CALCULATED_MARKER) return memoizedAbsoluteFileLocation;
|
||||
|
||||
memoizedAbsoluteFileLocation = getAbsoluteFileLocation0();
|
||||
return memoizedAbsoluteFileLocation;
|
||||
}
|
||||
|
||||
/** This is the call, but we wrapped it to memoize this. */
|
||||
private URI getAbsoluteFileLocation0() {
|
||||
String fileName = getFileName();
|
||||
if (fileName != null && (fileName.startsWith("file:") || fileName.startsWith("sourcecontrol:"))) {
|
||||
// Some exotic build systems get real fancy with filenames. Known culprits:
|
||||
|
||||
Reference in new issue
Block a user