Skip to content

Commit

Permalink
Make community modules compile
Browse files Browse the repository at this point in the history
  • Loading branch information
aaime committed Jun 1, 2019
1 parent 6370045 commit ac0ed11
Show file tree
Hide file tree
Showing 22 changed files with 44 additions and 236 deletions.
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -96,11 +96,11 @@ public synchronized int synchronize() throws IOException {
checkProperties(); checkProperties();


File propFile = File propFile =
new File(getSecurityManager().getUserGroupRoot(), getUserGroupServiceName()); new File(getSecurityManager().userGroup().dir(), getUserGroupServiceName());
propFile = new File(propFile, AUTHKEYS_FILE); propFile = new File(propFile, AUTHKEYS_FILE);


File backupFile = File backupFile =
new File(getSecurityManager().getUserGroupRoot(), getUserGroupServiceName()); new File(getSecurityManager().userGroup().dir(), getUserGroupServiceName());
backupFile = new File(backupFile, AUTHKEYS_FILE + ".backup"); backupFile = new File(backupFile, AUTHKEYS_FILE + ".backup");


// check if the previous synchronize failed // check if the previous synchronize failed
Expand Down
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class ClusterPage extends GeoServerSecuredPage {


public ClusterPage() { public ClusterPage() {


final FeedbackPanel fp = getFeedbackPanel(); final FeedbackPanel fp = bottomFeedbackPanel;


// setup the JMSContainer exception handler // setup the JMSContainer exception handler
getJMSContainerExceptionHandler().setFeedbackPanel(fp); getJMSContainerExceptionHandler().setFeedbackPanel(fp);
Expand Down
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -320,7 +320,8 @@ protected boolean onSubmit(
}); });
} catch (IOException | IllegalStateException e) { } catch (IOException | IllegalStateException e) {
error(e.getMessage()); error(e.getMessage());
target.add(getFeedbackPanel()); target.add(bottomFeedbackPanel);
target.add(topFeedbackPanel);
} }
} }
}; };
Expand Down Expand Up @@ -625,7 +626,8 @@ protected boolean onSubmit(
"deleteFailed", getPage()) "deleteFailed", getPage())
.getString() .getString()
.replace("%", res.path())); .replace("%", res.path()));
target.add(getFeedbackPanel()); target.add(bottomFeedbackPanel);
target.add(topFeedbackPanel);
} }
} }
// if deleted node was on clipboard, remove it form the // if deleted node was on clipboard, remove it form the
Expand Down

This file was deleted.

Original file line number Original file line Diff line number Diff line change
Expand Up @@ -82,15 +82,6 @@ public Decimator(MathTransform screenToWorld, Rectangle paintArea) {
} }
} }


/**
* @throws TransformException
* @deprecated use the other constructor (with rectange) see javadox. This works fine, but it
* the results are often poor if you're also doing CRS xforms.
*/
public Decimator(MathTransform screenToWorld) {
this(screenToWorld, new Rectangle()); // do at (0,0)
}

public final void decimateTransformGeneralize(Geometry geometry, MathTransform transform) public final void decimateTransformGeneralize(Geometry geometry, MathTransform transform)
throws TransformException { throws TransformException {
if (geometry instanceof GeometryCollection) { if (geometry instanceof GeometryCollection) {
Expand Down
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ public class MonitorConfig implements GeoServerPluginConfigurator, ApplicationCo
public static enum Mode { public static enum Mode {
HISTORY, HISTORY,
LIVE, LIVE,

@Deprecated // use live
HYBRID;
} }


public static enum BboxMode { public static enum BboxMode {
Expand Down Expand Up @@ -96,9 +93,6 @@ public Properties getProperties() {


public Mode getMode() { public Mode getMode() {
Mode m = Mode.valueOf(props().getProperty("mode", "history").toUpperCase()); Mode m = Mode.valueOf(props().getProperty("mode", "history").toUpperCase());
if (m == Mode.HYBRID) {
m = Mode.LIVE;
}
return m; return m;
} }


Expand Down Expand Up @@ -163,7 +157,7 @@ public MonitorDAO createDAO() {
if (storage == null) { if (storage == null) {
// storage key not found, for backward compatibility look up mode // storage key not found, for backward compatibility look up mode
Mode mode = getMode(); Mode mode = getMode();
if (mode == Mode.HISTORY || mode == Mode.HYBRID) { if (mode == Mode.HISTORY) {
storage = "hibernate"; storage = "hibernate";
} }
} }
Expand Down
13 changes: 0 additions & 13 deletions src/gwc/src/main/java/org/geoserver/gwc/GWC.java
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@
import org.geowebcache.config.ConfigurationException; import org.geowebcache.config.ConfigurationException;
import org.geowebcache.config.ConfigurationPersistenceException; import org.geowebcache.config.ConfigurationPersistenceException;
import org.geowebcache.config.TileLayerConfiguration; import org.geowebcache.config.TileLayerConfiguration;
import org.geowebcache.config.XMLConfiguration;
import org.geowebcache.conveyor.ConveyorTile; import org.geowebcache.conveyor.ConveyorTile;
import org.geowebcache.diskquota.DiskQuotaConfig; import org.geowebcache.diskquota.DiskQuotaConfig;
import org.geowebcache.diskquota.DiskQuotaMonitor; import org.geowebcache.diskquota.DiskQuotaMonitor;
Expand Down Expand Up @@ -1648,18 +1647,6 @@ public synchronized void modifyGridSet(final String oldGridSetName, final GridSe
} }
} }


/**
* Looks up the {@link XMLConfiguration} from the spring context.
*
* @deprecated Only to be used for testing
* @return The {@link XMLConfiguration}
*/
@Deprecated
XMLConfiguration getXmlConfiguration() {
XMLConfiguration mainConfig = GeoWebCacheExtensions.bean(XMLConfiguration.class);
return mainConfig;
}

private BlobStoreAggregator getBlobStoreAggregator() { private BlobStoreAggregator getBlobStoreAggregator() {
return blobStoreAggregator; return blobStoreAggregator;
} }
Expand Down
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -180,28 +180,6 @@ public static void checkAutomaticStyles(
} }
} }


/**
* Find a parameter filter by key from a set of filters.
*
* @param paramName
* @param parameterFilters
* @deprecated
*/
public static ParameterFilter findParameterFilter(
final String paramName, Set<ParameterFilter> parameterFilters) {

if (parameterFilters == null || parameterFilters.size() == 0) {
return null;
}

for (ParameterFilter pf : parameterFilters) {
if (paramName.equalsIgnoreCase(pf.getKey())) {
return pf;
}
}
return null;
}

/** /**
* Set the styles which should be cached on a layer * Set the styles which should be cached on a layer
* *
Expand Down Expand Up @@ -275,19 +253,6 @@ public static void updateStringParameterFilter(
} }
} }


/**
* Remove a parameter filter from a layer
*
* @param tileLayerInfo the layer
* @param paramKey the key of the parameter filter
* @return true if a parameter matched and was removed, false otherwise
* @deprecated
*/
public static boolean removeParameterFilter(
final GeoServerTileLayerInfo tileLayerInfo, final String paramKey) {
return tileLayerInfo.removeParameterFilter(paramKey);
}

/** /**
* Add a {@link RegexParameterFilter} set accept anything, replacing any existing filter for the * Add a {@link RegexParameterFilter} set accept anything, replacing any existing filter for the
* same parameter. * same parameter.
Expand Down
2 changes: 0 additions & 2 deletions src/gwc/src/test/java/org/geoserver/gwc/GWCTest.java
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -332,8 +332,6 @@ public void setUp() throws Exception {
mediator.setApplicationContext(appContext); mediator.setApplicationContext(appContext);


mediator = spy(mediator); mediator = spy(mediator);
when(mediator.getXmlConfiguration()).thenReturn(xmlConfig);

GWC.set(mediator); GWC.set(mediator);
} }


Expand Down
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertTrue;


import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet;
import java.util.Set;
import org.geoserver.catalog.PublishedType; import org.geoserver.catalog.PublishedType;
import org.geoserver.catalog.impl.LayerGroupInfoImpl; import org.geoserver.catalog.impl.LayerGroupInfoImpl;
import org.geoserver.catalog.impl.LayerInfoImpl; import org.geoserver.catalog.impl.LayerInfoImpl;
Expand Down Expand Up @@ -121,26 +122,23 @@ public void testUpdateAcceptAllRegExParameterFilter() {


// If createParam is false and there isn't already a filter, don't create one // If createParam is false and there isn't already a filter, don't create one
TileLayerInfoUtil.updateAcceptAllRegExParameterFilter(info, "ENV", false); TileLayerInfoUtil.updateAcceptAllRegExParameterFilter(info, "ENV", false);
assertNull(TileLayerInfoUtil.findParameterFilter("ENV", info.getParameterFilters())); assertNull(findParameterFilter("ENV", info.getParameterFilters()));


// If createParam is true and there isn't already a filter, create one // If createParam is true and there isn't already a filter, create one
TileLayerInfoUtil.updateAcceptAllRegExParameterFilter(info, "ENV", true); TileLayerInfoUtil.updateAcceptAllRegExParameterFilter(info, "ENV", true);
ParameterFilter filter = ParameterFilter filter = findParameterFilter("ENV", info.getParameterFilters());
TileLayerInfoUtil.findParameterFilter("ENV", info.getParameterFilters());
assertTrue(filter instanceof RegexParameterFilter); assertTrue(filter instanceof RegexParameterFilter);
assertEquals(".*", ((RegexParameterFilter) filter).getRegex()); assertEquals(".*", ((RegexParameterFilter) filter).getRegex());


// If createParam is true and there is already a filter, replace it with a new one // If createParam is true and there is already a filter, replace it with a new one
TileLayerInfoUtil.updateAcceptAllRegExParameterFilter(info, "ENV", true); TileLayerInfoUtil.updateAcceptAllRegExParameterFilter(info, "ENV", true);
ParameterFilter filter2 = ParameterFilter filter2 = findParameterFilter("ENV", info.getParameterFilters());
TileLayerInfoUtil.findParameterFilter("ENV", info.getParameterFilters());
assertNotSame(filter, filter2); assertNotSame(filter, filter2);
assertEquals(filter, filter2); assertEquals(filter, filter2);


// If createParam is false and there is already a filter, replace it with a new one // If createParam is false and there is already a filter, replace it with a new one
TileLayerInfoUtil.updateAcceptAllRegExParameterFilter(info, "ENV", false); TileLayerInfoUtil.updateAcceptAllRegExParameterFilter(info, "ENV", false);
ParameterFilter filter3 = ParameterFilter filter3 = findParameterFilter("ENV", info.getParameterFilters());
TileLayerInfoUtil.findParameterFilter("ENV", info.getParameterFilters());
assertNotSame(filter2, filter3); assertNotSame(filter2, filter3);
assertEquals(filter, filter3); assertEquals(filter, filter3);
} }
Expand All @@ -152,27 +150,45 @@ public void testUpdateAcceptAllFloatParameterFilter() {


// If createParam is false and there isn't already a filter, don't create one // If createParam is false and there isn't already a filter, don't create one
TileLayerInfoUtil.updateAcceptAllFloatParameterFilter(info, "ELEVATION", false); TileLayerInfoUtil.updateAcceptAllFloatParameterFilter(info, "ELEVATION", false);
assertNull(TileLayerInfoUtil.findParameterFilter("ELEVATION", info.getParameterFilters())); assertNull(findParameterFilter("ELEVATION", info.getParameterFilters()));


// If createParam is true and there isn't already a filter, create one // If createParam is true and there isn't already a filter, create one
TileLayerInfoUtil.updateAcceptAllFloatParameterFilter(info, "ELEVATION", true); TileLayerInfoUtil.updateAcceptAllFloatParameterFilter(info, "ELEVATION", true);
ParameterFilter filter = ParameterFilter filter = findParameterFilter("ELEVATION", info.getParameterFilters());
TileLayerInfoUtil.findParameterFilter("ELEVATION", info.getParameterFilters());
assertTrue(filter instanceof FloatParameterFilter); assertTrue(filter instanceof FloatParameterFilter);
assertEquals(0, ((FloatParameterFilter) filter).getValues().size()); assertEquals(0, ((FloatParameterFilter) filter).getValues().size());


// If createParam is true and there is already a filter, replace it with a new one // If createParam is true and there is already a filter, replace it with a new one
TileLayerInfoUtil.updateAcceptAllFloatParameterFilter(info, "ELEVATION", true); TileLayerInfoUtil.updateAcceptAllFloatParameterFilter(info, "ELEVATION", true);
ParameterFilter filter2 = ParameterFilter filter2 = findParameterFilter("ELEVATION", info.getParameterFilters());
TileLayerInfoUtil.findParameterFilter("ELEVATION", info.getParameterFilters());
assertNotSame(filter, filter2); assertNotSame(filter, filter2);
assertEquals(filter, filter2); assertEquals(filter, filter2);


// If createParam is false and there is already a filter, replace it with a new one // If createParam is false and there is already a filter, replace it with a new one
TileLayerInfoUtil.updateAcceptAllFloatParameterFilter(info, "ELEVATION", false); TileLayerInfoUtil.updateAcceptAllFloatParameterFilter(info, "ELEVATION", false);
ParameterFilter filter3 = ParameterFilter filter3 = findParameterFilter("ELEVATION", info.getParameterFilters());
TileLayerInfoUtil.findParameterFilter("ELEVATION", info.getParameterFilters());
assertNotSame(filter2, filter3); assertNotSame(filter2, filter3);
assertEquals(filter, filter3); assertEquals(filter, filter3);
} }

/**
* Find a parameter filter by key from a set of filters.
*
* @param paramName
* @param parameterFilters
*/
private static ParameterFilter findParameterFilter(
final String paramName, Set<ParameterFilter> parameterFilters) {

if (parameterFilters == null || parameterFilters.size() == 0) {
return null;
}

for (ParameterFilter pf : parameterFilters) {
if (paramName.equalsIgnoreCase(pf.getKey())) {
return pf;
}
}
return null;
}
} }
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public Set<String> getFilter() {
* @return A new instance of the request. * @return A new instance of the request.
*/ */
public Object createRequest() throws Exception { public Object createRequest() throws Exception {
return getRequestBean().newInstance(); return getRequestBean().getDeclaredConstructor().newInstance();
} }


/** /**
Expand Down
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ public String getMimeType(Object value, Operation operation) throws ServiceExcep
public void write(Object value, OutputStream output, Operation operation) public void write(Object value, OutputStream output, Operation operation)
throws IOException, ServiceException { throws IOException, ServiceException {
try { try {
Configuration c = (Configuration) xmlConfiguration.newInstance(); Configuration c =
(Configuration) xmlConfiguration.getDeclaredConstructor().newInstance();
Encoder e = new Encoder(c); Encoder e = new Encoder(c);
for (Map.Entry<String, String> entry : getSchemaLocations().entrySet()) { for (Map.Entry<String, String> entry : getSchemaLocations().entrySet()) {
e.setSchemaLocation(entry.getKey(), entry.getValue()); e.setSchemaLocation(entry.getKey(), entry.getValue());
Expand Down
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import java.io.InputStream; import java.io.InputStream;
import java.io.OutputStream; import java.io.OutputStream;
import java.net.URL; import java.net.URL;
import java.util.Set;
import java.util.logging.Level; import java.util.logging.Level;
import java.util.logging.Logger; import java.util.logging.Logger;
import javax.servlet.ServletContext; import javax.servlet.ServletContext;
Expand Down Expand Up @@ -118,24 +117,6 @@ public void setServletContext(ServletContext servletContext) {
} }
} }


/**
* Adds a location to the path used for resource lookups.
*
* @param searchLocation directory containing resources.
* @deprecated No longer used
*/
public void addSearchLocation(File searchLocation) {
// searchLocations.add(searchLocation);
}

/**
* Sets the search locations used for resource lookups.
*
* @param searchLocations A set of {@link File}.
* @deprecated No longer used
*/
public void setSearchLocations(Set<File> searchLocations) {}

/** @return The base directory. */ /** @return The base directory. */
public File getBaseDirectory() { public File getBaseDirectory() {
return baseDirectory; return baseDirectory;
Expand Down
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -341,28 +341,6 @@ protected String getGroupSearchBase() {
return groupSearchBase; return groupSearchBase;
} }


/**
* @deprecated Convert case in the {@code AuthenticationProvider} using a {@code
* GrantedAuthoritiesMapper}.
*/
@Deprecated
public void setConvertToUpperCase(boolean convertToUpperCase) {
this.convertToUpperCase = convertToUpperCase;
}

/**
* The default role which will be assigned to all users.
*
* @param defaultRole the role name, including any desired prefix.
* @deprecated Assign a default role in the {@code AuthenticationProvider} using a {@code
* GrantedAuthoritiesMapper}.
*/
@Deprecated
public void setDefaultRole(String defaultRole) {
Assert.notNull(defaultRole, "The defaultRole property cannot be set to null");
this.defaultRole = new SimpleGrantedAuthority(defaultRole);
}

public void setGroupRoleAttribute(String groupRoleAttribute) { public void setGroupRoleAttribute(String groupRoleAttribute) {
Assert.notNull(groupRoleAttribute, "groupRoleAttribute must not be null"); Assert.notNull(groupRoleAttribute, "groupRoleAttribute must not be null");
this.groupRoleAttribute = groupRoleAttribute; this.groupRoleAttribute = groupRoleAttribute;
Expand All @@ -373,19 +351,6 @@ public void setGroupSearchFilter(String groupSearchFilter) {
this.groupSearchFilter = groupSearchFilter; this.groupSearchFilter = groupSearchFilter;
} }


/**
* Sets the prefix which will be prepended to the values loaded from the directory. Defaults to
* "ROLE_" for compatibility with <tt>RoleVoter/tt>.
*
* @deprecated Map the authorities in the {@code AuthenticationProvider} using a {@code
* GrantedAuthoritiesMapper}.
*/
@Deprecated
public void setRolePrefix(String rolePrefix) {
Assert.notNull(rolePrefix, "rolePrefix must not be null");
this.rolePrefix = rolePrefix;
}

/** /**
* If set to true, a subtree scope search will be performed. If false a single-level search is * If set to true, a subtree scope search will be performed. If false a single-level search is
* used. * used.
Expand Down
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -26,12 +26,6 @@ public void onEndRequest() {
AdminRequest.finish(); AdminRequest.finish();
} }


@Override
@SuppressWarnings("deprecation")
public void onRequestTargetSet(Class<? extends IRequestablePage> requestTarget) {
// not using anymore as it's deprecated
}

@Override @Override
public void onAfterTargetsDetached() {} public void onAfterTargetsDetached() {}


Expand Down

0 comments on commit ac0ed11

Please sign in to comment.