<commit_before>package org.pathvisio.gui.wikipathways;

import java.io.File;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;
import java.sql.SQLException;

import javax.jnlp.BasicService;
import javax.jnlp.ServiceManager;
import javax.swing.JOptionPane;

import org.pathvisio.debug.Logger;
import org.pathvisio.model.Pathway;

public class GenMappExporter {
	public static void main(String[] args) {
		try {
			if(args.length != 2) {
				throw new IllegalArgumentException(
						"Invalid number of arguments: " + args.length
				);
			}
			URL pwUrl = new URL(args[0]);
			String pwName = args[1];
			File mappFile = doExport(pwUrl, pwName);
			
			BasicService basicService = (BasicService)ServiceManager.lookup("javax.jnlp.BasicService");
			basicService.showDocument(new URL("file://" + mappFile.getAbsolutePath()));
		} catch(Exception e) {
			Logger.log.error("Error converting to GenMAPP format", e);
			String message = "Unable to save GenMAPP file\n" + e.getClass() + ": " + e.getMessage(); 				
			if(e.getCause() instanceof SQLException) {
				message = "Exporting GenMAPP files is only supported on Windows";
			}
			JOptionPane.showMessageDialog(null, 
					message + "\nSee error log for datails", 
					"Error",
					JOptionPane.ERROR_MESSAGE);
		}
	}

	/**
	 * Export to GenMAPP
	 */
	static File doExport(URL pwUrl, String pwName) throws Exception {
		//Load the pathway
		URLConnection con = pwUrl.openConnection();
		InputStreamReader reader = new InputStreamReader(con.getInputStream());
		Pathway pathway = new Pathway();
		pathway.readFromXml(reader, true);

		//Convert to temp file
		File mappFile = File.createTempFile(pwName, "mapp");
		pathway.writeToMapp(mappFile);

		return mappFile;
	}
}<commit_msg>small fix to genmapp exporter<commit_after>package org.pathvisio.gui.wikipathways;

import java.io.File;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;
import java.sql.SQLException;

import javax.jnlp.BasicService;
import javax.jnlp.ServiceManager;
import javax.swing.JOptionPane;

import org.pathvisio.debug.Logger;
import org.pathvisio.model.Pathway;

public class GenMappExporter {
	public static void main(String[] args) {
		try {
			if(args.length != 2) {
				throw new IllegalArgumentException(
						"Invalid number of arguments: " + args.length
				);
			}
			URL pwUrl = new URL(args[0]);
			String pwName = args[1];
			File mappFile = doExport(pwUrl, pwName);
			
			BasicService basicService = (BasicService)ServiceManager.lookup("javax.jnlp.BasicService");
			basicService.showDocument(new URL("file://" + mappFile.getAbsolutePath()));
		} catch(Exception e) {
			Logger.log.error("Error converting to GenMAPP format", e);
			String message = "Unable to save GenMAPP file\n" + e.getClass() + ": " + e.getMessage(); 				
			if(e.getCause() instanceof SQLException) {
				message = "Exporting GenMAPP files is only supported on Windows";
			}
			JOptionPane.showMessageDialog(null, 
					message + "\nSee error log for datails", 
					"Error",
					JOptionPane.ERROR_MESSAGE);
		}
		System.exit(0);
	}

	/**
	 * Export to GenMAPP
	 */
	static File doExport(URL pwUrl, String pwName) throws Exception {
		//Load the pathway
		URLConnection con = pwUrl.openConnection();
		InputStreamReader reader = new InputStreamReader(con.getInputStream());
		Pathway pathway = new Pathway();
		pathway.readFromXml(reader, true);

		//Convert to temp file
		File mappFile = File.createTempFile(pwName, ".mapp");
		pathway.writeToMapp(mappFile);

		return mappFile;
	}
}
{'fraction_non_alphanumeric': 0.11789414729767572, 'fraction_numerical': 0.0019602352282273874, 'mean_word_length': 4.102857142857143, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '829961', 'n_tokens_mistral': 1297, 'n_tokens_neox': 1144, 'n_words': 273}