Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
vadere
vadere
Commits
ecbfd11a
Commit
ecbfd11a
authored
Jul 25, 2018
by
Stefan Schuhbaeck
Browse files
remove unneeded exception handling
parent
e85cb91f
Changes
2
Hide whitespace changes
Inline
Side-by-side
VadereSimulator/src/org/vadere/simulator/projects/migration/JoltMigrationAssistant.java
View file @
ecbfd11a
...
@@ -112,12 +112,7 @@ public class JoltMigrationAssistant extends MigrationAssistant {
...
@@ -112,12 +112,7 @@ public class JoltMigrationAssistant extends MigrationAssistant {
}
}
public
JsonNode
transform
(
JsonNode
currentJson
,
Version
targetVersion
)
throws
MigrationException
{
public
JsonNode
transform
(
JsonNode
currentJson
,
Version
targetVersion
)
throws
MigrationException
{
try
{
return
transform
(
StateJsonConverter
.
convertJsonNodeToObject
(
currentJson
),
targetVersion
);
return
transform
(
StateJsonConverter
.
convertJsonNodeToObject
(
currentJson
),
targetVersion
);
}
catch
(
IOException
e
)
{
logger
.
error
(
"Error in converting JsonNode To Map of Object representation"
);
throw
new
MigrationException
(
"Error in converting JsonNode To Map of Object representation"
,
e
);
}
}
}
private
JsonNode
transform
(
Object
currentJson
,
Version
targetVersion
)
throws
MigrationException
{
private
JsonNode
transform
(
Object
currentJson
,
Version
targetVersion
)
throws
MigrationException
{
...
@@ -159,7 +154,7 @@ public class JoltMigrationAssistant extends MigrationAssistant {
...
@@ -159,7 +154,7 @@ public class JoltMigrationAssistant extends MigrationAssistant {
if
(
node
.
get
(
"release"
)
!=
null
)
{
if
(
node
.
get
(
"release"
)
!=
null
)
{
version
=
Version
.
fromString
(
node
.
get
(
"release"
).
asText
());
version
=
Version
.
fromString
(
node
.
get
(
"release"
).
asText
());
if
(
version
==
null
||
version
.
equalOrSamller
(
Version
.
NOT_A_RELEASE
))
{
if
(
version
==
null
||
version
.
equalOrSamller
(
Version
.
UNDEFINED
))
{
logger
.
error
(
"release version "
+
node
.
get
(
"release"
).
asText
()
+
" is unknown or not "
+
logger
.
error
(
"release version "
+
node
.
get
(
"release"
).
asText
()
+
" is unknown or not "
+
"supported. If this is a valid release create a version transformation and a new idenity transformation"
);
"supported. If this is a valid release create a version transformation and a new idenity transformation"
);
throw
new
MigrationException
(
"release version "
+
node
.
get
(
"release"
).
asText
()
+
" is unknown or not "
+
throw
new
MigrationException
(
"release version "
+
node
.
get
(
"release"
).
asText
()
+
" is unknown or not "
+
...
...
VadereState/src/org/vadere/state/util/StateJsonConverter.java
View file @
ecbfd11a
...
@@ -86,7 +86,7 @@ public abstract class StateJsonConverter {
...
@@ -86,7 +86,7 @@ public abstract class StateJsonConverter {
return
mapper
.
readValue
(
dev
,
mapTypeReference
);
return
mapper
.
readValue
(
dev
,
mapTypeReference
);
}
}
public
static
Object
convertJsonNodeToObject
(
JsonNode
node
)
throws
IOException
{
public
static
Object
convertJsonNodeToObject
(
JsonNode
node
)
{
return
mapper
.
convertValue
(
node
,
Map
.
class
);
return
mapper
.
convertValue
(
node
,
Map
.
class
);
}
}
...
...
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