#vulnerable code 
                             private int runRuby(File ruFile, String[] stmts, String[] scriptPaths) {
		int exitCode = 0;
		String stmt = "";
		boolean fromIDE = false;
		String filename = "<script>";
		try {
			if (null == ruFile) {
				log(lvl, "runRuby: running statements");
				StringBuilder buffer = new StringBuilder();
				for (String e : stmts) {
					buffer.append(e);
				}
				interpreter.setScriptFilename(filename);
				interpreter.runScriptlet(buffer.toString());
			} else {
				filename = ruFile.getAbsolutePath();
				if (scriptPaths != null) {
					FileReader script = new FileReader(ruFile.getAbsolutePath());
// TODO implement compile only !!!
					if (scriptPaths[0].toUpperCase().equals(COMPILE_ONLY)) {
						log(lvl, "runRuby: running COMPILE_ONLY");
						EvalUnit unit = interpreter.parse(script, filename);
						//unit.run();
					} else {
						if (scriptPaths.length > 1) {
							filename = FileManager.slashify(scriptPaths[0], true)
											+ scriptPaths[1] + ".sikuli";
							log(lvl, "runRuby: running script from IDE: \n" + filename);
							fromIDE = true;
						} else {
							filename = scriptPaths[0];
							log(lvl, "runRuby: running script: \n" + filename);
						}
						interpreter.runScriptlet(script, filename);
					}
				} else {
					log(-1, "runRuby: invalid arguments");
					exitCode = -1;
				}
			}
		} catch (Exception e) {
			java.util.regex.Pattern p
							= java.util.regex.Pattern.compile("SystemExit: ([0-9]+)");
			Matcher matcher = p.matcher(e.toString());
//TODO error stop I18N
			if (matcher.find()) {
				exitCode = Integer.parseInt(matcher.group(1));
				Debug.info("Exit code: " + exitCode);
			} else {
				//log(-1,_I("msgStopped"));
				if (null != ruFile) {
					exitCode = findErrorSource(e, filename, scriptPaths);
				} else {
					Debug.error("runRuby: Ruby exception: %s with %s", e.getMessage(), stmt);
				}
				if (fromIDE) {
					exitCode *= -1;
				} else {
					exitCode = 1;
				}
			}
		}
		return exitCode;
	} 
                            #location 18 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                             private int runRuby(File ruFile, String[] stmts, String[] scriptPaths) {
		int exitCode = 0;
		String stmt = "";
		boolean fromIDE = false;
		String filename = "<script>";
		try {
			if (null == ruFile) {
				log(lvl, "runRuby: running statements");
				StringBuilder buffer = new StringBuilder();
				for (String e : stmts) {
					buffer.append(e);
				}
				interpreter.setScriptFilename(filename);
				interpreter.runScriptlet(buffer.toString());
			} else {
				filename = ruFile.getAbsolutePath();
				if (scriptPaths != null) {
					BufferedReader script = new BufferedReader(
						new InputStreamReader(
							new FileInputStream(ruFile.getAbsolutePath()), "UTF-8"));
// TODO implement compile only !!!
					if (scriptPaths[0].toUpperCase().equals(COMPILE_ONLY)) {
						log(lvl, "runRuby: running COMPILE_ONLY");
						EvalUnit unit = interpreter.parse(script, filename);
						//unit.run();
					} else {
						if (scriptPaths.length > 1) {
							filename = FileManager.slashify(scriptPaths[0], true)
											+ scriptPaths[1] + ".sikuli";
							log(lvl, "runRuby: running script from IDE: \n" + filename);
							fromIDE = true;
						} else {
							filename = scriptPaths[0];
							log(lvl, "runRuby: running script: \n" + filename);
						}
						interpreter.runScriptlet(script, filename);
					}
				} else {
					log(-1, "runRuby: invalid arguments");
					exitCode = -1;
				}
			}
		} catch (Exception e) {
			java.util.regex.Pattern p
							= java.util.regex.Pattern.compile("SystemExit: ([0-9]+)");
			Matcher matcher = p.matcher(e.toString());
//TODO error stop I18N
			if (matcher.find()) {
				exitCode = Integer.parseInt(matcher.group(1));
				Debug.info("Exit code: " + exitCode);
			} else {
				//log(-1,_I("msgStopped"));
				if (null != ruFile) {
					exitCode = findErrorSource(e, filename, scriptPaths);
				} else {
					Debug.error("runRuby: Ruby exception: %s with %s", e.getMessage(), stmt);
				}
				if (fromIDE) {
					exitCode *= -1;
				} else {
					exitCode = 1;
				}
			}
		}
		return exitCode;
	}