Skip to content

Commit

Permalink
Remove "throws IOException" declaration for methods that do not throw…
Browse files Browse the repository at this point in the history
… such exceptions.

As IOException needs to be declared or catched, the fact that no internally invoked methods declares it means that it can't be thrown.

Fixes: SE-13158
  • Loading branch information
fhaScireum committed Oct 31, 2023
1 parent b500b32 commit 3c3262c
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/main/java/sirius/kernel/xml/Outcall.java
Original file line number Diff line number Diff line change
Expand Up @@ -267,9 +267,8 @@ public Outcall setIfModifiedSince(LocalDateTime ifModifiedSince) {
* @param user the username to use
* @param password the password to use
* @return the outcall itself for fluent method calls
* @throws IOException in case of any IO error
*/
public Outcall setAuthParams(String user, String password) throws IOException {
public Outcall setAuthParams(String user, String password) {
if (Strings.isEmpty(user)) {
return this;
}
Expand Down Expand Up @@ -351,9 +350,8 @@ public Outcall withConfiguredTimeout(@Nonnull String configKey) {
* @param params the data to POST
* @param charset the charset to use when encoding the post data
* @return the outcall itself for fluent method calls
* @throws IOException in case of any IO error
*/
public Outcall postData(Context params, Charset charset) throws IOException {
public Outcall postData(Context params, Charset charset) {
this.charset = charset;

StringBuilder parameterString = new StringBuilder();
Expand Down Expand Up @@ -389,9 +387,8 @@ public Outcall markAsPostRequest(HttpRequest.BodyPublisher bodyPublisher) {
* Note that {@link #postFromOutput()} can not be invoked on this call, as we will send no body at all.
*
* @return the outcall itself for fluent method calls
* @throws IOException if the method cannot be reset or if the requested method isn't valid for HTTP.
*/
public Outcall markAsHeadRequest() throws IOException {
public Outcall markAsHeadRequest() {
modifyRequest().method(REQUEST_METHOD_HEAD, HttpRequest.BodyPublishers.noBody());
return this;
}
Expand Down

0 comments on commit 3c3262c

Please sign in to comment.