Skip to content

Commit c402592

Browse files
committed
Merge ReplacedWith into DeprecatedSince
1 parent 78e64e7 commit c402592

File tree

5 files changed

+16
-47
lines changed

5 files changed

+16
-47
lines changed

.github/CONTRIBUTING.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Please follow those templates or else your issue might get ignored and closed.
3333
We accept pull requests for fixing issues or adding new features, but you have to follow those rules.
3434

3535
### Javadocs
36-
Please add javadocs comments to **all public methods the developer has access to.**
36+
Please add javadocs comments to **all public methods the developer has access to and should use.**
3737
Javadocs help developers to see what methods they can/should use and what those do.
3838

3939
When adding Javadoc comments, follow this Styling choises.
@@ -56,13 +56,15 @@ Do the same for new paragraphs, but keep an empty line in between the text (And
5656
Please always use the full path to a class/method when using `{@link}`
5757

5858
Bad example: `{@link BotBlockAPI}`
59-
Good example: `{@link BotBlockAPI BotBlockAPI}`
59+
Good example: `{@link org.botblock.javabotblockapi.BotBlockAPI BotBlockAPI}`
6060

6161
We want to point out the alternative text used in the Good example, to display "BotBlockAPI" instead of the path.
6262
When linking to a method that is in a separate class, set the alternative text to `Class.method(option(s))`.
6363

64-
There is an exception for linking, when you link to a method in the same (inner) class.
65-
In those cases just link to it by using `{@link #methodName}`
64+
If the method you link to is within the same class, use `{@link #methodName() methodName()}`.
65+
66+
Linking to external Javadoc may be set with the same linking-rules.
67+
New external javadocs may need to be added to the `javadoc` task in the `build.gradle`.
6668

6769
**Note**:
6870
Use the `<a href="">` option to link external pages. When doing so also remember to include `target="_blank"`.
@@ -112,6 +114,7 @@ Here is an example of the different parts being used:
112114
* @deprecated Use {@link #getFooBar() getFooBar()} instead.
113115
*/
114116
@Deprecated
117+
@DeprecatedSince({"v1.0.1", "#getFooBar"}) // If you deprecate a method, add this one too.
115118
public String getFooBar(String foo) throws IllegalArgumentException{
116119
if(foo.isEmpty())
117120
throw new IllegalArgumentException("foo may not be empty");
@@ -134,4 +137,4 @@ public String getFooBar(){
134137
## [Code of Conduct]
135138
We want to give everyone a chance to contribute to the project.
136139
So please keep your comments and messages nice. Every message that is considered rasist, insulting or similar will be removed.
137-
If you continue to send those messages you'll be permanently removed from this repository.
140+
If you continue to send those messages will we permanently remove you from this repository.

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ plugins{
77
id 'com.github.johnrengelman.shadow' version '5.2.0'
88
}
99

10-
def ver = new Version(major: 4, minor: 0, revision: 4)
10+
def ver = new Version(major: 4, minor: 1, revision: 0)
1111

1212
group = "org.botblock"
1313
version = "$ver"

src/main/java/org/botblock/javabotblockapi/Site.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
package org.botblock.javabotblockapi;
1919

2020
import org.botblock.javabotblockapi.annotations.DeprecatedSince;
21-
import org.botblock.javabotblockapi.annotations.ReplacedWith;
2221

2322
/**
2423
* Enum class containing all sites currently supported by BotBlock.org.
@@ -67,8 +66,7 @@ public enum Site {
6766
* <br>This option still works, but is no longer supported, nor recommended!
6867
*/
6968
@Deprecated
70-
@ReplacedWith("TOP_GG")
71-
@DeprecatedSince("v3.0.1")
69+
@DeprecatedSince({"v3.0.1", "#TOP_GG"})
7270
DISCORDBOTS_ORG("discordbots.org"),
7371

7472
/**

src/main/java/org/botblock/javabotblockapi/annotations/DeprecatedSince.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,17 @@
2222

2323
/**
2424
* Annotation used to indicate since when a method or field is deprecated.
25-
* <br>This is paired with the {@link java.lang.Deprecated @Deprecated} and the
26-
* {@link org.botblock.javabotblockapi.annotations.ReplacedWith @ReplacedWith} annotation when possible.
25+
* <br>This is paired with the {@link java.lang.Deprecated @Deprecated} annotation.
26+
*
27+
* <p>This annotation may have multiple arguments, where first one is the version of deprecation and second one being
28+
* a optional replacement method.
29+
* <br><b>Example</b>: {@code @DeprecatedSince({"v1.0.5", "#replacementMethod"})}
2730
*
2831
* @since v3.2.0
2932
*/
3033
@Documented
3134
@Retention(RetentionPolicy.RUNTIME)
3235
@Target({ElementType.METHOD, ElementType.FIELD})
3336
public @interface DeprecatedSince{
34-
String value();
37+
String[] value();
3538
}

src/main/java/org/botblock/javabotblockapi/annotations/ReplacedWith.java

Lines changed: 0 additions & 35 deletions
This file was deleted.

0 commit comments

Comments
 (0)