[core] Fix the cache
- The cache listener was broken, and violations never actually made it to the cache
This commit is contained in:
1 parent
596cc2694d
commit
4f947b46e0
1 file changed
+2
-9
+2
-9
@@ -211,19 +211,12 @@ public abstract class AbstractAnalysisCache implements AnalysisCache {
|
||||
|
||||
@Override
|
||||
public FileAnalysisListener startFileAnalysis(TextDocument file) {
|
||||
String fileName = file.getPathId();
|
||||
AnalysisResult analysisResult = updatedResultsCache.get(fileName);
|
||||
if (analysisResult == null) {
|
||||
analysisResult = new AnalysisResult(file.getCheckSum());
|
||||
}
|
||||
final AnalysisResult nonNullAnalysisResult = analysisResult;
|
||||
final String fileName = file.getPathId();
|
||||
|
||||
return new FileAnalysisListener() {
|
||||
@Override
|
||||
public void onRuleViolation(RuleViolation violation) {
|
||||
synchronized (nonNullAnalysisResult) {
|
||||
nonNullAnalysisResult.addViolation(violation);
|
||||
}
|
||||
updatedResultsCache.get(fileName).addViolation(violation);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user