Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
Rugged-MOD
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
youngcle
Rugged-MOD
Commits
3f29812a
Commit
3f29812a
authored
8 years ago
by
Jonathan Guinet
Browse files
Options
Downloads
Patches
Plain Diff
add ruggedexception
parent
f938334f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/org/orekit/rugged/errors/RuggedMessages.java
+10
-6
10 additions, 6 deletions
src/main/java/org/orekit/rugged/errors/RuggedMessages.java
with
10 additions
and
6 deletions
src/main/java/org/orekit/rugged/errors/RuggedMessages.java
+
10
−
6
View file @
3f29812a
...
...
@@ -16,7 +16,6 @@
*/
package
org.orekit.rugged.errors
;
import
org.hipparchus.exception.Localizable
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.io.InputStreamReader
;
...
...
@@ -27,6 +26,8 @@ import java.util.MissingResourceException;
import
java.util.PropertyResourceBundle
;
import
java.util.ResourceBundle
;
import
org.hipparchus.exception.Localizable
;
/**
* Enumeration for localized messages formats.
...
...
@@ -78,7 +79,8 @@ public enum RuggedMessages implements Localizable {
UNKNOWN_TILE
(
"unknown tile {0}, line {1}, file {2}: {3}"
),
NO_PARAMETERS_SELECTED
(
"no parameters have been selected for estimation"
),
NO_REFERENCE_MAPPINGS
(
"no reference mappings for parameters estimation"
),
DUPLICATED_PARAMETER_NAME
(
"a different parameter with name {0} already exists"
);
DUPLICATED_PARAMETER_NAME
(
"a different parameter with name {0} already exists"
),
INVALID_RUGGED_NAME
(
"invalid rugged name."
);
// CHECKSTYLE: resume JavadocVariable check
...
...
@@ -97,20 +99,22 @@ public enum RuggedMessages implements Localizable {
}
/** {@inheritDoc} */
@Override
public
String
getSourceString
()
{
return
sourceFormat
;
}
/** {@inheritDoc} */
@Override
public
String
getLocalizedString
(
final
Locale
locale
)
{
try
{
final
ResourceBundle
bundle
=
ResourceBundle
.
getBundle
(
RESOURCE_BASE_NAME
,
locale
,
new
UTF8Control
());
ResourceBundle
.
getBundle
(
RESOURCE_BASE_NAME
,
locale
,
new
UTF8Control
());
if
(
bundle
.
getLocale
().
getLanguage
().
equals
(
locale
.
getLanguage
()))
{
final
String
translated
=
bundle
.
getString
(
name
());
if
((
translated
!=
null
)
&&
(
translated
.
length
()
>
0
)
&&
(!
translated
.
toLowerCase
().
contains
(
"missing translation"
)))
{
(
translated
.
length
()
>
0
)
&&
(!
translated
.
toLowerCase
().
contains
(
"missing translation"
)))
{
// the value of the resource is the translated format
return
translated
;
}
...
...
@@ -139,7 +143,7 @@ public enum RuggedMessages implements Localizable {
@Override
public
ResourceBundle
newBundle
(
final
String
baseName
,
final
Locale
locale
,
final
String
format
,
final
ClassLoader
loader
,
final
boolean
reload
)
throws
IllegalAccessException
,
InstantiationException
,
IOException
{
throws
IllegalAccessException
,
InstantiationException
,
IOException
{
// The below is a copy of the default implementation.
final
String
bundleName
=
toBundleName
(
baseName
,
locale
);
final
String
resourceName
=
toResourceName
(
bundleName
,
"utf8"
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment