mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-08 10:16:03 +02:00
Don't create empty file-mapping entries in .cproject file
When file language mapping is reset back to inherit, empty (without configuration, language and path attributes) file-mapping element is created in .cproject file. This leads to project corruption. Add a check for empty entry value in LanguageMappingStore#addFileMappings. 475344: Broken .cproject file after file language mapping is reset to inherit https://bugs.eclipse.org/bugs/show_bug.cgi?id=475344 Change-Id: I6e7d0b8d1199501e087ce42b75f0d8e83fca77cd Signed-off-by: Ivan Furnadjiev <ivan@eclipsesource.com>
This commit is contained in:
parent
74e4b6d504
commit
a48852f21a
1 changed files with 11 additions and 9 deletions
|
@ -270,6 +270,7 @@ public class LanguageMappingStore {
|
||||||
|
|
||||||
private void addFileMappings(Map<String, Map<String, String>> mappings, ICStorageElement rootElement) {
|
private void addFileMappings(Map<String, Map<String, String>> mappings, ICStorageElement rootElement) {
|
||||||
for (Map.Entry<String, Map<String, String>> entry : mappings.entrySet()) {
|
for (Map.Entry<String, Map<String, String>> entry : mappings.entrySet()) {
|
||||||
|
if (!entry.getValue().isEmpty()) {
|
||||||
ICStorageElement mapping = rootElement.createChild(FILE_MAPPING);
|
ICStorageElement mapping = rootElement.createChild(FILE_MAPPING);
|
||||||
String path = entry.getKey();
|
String path = entry.getKey();
|
||||||
for (Entry<String, String> configurationEntry : entry.getValue().entrySet()) {
|
for (Entry<String, String> configurationEntry : entry.getValue().entrySet()) {
|
||||||
|
@ -283,3 +284,4 @@ public class LanguageMappingStore {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue