Skip to content

Commit

Permalink
Apply palantir java formatting
Browse files Browse the repository at this point in the history
run `make format` at the root directory.
  • Loading branch information
groldan committed Nov 29, 2024
1 parent 75f594e commit fdc2dcc
Show file tree
Hide file tree
Showing 581 changed files with 4,637 additions and 8,089 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ public static void main(String[] args) {
SpringApplication.run(GeoWebCacheApplication.class, args);
} catch (RuntimeException e) {
try {
LoggerFactory.getLogger(GeoWebCacheApplication.class)
.error("Application run failed", e);
LoggerFactory.getLogger(GeoWebCacheApplication.class).error("Application run failed", e);
} finally {
System.exit(-1);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@
*/
package org.geoserver.cloud.gwc.app;

import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;
import org.geoserver.catalog.Catalog;
import org.geoserver.cloud.gwc.config.core.WebMapServiceMinimalConfiguration;
import org.geoserver.gwc.layer.GeoServerTileLayer;
Expand All @@ -22,16 +30,6 @@
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping;
import org.springframework.web.servlet.resource.ResourceUrlProvider;

import java.io.IOException;

import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;

@Configuration
public class GeoWebCacheApplicationConfiguration extends RestConfiguration {

Expand All @@ -44,8 +42,7 @@ public class GeoWebCacheApplicationConfiguration extends RestConfiguration {
*/
@Bean
@ConditionalOnMissingBean
LegendSample legendSample(
@Qualifier("rawCatalog") Catalog catalog, GeoServerResourceLoader loader) {
LegendSample legendSample(@Qualifier("rawCatalog") Catalog catalog, GeoServerResourceLoader loader) {
return new LegendSampleImpl(catalog, loader);
}

Expand All @@ -64,14 +61,12 @@ public void configureContentNegotiation(ContentNegotiationConfigurer configurer)
@Bean
@Override
public RequestMappingHandlerMapping requestMappingHandlerMapping(
@Qualifier("mvcContentNegotiationManager")
ContentNegotiationManager contentNegotiationManager,
@Qualifier("mvcContentNegotiationManager") ContentNegotiationManager contentNegotiationManager,
@Qualifier("mvcConversionService") FormattingConversionService conversionService,
@Qualifier("mvcResourceUrlProvider") ResourceUrlProvider resourceUrlProvider) {

RequestMappingHandlerMapping handlerMapping =
super.requestMappingHandlerMapping(
contentNegotiationManager, conversionService, resourceUrlProvider);
super.requestMappingHandlerMapping(contentNegotiationManager, conversionService, resourceUrlProvider);

handlerMapping.setUseSuffixPatternMatch(true);
handlerMapping.setUseRegisteredSuffixPatternMatch(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

import com.google.gson.JsonElement;
import com.google.gson.JsonParser;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
Expand All @@ -26,7 +25,8 @@
@ActiveProfiles("test")
class GeoWebCacheApplicationTest {

@Autowired private TestRestTemplate restTemplate;
@Autowired
private TestRestTemplate restTemplate;

@BeforeEach
void before() {
Expand All @@ -37,16 +37,14 @@ void before() {

@Test
void testRESTDefaultContentType() {
ResponseEntity<String> response =
testGetRequestContentType("/gwc/rest/layers", APPLICATION_JSON);
ResponseEntity<String> response = testGetRequestContentType("/gwc/rest/layers", APPLICATION_JSON);
JsonElement parsed = JsonParser.parseString(response.getBody());
assertThat(parsed.isJsonArray()).isTrue();
}

@Test
void testRESTPathExtensionContentNegotiation() {
ResponseEntity<String> response =
testGetRequestContentType("/gwc/rest/layers.json", APPLICATION_JSON);
ResponseEntity<String> response = testGetRequestContentType("/gwc/rest/layers.json", APPLICATION_JSON);
JsonElement parsed = JsonParser.parseString(response.getBody());
assertThat(parsed.isJsonArray()).isTrue();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ public static void main(String[] args) {
SpringApplication.run(RestConfigApplication.class, args);
} catch (RuntimeException e) {
try {
LoggerFactory.getLogger(RestConfigApplication.class)
.error("Application run failed", e);
LoggerFactory.getLogger(RestConfigApplication.class).error("Application run failed", e);
} finally {
System.exit(-1);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@
*/
package org.geoserver.cloud.restconfig;

import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;
import org.geoserver.rest.RequestInfo;
import org.geoserver.rest.RestConfiguration;
import org.geoserver.rest.catalog.AdminRequestCallback;
Expand All @@ -19,16 +27,6 @@
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping;
import org.springframework.web.servlet.resource.ResourceUrlProvider;

import java.io.IOException;

import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;

@Configuration
@ComponentScan(basePackageClasses = org.geoserver.rest.AbstractGeoServerController.class)
@SuppressWarnings("deprecation")
Expand All @@ -53,14 +51,12 @@ AdminRequestCallback adminRequestCallback() {
@Bean
@Override
public RequestMappingHandlerMapping requestMappingHandlerMapping(
@Qualifier("mvcContentNegotiationManager")
ContentNegotiationManager contentNegotiationManager,
@Qualifier("mvcContentNegotiationManager") ContentNegotiationManager contentNegotiationManager,
@Qualifier("mvcConversionService") FormattingConversionService conversionService,
@Qualifier("mvcResourceUrlProvider") ResourceUrlProvider resourceUrlProvider) {

RequestMappingHandlerMapping handlerMapping =
super.requestMappingHandlerMapping(
contentNegotiationManager, conversionService, resourceUrlProvider);
super.requestMappingHandlerMapping(contentNegotiationManager, conversionService, resourceUrlProvider);

handlerMapping.setUseSuffixPatternMatch(true);
handlerMapping.setUseRegisteredSuffixPatternMatch(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
@ActiveProfiles("test")
class RestConfigApplicationTest {

@Autowired private TestRestTemplate restTemplate;
@Autowired
private TestRestTemplate restTemplate;

@BeforeEach
void before() {
Expand All @@ -45,8 +46,7 @@ void testPathExtensionContentNegotiation() {
testPathExtensionContentType("/rest/styles/line.json", APPLICATION_JSON);
testPathExtensionContentType("/rest/styles/line.xml", APPLICATION_XML);
testPathExtensionContentType("/rest/styles/line.html", TEXT_HTML);
testPathExtensionContentType(
"/rest/styles/line.sld", MediaType.valueOf(SLDHandler.MIMETYPE_10));
testPathExtensionContentType("/rest/styles/line.sld", MediaType.valueOf(SLDHandler.MIMETYPE_10));

testPathExtensionContentType("/rest/workspaces.html", TEXT_HTML);
testPathExtensionContentType("/rest/workspaces.xml", APPLICATION_XML);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
*/
package org.geoserver.cloud.wcs;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import lombok.NonNull;
import lombok.RequiredArgsConstructor;

import org.geoserver.cloud.virtualservice.VirtualServiceVerifier;
import org.geoserver.ows.Dispatcher;
import org.springframework.stereotype.Controller;
Expand All @@ -15,9 +16,6 @@
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.servlet.view.RedirectView;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@RequiredArgsConstructor
public @Controller class WCSController {

Expand All @@ -34,20 +32,17 @@ public RedirectView redirectRootToGetCapabilities() {

/** Serve only WCS schemas from classpath (e.g. {@code /schemas/wcs/1.1.1/wcsAll.xsd}) */
@GetMapping(path = "/schemas/wcs/**")
public void getSchema(HttpServletRequest request, HttpServletResponse response)
throws Exception {
public void getSchema(HttpServletRequest request, HttpServletResponse response) throws Exception {
classPathPublisher.handleRequest(request, response);
}

@GetMapping(path = {"/wcs", "/ows"})
public void handleGet(HttpServletRequest request, HttpServletResponse response)
throws Exception {
public void handleGet(HttpServletRequest request, HttpServletResponse response) throws Exception {
dispatch(request, response);
}

@PostMapping(path = {"/wcs", "/ows"})
public void handlePost(HttpServletRequest request, HttpServletResponse response)
throws Exception {
public void handlePost(HttpServletRequest request, HttpServletResponse response) throws Exception {
dispatch(request, response);
}

Expand Down Expand Up @@ -97,8 +92,7 @@ public void handleVirtualServiceLayerPost(
dispatch(request, response);
}

private void dispatch(HttpServletRequest request, HttpServletResponse response)
throws Exception {
private void dispatch(HttpServletRequest request, HttpServletResponse response) throws Exception {
geoserverDispatcher.handleRequest(request, response);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@

import static org.assertj.core.api.Assertions.assertThat;

import java.util.stream.Stream;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.test.context.ActiveProfiles;

import java.util.stream.Stream;

@SpringBootTest
@ActiveProfiles("test")
class WcsApplicationTest {
Expand All @@ -27,18 +26,11 @@ void testWcsCoreBeans() {
expectBean("wcsURLMapping", org.geoserver.ows.OWSHandlerMapping.class);
expectBean("wcsLocalWorkspaceURLManger", org.geoserver.ows.LocalWorkspaceURLMangler.class);
expectBean("cqlKvpParser", org.geoserver.ows.kvp.CQLFilterKvpParser.class);
expectBean("coverageResponseDelegateFactory", org.geoserver.wcs.responses.CoverageResponseDelegateFinder.class);
expectBean(
"coverageResponseDelegateFactory",
org.geoserver.wcs.responses.CoverageResponseDelegateFinder.class);
expectBean(
"geotiffCoverageResponseDelegate",
org.geoserver.wcs.responses.GeoTIFFCoverageResponseDelegate.class);
expectBean(
"imgCoverageResponseDelegate",
org.geoserver.wcs.responses.IMGCoverageResponseDelegate.class);
expectBean(
"debugCoverageResponseDelegate",
org.geoserver.wcs.responses.DebugCoverageResponseDelegate.class);
"geotiffCoverageResponseDelegate", org.geoserver.wcs.responses.GeoTIFFCoverageResponseDelegate.class);
expectBean("imgCoverageResponseDelegate", org.geoserver.wcs.responses.IMGCoverageResponseDelegate.class);
expectBean("debugCoverageResponseDelegate", org.geoserver.wcs.responses.DebugCoverageResponseDelegate.class);
expectBean("coverageCleaner", org.geoserver.wcs.CoverageCleanerCallback.class);
expectBean("wcsResourceVoter", org.geoserver.wcs.WCSResourceVoter.class);
expectBean("legacyWcsLoader", org.geoserver.wcs.WCSLoader.class);
Expand All @@ -47,18 +39,11 @@ void testWcsCoreBeans() {
expectBean("wcsURLMapping", org.geoserver.ows.OWSHandlerMapping.class);
expectBean("wcsLocalWorkspaceURLManger", org.geoserver.ows.LocalWorkspaceURLMangler.class);
expectBean("cqlKvpParser", org.geoserver.ows.kvp.CQLFilterKvpParser.class);
expectBean("coverageResponseDelegateFactory", org.geoserver.wcs.responses.CoverageResponseDelegateFinder.class);
expectBean(
"coverageResponseDelegateFactory",
org.geoserver.wcs.responses.CoverageResponseDelegateFinder.class);
expectBean(
"geotiffCoverageResponseDelegate",
org.geoserver.wcs.responses.GeoTIFFCoverageResponseDelegate.class);
expectBean(
"imgCoverageResponseDelegate",
org.geoserver.wcs.responses.IMGCoverageResponseDelegate.class);
expectBean(
"debugCoverageResponseDelegate",
org.geoserver.wcs.responses.DebugCoverageResponseDelegate.class);
"geotiffCoverageResponseDelegate", org.geoserver.wcs.responses.GeoTIFFCoverageResponseDelegate.class);
expectBean("imgCoverageResponseDelegate", org.geoserver.wcs.responses.IMGCoverageResponseDelegate.class);
expectBean("debugCoverageResponseDelegate", org.geoserver.wcs.responses.DebugCoverageResponseDelegate.class);
expectBean("coverageCleaner", org.geoserver.wcs.CoverageCleanerCallback.class);
expectBean("wcsResourceVoter", org.geoserver.wcs.WCSResourceVoter.class);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@
*/
package org.geoserver.cloud.autoconfigure.web.cloudnative;

import javax.annotation.PostConstruct;
import lombok.extern.slf4j.Slf4j;

import org.geoserver.cloud.web.service.WebUiCloudServicesConfiguration;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

import javax.annotation.PostConstruct;

/**
* @since 1.0
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
*/
package org.geoserver.cloud.autoconfigure.web.core;

import lombok.extern.slf4j.Slf4j;

import javax.annotation.PostConstruct;
import lombok.extern.slf4j.Slf4j;

@Slf4j(topic = "org.geoserver.cloud.autoconfigure.web")
public abstract class AbstractWebUIAutoConfiguration {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
@ImportResource( //
reader = FilteringXmlBeanDefinitionReader.class, //
locations = { //
"jar:gs-web-core-.*!/applicationContext.xml#name="
+ WebCoreConfiguration.EXCLUDED_BEANS_PATTERN, //
"jar:gs-web-core-.*!/applicationContext.xml#name=" + WebCoreConfiguration.EXCLUDED_BEANS_PATTERN, //
"jar:gs-web-rest-.*!/applicationContext.xml" //
})
public class WebCoreConfiguration {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
package org.geoserver.cloud.autoconfigure.web.core;

import lombok.extern.slf4j.Slf4j;

import org.springframework.context.ApplicationContextInitializer;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.util.StringUtils;
Expand All @@ -15,8 +14,7 @@
* @since 1.8.2
*/
@Slf4j
public class WebUIContextInitializer
implements ApplicationContextInitializer<ConfigurableApplicationContext> {
public class WebUIContextInitializer implements ApplicationContextInitializer<ConfigurableApplicationContext> {

@Override
public void initialize(ConfigurableApplicationContext applicationContext) {
Expand All @@ -31,9 +29,7 @@ private void setHomePageSelectionMode() {

String systemProp = System.getProperty("GeoServerHomePage.selectionMode");
if (StringUtils.hasText(systemProp)) {
log.info(
"GeoServerHomePage.selectionMode set to '{}' through system property",
systemProp);
log.info("GeoServerHomePage.selectionMode set to '{}' through system property", systemProp);
} else {
String selectionMode = "TEXT";
log.info("GeoServerHomePage.selectionMode set to '{}' as default value", selectionMode);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import lombok.NonNull;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;

import org.geoserver.config.GeoServer;
import org.geoserver.config.GeoServerInfo;
import org.geoserver.config.GeoServerInfo.WebUIMode;
Expand All @@ -30,9 +29,7 @@ public void initialize(GeoServer geoServer) throws Exception {
geoServer.save(global);
}

Boolean hidefs =
environment.getProperty(
"geoserver.web-ui.file-browser.hide-file-system", Boolean.class);
Boolean hidefs = environment.getProperty("geoserver.web-ui.file-browser.hide-file-system", Boolean.class);
if (Boolean.TRUE.equals(hidefs)) {
log.info("Setting GEOSERVER_FILEBROWSER_HIDEFS=true System Property");
System.setProperty("GEOSERVER_FILEBROWSER_HIDEFS", "true");
Expand Down
Loading

0 comments on commit fdc2dcc

Please sign in to comment.