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:
parent
aa4f014a3a
commit
1b0fe3a41e
9 changed files with 19 additions and 78 deletions
|
@ -55,9 +55,9 @@ public class CommentChecker extends AbstractIndexAstChecker {
|
|||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private IProblemLocation getProblemLocation(IASTFileLocation astLocation, int pos) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -2,7 +2,7 @@ Manifest-Version: 1.0
|
|||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: %Bundle-Name
|
||||
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-Vendor: %Bundle-Vendor
|
||||
Require-Bundle: org.eclipse.core.runtime,
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
<version>3.3.0-SNAPSHOT</version>
|
||||
<version>4.0.0-SNAPSHOT</version>
|
||||
<artifactId>org.eclipse.cdt.codan.core</artifactId>
|
||||
<packaging>eclipse-plugin</packaging>
|
||||
</project>
|
||||
|
|
|
@ -35,12 +35,6 @@ public abstract class AbstractChecker implements IChecker {
|
|||
public AbstractChecker() {
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@Override
|
||||
public boolean enabledInContext(IResource resource) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reports a simple problem for given file and line
|
||||
*
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2009, 2012 Alena Laskavaia
|
||||
* Copyright (c) 2009, 2012 Alena Laskavaia
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -15,13 +15,8 @@ import org.eclipse.core.resources.IResource;
|
|||
|
||||
/**
|
||||
* Abstract Implementation of IProblemLocation
|
||||
*
|
||||
*
|
||||
* 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 {
|
||||
protected IResource file;
|
||||
|
@ -58,10 +53,11 @@ public abstract class AbstractProblemLocation implements IProblemLocation {
|
|||
this.posEnd = endChar;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.cdt.codan.core.model.IProblemLocation#getData()
|
||||
/**
|
||||
* Gets the extra data for the location. It is checker specific,
|
||||
* for example can be problem backtrace.
|
||||
*
|
||||
* @return data object or null if non set
|
||||
*/
|
||||
@Override
|
||||
public Object getData() {
|
||||
|
@ -69,8 +65,8 @@ public abstract class AbstractProblemLocation implements IProblemLocation {
|
|||
}
|
||||
|
||||
/**
|
||||
* Sets extra data for the problem location
|
||||
*
|
||||
* Sets extra data for the problem location.
|
||||
*
|
||||
* @param data
|
||||
*/
|
||||
public void setData(Object data) {
|
||||
|
@ -79,7 +75,7 @@ public abstract class AbstractProblemLocation implements IProblemLocation {
|
|||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
*
|
||||
* @see org.eclipse.cdt.codan.core.model.IProblemLocation#getFile()
|
||||
*/
|
||||
@Override
|
||||
|
@ -112,7 +108,7 @@ public abstract class AbstractProblemLocation implements IProblemLocation {
|
|||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
*
|
||||
* @see org.eclipse.cdt.codan.core.model.IProblemLocation#getStartPos()
|
||||
*/
|
||||
@Override
|
||||
|
@ -122,7 +118,7 @@ public abstract class AbstractProblemLocation implements IProblemLocation {
|
|||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
*
|
||||
* @see org.eclipse.cdt.codan.core.model.IProblemLocation#getEndingChar()
|
||||
*/
|
||||
@Override
|
||||
|
|
|
@ -65,15 +65,6 @@ public interface IChecker {
|
|||
*/
|
||||
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
|
||||
* "as you type". Checker must be really light weight to run in this mode.
|
||||
|
|
|
@ -16,11 +16,6 @@ import org.eclipse.core.resources.IFile;
|
|||
* Factory interface that allows to create problem locations.
|
||||
*
|
||||
* 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 {
|
||||
/**
|
||||
|
@ -34,23 +29,6 @@ public interface IProblemLocationFactory {
|
|||
*/
|
||||
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
|
||||
*
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2009, 2011 Alena Laskavaia
|
||||
* Copyright (c) 2009, 2011 Alena Laskavaia
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -16,7 +16,7 @@ import org.eclipse.core.resources.IResource;
|
|||
|
||||
/**
|
||||
* Codan Problem Location, so far same as abstract class
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class CodanProblemLocation extends AbstractProblemLocation {
|
||||
/**
|
||||
|
@ -30,18 +30,6 @@ public class CodanProblemLocation extends AbstractProblemLocation {
|
|||
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 startChar - start chart, absolute file offset starts with 0
|
||||
|
|
|
@ -24,12 +24,6 @@ public class ProblemLocationFactory implements IProblemLocationFactory {
|
|||
return new CodanProblemLocation(file, line);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public IProblemLocation createProblemLocation(IFile file, int startChar, int endChar) {
|
||||
return new CodanProblemLocation(file, startChar, endChar);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IProblemLocation createProblemLocation(IFile file, int startChar, int endChar, int line) {
|
||||
return new CodanProblemLocation(file, startChar, endChar, line);
|
||||
|
|
Loading…
Add table
Reference in a new issue