#505 jalopy.parse() then jalopy.format() issue

1.5rc3
open
S
5
2007-09-14
2007-09-14
Simon Precurse
No

Not sure if this is a bug (but seemed to work in previous early version of Jalopy), but when you call parse() and then call format() the out file is a 0 length file, you have to reset the input for the output file to then print out properly.

Not sure if this is the desired behaviour or not but it took me a while to work it out, perhaps the javadoc should be updated in the parse() method to indicate what is happening.

Cheers
Simon
p.s. is anyone looking at this project anymore?
---- java source ----

package test;

import de.hunsicker.jalopy.Jalopy;
import java.io.File;

public class SimpleConsole {
public static void main(String[] _args) {
if (_args.length != 3) {
System.out.println("test.SimpleConsole convention in out");
} else {
try {
String convention = _args[0];
String in = _args[1];
String out = _args[2];
Jalopy jalopy = new Jalopy();

File inFile = new File(in);
File outFile = new File(out);

// set up the jalopy object
jalopy.setInput(inFile);
jalopy.setOutput(outFile);
Jalopy.setConvention(new File(convention));

// parse
jalopy.parse();
System.out.println("state: " + jalopy.getState());

// UNCOMMENT the line below to make it work
//jalopy.setInput(inFile);

// format
boolean success = jalopy.format();
System.out.println("formatted: " + success + ", state: " + jalopy.getState() + ", outfile length: " + outFile.length());
} catch (Exception e) {
System.out.println("issue: " + e.getMessage());
System.exit(0);
}

}
}
}

Discussion

  • S
    S
    2007-09-14

    Logged In: YES
    user_id=723231
    Originator: NO

    Yup someone is still here, but very busy :(

     
  • S
    S
    2007-09-14

    • assigned_to: nobody --> notzippy