Browse Source

SONAR-5931 Cleanup symbol reference API

tags/5.1-RC1
Julien HENRY 9 years ago
parent
commit
38357bb249
17 changed files with 46 additions and 185 deletions
  1. 14
    5
      plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/lang/SymbolReferencesSensor.java
  2. 10
    5
      plugins/sonar-xoo-plugin/src/test/java/org/sonar/xoo/lang/SymbolReferencesSensorTest.java
  3. 1
    1
      sonar-batch/src/main/java/org/sonar/batch/index/SourceDataFactory.java
  4. 1
    1
      sonar-batch/src/main/java/org/sonar/batch/mediumtest/TaskResult.java
  5. 0
    9
      sonar-batch/src/main/java/org/sonar/batch/sensor/DefaultSensorContext.java
  6. 2
    3
      sonar-batch/src/main/java/org/sonar/batch/source/DefaultSymbol.java
  7. 1
    2
      sonar-batch/src/main/java/org/sonar/batch/source/DefaultSymbolTable.java
  8. 3
    7
      sonar-batch/src/main/java/org/sonar/batch/symbol/DefaultSymbolTableBuilder.java
  9. 1
    1
      sonar-batch/src/main/java/org/sonar/batch/symbol/SymbolData.java
  10. 5
    4
      sonar-batch/src/test/java/org/sonar/batch/index/SourceDataFactoryTest.java
  11. 6
    7
      sonar-batch/src/test/java/org/sonar/batch/symbol/DefaultSymbolTableBuilderTest.java
  12. 1
    6
      sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/SensorContext.java
  13. 0
    36
      sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/symbol/Symbol.java
  14. 0
    53
      sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/symbol/SymbolTableBuilder.java
  15. 0
    21
      sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/symbol/internal/package-info.java
  16. 0
    21
      sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/symbol/package-info.java
  17. 1
    3
      sonar-plugin-api/src/main/java/org/sonar/api/source/Symbol.java

+ 14
- 5
plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/lang/SymbolReferencesSensor.java View File

@@ -26,8 +26,9 @@ import org.sonar.api.batch.fs.InputFile;
import org.sonar.api.batch.sensor.Sensor;
import org.sonar.api.batch.sensor.SensorContext;
import org.sonar.api.batch.sensor.SensorDescriptor;
import org.sonar.api.batch.sensor.symbol.Symbol;
import org.sonar.api.batch.sensor.symbol.SymbolTableBuilder;
import org.sonar.api.component.ResourcePerspectives;
import org.sonar.api.source.Symbol;
import org.sonar.api.source.Symbolizable;
import org.sonar.api.utils.log.Logger;
import org.sonar.api.utils.log.Loggers;
import org.sonar.xoo.Xoo;
@@ -42,6 +43,12 @@ import java.util.List;
*/
public class SymbolReferencesSensor implements Sensor {

private ResourcePerspectives perspectives;

public SymbolReferencesSensor(ResourcePerspectives perspectives) {
this.perspectives = perspectives;
}

private static final Logger LOG = Loggers.get(SymbolReferencesSensor.class);

private static final String SYMBOL_EXTENSION = ".symbol";
@@ -54,7 +61,9 @@ public class SymbolReferencesSensor implements Sensor {
try {
List<String> lines = FileUtils.readLines(symbolFile, context.fileSystem().encoding().name());
int lineNumber = 0;
SymbolTableBuilder symbolTableBuilder = context.symbolTableBuilder(inputFile);
Symbolizable symbolizable = perspectives.as(Symbolizable.class, inputFile);

Symbolizable.SymbolTableBuilder symbolTableBuilder = symbolizable.newSymbolTableBuilder();
for (String line : lines) {
lineNumber++;
if (StringUtils.isBlank(line) || line.startsWith("#")) {
@@ -62,14 +71,14 @@ public class SymbolReferencesSensor implements Sensor {
}
processLine(symbolFile, lineNumber, symbolTableBuilder, line);
}
symbolTableBuilder.done();
symbolizable.setSymbolTable(symbolTableBuilder.build());
} catch (IOException e) {
throw new IllegalStateException(e);
}
}
}

private void processLine(File symbolFile, int lineNumber, SymbolTableBuilder symbolTableBuilder, String line) {
private void processLine(File symbolFile, int lineNumber, Symbolizable.SymbolTableBuilder symbolTableBuilder, String line) {
try {
Iterator<String> split = Splitter.on(",").split(line).iterator();
int startOffset = Integer.parseInt(split.next());

+ 10
- 5
plugins/sonar-xoo-plugin/src/test/java/org/sonar/xoo/lang/SymbolReferencesSensorTest.java View File

@@ -28,8 +28,9 @@ import org.sonar.api.batch.fs.internal.DefaultFileSystem;
import org.sonar.api.batch.fs.internal.DefaultInputFile;
import org.sonar.api.batch.sensor.SensorContext;
import org.sonar.api.batch.sensor.internal.DefaultSensorDescriptor;
import org.sonar.api.batch.sensor.symbol.Symbol;
import org.sonar.api.batch.sensor.symbol.SymbolTableBuilder;
import org.sonar.api.component.ResourcePerspectives;
import org.sonar.api.source.Symbol;
import org.sonar.api.source.Symbolizable;

import java.io.File;
import java.io.IOException;
@@ -47,11 +48,13 @@ public class SymbolReferencesSensorTest {
@Rule
public TemporaryFolder temp = new TemporaryFolder();
private File baseDir;
private ResourcePerspectives perspectives;

@Before
public void prepare() throws IOException {
baseDir = temp.newFolder();
sensor = new SymbolReferencesSensor();
perspectives = mock(ResourcePerspectives.class);
sensor = new SymbolReferencesSensor(perspectives);
fileSystem = new DefaultFileSystem(baseDir.toPath());
when(context.fileSystem()).thenReturn(fileSystem);
}
@@ -74,8 +77,10 @@ public class SymbolReferencesSensorTest {
FileUtils.write(symbol, "1,4,7\n12,15,23\n\n#comment");
DefaultInputFile inputFile = new DefaultInputFile("foo", "src/foo.xoo").setLanguage("xoo");
fileSystem.add(inputFile);
SymbolTableBuilder symbolTableBuilder = mock(SymbolTableBuilder.class);
when(context.symbolTableBuilder(inputFile)).thenReturn(symbolTableBuilder);
Symbolizable symbolizable = mock(Symbolizable.class);
when(perspectives.as(Symbolizable.class, inputFile)).thenReturn(symbolizable);
Symbolizable.SymbolTableBuilder symbolTableBuilder = mock(Symbolizable.SymbolTableBuilder.class);
when(symbolizable.newSymbolTableBuilder()).thenReturn(symbolTableBuilder);

Symbol symbol1 = mock(Symbol.class);
when(symbolTableBuilder.newSymbol(1, 4)).thenReturn(symbol1);

+ 1
- 1
sonar-batch/src/main/java/org/sonar/batch/index/SourceDataFactory.java View File

@@ -27,9 +27,9 @@ import org.sonar.api.batch.fs.internal.DefaultInputFile;
import org.sonar.api.batch.sensor.duplication.Duplication;
import org.sonar.api.batch.sensor.duplication.internal.DefaultDuplication;
import org.sonar.api.batch.sensor.highlighting.internal.SyntaxHighlightingRule;
import org.sonar.api.batch.sensor.symbol.Symbol;
import org.sonar.api.measures.CoreMetrics;
import org.sonar.api.measures.Measure;
import org.sonar.api.source.Symbol;
import org.sonar.api.utils.DateUtils;
import org.sonar.api.utils.KeyValueFormat;
import org.sonar.batch.duplication.DuplicationCache;

+ 1
- 1
sonar-batch/src/main/java/org/sonar/batch/mediumtest/TaskResult.java View File

@@ -31,10 +31,10 @@ import org.sonar.api.batch.sensor.duplication.Duplication;
import org.sonar.api.batch.sensor.highlighting.TypeOfText;
import org.sonar.api.batch.sensor.highlighting.internal.SyntaxHighlightingRule;
import org.sonar.api.batch.sensor.measure.internal.DefaultMeasure;
import org.sonar.api.batch.sensor.symbol.Symbol;
import org.sonar.api.issue.Issue;
import org.sonar.api.issue.internal.DefaultIssue;
import org.sonar.api.measures.Measure;
import org.sonar.api.source.Symbol;
import org.sonar.batch.dependency.DependencyCache;
import org.sonar.batch.duplication.DuplicationCache;
import org.sonar.batch.highlighting.SyntaxHighlightingData;

+ 0
- 9
sonar-batch/src/main/java/org/sonar/batch/sensor/DefaultSensorContext.java View File

@@ -21,8 +21,6 @@ package org.sonar.batch.sensor;

import org.sonar.api.batch.AnalysisMode;
import org.sonar.api.batch.fs.FileSystem;
import org.sonar.api.batch.fs.InputFile;
import org.sonar.api.batch.fs.internal.DefaultInputFile;
import org.sonar.api.batch.rule.ActiveRules;
import org.sonar.api.batch.sensor.SensorContext;
import org.sonar.api.batch.sensor.dependency.NewDependency;
@@ -36,10 +34,8 @@ import org.sonar.api.batch.sensor.issue.NewIssue;
import org.sonar.api.batch.sensor.issue.internal.DefaultIssue;
import org.sonar.api.batch.sensor.measure.NewMeasure;
import org.sonar.api.batch.sensor.measure.internal.DefaultMeasure;
import org.sonar.api.batch.sensor.symbol.SymbolTableBuilder;
import org.sonar.api.config.Settings;
import org.sonar.batch.index.ComponentDataCache;
import org.sonar.batch.symbol.DefaultSymbolTableBuilder;

import java.io.Serializable;

@@ -97,11 +93,6 @@ public class DefaultSensorContext implements SensorContext {
return new DefaultHighlighting(sensorStorage);
}

@Override
public SymbolTableBuilder symbolTableBuilder(InputFile inputFile) {
return new DefaultSymbolTableBuilder(((DefaultInputFile) inputFile).key(), componentDataCache);
}

@Override
public NewDuplication newDuplication() {
return new DefaultDuplication(sensorStorage);

sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/symbol/internal/DefaultSymbol.java → sonar-batch/src/main/java/org/sonar/batch/source/DefaultSymbol.java View File

@@ -18,14 +18,13 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/

package org.sonar.api.batch.sensor.symbol.internal;
package org.sonar.batch.source;

import com.google.common.base.Objects;
import org.sonar.api.batch.sensor.symbol.Symbol;

import java.io.Serializable;

public class DefaultSymbol implements Symbol, org.sonar.api.source.Symbol, Serializable {
public class DefaultSymbol implements org.sonar.api.source.Symbol, Serializable {

private final int declarationStartOffset;
private final int declarationEndOffset;

+ 1
- 2
sonar-batch/src/main/java/org/sonar/batch/source/DefaultSymbolTable.java View File

@@ -20,7 +20,6 @@

package org.sonar.batch.source;

import org.sonar.api.batch.sensor.symbol.internal.DefaultSymbol;
import org.sonar.api.source.Symbol;
import org.sonar.api.source.Symbolizable;

@@ -46,7 +45,7 @@ public class DefaultSymbolTable implements Symbolizable.SymbolTable {
@Override
public List<Symbol> symbols() {
List<Symbol> result = new ArrayList<Symbol>();
for (org.sonar.api.batch.sensor.symbol.Symbol symbol : referencesBySymbol.keySet()) {
for (Symbol symbol : referencesBySymbol.keySet()) {
result.add((Symbol) symbol);
}
return result;

+ 3
- 7
sonar-batch/src/main/java/org/sonar/batch/symbol/DefaultSymbolTableBuilder.java View File

@@ -20,10 +20,9 @@

package org.sonar.batch.symbol;

import org.sonar.api.batch.sensor.symbol.Symbol;
import org.sonar.api.batch.sensor.symbol.SymbolTableBuilder;
import org.sonar.api.batch.sensor.symbol.internal.DefaultSymbol;
import org.sonar.api.source.Symbol;
import org.sonar.batch.index.ComponentDataCache;
import org.sonar.batch.source.DefaultSymbol;
import org.sonar.core.source.SnapshotDataTypes;

import java.io.Serializable;
@@ -33,7 +32,7 @@ import java.util.Map;
import java.util.Set;
import java.util.TreeSet;

public class DefaultSymbolTableBuilder implements SymbolTableBuilder {
public class DefaultSymbolTableBuilder {

private final String componentKey;
private final ComponentDataCache cache;
@@ -44,14 +43,12 @@ public class DefaultSymbolTableBuilder implements SymbolTableBuilder {
this.cache = cache;
}

@Override
public Symbol newSymbol(int fromOffset, int toOffset) {
org.sonar.api.source.Symbol symbol = new DefaultSymbol(fromOffset, toOffset);
referencesBySymbol.put(symbol, new TreeSet<Integer>());
return symbol;
}

@Override
public void newReference(Symbol symbol, int fromOffset) {
if (!referencesBySymbol.containsKey(symbol)) {
throw new UnsupportedOperationException("Cannot add reference to a symbol in another file");
@@ -66,7 +63,6 @@ public class DefaultSymbolTableBuilder implements SymbolTableBuilder {
return new SymbolData(referencesBySymbol);
}

@Override
public void done() {
cache.setData(componentKey, SnapshotDataTypes.SYMBOL_HIGHLIGHTING, build());
}

+ 1
- 1
sonar-batch/src/main/java/org/sonar/batch/symbol/SymbolData.java View File

@@ -20,7 +20,7 @@

package org.sonar.batch.symbol;

import org.sonar.api.batch.sensor.symbol.Symbol;
import org.sonar.api.source.Symbol;
import org.sonar.batch.index.Data;

import java.util.Collection;

+ 5
- 4
sonar-batch/src/test/java/org/sonar/batch/index/SourceDataFactoryTest.java View File

@@ -34,6 +34,7 @@ import org.sonar.api.batch.sensor.highlighting.TypeOfText;
import org.sonar.api.measures.CoreMetrics;
import org.sonar.api.measures.Measure;
import org.sonar.api.measures.Metric;
import org.sonar.api.source.Symbol;
import org.sonar.batch.duplication.DuplicationCache;
import org.sonar.batch.highlighting.SyntaxHighlightingData;
import org.sonar.batch.highlighting.SyntaxHighlightingDataBuilder;
@@ -324,10 +325,10 @@ public class SourceDataFactoryTest {
@Test
public void applySymbolReferences() throws Exception {
DefaultSymbolTableBuilder symbolBuilder = new DefaultSymbolTableBuilder(inputFile.key(), null);
org.sonar.api.batch.sensor.symbol.Symbol s1 = symbolBuilder.newSymbol(1, 2);
Symbol s1 = symbolBuilder.newSymbol(1, 2);
symbolBuilder.newReference(s1, 4);
symbolBuilder.newReference(s1, 11);
org.sonar.api.batch.sensor.symbol.Symbol s2 = symbolBuilder.newSymbol(4, 6);
Symbol s2 = symbolBuilder.newSymbol(4, 6);
symbolBuilder.newReference(s2, 0);
symbolBuilder.newReference(s2, 7);
when(componentDataCache.getData(inputFile.key(), SnapshotDataTypes.SYMBOL_HIGHLIGHTING)).thenReturn(symbolBuilder.build());
@@ -344,10 +345,10 @@ public class SourceDataFactoryTest {
@Test
public void applySymbolReferences_declaration_order_is_not_important() throws Exception {
DefaultSymbolTableBuilder symbolBuilder = new DefaultSymbolTableBuilder(inputFile.key(), null);
org.sonar.api.batch.sensor.symbol.Symbol s2 = symbolBuilder.newSymbol(4, 6);
Symbol s2 = symbolBuilder.newSymbol(4, 6);
symbolBuilder.newReference(s2, 7);
symbolBuilder.newReference(s2, 0);
org.sonar.api.batch.sensor.symbol.Symbol s1 = symbolBuilder.newSymbol(1, 2);
Symbol s1 = symbolBuilder.newSymbol(1, 2);
symbolBuilder.newReference(s1, 11);
symbolBuilder.newReference(s1, 4);
when(componentDataCache.getData(inputFile.key(), SnapshotDataTypes.SYMBOL_HIGHLIGHTING)).thenReturn(symbolBuilder.build());

+ 6
- 7
sonar-batch/src/test/java/org/sonar/batch/symbol/DefaultSymbolTableBuilderTest.java View File

@@ -24,8 +24,7 @@ import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.mockito.ArgumentCaptor;
import org.sonar.api.batch.sensor.symbol.Symbol;
import org.sonar.api.batch.sensor.symbol.SymbolTableBuilder;
import org.sonar.api.source.Symbol;
import org.sonar.batch.index.ComponentDataCache;
import org.sonar.core.source.SnapshotDataTypes;

@@ -46,7 +45,7 @@ public class DefaultSymbolTableBuilderTest {
@Test
public void should_write_symbol_and_references() throws Exception {
ComponentDataCache componentDataCache = mock(ComponentDataCache.class);
SymbolTableBuilder symbolTableBuilder = new DefaultSymbolTableBuilder("foo", componentDataCache);
DefaultSymbolTableBuilder symbolTableBuilder = new DefaultSymbolTableBuilder("foo", componentDataCache);
Symbol firstSymbol = symbolTableBuilder.newSymbol(10, 20);
symbolTableBuilder.newReference(firstSymbol, 32);
Symbol secondSymbol = symbolTableBuilder.newSymbol(84, 92);
@@ -72,7 +71,7 @@ public class DefaultSymbolTableBuilderTest {
public void should_serialize_unused_symbol() throws Exception {

ComponentDataCache componentDataCache = mock(ComponentDataCache.class);
SymbolTableBuilder symbolTableBuilder = new DefaultSymbolTableBuilder("foo", componentDataCache);
DefaultSymbolTableBuilder symbolTableBuilder = new DefaultSymbolTableBuilder("foo", componentDataCache);
symbolTableBuilder.newSymbol(10, 20);
symbolTableBuilder.done();

@@ -87,7 +86,7 @@ public class DefaultSymbolTableBuilderTest {
throwable.expect(UnsupportedOperationException.class);

ComponentDataCache componentDataCache = mock(ComponentDataCache.class);
SymbolTableBuilder symbolTableBuilder = new DefaultSymbolTableBuilder("foo", componentDataCache);
DefaultSymbolTableBuilder symbolTableBuilder = new DefaultSymbolTableBuilder("foo", componentDataCache);
Symbol symbol = symbolTableBuilder.newSymbol(10, 20);
symbolTableBuilder.newReference(symbol, 15);
}
@@ -97,10 +96,10 @@ public class DefaultSymbolTableBuilderTest {
throwable.expect(UnsupportedOperationException.class);

ComponentDataCache componentDataCache = mock(ComponentDataCache.class);
SymbolTableBuilder symbolTableBuilder = new DefaultSymbolTableBuilder("foo", componentDataCache);
DefaultSymbolTableBuilder symbolTableBuilder = new DefaultSymbolTableBuilder("foo", componentDataCache);
Symbol symbol = symbolTableBuilder.newSymbol(10, 20);

SymbolTableBuilder symbolTableBuilder2 = new DefaultSymbolTableBuilder("foo2", componentDataCache);
DefaultSymbolTableBuilder symbolTableBuilder2 = new DefaultSymbolTableBuilder("foo2", componentDataCache);
Symbol symbol2 = symbolTableBuilder2.newSymbol(30, 40);

symbolTableBuilder.newReference(symbol2, 15);

+ 1
- 6
sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/SensorContext.java View File

@@ -22,7 +22,6 @@ package org.sonar.api.batch.sensor;
import org.sonar.api.batch.AnalysisMode;
import org.sonar.api.batch.CpdMapping;
import org.sonar.api.batch.fs.FileSystem;
import org.sonar.api.batch.fs.InputFile;
import org.sonar.api.batch.rule.ActiveRules;
import org.sonar.api.batch.sensor.dependency.NewDependency;
import org.sonar.api.batch.sensor.duplication.NewDuplication;
@@ -31,7 +30,6 @@ import org.sonar.api.batch.sensor.issue.Issue;
import org.sonar.api.batch.sensor.issue.NewIssue;
import org.sonar.api.batch.sensor.measure.Measure;
import org.sonar.api.batch.sensor.measure.NewMeasure;
import org.sonar.api.batch.sensor.symbol.SymbolTableBuilder;
import org.sonar.api.config.Settings;

import java.io.Serializable;
@@ -85,10 +83,7 @@ public interface SensorContext {

// ------------ SYMBOL REFERENCES ------------

/**
* Builder to define symbol references in a file.
*/
SymbolTableBuilder symbolTableBuilder(InputFile inputFile);
// TODO

// ------------ DUPLICATIONS ------------


+ 0
- 36
sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/symbol/Symbol.java View File

@@ -1,36 +0,0 @@
/*
* SonarQube, open source software quality management tool.
* Copyright (C) 2008-2014 SonarSource
* mailto:contact AT sonarsource DOT com
*
* SonarQube is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* SonarQube is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/

package org.sonar.api.batch.sensor.symbol;

import com.google.common.annotations.Beta;

/**
* Represent a symbol in a source file. Experimental, do not use
* @since 4.5
*/
@Beta
public interface Symbol {

int getDeclarationStartOffset();

int getDeclarationEndOffset();

}

+ 0
- 53
sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/symbol/SymbolTableBuilder.java View File

@@ -1,53 +0,0 @@
/*
* SonarQube, open source software quality management tool.
* Copyright (C) 2008-2014 SonarSource
* mailto:contact AT sonarsource DOT com
*
* SonarQube is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* SonarQube is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.sonar.api.batch.sensor.symbol;

import com.google.common.annotations.Beta;

/**
* Experimental, do not use.
* <p/>
* Use this builder to create symbol references. For now only references
* in the same file are supported.
* @since 4.5
*/
@Beta
public interface SymbolTableBuilder {

/**
* Create a new symbol.
* @param fromOffset Starting offset in a file for the symbol declaration. File starts at offset '0'.
* @param toOffset Ending offset of symbol declaration.
* @return a new Symbol that can be used later in {@link #newReference(Symbol, int)}
*/
Symbol newSymbol(int fromOffset, int toOffset);

/**
* Records that a {@link Symbol} is referenced at another location in the same file.
* @param symbol Symbol previously created with {@link #newSymbol(int, int)}
* @param fromOffset Starting offset of the place symbol is referenced. No need for end offset here since we assume it is same length.
*/
void newReference(Symbol symbol, int fromOffset);

/**
* Call this method only once when your are done with defining symbols of the file.
*/
void done();
}

+ 0
- 21
sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/symbol/internal/package-info.java View File

@@ -1,21 +0,0 @@
/*
* SonarQube, open source software quality management tool.
* Copyright (C) 2008-2014 SonarSource
* mailto:contact AT sonarsource DOT com
*
* SonarQube is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* SonarQube is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
@javax.annotation.ParametersAreNonnullByDefault
package org.sonar.api.batch.sensor.symbol.internal;

+ 0
- 21
sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/symbol/package-info.java View File

@@ -1,21 +0,0 @@
/*
* SonarQube, open source software quality management tool.
* Copyright (C) 2008-2014 SonarSource
* mailto:contact AT sonarsource DOT com
*
* SonarQube is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* SonarQube is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
@javax.annotation.ParametersAreNonnullByDefault
package org.sonar.api.batch.sensor.symbol;

+ 1
- 3
sonar-plugin-api/src/main/java/org/sonar/api/source/Symbol.java View File

@@ -20,12 +20,10 @@

package org.sonar.api.source;

public interface Symbol extends org.sonar.api.batch.sensor.symbol.Symbol {
public interface Symbol {

@Override
int getDeclarationStartOffset();

@Override
int getDeclarationEndOffset();

/**

Loading…
Cancel
Save