Skip to content

Commit

Permalink
Mark methods and constructor as deprecated
Browse files Browse the repository at this point in the history
- Mark the methods and the constructor as deprecated for future changes in the 2.0.0 release.
  • Loading branch information
alaugks committed Apr 5, 2024
1 parent 42abbbd commit 03b3d11
Show file tree
Hide file tree
Showing 8 changed files with 60 additions and 33 deletions.
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ This package provides a **MessageSource** for using translations from XLIFF file
<a name="a1"></a>
## 1. Versions

| Version | Description |
|:---------------|:------------------------------------------------------------------------------------------|
| 2.0.0-SNAPSHOT | [SNAPSHOT](https://github.com/alaugks/spring-messagesource-xliff/tree/snapshot/2.0.0) |
| 1.2.0 | [Release notes](https://github.com/alaugks/spring-messagesource-xliff/releases/tag/1.2.0) |
| 1.1.2 | [Release notes](https://github.com/alaugks/spring-messagesource-xliff/releases/tag/1.1.2) |
| 1.1.1 | [Release notes](https://github.com/alaugks/spring-messagesource-xliff/releases/tag/1.1.1) |
| 1.1.0 | [Release notes](https://github.com/alaugks/spring-messagesource-xliff/releases/tag/1.1.0) |
| 1.0.0 | First public version |

| Version | Description |
|:--------|:------------------------------------------------------------------------------------------|
| 1.1.2 | [Release notes](https://github.com/alaugks/spring-messagesource-xliff/releases/tag/1.1.2) |
| 1.1.1 | [Release notes](https://github.com/alaugks/spring-messagesource-xliff/releases/tag/1.1.1) |
| 1.1.0 | [Release notes](https://github.com/alaugks/spring-messagesource-xliff/releases/tag/1.1.0) |
| 1.0.0 | First public version |


[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=alaugks_spring-xliff-translation&metric=alert_status)](https://sonarcloud.io/summary/overall?id=alaugks_spring-xliff-translation) [![Maven Central](https://img.shields.io/maven-central/v/io.github.alaugks/spring-messagesource-xliff.svg?label=Maven%20Central)](https://central.sonatype.com/artifact/io.github.alaugks/spring-messagesource-xliff/1.1.2)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=alaugks_spring-xliff-translation&metric=alert_status)](https://sonarcloud.io/summary/overall?id=alaugks_spring-xliff-translation) [![Maven Central](https://img.shields.io/maven-central/v/io.github.alaugks/spring-messagesource-xliff.svg?label=Maven%20Central)](https://central.sonatype.com/artifact/io.github.alaugks/spring-messagesource-xliff/1.2.0)


<a name="a2"></a>
Expand All @@ -39,13 +39,13 @@ This package provides a **MessageSource** for using translations from XLIFF file
<dependency>
<groupId>io.github.alaugks</groupId>
<artifactId>spring-messagesource-xliff</artifactId>
<version>1.1.2</version>
<version>1.2.0</version>
</dependency>
```

**Gradle**
```text
implementation group: 'io.github.alaugks', name: 'spring-messagesource-xliff', version: '1.1.2'
implementation group: 'io.github.alaugks', name: 'spring-messagesource-xliff', version: '1.2.0'
```


Expand Down
6 changes: 0 additions & 6 deletions docker-compose.yml

This file was deleted.

2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>io.github.alaugks</groupId>
<artifactId>spring-messagesource-xliff</artifactId>
<version>1.1.2</version>
<version>1.2.0</version>
<packaging>jar</packaging>

<name>${project.groupId}:${project.artifactId}</name>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
package io.github.alaugks.spring.messagesource.xliff;

import io.github.alaugks.spring.messagesource.xliff.catalog.CatalogUtilities;
import org.springframework.cache.interceptor.KeyGenerator;

import java.lang.reflect.Method;
import java.util.Locale;
import org.springframework.cache.interceptor.KeyGenerator;

/**
* @deprecated
*/
@Deprecated(since = "2.0.0")
@SuppressWarnings({"java:S1133"})
public final class XliffCacheableKeyGenerator implements KeyGenerator {

public static final String GENERATOR_NAME = "messagesource.xliff.KEY_GENERATOR";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,27 @@
import io.github.alaugks.spring.messagesource.xliff.catalog.xliff.XliffCatalogBuilder;
import io.github.alaugks.spring.messagesource.xliff.ressources.ResourcesLoader;
import io.github.alaugks.spring.messagesource.xliff.ressources.ResourcesLoaderInterface;
import java.text.MessageFormat;
import java.util.List;
import java.util.Locale;
import org.springframework.cache.CacheManager;
import org.springframework.context.MessageSource;
import org.springframework.context.MessageSourceResolvable;
import org.springframework.context.NoSuchMessageException;
import org.springframework.context.support.DefaultMessageSourceResolvable;
import org.springframework.lang.Nullable;

import java.text.MessageFormat;
import java.util.List;
import java.util.Locale;

@SuppressWarnings("java:S1133")
public class XliffTranslationMessageSource implements MessageSource {

private final CatalogWrapper catalogWrapper;
private final ResourcesLoaderInterface resourcesLoader = new ResourcesLoader();
private final XliffCatalogBuilder xliffCatalogBuilder = new XliffCatalogBuilder();

/**
* @deprecated
*/
@Deprecated(since = "2.0.0")
public XliffTranslationMessageSource(CacheManager cacheManager) {
this.catalogWrapper = new CatalogWrapper(
cacheManager,
Expand All @@ -31,26 +35,46 @@ public XliffTranslationMessageSource(CacheManager cacheManager) {
);
}

/**
* @deprecated
*/
@Deprecated(since = "2.0.0")
public XliffTranslationMessageSource setDefaultLocale(Locale locale) {
this.resourcesLoader.setDefaultLocale(locale);
return this;
}

/**
* @deprecated
*/
@Deprecated(since = "2.0.0")
public XliffTranslationMessageSource setBasenamePattern(String basename) {
this.resourcesLoader.setBasenamePattern(basename);
return this;
}

/**
* @deprecated
*/
@Deprecated(since = "2.0.0")
public XliffTranslationMessageSource setBasenamesPattern(Iterable<String> basenames) {
this.resourcesLoader.setBasenamesPattern(basenames);
return this;
}

/**
* @deprecated
*/
@Deprecated(since = "2.0.0")
public XliffTranslationMessageSource setDefaultDomain(String defaultDomain) {
this.catalogWrapper.setDefaultDomain(defaultDomain);
return this;
}

/**
* @deprecated
*/
@Deprecated(since = "2.0.0")
public XliffTranslationMessageSource setTranslationUnitIdentifiersOrdering(List<String> translationUnitIdentifiers) {
this.xliffCatalogBuilder.setTranslationUnitIdentifiersOrdering(translationUnitIdentifiers);
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,22 @@
import io.github.alaugks.spring.messagesource.xliff.XliffCacheableKeyGenerator;
import io.github.alaugks.spring.messagesource.xliff.XliffTranslationMessageSource;
import io.github.alaugks.spring.messagesource.xliff.exception.XliffMessageSourceCacheNotExistsException;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.cache.Cache;
import org.springframework.cache.CacheManager;

import java.util.Collection;
import java.util.HashMap;
import java.util.Locale;
import java.util.Objects;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.cache.Cache;
import org.springframework.cache.CacheManager;

@SuppressWarnings({"java:S5738", "java:S1874", "java:S1133"})
public final class CatalogCache implements CatalogInterface {

/**
* @deprecated
*/
@Deprecated(since = "2.0.0")
public static final String CACHE_NAME = "messagesource.xliff.catalog.CACHE";

private static final Logger logger = LogManager.getLogger(XliffTranslationMessageSource.class.toString());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package io.github.alaugks.spring.messagesource.xliff;

import org.junit.jupiter.api.BeforeAll;

import java.util.Locale;
import org.junit.jupiter.api.BeforeAll;

@SuppressWarnings({"java:S2187"})
class XliffMatchingResourcePatternResolverInitCacheTest extends XliffMatchingResourcePatternResolverAbstract {

@BeforeAll
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package io.github.alaugks.spring.messagesource.xliff;

import org.junit.jupiter.api.BeforeAll;

import java.util.Locale;
import org.junit.jupiter.api.BeforeAll;

@SuppressWarnings({"java:S2187"})
class XliffMatchingResourcePatternResolverTest extends XliffMatchingResourcePatternResolverAbstract {

@BeforeAll
Expand Down

0 comments on commit 03b3d11

Please sign in to comment.