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

ThymeleafTemplateEngineImpl.WebIContext Locale bug introduced in 3.1 #226

Closed
dragan088 opened this issue Oct 16, 2015 · 6 comments
Closed
Assignees

Comments

@dragan088
Copy link

Hi there,

After upgrading to version 3.1 I started getting NullPointerException and narrow it down to the code that creates a new Locale object. I'm using Thymeleaf template engine.

private WebIContext(VariablesMap<String, Object> data, io.vertx.ext.web.Locale locale) {
this.data = data;
this.locale = new Locale(locale.language(), locale.country(), locale.variant());
}

Standard Java Locale will throw NPE if country or variants are null, but will happily take an empty string. Maybe vert.x's own Locale should convert and use empty string rather than nulls for country and variant.

Thanks

Dragan

@pmlopes pmlopes self-assigned this Oct 20, 2015
pmlopes added a commit that referenced this issue Oct 21, 2015
Fixes #226: use default empty string for locale country and variant
@pmlopes pmlopes removed the to review label Oct 21, 2015
@ieugen
Copy link

ieugen commented Oct 26, 2015

Cool. Do you release maintenance versions?

@goerge
Copy link

goerge commented Nov 17, 2015

We're also hit but this bug. Any plans, when to release 3.1.1 with this fix included? Thanks.

@vietj
Copy link
Contributor

vietj commented Nov 17, 2015

we plan a 3.2 release within a couple of weeks.

@ieugen
Copy link

ieugen commented Nov 17, 2015

Cool. However if you have apps in production it's not OK to upgrade just like that. A maintenance version that does not include new feauters, just bug fixes is a nice thing to have. You can upgrade without too many issues.

@ieugen
Copy link

ieugen commented Nov 17, 2015

@goerge I've fixed it by copy pasting the class and using my own version until the release is there: https://gist.github.com/ieugen/56a1da25281702f732e6

@eshkel
Copy link

eshkel commented Mar 10, 2017

that seems not fixed for all cases, I've got NPE in 3.4.0 for ParsableLanguageValue.parsedValues = '[ru]' .

@pmlopes pmlopes reopened this Mar 13, 2017
pmlopes added a commit that referenced this issue Mar 13, 2017
Fix #226: do not assume country is always provided
@pmlopes pmlopes removed the to review label Mar 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

6 participants