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

Cosmetics.

This commit is contained in:
Sergey Prigogin 2011-07-29 13:42:10 -07:00
parent f4600b8703
commit 6f5df15c4f
3 changed files with 44 additions and 50 deletions

View file

@ -8,10 +8,8 @@
* Contributors: * Contributors:
* Doug Schaefer (QNX) - Initial API and implementation * Doug Schaefer (QNX) - Initial API and implementation
* Markus Schorn (Wind River Systems) * Markus Schorn (Wind River Systems)
* IBM Corporation * IBM Corporation - Language management feature (see Bugzilla 151850)
* - Language managment feature (see Bugzilla 151850)
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.core.model; package org.eclipse.cdt.core.model;
import java.util.ArrayList; import java.util.ArrayList;
@ -227,8 +225,8 @@ public class LanguageManager {
* @deprecated use getRegisteredContentTypes() instead. * @deprecated use getRegisteredContentTypes() instead.
*/ */
@Deprecated @Deprecated
public ArrayList/*<String>*/<String> getAllContentTypes() { public ArrayList<String> getAllContentTypes() {
ArrayList/*<String>*/<String> allTypes = new ArrayList<String>(); ArrayList<String> allTypes = new ArrayList<String>();
allTypes.add(CCorePlugin.CONTENT_TYPE_ASMSOURCE); allTypes.add(CCorePlugin.CONTENT_TYPE_ASMSOURCE);
allTypes.add(CCorePlugin.CONTENT_TYPE_CHEADER); allTypes.add(CCorePlugin.CONTENT_TYPE_CHEADER);
allTypes.add(CCorePlugin.CONTENT_TYPE_CSOURCE); allTypes.add(CCorePlugin.CONTENT_TYPE_CSOURCE);
@ -261,7 +259,7 @@ public class LanguageManager {
} }
private Set<String> collectContentTypeIds() { private Set<String> collectContentTypeIds() {
HashSet/*<String>*/<String> allTypes = new HashSet<String>(); HashSet<String> allTypes = new HashSet<String>();
allTypes.add(CCorePlugin.CONTENT_TYPE_ASMSOURCE); allTypes.add(CCorePlugin.CONTENT_TYPE_ASMSOURCE);
allTypes.add(CCorePlugin.CONTENT_TYPE_CHEADER); allTypes.add(CCorePlugin.CONTENT_TYPE_CHEADER);
allTypes.add(CCorePlugin.CONTENT_TYPE_CSOURCE); allTypes.add(CCorePlugin.CONTENT_TYPE_CSOURCE);
@ -490,8 +488,7 @@ public class LanguageManager {
IContentType contentType = CContentTypes.getContentType(project, fullPathToFile); IContentType contentType = CContentTypes.getContentType(project, fullPathToFile);
if(contentType == null) if (contentType == null) {
{
return null; return null;
} }
@ -561,7 +558,6 @@ public class LanguageManager {
return getLanguageForFile(file, configuration, null); return getLanguageForFile(file, configuration, null);
} }
/** /**
* Returns an ILanguage representing the language to be used for the given file. * Returns an ILanguage representing the language to be used for the given file.
* @return an ILanguage representing the language to be used for the given file * @return an ILanguage representing the language to be used for the given file
@ -572,12 +568,12 @@ public class LanguageManager {
* @throws CoreException * @throws CoreException
* @since 4.0 * @since 4.0
*/ */
public ILanguage getLanguageForFile(IFile file, ICConfigurationDescription configuration, String contentTypeId) throws CoreException { public ILanguage getLanguageForFile(IFile file, ICConfigurationDescription configuration,
String contentTypeId) throws CoreException {
IProject project = file.getProject(); IProject project = file.getProject();
if (contentTypeId == null) { if (contentTypeId == null) {
IContentType contentType= IContentType contentType= CContentTypes.getContentType(project, file.getLocation().toString());
CContentTypes.getContentType(project, file.getLocation().toString());
if (contentType == null) { if (contentType == null) {
return null; return null;
} }

View file

@ -55,7 +55,6 @@ class PDOMCache {
* @return a PDOM instance or null if the PDOM version was too old * @return a PDOM instance or null if the PDOM version was too old
*/ */
public PDOM getPDOM(IPath path, IIndexLocationConverter converter) { public PDOM getPDOM(IPath path, IIndexLocationConverter converter) {
if (path == null){ if (path == null){
return null; return null;
} }

View file

@ -108,8 +108,7 @@ public class IndexUI {
if (name != null) { if (name != null) {
return index.findBinding(name); return index.findBinding(name);
} }
} } else {
else {
String name= element.getElementName(); String name= element.getElementName();
name= name.substring(name.lastIndexOf(':')+1); name= name.substring(name.lastIndexOf(':')+1);
IIndexBinding[] bindings= index.findBindings(name.toCharArray(), IndexFilter.ALL, new NullProgressMonitor()); IIndexBinding[] bindings= index.findBindings(name.toCharArray(), IndexFilter.ALL, new NullProgressMonitor());
@ -223,9 +222,11 @@ public class IndexUI {
return false; return false;
} }
private static IRegion getConvertedRegion(ITranslationUnit tu, IIndexFile file, int pos, int length) throws CoreException { private static IRegion getConvertedRegion(ITranslationUnit tu, IIndexFile file, int pos,
int length) throws CoreException {
IRegion region= new Region(pos, length); IRegion region= new Region(pos, length);
IPositionConverter converter= CCorePlugin.getPositionTrackerManager().findPositionConverter(tu, file.getTimestamp()); IPositionConverter converter=
CCorePlugin.getPositionTrackerManager().findPositionConverter(tu, file.getTimestamp());
if (converter != null) { if (converter != null) {
region= converter.actualToHistoric(region); region= converter.actualToHistoric(region);
} }
@ -288,7 +289,6 @@ public class IndexUI {
if (definition != null) { if (definition != null) {
result.add(definition); result.add(definition);
} }
} }
return result.toArray(new ICElementHandle[result.size()]); return result.toArray(new ICElementHandle[result.size()]);
} }
@ -513,7 +513,6 @@ public class IndexUI {
if (result == null) if (result == null)
result= new ArrayList<IBinding>(instances.size()); result= new ArrayList<IBinding>(instances.size());
for (ICPPTemplateInstance inst : instances) { for (ICPPTemplateInstance inst : instances) {
if (!ASTInternal.hasDeclaration(inst)) { if (!ASTInternal.hasDeclaration(inst)) {
result.add(inst); result.add(inst);