boolean success= false; try { if (arguments.length > 0) { try { final ObjectStreamClass stream= ObjectStreamClass.lookup(Class.forName(arguments[0])); if (stream != null) { System.out.println(RESULT_PREFIX + String.valueOf(stream.getSerialVersionUID()) + RESULT_POSTFIX); success= true; } else System.err.println(ERROR_PREFIX + SerialVersionMessages.getFormattedString("SerialVersionComputer.not.serializable", arguments[0]) + ERROR_POSTFIX); } catch (ClassNotFoundException exception) { System.err.println(ERROR_PREFIX + SerialVersionMessages.getFormattedString("SerialVersionComputer.not.resolvable", arguments[0]) + ERROR_POSTFIX);
BufferedWriter logger= null; if (DEBUG) { try { logger= new BufferedWriter(new OutputStreamWriter(new FileOutputStream("C:\\serial.log"))); final Date date= new Date(System.currentTimeMillis()); logger.write("Begin Session: " + DateFormat.getDateInstance().format(date) + " at " + DateFormat.getTimeInstance().format(date) + "\r\n"); logger.write("Argument Count: " + arguments.length + "\r\n"); } catch (IOException exception) {  } } if (arguments.length > 0) { final String directory= System.getProperty("java.io.tmpdir"); if (directory != null && !"".equals(directory)) { final String separator= System.getProperty("file.separator"); if (separator != null && !"".equals(separator)) { final File file= new File(directory + separator + TEMP_FILE_NAME); if (DEBUG) { try { logger.write("Created file: " + file.getCanonicalPath() + "\r\n"); } catch (IOException exception) {  } } Writer writer= null; try { file.delete(); file.createNewFile(); writer= new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file), TEMP_FILE_ENCODING)); try { final ObjectStreamClass clazz= ObjectStreamClass.lookup(Class.forName(arguments[0])); if (clazz != null) { writer.write(new Long(clazz.getSerialVersionUID()).toString()); writer.write('\n'); } else { writer.write(SerialVersionMessages.getString("SerialVersionComputer.not.serializable")); writer.write('\n'); } } catch (ClassNotFoundException exception) { writer.write(SerialVersionMessages.getString("SerialVersionComputer.not.resolvable")); writer.write('\n'); } } catch (Throwable throwable) { if (DEBUG) { PrintWriter printer= null; try { logger.write("Exception occurred: " + throwable.getLocalizedMessage() + "\r\n"); printer= new PrintWriter(logger); throwable.printStackTrace(printer); } catch (IOException exc) {  } finally { if (printer != null) { printer.close(); } } } } finally { if (writer != null) { try { writer.close(); } catch (IOException exception) {  } } }
	public static void main(final String[] arguments) {		boolean success= false;		try {			if (arguments.length > 0) {				try {					final ObjectStreamClass stream= ObjectStreamClass.lookup(Class.forName(arguments[0]));					if (stream != null) {						System.out.println(RESULT_PREFIX + String.valueOf(stream.getSerialVersionUID()) + RESULT_POSTFIX);						success= true;					} else						System.err.println(ERROR_PREFIX + SerialVersionMessages.getFormattedString("SerialVersionComputer.not.serializable", arguments[0]) + ERROR_POSTFIX); //$NON-NLS-1$				} catch (ClassNotFoundException exception) {					System.err.println(ERROR_PREFIX + SerialVersionMessages.getFormattedString("SerialVersionComputer.not.resolvable", arguments[0]) + ERROR_POSTFIX); //$NON-NLS-1$				}			} else				System.err.println(ERROR_PREFIX + SerialVersionMessages.getString("SerialVersionComputer.no.argument") + ERROR_POSTFIX); //$NON-NLS-1$		} finally {			if (!success)				System.out.println(RESULT_PREFIX + String.valueOf(1) + RESULT_POSTFIX);		}	}