Skip to content

Commit

Permalink
Merge ReplacedWith into DeprecatedSince
Browse files Browse the repository at this point in the history
  • Loading branch information
Andre601 committed Jan 4, 2020
1 parent 78e64e7 commit c402592
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 47 deletions.
13 changes: 8 additions & 5 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Please follow those templates or else your issue might get ignored and closed.
We accept pull requests for fixing issues or adding new features, but you have to follow those rules.

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

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

Bad example: `{@link BotBlockAPI}`
Good example: `{@link BotBlockAPI BotBlockAPI}`
Good example: `{@link org.botblock.javabotblockapi.BotBlockAPI BotBlockAPI}`

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

There is an exception for linking, when you link to a method in the same (inner) class.
In those cases just link to it by using `{@link #methodName}`
If the method you link to is within the same class, use `{@link #methodName() methodName()}`.

Linking to external Javadoc may be set with the same linking-rules.
New external javadocs may need to be added to the `javadoc` task in the `build.gradle`.

**Note**:
Use the `<a href="">` option to link external pages. When doing so also remember to include `target="_blank"`.
Expand Down Expand Up @@ -112,6 +114,7 @@ Here is an example of the different parts being used:
* @deprecated Use {@link #getFooBar() getFooBar()} instead.
*/
@Deprecated
@DeprecatedSince({"v1.0.1", "#getFooBar"}) // If you deprecate a method, add this one too.
public String getFooBar(String foo) throws IllegalArgumentException{
if(foo.isEmpty())
throw new IllegalArgumentException("foo may not be empty");
Expand All @@ -134,4 +137,4 @@ public String getFooBar(){
## [Code of Conduct]
We want to give everyone a chance to contribute to the project.
So please keep your comments and messages nice. Every message that is considered rasist, insulting or similar will be removed.
If you continue to send those messages you'll be permanently removed from this repository.
If you continue to send those messages will we permanently remove you from this repository.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ plugins{
id 'com.github.johnrengelman.shadow' version '5.2.0'
}

def ver = new Version(major: 4, minor: 0, revision: 4)
def ver = new Version(major: 4, minor: 1, revision: 0)

group = "org.botblock"
version = "$ver"
Expand Down
4 changes: 1 addition & 3 deletions src/main/java/org/botblock/javabotblockapi/Site.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
package org.botblock.javabotblockapi;

import org.botblock.javabotblockapi.annotations.DeprecatedSince;
import org.botblock.javabotblockapi.annotations.ReplacedWith;

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

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,17 @@

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

This file was deleted.

0 comments on commit c402592

Please sign in to comment.