Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
import ua.com.fielden.platform.serialisation.api.impl.IdOnlyProxiedEntityTypeCacheForTests;
import ua.com.fielden.platform.web.annotations.AppUri;

import java.time.Duration;
import java.util.List;
import java.util.Properties;
import java.util.concurrent.TimeUnit;

import static java.lang.String.format;

Expand Down Expand Up @@ -59,7 +59,7 @@ protected void configure() {
@Provides
@Singleton
@SessionCache Cache<String, UserSession> provideSessionCache() {
return CacheBuilder.newBuilder().expireAfterWrite(2, TimeUnit.MINUTES).build();
return CacheBuilder.newBuilder().expireAfterWrite(Duration.ofMinutes(2)).build();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
import ua.com.fielden.platform.serialisation.api.impl.IdOnlyProxiedEntityTypeCacheForTests;
import ua.com.fielden.platform.web.annotations.AppUri;

import java.time.Duration;
import java.util.List;
import java.util.Properties;
import java.util.concurrent.TimeUnit;

import static java.lang.String.format;

Expand Down Expand Up @@ -59,7 +59,7 @@ protected void configure() {
@Provides
@Singleton
@SessionCache Cache<String, UserSession> provideSessionCache() {
return CacheBuilder.newBuilder().expireAfterWrite(2, TimeUnit.MINUTES).build();
return CacheBuilder.newBuilder().expireAfterWrite(Duration.ofMinutes(2)).build();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@
import ua.com.fielden.platform.utils.IUniversalConstants;
import ua.com.fielden.platform.web.annotations.AppUri;

import java.time.Duration;
import java.util.List;
import java.util.Properties;
import java.util.concurrent.TimeUnit;

import static java.lang.String.format;

Expand Down Expand Up @@ -230,7 +230,7 @@ protected void bindDomainCompanionObjects(final List<Class<? extends AbstractEnt
return CacheBuilder.newBuilder()
// all authenticators should be evicted from the cache in 2 minutes time after that have been
// put into the cache
.expireAfterWrite(2, TimeUnit.MINUTES)
.expireAfterWrite(Duration.ofMinutes(2))
// the ticker controls the eviction time
// the injected instance is initialised with IUniversalConstants.now() as its start time
.ticker(ticker)
Expand Down
10 changes: 5 additions & 5 deletions platform-pojo-bl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
</description>

<properties>
<jackson.version>2.21.1</jackson.version>
<jackson.annotations.version>2.21</jackson.annotations.version>
<guava.version>33.5.0-jre</guava.version>
<poi.verstion>5.4.1</poi.verstion>
<jackson.version>2.22.0</jackson.version>
<jackson.annotations.version>2.22</jackson.annotations.version>
<guava.version>33.6.0-jre</guava.version>
<poi.verstion>5.5.1</poi.verstion>
<xalan.version>2.7.3</xalan.version>
<guice.version>7.0.0</guice.version>
<asm.version>9.9.1</asm.version><!-- Required to override the outdated dependency in Guice. -->
Expand Down Expand Up @@ -268,7 +268,7 @@
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.20.0</version>
<version>2.21.0</version>
</dependency>
<dependency>
<groupId>org.commonmark</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ private TypeDiffSerialiser() {
*/
public byte[] serialise(final Map<String, Object> diff) {
try {
return writeValueAsBytes(diff); // default encoding is Charsets.UTF_8
return writeValueAsBytes(diff); // default encoding is StandardCharsets.UTF_8
} catch (final JsonProcessingException ex) {
throw new SerialisationException("Error during type diff serialisation.", ex);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import com.fasterxml.jackson.databind.*;
import com.fasterxml.jackson.databind.ser.DefaultSerializerProvider;
import com.fasterxml.jackson.databind.type.TypeFactory;
import com.google.common.base.Charsets;
import jakarta.inject.Inject;
import org.apache.commons.io.IOUtils;
import org.apache.logging.log4j.Logger;
Expand Down Expand Up @@ -34,6 +33,7 @@
import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.Modifier;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -225,10 +225,10 @@ public byte[] serialise(final Object obj) {
}

try {
// logger.debug("Serialised pretty JSON = |" + new String(writerWithDefaultPrettyPrinter().writeValueAsBytes(obj), Charsets.UTF_8) + "|.");
// logger.debug("Serialised pretty JSON = |" + new String(writerWithDefaultPrettyPrinter().writeValueAsBytes(obj), StandardCharsets.UTF_8) + "|.");
EntitySerialiser.getContext().reset();
final byte[] bytes = writeValueAsBytes(obj); // default encoding is Charsets.UTF_8
logger.debug("Serialised JSON = |" + new String(bytes, Charsets.UTF_8) + "|.");
final byte[] bytes = writeValueAsBytes(obj); // default encoding is StandardCharsets.UTF_8
logger.debug("Serialised JSON = |" + new String(bytes, StandardCharsets.UTF_8) + "|.");

return bytes;
} catch (final JsonProcessingException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import static org.apache.logging.log4j.LogManager.getLogger;
import static ua.com.fielden.platform.reflection.PropertyTypeDeterminator.stripIfNeeded;

import java.time.Duration;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;

import org.apache.logging.log4j.Logger;

Expand All @@ -27,7 +27,7 @@ public class TgSimpleDeserialisers extends SimpleDeserializers {
private static final Logger LOGGER = getLogger(TgSimpleDeserialisers.class);

private final transient TgJacksonModule module;
private final transient Cache<Class<?>,JsonDeserializer<?>> genClassDeserialisers = CacheBuilder.newBuilder().expireAfterAccess(10, TimeUnit.SECONDS).initialCapacity(1000).build();
private final transient Cache<Class<?>,JsonDeserializer<?>> genClassDeserialisers = CacheBuilder.newBuilder().expireAfterAccess(Duration.ofSeconds(10)).initialCapacity(1000).build();

public TgSimpleDeserialisers(final TgJacksonModule module) {
this.module = module;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import static org.apache.logging.log4j.LogManager.getLogger;
import static ua.com.fielden.platform.reflection.PropertyTypeDeterminator.stripIfNeeded;

import java.time.Duration;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;

import org.apache.logging.log4j.Logger;

Expand All @@ -26,7 +26,7 @@ public class TgSimpleSerialisers extends SimpleSerializers {
private static final Logger LOGGER = getLogger(TgSimpleSerialisers.class);

private final transient TgJacksonModule module;
public final transient Cache<Class<?>, JsonSerializer<?>> genClassSerialisers = CacheBuilder.newBuilder().expireAfterAccess(10, TimeUnit.SECONDS).initialCapacity(1000).build();
public final transient Cache<Class<?>, JsonSerializer<?>> genClassSerialisers = CacheBuilder.newBuilder().expireAfterAccess(Duration.ofSeconds(10)).initialCapacity(1000).build();

public TgSimpleSerialisers(final TgJacksonModule module) {
this.module = module;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@
import java.math.MathContext;
import java.math.RoundingMode;
import java.text.NumberFormat;
import java.time.Duration;
import java.util.*;
import java.util.Optional;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import java.util.stream.Stream;

Expand Down Expand Up @@ -67,9 +67,9 @@
public class EntityUtils {
private static final Logger logger = getLogger();

private static final Cache<Class<?>, Boolean> persistentTypes = CacheBuilder.newBuilder().expireAfterAccess(10, TimeUnit.SECONDS).initialCapacity(512).build();
private static final Cache<Class<?>, Boolean> syntheticTypes = CacheBuilder.newBuilder().expireAfterAccess(10, TimeUnit.SECONDS).initialCapacity(512).build();
private static final Cache<Class<?>, Boolean> entityCriteriaTypes = CacheBuilder.newBuilder().expireAfterAccess(10, TimeUnit.SECONDS).initialCapacity(512).build();
private static final Cache<Class<?>, Boolean> persistentTypes = CacheBuilder.newBuilder().expireAfterAccess(Duration.ofSeconds(10)).initialCapacity(512).build();
private static final Cache<Class<?>, Boolean> syntheticTypes = CacheBuilder.newBuilder().expireAfterAccess(Duration.ofSeconds(10)).initialCapacity(512).build();
private static final Cache<Class<?>, Boolean> entityCriteriaTypes = CacheBuilder.newBuilder().expireAfterAccess(Duration.ofSeconds(10)).initialCapacity(512).build();

public static final String ERR_PERSISTENT_NATURE_OF_ENTITY_TYPE = "Could not determine persistent nature of entity type [%s].";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
import java.io.InputStream;
import java.util.*;

import static com.google.common.base.Charsets.UTF_8;
import static java.lang.String.format;
import static java.nio.charset.StandardCharsets.UTF_8;
import static java.util.Collections.sort;
import static java.util.Optional.empty;
import static java.util.Optional.ofNullable;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import java.util.Set;
import java.util.function.Supplier;

import static com.google.common.base.Charsets.UTF_8;
import static java.nio.charset.StandardCharsets.UTF_8;
import static java.util.Optional.empty;
import static java.util.Optional.of;
import static org.restlet.data.MediaType.*;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package ua.com.fielden.platform.web.resources.webui;

import static com.google.common.base.Charsets.UTF_8;
import static java.nio.charset.StandardCharsets.UTF_8;
import static org.restlet.data.MediaType.TEXT_HTML;
import static ua.com.fielden.platform.web.resources.RestServerUtil.encodedRepresentation;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import org.restlet.representation.Representation;
import org.restlet.resource.Get;

import com.google.common.base.Charsets;
import java.nio.charset.StandardCharsets;

import ua.com.fielden.platform.entity.AbstractEntity;
import ua.com.fielden.platform.utils.IDates;
Expand Down Expand Up @@ -51,6 +51,6 @@ public MasterTestsComponentResource(
@Get
@Override
public Representation get() {
return new EncodeRepresentation(Encoding.GZIP, new InputRepresentation(new ByteArrayInputStream(master.render().toString().getBytes(Charsets.UTF_8)), MediaType.TEXT_HTML));
return new EncodeRepresentation(Encoding.GZIP, new InputRepresentation(new ByteArrayInputStream(master.render().toString().getBytes(StandardCharsets.UTF_8)), MediaType.TEXT_HTML));
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package ua.com.fielden.platform.web.resources.webui;

import static com.google.common.base.Charsets.UTF_8;
import static java.nio.charset.StandardCharsets.UTF_8;
import static org.restlet.data.MediaType.TEXT_JAVASCRIPT;
import static ua.com.fielden.platform.web.resources.RestServerUtil.encodedRepresentation;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
import ua.com.fielden.platform.web.annotations.AppUri;
import ua.com.fielden.platform.web.interfaces.IUserPreferencesProvider;

import java.time.Duration;
import java.util.List;
import java.util.Properties;
import java.util.concurrent.TimeUnit;

import static java.lang.String.format;

Expand Down Expand Up @@ -70,7 +70,7 @@ protected void configure() {
@Singleton
@SessionCache Cache<String, UserSession> provideSessionCache(final @UntrustedDeviceSessionDuration int untrustedDeviceSessionDurationMins) {
return CacheBuilder.newBuilder()
.expireAfterWrite(untrustedDeviceSessionDurationMins / 2, TimeUnit.MINUTES)
.expireAfterWrite(Duration.ofMinutes(untrustedDeviceSessionDurationMins / 2))
.build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import java.io.IOException;
import java.io.OutputStream;
import java.nio.file.DirectoryIteratorException;
import java.nio.charset.StandardCharsets;
import java.nio.file.DirectoryStream;
import java.nio.file.Files;
import java.nio.file.Path;
Expand All @@ -18,8 +19,6 @@
import java.util.List;
import java.util.Set;

import com.google.common.base.Charsets;

public class IronIconsetUtility {
public static final String FILE_BEGIN_TEMPLATE = "import '/resources/polymer/@polymer/iron-icon/iron-icon.js';%n" +
"import '/resources/polymer/@polymer/iron-iconset-svg/iron-iconset-svg.js';%n" +
Expand All @@ -39,7 +38,7 @@ public IronIconsetUtility(final String iconsetId, final int svgWidth, final Stri

public void createSvgIconset(final String outputFile) throws IOException {
try (OutputStream outputStream = new FileOutputStream(outputFile)) {
outputStream.write(joinFilesContent().getBytes(Charsets.UTF_8));
outputStream.write(joinFilesContent().getBytes(StandardCharsets.UTF_8));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ private CentreDiffSerialiser() {
*/
public byte[] serialise(final Map<String, Object> diff) {
try {
// logger.error("Serialised pretty JSON = |" + new String(writerWithDefaultPrettyPrinter().writeValueAsBytes(diff), Charsets.UTF_8) + "|.");
final byte[] bytes = writeValueAsBytes(diff); // default encoding is Charsets.UTF_8
// logger.error("Serialised pretty JSON = |" + new String(writerWithDefaultPrettyPrinter().writeValueAsBytes(diff), StandardCharsets.UTF_8) + "|.");
final byte[] bytes = writeValueAsBytes(diff); // default encoding is StandardCharsets.UTF_8
return bytes;
} catch (final JsonProcessingException ex) {
throw new SerialisationException("Error during centre diff serialisation.", ex);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;

import com.google.common.base.Charsets;
import java.nio.charset.StandardCharsets;

import ua.com.fielden.platform.svg.combining.IronIconsetUtility;

Expand All @@ -19,7 +18,7 @@ public static void main(final String[] args) throws IOException {
"</svg>";
for (int index = 1; index <= 9; index++) {
try (OutputStream outputStream = new FileOutputStream(format("src/main/resources/images/collapse-expand/number%s.svg", index))) {
outputStream.write(numberSvgTemplate.replace('@', (index + "").charAt(0)).getBytes(Charsets.UTF_8));
outputStream.write(numberSvgTemplate.replace('@', (index + "").charAt(0)).getBytes(StandardCharsets.UTF_8));
}
}

Expand Down
Loading