Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'codan/org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/internal/checkers/ui/quickfix/QuickFixCreateField.java')
-rw-r--r--codan/org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/internal/checkers/ui/quickfix/QuickFixCreateField.java16
1 files changed, 10 insertions, 6 deletions
diff --git a/codan/org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/internal/checkers/ui/quickfix/QuickFixCreateField.java b/codan/org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/internal/checkers/ui/quickfix/QuickFixCreateField.java
index 478914a147a..515a50acd91 100644
--- a/codan/org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/internal/checkers/ui/quickfix/QuickFixCreateField.java
+++ b/codan/org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/internal/checkers/ui/quickfix/QuickFixCreateField.java
@@ -44,7 +44,8 @@ public class QuickFixCreateField extends AbstractAstRewriteQuickFix {
@Override
public void modifyAST(IIndex index, IMarker marker) {
try {
- IASTTranslationUnit ast = getTranslationUnitViaEditor(marker).getAST(index, ITranslationUnit.AST_SKIP_INDEXED_HEADERS);
+ IASTTranslationUnit ast = getTranslationUnitViaEditor(marker).getAST(index,
+ ITranslationUnit.AST_SKIP_INDEXED_HEADERS);
IASTName astName = getASTNameFromMarker(marker, ast);
if (astName == null) {
return;
@@ -54,7 +55,8 @@ public class QuickFixCreateField extends AbstractAstRewriteQuickFix {
if (targetCompositeType == null) {
// We're not in an inline method;
// check if we're in a method at all
- targetCompositeType = CxxAstUtils.getCompositeTypeFromFunction(CxxAstUtils.getEnclosingFunction(astName), index);
+ targetCompositeType = CxxAstUtils
+ .getCompositeTypeFromFunction(CxxAstUtils.getEnclosingFunction(astName), index);
if (targetCompositeType == null) {
return;
}
@@ -71,13 +73,13 @@ public class QuickFixCreateField extends AbstractAstRewriteQuickFix {
/**
* Suggests a default place to insert a field:
- *
+ *
* Default place to insert:
* <ul>
* <li>If in a class, after last private field or at the end</li>
* <li>If in a struct, after last public field or at the end</li>
* </ul>
- *
+ *
* @param composite
* the composite to search
* @return an ASTNode inside composite to insert before, or null to insert
@@ -106,9 +108,11 @@ public class QuickFixCreateField extends AbstractAstRewriteQuickFix {
IASTNode child = children[i];
if (child instanceof ICPPASTVisibilityLabel) {
ICPPASTVisibilityLabel label = (ICPPASTVisibilityLabel) child;
- inDesiredAccessibilityContext = (wantPublicContext && label.getVisibility() == ICPPASTVisibilityLabel.v_public)
+ inDesiredAccessibilityContext = (wantPublicContext
+ && label.getVisibility() == ICPPASTVisibilityLabel.v_public)
|| (!wantPublicContext && label.getVisibility() == ICPPASTVisibilityLabel.v_private);
- } else if (inDesiredAccessibilityContext && (child instanceof IASTDeclaration) && !(child instanceof IASTFunctionDefinition)) {
+ } else if (inDesiredAccessibilityContext && (child instanceof IASTDeclaration)
+ && !(child instanceof IASTFunctionDefinition)) {
// TODO: the above condition needs to also check if child is not
// a typedef
for (IASTNode gchild : child.getChildren()) {

Back to the top