mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Fix for PR 102058: Per file discovery + Extended Scanner Info + C Project does not work.
Fixed a bug with unitial updating of discovered scanner info.
This commit is contained in:
parent
295e397a5a
commit
a4b032301a
2 changed files with 6 additions and 7 deletions
|
@ -125,7 +125,7 @@ public class DiscoveredPathManager implements IDiscoveredPathManager, IResourceC
|
|||
* @see org.eclipse.cdt.make.core.scannerconfig.IDiscoveredPathManager#updateDiscoveredInfo(org.eclipse.cdt.make.core.scannerconfig.IDiscoveredPathManager.IDiscoveredPathInfo, java.util.List)
|
||||
*/
|
||||
public void updateDiscoveredInfo(IDiscoveredPathInfo info, List changedResources) throws CoreException {
|
||||
if (fDiscoveredMap.get(info.getProject()) != null) {
|
||||
if (fDiscoveredMap.get(info.getProject()) != info) {
|
||||
IDiscoveredScannerInfoSerializable serializable = info.getSerializable();
|
||||
if (serializable != null) {
|
||||
IProject project = info.getProject();
|
||||
|
|
|
@ -105,8 +105,7 @@ public class DiscoveredScannerInfoStore {
|
|||
|
||||
private Document getDocument(IProject project) throws CoreException {
|
||||
// Get the document
|
||||
Document document = null;
|
||||
document = (Document) fDocumentMap.get(project);
|
||||
Document document = (Document) fDocumentMap.get(project);
|
||||
if (document == null) {
|
||||
try {
|
||||
DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
|
||||
|
@ -154,9 +153,8 @@ public class DiscoveredScannerInfoStore {
|
|||
/**
|
||||
* @param document
|
||||
* @param project
|
||||
* @throws CoreException
|
||||
*/
|
||||
private void upgradeDocument(Document document, IProject project) throws CoreException {
|
||||
private void upgradeDocument(Document document, IProject project) {
|
||||
Element rootElem = (Element) document.getElementsByTagName(SI_ELEM).item(0); //$NON-NLS-1$
|
||||
ProcessingInstruction pi = document.createProcessingInstruction(SCD_STORE_VERSION, "version=\"2.0\""); //$NON-NLS-1$
|
||||
document.insertBefore(pi, rootElem);
|
||||
|
@ -173,9 +171,8 @@ public class DiscoveredScannerInfoStore {
|
|||
* @param scannerInfo
|
||||
* @param rootElement
|
||||
* @param doc
|
||||
* @throws CoreException
|
||||
*/
|
||||
private void saveDiscoveredScannerInfo(IDiscoveredScannerInfoSerializable serializable, Document doc) throws CoreException {
|
||||
private void saveDiscoveredScannerInfo(IDiscoveredScannerInfoSerializable serializable, Document doc) {
|
||||
NodeList rootList = doc.getElementsByTagName(SI_ELEM);
|
||||
if (rootList.getLength() > 0) {
|
||||
Element rootElem = (Element) rootList.item(0);
|
||||
|
@ -295,6 +292,8 @@ public class DiscoveredScannerInfoStore {
|
|||
// project deleted
|
||||
scProjectDeleted(project);
|
||||
}
|
||||
// remove from cache
|
||||
fDocumentMap.put(project, null);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue