Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Antti Väyrynen
/
Moya
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit dcb02092
authored
Oct 23, 2014
by
Tuomas Riihimäki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Logitusta ja nullcheck
1 parent
d51c2a0b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
5 deletions
code/moya-ear/pom.xml
code/moya-web/src/main/java/fi/codecrew/moya/web/cdiview/reader/ReaderNameContainer.java
code/moya-ear/pom.xml
View file @
dcb0209
...
...
@@ -56,6 +56,11 @@
<version>
${moya.version}
</version>
<type>
war
</type>
</dependency>
<dependency>
<groupId>
org.slf4j
</groupId>
<artifactId>
slf4j-jdk14
</artifactId>
<version>
1.7.7
</version>
</dependency>
</dependencies>
...
...
code/moya-web/src/main/java/fi/codecrew/moya/web/cdiview/reader/ReaderNameContainer.java
View file @
dcb0209
...
...
@@ -62,20 +62,20 @@ public class ReaderNameContainer implements Serializable {
* to set, or null to clear all readers
*/
public
void
setReaderId
(
Integer
readerId
)
{
if
(
readerId
==
null
)
if
(
readerId
==
null
)
{
clearReaders
();
return
;
}
if
(
getReaders
().
isEmpty
())
{
getReaders
().
add
(
readerId
);
}
else
{
Integer
replacedItem
=
getReaders
().
set
(
0
,
readerId
);
logger
.
warn
(
"Replaced item {} wit {}"
,
readerId
,
replacedItem
);
getReaders
().
set
(
0
,
readerId
);
}
}
public
void
addReader
(
Integer
readerId
)
{
if
(!
getReaders
().
contains
(
readerId
))
{
if
(
readerId
!=
null
&&
!
getReaders
().
contains
(
readerId
))
{
getReaders
().
add
(
readerId
);
}
}
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment