Commit 6bb431a3 authored by Andrea Aime's avatar Andrea Aime
Browse files

PMD: enabling priority 3 rules, same way as done in GeoTools

parent 952dcbb0
......@@ -84,8 +84,6 @@ public class ControlFlowCallback extends AbstractDispatcherCallback
REQUEST_CONTROLLERS.remove();
}
private ApplicationContext applicationContext;
/** Returns the current number of blocked/queued requests. */
public long getBlockedRequests() {
return blockedRequests.get();
......@@ -203,7 +201,6 @@ public class ControlFlowCallback extends AbstractDispatcherCallback
}
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
this.applicationContext = applicationContext;
if (applicationContext instanceof ConfigurableApplicationContext) {
// register default beans if needed
registDefaultBeansIfNeeded((ConfigurableApplicationContext) applicationContext);
......
......@@ -14,12 +14,9 @@ package org.geoserver.flow.controller;
*/
public class SingleIpFlowController extends SingleQueueFlowController {
private final String ip;
public SingleIpFlowController(final int queueSize, final String ip) {
// building a simpLe thread blocker as this queue is for a single IP, there is no priority
// concept here
super(new IpRequestMatcher(ip), queueSize, new SimpleThreadBlocker(queueSize));
this.ip = ip;
}
}
......@@ -36,8 +36,6 @@ import org.springframework.context.ApplicationContextAware;
*/
public class DefaultWebCatalogService implements WebCatalogService, ApplicationContextAware {
private CSWInfo csw;
private GeoServer gs;
private CatalogStore store;
......@@ -45,7 +43,6 @@ public class DefaultWebCatalogService implements WebCatalogService, ApplicationC
protected ApplicationContext context;
public DefaultWebCatalogService(GeoServer gs) {
this.csw = gs.getService(CSWInfo.class);
this.gs = gs;
}
......
......@@ -922,4 +922,4 @@ class CSWSpatialCapabilities extends SpatialCapabiltiesImpl {
}
};
}
};
}
......@@ -121,9 +121,7 @@ public class CSWRecordTransformer extends AbstractRecordTransformer {
private void encodeProperty(Feature f, Property p) {
if (p.getType() == CSWRecordDescriptor.SIMPLE_LITERAL) {
encodeSimpleLiteral(p);
} else if (CSWRecordDescriptor.RECORD_BBOX_NAME.equals(p.getName())) {
// skip it for the moment, it is constrained to be last
} else {
} else if (!CSWRecordDescriptor.RECORD_BBOX_NAME.equals(p.getName())) {
throw new IllegalArgumentException(
"Don't know how to encode property " + p + " in record " + f);
}
......
......@@ -396,7 +396,6 @@ public class Rel14DXFWriter extends AbstractDXFWriter {
throws IOException {
LOGGER.warning("Rel14DXFWriter.writeAttributeDefinitionBlocks");
for (FeatureCollection coll : featureList) {
String fid = coll.hashCode() + "";
// consider only items cached to be treated as
// blocks (by the previous block_record analysis)
......
......@@ -13,11 +13,9 @@ import java.io.OutputStreamWriter;
import java.nio.charset.Charset;
import java.util.LinkedList;
import java.util.List;
import java.util.logging.Logger;
import org.geoserver.wfs.response.dxf.DXFWriter;
import org.geoserver.wfs.response.dxf.DXFWriterFinder;
import org.geotools.feature.FeatureCollection;
import org.geotools.util.logging.Logging;
/**
* Outputs feature collections in DXF format
......@@ -25,8 +23,6 @@ import org.geotools.util.logging.Logging;
* @author Andrea Aime - OpenGeo, Peter Hopfgartner - R3 GIS
*/
public class DXFPPIO extends CDataPPIO {
private static final Logger LOGGER = Logging.getLogger(DXFPPIO.class);
protected DXFPPIO() {
super(FeatureCollection.class, FeatureCollection.class, "application/dxf");
}
......
......@@ -5,7 +5,6 @@
*/
package org.geoserver.wfs.response;
import org.apache.log4j.Logger;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.streaming.SXSSFWorkbook;
import org.geoserver.config.GeoServer;
......@@ -16,8 +15,6 @@ import org.geoserver.config.GeoServer;
* @author Shane StClair, Axiom Consulting, shane@axiomalaska.com
*/
public class Excel2007OutputFormat extends ExcelOutputFormat {
private static Logger log = Logger.getLogger(Excel2007OutputFormat.class);
/**
* Constructor setting the format type as "excel2007" in addition to file extension, mime type,
* and row and column limits
......
......@@ -5,7 +5,6 @@
*/
package org.geoserver.wfs.response;
import org.apache.log4j.Logger;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Workbook;
import org.geoserver.config.GeoServer;
......@@ -16,7 +15,6 @@ import org.geoserver.config.GeoServer;
* @author Shane StClair, Axiom Consulting, shane@axiomalaska.com
*/
public class Excel97OutputFormat extends ExcelOutputFormat {
private static Logger log = Logger.getLogger(Excel97OutputFormat.class);
/**
* Constructor setting the format type as "excel" in addition to file extension, mime type, and
......
......@@ -10,7 +10,6 @@ import java.io.OutputStream;
import java.util.Calendar;
import java.util.Date;
import java.util.Iterator;
import org.apache.log4j.Logger;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.CreationHelper;
import org.apache.poi.ss.usermodel.RichTextString;
......@@ -36,7 +35,6 @@ import org.opengis.feature.type.AttributeDescriptor;
* shane@axiomalaska.com
*/
public abstract class ExcelOutputFormat extends WFSGetFeatureOutputFormat {
private static Logger log = Logger.getLogger(ExcelOutputFormat.class);
protected static int CELL_CHAR_LIMIT = (int) Math.pow(2, 15) - 1; // 32,767
......
......@@ -5,16 +5,12 @@
package org.geoserver.geofence.config;
import java.io.IOException;
import java.util.logging.Logger;
import org.geoserver.geofence.cache.CacheConfiguration;
import org.geoserver.geofence.cache.CachedRuleReader;
import org.geotools.util.logging.Logging;
/** @author ETj (etj at geo-solutions.it) */
public class GeoFenceConfigurationController {
private static final Logger LOGGER = Logging.getLogger(GeoFenceConfigurationController.class);
private GeoFenceConfigurationManager configurationManager;
private CachedRuleReader cachedRuleReader;
......
......@@ -10,7 +10,6 @@ import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import org.geoserver.geofence.services.RuleReaderService;
import org.geoserver.geoserver.authentication.auth.GeoFenceAuthenticationProvider;
import org.geoserver.geoserver.authentication.auth.GeoFenceSecurityProvider;
import org.geoserver.security.GeoServerSecurityManager;
......@@ -30,8 +29,6 @@ public class GeoFenceAuthFilter
static final Logger LOGGER = Logging.getLogger(GeoFenceAuthFilter.class);
private RuleReaderService ruleReaderService;
private GeoFenceSecurityProvider geofenceAuth;
// static final String ROOT_ROLE = "ROLE_ADMINISTRATOR";
......@@ -44,7 +41,6 @@ public class GeoFenceAuthFilter
public void initializeFromConfig(SecurityNamedServiceConfig config) throws IOException {
super.initializeFromConfig(config);
GeoFenceAuthFilterConfig cfg = (GeoFenceAuthFilterConfig) config;
// anything to set here? maybe the cache config
aep = new BasicAuthenticationEntryPoint();
......@@ -119,10 +115,6 @@ public class GeoFenceAuthFilter
return true;
}
public void setRuleReaderService(RuleReaderService ruleReaderService) {
this.ruleReaderService = ruleReaderService;
}
public void setGeofenceAuth(GeoFenceSecurityProvider geofenceAuth) {
this.geofenceAuth = geofenceAuth;
}
......
......@@ -5,7 +5,6 @@
package org.geoserver.geoserver.authentication.filter;
import org.geoserver.config.util.XStreamPersister;
import org.geoserver.geofence.services.RuleReaderService;
import org.geoserver.geoserver.authentication.auth.GeoFenceSecurityProvider;
import org.geoserver.security.config.SecurityNamedServiceConfig;
import org.geoserver.security.filter.AbstractFilterProvider;
......@@ -14,8 +13,6 @@ import org.geoserver.security.filter.GeoServerSecurityFilter;
/** @author ETj (etj at geo-solutions.it) */
public class GeoFenceAuthFilterProvider extends AbstractFilterProvider {
private RuleReaderService ruleReaderService;
private GeoFenceSecurityProvider geofenceAuth;
@Override
......@@ -33,16 +30,11 @@ public class GeoFenceAuthFilterProvider extends AbstractFilterProvider {
public GeoServerSecurityFilter createFilter(SecurityNamedServiceConfig config) {
GeoFenceAuthFilter filter = new GeoFenceAuthFilter();
filter.setRuleReaderService(ruleReaderService);
filter.setGeofenceAuth(geofenceAuth);
return filter;
}
public void setRuleReaderService(RuleReaderService ruleReaderService) {
this.ruleReaderService = ruleReaderService;
}
public void setGeofenceAuth(GeoFenceSecurityProvider geofenceAuth) {
this.geofenceAuth = geofenceAuth;
}
......
......@@ -95,7 +95,6 @@
<!-- geoserver auth mechanism -->
<bean id="geofenceFilter" class="org.geoserver.geoserver.authentication.filter.GeoFenceAuthFilterProvider">
<property name="ruleReaderService" ref="${ruleReaderFrontend}"/>
<property name="geofenceAuth" ref="geofenceAuth"/>
</bean>
......
......@@ -46,7 +46,6 @@ public class GeofenceFilterConfigTest extends GeofenceBaseTest {
geofenceAuth.setSecurityManager(getSecurityManager());
geofenceAuth.setRuleReaderService(geofenceService);
filter.setGeofenceAuth(geofenceAuth);
filter.setRuleReaderService(geofenceService);
filter.initializeFromConfig(config);
}
......
......@@ -161,7 +161,6 @@ public class HTMLImageMapWriter extends OutputStreamWriter {
SimpleFeatureIterator iter = null;
try {
SimpleFeatureType featureType = fColl.getSchema();
Class<?> gtype = featureType.getGeometryDescriptor().getType().getBinding();
// iterates through the single features
iter = fColl.features();
......
......@@ -229,8 +229,7 @@ public class BDBImportStore implements ImportStore {
LongBinding keyBinding = new LongBinding();
List<Long> ids = new ArrayList();
OperationStatus op = null;
while ((op = c.getNext(key, val, LockMode.DEFAULT)) == OperationStatus.SUCCESS) {
while (c.getNext(key, val, LockMode.DEFAULT) == OperationStatus.SUCCESS) {
ids.add(LongBinding.entryToLong(key));
}
c.close();
......@@ -296,8 +295,7 @@ public class BDBImportStore implements ImportStore {
DatabaseEntry key = new DatabaseEntry();
DatabaseEntry val = new DatabaseEntry();
OperationStatus op = null;
while ((op = c.getNext(key, val, LockMode.DEFAULT)) == OperationStatus.SUCCESS) {
while (c.getNext(key, val, LockMode.DEFAULT) == OperationStatus.SUCCESS) {
visitor.visit(importBinding.entryToObject(val));
}
} finally {
......
......@@ -450,14 +450,12 @@ public class Directory extends FileData {
}
ZipOutputStream zout =
new ZipOutputStream(new BufferedOutputStream(new FileOutputStream(output)));
Exception error = null;
// don't call zout.close in finally block, if an error occurs and the zip
// file is empty by chance, the second error will mask the first
try {
IOUtils.zipDirectory(file, zout, null);
} catch (Exception ex) {
error = ex;
try {
zout.close();
} catch (Exception ex2) {
......
......@@ -480,7 +480,6 @@ public class Importer implements DisposableBean, ApplicationListener {
} else {
return initForFile(context, (FileData) data);
}
} else if (data instanceof Table) {
} else if (data instanceof Database) {
return initForDatabase(context, (Database) data);
}
......@@ -1423,7 +1422,6 @@ public class Importer implements DisposableBean, ApplicationListener {
Throwable error = null;
ProgressMonitor monitor = task.progress();
try {
long startTime = System.currentTimeMillis();
task.clearMessages();
task.setTotalToProcess(format.getFeatureCount(task.getData(), task));
......
......@@ -131,8 +131,6 @@ public class VFSWorker {
return names;
} catch (FileSystemException e) {
e.printStackTrace();
} finally {
// fsManager.closeFileSystem(fileSystem.getFileSystem());
}
return Collections.emptyList();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment