Git Product home page Git Product logo

Comments (6)

metlos avatar metlos commented on June 8, 2024 1

Same seems to happen, if I remove a function and try to add that to the api-changes.

...
"code": "java.class.removed",
...

but it still reports
...
"code": "java.method.removed",
...

You specified a different difference code in your config. I hope this should work when you correct that.

As for a deprecated method showing up as removed - from top of my head I don't know why that should happen by default. Are you sure you don't configure Revapi to for example filter out the deprecated methods from the analysis?

from revapi.

metlos avatar metlos commented on June 8, 2024

I think the example you gave got truncated somehow... Would you be able to reformulate your question a little?

from revapi.

boaks avatar boaks commented on June 8, 2024

Hm, I thought more on general information about the "deprecation process" consider by revapi.

My concrete issue is:
I would like to indicate deprecation e.g. for this function HealthStatisticLogger

         * @param executor executor to schedule active calls of {@link #dump()}.
	 * @throws NullPointerException if executor is {@code null}
	 * @since 3.0 (added unit)
	 * @deprecated use {@link CounterStatisticManager#CounterStatisticManager(String)}
	 *             instead and call {@link #dump()} externally.
	 */
	protected CounterStatisticManager(String tag, long interval, TimeUnit unit, ScheduledExecutorService executor) {
		if (executor == null) {

What I tried is to add the annotation as well:

         * @param executor executor to schedule active calls of {@link #dump()}.
	 * @throws NullPointerException if executor is {@code null}
	 * @since 3.0 (added unit)
	 * @deprecated use {@link CounterStatisticManager#CounterStatisticManager(String)}
	 *             instead and call {@link #dump()} externally.
	 */
	@Deprecated
	protected CounterStatisticManager(String tag, long interval, TimeUnit unit, ScheduledExecutorService executor) {
		if (executor == null) {

that results in the error:

[INFO] Comparing [org.eclipse.californium:element-connector:jar:3.0.0] against [org.eclipse.californium:element-connector:jar:3.1.0-SNAPSHOT] (including their transitive dependencies).
[INFO] API problems found.
[INFO] If you're using the semver-ignore extension, update your module's version to one compatible with the current changes (e.g. mvn package revapi:update-versions). If you want to explicitly ignore these changes or provide justifications for them, add the json snippets to your Revapi configuration for the "revapi.differences" extension.

{
"ignore": true,
"code": "java.method.removed",
"old": "method void org.eclipse.californium.elements.util.CounterStatisticManager::(java.lang.String, long, java.util.concurrent.TimeUnit, java.util.concurrent.ScheduledExecutorService)",
"justification": "ADD YOUR EXPLANATION FOR THE NECESSITY OF THIS CHANGE"
/* "package": "org.eclipse.californium.elements.util",
"classQualifiedName": "org.eclipse.californium.elements.util.CounterStatisticManager",
"classSimpleName": "CounterStatisticManager",
"methodName": "",
"elementKind": "constructor",
"oldArchive": "org.eclipse.californium:element-connector:jar:3.0.0",
"oldArchiveRole": "primary",
"breaksVersioningRules": "true",
*/

},

I tried to ignore deprecation by pom.xml - revapi, that doesn't help.

So, what is the intended way of revapi to signal deprecation?

from revapi.

boaks avatar boaks commented on June 8, 2024

Same seems to happen, if I remove a function and try to add that to the api-changes.

	"3.1.0": [
		{
			"extension": "revapi.differences",
			"configuration": {
				"ignore": true,
				"differences": [
					{
						"ignore": true,
						"code": "java.class.removed",
						"old": "method org.eclipse.californium.core.network.stack.Layer org.eclipse.californium.core.network.stack.CoapUdpStack::createBlockwiseLayer(java.lang.String, org.eclipse.californium.elements.config.Configuration)",
						"justification": "Not part of the public API"
					},

but it still reports

{
"ignore": true,
"code": "java.method.removed",
"old": "method org.eclipse.californium.core.network.stack.Layer org.eclipse.californium.core.network.stack.CoapUdpStack::createBlockwiseLayer(java.lang.String, org.eclipse.californium.elements.config.Configuration)",
"justification": "ADD YOUR EXPLANATION FOR THE NECESSITY OF THIS CHANGE"

from revapi.

boaks avatar boaks commented on June 8, 2024

You're right.

from revapi.

boaks avatar boaks commented on June 8, 2024

Are you sure you don't configure Revapi to for example filter out the deprecated methods from the analysis?

Yes, this was the case. I removed

						<revapi.filter>
							<elements>
								<exclude>
									<item>
										<matcher>java</matcher>
										<match>@java.lang.Deprecated ^*;</match>
									</item>
								</exclude>
							</elements>
						</revapi.filter>

and it works now. Thanks a lot!

from revapi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.