Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ProB Rodin Plugin
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
general
stups
ProB Rodin Plugin
Commits
1398231d
Commit
1398231d
authored
12 years ago
by
Daniel Plagge
Browse files
Options
Downloads
Patches
Plain Diff
Converting RuntimeExceptions to TranslationFailedExceptions,
because the latter failed silently on export to classical ProB
parent
891f45b3
No related branches found
No related tags found
Loading
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
de.prob.core/src/de/prob/eventb/translator/TranslatorFactory.java
+19
-14
19 additions, 14 deletions
...core/src/de/prob/eventb/translator/TranslatorFactory.java
with
19 additions
and
14 deletions
de.prob.core/src/de/prob/eventb/translator/TranslatorFactory.java
+
19
−
14
View file @
1398231d
...
@@ -33,7 +33,8 @@ public class TranslatorFactory {
...
@@ -33,7 +33,8 @@ public class TranslatorFactory {
*/
*/
public
static
void
translate
(
final
IEventBRoot
root
,
public
static
void
translate
(
final
IEventBRoot
root
,
final
IPrologTermOutput
pto
)
throws
TranslationFailedException
{
final
IPrologTermOutput
pto
)
throws
TranslationFailedException
{
final
String
componentName
=
root
.
getComponentName
();
try
{
if
(
root
instanceof
IMachineRoot
)
{
if
(
root
instanceof
IMachineRoot
)
{
final
ISCMachineRoot
scRoot
=
((
IMachineRoot
)
root
)
final
ISCMachineRoot
scRoot
=
((
IMachineRoot
)
root
)
.
getSCMachineRoot
();
.
getSCMachineRoot
();
...
@@ -44,10 +45,14 @@ public class TranslatorFactory {
...
@@ -44,10 +45,14 @@ public class TranslatorFactory {
.
getSCContextRoot
();
.
getSCContextRoot
();
EventBContextTranslator
.
create
(
scRoot
,
pto
);
EventBContextTranslator
.
create
(
scRoot
,
pto
);
}
else
{
}
else
{
throw
new
TranslationFailedException
(
root
.
getC
omponentName
()
,
throw
new
TranslationFailedException
(
c
omponentName
,
"Cannot translate anything else than IMachineRoot or IContextRoot. Type was: "
"Cannot translate anything else than IMachineRoot or IContextRoot. Type was: "
+
root
.
getClass
());
+
root
.
getClass
());
}
}
}
catch
(
RuntimeException
e
)
{
throw
new
TranslationFailedException
(
componentName
,
"A runtime exception occurred: "
+
e
.
getMessage
(),
e
);
}
}
}
public
static
void
translate
(
final
IEventBRoot
root
,
public
static
void
translate
(
final
IEventBRoot
root
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment