diff options
author | Julien HENRY <julien.henry@sonarsource.com> | 2014-11-06 16:47:23 +0100 |
---|---|---|
committer | Julien HENRY <julien.henry@sonarsource.com> | 2014-11-07 16:10:40 +0100 |
commit | 1ce597bb9c13cc9b403da355b48e2188344fed71 (patch) | |
tree | 6d7c33902a26bac47b263fcdd3b358329f4d894a /sonar-batch | |
parent | b52699ac73962feafd13afca60af2fe9e5b66a95 (diff) | |
download | sonarqube-1ce597bb9c13cc9b403da355b48e2188344fed71.tar.gz sonarqube-1ce597bb9c13cc9b403da355b48e2188344fed71.zip |
SONAR-5672 Decrease memory comsumption when working on very big DSM with empty cells
Diffstat (limited to 'sonar-batch')
-rw-r--r-- | sonar-batch/src/main/java/org/sonar/batch/design/DsmSerializer.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sonar-batch/src/main/java/org/sonar/batch/design/DsmSerializer.java b/sonar-batch/src/main/java/org/sonar/batch/design/DsmSerializer.java index 48da21bd0c2..039921a94cf 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/design/DsmSerializer.java +++ b/sonar-batch/src/main/java/org/sonar/batch/design/DsmSerializer.java @@ -74,9 +74,9 @@ public final class DsmSerializer { } private void serializeCell(int y, int x) { - DsmCell cell = dsm.getCell(x, y); + DsmCell cell = dsm.cell(x, y); json.append('{'); - if (cell.getEdge() != null && cell.getWeight() > 0) { + if (cell != null && cell.getEdge() != null && cell.getWeight() > 0) { Dependency dep = (Dependency) cell.getEdge(); json.append("\"i\":"); json.append(dep.getId()); |