You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@skywalking.apache.org by johnniang <jo...@foxmail.com> on 2020/02/05 08:49:41 UTC
Code rule discussion
Dear Skywalking Developers,
Thank you for wu.sheng invitation for discussing about Deprecated API,
I've thrown my suggestion below the PR:
<https://github.com/apache/skywalking/pull/4318>.
Here's a copy:
We can't avoid using deprecated method, but it's our duty to tell future
users that method is deprecated.
Just like recent rectifications of invoking rewrited method in
deprecated method body, but keep|Deprecated|annotation on the deprecated
method.
e.g.
@Deprecated // Keep this annotation
public T deprecatedMethod() {
return newMethod();
}
public T rewritedMethod() {
// Latest codes here...
}
In a short, Using|Deprecated|api is my suggestion.
BR.
johnniang
Re: Code rule discussion
Posted by Sheng Wu <wu...@gmail.com>.
From my understanding, `rewrite` is done for a long time.
We are discussing whether deleting the Deprecated method(6 months ago).
My suggestion is, don't delete them, but we should make sure inside the
main repo(open source), we don't use them. Otherwise, no API could be
deleted eventually.
Sheng Wu 吴晟
Twitter, wusheng1108
johnniang <jo...@foxmail.com> 于2020年2月5日周三 下午4:50写道:
> Dear Skywalking Developers,
>
> Thank you for wu.sheng invitation for discussing about Deprecated API,
> I've thrown my suggestion below the PR:
> <https://github.com/apache/skywalking/pull/4318>.
>
>
> Here's a copy:
>
>
> We can't avoid using deprecated method, but it's our duty to tell future
> users that method is deprecated.
>
> Just like recent rectifications of invoking rewrited method in
> deprecated method body, but keep|Deprecated|annotation on the deprecated
> method.
>
> e.g.
>
> @Deprecated // Keep this annotation
> public T deprecatedMethod() {
> return newMethod();
> }
>
> public T rewritedMethod() {
> // Latest codes here...
> }
>
> In a short, Using|Deprecated|api is my suggestion.
>
>
> BR.
>
> johnniang
>
>
Re:Code rule discussion
Posted by kezhenxu94 <ke...@apache.org>.
I guess you have misunderstood our meanings, by saying "add a new check rule, don't use Deprecated API.",
we didn't mean to remove all APIs that are annotated with @Deprecated annotation, instead, our meaning is to
add a rule to check codes that use the APIs that are annotated with @Deprecated, and guide developers/users
to use the recommended new API, because the deprecated will be remove eventually.
--
GitHub @kezhenxu94
Apache SkyWalking, Apache Dubbo
At 2020-02-05 16:49:41, "johnniang" <jo...@foxmail.com> wrote:
>Dear Skywalking Developers,
>
>Thank you for wu.sheng invitation for discussing about Deprecated API,
>I've thrown my suggestion below the PR:
><https://github.com/apache/skywalking/pull/4318>.
>
>
>Here's a copy:
>
>
>We can't avoid using deprecated method, but it's our duty to tell future
>users that method is deprecated.
>
>Just like recent rectifications of invoking rewrited method in
>deprecated method body, but keep|Deprecated|annotation on the deprecated
>method.
>
>e.g.
>
>@Deprecated // Keep this annotation
>public T deprecatedMethod() {
> return newMethod();
>}
>
>public T rewritedMethod() {
> // Latest codes here...
>}
>
>In a short, Using|Deprecated|api is my suggestion.
>
>
>BR.
>
>johnniang
>