Unverified Commit f7c4da3d authored by User expired's avatar User expired
Browse files

fixing findbugs warnings

parent 4eb72409
Upcoming version:
-----------------
- fixing findbugs warnings (Nikolaus Krismer)
- updating webpack to latest version (Nikolaus Krismer)
- fixed minor issues regarding JAI (Nikolaus Krismer)
- added logging of mean isochrones to console (Nikolaus Krismer)
......
......@@ -117,6 +117,48 @@ public class ConfigClient extends ConfigDatasetWeb {
// Public methods
/**
* Gets a flag that indicates if a task for this client is already running.
*
* @return flag indicating if a task for this client is already running
*/
public boolean containsTask() {
return TASKS.get(clientId) != null;
}
@Override
public boolean equals(final Object obj) {
if (this == obj) {
return true;
}
if (!super.equals(obj)) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final ConfigClient other = (ConfigClient) obj;
if (clientId == null) {
if (other.clientId != null) {
return false;
}
} else if (!clientId.equals(other.clientId)) {
return false;
}
return true;
}
@Override
public int hashCode() {
// CHECKSTYLE:OFF MagicNumber
final int prime = 31;
int result = super.hashCode();
result = prime * result + ((clientId == null) ? 0 : clientId.hashCode());
// CHECKSTYLE:ON MagicNumber
return result;
}
/**
* Registers a running task to the client's configuration.
* The method {@link #unregisterTask()} should be called after the task has been finished.
......@@ -137,13 +179,9 @@ public class ConfigClient extends ConfigDatasetWeb {
DbUtilsWeb.registerTableAndLayers(connection, this, useJts, useGeoserver);
}
/**
* Gets a flag that indicates if a task for this client is already running.
*
* @return flag indicating if a task for this client is already running
*/
public boolean containsTask() {
return TASKS.get(clientId) != null;
@Override
public String toString() {
return "ConfigClient [clientId=" + clientId + "]";
}
/**
......
......@@ -69,6 +69,48 @@ class ConfigDatasetWeb extends ConfigDataset {
return boundaryBBox;
}
// Public methods
@Override
public boolean equals(final Object obj) {
if (this == obj) {
return true;
}
if (!super.equals(obj)) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final ConfigDatasetWeb other = (ConfigDatasetWeb) obj;
if (clientBBox == null) {
if (other.clientBBox != null) {
return false;
}
} else if (!clientBBox.equals(other.clientBBox)) {
return false;
}
return true;
}
@Override
public int hashCode() {
// CHECKSTYLE:OFF MagicNumber
final int prime = 31;
int result = super.hashCode();
result = prime * result + ((clientBBox == null) ? 0 : clientBBox.hashCode());
// CHECKSTYLE:ON MagicNumber
return result;
}
@Override
public String toString() {
return "ConfigDatasetWeb [clientBBox=" + clientBBox + "]";
}
// Public static methods
public static void initializeBoundary(final String datasetName, final File file) throws IOException {
......
package at.uibk.dbis.isomap.config;
import org.testng.annotations.Test;
import nl.jqno.equalsverifier.EqualsVerifier;
import nl.jqno.equalsverifier.Warning;
public class EqualityTest {
// Test methods
@Test
public void testConfigClient() {
EqualsVerifier.forClass(ConfigClient.class)
.suppress(Warning.ALL_FIELDS_SHOULD_BE_USED)
.suppress(Warning.NONFINAL_FIELDS)
.usingGetClass()
.verify();
}
@Test
public void testConfigDatasetWeb() {
EqualsVerifier.forClass(ConfigDatasetWeb.class)
.suppress(Warning.ALL_FIELDS_SHOULD_BE_USED)
.suppress(Warning.NONFINAL_FIELDS)
.usingGetClass()
.verify();
}
}
package at.uibk.dbis.isomap.config;
import org.testng.Assert;
import org.testng.annotations.Test;
import at.uibk.dbis.isomap.TestHelper;
public class StringifierTest {
// Test methods
@Test
public void testConfigClient() {
final ConfigClient o = TestHelper.getConfigClient();
Assert.assertFalse(o.toString().contains("@"));
}
}
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