Polishing and removal of "this." for method invocations

This commit is contained in:
Sam Brannen
2025-06-09 14:10:30 +02:00
parent 99890b6147
commit 18d6a55e3e
37 changed files with 127 additions and 135 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2022 the original author or authors.
* Copyright 2002-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -69,7 +69,7 @@ public class HttpMediaTypeNotAcceptableException extends HttpMediaTypeException
return HttpHeaders.EMPTY;
}
HttpHeaders headers = new HttpHeaders();
headers.setAccept(this.getSupportedMediaTypes());
headers.setAccept(getSupportedMediaTypes());
return headers;
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2024 the original author or authors.
* Copyright 2002-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -237,7 +237,7 @@ public class InMemoryWebSessionStore implements WebSessionStore {
InMemoryWebSessionStore.this.sessions.remove(currentId);
String newId = String.valueOf(idGenerator.generateId());
this.id.set(newId);
InMemoryWebSessionStore.this.sessions.put(this.getId(), this);
InMemoryWebSessionStore.this.sessions.put(this.id.get(), this);
return Mono.empty();
})
.subscribeOn(Schedulers.boundedElastic())
@@ -266,11 +266,11 @@ public class InMemoryWebSessionStore implements WebSessionStore {
if (isStarted()) {
// Save
InMemoryWebSessionStore.this.sessions.put(this.getId(), this);
InMemoryWebSessionStore.this.sessions.put(this.id.get(), this);
// Unless it was invalidated
if (this.state.get().equals(State.EXPIRED)) {
InMemoryWebSessionStore.this.sessions.remove(this.getId());
InMemoryWebSessionStore.this.sessions.remove(this.id.get());
return Mono.error(new IllegalStateException("Session was invalidated"));
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2024 the original author or authors.
* Copyright 2002-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -2040,7 +2040,7 @@ final class WhatWgUrlParser {
if (obj == this) {
return true;
}
if (obj == null || obj.getClass() != this.getClass()) {
if (obj == null || getClass() != obj.getClass()) {
return false;
}
UrlRecord that = (UrlRecord) obj;
@@ -2322,7 +2322,7 @@ final class WhatWgUrlParser {
@Override
public boolean equals(Object obj) {
return obj == this || obj != null && obj.getClass() == this.getClass();
return obj == this || obj != null && getClass() == obj.getClass();
}
@Override

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2024 the original author or authors.
* Copyright 2002-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -435,7 +435,7 @@ public class PathPattern implements Comparable<PathPattern> {
if (this.endsWithSeparatorWildcard) {
String prefix = this.patternString.length() > 2 ?
this.patternString.substring(0, this.patternString.length() - 2) :
String.valueOf(this.getSeparator());
String.valueOf(getSeparator());
return this.parser.parse(concat(prefix, otherPattern.patternString));
}
@@ -465,8 +465,8 @@ public class PathPattern implements Comparable<PathPattern> {
"Cannot combine patterns: " + this.patternString + " and " + otherPattern);
}
String firstPath = this.patternString.substring(0, this.patternString.lastIndexOf(this.getSeparator()));
String secondPath = otherPattern.patternString.substring(0, otherPattern.patternString.lastIndexOf(this.getSeparator()));
String firstPath = this.patternString.substring(0, this.patternString.lastIndexOf(getSeparator()));
String secondPath = otherPattern.patternString.substring(0, otherPattern.patternString.lastIndexOf(getSeparator()));
if (!this.parser.parse(firstPath).matches(PathContainer.parsePath(secondPath))) {
throw new IllegalArgumentException(
"Cannot combine patterns: " + this.patternString + " and " + otherPattern);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2024 the original author or authors.
* Copyright 2002-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -615,7 +615,7 @@ class Jackson2ObjectMapperBuilderTests {
@Override
public String getModuleName() {
return this.getClass().getSimpleName();
return getClass().getSimpleName();
}
@Override

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2024 the original author or authors.
* Copyright 2002-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -358,7 +358,7 @@ public class Jackson2ObjectMapperFactoryBeanTests {
@Override
public String getModuleName() {
return this.getClass().getSimpleName();
return getClass().getSimpleName();
}
@Override

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2024 the original author or authors.
* Copyright 2002-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -47,7 +47,7 @@ class CompositeUriComponentsContributorTests {
resolvers.add(new RequestParamMethodArgumentResolver(true));
CompositeUriComponentsContributor contributor = new CompositeUriComponentsContributor(resolvers);
Method method = ClassUtils.getMethod(this.getClass(), "handleRequest", String.class, String.class, String.class);
Method method = ClassUtils.getMethod(getClass(), "handleRequest", String.class, String.class, String.class);
assertThat(contributor.supportsParameter(new MethodParameter(method, 0))).isTrue();
assertThat(contributor.supportsParameter(new MethodParameter(method, 1))).isTrue();
assertThat(contributor.supportsParameter(new MethodParameter(method, 2))).isFalse();