Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tlc4b
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
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
general
stups
tlc4b
Commits
200a7291
Commit
200a7291
authored
10 months ago
by
dgelessus
Browse files
Options
Downloads
Patches
Plain Diff
Unwrap some TLC4BIOException where IOException also works
parent
61916f55
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/de/tlc4b/TLC4B.java
+12
-22
12 additions, 22 deletions
src/main/java/de/tlc4b/TLC4B.java
src/main/java/de/tlc4b/Translator.java
+0
-1
0 additions, 1 deletion
src/main/java/de/tlc4b/Translator.java
with
12 additions
and
23 deletions
src/main/java/de/tlc4b/TLC4B.java
+
12
−
22
View file @
200a7291
...
@@ -128,7 +128,7 @@ public class TLC4B {
...
@@ -128,7 +128,7 @@ public class TLC4B {
}
}
}
}
private
void
printResults
(
TLCResults
results
)
{
private
void
printResults
(
TLCResults
results
)
throws
IOException
{
printOperationsCount
(
results
);
printOperationsCount
(
results
);
// options
// options
printlnSilent
(
"Used Options"
);
printlnSilent
(
"Used Options"
);
...
@@ -476,20 +476,18 @@ public class TLC4B {
...
@@ -476,20 +476,18 @@ public class TLC4B {
return
sb
.
toString
();
return
sb
.
toString
();
}
}
private
void
createLogFile
(
TLCResults
results
)
{
private
void
createLogFile
(
TLCResults
results
)
throws
IOException
{
if
(
logFile
!=
null
)
{
if
(
logFile
!=
null
)
{
String
logCsvString
=
getLogCsvString
(
results
);
String
logCsvString
=
getLogCsvString
(
results
);
try
(
FileWriter
fw
=
new
FileWriter
(
logFile
,
true
))
{
// the true will append the new data
try
(
FileWriter
fw
=
new
FileWriter
(
logFile
,
true
))
{
// the true will append the new data
fw
.
write
(
logCsvString
);
fw
.
write
(
logCsvString
);
fw
.
close
();
fw
.
close
();
println
(
"Log file: "
+
logFile
.
getAbsolutePath
());
println
(
"Log file: "
+
logFile
.
getAbsolutePath
());
}
catch
(
IOException
e
)
{
throw
new
TLC4BIOException
(
e
);
}
}
}
}
}
}
private
void
createFiles
()
{
private
void
createFiles
()
throws
IOException
{
boolean
dirCreated
=
buildDir
.
mkdir
();
boolean
dirCreated
=
buildDir
.
mkdir
();
if
(
dirCreated
&&
TLC4BGlobals
.
isDeleteOnExit
())
{
if
(
dirCreated
&&
TLC4BGlobals
.
isDeleteOnExit
())
{
buildDir
.
deleteOnExit
();
buildDir
.
deleteOnExit
();
...
@@ -508,13 +506,13 @@ public class TLC4B {
...
@@ -508,13 +506,13 @@ public class TLC4B {
createStandardModules
();
createStandardModules
();
}
}
private
void
createStandardModules
()
{
private
void
createStandardModules
()
throws
IOException
{
for
(
String
module
:
translator
.
getStandardModuleToBeCreated
())
{
for
(
String
module
:
translator
.
getStandardModuleToBeCreated
())
{
createStandardModule
(
buildDir
,
module
);
createStandardModule
(
buildDir
,
module
);
}
}
}
}
private
void
createStandardModule
(
File
path
,
String
name
)
{
private
void
createStandardModule
(
File
path
,
String
name
)
throws
IOException
{
// standard modules are copied from the standardModules folder to the current directory
// standard modules are copied from the standardModules folder to the current directory
File
file
=
new
File
(
path
,
name
+
".tla"
);
File
file
=
new
File
(
path
,
name
+
".tla"
);
...
@@ -536,13 +534,10 @@ public class TLC4B {
...
@@ -536,13 +534,10 @@ public class TLC4B {
fos
.
write
(
bytes
,
0
,
read
);
fos
.
write
(
bytes
,
0
,
read
);
}
}
println
(
"Standard module '"
+
file
.
getName
()
+
"' created."
);
println
(
"Standard module '"
+
file
.
getName
()
+
"' created."
);
}
catch
(
IOException
e
)
{
throw
new
TLC4BIOException
(
e
);
}
finally
{
}
finally
{
if
(
TLC4BGlobals
.
isDeleteOnExit
()
&&
file
.
exists
())
{
if
(
TLC4BGlobals
.
isDeleteOnExit
()
&&
file
.
exists
())
{
file
.
deleteOnExit
();
file
.
deleteOnExit
();
}
}
try
{
if
(
is
!=
null
)
{
if
(
is
!=
null
)
{
is
.
close
();
is
.
close
();
}
}
...
@@ -550,13 +545,10 @@ public class TLC4B {
...
@@ -550,13 +545,10 @@ public class TLC4B {
fos
.
flush
();
fos
.
flush
();
fos
.
close
();
fos
.
close
();
}
}
}
catch
(
IOException
ex
)
{
throw
new
TLC4BIOException
(
ex
);
}
}
}
}
}
private
static
File
createFile
(
File
dir
,
String
fileName
,
String
text
,
boolean
deleteOnExit
)
{
private
static
File
createFile
(
File
dir
,
String
fileName
,
String
text
,
boolean
deleteOnExit
)
throws
IOException
{
File
file
=
new
File
(
dir
,
fileName
);
File
file
=
new
File
(
dir
,
fileName
);
boolean
exists
=
false
;
boolean
exists
=
false
;
try
{
try
{
...
@@ -566,8 +558,6 @@ public class TLC4B {
...
@@ -566,8 +558,6 @@ public class TLC4B {
out
.
write
(
text
);
out
.
write
(
text
);
out
.
close
();
out
.
close
();
return
file
;
return
file
;
}
catch
(
IOException
e
)
{
throw
new
TLC4BIOException
(
e
);
}
finally
{
}
finally
{
if
(
deleteOnExit
&&
exists
)
{
if
(
deleteOnExit
&&
exists
)
{
file
.
deleteOnExit
();
file
.
deleteOnExit
();
...
...
This diff is collapsed.
Click to expand it.
src/main/java/de/tlc4b/Translator.java
+
0
−
1
View file @
200a7291
...
@@ -28,7 +28,6 @@ import de.tlc4b.analysis.transformation.SetComprehensionOptimizer;
...
@@ -28,7 +28,6 @@ import de.tlc4b.analysis.transformation.SetComprehensionOptimizer;
import
de.tlc4b.analysis.typerestriction.TypeRestrictor
;
import
de.tlc4b.analysis.typerestriction.TypeRestrictor
;
import
de.tlc4b.analysis.unchangedvariables.InvariantPreservationAnalysis
;
import
de.tlc4b.analysis.unchangedvariables.InvariantPreservationAnalysis
;
import
de.tlc4b.analysis.unchangedvariables.UnchangedVariablesFinder
;
import
de.tlc4b.analysis.unchangedvariables.UnchangedVariablesFinder
;
import
de.tlc4b.exceptions.TLC4BIOException
;
import
de.tlc4b.prettyprint.TLAPrinter
;
import
de.tlc4b.prettyprint.TLAPrinter
;
import
de.tlc4b.tla.Generator
;
import
de.tlc4b.tla.Generator
;
import
de.tlc4b.tlc.TLCOutputInfo
;
import
de.tlc4b.tlc.TLCOutputInfo
;
...
...
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