congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
StatementTree.lastToken
Code IndexAdd Tabnine to your IDE (free)

How to use
lastToken
method
in
org.sonar.plugins.java.api.tree.StatementTree

Best Java code snippets using org.sonar.plugins.java.api.tree.StatementTree.lastToken (Showing top 2 results out of 315)

origin: SonarSource/sonar-java

@Override
public void visitNode(Tree tree) {
 IfStatementTree ifStatementTree = (IfStatementTree) tree;
 SyntaxToken lastToken = ifStatementTree.thenStatement().lastToken();
 if (ifStatementTree.elseKeyword() == null) {
  if(previousToken != null && isOnSameLineAsPreviousIf(ifStatementTree)) {
   reportIssue(ifStatementTree.ifKeyword(), "Move this \"if\" to a new line or add the missing \"else\".",
    Collections.singletonList(new JavaFileScannerContext.Location("", previousToken)), null);
  }
  previousToken = lastToken;
 }
}
origin: org.sonarsource.java/java-checks

@Override
public void visitNode(Tree tree) {
 IfStatementTree ifStatementTree = (IfStatementTree) tree;
 SyntaxToken lastToken = ifStatementTree.thenStatement().lastToken();
 if (ifStatementTree.elseKeyword() == null) {
  if(previousToken != null && isOnSameLineAsPreviousIf(ifStatementTree)) {
   reportIssue(ifStatementTree.ifKeyword(), "Move this \"if\" to a new line or add the missing \"else\".",
    Collections.singletonList(new JavaFileScannerContext.Location("", previousToken)), null);
  }
  previousToken = lastToken;
 }
}
org.sonar.plugins.java.api.treeStatementTreelastToken

Popular methods of StatementTree

  • is
  • accept
  • firstToken

Popular in Java

  • Reading from database using SQL prepared statement
  • getContentResolver (Context)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • setScale (BigDecimal)
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • String (java.lang)
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now