Skip to content

Commit

Permalink
Bump libs + Some minor cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
tsegall committed Dec 26, 2024
1 parent 0fee0fe commit 029fe8d
Show file tree
Hide file tree
Showing 40 changed files with 103 additions and 67 deletions.
4 changes: 4 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@

## Changes ##

### 15.11.1
- INT: Bump google phonenumber to 8.13.52, commons-text to 1.13.0, guava to 33.4.0-jre, logback-classic to 1.5.15, gradle to 8.12, org.springframework.boot to 3.4.1, io.spring.dependency-management to 1.1.7
- INT: Some minor cleaning

### 15.11.0
- ENH: Add support for registering plugins on the RecordAnalyzer (via the template)
- BUG: Added missing source for DateDemo and Serialize examples
Expand Down
3 changes: 2 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
}

wrapper {
gradleVersion = '8.11.1'
gradleVersion = '8.12'
}

tasks.register('examples.build') {
Expand Down Expand Up @@ -31,6 +31,7 @@ subprojects {

compileJava {
options.release = 11
options.compilerArgs.add("-Xlint:unchecked")
}

java {
Expand Down
2 changes: 1 addition & 1 deletion cli/src/main/java/com/cobber/fta/driver/faker/Faker.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public Faker(final DriverOptions options, final PrintStream output, final PrintS
this.error = error;
}

private String[] quoteAwareSplit(String input, char splitOn) {
private String[] quoteAwareSplit(final String input, final char splitOn) {
final LinkedHashSet<String> result = new LinkedHashSet<>();
boolean inQuotes = false;
int start = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

public class FakerBooleanLT extends FakerLT {
private boolean initialized = false;
private String[] values = new String[2];
private final String[] values = new String[2];
final Random random = new Random(31415926);

public FakerBooleanLT(final PluginDefinition plugin) {
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/com/cobber/fta/core/CircularBuffer.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public boolean add(final String[] record) {
public String[] get() {
if (records == 0)
return null;
String[] ret = this.buffer[retrieve];
final String[] ret = this.buffer[retrieve];
records--;
retrieve = retrieve == depth - 1 ? 0 : retrieve + 1;
return ret;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ else if (FTAType.ZONEDDATETIME.equals(type)) {
text = offsetDateTime.format(formatter);
offsetDateTime = offsetDateTime.minusHours(209);
}
answer.append("\"").append(text).append("\"");
answer.append('"').append(text).append('"');
if (i + 1 < inputs.length)
answer.append(',');
else
Expand Down Expand Up @@ -2165,7 +2165,7 @@ public void testDTPResult_Unknown() {

@Test(groups = { TestGroups.ALL, TestGroups.DATETIME })
public void intuitAlmostISO4() {
final DateTimeParser det = new DateTimeParser().withDateResolutionMode(DateResolutionMode.MonthFirst);;
final DateTimeParser det = new DateTimeParser().withDateResolutionMode(DateResolutionMode.MonthFirst);
final String sample = "2004-01-01 12:35:41.999";
assertEquals(det.determineFormatString(sample), "yyyy-MM-dd HH:mm:ss.SSS");

Expand Down
2 changes: 1 addition & 1 deletion core/src/test/java/com/cobber/fta/TestUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,7 @@ public void typeInfo() {
knownTypes.initialize(Locale.US);
assertTrue(knownTypes.getByID(KnownTypes.ID.ID_LONG).equals(knownTypes.getByID(KnownTypes.ID.ID_LONG)));
assertFalse(knownTypes.getByID(KnownTypes.ID.ID_LONG).equals(knownTypes.getByID(KnownTypes.ID.ID_LONG_GROUPING)));
assertFalse(knownTypes.getByID(KnownTypes.ID.ID_LONG).equals(null));
assertFalse(knownTypes.getByID(KnownTypes.ID.ID_LONG) == null);

assertFalse(knownTypes.getByID(KnownTypes.ID.ID_LONG).hasGrouping());
assertFalse(knownTypes.getByID(KnownTypes.ID.ID_LONG).isSigned());
Expand Down
2 changes: 1 addition & 1 deletion examples/contextual/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
}

wrapper {
gradleVersion = '8.11.1'
gradleVersion = '8.12'
}

repositories {
Expand Down
2 changes: 1 addition & 1 deletion examples/core/datedemo/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
}

wrapper {
gradleVersion = '8.11.1'
gradleVersion = '8.12'
}

repositories {
Expand Down
2 changes: 1 addition & 1 deletion examples/core/dateformat/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
}

wrapper {
gradleVersion = '8.11.1'
gradleVersion = '8.12'
}

repositories {
Expand Down
2 changes: 1 addition & 1 deletion examples/core/dateformattrained/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
}

wrapper {
gradleVersion = '8.11.1'
gradleVersion = '8.12'
}

repositories {
Expand Down
2 changes: 1 addition & 1 deletion examples/core/speed/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
}

wrapper {
gradleVersion = '8.11.1'
gradleVersion = '8.12'
}

repositories {
Expand Down
2 changes: 1 addition & 1 deletion examples/dateparsing/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
}

wrapper {
gradleVersion = '8.11.1'
gradleVersion = '8.12'
}

repositories {
Expand Down
2 changes: 1 addition & 1 deletion examples/datetraining/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
}

wrapper {
gradleVersion = '8.11.1'
gradleVersion = '8.12'
}

repositories {
Expand Down
2 changes: 1 addition & 1 deletion examples/generation/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
}

wrapper {
gradleVersion = '8.11.1'
gradleVersion = '8.12'
}

repositories {
Expand Down
2 changes: 1 addition & 1 deletion examples/mergesimple/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
}

wrapper {
gradleVersion = '8.11.1'
gradleVersion = '8.12'
}

repositories {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import java.util.HashMap;
import java.util.Map;

import com.cobber.fta.LogicalType;
import com.cobber.fta.TextAnalysisResult;
import com.cobber.fta.TextAnalyzer;
import com.cobber.fta.core.FTAException;
Expand Down
2 changes: 1 addition & 1 deletion examples/minicli/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
}

wrapper {
gradleVersion = '8.11.1'
gradleVersion = '8.12'
}

repositories {
Expand Down
2 changes: 1 addition & 1 deletion examples/modebulk/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
}

wrapper {
gradleVersion = '8.11.1'
gradleVersion = '8.12'
}

repositories {
Expand Down
2 changes: 1 addition & 1 deletion examples/moderecord/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
}

wrapper {
gradleVersion = '8.11.1'
gradleVersion = '8.12'
}

repositories {
Expand Down
2 changes: 1 addition & 1 deletion examples/modestreaming/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
}

wrapper {
gradleVersion = '8.11.1'
gradleVersion = '8.12'
}

repositories {
Expand Down
2 changes: 1 addition & 1 deletion examples/performance/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
}

wrapper {
gradleVersion = '8.11.1'
gradleVersion = '8.12'
}

repositories {
Expand Down
2 changes: 1 addition & 1 deletion examples/sampleplugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
}

wrapper {
gradleVersion = '8.11.1'
gradleVersion = '8.12'
}

repositories {
Expand Down
2 changes: 1 addition & 1 deletion examples/serialize/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
}

wrapper {
gradleVersion = '8.11.1'
gradleVersion = '8.12'
}

repositories {
Expand Down
4 changes: 2 additions & 2 deletions examples/serialize/src/main/java/serialize/Serialize.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public static void main(final String[] args) throws FTAException {

String serialized = analysis.serialize();
for (int i = 0; i < 10000; i++) {
TextAnalyzer t = TextAnalyzer.deserialize(serialized);
final TextAnalyzer t = TextAnalyzer.deserialize(serialized);
t.train(options[r.nextInt(options.length)]);
serialized = t.serialize();
}
Expand All @@ -46,7 +46,7 @@ public static void main(final String[] args) throws FTAException {
System.err.println("Detail: " + result.asJSON(true, 1));

// Given the Semantic Type we retrieve the associated plugin
LogicalType semanticType = finalAnalysis.getPlugins().getRegistered(result.getSemanticType());
final LogicalType semanticType = finalAnalysis.getPlugins().getRegistered(result.getSemanticType());

// Use the plugin to get the non-localized description
System.err.printf("Description: %s%n", semanticType.getDescription());
Expand Down
2 changes: 1 addition & 1 deletion examples/validation/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
}

wrapper {
gradleVersion = '8.11.1'
gradleVersion = '8.12'
}

repositories {
Expand Down
6 changes: 3 additions & 3 deletions examples/web/build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
plugins {
id 'org.springframework.boot' version '3.4.0'
id 'io.spring.dependency-management' version '1.1.6'
id 'org.springframework.boot' version '3.4.1'
id 'io.spring.dependency-management' version '1.1.7'
id "com.github.ben-manes.versions" version '0.51.0'
id 'java'
id 'war'
id 'eclipse'
}

wrapper {
gradleVersion = '8.11.1'
gradleVersion = '8.12'
}

group = 'com.cobber.fta'
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
12 changes: 6 additions & 6 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ pluginManagement {
repositories {
mavenCentral()
maven {
url 'https://plugins.gradle.org/m2/'
url = 'https://plugins.gradle.org/m2/'
}
gradlePluginPortal()
}
Expand Down Expand Up @@ -40,7 +40,7 @@ includeBuild 'examples/core/speed'
dependencyResolutionManagement {
versionCatalogs {
libs {
version('fta', '15.11.0')
version('fta', '15.11.1')
version('jacoco', '0.8.12')

// https://mvnrepository.com/artifact/com.univocity/univocity-parsers
Expand All @@ -54,19 +54,19 @@ dependencyResolutionManagement {
// https://mvnrepository.com/artifact/com.fasterxml.jackson.datatype/jackson-datatype-jsr310
library('jacksonDataType', 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.18.2')
// https://mvnrepository.com/artifact/com.googlecode.libphonenumber/libphonenumber
library('googlePhoneNumber', 'com.googlecode.libphonenumber:libphonenumber:8.13.51')
library('googlePhoneNumber', 'com.googlecode.libphonenumber:libphonenumber:8.13.52')
// https://mvnrepository.com/artifact/org.apache.commons/commons-text
library('commonsText', 'org.apache.commons:commons-text:1.12.0')
library('commonsText', 'org.apache.commons:commons-text:1.13.0')
// https://mvnrepository.com/artifact/com.github.krraghavan/xeger
library('xeger', 'com.github.krraghavan:xeger:1.0.0-RELEASE')
// https://mvnrepository.com/artifact/dk.brics.automaton/automaton
library('automaton', 'dk.brics:automaton:1.12-4')
// https://mvnrepository.com/artifact/org.slf4j/slf4j-api
library('slf4jAPI', 'org.slf4j:slf4j-api:2.0.16')
// https://mvnrepository.com/artifact/com.google.guava/guava
library('guava', 'com.google.guava:guava:33.3.1-jre')
library('guava', 'com.google.guava:guava:33.4.0-jre')
// https://mvnrepository.com/artifact/ch.qos.logback/logback-classic
library('logbackClassic', 'ch.qos.logback:logback-classic:1.5.12')
library('logbackClassic', 'ch.qos.logback:logback-classic:1.5.15')
// https://mvnrepository.com/artifact/com.datadoghq/sketches-java
library('sketches', 'com.datadoghq:sketches-java:0.8.3')
}
Expand Down
6 changes: 3 additions & 3 deletions types/src/main/java/com/cobber/fta/CacheLRU.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,22 @@
public class CacheLRU<K, V> {
private final Cache<K, V> cache;

public CacheLRU(int capacity) {
public CacheLRU(final int capacity) {
this.cache = CacheBuilder.newBuilder()
.maximumSize(capacity)
.expireAfterAccess(10, TimeUnit.MINUTES)
.build();
}

public void put(K key, V value) {
public void put(final K key, final V value) {
cache.put(key, value);
}

public V get(K key) {
return cache.getIfPresent(key);
}

public void invalidate(K key) {
public void invalidate(final K key) {
cache.invalidate(key);
}

Expand Down
4 changes: 2 additions & 2 deletions types/src/main/java/com/cobber/fta/CommonComparator.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

import com.cobber.fta.core.FTAType;

public class CommonComparator<T extends Comparable> implements Comparator<String> {
public class CommonComparator<T extends Comparable<? super T>> implements Comparator<String> {
private final StringConverter stringConverter;

public CommonComparator(final StringConverter stringConverter) {
Expand All @@ -39,7 +39,7 @@ public int compare(final String input1, final String input2) {
if (val1 == null)
System.err.println("*** Failed to convert ... " + input1);
final T val2 = (T)stringConverter.getValue(input2);
final int value = val1.compareTo(val2);
final int value = val1.compareTo(val2);

if (value < 0)
return -1;
Expand Down
6 changes: 3 additions & 3 deletions types/src/main/java/com/cobber/fta/NumericInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ public class NumericInfo {

private NumericInfo nonLocalized;

private NumericInfo(char decimalSeparator, char groupingSeparator, char minusSign,
boolean hasNegativePrefix, char negativePrefix, boolean hasNegativeSuffix, char negativeSuffix) {
private NumericInfo(final char decimalSeparator, final char groupingSeparator, final char minusSign,
final boolean hasNegativePrefix, final char negativePrefix, final boolean hasNegativeSuffix, final char negativeSuffix) {
this.decimalSeparator = decimalSeparator;
this.groupingSeparator = groupingSeparator;
this.minusSign = minusSign;
Expand All @@ -47,7 +47,7 @@ public NumericInfo getNonLocalized() {
return nonLocalized;
}

NumericInfo(Locale locale) throws FTAUnsupportedLocaleException {
NumericInfo(final Locale locale) throws FTAUnsupportedLocaleException {
final DecimalFormatSymbols formatSymbols = new DecimalFormatSymbols(locale);
decimalSeparator = formatSymbols.getDecimalSeparator();
groupingSeparator = formatSymbols.getGroupingSeparator();
Expand Down
Loading

0 comments on commit 029fe8d

Please sign in to comment.