Fix major update integrating with external wisemapping frond end

This commit is contained in:
Paulo Gustavo Veiga
2021-12-24 18:03:23 -08:00
parent 76ff1cc83d
commit b3e26caee4
1042 changed files with 1160 additions and 73432 deletions

View File

@@ -84,8 +84,8 @@ public enum Application {
private final ApplicationType applicationType;
private final Manufacturer manufacturer;
private Application(Manufacturer manufacturer, int versionId, String name,
String[] aliases, ApplicationType applicationType) {
Application(Manufacturer manufacturer, int versionId, String name,
String[] aliases, ApplicationType applicationType) {
this.id = (short) ((manufacturer.getId() << 8) + (byte) versionId);
this.name = name;
this.aliases = aliases;

View File

@@ -50,9 +50,9 @@ public enum ApplicationType {
WEBMAIL("Webmail client"),
UNKNOWN("unknown");
private String name;
private final String name;
private ApplicationType(String name) {
ApplicationType(String name) {
this.name = name;
}

View File

@@ -168,10 +168,10 @@ public enum Browser {
private final Manufacturer manufacturer;
private final RenderingEngine renderingEngine;
private final Browser parent;
private List<Browser> children;
private final List<Browser> children;
private Pattern versionRegEx;
private Browser(Manufacturer manufacturer, Browser parent, int versionId, String name, String[] aliases, String[] exclude, BrowserType browserType, RenderingEngine renderingEngine, String versionRegexString) {
Browser(Manufacturer manufacturer, Browser parent, int versionId, String name, String[] aliases, String[] exclude, BrowserType browserType, RenderingEngine renderingEngine, String versionRegexString) {
this.id = (short) ((manufacturer.getId() << 8) + (byte) versionId);
this.name = name;
this.parent = parent;

View File

@@ -70,9 +70,9 @@ public enum BrowserType {
TOOL("Downloading tool"),
UNKNOWN("unknown");
private String name;
private final String name;
private BrowserType(String name) {
BrowserType(String name) {
this.name = name;
}

View File

@@ -60,7 +60,7 @@ public enum DeviceType {
String name;
private DeviceType(String name) {
DeviceType(String name) {
this.name = name;
}

View File

@@ -123,7 +123,7 @@ public enum Manufacturer {
private final byte id;
private final String name;
private Manufacturer(int id, String name) {
Manufacturer(int id, String name) {
this.id = (byte) id;
this.name = name;
}

View File

@@ -148,11 +148,11 @@ public enum OperatingSystem {
private final Manufacturer manufacturer;
private final DeviceType deviceType;
private final OperatingSystem parent;
private List<OperatingSystem> children;
private final List<OperatingSystem> children;
private Pattern versionRegEx;
private OperatingSystem(Manufacturer manufacturer, OperatingSystem parent, int versionId, String name, String[] aliases,
String[] exclude, DeviceType deviceType, String versionRegexString) {
OperatingSystem(Manufacturer manufacturer, OperatingSystem parent, int versionId, String name, String[] aliases,
String[] exclude, DeviceType deviceType, String versionRegexString) {
this.manufacturer = manufacturer;
this.parent = parent;
this.children = new ArrayList<OperatingSystem>();

View File

@@ -78,7 +78,7 @@ public enum RenderingEngine {
String name;
private RenderingEngine(String name) {
RenderingEngine(String name) {
this.name = name;
}

View File

@@ -8,7 +8,7 @@ import java.util.TimeZone;
final public class TimeUtils
{
private static SimpleDateFormat sdf;
private static final SimpleDateFormat sdf;
static {
sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
sdf.setTimeZone(TimeZone.getTimeZone("UTC"));

View File

@@ -215,11 +215,8 @@ public class UserAgent {
if (id != other.id)
return false;
if (operatingSystem == null) {
if (other.operatingSystem != null)
return false;
} else if (!operatingSystem.equals(other.operatingSystem))
return false;
return true;
return other.operatingSystem == null;
} else return operatingSystem.equals(other.operatingSystem);
}
}

View File

@@ -2,10 +2,11 @@ package com.wisemapping.util;
import org.apache.commons.collections.ExtendedProperties;
import org.apache.velocity.app.VelocityEngine;
import org.apache.velocity.runtime.RuntimeConstants;
import org.jetbrains.annotations.NotNull;
public class VelocityEngineWrapper {
private VelocityEngine velocityEngine;
private final VelocityEngine velocityEngine;
public VelocityEngineWrapper() {
ExtendedProperties extendedProperties = new ExtendedProperties();
@@ -15,6 +16,12 @@ public class VelocityEngineWrapper {
this.velocityEngine = new VelocityEngine();
velocityEngine.setExtendedProperties(extendedProperties);
// Configure velocity to use log4j.
velocityEngine.setProperty( RuntimeConstants.RUNTIME_LOG_LOGSYSTEM_CLASS,
"org.apache.velocity.runtime.log.SimpleLog4JLogSystem" );
velocityEngine.setProperty("runtime.log.logsystem.log4j.category", "org.apache.velocity");
}
@NotNull

View File

@@ -104,11 +104,8 @@ public class Version {
} else if (!minorVersion.equals(other.minorVersion))
return false;
if (version == null) {
if (other.version != null)
return false;
} else if (!version.equals(other.version))
return false;
return true;
return other.version == null;
} else return version.equals(other.version);
}