Revision 1688 tmp/org.txm.core/src/java/org/txm/scripts/importer/StaxParser.groovy

StaxParser.groovy (revision 1688)
46 46
	protected void after()
47 47
	{
48 48
		factory = null;
49
		if (parser !=null) parser.close();
49
		if (parser != null) parser.close();
50
		if (inputData != null) inputData.close();
50 51
		parser = null;
51 52
	}
52 53
	
53 54
	protected void closeForError() {
54
		parser.close();
55
		if (parser != null) parser.close();
56
		if (inputData != null) inputData.close();
55 57
	}
56 58

  
57 59
	public boolean process()
......
97 99
			println("Unexpected error while parsing file "+inputurl+" : "+e);
98 100
			println("Location line: "+parser.getLocation().getLineNumber()+" character: "+parser.getLocation().getColumnNumber());
99 101
			org.txm.utils.logger.Log.printStackTrace(e);
100
			parser.close();
102
			if (parser != null) parser.close();
103
		if (inputData != null) inputData.close();
101 104
			return false;
102 105
		}
103 106
		

Also available in: Unified diff