Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HV-1974 Upgrade to forbiddenapis 3.7 + update gmavenplus plugin #1344

Closed
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 @@ -200,7 +200,7 @@ public void testUserResourceBundle() {
String actual = interpolator.interpolate(
notNullDescriptor.getAnnotation().message(),
messageInterpolatorContext,
new Locale( "es", "ES" )
Locale.forLanguageTag( "es-ES" )
);
assertEquals( actual, expected, "Wrong substitution" );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public void decapitalizeShouldReturnDecapizalizedWord() {
@TestForIssue(jiraKey = "HV-1140")
public void decapitalizeShouldReturnDecapizalizedWordOnTurkishLocale() {
Locale defaultLocale = Locale.getDefault();
Locale.setDefault( new Locale( "tr" , "TR" ) );
Locale.setDefault( Locale.forLanguageTag( "tr-TR" ) );
assertEquals( StringHelper.decapitalize( "IsIsolationLevelGuaranteed" ), "isIsolationLevelGuaranteed" );
Locale.setDefault( defaultLocale );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import org.hibernate.validator.HibernateValidatorConfiguration;
import org.hibernate.validator.cfg.ConstraintDef;
import org.hibernate.validator.cfg.ConstraintMapping;
import org.hibernate.validator.internal.IgnoreForbiddenApisErrors;
import org.hibernate.validator.testutils.ValidatorUtil;

import jakarta.validation.Constraint;
Expand Down Expand Up @@ -191,6 +192,7 @@ public boolean isValid(Object value, ConstraintValidatorContext context) {
* A classloader that allows to use a `META-INF/services/jakarta.validation.ConstraintValidator`
* defined in the tests rather than reading it from an actual file.
*/
@IgnoreForbiddenApisErrors(reason = "Need a Java 20 API to create URLs with a custom handler.")
private static class ServiceLoaderTestingClassLoader extends SecureClassLoader {

private static final String SERVICE_FILE = "META-INF/services/" + ConstraintValidator.class.getName();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class LocaleResolverTest {

@Test
public void testLanguageRangeSupport() throws NoSuchMethodException, SecurityException {
ValidatorFactory validatorFactory = getValidatorFactoryWithInitializedLocales( Locale.FRANCE, new Locale( "es", "ES" ) );
ValidatorFactory validatorFactory = getValidatorFactoryWithInitializedLocales( Locale.FRANCE, Locale.forLanguageTag( "es-ES" ) );
MessageInterpolator messageInterpolator = validatorFactory.getMessageInterpolator();

StaticFieldLocaleResolver.acceptLanguage = "fr-FR,fr;q=0.9";
Expand All @@ -53,7 +53,7 @@ public void testCascadePriorities() {
@Test
public void testFallbackToDefault() throws NoSuchMethodException, SecurityException {
// Defaults to en when we don't define a default as we launch Surefire with the en locale
ValidatorFactory validatorFactory = getValidatorFactoryWithInitializedLocales( new Locale( "es", "ES" ) );
ValidatorFactory validatorFactory = getValidatorFactoryWithInitializedLocales( Locale.forLanguageTag( "es-ES" ) );
MessageInterpolator messageInterpolator = validatorFactory.getMessageInterpolator();

StaticFieldLocaleResolver.acceptLanguage = "hr-HR,hr;q=0.9";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public void testUnavailableInitializedLocale() {
Locale defaultLocale = Locale.getDefault();

try {
Locale georgianLocale = new Locale( "ka", "GE" );
Locale georgianLocale = Locale.forLanguageTag( "ka-GE" );

Locale.setDefault( georgianLocale );

Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,8 @@
<version.depends.plugin>1.4.0</version.depends.plugin>
<version.deploy.plugin>2.8.2</version.deploy.plugin>
<version.enforcer.plugin>3.0.0</version.enforcer.plugin>
<version.forbiddenapis.plugin>3.2</version.forbiddenapis.plugin>
<version.gmavenplus.plugin>1.6</version.gmavenplus.plugin>
<version.forbiddenapis.plugin>3.7</version.forbiddenapis.plugin>
<version.gmavenplus.plugin>3.0.2</version.gmavenplus.plugin>
<version.gpg.plugin>3.0.1</version.gpg.plugin>
<version.install.plugin>2.5.2</version.install.plugin>
<version.japicmp.plugin>0.11.0</version.japicmp.plugin>
Expand Down