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

How to use
org.sonar.duplications.statement.Statement
constructor

Best Java code snippets using org.sonar.duplications.statement.Statement.<init> (Showing top 6 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
SimpleDateFormat s =
  • Codota IconString pattern;new SimpleDateFormat(pattern)
  • Codota IconString template;Locale locale;new SimpleDateFormat(template, locale)
  • Codota Iconnew SimpleDateFormat()
  • Smart code suggestions by Codota
}
origin: SonarSource/sonarqube

public boolean consume(TokenQueue tokenQueue, List<Statement> output) {
 List<Token> matchedTokenList = new ArrayList<>();
 for (TokenMatcher tokenMatcher : tokenMatchers) {
  if (!tokenMatcher.matchToken(tokenQueue, matchedTokenList)) {
   tokenQueue.pushForward(matchedTokenList);
   return false;
  }
 }
 // all matchers were successful, so now build the statement
 // matchedTokenList.size() check is for case with ForgiveLastTokenMatcher
 if (!blackHole && !matchedTokenList.isEmpty()) {
  output.add(new Statement(matchedTokenList));
 }
 return true;
}
origin: SonarSource/sonarqube

/**
 * Creates list of statements from Strings, each statement on a new line starting from 0.
 */
protected static List<Statement> createStatementsFromStrings(String... values) {
 List<Statement> result = new ArrayList<>();
 for (int i = 0; i < values.length; i++) {
  result.add(new Statement(i, i, values[i]));
 }
 return result;
}
origin: SonarSource/sonarqube

@Test(expected = IllegalArgumentException.class)
public void shouldNotAcceptEmpty() {
 new Statement(new ArrayList<Token>());
}
origin: SonarSource/sonarqube

@Test(expected = IllegalArgumentException.class)
public void shouldNotAcceptNull() {
 new Statement(null);
}
origin: SonarSource/sonarqube

@Test
public void shouldCreateStatementFromListOfTokens() {
 Statement statement = new Statement(Arrays.asList(new Token("a", 1, 1), new Token("b", 2, 1)));
 assertThat(statement.getValue(), is("ab"));
 assertThat(statement.getStartLine(), is(1));
 assertThat(statement.getEndLine(), is(2));
}
origin: org.codehaus.sonar/sonar-duplications

public boolean consume(TokenQueue tokenQueue, List<Statement> output) {
 List<Token> matchedTokenList = new ArrayList<Token>();
 for (TokenMatcher tokenMatcher : tokenMatchers) {
  if (!tokenMatcher.matchToken(tokenQueue, matchedTokenList)) {
   tokenQueue.pushForward(matchedTokenList);
   return false;
  }
 }
 // all matchers were successful, so now build the statement
 // matchedTokenList.size() check is for case with ForgiveLastTokenMatcher
 if (!blackHole && !matchedTokenList.isEmpty()) {
  output.add(new Statement(matchedTokenList));
 }
 return true;
}
org.sonar.duplications.statementStatement<init>

Popular methods of Statement

  • getEndLine
  • getStartLine
  • getValue

Popular in Java

  • Start an intent from android
  • notifyDataSetChanged (ArrayAdapter)
  • putExtra (Intent)
  • setRequestProperty (URLConnection)
    Sets the general request property. If a property with the key already exists, overwrite its value wi
  • Kernel (java.awt.image)
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate(i
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
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