Bug #645

JTorX cannot handle very short filenames

Added by Axel Belinfante about 8 years ago. Updated about 8 years ago.

Status:ResolvedStart date:26 Jul 2012
Priority:NormalDue date:
Assignee:-% Done:

100%

Category:-
Target version:-

Description

When we use a very short file name, at least for a .sax file, and (e.g. ?) ask for visualization, JTorX hangs.

Turns out it crashes as follows:

[LaunchRunner Error] utwente.fmt.jtorx.testgui.Testgui.main(String[]) threw an exception:
java.lang.IllegalArgumentException: Prefix string too short
at java.io.File.createTempFile0(File.java:1716)
at java.io.File.createTempFile(File.java:1838)
at utwente.fmt.jtorx.testgui.RunItemData.invokeGraphvizCreationCommand(RunItemData.java:221)
at utwente.fmt.jtorx.testgui.RunItemData.createTempGraphVizFile(RunItemData.java:260)
at utwente.fmt.jtorx.testgui.RunItemData.getGraphVizFilename(RunItemData.java:196)
at utwente.fmt.jtorx.testgui.Testgui.doHandleViewLTSEvent(Testgui.java:809)

(reported by Sergey)

Associated revisions

Revision 157cc6a3
Added by Axel Belinfante about 8 years ago

fix to allow use of short file names

by extending the file name supplied by the user with a short suffix
such that we always invoke java's createTempFile with a prefix argument
that is longer than 3 characters.

closes #645

Revision 6366371a
Added by Axel Belinfante about 8 years ago

fix to allow use of short file names

by extending the file name supplied by the user with a short suffix
such that we always invoke java's createTempFile with a prefix argument
that is longer than 3 characters

closes #645

History

#1 Updated by Axel Belinfante about 8 years ago

According to the Java documentation, this is indeed to be expected:

prefix (1st argument) - The prefix string to be used in generating the file's name; must be at least three characters long

(throws) IllegalArgumentException - If the prefix (i.e.first) argument contains fewer than three characters

#2 Updated by Axel Belinfante about 8 years ago

  • Status changed from New to Feedback
  • % Done changed from 0 to 100

#3 Updated by Axel Belinfante about 8 years ago

  • Status changed from Feedback to Resolved

#4 Updated by Axel Belinfante about 8 years ago

same fix is also present in 6366371a4cac2f5bcd5c88078bd3a4ba95fa523d

Also available in: Atom PDF