Skip to content
Snippets Groups Projects
Commit 196e06c6 authored by Sebastian Ebert's avatar Sebastian Ebert
Browse files

fixed export related bugs

parent 1e391f56
Branches
Tags
No related merge requests found
...@@ -51,7 +51,7 @@ public class PnmlExporter { ...@@ -51,7 +51,7 @@ public class PnmlExporter {
try { try {
File myObj = new File(targetPath); File myObj = new File(targetPath);
if (myObj.createNewFile()) { if (myObj.createNewFile()) {
logger.info("File created: " + myObj.getName()); // logger.info("File created: " + myObj.getName());
} else { } else {
logger.info("File already exists."); logger.info("File already exists.");
} }
......
...@@ -9,25 +9,27 @@ public class PrimitiveElementsConverter { ...@@ -9,25 +9,27 @@ public class PrimitiveElementsConverter {
private static StringBuffer clipToolSpecificsFormattedXmlBuffer(String toolName, String toolVersion, StringBuffer formattedXmlBuffer) { private static StringBuffer clipToolSpecificsFormattedXmlBuffer(String toolName, String toolVersion, StringBuffer formattedXmlBuffer) {
if (formattedXmlBuffer != null && formattedXmlBuffer.indexOf("</toolspecific>") > -1) { StringBuffer bufferCopy = new StringBuffer(formattedXmlBuffer);
if (bufferCopy != null && bufferCopy.indexOf("</toolspecific>") > -1) {
int endCharsLength = 15; int endCharsLength = 15;
int toolNameLenth = (toolName == null) ? 0 : toolName.length(); int toolNameLenth = (toolName == null) ? 0 : toolName.length();
int toolVersionLength = (toolVersion == null) ? 0 : toolVersion.length(); int toolVersionLength = (toolVersion == null) ? 0 : toolVersion.length();
int indexGt = 0; int indexGt = 0;
if (formattedXmlBuffer.indexOf("?xml") > -1) { if (bufferCopy.indexOf("?xml") > -1) {
indexGt = formattedXmlBuffer.indexOf(">", formattedXmlBuffer.indexOf(">") + 1); indexGt = bufferCopy.indexOf(">", bufferCopy.indexOf(">") + 1);
} else { } else {
indexGt = formattedXmlBuffer.indexOf(">"); indexGt = bufferCopy.indexOf(">");
} }
if (toolNameLenth > 0 || toolVersionLength > 0) { if (toolNameLenth > 0 || toolVersionLength > 0) {
formattedXmlBuffer.delete(0, indexGt + 1); bufferCopy.delete(0, indexGt + 1);
formattedXmlBuffer.delete(formattedXmlBuffer.length() - endCharsLength, formattedXmlBuffer.length()); bufferCopy.delete(bufferCopy.length() - endCharsLength, bufferCopy.length());
} }
} }
return formattedXmlBuffer; return bufferCopy;
} }
public static RefTransitionHLAPI convertRefTransitionToPnmlObject(RefTransition refTransition, TransitionHLAPI referencedTransition, RefTransitionHLAPI referencedRefTransition){ public static RefTransitionHLAPI convertRefTransitionToPnmlObject(RefTransition refTransition, TransitionHLAPI referencedTransition, RefTransitionHLAPI referencedRefTransition){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment