Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
OLAT CI-CD Testing Project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor 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
Lars Oliver Dam
OLAT CI-CD Testing Project
Commits
e0a12aee
Commit
e0a12aee
authored
11 years ago
by
srosse
Browse files
Options
Downloads
Patches
Plain Diff
OO-948: remove the synchronized in i18nManager, rely on ConcurrentHashMap for it
parent
f906df89
No related branches found
No related tags found
No related merge requests found
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/org/olat/core/util/AlwaysEmptyMap.java
+39
-7
39 additions, 7 deletions
src/main/java/org/olat/core/util/AlwaysEmptyMap.java
src/main/java/org/olat/core/util/i18n/I18nManager.java
+177
-178
177 additions, 178 deletions
src/main/java/org/olat/core/util/i18n/I18nManager.java
with
216 additions
and
185 deletions
src/main/java/org/olat/core/util/AlwaysEmptyMap.java
+
39
−
7
View file @
e0a12aee
...
...
@@ -23,6 +23,7 @@ import java.util.Collection;
import
java.util.HashSet
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.concurrent.ConcurrentMap
;
/**
* <h3>Description:</h3>
...
...
@@ -34,54 +35,85 @@ import java.util.Set;
*
* @author Florian Gnaegi, frentix GmbH, http://www.frentix.com
*/
public
class
AlwaysEmptyMap
<
K
,
V
>
implements
Map
<
K
,
V
>
{
public
class
AlwaysEmptyMap
<
K
,
V
>
implements
Concurrent
Map
<
K
,
V
>
{
@Override
public
void
clear
()
{
// nothing to do
}
public
boolean
containsKey
(
@SuppressWarnings
(
"unused"
)
Object
key
)
{
@Override
public
boolean
containsKey
(
Object
key
)
{
return
false
;
}
public
boolean
containsValue
(
@SuppressWarnings
(
"unused"
)
Object
value
)
{
@Override
public
boolean
containsValue
(
Object
value
)
{
return
false
;
}
@Override
public
Set
<
java
.
util
.
Map
.
Entry
<
K
,
V
>>
entrySet
()
{
return
new
HashSet
<
java
.
util
.
Map
.
Entry
<
K
,
V
>>();
}
public
V
get
(
@SuppressWarnings
(
"unused"
)
Object
key
)
{
@Override
public
V
get
(
Object
key
)
{
return
null
;
}
@Override
public
boolean
isEmpty
()
{
return
true
;
}
@Override
public
Set
<
K
>
keySet
()
{
return
new
HashSet
<
K
>();
}
public
V
put
(
@SuppressWarnings
(
"unused"
)
K
key
,
@SuppressWarnings
(
"unused"
)
V
value
)
{
@Override
public
V
put
(
K
key
,
V
value
)
{
return
null
;
}
public
void
putAll
(
@SuppressWarnings
(
"unused"
)
Map
<?
extends
K
,
?
extends
V
>
t
)
{
@Override
public
void
putAll
(
Map
<?
extends
K
,
?
extends
V
>
t
)
{
// nothing to do
}
public
V
remove
(
@SuppressWarnings
(
"unused"
)
Object
key
)
{
@Override
public
V
remove
(
Object
key
)
{
return
null
;
}
@Override
public
int
size
()
{
return
0
;
}
@Override
public
Collection
<
V
>
values
()
{
return
new
HashSet
<
V
>();
}
@Override
public
V
putIfAbsent
(
K
key
,
V
value
)
{
return
null
;
}
@Override
public
boolean
remove
(
Object
key
,
Object
value
)
{
return
false
;
}
@Override
public
boolean
replace
(
K
key
,
V
oldValue
,
V
newValue
)
{
return
false
;
}
@Override
public
V
replace
(
K
key
,
V
value
)
{
return
null
;
}
}
This diff is collapsed.
Click to expand it.
src/main/java/org/olat/core/util/i18n/I18nManager.java
+
177
−
178
View file @
e0a12aee
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