Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
af3
AF3
Commits
c133c090
Commit
c133c090
authored
Aug 01, 2012
by
Daniel Ratiu
Browse files
GREEN
refs 862
parent
97d3c606
Changes
1
Show whitespace changes
Inline
Side-by-side
org.fortiss.af3.tools/trunk/src/org/fortiss/af3/tools/base/ToolRunnerBase.java
View file @
c133c090
...
...
@@ -55,13 +55,11 @@ import org.fortiss.tooling.kernel.model.INamedElement;
* @author ratiu
* @author $Author: hoelzl $
* @version $Rev: 18709 $
* @ConQAT.Rating RE
D
Hash:
808FF0487ECD7D3ED822E61D6BF846F5
* @ConQAT.Rating
G
RE
EN
Hash:
20530134FF909B6F61170212FBE6C120
*/
public
abstract
class
ToolRunnerBase
<
S
extends
INamedElement
,
T
>
implements
IToolRunner
<
T
>
{
// TODO(AW) review: this flag seems to be overwhelmingly used, is there maybe a cleaner
// solution?
/** Whether the tool should be debugged. */
/** Whether the tool should be debugged. If DEBUG == true, then generated files are not deleted. */
public
static
boolean
DEBUG
=
false
;
/** The logical file on which the tool will be run. */
...
...
@@ -76,20 +74,13 @@ public abstract class ToolRunnerBase<S extends INamedElement, T> implements IToo
/** Returns the shell command that runs the tool. */
protected
abstract
String
getToolCommand
();
/**
* Generates the physical file.
*/
/** Generates the physical file. */
protected
File
generatePhysicalFile
(
ITextGenerator
<
S
>
textGen
,
String
fileExtension
)
throws
IOException
,
UnknownLanguageFragmentException
{
IPath
location
=
plugin
.
getStateLocation
();
Random
randomGenerator
=
new
Random
();
// TODO(AW) review: Shall this regex remove only the trailing non-alphanumeric character
// or all non-alphanumeric characters? Isn't it possible, that ambiguities
// occur, when information-bearing characters are just skipped? I mean, are
// random numbers really safe? I don't know the complete context, so I may be
// Completely wrong ;)
String
patchedPhysicalFileName
=
logicalFile
.
getName
().
replaceAll
(
"[^A-Za-z0-9]"
,
""
);
File
physicalFile
=
new
File
(
location
.
toFile
(),
patchedPhysicalFileName
+
randomGenerator
.
nextLong
()
+
...
...
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