mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Cosmetics.
This commit is contained in:
parent
d2c51aec89
commit
004a2f86d8
3 changed files with 44 additions and 50 deletions
|
@ -8,10 +8,8 @@
|
|||
* Contributors:
|
||||
* Doug Schaefer (QNX) - Initial API and implementation
|
||||
* Markus Schorn (Wind River Systems)
|
||||
* IBM Corporation
|
||||
* - Language managment feature (see Bugzilla 151850)
|
||||
* IBM Corporation - Language management feature (see Bugzilla 151850)
|
||||
*******************************************************************************/
|
||||
|
||||
package org.eclipse.cdt.core.model;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
@ -227,8 +225,8 @@ public class LanguageManager {
|
|||
* @deprecated use getRegisteredContentTypes() instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public ArrayList/*<String>*/<String> getAllContentTypes() {
|
||||
ArrayList/*<String>*/<String> allTypes = new ArrayList<String>();
|
||||
public ArrayList<String> getAllContentTypes() {
|
||||
ArrayList<String> allTypes = new ArrayList<String>();
|
||||
allTypes.add(CCorePlugin.CONTENT_TYPE_ASMSOURCE);
|
||||
allTypes.add(CCorePlugin.CONTENT_TYPE_CHEADER);
|
||||
allTypes.add(CCorePlugin.CONTENT_TYPE_CSOURCE);
|
||||
|
@ -261,7 +259,7 @@ public class LanguageManager {
|
|||
}
|
||||
|
||||
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_CHEADER);
|
||||
allTypes.add(CCorePlugin.CONTENT_TYPE_CSOURCE);
|
||||
|
@ -490,8 +488,7 @@ public class LanguageManager {
|
|||
|
||||
IContentType contentType = CContentTypes.getContentType(project, fullPathToFile);
|
||||
|
||||
if(contentType == null)
|
||||
{
|
||||
if (contentType == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -561,7 +558,6 @@ public class LanguageManager {
|
|||
return getLanguageForFile(file, configuration, null);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 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
|
||||
|
@ -572,12 +568,12 @@ public class LanguageManager {
|
|||
* @throws CoreException
|
||||
* @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();
|
||||
|
||||
if (contentTypeId == null) {
|
||||
IContentType contentType=
|
||||
CContentTypes.getContentType(project, file.getLocation().toString());
|
||||
IContentType contentType= CContentTypes.getContentType(project, file.getLocation().toString());
|
||||
if (contentType == null) {
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -55,7 +55,6 @@ class PDOMCache {
|
|||
* @return a PDOM instance or null if the PDOM version was too old
|
||||
*/
|
||||
public PDOM getPDOM(IPath path, IIndexLocationConverter converter) {
|
||||
|
||||
if (path == null){
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -108,8 +108,7 @@ public class IndexUI {
|
|||
if (name != null) {
|
||||
return index.findBinding(name);
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
String name= element.getElementName();
|
||||
name= name.substring(name.lastIndexOf(':')+1);
|
||||
IIndexBinding[] bindings= index.findBindings(name.toCharArray(), IndexFilter.ALL, new NullProgressMonitor());
|
||||
|
@ -223,9 +222,11 @@ public class IndexUI {
|
|||
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);
|
||||
IPositionConverter converter= CCorePlugin.getPositionTrackerManager().findPositionConverter(tu, file.getTimestamp());
|
||||
IPositionConverter converter=
|
||||
CCorePlugin.getPositionTrackerManager().findPositionConverter(tu, file.getTimestamp());
|
||||
if (converter != null) {
|
||||
region= converter.actualToHistoric(region);
|
||||
}
|
||||
|
@ -288,7 +289,6 @@ public class IndexUI {
|
|||
if (definition != null) {
|
||||
result.add(definition);
|
||||
}
|
||||
|
||||
}
|
||||
return result.toArray(new ICElementHandle[result.size()]);
|
||||
}
|
||||
|
@ -513,7 +513,6 @@ public class IndexUI {
|
|||
if (result == null)
|
||||
result= new ArrayList<IBinding>(instances.size());
|
||||
|
||||
|
||||
for (ICPPTemplateInstance inst : instances) {
|
||||
if (!ASTInternal.hasDeclaration(inst)) {
|
||||
result.add(inst);
|
||||
|
|
Loading…
Add table
Reference in a new issue