diff --git a/README.md b/README.md index 2dea5c28..32d66ce0 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ mvn clean install com.github.cfmleditor cfml.parsing - 2.2.14-SNAPSHOT + 2.14.0-SNAPSHOT ``` diff --git a/build.gradle b/build.gradle index d2188541..7ffd19a0 100644 --- a/build.gradle +++ b/build.gradle @@ -4,6 +4,8 @@ plugins { id 'net.researchgate.release' version '3.0.2' apply(false) } +version = '2.14.0-SNAPSHOT' + license { header rootProject.file('LICENSE') exclude "./cfml.dictionary/**" diff --git a/cfml.dictionary/README.md b/cfml.dictionary/README.md index 155ea196..a28db2ab 100644 --- a/cfml.dictionary/README.md +++ b/cfml.dictionary/README.md @@ -1,12 +1,12 @@ cfml.dictionary ======== + The CFML dictionary project. Aims to have the different vendor and version, versions. ```xml com.github.cfmleditor cfml.dictionary - 2.5.0 + 2.14.0-SNAPSHOT ``` - diff --git a/cfml.parsing/build.gradle b/cfml.parsing/build.gradle index 7d2bd33c..b0ca831b 100644 --- a/cfml.parsing/build.gradle +++ b/cfml.parsing/build.gradle @@ -14,8 +14,8 @@ generateGrammarSource { } ext { - antlrVersion = '4.7' - slf4jVersion = '1.7.21' + antlrVersion = '4.13.2' + slf4jVersion = '2.0.17' } jar.manifest.attributes( @@ -27,8 +27,8 @@ dependencies { antlr group: 'org.antlr', name: 'antlr4', version: antlrVersion implementation group: 'net.htmlparser.jericho', name: 'jericho-html', version: '3.4' implementation group: 'org.antlr', name: 'antlr4-runtime', version: antlrVersion - implementation group: 'org.antlr', name: 'antlr-runtime', version: '3.5.2' implementation group: 'javolution', name: 'javolution', version: '5.5.1' + // implementation group: 'org.antlr', name: 'antlr-runtime', version: '3.5.2' implementation group: 'org.slf4j', name: 'slf4j-api', version: slf4jVersion implementation group: 'org.slf4j', name: 'slf4j-simple', version: slf4jVersion testImplementation 'junit:junit:4.13.2' diff --git a/cfml.parsing/src/main/java/cfml/parsing/util/FastMapNative.java b/cfml.parsing/src/main/java/cfml/parsing/util/FastMapNative.java new file mode 100644 index 00000000..06ed7061 --- /dev/null +++ b/cfml.parsing/src/main/java/cfml/parsing/util/FastMapNative.java @@ -0,0 +1,135 @@ +package cfml.parsing.util; + +import java.io.Serializable; +import java.util.*; + +/** + * A replacement for javolution.util.FastMap that supports case-insensitive keys. Keys are always strings. + * This implementation uses standard Java utilities. + */ +public class FastMapNative implements CaseSensitiveMap, Serializable, Cloneable { + static final long serialVersionUID = 1; + + public static final boolean CASE_SENSITIVE = true; + public static final boolean CASE_INSENSITIVE = false; + + private final boolean caseSensitive; + private final Map map; + + public FastMapNative() { + this(CASE_SENSITIVE); + } + + public FastMapNative(boolean isCaseSensitive) { + this.caseSensitive = isCaseSensitive; + this.map = new LinkedHashMap<>(); + } + + public FastMapNative(FastMapNative other) { + this(other.caseSensitive); + this.map.putAll(other.map); + } + + public FastMapNative(Map otherMap) { + this(CASE_SENSITIVE); + putAll(otherMap); + } + + public FastMapNative(int initialCapacity) { + this(CASE_SENSITIVE); + // LinkedHashMap initial capacity + // Not strictly necessary, but can be used if needed + } + + @Override + public Object clone() { + return new FastMapNative<>(this); + } + + @Override + public boolean isCaseSensitive() { + return caseSensitive; + } + + // Helper to normalize keys for case-insensitive mode + private String normalizeKey(String key) { + return caseSensitive ? key : key.toLowerCase(Locale.ROOT); + } + + // Map-like methods + public V put(String key, V value) { + return map.put(normalizeKey(key), value); + } + + public V get(String key) { + return map.get(normalizeKey(key)); + } + + public boolean containsKey(String key) { + return map.containsKey(normalizeKey(key)); + } + + public V remove(String key) { + return map.remove(normalizeKey(key)); + } + + @Override + public V remove(Object key) { + if (key instanceof String) { + return map.remove(normalizeKey((String) key)); + } + return null; + } + + @Override + public void putAll(Map m) { + for (Map.Entry entry : m.entrySet()) { + put(entry.getKey(), entry.getValue()); + } + } + + public Set keySet() { + return map.keySet(); + } + + public Collection values() { + return map.values(); + } + + public Set> entrySet() { + return map.entrySet(); + } + + public int size() { + return map.size(); + } + + public boolean isEmpty() { + return map.isEmpty(); + } + + public void clear() { + map.clear(); + } + + @Override + public V get(Object key) { + if (key instanceof String) { + return map.get(normalizeKey((String) key)); + } + return null; + } + + @Override + public boolean containsValue(Object value) { + return map.containsValue(value); + } + + @Override + public boolean containsKey(Object key) { + if (key instanceof String) { + return map.containsKey(normalizeKey((String) key)); + } + return false; + } +}