1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-09-10 03:53:21 +02:00

bug 290631: Scanner Discovery Challenge. ICSettingEntry &

ICDescriptionDelta as @noextend-@noimplement.
This commit is contained in:
Andrew Gvozdev 2012-01-04 17:44:54 -05:00
parent b83af889fb
commit 76163a477c
6 changed files with 73 additions and 26 deletions

View file

@ -339,7 +339,7 @@ public class CProjectDescriptionDeltaTests extends BaseTestCase{
ICConfigurationDescription cfgDescription = prjDescription.getConfigurations()[0];
assertNotNull(cfgDescription);
// Modification SOURCE_ENTENSIONS
// Modification SOURCE_EXTENSIONS
ICLanguageSetting langSetting = cfgDescription.getLanguageSettingForFile(file.getProjectRelativePath(), false);
final String testContentType = CCorePlugin.CONTENT_TYPE_ASMSOURCE;
langSetting.setSourceContentTypeIds(new String[] {testContentType});
@ -356,11 +356,11 @@ public class CProjectDescriptionDeltaTests extends BaseTestCase{
// Analyze delta
ICDescriptionDelta rootDelta = listener.getDelta();
assertNotNull(rootDelta);
List<ICDescriptionDelta> deltas = findDeltas(rootDelta, ICDescriptionDelta.SOURCE_ENTENSIONS);
List<ICDescriptionDelta> deltas = findDeltas(rootDelta, ICDescriptionDelta.SOURCE_EXTENSIONS);
assertEquals(1, deltas.size());
ICDescriptionDelta delta = deltas.get(0);
assertNotNull(delta);
// assertEquals(ICDescriptionDelta.SOURCE_ENTENSIONS, delta.getChangeFlags());
// assertEquals(ICDescriptionDelta.SOURCE_EXTENSIONS, delta.getChangeFlags());
// Check old setting
assertTrue(delta.getOldSetting() instanceof ICLanguageSetting);

View file

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<component id="org.eclipse.cdt.core" version="2">
<resource path="model/org/eclipse/cdt/core/settings/model/ICDescriptionDelta.java" type="org.eclipse.cdt.core.settings.model.ICDescriptionDelta">
<filter comment="Temporary filter to ignore added API restictions for interfaces that should be internal to begin with" id="403853384">
<message_arguments>
<message_argument value="org.eclipse.cdt.core.settings.model.ICDescriptionDelta"/>
</message_arguments>
</filter>
</resource>
<resource path="model/org/eclipse/cdt/core/settings/model/ICSettingEntry.java" type="org.eclipse.cdt.core.settings.model.ICSettingEntry">
<filter comment="Temporary filter to ignore added API restictions for interfaces that should be internal to begin with" id="403853384">
<message_arguments>
<message_argument value="org.eclipse.cdt.core.settings.model.ICSettingEntry"/>
</message_arguments>
</filter>
</resource>
</component>

View file

@ -10,7 +10,10 @@
*******************************************************************************/
package org.eclipse.cdt.core.settings.model;
/**
* @noextend This interface is not intended to be extended by clients.
* @noimplement This interface is not intended to be implemented by clients.
*/
public interface ICDescriptionDelta {
/*
* delta kinds
@ -18,8 +21,8 @@ public interface ICDescriptionDelta {
/**
* kind specifying that the setting object returned by
* the {@link #getSetting()} was removed
* the {@link #getNewSetting()} returns null
* the {@link #getOldSetting()} returns the same object as {@link #getSetting()}
* the {@link #getNewSetting()} returns null
* the {@link #getOldSetting()} returns the same object as {@link #getSetting()}
*/
int REMOVED = 1;
@ -27,29 +30,33 @@ public interface ICDescriptionDelta {
* kind specifying that the setting object returned by
* the {@link #getSetting()} was added
* the {@link #getNewSetting()} returns the same object as {@link #getSetting()}
* the {@link #getOldSetting()} returns null
* the {@link #getOldSetting()} returns null
*/
int ADDED = 2;
/**
* kind specifying that the setting object was changed
* the {@link #getNewSetting()} returns new object
* the {@link #getOldSetting()} returns old object
* the {@link #getNewSetting()} returns new object
* the {@link #getOldSetting()} returns old object
* the {@link #getSetting()} returns the same object as {@link #getNewSetting()}
*/
int CHANGED = 3;
/*
* delta change flags
*/
int ACTIVE_CFG = 1;
int NAME = 1 << 1;
int DESCRIPTION = 1 << 2;
// int PATH = 1 << 3;
int LANGUAGE_ID = 1 << 4;
int SOURCE_CONTENT_TYPE = 1 << 5;
int SOURCE_ENTENSIONS = 1 << 6;
/** @since 5.4 */
int SOURCE_EXTENSIONS = 1 << 6;
/** @deprecated Use ICDescriptionDelta.SOURCE_EXTENSIONS */
@Deprecated
int SOURCE_ENTENSIONS = SOURCE_EXTENSIONS;
// int HEADER_CONTENT_TYPE = 1 << 7;
// int HEADER_ENTENSIONS = 1 << 8;
int SETTING_ENTRIES = 1 << 9;
@ -66,17 +73,19 @@ public interface ICDescriptionDelta {
int OWNER = 1 << 20;
int INDEX_CFG = 1 << 21;
int SETTING_CFG = INDEX_CFG;
/** @since 5.4 */
int LANGUAGE_SETTINGS_PROVIDERS = 1 << 22;
/**
* specifies that the project "isCdtProjectCreating" state was set to false
* the PROJECT_CREAION_COMPLETED delta gets notified ONLY in case
* the project previously contained the project description with
* the project previously contained the project description with
* the true "isCdtProjectCreating" state
*
*
* in case the initial project description does NOT contain the true "isCdtProjectCreating"
* the project is considered as initialized from the very beginning
* the project is considered as initialized from the very beginning
* and the PROJECT_CREAION_COMPLETED delta is NOT notified
*
*
* @see ICProjectDescription#isCdtProjectCreating()
* @see ICProjectDescription#setCdtProjectCreated()
* @see ICProjectDescriptionManager#createProjectDescription(org.eclipse.core.resources.IProject, boolean, boolean)
@ -85,19 +94,19 @@ public interface ICDescriptionDelta {
/**
* returns the kind
* @see #ADDED
* @see #REMOVED
* @see #ADDED
* @see #REMOVED
* @see #CHANGED
*
*
* @return int
*/
int getDeltaKind();
/**
* @return ored delta flags
*/
int getChangeFlags();
int getSettingType();
int getAddedEntriesKinds();
@ -111,8 +120,8 @@ public interface ICDescriptionDelta {
ICSettingObject getNewSetting();
ICSettingObject getSetting();
ICSettingObject getOldSetting();
ICDescriptionDelta getParent();
}

View file

@ -12,6 +12,10 @@ package org.eclipse.cdt.core.settings.model;
import org.eclipse.cdt.core.model.IIncludeEntry;
/**
* @noextend This interface is not intended to be extended by clients.
* @noimplement This interface is not intended to be implemented by clients.
*/
public interface ICSettingEntry {
/**
* Flag {@code BUILTIN} indicates settings built in a tool (compiler) itself.
@ -46,6 +50,22 @@ public interface ICSettingEntry {
*/
int RESOLVED = 1 << 4;
/**
* Flag {@code UNDEFINED} indicates that the entry should not be defined.
* It's main purpose to provide the means to negate entries defined elsewhere.
*
* @since 5.4
*/
int UNDEFINED = 1 << 5;
/**
* Flag {@code FRAMEWORKS_MAC} applies for path entries. Such a path entry will be treated
* in a special way to imitate resolving paths by Apple's version of gcc, see bug 69529.
*
* @since 5.4
*/
int FRAMEWORKS_MAC = 1 << 6;
int INCLUDE_PATH = 1;
int INCLUDE_FILE = 1 << 1;
int MACRO = 1 << 2;

View file

@ -168,7 +168,7 @@ public class CProjectDescriptionDelta implements ICDescriptionDelta {
if ((flags&DESCRIPTION)!=0) str.append("DESCRIPTION|");
if ((flags&LANGUAGE_ID)!=0) str.append("LANGUAGE_ID|");
if ((flags&SOURCE_CONTENT_TYPE)!=0) str.append("SOURCE_CONTENT_TYPE|");
if ((flags&SOURCE_ENTENSIONS)!=0) str.append("SOURCE_ENTENSIONS|");
if ((flags&SOURCE_EXTENSIONS)!=0) str.append("SOURCE_EXTENSIONS|");
if ((flags&SETTING_ENTRIES)!=0) str.append("SETTING_ENTRIES|");
if ((flags&BINARY_PARSER_IDS)!=0) str.append("BINARY_PARSER_IDS|");
if ((flags&ERROR_PARSER_IDS)!=0) str.append("ERROR_PARSER_IDS|");
@ -182,6 +182,7 @@ public class CProjectDescriptionDelta implements ICDescriptionDelta {
if ((flags&EXT_REF)!=0) str.append("EXT_REF|");
if ((flags&OWNER)!=0) str.append("OWNER|");
if ((flags&INDEX_CFG)!=0) str.append("INDEX_CFG|");
if ((flags&LANGUAGE_SETTINGS_PROVIDERS)!=0) str.append("LANGUAGE_SETTINGS_PROVIDERS|");
if (str.charAt(str.length()-1)=='|') str.deleteCharAt(str.length()-1);
return str.toString();

View file

@ -1845,7 +1845,7 @@ public class CProjectDescriptionManager implements ICProjectDescriptionManager {
String[] newExts = newLs.getSourceExtensions();
String[] oldExts = oldLs.getSourceExtensions();
if(!Arrays.equals(newExts, oldExts))
delta.addChangeFlags(ICDescriptionDelta.SOURCE_ENTENSIONS);
delta.addChangeFlags(ICDescriptionDelta.SOURCE_EXTENSIONS);
// newCt = newLs.getHeaderContentType();