mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-07 08:15:48 +02:00
Fix warnings
This commit is contained in:
parent
52034c884a
commit
80c167206d
4 changed files with 24 additions and 31 deletions
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2007 Intel Corporation and others.
|
||||
* Copyright (c) 2007, 2008 Intel Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -330,7 +330,7 @@ public class CDataUtil {
|
|||
} else {
|
||||
exts = data.getSourceExtensions();
|
||||
if(exts != null && exts.length != 0)
|
||||
exts = (String[])exts.clone();
|
||||
exts = exts.clone();
|
||||
else
|
||||
exts = CDefaultLanguageData.EMPTY_STRING_ARRAY;
|
||||
}
|
||||
|
@ -516,7 +516,7 @@ public class CDataUtil {
|
|||
}
|
||||
CLanguageData lDatas[] = data.getLanguageDatas();
|
||||
for(int i = 0; i < lDatas.length; i++){
|
||||
CLanguageData lData = (CLanguageData)lDatas[i];
|
||||
CLanguageData lData = lDatas[i];
|
||||
String langId = lData.getLanguageId();
|
||||
if(langId != null){
|
||||
ILanguageDescriptor des = (ILanguageDescriptor)langMap.remove(langId);
|
||||
|
@ -732,9 +732,10 @@ public class CDataUtil {
|
|||
for(int i = 0; i < entries.size(); i++){
|
||||
ICSourceEntry entry = (ICSourceEntry)entries.get(i);
|
||||
entry = include(path, entry);
|
||||
if(entry != null)
|
||||
if(entry != null) {
|
||||
entries.set(i, entry);
|
||||
return i;
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
|
|
@ -1590,11 +1590,8 @@ public class CodeFormatterVisitor extends CPPASTVisitor {
|
|||
formatOpeningBrace(preferences.brace_position_for_type_declaration, preferences.insert_space_before_opening_brace_in_type_declaration);
|
||||
final int braceIndent= scribe.numberOfIndentations;
|
||||
|
||||
if (true /* preferences.insert_new_line_after_opening_brace_in_enumerator_list */) {
|
||||
scribe.startNewLine();
|
||||
} else if (true /* preferences.insert_space_after_opening_brace_in_enumerator_list */) {
|
||||
scribe.space();
|
||||
}
|
||||
scribe.startNewLine();
|
||||
|
||||
if (braceIndent == headerIndent) {
|
||||
scribe.indent();
|
||||
}
|
||||
|
@ -1618,11 +1615,8 @@ public class CodeFormatterVisitor extends CPPASTVisitor {
|
|||
if (enumIndent > braceIndent) {
|
||||
scribe.unIndent();
|
||||
}
|
||||
if (true /* preferences.insert_new_line_before_closing_brace_in_enumerator_list */) {
|
||||
scribe.startNewLine();
|
||||
} else if (true /* preferences.insert_space_before_closing_brace_in_enumerator_list */) {
|
||||
scribe.space();
|
||||
}
|
||||
scribe.startNewLine();
|
||||
|
||||
formatClosingBrace(preferences.brace_position_for_type_declaration);
|
||||
return PROCESS_SKIP;
|
||||
}
|
||||
|
@ -1758,9 +1752,9 @@ public class CodeFormatterVisitor extends CPPASTVisitor {
|
|||
}
|
||||
} else if (node.isCatchAll()) {
|
||||
scribe.printNextToken(Token.tELIPSE, false /* preferences.insert_space_before_ellipsis */);
|
||||
if (false /* preferences.insert_space_after_ellipsis */) {
|
||||
scribe.space();
|
||||
}
|
||||
// if (false /* preferences.insert_space_after_ellipsis */) {
|
||||
// scribe.space();
|
||||
// }
|
||||
}
|
||||
scribe.printNextToken(Token.tRPAREN, preferences.insert_space_before_closing_paren_in_catch);
|
||||
final IASTStatement catchBody= node.getCatchBody();
|
||||
|
|
|
@ -260,17 +260,15 @@ public final class CIndenter {
|
|||
}
|
||||
|
||||
private boolean prefParenthesisDeepIndent() {
|
||||
if (true) // don't do parenthesis deep indentation
|
||||
return false;
|
||||
// don't do parenthesis deep indentation
|
||||
// String option= getCoreFormatterOption(DefaultCodeFormatterConstants.FORMATTER_CONTINUATION_INDENTATION);
|
||||
// try {
|
||||
// return DefaultCodeFormatterConstants.getIndentStyle(option) == DefaultCodeFormatterConstants.INDENT_ON_COLUMN;
|
||||
// } catch (IllegalArgumentException e) {
|
||||
// // ignore and return default
|
||||
// }
|
||||
|
||||
String option= getCoreFormatterOption(DefaultCodeFormatterConstants.FORMATTER_CONTINUATION_INDENTATION);
|
||||
try {
|
||||
return DefaultCodeFormatterConstants.getIndentStyle(option) == DefaultCodeFormatterConstants.INDENT_ON_COLUMN;
|
||||
} catch (IllegalArgumentException e) {
|
||||
// ignore and return default
|
||||
}
|
||||
|
||||
return false; // sensible default
|
||||
return false;
|
||||
}
|
||||
|
||||
private int prefParenthesisIndent() {
|
||||
|
|
|
@ -119,9 +119,9 @@ public class TUCorrectionProposal extends ChangeCorrectionProposal {
|
|||
* @throws CoreException can be thrown if adding the edits is failing.
|
||||
*/
|
||||
protected void addEdits(IDocument document, TextEdit editRoot) throws CoreException {
|
||||
if (false) {
|
||||
throw new CoreException(CUIStatus.createError(IStatus.ERROR, "Implementors can throw an exception", null)); //$NON-NLS-1$
|
||||
}
|
||||
// if (false) {
|
||||
// throw new CoreException(CUIStatus.createError(IStatus.ERROR, "Implementors can throw an exception", null)); //$NON-NLS-1$
|
||||
// }
|
||||
}
|
||||
|
||||
protected LinkedProposalModel getLinkedProposalModel() {
|
||||
|
|
Loading…
Add table
Reference in a new issue