@@ -56,13 +56,14 @@ public boolean sourcesRequired() {
56
56
}
57
57
58
58
private static VirtualFile asVirtualFile (SourceFile sourceFile , DelegatingReporter reporter ,
59
- HashMap <AbstractFile , VirtualFile > lookup , Map <AbstractFile , VirtualFile > placeholders ) {
60
- VirtualFile maybeCached = lookup .get (sourceFile .file ());
61
- if (maybeCached != null ) {
62
- return maybeCached ;
63
- } else {
64
- return fallbackVirtualFile (reporter , sourceFile , placeholders );
65
- }
59
+ HashMap <AbstractFile , VirtualFile > lookup ) {
60
+ return lookup .computeIfAbsent (sourceFile .file (), path -> {
61
+ reportMissingFile (reporter , sourceFile );
62
+ if (sourceFile .file ().jpath () != null )
63
+ return new BasicPathBasedFile (sourceFile );
64
+ else
65
+ return new PlaceholderVirtualFile (sourceFile );
66
+ });
66
67
}
67
68
68
69
private static void reportMissingFile (DelegatingReporter reporter , SourceFile sourceFile ) {
@@ -75,17 +76,6 @@ private static void reportMissingFile(DelegatingReporter reporter, SourceFile so
75
76
reporter .reportBasicWarning (message );
76
77
}
77
78
78
- private static VirtualFile fallbackVirtualFile (DelegatingReporter reporter , SourceFile sourceFile ,
79
- Map <AbstractFile , VirtualFile > placeholders ) {
80
- return placeholders .computeIfAbsent (sourceFile .file (), path -> {
81
- reportMissingFile (reporter , sourceFile );
82
- if (sourceFile .file ().jpath () != null )
83
- return new BasicPathBasedFile (sourceFile );
84
- else
85
- return new PlaceholderVirtualFile (sourceFile );
86
- });
87
- }
88
-
89
79
synchronized public void run (VirtualFile [] sources , AnalysisCallback callback , Logger log , Reporter delegate ) {
90
80
VirtualFile [] sortedSources = new VirtualFile [sources .length ];
91
81
System .arraycopy (sources , 0 , sortedSources , 0 , sources .length );
@@ -101,13 +91,12 @@ synchronized public void run(VirtualFile[] sources, AnalysisCallback callback, L
101
91
lookup .put (abstractFile , source );
102
92
}
103
93
104
- HashMap <AbstractFile , VirtualFile > placeholders = new HashMap <>();
105
-
106
94
DelegatingReporter reporter = new DelegatingReporter (delegate , (self , sourceFile ) ->
107
- asVirtualFile (sourceFile , self , lookup , placeholders ).id ());
95
+ asVirtualFile (sourceFile , self , lookup ).id ()
96
+ );
108
97
109
98
IncrementalCallback incCallback = new IncrementalCallback (callback , sourceFile ->
110
- asVirtualFile (sourceFile , reporter , lookup , placeholders )
99
+ asVirtualFile (sourceFile , reporter , lookup )
111
100
);
112
101
113
102
try {
0 commit comments