diff options
author | Julien HENRY <julien.henry@sonarsource.com> | 2014-07-31 11:41:36 +0200 |
---|---|---|
committer | Julien HENRY <julien.henry@sonarsource.com> | 2014-07-31 11:42:35 +0200 |
commit | 981ba5f21600c0e10d8d37546cc8af86d315251e (patch) | |
tree | 9d1b509432dd308075b3ce0ea4db19f4180b9ad0 /sonar-batch | |
parent | 28bad14b81d5347ac7a9c1c053717d238a57ab1f (diff) | |
download | sonarqube-981ba5f21600c0e10d8d37546cc8af86d315251e.tar.gz sonarqube-981ba5f21600c0e10d8d37546cc8af86d315251e.zip |
Try to limit heap size by reusing String references
Diffstat (limited to 'sonar-batch')
-rw-r--r-- | sonar-batch/src/main/java/org/sonar/batch/scan/filesystem/DefaultInputFileValueCoder.java | 10 | ||||
-rw-r--r-- | sonar-batch/src/main/java/org/sonar/batch/scan/measure/MeasureValueCoder.java | 4 |
2 files changed, 7 insertions, 7 deletions
diff --git a/sonar-batch/src/main/java/org/sonar/batch/scan/filesystem/DefaultInputFileValueCoder.java b/sonar-batch/src/main/java/org/sonar/batch/scan/filesystem/DefaultInputFileValueCoder.java index d60cbac0088..6dcfc9903b1 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/scan/filesystem/DefaultInputFileValueCoder.java +++ b/sonar-batch/src/main/java/org/sonar/batch/scan/filesystem/DefaultInputFileValueCoder.java @@ -35,14 +35,14 @@ class DefaultInputFileValueCoder implements ValueCoder { public void put(Value value, Object object, CoderContext context) { DeprecatedDefaultInputFile f = (DeprecatedDefaultInputFile) object; putUTFOrNull(value, f.relativePath()); - putUTFOrNull(value, f.getFileBaseDir().toString()); + value.putString(f.getFileBaseDir().toString()); putUTFOrNull(value, f.deprecatedKey()); - putUTFOrNull(value, f.sourceDirAbsolutePath()); + value.putString(f.sourceDirAbsolutePath()); putUTFOrNull(value, f.pathRelativeToSourceDir()); putUTFOrNull(value, f.absolutePath()); - putUTFOrNull(value, f.language()); - putUTFOrNull(value, f.type().name()); - putUTFOrNull(value, f.status().name()); + value.putString(f.language()); + value.putString(f.type().name()); + value.putString(f.status().name()); putUTFOrNull(value, f.hash()); value.put(f.lines()); putUTFOrNull(value, f.key()); diff --git a/sonar-batch/src/main/java/org/sonar/batch/scan/measure/MeasureValueCoder.java b/sonar-batch/src/main/java/org/sonar/batch/scan/measure/MeasureValueCoder.java index c0906b51d6d..bd8cee930d8 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/scan/measure/MeasureValueCoder.java +++ b/sonar-batch/src/main/java/org/sonar/batch/scan/measure/MeasureValueCoder.java @@ -48,7 +48,7 @@ class MeasureValueCoder implements ValueCoder { value.put(m.getValue()); putUTFOrNull(value, m.getData()); putUTFOrNull(value, m.getDescription()); - putUTFOrNull(value, m.getAlertStatus() != null ? m.getAlertStatus().name() : null); + value.putString(m.getAlertStatus() != null ? m.getAlertStatus().name() : null); putUTFOrNull(value, m.getAlertText()); value.put(m.getTendency()); value.putDate(m.getDate()); @@ -65,7 +65,7 @@ class MeasureValueCoder implements ValueCoder { Integer personId = m.getPersonId(); value.put(personId != null ? personId.intValue() : null); PersistenceMode persistenceMode = m.getPersistenceMode(); - putUTFOrNull(value, persistenceMode != null ? persistenceMode.name() : null); + value.putString(persistenceMode != null ? persistenceMode.name() : null); } private void putUTFOrNull(Value value, @Nullable String utfOrNull) { |