Toggle navigation
Toggle navigation
This project
Loading...
Sign in
grogv3
/
grog-cubi
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Jean-Francois Leveque
2017-04-05 10:36:32 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
ef9136988448bff254f67ef54300d1005c008f53
ef913698
1 parent
8208c84f
Correction étourderie (NPE), traces supplémentaires et logger.error à la place de printStackTrace
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
9 deletions
grog-recommendation/grog-recommendation-postprocess/src/main/java/org/legrog/recommendation/postprocess/PostprocessingApplication.java
grog-recommendation/grog-recommendation-postprocess/src/main/java/org/legrog/recommendation/postprocess/PostprocessingApplication.java
View file @
ef91369
...
...
@@ -68,12 +68,11 @@ public class PostprocessingApplication {
sampleItemIds
.
add
(
itemId
);
sampleUserIds
.
add
(
userId
);
if
(!
sampleItemUserIds
.
containsKey
(
itemId
))
{
Set
<
Long
>
set
=
sampleItemUserIds
.
get
(
itemId
);
// NPE !!!
Set
<
Long
>
set
=
new
HashSet
<>();
set
.
add
(
userId
);
sampleItemUserIds
.
put
(
itemId
,
set
);
}
else
{
Set
<
Long
>
set
=
new
HashSet
<>(
);
Set
<
Long
>
set
=
sampleItemUserIds
.
get
(
itemId
);
set
.
add
(
userId
);
sampleItemUserIds
.
put
(
itemId
,
set
);
}
...
...
@@ -87,10 +86,10 @@ public class PostprocessingApplication {
}
logger
.
trace
(
"Nombre de couples item-user dans l'échantillon {}"
,
sampleCoupleCount
);
logger
.
trace
(
"Nombre de couples item-user recommandables {}"
,
sampleItemIds
.
size
()
*
sampleUserIds
.
size
()
-
sampleCoupleCount
);
}
catch
(
IOException
e
)
{
//fixme use logger instead of e.printStackTrace() !!!
e
.
printStackTrace
();
logger
.
error
(
"analyzeSample IOException : {}"
,
e
.
getStackTrace
());
}
}
...
...
@@ -112,8 +111,6 @@ public class PostprocessingApplication {
void
loadParametersProperties
()
{
//fixme use logger instead of e.printStackTrace() !!!
Properties
properties
=
new
Properties
();
InputStream
in
=
null
;
try
{
...
...
@@ -122,9 +119,9 @@ public class PostprocessingApplication {
properties
.
load
(
in
);
in
.
close
();
}
catch
(
FileNotFoundException
e
)
{
e
.
printStackTrace
(
);
logger
.
error
(
"analyzeSample FileNotFoundException : {}"
,
e
.
getStackTrace
()
);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
(
);
logger
.
error
(
"analyzeSample IOException : {}"
,
e
.
getStackTrace
()
);
}
this
.
properties
=
properties
;
...
...
Please
register
or
login
to post a comment