org.eclipse.cdt.codan.checkers.ui_1.0.0.201202111925

16:41:34.504 INFO  jd.cli.Main - Decompiling org.eclipse.cdt.codan.checkers.ui_1.0.0.201202111925.jar
package org.eclipse.cdt.codan.internal.checkers.ui.quickfix;

import java.util.HashMap;
import org.eclipse.cdt.codan.core.cxx.CxxAstUtils;
import org.eclipse.cdt.codan.core.cxx.CxxAstUtils.NameFinderVisitor;
import org.eclipse.cdt.codan.internal.checkers.ui.CheckersUiActivator;
import org.eclipse.cdt.codan.ui.AbstractAstRewriteQuickFix;
import org.eclipse.cdt.core.dom.ast.IASTDeclSpecifier;
import org.eclipse.cdt.core.dom.ast.IASTDeclaration;
import org.eclipse.cdt.core.dom.ast.IASTDeclarator;
import org.eclipse.cdt.core.dom.ast.IASTFileLocation;
import org.eclipse.cdt.core.dom.ast.IASTFunctionDeclarator;
import org.eclipse.cdt.core.dom.ast.IASTFunctionDefinition;
import org.eclipse.cdt.core.dom.ast.IASTName;
import org.eclipse.cdt.core.dom.ast.IASTNode;
import org.eclipse.cdt.core.dom.ast.IASTNodeSelector;
import org.eclipse.cdt.core.dom.ast.IASTParameterDeclaration;
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
import org.eclipse.cdt.core.dom.ast.IBinding;
import org.eclipse.cdt.core.dom.ast.INodeFactory;
import org.eclipse.cdt.core.dom.rewrite.ASTRewrite;
import org.eclipse.cdt.core.index.IIndex;
import org.eclipse.cdt.core.index.IIndexName;
import org.eclipse.cdt.core.model.ITranslationUnit;
import org.eclipse.core.resources.IMarker;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.ltk.core.refactoring.CompositeChange;

public class QuickFixCreateParameter
  extends AbstractAstRewriteQuickFix
{
  public String getLabel()
  {
    return Messages.QuickFixCreateParameter_0;
  }
  
  public void modifyAST(IIndex index, IMarker marker)
  {
    CxxAstUtils utils = CxxAstUtils.getInstance();
    CompositeChange c = new CompositeChange(Messages.QuickFixCreateParameter_0);
    try
    {
      ITranslationUnit baseTU = getTranslationUnitViaEditor(marker);
      IASTTranslationUnit baseAST = baseTU.getAST(index, 2);
      IASTName astName = getASTNameFromMarker(marker, baseAST);
      if (astName == null) {
        return;
      }
      IASTDeclaration declaration = CxxAstUtils.getInstance().createDeclaration(astName, baseAST.getASTNodeFactory(), index);
      
      IASTDeclSpecifier finalDeclSpec = (IASTDeclSpecifier)declaration.getChildren()[0];
      IASTDeclarator finalDeclarator = (IASTDeclarator)declaration.getChildren()[1];
      IASTFunctionDefinition function = utils.getEnclosingFunction(astName);
      if (function == null) {
        return;
      }
      CxxAstUtils.NameFinderVisitor nameFinderVisitor = new CxxAstUtils.NameFinderVisitor();
      function.accept(nameFinderVisitor);
      IASTName funcName = name;
      IBinding binding = funcName.resolveBinding();
      IIndexName[] declarations = index.findNames(binding, 3);
      if (declarations.length == 0) {
        return;
      }
      HashMap<ITranslationUnit, IASTTranslationUnit> cachedASTs = new HashMap();
      HashMap<ITranslationUnit, ASTRewrite> cachedRewrites = new HashMap();
      IIndexName[] arrayOfIIndexName1;
      int j = (arrayOfIIndexName1 = declarations).length;
      for (int i = 0; i < j; i++)
      {
        IIndexName iname = arrayOfIIndexName1[i];
        ITranslationUnit declTU = utils.getTranslationUnitFromIndexName(iname);
        IASTTranslationUnit declAST;
        ASTRewrite rewrite;
        if (!cachedASTs.containsKey(declTU))
        {
          IASTTranslationUnit declAST = declTU.getAST(index, 2);
          ASTRewrite rewrite = ASTRewrite.create(declAST);
          cachedASTs.put(declTU, declAST);
          cachedRewrites.put(declTU, rewrite);
        }
        else
        {
          declAST = (IASTTranslationUnit)cachedASTs.get(declTU);
          rewrite = (ASTRewrite)cachedRewrites.get(declTU);
        }
        IASTFileLocation fileLocation = iname.getFileLocation();
        IASTName declName = declAST.getNodeSelector(null).findEnclosingName(fileLocation.getNodeOffset(), 
          fileLocation.getNodeLength());
        if (declName != null)
        {
          INodeFactory factory = declAST.getASTNodeFactory();
          
          IASTNode n = declName;
          while ((n instanceof IASTName)) {
            n = n.getParent();
          }
          IASTFunctionDeclarator functionDecl = (IASTFunctionDeclarator)n;
          
          IASTParameterDeclaration newParam = factory.newParameterDeclaration(finalDeclSpec, finalDeclarator);
          rewrite.insertBefore(functionDecl, null, newParam, null);
        }
      }
      for (ASTRewrite rewrite : cachedRewrites.values()) {
        c.add(rewrite.rewriteAST());
      }
      c.perform(new NullProgressMonitor());
    }
    catch (CoreException e)
    {
      CheckersUiActivator.log(e);
    }
  }
  
  public boolean isApplicable(IMarker marker)
  {
    String problemArgument = getProblemArgument(marker, 1);
    return problemArgument.contains(":func");
  }
}

/* Location:
 * Qualified Name:     org.eclipse.cdt.codan.internal.checkers.ui.quickfix.QuickFixCreateParameter
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.cdt.codan.internal.checkers.ui.quickfix;

import org.eclipse.cdt.codan.core.model.IProblem;
import org.eclipse.cdt.codan.core.param.RootProblemPreference;
import org.eclipse.cdt.codan.ui.AbstractCodanCMarkerResolution;
import org.eclipse.core.resources.IMarker;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IRegion;
import org.eclipse.text.edits.InsertEdit;
import org.eclipse.text.edits.MalformedTreeException;

public class CaseBreakQuickFixComment
  extends AbstractCodanCMarkerResolution
{
  public String getLabel()
  {
    return Messages.CaseBreakQuickFixComment_Label;
  }
  
  public void apply(IMarker marker, IDocument document)
  {
    try
    {
      int line = marker.getAttribute("lineNumber", -1);
      if (line < 0) {
        return;
      }
      int offset = document.getLineOffset(line);
      String indent = getIndentationStr(document, line);
      String comment = getNoBreakComment(marker);
      String editStr = String.format("%s/* %s */\n", new Object[] { indent, comment });
      InsertEdit edit = new InsertEdit(offset, editStr);
      edit.apply(document);
    }
    catch (MalformedTreeException localMalformedTreeException) {}catch (BadLocationException localBadLocationException) {}
  }
  
  private String getIndentationStr(IDocument document, int line)
    throws BadLocationException
  {
    int prevLine = line - 1;
    IRegion lineInformation = document.getLineInformation(prevLine);
    String prevLineStr = document.get(lineInformation.getOffset(), lineInformation.getLength());
    int nonSpace = prevLineStr.indexOf(prevLineStr.trim());
    String indent = prevLineStr.substring(0, nonSpace);
    return indent;
  }
  
  private String getNoBreakComment(IMarker marker)
  {
    IProblem problem = getProblem(marker);
    RootProblemPreference map = (RootProblemPreference)problem.getPreference();
    String comment = (String)map.getChildValue("no_break_comment");
    if ((comment == null) || (comment.trim().length() == 0)) {
      comment = "no break";
    }
    return comment;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.cdt.codan.internal.checkers.ui.quickfix.CaseBreakQuickFixComment
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.cdt.codan.internal.checkers.ui.quickfix;

import org.eclipse.cdt.codan.internal.checkers.ui.CheckersUiActivator;
import org.eclipse.cdt.codan.internal.checkers.ui.Messages;
import org.eclipse.cdt.codan.ui.AbstractCodanCMarkerResolution;
import org.eclipse.core.resources.IMarker;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;

public class CatchByReferenceQuickFix
  extends AbstractCodanCMarkerResolution
{
  public String getLabel()
  {
    return Messages.CatchByReferenceQuickFix_Message;
  }
  
  public void apply(IMarker marker, IDocument document)
  {
    applyCatchByReferenceQuickFix(marker, document, false);
  }
  
  static void applyCatchByReferenceQuickFix(IMarker marker, IDocument document, boolean addConst)
  {
    try
    {
      int left = marker.getAttribute("charStart", -1);
      int right = marker.getAttribute("charEnd", -1);
      String inStr = document.get(left, right - left);
      document.replace(left, right - left, getCatchByReferenceString(inStr, addConst));
    }
    catch (BadLocationException e)
    {
      CheckersUiActivator.log(e);
    }
  }
  
  private static String getCatchByReferenceString(String inStr, boolean addConst)
  {
    StringBuilder stringBuilder = new StringBuilder(inStr.length() + 10);
    if (addConst) {
      stringBuilder.append("const ");
    }
    int space = inStr.lastIndexOf(' ');
    boolean hasDeclName = space != -1;
    String typename;
    String typename;
    if (hasDeclName) {
      typename = inStr.substring(0, space);
    } else {
      typename = inStr;
    }
    stringBuilder.append(typename);
    
    stringBuilder.append(" &");
    if (hasDeclName)
    {
      stringBuilder.append(" ");
      String declname = inStr.substring(space + 1);
      stringBuilder.append(declname);
    }
    return stringBuilder.toString();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.cdt.codan.internal.checkers.ui.quickfix.CatchByReferenceQuickFix
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.cdt.codan.internal.checkers.ui.quickfix;

import org.eclipse.cdt.codan.core.cxx.CxxAstUtils;
import org.eclipse.cdt.codan.internal.checkers.ui.CheckersUiActivator;
import org.eclipse.cdt.codan.ui.AbstractAstRewriteQuickFix;
import org.eclipse.cdt.core.dom.ast.IASTBreakStatement;
import org.eclipse.cdt.core.dom.ast.IASTCompoundStatement;
import org.eclipse.cdt.core.dom.ast.IASTNode;
import org.eclipse.cdt.core.dom.ast.IASTNodeSelector;
import org.eclipse.cdt.core.dom.ast.IASTStatement;
import org.eclipse.cdt.core.dom.ast.IASTSwitchStatement;
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
import org.eclipse.cdt.core.dom.ast.INodeFactory;
import org.eclipse.cdt.core.dom.rewrite.ASTRewrite;
import org.eclipse.cdt.core.index.IIndex;
import org.eclipse.cdt.core.model.ITranslationUnit;
import org.eclipse.core.resources.IMarker;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IRegion;
import org.eclipse.ltk.core.refactoring.Change;

public class CaseBreakQuickFixBreak
  extends AbstractAstRewriteQuickFix
{
  public boolean isApplicable(IMarker marker)
  {
    int line = marker.getAttribute("lineNumber", -1) - 1;
    if (line < 0) {
      return false;
    }
    return true;
  }
  
  public String getLabel()
  {
    return Messages.CaseBreakQuickFixBreak_Label;
  }
  
  protected IASTStatement getStmtBeforeBreak(IMarker marker, IASTTranslationUnit ast)
    throws BadLocationException
  {
    int line = marker.getAttribute("lineNumber", -1) - 1;
    if (line < 0) {
      return null;
    }
    IRegion lineInformation = getDocument().getLineInformation(line);
    IASTNodeSelector nodeSelector = ast.getNodeSelector(null);
    IASTNode containedNode = nodeSelector.findFirstContainedNode(lineInformation.getOffset(), lineInformation.getLength());
    IASTNode beforeBreakNode = null;
    if (containedNode != null) {
      beforeBreakNode = CxxAstUtils.getInstance().getEnclosingStatement(containedNode);
    } else {
      beforeBreakNode = nodeSelector.findEnclosingNode(lineInformation.getOffset(), lineInformation.getLength());
    }
    if ((beforeBreakNode instanceof IASTCompoundStatement)) {
      while (beforeBreakNode != null)
      {
        if (((beforeBreakNode.getParent() instanceof IASTCompoundStatement)) && 
          ((beforeBreakNode.getParent().getParent() instanceof IASTSwitchStatement)))
        {
          if ((beforeBreakNode instanceof IASTCompoundStatement))
          {
            IASTStatement[] statements = ((IASTCompoundStatement)beforeBreakNode).getStatements();
            return statements[(statements.length - 1)];
          }
          return (IASTStatement)beforeBreakNode;
        }
        beforeBreakNode = beforeBreakNode.getParent();
      }
    }
    if ((beforeBreakNode instanceof IASTStatement)) {
      return (IASTStatement)beforeBreakNode;
    }
    return null;
  }
  
  public void modifyAST(IIndex index, IMarker marker)
  {
    try
    {
      IASTTranslationUnit ast = getTranslationUnitViaEditor(marker).getAST(index, 2);
      IASTStatement beforeBreak = getStmtBeforeBreak(marker, ast);
      if ((beforeBreak.getParent() instanceof IASTCompoundStatement))
      {
        IASTCompoundStatement enclosingStatement = (IASTCompoundStatement)beforeBreak.getParent();
        IASTStatement after = getAfterStatement(beforeBreak);
        ASTRewrite r = ASTRewrite.create(enclosingStatement.getTranslationUnit());
        IASTBreakStatement breakStatement = ast.getASTNodeFactory().newBreakStatement();
        r.insertBefore(enclosingStatement, after, breakStatement, null);
        Change c = r.rewriteAST();
        c.perform(new NullProgressMonitor());
      }
    }
    catch (CoreException e)
    {
      CheckersUiActivator.log(e);
    }
    catch (BadLocationException e)
    {
      CheckersUiActivator.log(e);
    }
  }
  
  private IASTStatement getAfterStatement(IASTStatement beforeBreak)
  {
    IASTCompoundStatement enclosingStatement = (IASTCompoundStatement)beforeBreak.getParent();
    IASTStatement after = null;
    IASTStatement[] statements = enclosingStatement.getStatements();
    for (int i = 0; i < statements.length; i++)
    {
      IASTStatement st = statements[i];
      if ((st == beforeBreak) && 
        (i < statements.length - 1))
      {
        after = statements[(i + 1)];
        break;
      }
    }
    return after;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.cdt.codan.internal.checkers.ui.quickfix.CaseBreakQuickFixBreak
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.cdt.codan.internal.checkers.ui.quickfix;

import org.eclipse.cdt.codan.internal.checkers.ui.CheckersUiActivator;
import org.eclipse.cdt.codan.internal.checkers.ui.Messages;
import org.eclipse.cdt.codan.ui.AbstractCodanCMarkerResolution;
import org.eclipse.core.resources.IMarker;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.FindReplaceDocumentAdapter;
import org.eclipse.jface.text.IDocument;

public class QuickFixAssignmentInCondition
  extends AbstractCodanCMarkerResolution
{
  public String getLabel()
  {
    return Messages.QuickFixAssignmentInCondition_Message;
  }
  
  public void apply(IMarker marker, IDocument document)
  {
    int pos = getOffset(marker, document);
    try
    {
      FindReplaceDocumentAdapter dad = new FindReplaceDocumentAdapter(document);
      dad.find(pos, "=", 
        true, false, 
        false, false);
      dad.replace("==", false);
    }
    catch (BadLocationException e)
    {
      CheckersUiActivator.log(e);
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.cdt.codan.internal.checkers.ui.quickfix.QuickFixAssignmentInCondition
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.cdt.codan.internal.checkers.ui.quickfix;

import org.eclipse.cdt.codan.core.cxx.CxxAstUtils;
import org.eclipse.cdt.codan.internal.checkers.ui.CheckersUiActivator;
import org.eclipse.cdt.codan.ui.AbstractAstRewriteQuickFix;
import org.eclipse.cdt.core.dom.ast.IASTDeclaration;
import org.eclipse.cdt.core.dom.ast.IASTDeclarationStatement;
import org.eclipse.cdt.core.dom.ast.IASTName;
import org.eclipse.cdt.core.dom.ast.IASTNode;
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
import org.eclipse.cdt.core.dom.ast.INodeFactory;
import org.eclipse.cdt.core.dom.rewrite.ASTRewrite;
import org.eclipse.cdt.core.index.IIndex;
import org.eclipse.cdt.core.model.ITranslationUnit;
import org.eclipse.core.resources.IMarker;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.ltk.core.refactoring.Change;

public class QuickFixCreateLocalVariable
  extends AbstractAstRewriteQuickFix
{
  public String getLabel()
  {
    return Messages.QuickFixCreateLocalVariable_0;
  }
  
  public void modifyAST(IIndex index, IMarker marker)
  {
    CxxAstUtils utils = CxxAstUtils.getInstance();
    try
    {
      ITranslationUnit tu = getTranslationUnitViaEditor(marker);
      ast = tu.getAST(index, 2);
    }
    catch (CoreException e)
    {
      IASTTranslationUnit ast;
      CheckersUiActivator.log(e); return;
    }
    IASTTranslationUnit ast;
    IASTName astName;
    IASTName astName;
    if (isCodanProblem()) {
      astName = getASTNameFromMarker(marker, ast);
    } else {
      astName = getAstNameFromProblemArgument(marker, ast, 0);
    }
    if (astName == null) {
      return;
    }
    ASTRewrite r = ASTRewrite.create(ast);
    INodeFactory factory = ast.getASTNodeFactory();
    IASTDeclaration declaration = utils.createDeclaration(astName, factory, index);
    IASTDeclarationStatement newStatement = factory.newDeclarationStatement(declaration);
    IASTNode targetStatement = utils.getEnclosingStatement(astName);
    if (targetStatement == null) {
      return;
    }
    r.insertBefore(targetStatement.getParent(), targetStatement, newStatement, null);
    Change c = r.rewriteAST();
    try
    {
      c.perform(new NullProgressMonitor());
    }
    catch (CoreException e)
    {
      CheckersUiActivator.log(e);
      return;
    }
    try
    {
      marker.delete();
    }
    catch (CoreException e)
    {
      CheckersUiActivator.log(e);
    }
  }
  
  public boolean isApplicable(IMarker marker)
  {
    if (isCodanProblem())
    {
      String problemArgument = getProblemArgument(marker, 1);
      return problemArgument.contains(":func");
    }
    return true;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.cdt.codan.internal.checkers.ui.quickfix.QuickFixCreateLocalVariable
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.cdt.codan.internal.checkers.ui.quickfix;

import org.eclipse.cdt.codan.internal.checkers.ui.CheckersUiActivator;
import org.eclipse.cdt.codan.internal.checkers.ui.Messages;
import org.eclipse.cdt.codan.ui.AbstractCodanCMarkerResolution;
import org.eclipse.core.resources.IMarker;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;

public class SuggestedParenthesisQuickFix
  extends AbstractCodanCMarkerResolution
{
  public String getLabel()
  {
    return Messages.SuggestedParenthesisQuickFix_Message;
  }
  
  public boolean isApplicable(IMarker marker)
  {
    int charEnd = marker.getAttribute("charEnd", -1);
    if (charEnd == -1) {
      return false;
    }
    return true;
  }
  
  public void apply(IMarker marker, IDocument document)
  {
    int charStart = marker.getAttribute("charStart", -1);
    int charEnd = marker.getAttribute("charEnd", -1);
    if (charEnd == -1) {
      return;
    }
    try
    {
      document.replace(charStart, 0, "(");
      document.replace(charEnd + 1, 0, ")");
    }
    catch (BadLocationException e)
    {
      CheckersUiActivator.log(e);
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.cdt.codan.internal.checkers.ui.quickfix.SuggestedParenthesisQuickFix
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.cdt.codan.internal.checkers.ui.quickfix;

import org.eclipse.cdt.codan.core.cxx.CxxAstUtils;
import org.eclipse.cdt.codan.internal.checkers.ui.CheckersUiActivator;
import org.eclipse.cdt.codan.ui.AbstractAstRewriteQuickFix;
import org.eclipse.cdt.core.dom.ast.IASTCompositeTypeSpecifier;
import org.eclipse.cdt.core.dom.ast.IASTDeclaration;
import org.eclipse.cdt.core.dom.ast.IASTDeclarator;
import org.eclipse.cdt.core.dom.ast.IASTFunctionDeclarator;
import org.eclipse.cdt.core.dom.ast.IASTFunctionDefinition;
import org.eclipse.cdt.core.dom.ast.IASTName;
import org.eclipse.cdt.core.dom.ast.IASTNode;
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCompositeTypeSpecifier.ICPPASTBaseSpecifier;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTVisibilityLabel;
import org.eclipse.cdt.core.dom.rewrite.ASTRewrite;
import org.eclipse.cdt.core.index.IIndex;
import org.eclipse.cdt.core.model.ITranslationUnit;
import org.eclipse.core.resources.IMarker;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.ltk.core.refactoring.Change;

public class QuickFixCreateField
  extends AbstractAstRewriteQuickFix
{
  public String getLabel()
  {
    return Messages.QuickFixCreateField_0;
  }
  
  public void modifyAST(IIndex index, IMarker marker)
  {
    CxxAstUtils utils = CxxAstUtils.getInstance();
    try
    {
      IASTTranslationUnit ast = getTranslationUnitViaEditor(marker).getAST(index, 2);
      IASTName astName = getASTNameFromMarker(marker, ast);
      if (astName == null) {
        return;
      }
      IASTDeclaration declaration = utils.createDeclaration(astName, ast.getASTNodeFactory(), index);
      IASTCompositeTypeSpecifier targetCompositeType = utils.getEnclosingCompositeTypeSpecifier(astName);
      if (targetCompositeType == null)
      {
        targetCompositeType = utils.getCompositeTypeFromFunction(utils.getEnclosingFunction(astName), index);
        if (targetCompositeType == null) {
          return;
        }
      }
      ASTRewrite r = ASTRewrite.create(targetCompositeType.getTranslationUnit());
      IASTNode where = findInsertionPlace(targetCompositeType);
      r.insertBefore(targetCompositeType, where, declaration, null);
      Change c = r.rewriteAST();
      c.perform(new NullProgressMonitor());
    }
    catch (CoreException e)
    {
      CheckersUiActivator.log(e);
    }
  }
  
  protected IASTNode findInsertionPlace(IASTCompositeTypeSpecifier composite)
  {
    boolean wantPublicContext = composite.getKey() != 3;
    boolean inDesiredAccessibilityContext = true;
    IASTNode bestMatch = null;
    IASTNode[] children = composite.getChildren();
    IASTNode[] arrayOfIASTNode1;
    int j = (arrayOfIASTNode1 = children).length;
    for (int i = 0; i < j; i++)
    {
      IASTNode child = arrayOfIASTNode1[i];
      if ((!(child instanceof IASTName)) && (!(child instanceof ICPPASTCompositeTypeSpecifier.ICPPASTBaseSpecifier)))
      {
        bestMatch = child;
        break;
      }
    }
    for (int i = 0; i < children.length; i++)
    {
      IASTNode child = children[i];
      if ((child instanceof ICPPASTVisibilityLabel))
      {
        ICPPASTVisibilityLabel label = (ICPPASTVisibilityLabel)child;
        inDesiredAccessibilityContext = ((wantPublicContext) && (label.getVisibility() == 1)) || (
          (!wantPublicContext) && (label.getVisibility() == 3));
      }
      else if ((inDesiredAccessibilityContext) && ((child instanceof IASTDeclaration)) && (!(child instanceof IASTFunctionDefinition)))
      {
        IASTNode[] arrayOfIASTNode2;
        int m = (arrayOfIASTNode2 = child.getChildren()).length;
        for (int k = 0; k < m; k++)
        {
          IASTNode gchild = arrayOfIASTNode2[k];
          if (((gchild instanceof IASTDeclarator)) && (!(gchild instanceof IASTFunctionDeclarator)))
          {
            bestMatch = i + 1 < children.length ? children[(i + 1)] : null;
            break;
          }
        }
      }
    }
    return bestMatch;
  }
  
  public boolean isApplicable(IMarker marker)
  {
    String problemArgument = getProblemArgument(marker, 1);
    return (problemArgument.contains(":class")) && (problemArgument.contains(":func"));
  }
}

/* Location:
 * Qualified Name:     org.eclipse.cdt.codan.internal.checkers.ui.quickfix.QuickFixCreateField
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.cdt.codan.internal.checkers.ui.quickfix;

import org.eclipse.cdt.codan.internal.checkers.ui.Messages;
import org.eclipse.cdt.codan.ui.AbstractCodanCMarkerResolution;
import org.eclipse.core.resources.IMarker;
import org.eclipse.jface.text.IDocument;

public class CatchByConstReferenceQuickFix
  extends AbstractCodanCMarkerResolution
{
  public String getLabel()
  {
    return Messages.CatchByConstReferenceQuickFix_Message;
  }
  
  public void apply(IMarker marker, IDocument document)
  {
    CatchByReferenceQuickFix.applyCatchByReferenceQuickFix(marker, document, true);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.cdt.codan.internal.checkers.ui.quickfix.CatchByConstReferenceQuickFix
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.cdt.codan.internal.checkers.ui.quickfix;

import org.eclipse.osgi.util.NLS;

public class Messages
  extends NLS
{
  private static final String BUNDLE_NAME = "org.eclipse.cdt.codan.internal.checkers.ui.quickfix.messages";
  public static String CaseBreakQuickFixBreak_Label;
  public static String CaseBreakQuickFixComment_Label;
  public static String QuickFixCreateField_0;
  public static String QuickFixCreateLocalVariable_0;
  public static String QuickFixCreateParameter_0;
  
  static
  {
    NLS.initializeMessages("org.eclipse.cdt.codan.internal.checkers.ui.quickfix.messages", Messages.class);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.cdt.codan.internal.checkers.ui.quickfix.Messages
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.cdt.codan.internal.checkers.ui;

import org.eclipse.osgi.util.NLS;

public class Messages
  extends NLS
{
  public static String CatchByReferenceQuickFix_Message;
  public static String CatchByConstReferenceQuickFix_Message;
  public static String QuickFixAssignmentInCondition_Message;
  public static String SuggestedParenthesisQuickFix_Message;
  
  static
  {
    NLS.initializeMessages(Messages.class.getName(), Messages.class);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.cdt.codan.internal.checkers.ui.Messages
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.cdt.codan.internal.checkers.ui;

import org.eclipse.core.runtime.ILog;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;

public class CheckersUiActivator
  extends AbstractUIPlugin
{
  public static final String PLUGIN_ID = "org.eclipse.cdt.codan.checkers.ui";
  private static CheckersUiActivator plugin;
  
  public void start(BundleContext context)
    throws Exception
  {
    super.start(context);
    plugin = this;
  }
  
  public void stop(BundleContext context)
    throws Exception
  {
    plugin = null;
    super.stop(context);
  }
  
  public static CheckersUiActivator getDefault()
  {
    return plugin;
  }
  
  public static void log(IStatus status)
  {
    getDefault().getLog().log(status);
  }
  
  public static void log(Throwable e)
  {
    log(new Status(4, "org.eclipse.cdt.codan.checkers.ui", 1, "Internal Error", e));
  }
  
  public static void log(String message)
  {
    log(new Status(4, "org.eclipse.cdt.codan.checkers.ui", 1, message, null));
  }
}

/* Location:
 * Qualified Name:     org.eclipse.cdt.codan.internal.checkers.ui.CheckersUiActivator
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
1

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd