Project

General

Profile

Revision 2d6a9bb3

View differences:

regression_tests/CMakeLists.txt
1 1
cmake_minimum_required(VERSION 2.8.4)
2 2
project (lustrec-tests)
3 3
include( CTest )
4
include(FindJava)
5

  
4 6

  
5 7
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/modules)
6 8
include(./modules/Lustre_compile.cmake)
7 9
include(./modules/Zustre_compile.cmake)
8
	
10

  
11
if(JAVA_COMPILE AND EXISTS ${PROJECT_SOURCE_DIR}/modules/XPathParser_lusi.java)
12
	file(COPY ${PROJECT_SOURCE_DIR}/modules/XPathParser_lusi.java ${PROJECT_SOURCE_DIR}/modules/javax.xml-1.3.4.jar  DESTINATION  ${CMAKE_BINARY_DIR}/modules)
13
	add_custom_command(OUTPUT  ${CMAKE_BINARY_DIR}/modules/XPathParser_lusi.class 
14
						COMMAND ${JAVA_COMPILE} -classpath "'.;javax.xml-1.3.4.jar;'" XPathParser_lusi.java 
15
						WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/modules 
16
						COMMENT "compiling XPathParser_lusi")
17
	add_custom_target (XPathParser_lusi ALL
18
		DEPENDS ${CMAKE_BINARY_DIR}/modules/XPathParser_lusi.class)
19
else()
20
	message("javac not found")
21
endif()
9 22
add_subdirectory(lustre_files)
10 23

  
11 24
    
regression_tests/lustre_files/success/kind_fmcad08/large/src/CEX/CMakeLists.txt
1 1
cmake_minimum_required(VERSION 2.8.4)
2

  
2
include(FindUnixCommands)
3 3

  
4 4

  
5 5
if(ZUSTRE_COMPILER)
......
20 20
  FOREACH(lfile ${LFILES})
21 21
	  get_filename_component(L ${lfile} NAME_WE)
22 22
	  set(LUSTRE_OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/${L}")
23
	  file(COPY ${lfile}   DESTINATION  ${LUSTRE_OUTPUT_DIR})
23
	  file(COPY ${lfile}  ${L}.lusi DESTINATION  ${LUSTRE_OUTPUT_DIR})
24 24
	if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${L}.xml)
25 25
		file(COPY ${L}.xml   DESTINATION  ${LUSTRE_OUTPUT_DIR})
26 26
	else()
......
69 69
					OPTS ${ZUSTRE_OPTIONS_OPT})
70 70
	set(ZUS_OPTS_CUT ${ZUSTRE_OPTS_POSTFIX_${L}})
71 71
	
72

  
72
	set(ZUSTRE_ARGS_TEMP "${ZUSTRE_ARGS_${L}_${ZUSTRE_NODE_OPT}_${ZUS_OPTS_CUT}}" "> ${L}_${ZUSTRE_NODE_OPT}_${ZUS_OPTS_CUT}.xml")
73
    JOIN("${ZUSTRE_ARGS_TEMP}" " " ZUSTRE_ARGS)
74
    
73 75
	add_test(NAME Kind_fmcad08_large_CEX_COMPIL_ZUSTRE_${L}_${ZUSTRE_NODE_OPT}_${ZUS_OPTS_CUT}
74
			COMMAND  ${ZUSTRE_COMPILER} ${ZUSTRE_ARGS_${L}_${ZUSTRE_NODE_OPT}_${ZUS_OPTS_CUT}} 
76
			COMMAND bash -c "${ZUSTRE_COMPILER} ${ZUSTRE_ARGS}"
75 77
			WORKING_DIRECTORY ${ZUSTRE_OUTPUT_DIR_${L}_${ZUSTRE_NODE_OPT}_${ZUS_OPTS_CUT}}
76 78
	)
77 79
	SET_TESTS_PROPERTIES (  Kind_fmcad08_large_CEX_COMPIL_ZUSTRE_${L}_${ZUSTRE_NODE_OPT}_${ZUS_OPTS_CUT}
78
			PROPERTIES PASS_REGULAR_EXPRESSION "<Answer>CEX</Answer>"
80
			PROPERTIES FAIL_REGULAR_EXPRESSION "AssertionError;ERROR;Failed"
79 81
					DEPENDS Kind_fmcad08_large_CEX_COMPIL_LUSTRE_${L}_${ZUSTRE_NODE_OPT}_${ZUS_OPTS_CUT})
80
				
82
			
83
			
84
	add_test(NAME Kind_fmcad08_large_CEX_TAIL1_ZUSTRE_${L}_${ZUSTRE_NODE_OPT}_${ZUS_OPTS_CUT}
85
			COMMAND bash -c "tail -n +8 ${L}_${ZUSTRE_NODE_OPT}_${ZUS_OPTS_CUT}.xml > ${L}_tailed1.xml"
86
			WORKING_DIRECTORY ${ZUSTRE_OUTPUT_DIR_${L}_${ZUSTRE_NODE_OPT}_${ZUS_OPTS_CUT}}
87
			#DEPENDS Kind_fmcad08_large_CEX_COMPIL_ZUSTRE_${L}_${ZUSTRE_NODE_OPT}_${ZUS_OPTS_CUT}
88
	)
89
	
90
	add_test(NAME Kind_fmcad08_large_CEX_TAIL2_ZUSTRE_${L}_${ZUSTRE_NODE_OPT}_${ZUS_OPTS_CUT}
91
			COMMAND bash -c "tail -n +8 ${L}.xml > ${L}_tailed2.xml"
92
			WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${L}/
93
	)
94
					
95
	add_test(NAME Kind_fmcad08_large_CEX_DIFF_ZUSTRE_${L}_${ZUSTRE_NODE_OPT}_${ZUS_OPTS_CUT}
96
			COMMAND bash -c "diff  ${L}_tailed1.xml  ../${L}_tailed2.xml"
97
			WORKING_DIRECTORY ${ZUSTRE_OUTPUT_DIR_${L}_${ZUSTRE_NODE_OPT}_${ZUS_OPTS_CUT}}
98
	)
99
	SET_TESTS_PROPERTIES ( Kind_fmcad08_large_CEX_DIFF_ZUSTRE_${L}_${ZUSTRE_NODE_OPT}_${ZUS_OPTS_CUT}
100
	 PROPERTIES REQUIRED_FILES  ${L}_tailed1.xml
101
				DEPENDS Kind_fmcad08_large_CEX_TAIL1_ZUSTRE_${L}_${ZUSTRE_NODE_OPT}_${ZUS_OPTS_CUT} )	
102

  
103
	
104
	if(EXISTS ${CMAKE_BINARY_DIR}/modules/XPathParser_lusi.class)
105
		add_test(NAME Kind_fmcad08_large_CEX_XPathParser_lusi_ZUSTRE_${L}_${ZUSTRE_NODE_OPT}_${ZUS_OPTS_CUT}
106
			COMMAND ${JAVA_RUNTIME} -cp ${CMAKE_BINARY_DIR}/modules/ XPathParser_lusi ${ZUSTRE_NODE_OPT} ../${L}.lusi ${L}_${ZUSTRE_NODE_OPT}_${ZUS_OPTS_CUT}.xml
107
			WORKING_DIRECTORY ${ZUSTRE_OUTPUT_DIR_${L}_${ZUSTRE_NODE_OPT}_${ZUS_OPTS_CUT}}
108
		)
109
		SET_TESTS_PROPERTIES ( Kind_fmcad08_large_CEX_XPathParser_lusi_ZUSTRE_${L}_${ZUSTRE_NODE_OPT}_${ZUS_OPTS_CUT}
110
		 PROPERTIES REQUIRED_FILES  ${CMAKE_CURRENT_BINARY_DIR}/${L}/${L}.lusi 
111
					DEPENDS Kind_fmcad08_large_CEX_COMPIL_ZUSTRE_${L}_${ZUSTRE_NODE_OPT}_${ZUS_OPTS_CUT} )	
112
		
113
		set(LUSTRE_NODE_OPT "top")
114
		# First command generate C files from Lustre file
115
		Lustre_Compile(LUS_FILE ${lus_file}
116
						NODE ${LUSTRE_NODE_OPT}
117
						OPTS ""
118
						DIR ${ZUSTRE_OUTPUT_DIR_${L}_${ZUSTRE_NODE_OPT}_${ZUS_OPTS_CUT}})
119
						
120
		set(LUS_OPTS_CUT ${LUSTRE_OPTS_POSTFIX_${L}})
121
		add_test(NAME Kind_fmcad08_large_CEX_COMPIL_LUSTRE_${L}_${LUSTRE_NODE_OPT}_${LUS_OPTS_CUT}
122
				COMMAND  ${LUSTRE_COMPILER} ${LUSTREC_ARGS_${L}_${LUSTRE_NODE_OPT}_${LUS_OPTS_CUT}} 
123
				WORKING_DIRECTORY ${ZUSTRE_OUTPUT_DIR_${L}_${ZUSTRE_NODE_OPT}_${ZUS_OPTS_CUT}}
124
		)
125

  
126
		 #********************* make -f ${L}.makefile ***************************
127
		 add_test(NAME Kind_fmcad08_large_CEX_MAKE_${L}_${LUSTRE_NODE_OPT}_${LUS_OPTS_CUT}
128
				COMMAND  make -f ${L}.makefile
129
				WORKING_DIRECTORY ${ZUSTRE_OUTPUT_DIR_${L}_${ZUSTRE_NODE_OPT}_${ZUS_OPTS_CUT}}
130
		)
131
		SET_TESTS_PROPERTIES ( Kind_fmcad08_large_CEX_MAKE_${L}_${LUSTRE_NODE_OPT}_${LUS_OPTS_CUT}
132
		 PROPERTIES DEPENDS Kind_fmcad08_large_CEX_COMPIL_LUSTRE_${L}_${LUSTRE_NODE_OPT}_${LUS_OPTS_CUT}
133
					REQUIRED_FILES ${L}.makefile
134
					)
135
		 
136
		 #************** execute C binary **********************************
137
		
138
		if (BASH)
139
			add_test(
140
				NAME Kind_fmcad08_large_CEX_BIN_${L}_${LUSTRE_NODE_OPT}_${LUS_OPTS_CUT} 
141
				COMMAND ${BASH} -c "./${L}_${LUSTRE_NODE_OPT} < input_values > ${L}_${LUSTRE_NODE_OPT}_outputs"
142
				WORKING_DIRECTORY ${ZUSTRE_OUTPUT_DIR_${L}_${ZUSTRE_NODE_OPT}_${ZUS_OPTS_CUT}}
143
			)
144
			SET_TESTS_PROPERTIES ( Kind_fmcad08_large_CEX_BIN_${L}_${LUSTRE_NODE_OPT}_${LUS_OPTS_CUT}
145
				PROPERTIES REQUIRED_FILES ${L}_${LUSTRE_NODE_OPT}
146
					DEPENDS Kind_fmcad08_large_CEX_MAKE_${L}_${LUSTRE_NODE_OPT}_${LUS_OPTS_CUT})
147
		else()
148
			message(FATAL_ERROR "Unknown shell command for ${CMAKE_HOST_SYSTEM_NAME}")
149
		endif()
81 150

  
151
		 #************** execute C binary **********************************
152
		 add_test(NAME Kind_fmcad08_large_CEX_COMPARE_OUTPUTS_OF LUSTREC_ZUSTRE_${L}_${LUSTRE_NODE_OPT}_${LUS_OPTS_CUT}
153
				COMMAND ${CMAKE_COMMAND} -E compare_files ${L}_${LUSTRE_NODE_OPT}_outputs xml_output_values
154
				WORKING_DIRECTORY ${ZUSTRE_OUTPUT_DIR_${L}_${ZUSTRE_NODE_OPT}_${ZUS_OPTS_CUT}}
155
		)
156
		SET_TESTS_PROPERTIES ( Kind_fmcad08_large_CEX_COMPARE_OUTPUTS_OF LUSTREC_ZUSTRE_${L}_${LUSTRE_NODE_OPT}_${LUS_OPTS_CUT}
157
		 PROPERTIES REQUIRED_FILES ${L}_${LUSTRE_NODE_OPT}_outputs
158
					DEPENDS Kind_fmcad08_large_CEX_BIN_${L}_${LUSTRE_NODE_OPT}_${LUS_OPTS_CUT} )
159
		
160
	endif()
161
	
82 162
ENDFOREACH()
83 163

  
84 164

  
regression_tests/lustre_files/success/kind_fmcad08/large/src/CEX/ccp23.lusi
1
(* Generated Lustre Interface file from ccp23.lus *)
2
(* by Lustre-C compiler version 1.3-458, 2016/10/18, 0:6:19 *)
3
(* Feel free to mask some of the definitions by removing them from this file. *)
4

  
5
node top (onOff: bool; decelSet: bool; accelResume: bool; cancel: bool; brakePedal: bool; carGear: int; carSpeed: real; validInputs: bool) returns (OK: bool);
6

  
regression_tests/lustre_files/success/kind_fmcad08/large/src/CEX/ccp24.lusi
1
(* Generated Lustre Interface file from ccp24.lus *)
2
(* by Lustre-C compiler version 1.3-458, 2016/10/18, 0:6:52 *)
3
(* Feel free to mask some of the definitions by removing them from this file. *)
4

  
5
node top (onOff: bool; decelSet: bool; accelResume: bool; cancel: bool; brakePedal: bool; carGear: int; carSpeed: real; validInputs: bool) returns (OK: bool);
6

  
regression_tests/lustre_files/success/kind_fmcad08/large/src/CEX/cruise_controller_20.lusi
1
(* Generated Lustre Interface file from cruise_controller_20.lus *)
2
(* by Lustre-C compiler version 1.3-458, 2016/10/18, 0:6:41 *)
3
(* Feel free to mask some of the definitions by removing them from this file. *)
4

  
5
node top (onOff: bool; decelSet: bool; accelResume: bool; cancel: bool; brakePedal: bool; carGear: int; carSpeed: real; validInputs: bool) returns (OK: bool);
6

  
regression_tests/lustre_files/success/kind_fmcad08/large/src/CEX/microwave12.lusi
1
(* Generated Lustre Interface file from microwave12.lus *)
2
(* by Lustre-C compiler version 1.3-458, 2016/10/18, 0:6:30 *)
3
(* Feel free to mask some of the definitions by removing them from this file. *)
4

  
5
node top (KP_START: bool; KP_CLEAR: bool; KP_0: bool; KP_1: bool; KP_2: bool; KP_3: bool; KP_4: bool; KP_5: bool; KP_6: bool; KP_7: bool; KP_8: bool; KP_9: bool; DOOR_CLOSED: bool) returns (OK: bool);
6

  
regression_tests/modules/Lustre_compile.cmake
17 17
#                  LUS_FILE <Lustre file>
18 18
#                  [USER_C_FILES <C files>]
19 19
#                  [VERBOSE <level>]
20
#		   [OPTIONS <options>])
20
#		   [OPTIONS <options>]
21
#				[DIR <directory dest>])
21 22
#
22 23
# When used the Lustre_Compile macro define the variable
23 24
# LUSTRE_GENERATED_C_FILES_<libraryName> in the parent scope
......
71 72
include(CMakeParseArguments)
72 73
function(Lustre_Compile)
73 74
  set(options "")
74
  set(oneValueArgs  NODE VERBOSE LUS_FILE)
75
  set(oneValueArgs  NODE VERBOSE LUS_FILE DIR)
75 76
  set(multiValueArgs  OPTS USER_C_FILES )
76 77
  cmake_parse_arguments(LUS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
77 78

  
......
119 120
	set(LUSTRE_GENERATED_FILES ${LUSTRE_OUTPUT_DIR}/${L}.h)
120 121
  endif()
121 122
  
122
  
123
  set(LUSTREC_ARGS ${LUSTREC_ARGS} -d ${LUSTRE_OUTPUT_DIR} ${LUS_LUS_FILE})
124
	
123
  if(LUS_DIR)
124
	set(LUSTRE_OUTPUT_DIR ${LUS_DIR} )
125
  endif()
126
	set(LUSTREC_ARGS ${LUSTREC_ARGS} -d ${LUSTRE_OUTPUT_DIR} ${LUS_LUS_FILE})
127

  
125 128
  set(LUSTRE_OPTS_POSTFIX_${L} "${LUS_OPTS_CUT}" PARENT_SCOPE)
126 129
  set(LUSTREC_ARGS_${L}_${LUS_NODE}_${LUS_OPTS_CUT} "${LUSTREC_ARGS}" PARENT_SCOPE)
127 130
  set(LUSTRE_GENERATED_FILES_${L}_${LUS_NODE}_${LUS_OPTS_CUT} "${LUSTRE_GENERATED_FILES}" PARENT_SCOPE)
......
162 165
ENDMACRO()
163 166

  
164 167

  
168
function(JOIN VALUES GLUE OUTPUT)
169
  string (REGEX REPLACE "([^\\]|^);" "\\1${GLUE}" _TMP_STR "${VALUES}")
170
  string (REGEX REPLACE "[\\](.)" "\\1" _TMP_STR "${_TMP_STR}") #fixes escaping
171
  set (${OUTPUT} "${_TMP_STR}" PARENT_SCOPE)
172
endfunction()
165 173

  
regression_tests/modules/XPathParser_lusi.java
1
import java.io.BufferedReader;
2
import java.io.File;
3
import java.io.FileInputStream;
4
import java.io.FileNotFoundException;
5
import java.io.IOException;
6
import java.io.InputStream;
7
import java.io.InputStreamReader;
8
import java.io.PrintWriter;
9
import java.io.UnsupportedEncodingException;
10
import java.nio.charset.Charset;
11
import java.util.ArrayList;
12
import java.util.HashMap;
13
import java.util.Iterator;
14
import java.util.Map;
15

  
16
import javax.xml.parsers.DocumentBuilder;
17
import javax.xml.parsers.DocumentBuilderFactory;
18
import javax.xml.parsers.ParserConfigurationException;
19
import javax.xml.xpath.XPath;
20
import javax.xml.xpath.XPathConstants;
21
import javax.xml.xpath.XPathExpressionException;
22
import javax.xml.xpath.XPathFactory;
23

  
24
import org.w3c.dom.Document;
25
import org.w3c.dom.Element;
26
import org.w3c.dom.Node;
27
import org.w3c.dom.NodeList;
28
import org.xml.sax.SAXException;
29
//use : java XPathParser_lusi Node_name lusi_file xml_file
30
public class XPathParser_lusi {
31

  
32
	public static void main(String[] args) {
33
		/*parse lusi file*/
34
		String line;
35
		ArrayList<String> inputs_names  =new ArrayList<String>(); 
36
		ArrayList<String> inputs_types =new ArrayList<String>();
37
		ArrayList<String> outputs_names = new ArrayList<String>();
38
		ArrayList<String> outputs_types = new ArrayList<String>();
39
		try(
40
		InputStream fis = new FileInputStream(args[1]);
41
		InputStreamReader isr = new InputStreamReader(fis, Charset.forName("UTF-8"));
42
		BufferedReader br = new BufferedReader(isr);
43

  
44
		){
45
			while ((line = br.readLine()) != null) {
46
				String node = "node "+args[0];
47
				
48
				if(line.startsWith(node)){
49
					String new_line = line.replace(node, "");
50
					System.out.println(new_line);
51
					String delims = "returns";
52
					String[] inputs_outputs = new_line.split(delims);
53
					String inputs = inputs_outputs[0];
54
					String outputs = inputs_outputs[1];
55
					delims = "([(;)])";
56
					String[] inputsTokens = inputs.split(delims);
57
					for(int i=0;i<inputsTokens.length;i++){
58
						inputsTokens[i] = inputsTokens[i].replace(" ", "");
59
						if(inputsTokens[i].contains(":")){
60
							String[] varName_type = inputsTokens[i].split(":");
61
							inputs_names.add(varName_type[0]);
62
							inputs_types.add(varName_type[1]);
63
							//System.out.println("in:"+inputs_names.get(inputs_names.size()-1)+": "+inputs_types.get(inputs_names.size()-1));
64
						}
65
					}
66
					String[] outputsTokens = outputs.split(delims);
67
					for(int i=0;i<outputsTokens.length;i++){
68
						outputsTokens[i] = outputsTokens[i].replace(" ", "");
69
						if(outputsTokens[i].contains(":")){
70
							String[] varName_type = outputsTokens[i].split(":");
71
							outputs_names.add(varName_type[0]);
72
							outputs_types.add(varName_type[1]);
73
							//System.out.println("out:"+outputs_names.get(outputs_names.size()-1)+": "+outputs_types.get(outputs_names.size()-1));
74
						}
75
					}
76
				}
77
		        
78
		    }
79
		} catch (IOException e) {
80
			// TODO Auto-generated catch block
81
			e.printStackTrace();
82
		}
83
		int nbInputs = inputs_names.size();
84
		int nbOutputs = outputs_names.size();
85
		int nbInstants = 0;
86
		Map<String,ArrayList<String>> inputs_Data = new HashMap<String,ArrayList<String>>();
87
		Map<String,ArrayList<String>> outputs_Data = new HashMap<String,ArrayList<String>>();
88
		/*parse xml file*/
89
		try {
90
			File xmlFile = new File(args[2]);
91
			DocumentBuilderFactory dbFactory 
92
			= DocumentBuilderFactory.newInstance();
93
			DocumentBuilder dBuilder;
94

  
95
			dBuilder = dbFactory.newDocumentBuilder();
96

  
97
			Document doc = dBuilder.parse(xmlFile);
98
			doc.getDocumentElement().normalize();
99

  
100
			XPath xPath =  XPathFactory.newInstance().newXPath();
101
			for(String s : inputs_names) {
102
				System.out.println("in:"+s);
103
				String expression = "//Stream[@name='"+s+"']";	        
104
				NodeList nodeList = (NodeList) xPath.compile(expression).evaluate(doc, XPathConstants.NODESET);
105
					Node nNode = nodeList.item(0);
106
					if (nNode.getNodeType() == Node.ELEMENT_NODE) {
107
						Element eElement = (Element) nNode;
108
						NodeList Values_Tags = eElement.getElementsByTagName("Value");
109
						ArrayList<String> values = new ArrayList<String>();
110
						for (int i = 0; i < Values_Tags.getLength(); i++) {
111
							String v = Values_Tags.item(i).getTextContent();
112
							System.out.println("Value "+i+": " + v);
113
							values.add(v);
114
						}
115
						inputs_Data.put(s, values);
116
					}
117
			}
118
			for(String s : outputs_names) {
119
				System.out.println("out:"+s);
120
				String expression = "//Stream[@name='"+s+"']";	        
121
				NodeList nodeList = (NodeList) xPath.compile(expression).evaluate(doc, XPathConstants.NODESET);
122
					Node nNode = nodeList.item(0);
123
					if (nNode.getNodeType() == Node.ELEMENT_NODE) {
124
						Element eElement = (Element) nNode;
125
						NodeList Values_Tags = eElement.getElementsByTagName("Value");
126
						ArrayList<String> values = new ArrayList<String>();
127
						for (int i = 0; i < Values_Tags.getLength(); i++) {
128
							String v = Values_Tags.item(i).getTextContent();
129
							System.out.println("Value "+i+": " + v);
130
							values.add(v);
131
						}
132
						outputs_Data.put(s, values);
133
						 nbInstants = values.size();
134
					}
135
			}
136
			
137
			
138
		} catch (ParserConfigurationException e) {
139
			e.printStackTrace();
140
		} catch (SAXException e) {
141
			e.printStackTrace();
142
		} catch (IOException e) {
143
			e.printStackTrace();
144
		} catch (XPathExpressionException e) {
145
			e.printStackTrace();
146
		}
147
		
148
		
149
		//print inputs to a file
150
		PrintWriter writer_in, writer_out;
151
		try {
152
			writer_in = new PrintWriter("input_values", "UTF-8");
153
			writer_out = new PrintWriter("xml_output_values", "UTF-8");
154
			for(int instant=0; instant<nbInstants; instant++){
155
				for (Iterator<String> iterator = inputs_names.iterator(); iterator.hasNext();) {
156
					String name = iterator.next();
157
					ArrayList<String> values = inputs_Data.get(name);
158
					writer_in.println(values.get(instant));
159
				}
160
				for (Iterator<String> iterator = outputs_names.iterator(); iterator.hasNext();) {
161
					String name = iterator.next();
162
					ArrayList<String> values = outputs_Data.get(name);
163
					writer_out.println("'"+name+"': '"+values.get(instant)+"' ");
164
				}
165
			}
166
			writer_in.close();
167
			writer_out.close();
168
		} catch (FileNotFoundException | UnsupportedEncodingException e) {
169
			// TODO Auto-generated catch block
170
			e.printStackTrace();
171
		}
172
	    
173
	}
174
}

Also available in: Unified diff