1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

cleanup: warnings - $NON-NLS, field hiding, cast for clone()

This commit is contained in:
Andrew Gvozdev 2010-02-18 04:14:13 +00:00
parent c2a1e845ab
commit 43cb130a27

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2007 Intel Corporation and others. * Copyright (c) 2007, 2010 Intel Corporation and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -61,7 +61,7 @@ public class CProjectDescription implements ICProjectDescription, ICDataProxyCon
private ICConfigurationDescription fCfg; private ICConfigurationDescription fCfg;
private QualifiedName fPersistanceName; private QualifiedName fPersistanceName;
private boolean fNeedsPersistance; private boolean fNeedsPersistance;
private boolean fIsModified; private boolean fIsCfgModified;
CfgIdPair(CfgIdPair base){ CfgIdPair(CfgIdPair base){
fId = base.fId; fId = base.fId;
@ -111,7 +111,7 @@ public class CProjectDescription implements ICProjectDescription, ICDataProxyCon
fCfg = cfg; fCfg = cfg;
fId = cfg.getId(); fId = cfg.getId();
fIsModified = true; fIsCfgModified = true;
fNeedsPersistance = true; fNeedsPersistance = true;
} }
@ -122,7 +122,7 @@ public class CProjectDescription implements ICProjectDescription, ICDataProxyCon
if(!cfg.getId().equals(getId())) if(!cfg.getId().equals(getId()))
return; return;
fIsModified = true; fIsCfgModified = true;
fCfg = null; fCfg = null;
getConfiguration(); getConfiguration();
} }
@ -137,10 +137,10 @@ public class CProjectDescription implements ICProjectDescription, ICDataProxyCon
} }
private boolean store(String oldId, boolean force){ private boolean store(String oldId, boolean force){
if(force || fIsModified || fNeedsPersistance || oldId == null || !oldId.equals(fId)){ if(force || fIsCfgModified || fNeedsPersistance || oldId == null || !oldId.equals(fId)){
try { try {
getProject().setPersistentProperty(fPersistanceName, fId); getProject().setPersistentProperty(fPersistanceName, fId);
fIsModified = false; fIsCfgModified = false;
fNeedsPersistance = false; fNeedsPersistance = false;
return true; return true;
} catch (CoreException e) { } catch (CoreException e) {
@ -323,7 +323,9 @@ public class CProjectDescription implements ICProjectDescription, ICDataProxyCon
} }
} }
fPropertiesMap = (HashMap<QualifiedName, Object>)base.fPropertiesMap.clone(); @SuppressWarnings("unchecked")
HashMap<QualifiedName, Object> cloneMap = (HashMap<QualifiedName, Object>)base.fPropertiesMap.clone();
fPropertiesMap = cloneMap;
} }
/** /**
@ -497,7 +499,7 @@ public class CProjectDescription implements ICProjectDescription, ICDataProxyCon
public ICStorageElement getRootStorageElement() throws CoreException { public ICStorageElement getRootStorageElement() throws CoreException {
if (fRootStorageElement == null) if (fRootStorageElement == null)
throw ExceptionFactory.createCoreException("CProjectDescription ICStorageElement == null"); throw ExceptionFactory.createCoreException("CProjectDescription ICStorageElement == null"); //$NON-NLS-1$
// if(fRootStorageElement == null){ // if(fRootStorageElement == null){
// fRootStorageElement = CProjectDescriptionManager.getInstance().createStorage(fProject, true, true, isReadOnly()); // fRootStorageElement = CProjectDescriptionManager.getInstance().createStorage(fProject, true, true, isReadOnly());
@ -512,7 +514,7 @@ public class CProjectDescription implements ICProjectDescription, ICDataProxyCon
ICSettingsStorage getStorageBase() throws CoreException{ ICSettingsStorage getStorageBase() throws CoreException{
if(fStorage == null) if(fStorage == null)
// fStorage = new CStorage((InternalXmlStorageElement)getRootStorageElement()); // fStorage = new CStorage((InternalXmlStorageElement)getRootStorageElement());
throw ExceptionFactory.createCoreException("CProjectDescription ICSettingsStorage == null"); throw ExceptionFactory.createCoreException("CProjectDescription ICSettingsStorage == null"); //$NON-NLS-1$
return fStorage; return fStorage;
} }
@ -536,10 +538,10 @@ public class CProjectDescription implements ICProjectDescription, ICDataProxyCon
if(fIsModified) if(fIsModified)
return true; return true;
if(fActiveCfgInfo.fIsModified) if(fActiveCfgInfo.fIsCfgModified)
return true; return true;
if(fSettingCfgInfo.fIsModified) if(fSettingCfgInfo.fIsCfgModified)
return true; return true;
if(fPrefs.isModified()) if(fPrefs.isModified())
@ -559,9 +561,9 @@ public class CProjectDescription implements ICProjectDescription, ICDataProxyCon
fIsModified = modified; fIsModified = modified;
if(!modified){ if(!modified){
fActiveCfgInfo.fIsModified = false; fActiveCfgInfo.fIsCfgModified = false;
fSettingCfgInfo.fIsModified = false; fSettingCfgInfo.fIsCfgModified = false;
fPrefs.setModified(false); fPrefs.setModified(false);
@ -656,11 +658,11 @@ public class CProjectDescription implements ICProjectDescription, ICDataProxyCon
} }
boolean needsActiveCfgPersistence(){ boolean needsActiveCfgPersistence(){
return fActiveCfgInfo.fIsModified; return fActiveCfgInfo.fIsCfgModified;
} }
boolean needsSettingCfgPersistence(){ boolean needsSettingCfgPersistence(){
return fSettingCfgInfo.fIsModified; return fSettingCfgInfo.fIsCfgModified;
} }
CProjectDescriptionPreferences getPreferences(){ CProjectDescriptionPreferences getPreferences(){