Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/SourceTransformerDefinition.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/SourceTransformerDefinition.java?rev=1839288&r1=1839287&r2=1839288&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/SourceTransformerDefinition.java (original) +++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/SourceTransformerDefinition.java Mon Aug 27 09:48:33 2018 @@ -73,7 +73,7 @@ public final class SourceTransformerDefi public int hashCode() { HashCodeBuilder hashCodeBuilder = new HashCodeBuilder() - .append(sourceTransformer); + .append(sourceTransformer); return hashCodeBuilder.toHashCode(); } @@ -94,7 +94,7 @@ public final class SourceTransformerDefi } SourceTransformerDefinition other = (SourceTransformerDefinition) obj; EqualsBuilder equalsBuilder = new EqualsBuilder() - .append(sourceTransformer, other.sourceTransformer); + .append(sourceTransformer, other.sourceTransformer); return equalsBuilder.isEquals(); } }
Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/jdbc/ForeignKeyMetadata.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/jdbc/ForeignKeyMetadata.java?rev=1839288&r1=1839287&r2=1839288&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/jdbc/ForeignKeyMetadata.java (original) +++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/jdbc/ForeignKeyMetadata.java Mon Aug 27 09:48:33 2018 @@ -36,10 +36,10 @@ public class ForeignKeyMetadata private String foreignKeyName; /** The local columns of the foreign key. */ - private List<String> localColumns = new ArrayList<String>(); + private List<String> localColumns = new ArrayList<>(); /** The foreign columns of the foreign key. */ - private List<String> foreignColumns = new ArrayList<String>(); + private List<String> foreignColumns = new ArrayList<>(); /** * Returns the name of the referenced (foreign) table. Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/jdbc/JdbcMetadataSource.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/jdbc/JdbcMetadataSource.java?rev=1839288&r1=1839287&r2=1839288&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/jdbc/JdbcMetadataSource.java (original) +++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/jdbc/JdbcMetadataSource.java Mon Aug 27 09:48:33 2018 @@ -102,7 +102,7 @@ public class JdbcMetadataSource extends * The position in foreign key metadata containing the foreign column name. */ private static final int FOREIGN_COLUMN_NAME_POS_IN_FOREIGN_KEY_METADATA - = 4; + = 4; /** * The position in foreign key metadata containing the localcolumn name. @@ -192,9 +192,9 @@ public class JdbcMetadataSource extends table.setAttribute("name", tableName); List<ColumnMetadata> columns - = getColumns(dbMetaData, tableName, schema); + = getColumns(dbMetaData, tableName, schema); Set<String> primaryKeys - = getPrimaryKeys(dbMetaData, tableName, schema); + = getPrimaryKeys(dbMetaData, tableName, schema); for (ColumnMetadata col : columns) { @@ -260,7 +260,7 @@ public class JdbcMetadataSource extends // Foreign keys for this table. Collection<ForeignKeyMetadata> forgnKeys - = getForeignKeys(dbMetaData, tableName, schema); + = getForeignKeys(dbMetaData, tableName, schema); for (ForeignKeyMetadata foreignKeyMetadata : forgnKeys) { SourceElement fk = new SourceElement("foreign-key"); @@ -287,11 +287,13 @@ public class JdbcMetadataSource extends return rootElement; } + @Override public String getDescription() { return "JdbcMetadataSource using url " + url; } + @Override public File getSourceFile() { return null; @@ -306,10 +308,10 @@ public class JdbcMetadataSource extends * @throws SQLException */ List<String> getTableNames(final DatabaseMetaData dbMeta, final String dbSchema) - throws SQLException + throws SQLException { log.debug("Getting table list..."); - List<String> tables = new ArrayList<String>(); + List<String> tables = new ArrayList<>(); // these are the entity types we want from the database String[] types = {"TABLE", "VIEW"}; try (ResultSet tableNames = dbMeta.getTables(null, dbSchema, "%", types)) @@ -339,9 +341,9 @@ public class JdbcMetadataSource extends final DatabaseMetaData dbMeta, final String tableName, final String dbSchema) - throws SQLException + throws SQLException { - List<ColumnMetadata> columns = new ArrayList<ColumnMetadata>(); + List<ColumnMetadata> columns = new ArrayList<>(); try (ResultSet columnSet = dbMeta.getColumns(null, dbSchema, tableName, null)) { while (columnSet.next()) @@ -383,12 +385,12 @@ public class JdbcMetadataSource extends * @throws SQLException */ Set<String> getPrimaryKeys( - final DatabaseMetaData dbMeta, - final String tableName, - final String schemaName) - throws SQLException + final DatabaseMetaData dbMeta, + final String tableName, + final String schemaName) + throws SQLException { - Set<String> pk = new HashSet<String>(); + Set<String> pk = new HashSet<>(); try (ResultSet parts = dbMeta.getPrimaryKeys(null, schemaName, tableName)) { while (parts.next()) @@ -410,13 +412,13 @@ public class JdbcMetadataSource extends * @throws SQLException */ Collection<ForeignKeyMetadata> getForeignKeys( - final DatabaseMetaData dbMeta, - final String tableName, - final String schemaName) - throws SQLException + final DatabaseMetaData dbMeta, + final String tableName, + final String schemaName) + throws SQLException { Map<String, ForeignKeyMetadata> foreignKeys - = new HashMap<String, ForeignKeyMetadata>(); + = new HashMap<>(); try (ResultSet resultSet = dbMeta.getImportedKeys(null, schemaName, tableName)) { while (resultSet.next()) @@ -449,9 +451,9 @@ public class JdbcMetadataSource extends // this seems to be happening in some db drivers (sybase) // when retrieving foreign keys from views. log.warn("WARN: Could not read foreign keys for Table " - + tableName - + " : " - + e.getMessage()); + + tableName + + " : " + + e.getMessage()); } return foreignKeys.values(); @@ -462,6 +464,7 @@ public class JdbcMetadataSource extends * * @return always null because no source file exist. */ + @Override public Date getLastModified() { return null; @@ -472,6 +475,7 @@ public class JdbcMetadataSource extends * * @return always null. */ + @Override public byte[] getContentChecksum() { // Although we could determine a checksum for the content, Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/jdbc/JdbcMetadataSourceProvider.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/jdbc/JdbcMetadataSourceProvider.java?rev=1839288&r1=1839287&r2=1839288&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/jdbc/JdbcMetadataSourceProvider.java (original) +++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/jdbc/JdbcMetadataSourceProvider.java Mon Aug 27 09:48:33 2018 @@ -66,12 +66,12 @@ public class JdbcMetadataSourceProvider private boolean nextCalled = false; public JdbcMetadataSourceProvider( - String urlOption, - String driverOption, - String usernameOption, - String passwordOption, - String schemaOption) - throws ConfigurationException + String urlOption, + String driverOption, + String usernameOption, + String passwordOption, + String schemaOption) + throws ConfigurationException { if (urlOption == null) { @@ -82,7 +82,7 @@ public class JdbcMetadataSourceProvider { throw new ConfigurationException( "JdbcMetadataSourceProvider:" - + " driverOption must not be null"); + + " driverOption must not be null"); } this.urlOption = urlOption; this.driverOption = driverOption; @@ -97,10 +97,11 @@ public class JdbcMetadataSourceProvider * * @throws Exception a generic exception. */ + @Override public void initInternal( - ConfigurationHandlers configurationHandlers, - ControllerState controllerState) - throws ConfigurationException + ConfigurationHandlers configurationHandlers, + ControllerState controllerState) + throws ConfigurationException { driver = controllerState.getStringOption(driverOption); url = controllerState.getStringOption(urlOption); @@ -118,11 +119,13 @@ public class JdbcMetadataSourceProvider } } + @Override public boolean hasNext() { return !nextCalled; } + @Override public Source next() { if (nextCalled) @@ -134,10 +137,11 @@ public class JdbcMetadataSourceProvider } + @Override protected void resetInternal( - ConfigurationHandlers configurationHandlers, - ControllerState controllerState) - throws ConfigurationException + ConfigurationHandlers configurationHandlers, + ControllerState controllerState) + throws ConfigurationException { driver = null; url = null; @@ -147,6 +151,7 @@ public class JdbcMetadataSourceProvider nextCalled = false; } + @Override public void remove() { throw new UnsupportedOperationException(); @@ -206,6 +211,7 @@ public class JdbcMetadataSourceProvider /** * {@inheritDoc} */ + @Override public SourceProvider copy() throws ConfigurationException { JdbcMetadataSourceProvider result = new JdbcMetadataSourceProvider( @@ -220,6 +226,7 @@ public class JdbcMetadataSourceProvider /** * {@inheritDoc} */ + @Override public void copyNotSetSettingsFrom(SourceProvider sourceProvider) { // do nothing. Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/skipDecider/StopGenerationDecider.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/skipDecider/StopGenerationDecider.java?rev=1839288&r1=1839287&r2=1839288&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/skipDecider/StopGenerationDecider.java (original) +++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/skipDecider/StopGenerationDecider.java Mon Aug 27 09:48:33 2018 @@ -36,6 +36,7 @@ public class StopGenerationDecider imple * * @return <code>false</code> */ + @Override public boolean proceed(ControllerState controllerState) { return false; Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/stream/CombinedFileSource.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/stream/CombinedFileSource.java?rev=1839288&r1=1839287&r2=1839288&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/stream/CombinedFileSource.java (original) +++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/stream/CombinedFileSource.java Mon Aug 27 09:48:33 2018 @@ -83,7 +83,7 @@ public class CombinedFileSource extends { throw new NullPointerException("path must not be null"); } - this.fileSources = new ArrayList<FileSource>(fileSources); + this.fileSources = new ArrayList<>(fileSources); } /** @@ -127,6 +127,7 @@ public class CombinedFileSource extends * * @see org.apache.torque.generator.source.Source#getDescription() */ + @Override public String getDescription() { StringBuilder result = new StringBuilder(); @@ -147,6 +148,7 @@ public class CombinedFileSource extends * * @return null. */ + @Override public File getSourceFile() { return null; @@ -158,6 +160,7 @@ public class CombinedFileSource extends * @return the last modification date, * or null when unknown for at least one of the files. */ + @Override public Date getLastModified() { Date result = null; @@ -183,6 +186,7 @@ public class CombinedFileSource extends * @return a checksum for all files, or null if one of the checksums * of the file sources is null. */ + @Override public byte[] getContentChecksum() { byte[] result = new byte[] {}; Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/stream/FileSource.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/stream/FileSource.java?rev=1839288&r1=1839287&r2=1839288&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/stream/FileSource.java (original) +++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/stream/FileSource.java Mon Aug 27 09:48:33 2018 @@ -137,7 +137,7 @@ public class FileSource extends SourceIm { MessageDigest messageDigest = MessageDigest.getInstance("MD5"); DigestInputStream digestInputStream - = new DigestInputStream(inputStream, messageDigest); + = new DigestInputStream(inputStream, messageDigest); log.debug("Reading file " + path.getAbsolutePath() + " of type " @@ -179,6 +179,7 @@ public class FileSource extends SourceIm * * @see org.apache.torque.generator.source.Source#getDescription() */ + @Override public String getDescription() { return path.getAbsolutePath(); @@ -189,6 +190,7 @@ public class FileSource extends SourceIm * * @return the source file, or null if the source is not read from a file. */ + @Override public File getSourceFile() { return path; @@ -199,6 +201,7 @@ public class FileSource extends SourceIm * * @return the last modification date, or null when unknown. */ + @Override public Date getLastModified() { long lastModified = path.lastModified(); @@ -217,6 +220,7 @@ public class FileSource extends SourceIm * creating the checksum, or if the source is unread * and reading the source fails. */ + @Override public byte[] getContentChecksum() { if (contentMd5Sum == null) @@ -242,7 +246,7 @@ public class FileSource extends SourceIm { StringBuffer result = new StringBuffer(); result.append("(path=").append(path) - .append(",type=").append(format); + .append(",type=").append(format); return result.toString(); } } Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/stream/FileSourceProvider.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/stream/FileSourceProvider.java?rev=1839288&r1=1839287&r2=1839288&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/stream/FileSourceProvider.java (original) +++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/stream/FileSourceProvider.java Mon Aug 27 09:48:33 2018 @@ -90,10 +90,10 @@ public class FileSourceProvider extends * instantiated. */ public FileSourceProvider( - StreamSourceFormat sourceFormat, - Fileset sourceFileset, - Boolean combineFiles) - throws ConfigurationException + StreamSourceFormat sourceFormat, + Fileset sourceFileset, + Boolean combineFiles) + throws ConfigurationException { if (sourceFileset == null) { @@ -113,10 +113,11 @@ public class FileSourceProvider extends * @throws ConfigurationException if the sourceFileset has no basedir or * if the files cannot be determined. */ + @Override protected void initInternal( - ConfigurationHandlers configurationHandlers, - ControllerState controllerState) - throws ConfigurationException + ConfigurationHandlers configurationHandlers, + ControllerState controllerState) + throws ConfigurationException { if (controllerState == null) { @@ -142,6 +143,7 @@ public class FileSourceProvider extends streamSourceFormats = configurationHandlers.getStreamSourceFormats(); } + @Override public void resetInternal( ConfigurationHandlers configurationHandlers, ControllerState controllerState) @@ -152,24 +154,26 @@ public class FileSourceProvider extends this.controllerState = null; } + @Override public boolean hasNext() { if (!isInit()) { throw new IllegalStateException( "init() must be called on this SourceProvider " - + "before hasNext can be called"); + + "before hasNext can be called"); } return pathIt.hasNext(); } + @Override public Source next() { if (!isInit()) { throw new IllegalStateException( "init() must be called on this SourceProvider " - + "before hasNext can be called"); + + "before hasNext can be called"); } if (combineFiles == null || !combineFiles) { @@ -177,7 +181,7 @@ public class FileSourceProvider extends } else { - List<FileSource> fileSources = new ArrayList<FileSource>(); + List<FileSource> fileSources = new ArrayList<>(); while (pathIt.hasNext()) { fileSources.add(getNextFileSource()); @@ -208,7 +212,7 @@ public class FileSourceProvider extends { throw new RuntimeException( "format is not set and file extension is unknown for file " - + currentPath.getAbsolutePath()); + + currentPath.getAbsolutePath()); } return new FileSource( currentSourceFormat, @@ -216,6 +220,7 @@ public class FileSourceProvider extends controllerState); } + @Override public void remove() { throw new UnsupportedOperationException(); @@ -226,8 +231,8 @@ public class FileSourceProvider extends { StringBuffer result = new StringBuffer(); result.append("(sourceFileset=").append(sourceFileset) - .append(",sourceFormat=").append(sourceFormat) - .append(")"); + .append(",sourceFormat=").append(sourceFormat) + .append(")"); return result.toString(); } @@ -288,7 +293,7 @@ public class FileSourceProvider extends { throw new IllegalStateException( "init() must be called on this SourceProvider " - + "before hasNext can be called"); + + "before hasNext can be called"); } return Collections.unmodifiableList(paths); } @@ -308,6 +313,7 @@ public class FileSourceProvider extends /** * {@inheritDoc} */ + @Override public SourceProvider copy() throws ConfigurationException { FileSourceProvider result = new FileSourceProvider( @@ -326,6 +332,7 @@ public class FileSourceProvider extends * * @param sourceProvider the source provoder to copy the settings from. */ + @Override public void copyNotSetSettingsFrom(SourceProvider sourceProvider) { if (sourceProvider == null) @@ -337,7 +344,7 @@ public class FileSourceProvider extends return; } FileSourceProvider fileSourceProvider - = (FileSourceProvider) sourceProvider; + = (FileSourceProvider) sourceProvider; if (combineFiles == null) { log.debug("copying combineFiles property" Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/stream/PropertiesSourceFormat.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/stream/PropertiesSourceFormat.java?rev=1839288&r1=1839287&r2=1839288&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/stream/PropertiesSourceFormat.java (original) +++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/stream/PropertiesSourceFormat.java Mon Aug 27 09:48:33 2018 @@ -26,7 +26,6 @@ import java.util.LinkedHashSet; import java.util.Properties; import java.util.Set; -import org.apache.commons.collections.set.ListOrderedSet; import org.apache.commons.lang.builder.HashCodeBuilder; import org.apache.torque.generator.control.ControllerState; import org.apache.torque.generator.source.SourceElement; @@ -65,6 +64,7 @@ public final class PropertiesSourceForma * * @return "properties". */ + @Override public String getKey() { return KEY; @@ -75,6 +75,7 @@ public final class PropertiesSourceForma * * @return "properties". */ + @Override public String getFilenameExtension() { return FILENAME_EXTENSION; @@ -95,10 +96,11 @@ public final class PropertiesSourceForma * malformed unicode escape sequence. * @throws NullPointerException if inputStream is null. */ + @Override public SourceElement parse( - InputStream inputStream, - ControllerState controllerState) - throws SourceException + InputStream inputStream, + ControllerState controllerState) + throws SourceException { if (inputStream == null) { @@ -123,13 +125,13 @@ public final class PropertiesSourceForma } SourceElement result - = new SourceElement(ROOT_ELEMENT_NAME); + = new SourceElement(ROOT_ELEMENT_NAME); for (String key : properties.orderedKeySet()) { String value = properties.getProperty(key); SourceElement entryElement - = new SourceElement(ENTRY_ELEMENT_NAME); + = new SourceElement(ENTRY_ELEMENT_NAME); entryElement.setAttribute(KEY_ATTRIBUTE_NAME, key); entryElement.setAttribute((String) null, value); result.getChildren().add(entryElement); @@ -196,7 +198,7 @@ public final class PropertiesSourceForma /** * The ordered set of keys. */ - private final Set<String> keySet = new LinkedHashSet<String>(); + private final Set<String> keySet = new LinkedHashSet<>(); @Override public Object put(Object key, Object value) Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/stream/SourceToXml.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/stream/SourceToXml.java?rev=1839288&r1=1839287&r2=1839288&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/stream/SourceToXml.java (original) +++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/stream/SourceToXml.java Mon Aug 27 09:48:33 2018 @@ -58,7 +58,7 @@ public class SourceToXml private static final Map<Character, String> ESCAPE_MAP; static { - Map<Character, String> escapeMap = new HashMap<Character, String>(); + Map<Character, String> escapeMap = new HashMap<>(); escapeMap.put('&', "&"); escapeMap.put('>', ">"); escapeMap.put('<', "<"); @@ -83,7 +83,7 @@ public class SourceToXml throws SourceException { Map<SourceElement, Integer> knownElements - = new HashMap<SourceElement, Integer>(); + = new HashMap<>(); StringBuilder result = new StringBuilder(); String currentIndent = ""; outputElement( @@ -113,13 +113,13 @@ public class SourceToXml * is encountered twice in the source tree. */ private void outputElement( - SourceElement currentElement, - Map<SourceElement, Integer> knownElements, - StringBuilder result, - String currentIndent, - boolean identAtStart, - boolean automaticIds) - throws SourceException + SourceElement currentElement, + Map<SourceElement, Integer> knownElements, + StringBuilder result, + String currentIndent, + boolean identAtStart, + boolean automaticIds) + throws SourceException { // check whether element is already known, output reference if yes Integer currentId; @@ -136,13 +136,13 @@ public class SourceToXml + " but createIdAttributes is false."); } result.append(currentIndent) - .append("<") - .append(currentElement.getName()) - .append(" ") - .append(REFID_ATTRIBUTE) - .append("=\"") - .append(knownElementId) - .append("\"/>"); + .append("<") + .append(currentElement.getName()) + .append(" ") + .append(REFID_ATTRIBUTE) + .append("=\"") + .append(knownElementId) + .append("\"/>"); return; } currentId = getId(); @@ -155,7 +155,7 @@ public class SourceToXml result.append(currentIndent); } result.append("<") - .append(currentElement.getName()); + .append(currentElement.getName()); boolean hasTextAttribute = false; for (String attributeName : currentElement.getAttributeNames()) { @@ -166,8 +166,8 @@ public class SourceToXml else { result.append(" ") - .append(attributeName) - .append("=\""); + .append(attributeName) + .append("=\""); appendWithEscaping( currentElement.getAttribute(attributeName).toString(), result); @@ -177,10 +177,10 @@ public class SourceToXml if (automaticIds) { result.append(" ") - .append(ID_ATTRIBUTE) - .append("=\"") - .append(currentId) - .append("\""); + .append(ID_ATTRIBUTE) + .append("=\"") + .append(currentId) + .append("\""); } boolean hasChildren = !currentElement.getChildren().isEmpty(); if (hasChildren || hasTextAttribute) @@ -231,8 +231,8 @@ public class SourceToXml result.append(currentIndent); } result.append("</") - .append(currentElement.getName()) - .append(">"); + .append(currentElement.getName()) + .append(">"); } } Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/stream/StreamSourceFormat.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/stream/StreamSourceFormat.java?rev=1839288&r1=1839287&r2=1839288&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/stream/StreamSourceFormat.java (original) +++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/stream/StreamSourceFormat.java Mon Aug 27 09:48:33 2018 @@ -63,5 +63,5 @@ public interface StreamSourceFormat SourceElement parse( InputStream inputStream, ControllerState controllerState) - throws SourceException; + throws SourceException; } Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/stream/XmlSourceFormat.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/stream/XmlSourceFormat.java?rev=1839288&r1=1839287&r2=1839288&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/stream/XmlSourceFormat.java (original) +++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/stream/XmlSourceFormat.java Mon Aug 27 09:48:33 2018 @@ -82,6 +82,7 @@ public final class XmlSourceFormat imple * * @return "xml". */ + @Override public String getKey() { return KEY; @@ -92,6 +93,7 @@ public final class XmlSourceFormat imple * * @return "xml". */ + @Override public String getFilenameExtension() { return FILENAME_EXTENSION; @@ -110,10 +112,11 @@ public final class XmlSourceFormat imple * parsing the XML data or if the SAX parser is not configured * correctly. */ + @Override public SourceElement parse( - InputStream xmlStream, - ControllerState controllerState) - throws SourceException + InputStream xmlStream, + ControllerState controllerState) + throws SourceException { if (xmlStream == null) { @@ -124,8 +127,8 @@ public final class XmlSourceFormat imple SAXParser parser = SAX_FACTORY.newSAXParser(); EntityReferences entityReferences - = controllerState.getUnitConfiguration() - .getEntityReferences(); + = controllerState.getUnitConfiguration() + .getEntityReferences(); XmlSourceSaxHandler handler = new XmlSourceSaxHandler( entityReferences); @@ -148,9 +151,9 @@ public final class XmlSourceFormat imple { throw new SourceException( "Parser configuration error parsing Properties" - + " source file: " - + e.getMessage(), - e); + + " source file: " + + e.getMessage(), + e); } } Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/stream/XmlSourceSaxHandler.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/stream/XmlSourceSaxHandler.java?rev=1839288&r1=1839287&r2=1839288&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/stream/XmlSourceSaxHandler.java (original) +++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/stream/XmlSourceSaxHandler.java Mon Aug 27 09:48:33 2018 @@ -36,7 +36,7 @@ public class XmlSourceSaxHandler extends { /** The namespace of the xml schema instance. */ private static final String SCHEMA_INSTANCE_NAMESPACE - = "http://www.w3.org/2001/XMLSchema-instance"; + = "http://www.w3.org/2001/XMLSchema-instance"; /** * The currently parsed element. @@ -67,8 +67,8 @@ public class XmlSourceSaxHandler extends @Override public void startElement(String uri, String localName, - String qName, Attributes attributes) - throws SAXException + String qName, Attributes attributes) + throws SAXException { SourceElement current = new SourceElement(qName); for (int i = 0; i < attributes.getLength(); ++i) @@ -166,11 +166,11 @@ public class XmlSourceSaxHandler extends { for (int i = 0; i < toCheck.length(); ++i) { - char ch = toCheck.charAt(i); - if (ch != ' ' && ch != '\r' && ch != '\n' && ch != '\t') - { - return false; - } + char ch = toCheck.charAt(i); + if (ch != ' ' && ch != '\r' && ch != '\n' && ch != '\t') + { + return false; + } } return true; } Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/transform/AttributeTransformer.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/transform/AttributeTransformer.java?rev=1839288&r1=1839287&r2=1839288&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/transform/AttributeTransformer.java (original) +++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/transform/AttributeTransformer.java Mon Aug 27 09:48:33 2018 @@ -98,7 +98,7 @@ public class AttributeTransformer implem /** * The list of transform rules which is created from the definition file. */ - private List<TransformRule> transformRules = new ArrayList<TransformRule>(); + private List<TransformRule> transformRules = new ArrayList<>(); /** * Constructor. @@ -125,7 +125,7 @@ public class AttributeTransformer implem continue; } int equalsPos - = line.indexOf(SOURCE_TARGET_SEPARATION_CHAR); + = line.indexOf(SOURCE_TARGET_SEPARATION_CHAR); String target = line.substring(0, equalsPos).trim(); String source = line.substring(equalsPos + 1).trim(); @@ -176,10 +176,11 @@ public class AttributeTransformer implem * @throws SourceTransformerException if an error occurs during * transforming. */ + @Override public Object transform( Object toTransform, ControllerState controllerState) - throws SourceTransformerException + throws SourceTransformerException { SourceElement toTransformElement = (SourceElement) toTransform; for (TransformRule transformRule : transformRules) @@ -300,9 +301,9 @@ public class AttributeTransformer implem * incorrect. */ List<Definition> parse(String toParse, boolean source) - throws SourceTransformerException + throws SourceTransformerException { - List<Definition> result = new ArrayList<Definition>(); + List<Definition> result = new ArrayList<>(); ParseState parseState = new ParseState(); for (int position = 0; position < toParse.length(); ++position) { @@ -387,8 +388,8 @@ public class AttributeTransformer implem checkTypeAllowed(parseState.getDefinitionType(), source); result.add( new Definition( - parseState.getDefinitionType(), - parseState.getDefinitionValue().toString())); + parseState.getDefinitionType(), + parseState.getDefinitionValue().toString())); } return result; @@ -409,12 +410,12 @@ public class AttributeTransformer implem * which is not valid at this position. */ private void parseInType( - char current, - ParseState parseState, - boolean source, - String toParse, - int position) - throws SourceTransformerException + char current, + ParseState parseState, + boolean source, + String toParse, + int position) + throws SourceTransformerException { if (current != DEFINITION_TYPE_SEPARATION_CHAR) { @@ -423,7 +424,7 @@ public class AttributeTransformer implem else { String typeString - = parseState.getDefinitionTypeBuffer().toString(); + = parseState.getDefinitionTypeBuffer().toString(); Definition.Type type = null; for (Definition.Type possibleType : Definition.Type.values()) { @@ -465,11 +466,11 @@ public class AttributeTransformer implem * which is not valid at this position. */ private Definition parseDefinitionEnd( - ParseState parseState, - boolean source, - String toParse, - int position) - throws SourceTransformerException + ParseState parseState, + boolean source, + String toParse, + int position) + throws SourceTransformerException { if (parseState.isInType()) { @@ -482,9 +483,9 @@ public class AttributeTransformer implem + position); throw new SourceTransformerException( "Seen " - + DEFINITION_END_CHAR - + " before " - + DEFINITION_TYPE_SEPARATION_CHAR); + + DEFINITION_END_CHAR + + " before " + + DEFINITION_TYPE_SEPARATION_CHAR); } checkTypeAllowed(parseState.getDefinitionType(), source); Definition result = new Definition( @@ -528,11 +529,11 @@ public class AttributeTransformer implem * encountered. */ private void parseAfterDefinitionStart( - char current, - ParseState parseState, - String toParse, - int position) - throws SourceTransformerException + char current, + ParseState parseState, + String toParse, + int position) + throws SourceTransformerException { if (current != DEFINITION_START_CHAR) { @@ -564,7 +565,7 @@ public class AttributeTransformer implem * current place. */ private void checkTypeAllowed(Definition.Type type, boolean source) - throws SourceTransformerException + throws SourceTransformerException { if (source && !type.inSource) { Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/transform/BeanPropertyMethodNameTransformer.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/transform/BeanPropertyMethodNameTransformer.java?rev=1839288&r1=1839287&r2=1839288&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/transform/BeanPropertyMethodNameTransformer.java (original) +++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/transform/BeanPropertyMethodNameTransformer.java Mon Aug 27 09:48:33 2018 @@ -35,11 +35,11 @@ import org.apache.torque.generator.sourc * @version $Id$ */ public class BeanPropertyMethodNameTransformer - extends SourceTargetAttributeTransformer +extends SourceTargetAttributeTransformer { /** The logger of the class. */ private static Logger log - = Logger.getLogger(BeanPropertyMethodNameTransformer.class); + = Logger.getLogger(BeanPropertyMethodNameTransformer.class); /** The camelbacker used to convert the input string. */ private final Camelbacker camelbacker = new Camelbacker(); @@ -121,15 +121,15 @@ public class BeanPropertyMethodNameTrans */ @Override public SourceElement transform( - Object rootObject, - ControllerState controllerState) - throws SourceTransformerException + Object rootObject, + ControllerState controllerState) + throws SourceTransformerException { if (!(rootObject instanceof SourceElement)) { throw new SourceTransformerException( "rootObject is not a SourceElement but has the class " - + rootObject.getClass().getName()); + + rootObject.getClass().getName()); } SourceElement sourceElement = (SourceElement) rootObject; String targetAttributeName = getTargetAttributeName(); Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/transform/CopyAttributeTransformer.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/transform/CopyAttributeTransformer.java?rev=1839288&r1=1839287&r2=1839288&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/transform/CopyAttributeTransformer.java (original) +++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/transform/CopyAttributeTransformer.java Mon Aug 27 09:48:33 2018 @@ -34,7 +34,7 @@ public class CopyAttributeTransformer ex { /** The logger of the class. */ private static Logger log - = Logger.getLogger(CopyAttributeTransformer.class); + = Logger.getLogger(CopyAttributeTransformer.class); /** @@ -49,16 +49,17 @@ public class CopyAttributeTransformer ex * @throws IllegalStateException if sourceAttributeName or * targetAttributeName was not set. */ + @Override public SourceElement transform( - Object rootObject, - ControllerState controllerState) - throws SourceTransformerException + Object rootObject, + ControllerState controllerState) + throws SourceTransformerException { if (!(rootObject instanceof SourceElement)) { throw new SourceTransformerException( "rootObject is not a SourceElement but has the class " - + rootObject.getClass().getName()); + + rootObject.getClass().getName()); } SourceElement sourceElement = (SourceElement) rootObject; String sourceAttributeName = getSourceAttributeName(); Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/transform/GetterSetterNameTransformer.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/transform/GetterSetterNameTransformer.java?rev=1839288&r1=1839287&r2=1839288&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/transform/GetterSetterNameTransformer.java (original) +++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/transform/GetterSetterNameTransformer.java Mon Aug 27 09:48:33 2018 @@ -35,7 +35,7 @@ public class GetterSetterNameTransformer { /** The logger of the class. */ private static Logger log - = Logger.getLogger(GetterSetterNameTransformer.class); + = Logger.getLogger(GetterSetterNameTransformer.class); /** The camelbacker to convert the property name. */ private static Camelbacker camelbacker = new Camelbacker(); @@ -154,16 +154,17 @@ public class GetterSetterNameTransformer * targetAttributeName was not set. * @throws SourceTransformerException if rootObject is not a SourceElement. */ + @Override public SourceElement transform( - Object rootObject, - ControllerState controllerState) - throws SourceTransformerException + Object rootObject, + ControllerState controllerState) + throws SourceTransformerException { if (!(rootObject instanceof SourceElement)) { throw new SourceTransformerException( "rootObject is not a SourceElement but has the class " - + rootObject.getClass().getName()); + + rootObject.getClass().getName()); } SourceElement sourceElement = (SourceElement) rootObject; Object attributeValue = sourceElement.getAttribute(attributeName); Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/transform/LoadAdditionalSourceTransformer.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/transform/LoadAdditionalSourceTransformer.java?rev=1839288&r1=1839287&r2=1839288&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/transform/LoadAdditionalSourceTransformer.java (original) +++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/transform/LoadAdditionalSourceTransformer.java Mon Aug 27 09:48:33 2018 @@ -44,7 +44,7 @@ public class LoadAdditionalSourceTransfo { /** The class log. */ private static Log log - = LogFactory.getLog(LoadAdditionalSourceTransformer.class); + = LogFactory.getLog(LoadAdditionalSourceTransformer.class); /** * The element where the newly loaded source should be added. @@ -77,23 +77,24 @@ public class LoadAdditionalSourceTransfo * @throws SourceTransformerException if the additional source * cannot be loaded or the element to add to does not exist. */ + @Override public SourceElement transform( Object rootObject, ControllerState controllerState) - throws SourceTransformerException + throws SourceTransformerException { if (!(rootObject instanceof SourceElement)) { throw new SourceTransformerException( "rootObject is not a SourceElement but has the class " - + rootObject.getClass().getName()); + + rootObject.getClass().getName()); } SourceElement root = (SourceElement) rootObject; // the element where the additional source should be anchored. SourceElement sourceElement; List<SourceElement> sourceElementList - = SourcePath.getElementsFromRoot(root, element); + = SourcePath.getElementsFromRoot(root, element); if (sourceElementList.isEmpty()) { throw new SourceTransformerException( @@ -102,10 +103,10 @@ public class LoadAdditionalSourceTransfo sourceElement = sourceElementList.get(0); ConfigurationHandlers configurationHandlers - = controllerState.getUnitConfiguration() - .getConfigurationHandlers(); + = controllerState.getUnitConfiguration() + .getConfigurationHandlers(); Set<StreamSourceFormat> streamSourceFormats - = configurationHandlers.getStreamSourceFormats(); + = configurationHandlers.getStreamSourceFormats(); StreamSourceFormat streamSourceFormat = null; for (StreamSourceFormat candidate : streamSourceFormats) { @@ -150,11 +151,11 @@ public class LoadAdditionalSourceTransfo { log.error("Could not construct source from schema file " + additionalSource.getDescription(), - e); + e); throw new SourceTransformerException( "Could not construct source from schema file " - + additionalSource.getDescription(), - e); + + additionalSource.getDescription(), + e); } sourceElement.getChildren().add(additionalSourceRoot); } Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/transform/LoadAllSourceFilesTransformer.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/transform/LoadAllSourceFilesTransformer.java?rev=1839288&r1=1839287&r2=1839288&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/transform/LoadAllSourceFilesTransformer.java (original) +++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/transform/LoadAllSourceFilesTransformer.java Mon Aug 27 09:48:33 2018 @@ -54,7 +54,7 @@ public class LoadAllSourceFilesTransform { /** The class log. */ private static Log log - = LogFactory.getLog(LoadAllSourceFilesTransformer.class); + = LogFactory.getLog(LoadAllSourceFilesTransformer.class); /** * The element to where the new elements are added. @@ -83,25 +83,26 @@ public class LoadAllSourceFilesTransform * @throws SourceTransformerException if the additional source * cannot be loaded or the element to add to does not exist. */ + @Override public Object transform( Object rootObject, ControllerState controllerState) - throws SourceTransformerException + throws SourceTransformerException { if (!(rootObject instanceof SourceElement)) { throw new SourceTransformerException( "rootObject is not a SourceElement but has the class " - + rootObject.getClass().getName()); + + rootObject.getClass().getName()); } SourceElement root = (SourceElement) rootObject; Output output = controllerState.getOutput(); log.debug("adding all sources of output " + output.getName() - + " to current source tree at element " + addTo); + + " to current source tree at element " + addTo); // the element where the additional source should be anchored. SourceElement addToSourceElement; List<SourceElement> sourceElementList - = SourcePath.getElementsFromRoot(root, addTo); + = SourcePath.getElementsFromRoot(root, addTo); if (sourceElementList.isEmpty()) { throw new SourceTransformerException( @@ -111,9 +112,9 @@ public class LoadAllSourceFilesTransform UnitConfiguration unitConfiguration - = controllerState.getUnitConfiguration(); + = controllerState.getUnitConfiguration(); ConfigurationHandlers configurationHandlers - = unitConfiguration.getConfigurationHandlers(); + = unitConfiguration.getConfigurationHandlers(); Controller helperController = new Controller(); SourceElement newSourceElement = new SourceElement(newElement); @@ -123,7 +124,7 @@ public class LoadAllSourceFilesTransform // do not change state of original source provider, // instead make a copy. SourceProvider sourceProvider - = controllerState.getSourceProvider().copy(); + = controllerState.getSourceProvider().copy(); sourceProvider.init(configurationHandlers, controllerState); while (sourceProvider.hasNext()) @@ -131,18 +132,18 @@ public class LoadAllSourceFilesTransform Source source = sourceProvider.next(); SourceElement rootElement = source.getRootElement(); SourceProcessConfiguration sourceProcessConfiguration - = output.getSourceProcessConfiguration(); + = output.getSourceProcessConfiguration(); List<SourceTransformerDefinition> transformerDefinitions - = sourceProcessConfiguration.getTransformerDefinitions(); + = sourceProcessConfiguration.getTransformerDefinitions(); transformerDefinitions - = new ArrayList<SourceTransformerDefinition> - (transformerDefinitions); + = new ArrayList<> + (transformerDefinitions); Iterator<SourceTransformerDefinition> transformerDefinitionIt - = transformerDefinitions.iterator(); + = transformerDefinitions.iterator(); while (transformerDefinitionIt.hasNext()) { SourceTransformerDefinition transformerDefinition - = transformerDefinitionIt.next(); + = transformerDefinitionIt.next(); if (this.equals( transformerDefinition.getSourceTransformer())) { @@ -253,10 +254,10 @@ public class LoadAllSourceFilesTransform public int hashCode() { return new HashCodeBuilder() - .append(addTo) - .append(combineSources) - .append(newElement) - .toHashCode(); + .append(addTo) + .append(combineSources) + .append(newElement) + .toHashCode(); } @Override @@ -275,11 +276,11 @@ public class LoadAllSourceFilesTransform return false; } LoadAllSourceFilesTransformer other - = (LoadAllSourceFilesTransformer) obj; + = (LoadAllSourceFilesTransformer) obj; return new EqualsBuilder() - .append(other.addTo, this.addTo) - .append(other.combineSources, this.combineSources) - .append(other.newElement, this.newElement) - .isEquals(); + .append(other.addTo, this.addTo) + .append(other.combineSources, this.combineSources) + .append(other.newElement, this.newElement) + .isEquals(); } } Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/transform/SourceElementToModelTransformer.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/transform/SourceElementToModelTransformer.java?rev=1839288&r1=1839287&r2=1839288&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/transform/SourceElementToModelTransformer.java (original) +++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/transform/SourceElementToModelTransformer.java Mon Aug 27 09:48:33 2018 @@ -54,7 +54,7 @@ public class SourceElementToModelTransfo /** The processor which wraps reserved java words. */ private final WrapReservedJavaWords reservedWordsWrapper - = new WrapReservedJavaWords(); + = new WrapReservedJavaWords(); /** The class the model root must have. */ private String modelRootClass; @@ -133,23 +133,24 @@ public class SourceElementToModelTransfo * e.g. if an attribute name or element name has no corresponding * field in a model element. */ + @Override public Object transform( - final Object modelRoot, - final ControllerState controllerState) - throws SourceTransformerException + final Object modelRoot, + final ControllerState controllerState) + throws SourceTransformerException { if (modelRootClass == null) { throw new SourceTransformerException( "modelRootClass must not be null " - + "for the transformer of type " - + getClass().getName()); + + "for the transformer of type " + + getClass().getName()); } if (!(modelRoot instanceof SourceElement)) { throw new SourceTransformerException( "modelRoot must be of type " - + SourceElement.class.getName()); + + SourceElement.class.getName()); } final Object targetModelRoot = getInstance( modelRootClass, @@ -180,11 +181,11 @@ public class SourceElementToModelTransfo * has no corresponding field in a model element. */ private void fillModelElement( - final Object model, - final SourceElement sourceElement, - final UnitConfiguration unitConfiguration, - final Map<SourceElement, Object> alreadyMapped) - throws SourceTransformerException + final Object model, + final SourceElement sourceElement, + final UnitConfiguration unitConfiguration, + final Map<SourceElement, Object> alreadyMapped) + throws SourceTransformerException { for (String attributeName : sourceElement.getAttributeNames()) { @@ -272,7 +273,7 @@ public class SourceElementToModelTransfo propertyAccess.setProperty(childModelElement); alreadyMapped.put(child, childModelElement); PropertyAccess parentPropertyAccess - = new PropertyAccess(childModelElement, "parent"); + = new PropertyAccess(childModelElement, "parent"); if (!parentPropertyAccess.isPropertyAccessible()) { final String modelClassName = model.getClass().getSimpleName(); @@ -301,9 +302,9 @@ public class SourceElementToModelTransfo * @throws SourceTransformerException if the class cannot be instantiated. */ protected static Object getInstance( - final String className, - final UnitConfiguration unitConfiguration) - throws SourceTransformerException + final String className, + final UnitConfiguration unitConfiguration) + throws SourceTransformerException { if (className == null) { @@ -323,22 +324,22 @@ public class SourceElementToModelTransfo catch (final ClassNotFoundException e) { throw new SourceTransformerException("The class " - + className - + " could not be found.", + + className + + " could not be found.", e); } catch (final IllegalAccessException e) { throw new SourceTransformerException("Instantiating " - + className - + " is not allowed", + + className + + " is not allowed", e); } catch (final InstantiationException e) { throw new SourceTransformerException("The class " - + className - + " has no standard constructor.", + + className + + " has no standard constructor.", e); } return result; Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/transform/SourceTargetAttributeTransformer.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/transform/SourceTargetAttributeTransformer.java?rev=1839288&r1=1839287&r2=1839288&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/transform/SourceTargetAttributeTransformer.java (original) +++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/transform/SourceTargetAttributeTransformer.java Mon Aug 27 09:48:33 2018 @@ -28,11 +28,11 @@ import org.apache.torque.generator.contr * @version $Id$ */ public abstract class SourceTargetAttributeTransformer - implements SourceTransformer +implements SourceTransformer { /** The logger of the class. */ private static final Logger log - = Logger.getLogger(SourceTargetAttributeTransformer.class); + = Logger.getLogger(SourceTargetAttributeTransformer.class); /** The name of the attribute which is read as Input. */ private String sourceAttributeName; @@ -163,8 +163,9 @@ public abstract class SourceTargetAttrib * * @see SourceTransformer#transform(Object, ControllerState) */ + @Override public abstract Object transform( Object toTransformRoot, ControllerState controllerState) - throws SourceTransformerException; + throws SourceTransformerException; } Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/transform/SourceTransformer.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/transform/SourceTransformer.java?rev=1839288&r1=1839287&r2=1839288&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/transform/SourceTransformer.java (original) +++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/transform/SourceTransformer.java Mon Aug 27 09:48:33 2018 @@ -41,5 +41,5 @@ public interface SourceTransformer Object transform( Object modelRoot, ControllerState controllerState) - throws SourceTransformerException; + throws SourceTransformerException; } Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/transform/model/PropertyAccess.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/transform/model/PropertyAccess.java?rev=1839288&r1=1839287&r2=1839288&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/transform/model/PropertyAccess.java (original) +++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/transform/model/PropertyAccess.java Mon Aug 27 09:48:33 2018 @@ -52,7 +52,7 @@ public class PropertyAccess static { - converters = new ArrayList<TypeConverter>(); + converters = new ArrayList<>(); converters.add(new StringToBooleanConverter()); } @@ -113,9 +113,9 @@ public class PropertyAccess * @throws NullPointerException if target or propertyName are null. */ public PropertyAccess( - final Object target, - final String propertyName) - throws SourceTransformerException + final Object target, + final String propertyName) + throws SourceTransformerException { this(target, propertyName, @@ -148,11 +148,11 @@ public class PropertyAccess * @throws NullPointerException if target or propertyName are null. */ public PropertyAccess( - final Object target, - final String propertyName, - final List<String> prefixList, - final List<String> suffixList) - throws SourceTransformerException + final Object target, + final String propertyName, + final List<String> prefixList, + final List<String> suffixList) + throws SourceTransformerException { if (target == null) { @@ -166,19 +166,19 @@ public class PropertyAccess this.propertyName = propertyName; if (prefixList != null) { - this.prefixList = new ArrayList<String>(prefixList); + this.prefixList = new ArrayList<>(prefixList); } else { - this.prefixList = new ArrayList<String>(); + this.prefixList = new ArrayList<>(); } if (suffixList != null) { - this.suffixList = new ArrayList<String>(suffixList); + this.suffixList = new ArrayList<>(suffixList); } else { - this.suffixList = new ArrayList<String>(); + this.suffixList = new ArrayList<>(); } this.suffixList.add(0, ""); @@ -279,14 +279,14 @@ public class PropertyAccess * prevent reading the field of the object. */ private static PropertyDescriptor determinePropertyDescriptor( - final Object target, - final String name) - throws SourceTransformerException + final Object target, + final String name) + throws SourceTransformerException { try { final PropertyDescriptor propertyDescriptor - = PropertyUtils.getPropertyDescriptor(target, name); + = PropertyUtils.getPropertyDescriptor(target, name); return propertyDescriptor; } catch (final NoSuchMethodException e) @@ -330,7 +330,7 @@ public class PropertyAccess } else if (Collection.class.isAssignableFrom(field.getType()) && (value == null - || !Collection.class.isAssignableFrom(value.getClass()))) + || !Collection.class.isAssignableFrom(value.getClass()))) { setMemberinCollectionProperty(value); } @@ -348,9 +348,9 @@ public class PropertyAccess setMemberinArrayField(value); } else if (Collection.class.isAssignableFrom( - writeMethod.getParameterTypes()[0]) + writeMethod.getParameterTypes()[0]) && (value == null - || !Collection.class.isAssignableFrom(value.getClass()))) + || !Collection.class.isAssignableFrom(value.getClass()))) { setMemberinCollectionProperty(value); } @@ -364,7 +364,7 @@ public class PropertyAccess { if (Collection.class.isAssignableFrom( readMethod.getReturnType()) - && (value == null + && (value == null || !Collection.class.isAssignableFrom(value.getClass()))) { setMemberinCollectionProperty(value); @@ -459,7 +459,7 @@ public class PropertyAccess value, " because the argument has the wrong type " + value.getClass().getName() , - e); + e); } catch (final IllegalAccessException e) { @@ -513,7 +513,7 @@ public class PropertyAccess value, " because the argument has the wrong type " + value.getClass().getName() , - e); + e); } catch (final IllegalAccessException e) { @@ -670,7 +670,7 @@ public class PropertyAccess if (type instanceof ParameterizedType) { final Object firstType - = ((ParameterizedType) type).getActualTypeArguments()[0]; + = ((ParameterizedType) type).getActualTypeArguments()[0]; if (firstType instanceof Class) { return (Class<?>) firstType; @@ -781,15 +781,15 @@ public class PropertyAccess final Class<?> type = getPropertyType(); if (Collection.class == type || List.class == type) { - return new ArrayList<Object>(); + return new ArrayList<>(); } else if (Set.class == type) { - return new HashSet<Object>(); + return new HashSet<>(); } else if (Queue.class == type) { - return new LinkedList<Object>(); + return new LinkedList<>(); } else { @@ -797,7 +797,7 @@ public class PropertyAccess { @SuppressWarnings("unchecked") final Collection<Object> result - = (Collection<Object>) type.newInstance(); + = (Collection<Object>) type.newInstance(); return result; } catch (final InstantiationException e) @@ -852,9 +852,9 @@ public class PropertyAccess final Throwable cause) { final StringBuilder message = new StringBuilder("The field ") - .append(propertyName) - .append(" of class ") - .append(target.getClass().getName()); + .append(propertyName) + .append(" of class ") + .append(target.getClass().getName()); if (value != null) { message.append(" cannot be set to ").append(value); Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/transform/model/StringToBooleanConverter.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/transform/model/StringToBooleanConverter.java?rev=1839288&r1=1839287&r2=1839288&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/transform/model/StringToBooleanConverter.java (original) +++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/transform/model/StringToBooleanConverter.java Mon Aug 27 09:48:33 2018 @@ -28,11 +28,13 @@ package org.apache.torque.generator.sour public class StringToBooleanConverter implements TypeConverter { + @Override public boolean accept(final Object value, final Class<?> targetClass) { return (value instanceof String && Boolean.class == targetClass); } + @Override public Object convert(final Object value, final Class<?> targetClass) { return Boolean.parseBoolean((String) value); Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/template/TemplateOutletImpl.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/template/TemplateOutletImpl.java?rev=1839288&r1=1839287&r2=1839288&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/template/TemplateOutletImpl.java (original) +++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/template/TemplateOutletImpl.java Mon Aug 27 09:48:33 2018 @@ -37,8 +37,8 @@ import org.apache.torque.generator.qname * An implementation of the TemplateOutlet interface. */ public abstract class TemplateOutletImpl - extends OutletImpl - implements TemplateOutlet +extends OutletImpl +implements TemplateOutlet { /** * The content of the templates. @@ -46,7 +46,7 @@ public abstract class TemplateOutletImpl * There may be more than one template content per template because * the template path can contain tokens. */ - private final Map<String, String> contentMap = new HashMap<String, String>(); + private final Map<String, String> contentMap = new HashMap<>(); /** * The path to the template. May contain unresolved tokens. @@ -99,7 +99,7 @@ public abstract class TemplateOutletImpl final String path, final String encoding, final TemplateFilter templateFilter) - throws ConfigurationException + throws ConfigurationException { super(name); if (configurationProvider == null) @@ -117,6 +117,7 @@ public abstract class TemplateOutletImpl this.templateFilter = templateFilter; } + @Override public String getContent(final ControllerState controllerState) throws ConfigurationException { @@ -126,7 +127,7 @@ public abstract class TemplateOutletImpl if (result == null) { try (InputStream templateInputStream - = configurationProvider.getTemplateInputStream( + = configurationProvider.getTemplateInputStream( detokenizedPath)) { result = load(templateInputStream, encoding, templateFilter); @@ -164,7 +165,7 @@ public abstract class TemplateOutletImpl final InputStream inputStream, final String encoding, final TemplateFilter filter) - throws IOException + throws IOException { InputStream filteredStream; if (filter != null) Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/template/groovy/GroovyOutlet.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/template/groovy/GroovyOutlet.java?rev=1839288&r1=1839287&r2=1839288&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/template/groovy/GroovyOutlet.java (original) +++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/template/groovy/GroovyOutlet.java Mon Aug 27 09:48:33 2018 @@ -96,13 +96,13 @@ public abstract class GroovyOutlet exten final ConfigurationProvider configurationProvider, final String path, final String encoding) - throws ConfigurationException + throws ConfigurationException { super(name, - configurationProvider, - path, - encoding, - null); + configurationProvider, + path, + encoding, + null); } /** @@ -116,7 +116,7 @@ public abstract class GroovyOutlet exten */ @Override public OutletResult execute(final ControllerState controllerState) - throws GeneratorException + throws GeneratorException { if (log.isDebugEnabled()) @@ -158,11 +158,11 @@ public abstract class GroovyOutlet exten protected abstract String executeGroovy( Map<String, Object> binding, ControllerState controllerState) - throws GeneratorException; + throws GeneratorException; public Map<String, Object> createBinding(final ControllerState controllerState) { - final Map<String, Object> binding = new HashMap<String, Object>(); + final Map<String, Object> binding = new HashMap<>(); binding.put( TORQUE_GEN_BINDING_NAME, new TorqueGenGroovy(this, controllerState)); @@ -170,7 +170,7 @@ public abstract class GroovyOutlet exten { // Only consider options visible from the current namespace. final Options visibleOptions - = controllerState.getVisibleOptions(); + = controllerState.getVisibleOptions(); for (final Option option : visibleOptions.values()) { final QualifiedName qualifiedName = option.getQualifiedName(); @@ -220,11 +220,11 @@ public abstract class GroovyOutlet exten // only consider the most significant name. final Namespace namespace = getName().getNamespace(); final VariableStore variableStore - = controllerState.getVariableStore(); + = controllerState.getVariableStore(); final QualifiedNameMap<Variable> visibleVariables - = variableStore - .getContent() - .getInHierarchy(namespace); + = variableStore + .getContent() + .getInHierarchy(namespace); for (final Variable variable : visibleVariables.values()) { final QualifiedName qualifiedName = variable.getName(); Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/template/groovy/GroovyScriptOutlet.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/template/groovy/GroovyScriptOutlet.java?rev=1839288&r1=1839287&r2=1839288&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/template/groovy/GroovyScriptOutlet.java (original) +++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/template/groovy/GroovyScriptOutlet.java Mon Aug 27 09:48:33 2018 @@ -43,7 +43,7 @@ public class GroovyScriptOutlet extends /** The cached compiled scripts, keyed by the detokenized path. */ private static Map<String, Script> cachedScripts - = new HashMap<String, Script>(); + = new HashMap<>(); /** * Constructs a new GroovyScriptOutlet. @@ -60,20 +60,20 @@ public class GroovyScriptOutlet extends * template. */ public GroovyScriptOutlet( - final QualifiedName name, - final ConfigurationProvider configurationProvider, - final String path, - final String encoding) - throws ConfigurationException + final QualifiedName name, + final ConfigurationProvider configurationProvider, + final String path, + final String encoding) + throws ConfigurationException { super(name, configurationProvider, path, encoding); } @Override protected String executeGroovy( - final Map<String, Object> binding, - final ControllerState controllerState) - throws GeneratorException + final Map<String, Object> binding, + final ControllerState controllerState) + throws GeneratorException { try { Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/template/groovy/GroovyTemplateOutlet.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/template/groovy/GroovyTemplateOutlet.java?rev=1839288&r1=1839287&r2=1839288&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/template/groovy/GroovyTemplateOutlet.java (original) +++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/template/groovy/GroovyTemplateOutlet.java Mon Aug 27 09:48:33 2018 @@ -53,20 +53,20 @@ public class GroovyTemplateOutlet extend * template. */ public GroovyTemplateOutlet( - final QualifiedName name, - final ConfigurationProvider configurationProvider, - final String path, - final String encoding) - throws ConfigurationException + final QualifiedName name, + final ConfigurationProvider configurationProvider, + final String path, + final String encoding) + throws ConfigurationException { super(name, configurationProvider, path, encoding); } @Override protected String executeGroovy( - final Map<String, Object> binding, - final ControllerState controllerState) - throws GeneratorException + final Map<String, Object> binding, + final ControllerState controllerState) + throws GeneratorException { try { Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/template/groovy/TorqueGenGroovy.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/template/groovy/TorqueGenGroovy.java?rev=1839288&r1=1839287&r2=1839288&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/template/groovy/TorqueGenGroovy.java (original) +++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/template/groovy/TorqueGenGroovy.java Mon Aug 27 09:48:33 2018 @@ -83,7 +83,7 @@ public class TorqueGenGroovy * completely. */ public String mergepoint(final String mergepointName) - throws GeneratorException + throws GeneratorException { return outlet.mergepoint(mergepointName, controllerState); } Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/template/velocity/TorqueGenVelocity.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/template/velocity/TorqueGenVelocity.java?rev=1839288&r1=1839287&r2=1839288&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/template/velocity/TorqueGenVelocity.java (original) +++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/template/velocity/TorqueGenVelocity.java Mon Aug 27 09:48:33 2018 @@ -86,7 +86,7 @@ public class TorqueGenVelocity * completely. */ public String mergepoint(String mergepointName) - throws GeneratorException + throws GeneratorException { return outlet.mergepoint(mergepointName, controllerState); } @@ -129,7 +129,7 @@ public class TorqueGenVelocity return (SourceElement) model; } throw new SourceException("model is no SourceElement but is of class " - + model.getClass().getName()); + + model.getClass().getName()); } /** --------------------------------------------------------------------- To unsubscribe, e-mail: torque-dev-unsubscr...@db.apache.org For additional commands, e-mail: torque-dev-h...@db.apache.org