Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Max Mecklin
/
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 5443d00e
authored
Sep 14, 2014
by
Tuomas Riihimäki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Findbugs found some stuff.
1 parent
3600a0f0
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
8 additions
and
9 deletions
code/moya-beans/ejbModule/fi/codecrew/moya/beans/ReaderBean.java
code/moya-beans/ejbModule/fi/codecrew/moya/beans/UserBean.java
code/moya-utils/src/main/java/fi/codecrew/moya/utilities/JsonUtils.java
code/moya-web/src/main/java/fi/codecrew/moya/rest/NetworkAssociationRestView.java
code/moya-web/src/main/java/fi/codecrew/moya/web/cdiview/reader/ReaderView.java
code/moya-web/src/main/java/fi/codecrew/moya/web/lecture/LectureReportsView.java
code/moya-beans/ejbModule/fi/codecrew/moya/beans/ReaderBean.java
View file @
5443d00
...
...
@@ -107,7 +107,7 @@ public class ReaderBean implements ReaderBeanLocal {
{
ReaderEvent
lastevent
=
lastevents
.
get
(
0
);
if
(
lastevent
.
getValue
()
==
event
.
getValue
(
)
&&
(
lastevent
.
getUpdatetime
().
getTime
()
+
60000
l
)
>
event
.
getTime
().
getTime
())
{
if
(
lastevent
.
getValue
()
.
equals
(
event
.
getValue
()
)
&&
(
lastevent
.
getUpdatetime
().
getTime
()
+
60000
l
)
>
event
.
getTime
().
getTime
())
{
lastevent
=
readerEventFacade
.
reload
(
lastevent
);
lastevent
=
readerEventFacade
.
merge
(
lastevent
);
...
...
code/moya-beans/ejbModule/fi/codecrew/moya/beans/UserBean.java
View file @
5443d00
...
...
@@ -979,7 +979,7 @@ public class UserBean implements UserBeanLocal {
logger
.
info
(
"Catched exeption {}"
,
ex
.
getMessage
());
}
if
(
hash
!=
""
&&
hash
.
length
()
>
2
)
{
if
(
!
hash
.
isEmpty
()
&&
hash
.
length
()
>
2
)
{
// Generating code by concatenating hex string and first 3
// characters from hash
code
=
code
.
concat
(
hex
);
...
...
code/moya-utils/src/main/java/fi/codecrew/moya/utilities/JsonUtils.java
View file @
5443d00
...
...
@@ -52,13 +52,12 @@ public class JsonUtils {
* The value associate to the key
* @return JsonObject with the key:value pair added
*/
public
static
JsonObject
assocJsonObject
(
JsonObject
jsonObject
,
String
key
,
JsonValue
value
)
{
public
static
JsonObject
assocJsonObject
(
JsonObject
jsonObject
,
String
key
,
JsonValue
value
)
{
JsonObjectBuilder
builder
=
Json
.
createObjectBuilder
();
// Copy all non conflicting json entries
for
(
Map
.
Entry
<
String
,
JsonValue
>
v
:
jsonObject
.
entrySet
())
{
if
(
v
.
getKey
()
!=
key
)
{
if
(
v
.
getKey
()
.
equals
(
key
)
)
{
builder
=
builder
.
add
(
v
.
getKey
(),
v
.
getValue
());
}
}
...
...
code/moya-web/src/main/java/fi/codecrew/moya/rest/NetworkAssociationRestView.java
View file @
5443d00
...
...
@@ -50,7 +50,7 @@ public class NetworkAssociationRestView {
resp
.
getPendings
().
add
(
new
NetworkAssociationActionPojo
(
na
.
getIP
(),
na
.
getMAC
()));
}
catch
(
Exception
e
)
{
resp
.
getResult
().
setResultCode
(
0
);
if
(
e
.
getMessage
()
!=
null
&&
e
.
getMessage
()
!=
""
)
{
if
(
e
.
getMessage
()
!=
null
&&
!
e
.
getMessage
().
isEmpty
()
)
{
resp
.
getResult
().
setMessage
(
e
.
getMessage
());
}
else
{
resp
.
getResult
().
setMessage
(
"UNKNOWN_ERROR"
);
...
...
@@ -81,7 +81,7 @@ public class NetworkAssociationRestView {
resp
.
getPendings
().
add
(
new
NetworkAssociationActionPojo
(
na
.
getIP
(),
na
.
getMAC
()));
}
catch
(
Exception
e
)
{
resp
.
getResult
().
setResultCode
(
0
);
if
(
e
.
getMessage
()
!=
null
&&
e
.
getMessage
()
!=
""
)
{
if
(
e
.
getMessage
()
!=
null
&&
!
e
.
getMessage
().
isEmpty
()
)
{
resp
.
getResult
().
setMessage
(
e
.
getMessage
());
}
else
{
resp
.
getResult
().
setMessage
(
"UNKNOWN_ERROR"
);
...
...
code/moya-web/src/main/java/fi/codecrew/moya/web/cdiview/reader/ReaderView.java
View file @
5443d00
...
...
@@ -284,7 +284,7 @@ public class ReaderView extends GenericCDIView {
if
(
lastReadEvent
==
null
||
lastReadEvent
.
getId
()
==
null
)
return
true
;
return
(
newEvent
.
getId
()
!=
lastReadEvent
.
getId
(
));
return
(
newEvent
.
getId
()
.
equals
(
lastReadEvent
.
getId
()
));
}
...
...
code/moya-web/src/main/java/fi/codecrew/moya/web/lecture/LectureReportsView.java
View file @
5443d00
...
...
@@ -113,7 +113,7 @@ public class LectureReportsView extends GenericCDIView {
// sometimes you just are lazy
for
(
EventUser
user
:
getCurrentLecture
().
getParticipants
())
{
if
(
user
.
getId
()
==
userId
)
{
if
(
user
.
getId
()
.
equals
(
userId
)
)
{
lectureBean
.
unparticipate
(
user
,
getCurrentLecture
());
break
;
}
...
...
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