Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
LanguageFileCompare
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Jira
Jira
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
測試專案
LanguageFileCompare
Commits
4be171ae
Commit
4be171ae
authored
Nov 27, 2018
by
王品堯
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
format, 簡化log資訊
parent
37e468dc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
src/main/java/JsonFileCompare.java
src/main/java/JsonFileCompare.java
+6
-2
No files found.
src/main/java/JsonFileCompare.java
View file @
4be171ae
...
@@ -30,7 +30,8 @@ public class JsonFileCompare {
...
@@ -30,7 +30,8 @@ public class JsonFileCompare {
}
}
}
}
private
static
void
addKeys
(
String
currentPath
,
JsonNode
jsonNode
,
Set
<
String
>
set
,
List
<
Integer
>
suffix
)
{
private
static
void
addKeys
(
String
currentPath
,
JsonNode
jsonNode
,
Set
<
String
>
set
,
List
<
Integer
>
suffix
)
{
if
(
jsonNode
.
isObject
())
{
if
(
jsonNode
.
isObject
())
{
ObjectNode
objectNode
=
(
ObjectNode
)
jsonNode
;
ObjectNode
objectNode
=
(
ObjectNode
)
jsonNode
;
Iterator
<
Map
.
Entry
<
String
,
JsonNode
>>
iter
=
objectNode
.
fields
();
Iterator
<
Map
.
Entry
<
String
,
JsonNode
>>
iter
=
objectNode
.
fields
();
...
@@ -66,7 +67,10 @@ public class JsonFileCompare {
...
@@ -66,7 +67,10 @@ public class JsonFileCompare {
.
filter
(
key
->
!
targetSet
.
contains
(
key
))
.
filter
(
key
->
!
targetSet
.
contains
(
key
))
.
collect
(
Collectors
.
toSet
());
.
collect
(
Collectors
.
toSet
());
if
(!
missingKey
.
isEmpty
())
{
if
(!
missingKey
.
isEmpty
())
{
log
.
error
(
"Missing Key on {} \n Missing Keys: {}"
,
targetPath
,
missingKey
.
stream
().
sorted
().
collect
(
Collectors
.
toList
()));
log
.
error
(
"Missing Key on {} \nMissing Keys: {}"
,
targetPath
.
getFileName
(),
missingKey
.
stream
().
sorted
().
collect
(
Collectors
.
toList
()));
System
.
exit
(
1
);
System
.
exit
(
1
);
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment