Codota Logo
ExtractToNullCheckedLocalProposal.<init>
Code IndexAdd Codota to your IDE (free)

How to use
org.eclipse.jdt.internal.ui.text.correction.proposals.ExtractToNullCheckedLocalProposal
constructor

Best Java code snippets using org.eclipse.jdt.internal.ui.text.correction.proposals.ExtractToNullCheckedLocalProposal.<init> (Showing top 2 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
OutputStreamWriter o =
  • Codota IconOutputStream out;new OutputStreamWriter(out)
  • Codota IconOutputStream out;String charsetName;new OutputStreamWriter(out, charsetName)
  • Codota IconHttpURLConnection connection;new OutputStreamWriter(connection.getOutputStream())
  • Smart code suggestions by Codota
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

/**
 * Fix for {@link IProblem#NullableFieldReference}
 * @param context context
 * @param problem problem to be fixed
 * @param proposals accumulator for computed proposals
 */
public static void addExtractCheckedLocalProposal(IInvocationContext context, IProblemLocation problem, Collection<ICommandAccess> proposals) {
  CompilationUnit compilationUnit = context.getASTRoot();
  ICompilationUnit cu= (ICompilationUnit) compilationUnit.getJavaElement();

  ASTNode selectedNode= problem.getCoveringNode(compilationUnit);
  SimpleName name= findProblemFieldName(selectedNode, problem.getProblemId());
  if (name == null)
    return;
  ASTNode method= ASTNodes.getParent(selectedNode, MethodDeclaration.class);
  if (method == null)
    method= ASTNodes.getParent(selectedNode, Initializer.class);
  if (method == null)
    return;
  
  proposals.add(new ExtractToNullCheckedLocalProposal(cu, compilationUnit, name, method));
}
private static SimpleName findProblemFieldName(ASTNode selectedNode, int problemID) {
origin: org.eclipse.jdt/org.eclipse.jdt.ui

/**
 * Fix for {@link IProblem#NullableFieldReference}
 * @param context context
 * @param problem problem to be fixed
 * @param proposals accumulator for computed proposals
 */
public static void addExtractCheckedLocalProposal(IInvocationContext context, IProblemLocation problem, Collection<ICommandAccess> proposals) {
  CompilationUnit compilationUnit = context.getASTRoot();
  ICompilationUnit cu= (ICompilationUnit) compilationUnit.getJavaElement();

  ASTNode selectedNode= problem.getCoveringNode(compilationUnit);
  SimpleName name= findProblemFieldName(selectedNode, problem.getProblemId());
  if (name == null)
    return;
  ASTNode method= ASTNodes.getParent(selectedNode, MethodDeclaration.class);
  if (method == null)
    method= ASTNodes.getParent(selectedNode, Initializer.class);
  if (method == null)
    return;
  
  proposals.add(new ExtractToNullCheckedLocalProposal(cu, compilationUnit, name, method));
}
private static SimpleName findProblemFieldName(ASTNode selectedNode, int problemID) {
org.eclipse.jdt.internal.ui.text.correction.proposalsExtractToNullCheckedLocalProposal<init>

Popular methods of ExtractToNullCheckedLocalProposal

  • addLinkedPosition
  • getCompilationUnit
  • getLinkedProposalModel
  • newType
    Create a fresh type reference
  • proposeLocalName

Popular in Java

  • Parsing JSON documents to java classes using gson
  • requestLocationUpdates (LocationManager)
  • putExtra (Intent)
  • compareTo (BigDecimal)
    Compares this BigDecimal with the specified BigDecimal. Two BigDecimal objects that are equal in val
  • FileWriter (java.io)
    Convenience class for writing character files. The constructors of this class assume that the defaul
  • URI (java.net)
    Represents a Uniform Resource Identifier (URI) reference. Aside from some minor deviations noted bel
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now