1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-09 18:56:02 +02:00

Cosmetics.

This commit is contained in:
Sergey Prigogin 2010-08-23 05:04:50 +00:00
parent 7dafe8ec23
commit 06cdef2d93

View file

@ -527,7 +527,7 @@ public class TranslationUnit extends Openable implements ITranslationUnit {
while (iterator.hasNext()) { while (iterator.hasNext()) {
ICElement element = iterator.next(); ICElement element = iterator.next();
if (element instanceof Openable) { if (element instanceof Openable) {
((Openable)element).closeBuffer(); ((Openable) element).closeBuffer();
} }
} }
throw newNotPresentException(); throw newNotPresentException();
@ -541,8 +541,8 @@ public class TranslationUnit extends Openable implements ITranslationUnit {
} }
} }
if (info instanceof ASTHolderTUInfo) { if (info instanceof ASTHolderTUInfo) {
final IASTTranslationUnit ast= ((ASTHolderTUInfo)info).fAST; final IASTTranslationUnit ast= ((ASTHolderTUInfo) info).fAST;
((ASTHolderTUInfo)info).fAST= null; ((ASTHolderTUInfo) info).fAST= null;
return ast; return ast;
} }
return null; return null;
@ -559,7 +559,6 @@ public class TranslationUnit extends Openable implements ITranslationUnit {
@Override @Override
protected IBuffer openBuffer(IProgressMonitor pm) throws CModelException { protected IBuffer openBuffer(IProgressMonitor pm) throws CModelException {
// create buffer - translation units only use default buffer factory // create buffer - translation units only use default buffer factory
BufferManager bufManager = getBufferManager(); BufferManager bufManager = getBufferManager();
IBuffer buffer = getBufferFactory().createBuffer(this); IBuffer buffer = getBufferFactory().createBuffer(this);
@ -626,7 +625,7 @@ public class TranslationUnit extends Openable implements ITranslationUnit {
} }
} catch (Exception e) { } catch (Exception e) {
// use the debug log for this exception. // use the debug log for this exception.
Util.debugLog( "Exception in CModelBuilder", DebugLogConstants.MODEL); //$NON-NLS-1$ Util.debugLog("Exception in CModelBuilder", DebugLogConstants.MODEL); //$NON-NLS-1$
} }
} }
@ -641,7 +640,7 @@ public class TranslationUnit extends Openable implements ITranslationUnit {
mb.parse(quickParseMode); mb.parse(quickParseMode);
} catch (Exception e) { } catch (Exception e) {
// use the debug log for this exception. // use the debug log for this exception.
Util.debugLog( "Exception in contributed model builder", DebugLogConstants.MODEL); //$NON-NLS-1$ Util.debugLog("Exception in contributed model builder", DebugLogConstants.MODEL); //$NON-NLS-1$
} }
} }
@ -650,36 +649,28 @@ public class TranslationUnit extends Openable implements ITranslationUnit {
} }
public boolean isHeaderUnit() { public boolean isHeaderUnit() {
return ( return CCorePlugin.CONTENT_TYPE_CHEADER.equals(contentTypeId)
CCorePlugin.CONTENT_TYPE_CHEADER.equals(contentTypeId) || CCorePlugin.CONTENT_TYPE_CXXHEADER.equals(contentTypeId);
|| CCorePlugin.CONTENT_TYPE_CXXHEADER.equals(contentTypeId)
);
} }
public boolean isSourceUnit() { public boolean isSourceUnit() {
if (isHeaderUnit()) if (isHeaderUnit())
return false; return false;
return ( return CCorePlugin.CONTENT_TYPE_CSOURCE.equals(contentTypeId)
CCorePlugin.CONTENT_TYPE_CSOURCE.equals(contentTypeId)
|| CCorePlugin.CONTENT_TYPE_CXXSOURCE.equals(contentTypeId) || CCorePlugin.CONTENT_TYPE_CXXSOURCE.equals(contentTypeId)
|| CCorePlugin.CONTENT_TYPE_ASMSOURCE.equals(contentTypeId) || CCorePlugin.CONTENT_TYPE_ASMSOURCE.equals(contentTypeId)
|| LanguageManager.getInstance().isContributedContentType(contentTypeId) || LanguageManager.getInstance().isContributedContentType(contentTypeId);
);
} }
public boolean isCLanguage() { public boolean isCLanguage() {
return ( return CCorePlugin.CONTENT_TYPE_CSOURCE.equals(contentTypeId)
CCorePlugin.CONTENT_TYPE_CSOURCE.equals(contentTypeId) || CCorePlugin.CONTENT_TYPE_CHEADER.equals(contentTypeId);
|| CCorePlugin.CONTENT_TYPE_CHEADER.equals(contentTypeId)
);
} }
public boolean isCXXLanguage() { public boolean isCXXLanguage() {
return ( return CCorePlugin.CONTENT_TYPE_CXXSOURCE.equals(contentTypeId)
CCorePlugin.CONTENT_TYPE_CXXSOURCE.equals(contentTypeId) || CCorePlugin.CONTENT_TYPE_CXXHEADER.equals(contentTypeId);
|| CCorePlugin.CONTENT_TYPE_CXXHEADER.equals(contentTypeId)
);
} }
public boolean isASMLanguage() { public boolean isASMLanguage() {
@ -773,7 +764,7 @@ public class TranslationUnit extends Openable implements ITranslationUnit {
public IASTTranslationUnit getAST(IIndex index, int style, IProgressMonitor monitor) throws CoreException { public IASTTranslationUnit getAST(IIndex index, int style, IProgressMonitor monitor) throws CoreException {
ITranslationUnit configureWith = getSourceContextTU(index, style); ITranslationUnit configureWith = getSourceContextTU(index, style);
IScannerInfo scanInfo= configureWith.getScannerInfo( (style & AST_SKIP_IF_NO_BUILD_INFO) == 0); IScannerInfo scanInfo= configureWith.getScannerInfo((style & AST_SKIP_IF_NO_BUILD_INFO) == 0);
if (scanInfo == null) { if (scanInfo == null) {
return null; return null;
} }
@ -883,7 +874,7 @@ public class TranslationUnit extends Openable implements ITranslationUnit {
public IASTCompletionNode getCompletionNode(IIndex index, int style, int offset) throws CoreException { public IASTCompletionNode getCompletionNode(IIndex index, int style, int offset) throws CoreException {
ITranslationUnit configureWith= getSourceContextTU(index, style); ITranslationUnit configureWith= getSourceContextTU(index, style);
IScannerInfo scanInfo = configureWith.getScannerInfo( (style & ITranslationUnit.AST_SKIP_IF_NO_BUILD_INFO) == 0); IScannerInfo scanInfo = configureWith.getScannerInfo((style & ITranslationUnit.AST_SKIP_IF_NO_BUILD_INFO) == 0);
if (scanInfo == null) { if (scanInfo == null) {
return null; return null;
} }