Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 22 additions & 22 deletions java/jtraverser/src/main/java/mds/jtraverser/CompileTree.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ public static void main(String args[])
int shot = -1;
if (args.length < 1)
{
System.out.println("Usage: java CompileTree <experiment> [<shot>]");
System.exit(0);
System.err.println("Usage: java CompileTree <experiment> [<shot>]");
System.exit(1);
}
experiment = args[0];
if (args.length > 1)
Expand All @@ -29,8 +29,8 @@ public static void main(String args[])
}
catch (final Exception exc)
{
System.out.println("Error Parsing shot number");
System.exit(0);
System.err.println("Error Parsing shot number");
System.exit(1);
}
}
(new CompileTree(experiment, shot)).start();
Expand Down Expand Up @@ -124,7 +124,7 @@ void recCompile(Element node)
}
catch (final Exception exc)
{
System.out.println("Error writing data: " + exc);
System.err.println("Error writing data: " + exc);
}
}
return;
Expand Down Expand Up @@ -168,7 +168,7 @@ void recCompile(Element node)
}
catch (final Exception exc)
{
System.out.println("Error adding member " + name + " : " + exc);
System.err.println("Error adding member " + name + " : " + exc);
}
}
if (type.equals("member"))
Expand All @@ -183,7 +183,7 @@ void recCompile(Element node)
}
catch (final Exception exc)
{
System.out.println("Error adding member " + name + " : " + exc);
System.err.println("Error adding member " + name + " : " + exc);
}
}
if (type.equals("device"))
Expand All @@ -210,7 +210,7 @@ void recCompile(Element node)
}
catch (final Exception exc)
{
System.out.println("WARNING: device field " + name + " not found in model ");
System.err.println("WARNING: device field " + name + " not found in model ");
}
}
if (success)
Expand All @@ -231,7 +231,7 @@ void recCompile(Element node)
}
catch (final Exception exc)
{
System.out.println("Error adding tags " + tagsStr + " : " + exc);
System.err.println("Error adding tags " + tagsStr + " : " + exc);
}
}
// flags
Expand Down Expand Up @@ -262,7 +262,7 @@ void recCompile(Element node)
}
catch (final Exception exc)
{
System.out.println("Error setting flags to node " + name + " : " + exc);
System.err.println("Error setting flags to node " + name + " : " + exc);
}
}
// state
Expand All @@ -278,7 +278,7 @@ void recCompile(Element node)
}
catch (final Exception exc)
{
// System.out.println("Error setting state of node " + name + " : " + exc);
// System.err.println("Error setting state of node " + name + " : " + exc);
}
}
// Descend
Expand All @@ -294,7 +294,7 @@ void recCompile(Element node)
}
catch (final Exception exc)
{
System.out.println("Internal error in recCompile: " + exc);
System.err.println("Internal error in recCompile: " + exc);
exc.printStackTrace();
}
}
Expand All @@ -312,8 +312,8 @@ public void run()
catch (final SAXParseException spe)
{
// Error generated by the parser
System.out.println("\n** Parsing error" + ", line " + spe.getLineNumber() + ", uri " + spe.getSystemId());
System.out.println(" " + spe.getMessage());
System.err.println("\n** Parsing error" + ", line " + spe.getLineNumber() + ", uri " + spe.getSystemId());
System.err.println(" " + spe.getMessage());
// Use the contained exception, if any
Exception x = spe;
if (spe.getException() != null)
Expand Down Expand Up @@ -344,8 +344,8 @@ public void run()
}
catch (final Exception exc)
{
System.out.println(exc);
System.exit(0);
System.err.println(exc);
System.exit(1);
}
final Element rootNode = document.getDocumentElement();
final NodeList nodes = rootNode.getChildNodes();
Expand All @@ -371,7 +371,7 @@ public void run()
}
catch (final Exception exc)
{
System.out.println("Error renaming node of " + deviceName + " to " + newName + " : " + exc);
System.err.println("Error renaming node of " + deviceName + " to " + newName + " : " + exc);
}
}
for (int i = 0; i < unresolvedNidV.size(); i++)
Expand All @@ -381,21 +381,21 @@ public void run()
MDSplus.Data data = null;
try
{
// System.out.println((String) unresolvedExprV.elementAt(i));
// System.err.println((String) unresolvedExprV.elementAt(i));
tree.setDefault(unresolvedNidV.elementAt(i));
data = tree.tdiCompile(unresolvedExprV.elementAt(i));
}
catch (final Exception exc)
{
System.out.println("Error parsing expression " + unresolvedExprV.elementAt(i) + " : " + exc);
System.err.println("Error parsing expression " + unresolvedExprV.elementAt(i) + " : " + exc);
}
try
{
unresolvedNidV.elementAt(i).putData(data);
}
catch (final Exception exc)
{
System.out.println("Error writing data: " + exc);
System.err.println("Error writing data: " + exc);
}
}
//Set subtrees (apparently this must be done at the end....
Expand All @@ -407,7 +407,7 @@ public void run()
}
catch (final Exception exc)
{
System.out.println("Error setting subtree: " + exc);
System.err.println("Error setting subtree: " + exc);
}
}
try
Expand All @@ -417,7 +417,7 @@ public void run()
}
catch (final Exception exc)
{
System.out.println("Error closeing tree: " + exc);
System.err.println("Error closing tree: " + exc);
}
}
}