1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-09-10 12:03:16 +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
@ -49,7 +52,11 @@ public interface ICDescriptionDelta {
// 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,6 +73,8 @@ 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

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();