Skip to content

Commit

Permalink
Mark QUERY impl as @experimental
Browse files Browse the repository at this point in the history
  • Loading branch information
desiderantes committed Oct 19, 2024
1 parent 731e683 commit af10afd
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
* The field or method to which this annotation is applied is marked as experimental.
*/
@Documented
@Target({ElementType.METHOD, ElementType.TYPE})
@Target({ElementType.METHOD, ElementType.TYPE, ElementType.FIELD})
@Retention(RetentionPolicy.CLASS)
public @interface Experimental {
String reason() default "";
}
2 changes: 2 additions & 0 deletions httpcore5/src/main/java/org/apache/hc/core5/http/Method.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

import java.util.Locale;

import org.apache.hc.core5.annotation.Experimental;
import org.apache.hc.core5.util.Args;

/**
Expand Down Expand Up @@ -103,6 +104,7 @@ public enum Method {
*
* @since 5.4
*/
@Experimental(reason = "QUERY method is still in DRAFT status")

This comment has been minimized.

Copy link
@garydgregory

garydgregory Oct 19, 2024

Member

You should make such that the field name isn't required, less clutter imo. Also tell us the RFC.

QUERY(true, true);

private final boolean safe;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import java.util.Arrays;
import java.util.List;

import org.apache.hc.core5.annotation.Experimental;
import org.apache.hc.core5.http.ClassicHttpRequest;
import org.apache.hc.core5.http.ContentType;
import org.apache.hc.core5.http.Header;
Expand Down Expand Up @@ -127,6 +128,7 @@ public static ClassicRequestBuilder head(final String uri) {
*
* @since 5.4
*/
@Experimental
public static ClassicRequestBuilder query() {
return new ClassicRequestBuilder(Method.QUERY);
}
Expand All @@ -139,6 +141,7 @@ public static ClassicRequestBuilder query() {
*
* @since 5.4
*/
@Experimental
public static ClassicRequestBuilder query(final URI uri) {
return new ClassicRequestBuilder(Method.QUERY, uri);
}
Expand All @@ -151,6 +154,7 @@ public static ClassicRequestBuilder query(final URI uri) {
*
* @since 5.4
*/
@Experimental
public static ClassicRequestBuilder query(final String uri) {
return new ClassicRequestBuilder(Method.QUERY, uri);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import java.util.Arrays;
import java.util.List;

import org.apache.hc.core5.annotation.Experimental;
import org.apache.hc.core5.http.ContentType;
import org.apache.hc.core5.http.Header;
import org.apache.hc.core5.http.HttpHost;
Expand Down Expand Up @@ -127,6 +128,7 @@ public static AsyncRequestBuilder head(final String uri) {
*
* @since 5.4
*/
@Experimental
public static AsyncRequestBuilder query() {
return new AsyncRequestBuilder(Method.QUERY);
}
Expand All @@ -139,6 +141,7 @@ public static AsyncRequestBuilder query() {
*
* @since 5.4
*/
@Experimental
public static AsyncRequestBuilder query(final URI uri) {
return new AsyncRequestBuilder(Method.QUERY, uri);
}
Expand All @@ -151,6 +154,7 @@ public static AsyncRequestBuilder query(final URI uri) {
*
* @since 5.4
*/
@Experimental
public static AsyncRequestBuilder query(final String uri) {
return new AsyncRequestBuilder(Method.QUERY, uri);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import java.util.Arrays;
import java.util.List;

import org.apache.hc.core5.annotation.Experimental;
import org.apache.hc.core5.http.Header;
import org.apache.hc.core5.http.HttpHost;
import org.apache.hc.core5.http.HttpRequest;
Expand Down Expand Up @@ -111,6 +112,7 @@ public static BasicRequestBuilder head(final String uri) {
*
* @since 5.4
*/
@Experimental
public static BasicRequestBuilder query() {
return new BasicRequestBuilder(Method.QUERY);
}
Expand All @@ -123,6 +125,7 @@ public static BasicRequestBuilder query() {
*
* @since 5.4
*/
@Experimental
public static BasicRequestBuilder query(final URI uri) {
return new BasicRequestBuilder(Method.QUERY, uri);
}
Expand All @@ -135,6 +138,7 @@ public static BasicRequestBuilder query(final URI uri) {
*
* @since 5.4
*/
@Experimental
public static BasicRequestBuilder query(final String uri) {
return new BasicRequestBuilder(Method.QUERY, uri);
}
Expand Down

0 comments on commit af10afd

Please sign in to comment.