Fix major update integrating with external wisemapping frond end
This commit is contained in:
@@ -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;
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
@@ -60,7 +60,7 @@ public enum DeviceType {
|
||||
|
||||
String name;
|
||||
|
||||
private DeviceType(String name) {
|
||||
DeviceType(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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>();
|
||||
|
@@ -78,7 +78,7 @@ public enum RenderingEngine {
|
||||
|
||||
String name;
|
||||
|
||||
private RenderingEngine(String name) {
|
||||
RenderingEngine(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
|
@@ -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"));
|
||||
|
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -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
|
||||
|
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user