• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

openmrs / openmrs-core / 14752386992

30 Apr 2025 10:25AM UTC coverage: 64.96% (-0.1%) from 65.095%
14752386992

push

github

web-flow
TRUNK-6316 Upgrade Hibernate Search to 6.2.4 (#5005)

501 of 591 new or added lines in 24 files covered. (84.77%)

21 existing lines in 6 files now uncovered.

23344 of 35936 relevant lines covered (64.96%)

0.65 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

50.0
/api/src/main/java/org/openmrs/api/db/hibernate/search/bridge/LocaleValueBridge.java
1
/**
2
 * This Source Code Form is subject to the terms of the Mozilla Public License,
3
 * v. 2.0. If a copy of the MPL was not distributed with this file, You can
4
 * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under
5
 * the terms of the Healthcare Disclaimer located at http://openmrs.org/license.
6
 *
7
 * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS
8
 * graphic logo is a trademark of OpenMRS Inc.
9
 */
10
package org.openmrs.api.db.hibernate.search.bridge;
11

12
import java.util.Locale;
13

14
import org.apache.commons.lang.LocaleUtils;
15
import org.hibernate.search.mapper.pojo.bridge.ValueBridge;
16
import org.hibernate.search.mapper.pojo.bridge.runtime.ValueBridgeFromIndexedValueContext;
17
import org.hibernate.search.mapper.pojo.bridge.runtime.ValueBridgeToIndexedValueContext;
18

19
/**
20
 * Indexes {@link java.util.Locale} as string.
21
 * 
22
 * @since 2.8.0
23
 */
24
public class LocaleValueBridge implements ValueBridge<Locale, String> {
1✔
25

26
        @Override
27
        public String toIndexedValue(Locale locale, ValueBridgeToIndexedValueContext valueBridgeToIndexedValueContext) {
28
                return locale.toString();
1✔
29
        }
30

31
        @Override
32
        public Locale fromIndexedValue(String value, ValueBridgeFromIndexedValueContext context) {
NEW
33
                return value == null ? null : LocaleUtils.toLocale(value);
×
34
        }
35

36
        @Override
37
        public String parse(String value) {
NEW
38
                return LocaleUtils.toLocale(value).toString();
×
39
        }
40
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc