1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-22 06:02:11 +02:00

Removed deprecated method in codan.core, bumped version to 4.0

Change-Id: I1290d5388b30bd6b48663652d50f4718164b979d
This commit is contained in:
Alena Laskavaia 2016-01-07 20:34:16 -05:00
parent aa4f014a3a
commit 1b0fe3a41e
9 changed files with 19 additions and 78 deletions

View file

@ -55,9 +55,9 @@ public class CommentChecker extends AbstractIndexAstChecker {
} }
} }
@SuppressWarnings("deprecation")
private IProblemLocation getProblemLocation(IASTFileLocation astLocation, int pos) { private IProblemLocation getProblemLocation(IASTFileLocation astLocation, int pos) {
IProblemLocationFactory locFactory = getRuntime().getProblemLocationFactory(); IProblemLocationFactory locFactory = getRuntime().getProblemLocationFactory();
return locFactory.createProblemLocation(getFile(), astLocation.getNodeOffset() + pos, astLocation.getNodeOffset() + pos + 2); int newPosition = astLocation.getNodeOffset() + pos;
return locFactory.createProblemLocation(getFile(), newPosition, newPosition + 2, -1);
} }
} }

View file

@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2 Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name Bundle-Name: %Bundle-Name
Bundle-SymbolicName: org.eclipse.cdt.codan.core;singleton:=true Bundle-SymbolicName: org.eclipse.cdt.codan.core;singleton:=true
Bundle-Version: 3.3.0.qualifier Bundle-Version: 4.0.0.qualifier
Bundle-Activator: org.eclipse.cdt.codan.core.CodanCorePlugin Bundle-Activator: org.eclipse.cdt.codan.core.CodanCorePlugin
Bundle-Vendor: %Bundle-Vendor Bundle-Vendor: %Bundle-Vendor
Require-Bundle: org.eclipse.core.runtime, Require-Bundle: org.eclipse.core.runtime,

View file

@ -11,7 +11,7 @@
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>
<version>3.3.0-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>
<artifactId>org.eclipse.cdt.codan.core</artifactId> <artifactId>org.eclipse.cdt.codan.core</artifactId>
<packaging>eclipse-plugin</packaging> <packaging>eclipse-plugin</packaging>
</project> </project>

View file

@ -35,12 +35,6 @@ public abstract class AbstractChecker implements IChecker {
public AbstractChecker() { public AbstractChecker() {
} }
@Deprecated
@Override
public boolean enabledInContext(IResource resource) {
return false;
}
/** /**
* Reports a simple problem for given file and line * Reports a simple problem for given file and line
* *

View file

@ -17,11 +17,6 @@ import org.eclipse.core.resources.IResource;
* Abstract Implementation of IProblemLocation * Abstract Implementation of IProblemLocation
* *
* Clients may extend this class. * Clients may extend this class.
* <p>
* <strong>EXPERIMENTAL</strong>. This class or interface has been added as
* part of a work in progress. There is no guarantee that this API will
* work or that it will remain the same.
* </p>
*/ */
public abstract class AbstractProblemLocation implements IProblemLocation { public abstract class AbstractProblemLocation implements IProblemLocation {
protected IResource file; protected IResource file;
@ -58,10 +53,11 @@ public abstract class AbstractProblemLocation implements IProblemLocation {
this.posEnd = endChar; this.posEnd = endChar;
} }
/* /**
* (non-Javadoc) * Gets the extra data for the location. It is checker specific,
* for example can be problem backtrace.
* *
* @see org.eclipse.cdt.codan.core.model.IProblemLocation#getData() * @return data object or null if non set
*/ */
@Override @Override
public Object getData() { public Object getData() {
@ -69,7 +65,7 @@ public abstract class AbstractProblemLocation implements IProblemLocation {
} }
/** /**
* Sets extra data for the problem location * Sets extra data for the problem location.
* *
* @param data * @param data
*/ */

View file

@ -65,15 +65,6 @@ public interface IChecker {
*/ */
IProblemReporter getProblemReporter(); IProblemReporter getProblemReporter();
/**
* @param resource the resource to run on.
* @return true if checker should be run on this resource.
* @deprecated Ignored since 2.0. Replaced by
* {@link org.eclipse.cdt.codan.internal.core.CheckersRegistry#isCheckerEnabled(IChecker, IResource, CheckerLaunchMode)}
*/
@Deprecated
boolean enabledInContext(IResource resource);
/** /**
* Checker must implement this method to determine if it can run in editor * Checker must implement this method to determine if it can run in editor
* "as you type". Checker must be really light weight to run in this mode. * "as you type". Checker must be really light weight to run in this mode.

View file

@ -16,11 +16,6 @@ import org.eclipse.core.resources.IFile;
* Factory interface that allows to create problem locations. * Factory interface that allows to create problem locations.
* *
* Clients may implement and extend this interface. * Clients may implement and extend this interface.
* <p>
* <strong>EXPERIMENTAL</strong>. This class or interface has been added as part
* of a work in progress. There is no guarantee that this API will work or that
* it will remain the same.
* </p>
*/ */
public interface IProblemLocationFactory { public interface IProblemLocationFactory {
/** /**
@ -34,23 +29,6 @@ public interface IProblemLocationFactory {
*/ */
public IProblemLocation createProblemLocation(IFile file, int line); public IProblemLocation createProblemLocation(IFile file, int line);
/**
* Create and return instance of IProblemLocation
*
* @param file
* - file where problem is found
* @param startChar
* - start char of the problem in the file, is zero-relative
* @param endChar
* - end char of the problem in the file, is zero-relative and
* exclusive.
* @return instance of IProblemLocation
*
* @deprecated Use {@link #createProblemLocation(IFile, int, int, int)} instead.
*/
@Deprecated
public IProblemLocation createProblemLocation(IFile file, int startChar, int endChar);
/** /**
* Create and return instance of IProblemLocation * Create and return instance of IProblemLocation
* *

View file

@ -30,18 +30,6 @@ public class CodanProblemLocation extends AbstractProblemLocation {
this.line = line; this.line = line;
} }
/**
* @deprecated use {@link #CodanProblemLocation(IResource, int, int, int)}
* otherwise no line number will be shown
* @param file
* @param startChar
* @param endChar
*/
@Deprecated
public CodanProblemLocation(IFile file, int startChar, int endChar) {
super(file, startChar, endChar);
}
/** /**
* @param file - resource * @param file - resource
* @param startChar - start chart, absolute file offset starts with 0 * @param startChar - start chart, absolute file offset starts with 0

View file

@ -24,12 +24,6 @@ public class ProblemLocationFactory implements IProblemLocationFactory {
return new CodanProblemLocation(file, line); return new CodanProblemLocation(file, line);
} }
@Override
@Deprecated
public IProblemLocation createProblemLocation(IFile file, int startChar, int endChar) {
return new CodanProblemLocation(file, startChar, endChar);
}
@Override @Override
public IProblemLocation createProblemLocation(IFile file, int startChar, int endChar, int line) { public IProblemLocation createProblemLocation(IFile file, int startChar, int endChar, int line) {
return new CodanProblemLocation(file, startChar, endChar, line); return new CodanProblemLocation(file, startChar, endChar, line);