Skip to content

Commit

Permalink
spotless
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan-Thurner committed Aug 17, 2024
1 parent a5f7bbc commit ca3de0c
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,13 @@ private static void analyzeEndpoints() {
* It then iterates through the rest call map to find URIs that start with the same prefix as the endpoint URI
* (excluding the wildcard) and have the same HTTP method. If such URIs are found, they are added to the list of matching REST calls.
*
* @param endpoint The endpoint information to check for wildcard matches.
* @param endpoint The endpoint information to check for wildcard matches.
* @param matchingRestCalls The list of matching REST calls to be populated.
* @param endpointURI The URI of the endpoint being checked.
* @param restCallMap The map of rest call URIs to their corresponding information.
* @param endpointURI The URI of the endpoint being checked.
* @param restCallMap The map of rest call URIs to their corresponding information.
*/
private static void CheckForWildcardEndpoints(EndpointInformation endpoint, List<RestCallInformation> matchingRestCalls, String endpointURI, Map<String, List<RestCallInformation>> restCallMap) {
private static void CheckForWildcardEndpoints(EndpointInformation endpoint, List<RestCallInformation> matchingRestCalls, String endpointURI,
Map<String, List<RestCallInformation>> restCallMap) {
if (matchingRestCalls.isEmpty() && endpointURI.endsWith("*")) {
for (String uri : restCallMap.keySet()) {
if (uri.startsWith(endpoint.buildComparableEndpointUri().substring(0, endpoint.buildComparableEndpointUri().length() - 1))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,8 @@

import com.fasterxml.jackson.annotation.JsonIgnore;

public record EndpointInformation(
String requestMapping,
String endpoint,
String httpMethodAnnotation,
String URI,
String className,
int line,
List<String> otherAnnotations
) {
public record EndpointInformation(String requestMapping, String endpoint, String httpMethodAnnotation, String URI, String className, int line, List<String> otherAnnotations) {

public String buildCompleteEndpointURI() {
StringBuilder result = new StringBuilder();
if (this.requestMapping != null && !this.requestMapping.isEmpty()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,13 @@ private static void analyzeRestCalls() {
* It then iterates through the endpoint map to find URIs that start with the same prefix as the REST call URI
* (excluding the wildcard) and have the same HTTP method. If such URIs are found, they are added to the list of matching endpoints.
*
* @param restCall The REST call information to check for wildcard matches.
* @param restCall The REST call information to check for wildcard matches.
* @param matchingEndpoints The list of matching endpoints to be populated.
* @param restCallURI The URI of the REST call being checked.
* @param endpointMap The map of endpoint URIs to their corresponding information.
* @param restCallURI The URI of the REST call being checked.
* @param endpointMap The map of endpoint URIs to their corresponding information.
*/
private static void checkForWildcardMatches(RestCallInformation restCall, List<EndpointInformation> matchingEndpoints, String restCallURI, Map<String, List<EndpointInformation>> endpointMap) {
private static void checkForWildcardMatches(RestCallInformation restCall, List<EndpointInformation> matchingEndpoints, String restCallURI,
Map<String, List<EndpointInformation>> endpointMap) {
if (matchingEndpoints.isEmpty() && restCallURI.endsWith("*")) {
for (String uri : endpointMap.keySet()) {
if (uri.startsWith(restCallURI.substring(0, restCallURI.length() - 1))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
package de.tum.cit.endpointanalysis;

public record RestCallInformation(
String method,
String url,
int line,
String fileName
) {
public record RestCallInformation(String method, String url, int line, String fileName) {

public String buildCompleteRestCallURI() {
return this.url.replace("`", "");
}
Expand Down

0 comments on commit ca3de0c

Please sign in to comment.