Codota Logo
ExtractToNullCheckedLocalProposal$RearrangeStrategy$ModifyBlock
Code IndexAdd Codota to your IDE (free)

How to use
ExtractToNullCheckedLocalProposal$RearrangeStrategy$ModifyBlock
in
org.eclipse.jdt.internal.ui.text.correction.proposals

Best Java code snippets using org.eclipse.jdt.internal.ui.text.correction.proposals.ExtractToNullCheckedLocalProposal$RearrangeStrategy$ModifyBlock (Showing top 4 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Gson g =
  • Codota Iconnew Gson()
  • Codota IconGsonBuilder gsonBuilder;gsonBuilder.create()
  • Codota Iconnew GsonBuilder().create()
  • Smart code suggestions by Codota
}
origin: org.eclipse.jdt/org.eclipse.jdt.ui

  @Override
  public void insertIfStatement(IfStatement ifStmt, Block thenBlock) {
    // when stmt declares a local variable (see RearrangeStrategy.create(..)) we need to move all
    // subsequent statements into the then-block to ensure that the existing declared local is visible:
    List<ASTNode> blockStmts= this.block.statements();
    int stmtIdx= blockStmts.indexOf(this.origStmt);
    int lastIdx= blockStmts.size()-1;
    if (stmtIdx != -1 && stmtIdx < lastIdx) {
      thenBlock.statements()
      .add(this.blockRewrite.createMoveTarget(blockStmts.get(stmtIdx+1), blockStmts.get(lastIdx), null, this.group));
    }
    super.insertIfStatement(ifStmt, thenBlock);
  }
}
origin: org.eclipse.jdt/org.eclipse.jdt.ui

public static RearrangeStrategy create(Statement origStmt, ASTRewrite rewrite, TextEditGroup group) {
  ASTNode parent = origStmt.getParent();
  if (parent instanceof Block) {
    Block block= (Block)parent;
    if (origStmt instanceof VariableDeclarationStatement)
      return new ModifyBlockWithLocalDecl(origStmt, block, rewrite, group);
    else
      return new ModifyBlock(origStmt, block, rewrite, group);
  } else {
    return new ReplaceStatement(origStmt, rewrite, group);
  }
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

public static RearrangeStrategy create(Statement origStmt, ASTRewrite rewrite, TextEditGroup group) {
  ASTNode parent = origStmt.getParent();
  if (parent instanceof Block) {
    Block block= (Block)parent;
    if (origStmt instanceof VariableDeclarationStatement)
      return new ModifyBlockWithLocalDecl(origStmt, block, rewrite, group);
    else
      return new ModifyBlock(origStmt, block, rewrite, group);
  } else {
    return new ReplaceStatement(origStmt, rewrite, group);
  }
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

  @Override
  public void insertIfStatement(IfStatement ifStmt, Block thenBlock) {
    // when stmt declares a local variable (see RearrangeStrategy.create(..)) we need to move all
    // subsequent statements into the then-block to ensure that the existing declared local is visible:
    List<ASTNode> blockStmts= this.block.statements();
    int stmtIdx= blockStmts.indexOf(this.origStmt);
    int lastIdx= blockStmts.size()-1;
    if (stmtIdx != -1 && stmtIdx < lastIdx) {
      thenBlock.statements()
      .add(this.blockRewrite.createMoveTarget(blockStmts.get(stmtIdx+1), blockStmts.get(lastIdx), null, this.group));
    }
    super.insertIfStatement(ifStmt, thenBlock);
  }
}
org.eclipse.jdt.internal.ui.text.correction.proposalsExtractToNullCheckedLocalProposal$RearrangeStrategy$ModifyBlock

Javadoc

Strategy implementation for modifying statement list of the parent block.

Most used methods

  • <init>
  • insertIfStatement

Popular in Java

  • Creating JSON documents from java classes using gson
  • setScale (BigDecimal)
  • getSystemService (Context)
  • orElseThrow (Optional)
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • Timer (java.util)
    A facility for threads to schedule tasks for future execution in a background thread. Tasks may be s
  • TimerTask (java.util)
    A task that can be scheduled for one-time or repeated execution by a Timer.
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
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