Input:
    public void testBuildReader()
        throws Exception
    {
        PluginDescriptor pd = build( "/plugin.xml" );
        assertEquals( "org.apache.maven.plugins", pd.getGroupId() );
        assertEquals( "maven-jar-plugin", pd.getArtifactId() );
        assertEquals( "2.3-SNAPSHOT", pd.getVersion() );
        assertEquals( "jar", pd.getGoalPrefix() );
        assertEquals( "plugin-description", pd.getDescription() );
        assertEquals( false, pd.isIsolatedRealm() );
        assertEquals( true, pd.isInheritedByDefault() );
        assertEquals( 2, pd.getMojos().size() );
        assertEquals( 1, pd.getDependencies().size() );
        MojoDescriptor md = pd.getMojos().get( 0 );
        assertEquals( "jar", md.getGoal() );
        assertEquals( "mojo-description", md.getDescription() );
        assertEquals( "runtime", md.getDependencyResolutionRequired() );
        assertEquals( "test", md.getDependencyCollectionRequired() );
        assertEquals( false, md.isAggregator() );
        assertEquals( false, md.isDirectInvocationOnly() );
        assertEquals( true, md.isInheritedByDefault() );
        assertEquals( false, md.isOnlineRequired() );
        assertEquals( true, md.isProjectRequired() );
        assertEquals( false, md.isThreadSafe() );
        assertEquals( "package", md.getPhase() );
        assertEquals( "org.apache.maven.plugin.jar.JarMojo", md.getImplementation() );
        assertEquals( "antrun", md.getComponentConfigurator() );
        assertEquals( "java", md.getLanguage() );
        assertEquals( "per-lookup", md.getInstantiationStrategy() );
        assertEquals( "some-goal", md.getExecuteGoal() );
        assertEquals( "generate-sources", md.getExecutePhase() );
        assertEquals( "cobertura", md.getExecuteLifecycle() );
        assertEquals( "2.2", md.getSince() );
        assertEquals( "deprecated-mojo", md.getDeprecated() );
        assertEquals( 1, md.getRequirements().size() );
        assertEquals( 1, md.getParameters().size() );
        assertNotNull( md.getMojoConfiguration() );
        assertEquals( 1, md.getMojoConfiguration().getChildCount() );
        PlexusConfiguration pc = md.getMojoConfiguration().getChild( 0 );
        assertEquals( "${jar.finalName}", pc.getValue() );
        assertEquals( "${project.build.finalName}", pc.getAttribute( "default-value" ) );
        assertEquals( "java.lang.String", pc.getAttribute( "implementation" ) );
        Parameter mp = md.getParameters().get( 0 );
        assertEquals( "finalName", mp.getName() );
        assertEquals( "jarName", mp.getAlias() );
        assertEquals( "java.lang.String", mp.getType() );
        assertEquals( true, mp.isEditable() );
        assertEquals( false, mp.isRequired() );
        assertEquals( "parameter-description", mp.getDescription() );
        assertEquals( "deprecated-parameter", mp.getDeprecated() );
        assertEquals( "${jar.finalName}", mp.getExpression() );
        assertEquals( "${project.build.finalName}", mp.getDefaultValue() );
        ComponentRequirement cr = md.getRequirements().get( 0 );
        assertEquals( "org.codehaus.plexus.archiver.Archiver", cr.getRole() );
        assertEquals( "jar", cr.getRoleHint() );
        assertEquals( "jarArchiver", cr.getFieldName() );
        ComponentDependency cd = pd.getDependencies().get( 0 );
        assertEquals( "org.apache.maven", cd.getGroupId() );
        assertEquals( "maven-plugin-api", cd.getArtifactId() );
        assertEquals( "2.0.6", cd.getVersion() );
        assertEquals( "jar", cd.getType() );
        md = pd.getMojos().get( 1 );
        assertEquals( "war", md.getGoal() );
        assertEquals( null, md.getDependencyResolutionRequired() );
        assertEquals( null, md.getDependencyCollectionRequired() );
        assertEquals( true, md.isThreadSafe() );
    }

Output:
    public void testBuildReader()
        throws Exception
    {
        PluginDescriptor pd = build( "/plugin.xml" );
        assertEquals( "org.apache.maven.plugins", pd.getGroupId() );
        assertEquals( "maven-jar-plugin", pd.getArtifactId() );
        assertEquals( "2.3-SNAPSHOT", pd.getVersion() );
        assertEquals( "jar", pd.getGoalPrefix() );
        assertEquals( "plugin-description", pd.getDescription() );
        assertEquals( false, pd.isIsolatedRealm() );
        assertEquals( true, pd.isInheritedByDefault() );
        assertEquals( 2, pd.getMojos().size() );
        assertEquals( 1, pd.getDependencies().size() );
        MojoDescriptor md = pd.getMojos().get( 0 );
        assertEquals( "jar", md.getGoal() );
        assertEquals( "mojo-description", md.getDescription() );
        assertEquals( "runtime", md.getDependencyResolutionRequired() );
        assertEquals( "test", md.getDependencyCollectionRequired() );
        assertEquals( false, md.isAggregator() );
        assertEquals( false, md.isDirectInvocationOnly() );
        assertEquals( true, md.isInheritedByDefault() );
        assertEquals( false, md.isOnlineRequired() );
        assertEquals( true, md.isProjectRequired() );
        assertEquals( false, md.isThreadSafe() );
        assertEquals( "package", md.getPhase() );
        assertEquals( "org.apache.maven.plugin.jar.JarMojo", md.getImplementation() );
        assertEquals( "antrun", md.getComponentConfigurator() );
        assertEquals( "java", md.getLanguage() );
        assertEquals( "per-lookup", md.getInstantiationStrategy() );
        assertEquals( "some-goal", md.getExecuteGoal() );
        assertEquals( "generate-sources", md.getExecutePhase() );
        assertEquals( "cobertura", md.getExecuteLifecycle() );
        assertEquals( "2.2", md.getSince() );
        assertEquals( "deprecated-mojo", md.getDeprecated() );
        assertEquals( 1, md.getRequirements().size() );
        assertEquals( 1, md.getParameters().size() );
        assertNotNull( md.getMojoConfiguration() );
        assertEquals( 1, md.getMojoConfiguration().getChildCount() );
        PlexusConfiguration pc = md.getMojoConfiguration().getChild( 0 );
        assertEquals( "${jar.finalName}", pc.getValue() );
        assertEquals( "${project.build.finalName}", pc.getAttribute( "default-value" ) );
        Parameter mp = md.getParameters().get( 0 );
        assertEquals( "finalName", mp.getName() );
        assertEquals( "jarName", mp.getAlias() );
        assertEquals( "java.lang.String", mp.getType() );
        assertEquals( "java.lang.String", mp.getImplementation() );
        assertEquals( true, mp.isEditable() );
        assertEquals( false, mp.isRequired() );
        assertEquals( "parameter-description", mp.getDescription() );
        assertEquals( "deprecated-parameter", mp.getDeprecated() );
        assertEquals( "${jar.finalName}", mp.getExpression() );
        assertEquals( "${project.build.finalName}", mp.getDefaultValue() );
        ComponentRequirement cr = md.getRequirements().get( 0 );
        assertEquals( "org.codehaus.plexus.archiver.Archiver", cr.getRole() );
        assertEquals( "jar", cr.getRoleHint() );
        assertEquals( "jarArchiver", cr.getFieldName() );
        ComponentDependency cd = pd.getDependencies().get( 0 );
        assertEquals( "org.apache.maven", cd.getGroupId() );
        assertEquals( "maven-plugin-api", cd.getArtifactId() );
        assertEquals( "2.0.6", cd.getVersion() );
        assertEquals( "jar", cd.getType() );
        md = pd.getMojos().get( 1 );
        assertEquals( "war", md.getGoal() );
        assertEquals( null, md.getDependencyResolutionRequired() );
        assertEquals( null, md.getDependencyCollectionRequired() );
        assertEquals( true, md.isThreadSafe() );
    }


Input:
	private boolean insertIntoTable(String className, Product product) {
		try {
			int originalCount = getRecordCount(className);
			Class<?> c = product.getClass();
			Field[] fields = c.getFields();
			fields = sortFields(fields);
			String sql = "INSERT INTO " + className + "(";
			for (int i = 0; i < fields.length; i++) {
				sql += fields[i].getName();
				if (i < fields.length-1) {
					sql += ",";
				}
			}
			sql += ") values (";
			for (int i = 0; i < fields.length; i++) {
				sql += "?";
				if (i < fields.length-1) {
					sql += ",";
				}
			}
			sql += ");";
			PreparedStatement preparedStatement = conn.prepareStatement(sql);
			preparedStatement.setInt(1, 1);
			for (int i = 0; i < fields.length; i++) {
				Object obj = fields[i].get(product);
				String data = "";
				if (obj != null) {
					data = fields[i].get(product).toString();
				}
				setPreparedStatementValues(preparedStatement, fields[i], i+1, product);
			}
			preparedStatement.addBatch();
			preparedStatement.executeBatch();
			if (getRecordCount(className) == originalCount+1) {
				return true;
			} else {
				return false;
			}
		} catch (Exception e) {
			System.err.println("Error on database insert");
			e.printStackTrace();
			return false;
		}
	}

Output:
	private boolean insertIntoTable(String className, Product product) {
		try {
			int originalCount = getRecordCount(className);
			Class<?> c = product.getClass();
			Field[] fields = c.getFields();
			fields = sortFields(fields);
			String sql = "INSERT INTO " + className + "(";
			for (int i = 0; i < fields.length; i++) {
				sql += fields[i].getName();
				if (i < fields.length-1) {
					sql += ",";
				}
			}
			sql += ") values (";
			for (int i = 0; i < fields.length; i++) {
				sql += "?";
				if (i < fields.length-1) {
					sql += ",";
				}
			}
			sql += ");";
			PreparedStatement preparedStatement = conn.prepareStatement(sql);
			preparedStatement.setInt(1, 1);
			for (int i = 0; i < fields.length; i++) {
				Object obj = fields[i].get(product);
				String data = "";
				if (obj != null) {
					data = fields[i].get(product).toString();
					setPreparedStatementValues(preparedStatement, fields[i], i+1, product);
				}
			}
			preparedStatement.addBatch();
			preparedStatement.executeBatch();
			if (getRecordCount(className) == originalCount+1) {
				return true;
			} else {
				return false;
			}
		} catch (Exception e) {
			System.err.println("Error on database insert");
			e.printStackTrace();
			return false;
		}
	}