Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/outlet/Outlet.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/outlet/Outlet.java?rev=1839288&r1=1839287&r2=1839288&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/outlet/Outlet.java (original) +++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/outlet/Outlet.java Mon Aug 27 09:48:33 2018 @@ -51,7 +51,7 @@ public interface Outlet * for the given name already exists. */ void addMergepointMapping(MergepointMapping mergepointMapping) - throws ConfigurationException; + throws ConfigurationException; /** * Sets an mergepoint mapping in the outlet. If a mergepoint @@ -132,7 +132,7 @@ public interface Outlet * @throws GeneratorException if adjusting the controller state fails. */ void beforeExecute(ControllerState controllerState) - throws GeneratorException; + throws GeneratorException; /** * Adjusts the state of the Controller after generation. @@ -142,7 +142,7 @@ public interface Outlet * @throws GeneratorException if adjusting the controller state fails. */ void afterExecute(ControllerState controllerState) - throws GeneratorException; + throws GeneratorException; /** * Generates the output for this template into the Generated object. @@ -154,5 +154,5 @@ public interface Outlet * @throws GeneratorException if generation fails. */ OutletResult execute(ControllerState controllerState) - throws GeneratorException; + throws GeneratorException; }
Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/outlet/OutletImpl.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/outlet/OutletImpl.java?rev=1839288&r1=1839287&r2=1839288&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/outlet/OutletImpl.java (original) +++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/outlet/OutletImpl.java Mon Aug 27 09:48:33 2018 @@ -51,7 +51,7 @@ public abstract class OutletImpl impleme * The mergepoint mappings configured for this outlet. */ private final Map<String, MergepointMapping> mergepointMappings - = new HashMap<String, MergepointMapping>(); + = new HashMap<>(); /** * The name of the outlet. Is immutable. @@ -87,26 +87,31 @@ public abstract class OutletImpl impleme this.name = name; } + @Override public QualifiedName getName() { return name; } + @Override public String getInputElementName() { return inputElementName; } + @Override public void setInputElementName(String inputElementName) { this.inputElementName = inputElementName; } + @Override public String getInputClass() { return inputClass; } + @Override public void setInputClass(String inputClass) { this.inputClass = inputClass; @@ -122,20 +127,21 @@ public abstract class OutletImpl impleme * @throws ConfigurationException if an mergepointMapping * for the given name already exists. */ + @Override public void addMergepointMapping(MergepointMapping mergepointMapping) - throws ConfigurationException + throws ConfigurationException { MergepointMapping oldMapping - = mergepointMappings.get(mergepointMapping.getName()); + = mergepointMappings.get(mergepointMapping.getName()); if (oldMapping != null) { throw new ConfigurationException( "Attempted to add another mergepoint mapping for the name " - + mergepointMapping.getName() - + " : New mapping mapped to Actions " - + mergepointMapping.getActions() - + ", old mapping mapped to Actions " - + oldMapping.getActions()); + + mergepointMapping.getName() + + " : New mapping mapped to Actions " + + mergepointMapping.getActions() + + ", old mapping mapped to Actions " + + oldMapping.getActions()); } mergepointMappings.put(mergepointMapping.getName(), mergepointMapping); } @@ -150,6 +156,7 @@ public abstract class OutletImpl impleme * * @throws NullPointerException if mergepointMapping is null. */ + @Override public MergepointMapping setMergepointMapping( MergepointMapping mergepointMapping) { @@ -162,16 +169,19 @@ public abstract class OutletImpl impleme * @return the mergepoint mapping for the given name, or null if no * mergepoint mapping exists for this name. */ + @Override public MergepointMapping getMergepointMapping(String name) { return mergepointMappings.get(name); } + @Override public Map<String, MergepointMapping> getMergepointMappings() { return Collections.unmodifiableMap(mergepointMappings); } + @Override public void beforeExecute(ControllerState controllerState) throws GeneratorException { @@ -202,7 +212,7 @@ public abstract class OutletImpl impleme + model.getClass().getName()); } if (inputElementName != null - && !inputElementName.equals(((SourceElement) model).getName())) + && !inputElementName.equals(((SourceElement) model).getName())) { throw new GeneratorException("Input element name, " + ((SourceElement) model).getName() @@ -224,14 +234,16 @@ public abstract class OutletImpl impleme } } + @Override public void afterExecute(ControllerState controllerState) { controllerState.getVariableStore().endOutlet(); controllerState.popOutlet(); } + @Override public abstract OutletResult execute(ControllerState controllerState) - throws GeneratorException; + throws GeneratorException; @Override public String toString() @@ -283,12 +295,12 @@ public abstract class OutletImpl impleme ControllerState controllerState) { QualifiedName qualifiedName - = controllerState.getQualifiedName(key); + = controllerState.getQualifiedName(key); Variable variable - = new Variable( - qualifiedName, - value, - scope); + = new Variable( + qualifiedName, + value, + scope); VariableStore variableStore = controllerState.getVariableStore(); variableStore.set(variable); } @@ -310,7 +322,7 @@ public abstract class OutletImpl impleme public Object getVariable(String key, ControllerState controllerState) { QualifiedName qualifiedName - = controllerState.getQualifiedName(key); + = controllerState.getQualifiedName(key); VariableStore variableStore = controllerState.getVariableStore(); Variable variable = variableStore.getInHierarchy(qualifiedName); @@ -337,14 +349,14 @@ public abstract class OutletImpl impleme public String mergepoint( String mergepointName, ControllerState controllerState) - throws GeneratorException + throws GeneratorException { if (log.isDebugEnabled()) { log.debug("mergepoint() : Start for mergepoint " + mergepointName); } MergepointMapping mergepointMapping - = getMergepointMapping(mergepointName); + = getMergepointMapping(mergepointName); if (mergepointMapping == null) { if (log.isInfoEnabled()) @@ -386,10 +398,10 @@ public abstract class OutletImpl impleme { throw new GeneratorException( "mergepoint actions " - + "must return a String result! Mergepoint name: " - + mergepointName - + ", outlet name: " - + controllerState.getOutlet().getName().toString()); + + "must return a String result! Mergepoint name: " + + mergepointName + + ", outlet name: " + + controllerState.getOutlet().getName().toString()); } result.append(actionResult.getStringResult()); } Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/outlet/OutletResult.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/outlet/OutletResult.java?rev=1839288&r1=1839287&r2=1839288&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/outlet/OutletResult.java (original) +++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/outlet/OutletResult.java Mon Aug 27 09:48:33 2018 @@ -106,8 +106,8 @@ public class OutletResult public int hashCode() { HashCodeBuilder hashCodeBuilder = new HashCodeBuilder() - .append(stringResult) - .append(byteArrayResult); + .append(stringResult) + .append(byteArrayResult); return hashCodeBuilder.toHashCode(); } @@ -128,8 +128,8 @@ public class OutletResult } OutletResult other = (OutletResult) obj; EqualsBuilder equalsBuilder = new EqualsBuilder() - .append(stringResult, other.stringResult) - .append(byteArrayResult, other.byteArrayResult); + .append(stringResult, other.stringResult) + .append(byteArrayResult, other.byteArrayResult); return equalsBuilder.isEquals(); } @@ -211,10 +211,10 @@ public class OutletResult { throw new GeneratorException( "first OutletResult to concatenate is a " - + "String result but a following result is a " - + "byte array." - + " All concatenated results must be " - + "of the same type"); + + "String result but a following result is a " + + "byte array." + + " All concatenated results must be " + + "of the same type"); } String partContent = part.getStringResult(); if (partContent != null) @@ -231,10 +231,10 @@ public class OutletResult { throw new GeneratorException( "first OutletResult to concatenate is a " - + "byte array result but a following result is a " - + "String result." - + " All concatenated results must be " - + "of the same type"); + + "byte array result but a following result is a " + + "String result." + + " All concatenated results must be " + + "of the same type"); } byte[] partContent = part.getByteArrayResult(); if (partContent != null) Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/outlet/copy/CopyOutlet.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/outlet/copy/CopyOutlet.java?rev=1839288&r1=1839287&r2=1839288&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/outlet/copy/CopyOutlet.java (original) +++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/outlet/copy/CopyOutlet.java Mon Aug 27 09:48:33 2018 @@ -52,7 +52,7 @@ public class CopyOutlet extends OutletIm */ private final ConfigurationProvider configurationProvider; - /** + /** * Constructs a new CopyOutlet. * * @param name the name of this outlet, not null. @@ -70,7 +70,7 @@ public class CopyOutlet extends OutletIm QualifiedName name, ConfigurationProvider configurationProvider, String path) - throws ConfigurationException + throws ConfigurationException { super(name); if (path == null) @@ -96,7 +96,7 @@ public class CopyOutlet extends OutletIm */ @Override public OutletResult execute(ControllerState controllerState) - throws GeneratorException + throws GeneratorException { if (log.isDebugEnabled()) @@ -107,7 +107,7 @@ public class CopyOutlet extends OutletIm try { InputStream inputStream - = configurationProvider.getResourceInputStream(path); + = configurationProvider.getResourceInputStream(path); OutletResult result = new OutletResult( IOUtils.toByteArray(inputStream)); return result; @@ -118,7 +118,7 @@ public class CopyOutlet extends OutletIm + getName() + ": cannot read Resource " + path, - e); + e); } finally { Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/outlet/java/CamelbackOutlet.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/outlet/java/CamelbackOutlet.java?rev=1839288&r1=1839287&r2=1839288&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/outlet/java/CamelbackOutlet.java (original) +++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/outlet/java/CamelbackOutlet.java Mon Aug 27 09:48:33 2018 @@ -49,7 +49,7 @@ public class CamelbackOutlet extends Str * The processor which wraps reserved java words. */ private final WrapReservedJavaWords reservedWordsWrapper - = new WrapReservedJavaWords(); + = new WrapReservedJavaWords(); /** Whether reserved java words are wrapped. */ private boolean wrapReservedJavaWords = false; Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/outlet/java/JavaFilenameOutlet.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/outlet/java/JavaFilenameOutlet.java?rev=1839288&r1=1839287&r2=1839288&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/outlet/java/JavaFilenameOutlet.java (original) +++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/outlet/java/JavaFilenameOutlet.java Mon Aug 27 09:48:33 2018 @@ -57,9 +57,9 @@ public class JavaFilenameOutlet extends throws GeneratorException { String packageName - = mergepoint(PACKAGE_MERGEPOINT_NAME, controllerState); + = mergepoint(PACKAGE_MERGEPOINT_NAME, controllerState); String className - = mergepoint(CLASSNAME_MERGEPOINT_NAME, controllerState); + = mergepoint(CLASSNAME_MERGEPOINT_NAME, controllerState); String result = packageName.replace('.', '/') + "/" Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/outlet/java/JavadocOutlet.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/outlet/java/JavadocOutlet.java?rev=1839288&r1=1839287&r2=1839288&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/outlet/java/JavadocOutlet.java (original) +++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/outlet/java/JavadocOutlet.java Mon Aug 27 09:48:33 2018 @@ -102,13 +102,13 @@ public class JavadocOutlet extends Outle ATTRIBUTES_MERGEPOINT_NAME, controllerState); if (!StringUtils.isEmpty(attributes) - && !StringUtils.isEmpty(body)) + && !StringUtils.isEmpty(body)) { result.append(indent).append(" *").append(lineBreak); } if (!StringUtils.isEmpty(attributes)) { - result.append(wrapLinesAndIndent(attributes)); + result.append(wrapLinesAndIndent(attributes)); } } @@ -132,13 +132,13 @@ public class JavadocOutlet extends Outle return ""; } StringTokenizer tokenizer - = new StringTokenizer( - content.trim(), - removableWrapCharacters - + wrapAfterCharacters - + "\r\n" - + JAVADOC_ATTRIBUTE_START, - true); + = new StringTokenizer( + content.trim(), + removableWrapCharacters + + wrapAfterCharacters + + "\r\n" + + JAVADOC_ATTRIBUTE_START, + true); StringBuilder result = new StringBuilder(); result.append(indent).append(MID_LINE_START); int currentLineLength = indent.length() + MID_LINE_START.length(); @@ -186,7 +186,7 @@ public class JavadocOutlet extends Outle currentIndent = StringUtils.rightPad( indent + MID_LINE_START, indent.length() + MID_LINE_START.length() - + 2 + token.length()); + + 2 + token.length()); if (result.length() > indent.length() + MID_LINE_START.length()) { @@ -215,7 +215,7 @@ public class JavadocOutlet extends Outle } //+ 3 because " * " currentLineLength - = indent.length() + MID_LINE_START.length(); + = indent.length() + MID_LINE_START.length(); lastJavadocAttribute = token; } result.append(JAVADOC_ATTRIBUTE_START); @@ -260,11 +260,11 @@ public class JavadocOutlet extends Outle } int unbreakableChunkSize; if (nextToken == null - || "\r".equals(nextToken) - || "\n".equals(nextToken) - || wrapAfterCharacters.contains(token) - || JAVADOC_ATTRIBUTE_START.equals(nextToken) - || removableWrapCharacters.contains(nextToken)) + || "\r".equals(nextToken) + || "\n".equals(nextToken) + || wrapAfterCharacters.contains(token) + || JAVADOC_ATTRIBUTE_START.equals(nextToken) + || removableWrapCharacters.contains(nextToken)) { unbreakableChunkSize = token.length(); } @@ -283,10 +283,10 @@ public class JavadocOutlet extends Outle ""); } result.append(lineBreak) - .append(currentIndent) - .append(token); + .append(currentIndent) + .append(token); currentLineLength - = currentIndent.length() + token.length(); + = currentIndent.length() + token.length(); } else { @@ -379,7 +379,7 @@ public class JavadocOutlet extends Outle */ static void removeEnd(StringBuilder stringBuilder, String removeChars) { - Set<Character> removeCharSet = new HashSet<Character>(); + Set<Character> removeCharSet = new HashSet<>(); for (char character : removeChars.toCharArray()) { removeCharSet.add(character); Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/outlet/java/ModifySourcenameOutlet.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/outlet/java/ModifySourcenameOutlet.java?rev=1839288&r1=1839287&r2=1839288&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/outlet/java/ModifySourcenameOutlet.java (original) +++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/outlet/java/ModifySourcenameOutlet.java Mon Aug 27 09:48:33 2018 @@ -59,7 +59,7 @@ public class ModifySourcenameOutlet exte /** The logger of the class. */ private static Logger logger - = Logger.getLogger(ModifySourcenameOutlet.class); + = Logger.getLogger(ModifySourcenameOutlet.class); /** * Constructor. Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/outlet/java/OutletUtils.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/outlet/java/OutletUtils.java?rev=1839288&r1=1839287&r2=1839288&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/outlet/java/OutletUtils.java (original) +++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/outlet/java/OutletUtils.java Mon Aug 27 09:48:33 2018 @@ -67,25 +67,25 @@ public final class OutletUtils String attributeName, ControllerState controllerState, Class<?> clazz) - throws GeneratorException + throws GeneratorException { SourceElement sourceElement = SourcePath.getElement( (SourceElement) controllerState.getModel(), elementName, false); Object attribute - = sourceElement.getAttribute(attributeName); + = sourceElement.getAttribute(attributeName); if (attribute == null) { throw new GeneratorException( "Source element attribute not set in " - + clazz.getName() - + "\n" - + "The attribute " - + attributeName - + " of the source element " - + elementName - + " is not set."); + + clazz.getName() + + "\n" + + "The attribute " + + attributeName + + " of the source element " + + elementName + + " is not set."); } return attribute.toString(); } @@ -107,7 +107,7 @@ public final class OutletUtils String optionName, ControllerState controllerState, Class<?> clazz) - throws GeneratorException + throws GeneratorException { Object optionValue = controllerState.getOption(optionName); if (optionValue == null) @@ -158,28 +158,28 @@ public final class OutletUtils ControllerState controllerState, Class<?> clazz, String expectedFieldNames) - throws GeneratorException + throws GeneratorException { if (optionName != null && sourceElementName == null && presetValue == null && variableName == null) { - return OutletUtils.getOption( - optionName, - controllerState, - clazz); + return OutletUtils.getOption( + optionName, + controllerState, + clazz); } else if (sourceElementName != null && optionName == null && presetValue == null && variableName == null) { - return OutletUtils.getSourceElementAttribute( - sourceElementName, - sourceElementAttribute, - controllerState, - clazz); + return OutletUtils.getSourceElementAttribute( + sourceElementName, + sourceElementAttribute, + controllerState, + clazz); } else if (variableName != null && sourceElementName == null @@ -187,13 +187,13 @@ public final class OutletUtils && presetValue == null) { Namespace namespace - = controllerState.getOutlet().getName().getNamespace(); + = controllerState.getOutlet().getName().getNamespace(); QualifiedName variableQualifiedName = new QualifiedName( variableName, namespace); Variable variable - = controllerState.getVariableStore().getInHierarchy( - variableQualifiedName); + = controllerState.getVariableStore().getInHierarchy( + variableQualifiedName); if (variable == null) { log.info("clazz.getName() : Variable " + variableQualifiedName Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/outlet/java/OutletWithoutMergepoints.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/outlet/java/OutletWithoutMergepoints.java?rev=1839288&r1=1839287&r2=1839288&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/outlet/java/OutletWithoutMergepoints.java (original) +++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/outlet/java/OutletWithoutMergepoints.java Mon Aug 27 09:48:33 2018 @@ -47,7 +47,7 @@ public abstract class OutletWithoutMerge { throw new UnsupportedOperationException( "The outlet " + getClass().getName() - + " does not support mergepoints"); + + " does not support mergepoints"); } @Override Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/outlet/java/StringInputOutlet.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/outlet/java/StringInputOutlet.java?rev=1839288&r1=1839287&r2=1839288&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/outlet/java/StringInputOutlet.java (original) +++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/outlet/java/StringInputOutlet.java Mon Aug 27 09:48:33 2018 @@ -137,7 +137,7 @@ public abstract class StringInputOutlet * returned) */ protected String getInput(ControllerState controllerState) - throws GeneratorException + throws GeneratorException { return OutletUtils.getFromDifferentPlaces( inputValue, Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/processor/string/Camelbacker.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/processor/string/Camelbacker.java?rev=1839288&r1=1839287&r2=1839288&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/processor/string/Camelbacker.java (original) +++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/processor/string/Camelbacker.java Mon Aug 27 09:48:33 2018 @@ -66,6 +66,7 @@ public class Camelbacker implements Stri /** * Does the camelback processing according to the settings. */ + @Override public String process(String toProcess) { StringBuilder result = new StringBuilder(); Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/processor/string/CharReplacer.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/processor/string/CharReplacer.java?rev=1839288&r1=1839287&r2=1839288&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/processor/string/CharReplacer.java (original) +++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/processor/string/CharReplacer.java Mon Aug 27 09:48:33 2018 @@ -28,14 +28,14 @@ public class CharReplacer implements Str * Characters which are not allowed in java class names */ public static final String JAVA_CLASSNAME_SPECIAL_CHARS - = "-.;,\"'#+*`´~"; + = "-.;,\"'#+*`´~"; /** * The String which is usually used as replacement for not allowed * characters in java class names. */ public static final String JAVA_CLASSNAME_REPLACEMENT - = "_"; + = "_"; /** * Contains the characters which should be replaced. @@ -108,6 +108,7 @@ public class CharReplacer implements Str * * @return the processed String, not null. */ + @Override public String process(final String toProcess) { StringBuilder result = new StringBuilder(); Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/processor/string/ConstantNameCreator.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/processor/string/ConstantNameCreator.java?rev=1839288&r1=1839287&r2=1839288&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/processor/string/ConstantNameCreator.java (original) +++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/processor/string/ConstantNameCreator.java Mon Aug 27 09:48:33 2018 @@ -122,7 +122,7 @@ public class ConstantNameCreator extends else { result.append(upperCaseSeparationPrefix) - .append(currentChar); + .append(currentChar); } lastCharWasLowerCase = false; } Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/processor/string/RemoveUnusedImportsProcessor.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/processor/string/RemoveUnusedImportsProcessor.java?rev=1839288&r1=1839287&r2=1839288&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/processor/string/RemoveUnusedImportsProcessor.java (original) +++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/processor/string/RemoveUnusedImportsProcessor.java Mon Aug 27 09:48:33 2018 @@ -32,7 +32,7 @@ public class RemoveUnusedImportsProcesso { /** Regex for import lines. */ private static final Pattern IMPORT_PATTERN - = Pattern.compile("^import .*\\.[^\r\n\\.]*$", Pattern.MULTILINE); + = Pattern.compile("^import .*\\.[^\r\n\\.]*$", Pattern.MULTILINE); /** * Converts Windows CR/LF character sequences to Unix LF sequences. @@ -41,10 +41,11 @@ public class RemoveUnusedImportsProcesso * * @return the processed String, not null. */ + @Override public String process(final String toProcess) { Matcher matcher = IMPORT_PATTERN.matcher(toProcess); - Map<String, String> importsForClasses = new HashMap<String, String>(); + Map<String, String> importsForClasses = new HashMap<>(); while (matcher.find()) { String importLine = matcher.group(); @@ -57,7 +58,7 @@ public class RemoveUnusedImportsProcesso { char followingChar = toProcess.charAt(endPos); if (followingChar == '\r' - && toProcess.charAt(endPos + 1) == '\n') + && toProcess.charAt(endPos + 1) == '\n') { importLine = importLine + followingChar + '\n'; } @@ -78,7 +79,7 @@ public class RemoveUnusedImportsProcesso { doNextRun = false; Iterator<Map.Entry<String, String>> entryIt - = importsForClasses.entrySet().iterator(); + = importsForClasses.entrySet().iterator(); while (entryIt.hasNext()) { Map.Entry<String, String> importForClassEntry = entryIt.next(); Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/processor/string/UnixLinefeedProcessor.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/processor/string/UnixLinefeedProcessor.java?rev=1839288&r1=1839287&r2=1839288&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/processor/string/UnixLinefeedProcessor.java (original) +++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/processor/string/UnixLinefeedProcessor.java Mon Aug 27 09:48:33 2018 @@ -31,6 +31,7 @@ public class UnixLinefeedProcessor imple * * @return the processed String, not null. */ + @Override public String process(final String toProcess) { Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/processor/string/WrapReservedJavaWords.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/processor/string/WrapReservedJavaWords.java?rev=1839288&r1=1839287&r2=1839288&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/processor/string/WrapReservedJavaWords.java (original) +++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/processor/string/WrapReservedJavaWords.java Mon Aug 27 09:48:33 2018 @@ -42,7 +42,7 @@ public class WrapReservedJavaWords imple /** * the set of reserved words. */ - private static final Set<String> RESERVED_WORDS = new HashSet<String>(); + private static final Set<String> RESERVED_WORDS = new HashSet<>(); static { @@ -139,6 +139,7 @@ public class WrapReservedJavaWords imple * * @return the output. */ + @Override public String process(String toProcess) { if (RESERVED_WORDS.contains(toProcess)) Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/qname/Namespace.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/qname/Namespace.java?rev=1839288&r1=1839287&r2=1839288&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/qname/Namespace.java (original) +++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/qname/Namespace.java Mon Aug 27 09:48:33 2018 @@ -54,7 +54,7 @@ public final class Namespace * The root namespace. */ public static final Namespace ROOT_NAMESPACE - = new Namespace(StringUtils.EMPTY); + = new Namespace(StringUtils.EMPTY); /** * The String representation of the namespace. Is never null. @@ -131,10 +131,10 @@ public final class Namespace { if (StringUtils.EMPTY.equals(namespace)) { - return new ArrayList<String>(); + return new ArrayList<>(); } String[] partArray - = namespace.split("\\" + SEPARATOR); + = namespace.split("\\" + SEPARATOR); return Arrays.asList(partArray); } Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/qname/QualifiedName.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/qname/QualifiedName.java?rev=1839288&r1=1839287&r2=1839288&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/qname/QualifiedName.java (original) +++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/qname/QualifiedName.java Mon Aug 27 09:48:33 2018 @@ -91,9 +91,9 @@ public final class QualifiedName { this(nameOrQualifiedName, defaultNamespace != null - ? new Namespace(defaultNamespace) - : null); - } + ? new Namespace(defaultNamespace) + : null); + } /** * Creates a QualifiedName from a fully qualified name or the name and the @@ -131,7 +131,7 @@ public final class QualifiedName { setName(nameOrQualifiedName.substring(dotIndex + 1).trim()); String namespacePart - = nameOrQualifiedName.substring(0, dotIndex).trim(); + = nameOrQualifiedName.substring(0, dotIndex).trim(); setNamespace(namespacePart); } } @@ -159,7 +159,7 @@ public final class QualifiedName { throw new IllegalArgumentException( "name \"" + name + "\" must not contain " - + SEPARATOR); + + SEPARATOR); } if (StringUtils.isBlank(name)) { Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/qname/QualifiedNameMap.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/qname/QualifiedNameMap.java?rev=1839288&r1=1839287&r2=1839288&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/qname/QualifiedNameMap.java (original) +++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/qname/QualifiedNameMap.java Mon Aug 27 09:48:33 2018 @@ -35,7 +35,7 @@ import java.util.Set; * @param <T> The class of the object which should be stored in the map. */ public class QualifiedNameMap<T> - implements Map<QualifiedName, T>, Serializable +implements Map<QualifiedName, T>, Serializable { /** * SerialVersionUid for serializing. @@ -53,7 +53,7 @@ public class QualifiedNameMap<T> */ public QualifiedNameMap() { - map = new HashMap<QualifiedName, T>(); + map = new HashMap<>(); } /** @@ -68,7 +68,7 @@ public class QualifiedNameMap<T> throw new IllegalArgumentException( "map must not contain a mapping for the key null"); } - this.map = new HashMap<QualifiedName, T>(map); + this.map = new HashMap<>(map); } /** @@ -97,7 +97,7 @@ public class QualifiedNameMap<T> */ public T getInHierarchy(QualifiedName key) { - while (true) + while (true) { if (map.containsKey(key)) { @@ -134,7 +134,7 @@ public class QualifiedNameMap<T> */ public QualifiedName getKeyInHierarchy(QualifiedName key) { - while (true) + while (true) { if (map.containsKey(key)) { @@ -175,7 +175,7 @@ public class QualifiedNameMap<T> */ public QualifiedNameMap<T> getAllInHierarchy(Namespace namespace) { - QualifiedNameMap<T> result = new QualifiedNameMap<T>(); + QualifiedNameMap<T> result = new QualifiedNameMap<>(); for (Map.Entry<QualifiedName, T> entry : entrySet()) { QualifiedName qualifiedName = entry.getKey(); @@ -209,7 +209,7 @@ public class QualifiedNameMap<T> */ public QualifiedNameMap<T> getInHierarchy(Namespace namespace) { - QualifiedNameMap<T> result = new QualifiedNameMap<T>(); + QualifiedNameMap<T> result = new QualifiedNameMap<>(); for (Map.Entry<QualifiedName, T> entry : entrySet()) { QualifiedName qualifiedName = entry.getKey(); @@ -220,11 +220,11 @@ public class QualifiedNameMap<T> } Iterator<Map.Entry<QualifiedName, T>> resultEntryIt - = result.entrySet().iterator(); + = result.entrySet().iterator(); while (resultEntryIt.hasNext()) { Map.Entry<QualifiedName, T> resultEntry - = resultEntryIt.next(); + = resultEntryIt.next(); QualifiedName resultQName = resultEntry.getKey(); if (!resultQName.getName().equals(qualifiedName.getName())) { @@ -263,6 +263,7 @@ public class QualifiedNameMap<T> * @see Map#get(java.lang.Object) * @see #getInHierarchy(QualifiedName) */ + @Override public T get(Object key) { return map.get(key); @@ -279,6 +280,7 @@ public class QualifiedNameMap<T> * * @see Map#put(Object, Object) */ + @Override public T put(QualifiedName key, T value) { if (key == null) @@ -302,6 +304,7 @@ public class QualifiedNameMap<T> * * @see Map#putAll(java.util.Map) */ + @Override public void putAll(Map<? extends QualifiedName, ? extends T> toPut) { if (toPut.containsKey(null)) @@ -322,6 +325,7 @@ public class QualifiedNameMap<T> * * @see Map#remove(java.lang.Object) */ + @Override public T remove(Object key) { return map.remove(key); @@ -332,6 +336,7 @@ public class QualifiedNameMap<T> * * @see Map#clear() */ + @Override public void clear() { map.clear(); @@ -348,6 +353,7 @@ public class QualifiedNameMap<T> * * @see Map#containsKey(java.lang.Object) */ + @Override public boolean containsKey(Object key) { return map.containsKey(key); @@ -360,6 +366,7 @@ public class QualifiedNameMap<T> * * @see Map#entrySet() */ + @Override public Set<Map.Entry<QualifiedName, T>> entrySet() { return map.entrySet(); @@ -374,6 +381,7 @@ public class QualifiedNameMap<T> * * @see Map#containsValue(java.lang.Object) */ + @Override public boolean containsValue(Object value) { return map.containsValue(value); @@ -386,6 +394,7 @@ public class QualifiedNameMap<T> * * @see Map#values() */ + @Override public Collection<T> values() { return map.values(); @@ -398,6 +407,7 @@ public class QualifiedNameMap<T> * * @see Map#size() */ + @Override public int size() { return map.size(); @@ -410,6 +420,7 @@ public class QualifiedNameMap<T> * * @see Map#isEmpty() */ + @Override public boolean isEmpty() { return map.isEmpty(); @@ -422,6 +433,7 @@ public class QualifiedNameMap<T> * * @see Map#keySet() */ + @Override public Set<QualifiedName> keySet() { return map.keySet(); @@ -441,7 +453,7 @@ public class QualifiedNameMap<T> * * @param object1 the first object to compare. * @param qualifiedName1 the qualified name of the first object, - * must not be null if object1 is not null. + * must not be null if object1 is not null. * @param object2 the second object to compare. * @param qualifiedName2 the namepsace of the second object, * must not be null, if object2 is not null. Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/ModelNodeFactory.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/ModelNodeFactory.java?rev=1839288&r1=1839287&r2=1839288&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/ModelNodeFactory.java (original) +++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/ModelNodeFactory.java Mon Aug 27 09:48:33 2018 @@ -41,21 +41,24 @@ public class ModelNodeFactory implements /** factory order constant */ public static final int MODEL_NODE_FACTORY_ORDER = 2; + @Override public int getOrder() { return MODEL_NODE_FACTORY_ORDER; } + @Override public NodePointer createNodePointer( final QName name, final Object bean, final Locale locale) { final JXPathBeanInfo bi - = JXPathIntrospector.getBeanInfo(bean.getClass()); + = JXPathIntrospector.getBeanInfo(bean.getClass()); return new ModelNodePointer(name, bean, bi, bean.getClass(), locale); } + @Override public NodePointer createNodePointer( final NodePointer parent, final QName name, @@ -67,7 +70,7 @@ public class ModelNodeFactory implements } final JXPathBeanInfo bi - = JXPathIntrospector.getBeanInfo(bean.getClass()); + = JXPathIntrospector.getBeanInfo(bean.getClass()); return new ModelNodePointer(parent, name, bean, bi, bean.getClass()); } } Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/ModelPropertyPointer.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/ModelPropertyPointer.java?rev=1839288&r1=1839287&r2=1839288&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/ModelPropertyPointer.java (original) +++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/ModelPropertyPointer.java Mon Aug 27 09:48:33 2018 @@ -121,7 +121,7 @@ public class ModelPropertyPointer extend { if (propertyNames == null) { - final Set<String> names = new TreeSet<String>(); + final Set<String> names = new TreeSet<>(); for (final PropertyDescriptor pd : beanInfo.getPropertyDescriptors()) { names.add(pd.getName()); @@ -317,8 +317,8 @@ public class ModelPropertyPointer extend if (pd instanceof IndexedPropertyDescriptor) { return ValueUtils.getIndexedPropertyLength( - getBean(), - (IndexedPropertyDescriptor) pd); + getBean(), + (IndexedPropertyDescriptor) pd); } hint = ValueUtils.getCollectionHint(pd.getPropertyType()); } @@ -347,7 +347,7 @@ public class ModelPropertyPointer extend if (f == null) { throw new JXPathInvalidAccessException( - "Cannot set property: " + asPath() + " - no such property"); + "Cannot set property: " + asPath() + " - no such property"); } setFieldValue(f, value); } @@ -451,7 +451,7 @@ public class ModelPropertyPointer extend if (inx == UNSPECIFIED_PROPERTY) { propertyDescriptor = - beanInfo.getPropertyDescriptor(name); + beanInfo.getPropertyDescriptor(name); } else { @@ -459,7 +459,7 @@ public class ModelPropertyPointer extend if (inx >= 0 && inx < names.length) { propertyDescriptor - = beanInfo.getPropertyDescriptor(names[inx]); + = beanInfo.getPropertyDescriptor(names[inx]); } else { @@ -510,19 +510,19 @@ public class ModelPropertyPointer extend { throw new JXPathException( "Cannot access property: " - + valueClass.getName() - + "." - + name, - e); - } + + valueClass.getName() + + "." + + name, + e); + } catch (final NoSuchFieldException e) { throw new JXPathException( "Cannot access property: " - + valueClass.getName() - + "." - + name, - e); + + valueClass.getName() + + "." + + name, + e); } } @@ -536,19 +536,19 @@ public class ModelPropertyPointer extend { throw new JXPathException( "Cannot access property: " - + (bean == null ? "null" : bean.getClass().getName()) - + "." - + name, - e); + + (bean == null ? "null" : bean.getClass().getName()) + + "." + + name, + e); } catch (final IllegalAccessException e) { throw new JXPathException( "Cannot access property: " - + (bean == null ? "null" : bean.getClass().getName()) - + "." - + name, - e); + + (bean == null ? "null" : bean.getClass().getName()) + + "." + + name, + e); } } Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/PostprocessorDefinition.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/PostprocessorDefinition.java?rev=1839288&r1=1839287&r2=1839288&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/PostprocessorDefinition.java (original) +++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/PostprocessorDefinition.java Mon Aug 27 09:48:33 2018 @@ -73,7 +73,7 @@ public final class PostprocessorDefiniti public int hashCode() { HashCodeBuilder hashCodeBuilder = new HashCodeBuilder() - .append(postprocessor); + .append(postprocessor); return hashCodeBuilder.toHashCode(); } @@ -94,7 +94,7 @@ public final class PostprocessorDefiniti } PostprocessorDefinition other = (PostprocessorDefinition) obj; EqualsBuilder equalsBuilder = new EqualsBuilder() - .append(postprocessor, other.postprocessor); + .append(postprocessor, other.postprocessor); return equalsBuilder.isEquals(); } } Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/SourceElement.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/SourceElement.java?rev=1839288&r1=1839287&r2=1839288&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/SourceElement.java (original) +++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/SourceElement.java Mon Aug 27 09:48:33 2018 @@ -60,7 +60,7 @@ public class SourceElement implements Se * the source element's attributes. */ private final Map<String, Object> attributes - = new LinkedHashMap<String, Object>(); + = new LinkedHashMap<>(); /** * Constructor. @@ -157,7 +157,7 @@ public class SourceElement implements Se { throw new NullPointerException("name must not be null"); } - List<SourceElement> result = new ArrayList<SourceElement>(); + List<SourceElement> result = new ArrayList<>(); for (SourceElement sourceElement : children) { if (name.equals(sourceElement.getName())) @@ -307,7 +307,7 @@ public class SourceElement implements Se "parent is not a parent of this SourceElement"); } ListIterator<SourceElement> sameLevelIt - = SourcePath.getSiblingIteratorPositionedOnSelf(this, parent); + = SourcePath.getSiblingIteratorPositionedOnSelf(this, parent); if (!sameLevelIt.hasNext()) { return null; @@ -398,7 +398,7 @@ public class SourceElement implements Se "parent is not a parent of this SourceElement"); } ListIterator<SourceElement> sameLevelIt - = SourcePath.getSiblingIteratorPositionedOnSelf(this, parent); + = SourcePath.getSiblingIteratorPositionedOnSelf(this, parent); sameLevelIt.previous(); if (!sameLevelIt.hasPrevious()) { @@ -500,7 +500,7 @@ public class SourceElement implements Se public SourceElement copy() { Map<SourceElement, SourceElement> copied - = new HashMap<SourceElement, SourceElement>(); + = new HashMap<>(); return copy(this, copied); } @@ -546,7 +546,7 @@ public class SourceElement implements Se for (SourceElement parent : toCopy.getParents()) { SourceElement copiedParent - = copy(parent, copiedElements); + = copy(parent, copiedElements); if (!parentsOfCopied.contains(copiedParent)) { parentsOfCopied.add(copiedParent); @@ -570,7 +570,7 @@ public class SourceElement implements Se */ public boolean graphEquals(final SourceElement toCompare) { - Set<SourceElement> alreadyCompared = new HashSet<SourceElement>(); + Set<SourceElement> alreadyCompared = new HashSet<>(); return graphEquals(this, toCompare, alreadyCompared); } @@ -628,9 +628,9 @@ public class SourceElement implements Se for (String attributeName : reference.getAttributeNames()) { Object referenceAttributeContent - = reference.getAttribute(attributeName); + = reference.getAttribute(attributeName); Object toCompareAttributeContent - = toCompare.getAttribute(attributeName); + = toCompare.getAttribute(attributeName); if (referenceAttributeContent == null) { if (toCompareAttributeContent != null) @@ -660,9 +660,9 @@ public class SourceElement implements Se } Iterator<SourceElement> referenceChildIt - = reference.getChildren().iterator(); + = reference.getChildren().iterator(); Iterator<SourceElement> toCompareChildIt - = toCompare.getChildren().iterator(); + = toCompare.getChildren().iterator(); while (referenceChildIt.hasNext()) { SourceElement referenceChild = referenceChildIt.next(); @@ -678,7 +678,7 @@ public class SourceElement implements Se @Override public String toString() { - Set<SourceElement> alreadyProcessed = new HashSet<SourceElement>(); + Set<SourceElement> alreadyProcessed = new HashSet<>(); StringBuilder result = new StringBuilder(); toString(alreadyProcessed, result); return result.toString(); @@ -697,9 +697,9 @@ public class SourceElement implements Se { alreadyProcessed.add(this); result.append("(name=").append(name) - .append(",attributes=("); + .append(",attributes=("); Iterator<Map.Entry<String, Object>> entryIt - = attributes.entrySet().iterator(); + = attributes.entrySet().iterator(); while (entryIt.hasNext()) { Map.Entry<String, Object> entry = entryIt.next(); @@ -741,7 +741,7 @@ public class SourceElement implements Se /** The children list, not null. */ private final List<SourceElement> children - = new ArrayList<SourceElement>(); + = new ArrayList<>(); /** * Constructor. @@ -780,7 +780,7 @@ public class SourceElement implements Se { throw new IllegalArgumentException( "Element " + child + " is already a child of " - + sourceElement); + + sourceElement); } children.add(position, child); List<SourceElement> parents = child.getParents(); @@ -807,7 +807,7 @@ public class SourceElement implements Se { throw new IllegalArgumentException( "Element " + child + " is already a child of " - + sourceElement); + + sourceElement); } SourceElement previousChild = children.set(index, child); previousChild.getParents().remove(sourceElement); @@ -830,7 +830,7 @@ public class SourceElement implements Se /** The parent list, not null. */ private final List<SourceElement> parents - = new ArrayList<SourceElement>(); + = new ArrayList<>(); /** * Constructor. @@ -869,7 +869,7 @@ public class SourceElement implements Se { throw new IllegalArgumentException( "Element " + parent + " is already a parent of " - + sourceElement); + + sourceElement); } parents.add(position, parent); List<SourceElement> children = parent.getChildren(); @@ -896,7 +896,7 @@ public class SourceElement implements Se { throw new IllegalArgumentException( "Element " + parent + " is already a parent of " - + sourceElement); + + sourceElement); } SourceElement previousParent = parents.set(index, parent); previousParent.getChildren().remove(sourceElement); Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/SourceElementAttributeIterator.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/SourceElementAttributeIterator.java?rev=1839288&r1=1839287&r2=1839288&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/SourceElementAttributeIterator.java (original) +++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/SourceElementAttributeIterator.java Mon Aug 27 09:48:33 2018 @@ -63,7 +63,7 @@ public class SourceElementAttributeItera { this.parent = parent; this.name = qName.getName(); - names = new ArrayList<String>(); + names = new ArrayList<>(); sourceElement = (SourceElement) parent.getNode(); if (!name.equals("*")) { @@ -101,6 +101,7 @@ public class SourceElementAttributeItera return false; } + @Override public NodePointer getNodePointer() { if (position == 0) @@ -122,11 +123,13 @@ public class SourceElementAttributeItera names.get(index)); } + @Override public int getPosition() { return position; } + @Override public boolean setPosition(final int position) { this.position = position; Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/SourceElementAttributePointer.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/SourceElementAttributePointer.java?rev=1839288&r1=1839287&r2=1839288&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/SourceElementAttributePointer.java (original) +++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/SourceElementAttributePointer.java Mon Aug 27 09:48:33 2018 @@ -121,8 +121,8 @@ public class SourceElementAttributePoint public boolean testNode(final NodeTest nodeTest) { return nodeTest == null - || ((nodeTest instanceof NodeTypeTest) - && ((NodeTypeTest) nodeTest).getNodeType() == Compiler.NODE_TYPE_NODE); + || ((nodeTest instanceof NodeTypeTest) + && ((NodeTypeTest) nodeTest).getNodeType() == Compiler.NODE_TYPE_NODE); } /** @@ -153,7 +153,7 @@ public class SourceElementAttributePoint { buffer.append(parent.asPath()); if (buffer.length() == 0 - || buffer.charAt(buffer.length() - 1) != '/') + || buffer.charAt(buffer.length() - 1) != '/') { buffer.append('/'); } @@ -167,9 +167,9 @@ public class SourceElementAttributePoint public int hashCode() { return new HashCodeBuilder() - .append(sourceElement) - .append(name) - .toHashCode(); + .append(sourceElement) + .append(name) + .toHashCode(); } @Override @@ -184,7 +184,7 @@ public class SourceElementAttributePoint return false; } final SourceElementAttributePointer other - = (SourceElementAttributePointer) object; + = (SourceElementAttributePointer) object; if (sourceElement != other.sourceElement) { return false; Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/SourceElementNodeIterator.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/SourceElementNodeIterator.java?rev=1839288&r1=1839287&r2=1839288&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/SourceElementNodeIterator.java (original) +++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/SourceElementNodeIterator.java Mon Aug 27 09:48:33 2018 @@ -60,10 +60,10 @@ public class SourceElementNodeIterator i * @param startWith starting pointer */ public SourceElementNodeIterator( - final NodePointer parent, - final NodeTest nodeTest, - final boolean reverse, - final NodePointer startWith) + final NodePointer parent, + final NodeTest nodeTest, + final boolean reverse, + final NodePointer startWith) { this.parent = parent; this.sourceElement = (SourceElement) parent.getNode(); @@ -75,6 +75,7 @@ public class SourceElementNodeIterator i this.reverse = reverse; } + @Override public NodePointer getNodePointer() { if (position == 0) @@ -90,11 +91,13 @@ public class SourceElementNodeIterator i return null; } + @Override public int getPosition() { return position; } + @Override public boolean setPosition(final int position) { while (this.position < position) Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/SourceElementNodePointer.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/SourceElementNodePointer.java?rev=1839288&r1=1839287&r2=1839288&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/SourceElementNodePointer.java (original) +++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/SourceElementNodePointer.java Mon Aug 27 09:48:33 2018 @@ -84,7 +84,7 @@ public class SourceElementNodePointer ex return 1; } SourceElement parentInPath - = ((SourceElement) getParent().getBaseValue()); + = ((SourceElement) getParent().getBaseValue()); return parentInPath.getChildren(sourceElement.getName()).size(); } @@ -117,9 +117,9 @@ public class SourceElementNodePointer ex final NodePointer pointer2) { final SourceElement sourceElement1 - = (SourceElement) pointer1.getBaseValue(); + = (SourceElement) pointer1.getBaseValue(); final SourceElement sourceElement2 - = (SourceElement) pointer2.getBaseValue(); + = (SourceElement) pointer2.getBaseValue(); if (sourceElement1 == sourceElement2) { return 0; @@ -185,7 +185,7 @@ public class SourceElementNodePointer ex } if (wildcard || testName.getName().equals(sourceElement.getName())) { - return true; + return true; } return false; } Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/SourceElementNodePointerFactory.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/SourceElementNodePointerFactory.java?rev=1839288&r1=1839287&r2=1839288&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/SourceElementNodePointerFactory.java (original) +++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/SourceElementNodePointerFactory.java Mon Aug 27 09:48:33 2018 @@ -32,11 +32,13 @@ import org.apache.commons.jxpath.ri.mode */ public class SourceElementNodePointerFactory implements NodePointerFactory { + @Override public int getOrder() { return 1; } + @Override public NodePointer createNodePointer( final QName name, final Object object, @@ -44,9 +46,10 @@ public class SourceElementNodePointerFac { return object instanceof SourceElement ? new SourceElementNodePointer((SourceElement) object, locale) - : null; + : null; } + @Override public NodePointer createNodePointer( final NodePointer parent, final QName name, @@ -54,7 +57,7 @@ public class SourceElementNodePointerFac { return object instanceof SourceElement ? new SourceElementNodePointer(parent, (SourceElement) object) - : null; + : null; } } Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/SourceImpl.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/SourceImpl.java?rev=1839288&r1=1839287&r2=1839288&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/SourceImpl.java (original) +++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/SourceImpl.java Mon Aug 27 09:48:33 2018 @@ -40,8 +40,9 @@ public abstract class SourceImpl impleme */ protected abstract SourceElement createRootElement() throws SourceException; + @Override public synchronized SourceElement getRootElement() - throws SourceException + throws SourceException { if (rootElement == null) { Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/SourcePath.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/SourcePath.java?rev=1839288&r1=1839287&r2=1839288&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/SourcePath.java (original) +++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/SourcePath.java Mon Aug 27 09:48:33 2018 @@ -180,11 +180,11 @@ public final class SourcePath throw new NullPointerException("sourceElement must not be null"); } - final List<SourceElement> result = new ArrayList<SourceElement>(); + final List<SourceElement> result = new ArrayList<>(); final ListIterator<SourceElement> sameLevelIt - = getSiblingIteratorPositionedOnSelf( - sourceElement, - sourceElement.getParent()); + = getSiblingIteratorPositionedOnSelf( + sourceElement, + sourceElement.getParent()); if (sameLevelIt == null) { return result; @@ -233,12 +233,12 @@ public final class SourcePath { throw new NullPointerException("sourceElement must not be null"); } - final List<SourceElement> result = new ArrayList<SourceElement>(); + final List<SourceElement> result = new ArrayList<>(); final ListIterator<SourceElement> sameLevelIt - = getSiblingIteratorPositionedOnSelf( - sourceElement, - sourceElement.getParent()); + = getSiblingIteratorPositionedOnSelf( + sourceElement, + sourceElement.getParent()); if (sameLevelIt == null) { return result; @@ -279,7 +279,7 @@ public final class SourcePath return null; } final ListIterator<SourceElement> sameLevelIt - = parent.getChildren().listIterator(); + = parent.getChildren().listIterator(); boolean found = false; while (sameLevelIt.hasNext()) @@ -365,7 +365,7 @@ public final class SourcePath { throw new IllegalArgumentException( "The pathToBase " + pathToBase - + " is not found in root " + root, + + " is not found in root " + root, e); } @@ -373,7 +373,7 @@ public final class SourcePath if (pathValue != base) { throw new IllegalArgumentException( - "The pathToBase " + pathToBase + "The pathToBase " + pathToBase + " does not evaluate to base " + base + " from root " + root); } @@ -382,7 +382,7 @@ public final class SourcePath { return new SourcePathPointerIterator( JXPathContext.newContext(root) - .iteratePointers(pathToBase)); + .iteratePointers(pathToBase)); } } else @@ -418,18 +418,18 @@ public final class SourcePath if (path.equals(THIS_TOKEN)) { - final List<SourceElement> result = new ArrayList<SourceElement>(1); + final List<SourceElement> result = new ArrayList<>(1); result.add(sourceElement); return result; } final StringTokenizer selectionPathTokenizer - = new StringTokenizer(path, PATH_LEVEL_SEPARATOR); - List<SourceElement> currentSelection = new ArrayList<SourceElement>(); + = new StringTokenizer(path, PATH_LEVEL_SEPARATOR); + List<SourceElement> currentSelection = new ArrayList<>(); currentSelection.add(sourceElement); while (selectionPathTokenizer.hasMoreTokens()) { final String childName = selectionPathTokenizer.nextToken(); - final List<SourceElement> nextSelection = new ArrayList<SourceElement>(); + final List<SourceElement> nextSelection = new ArrayList<>(); for (final SourceElement currentElement : currentSelection) { if (childName.equals(PARENT_TOKEN)) @@ -487,7 +487,7 @@ public final class SourcePath || PATH_LEVEL_SEPARATOR.equals(path.trim())) { // use root element - final List<SourceElement> result = new ArrayList<SourceElement>(1); + final List<SourceElement> result = new ArrayList<>(1); result.add(rootElement); return result; } @@ -513,7 +513,7 @@ public final class SourcePath if (!ANY_ELEMENT_TOKEN.equals(firstElementName) && !rootElement.getName().equals(firstElementName)) { - return new ArrayList<SourceElement>(); + return new ArrayList<>(); } return SourcePath.getElements(rootElement, path); } @@ -545,10 +545,10 @@ public final class SourcePath final SourceElement sourceElement, final String path, final boolean acceptEmpty) - throws GeneratorException + throws GeneratorException { final Iterator<SourcePathPointer> sourceElementIt - = iteratePointer(root, pathToBase, sourceElement, path); + = iteratePointer(root, pathToBase, sourceElement, path); if (!sourceElementIt.hasNext()) { if (acceptEmpty) @@ -559,9 +559,9 @@ public final class SourcePath { throw new GeneratorException( "Source element path " - + path - + " selects no element on source element " - + sourceElement.getName()); + + path + + " selects no element on source element " + + sourceElement.getName()); } } final SourcePathPointer sourcePathPointer = sourceElementIt.next(); @@ -569,9 +569,9 @@ public final class SourcePath { throw new GeneratorException( "Source element path " - + path - + " selects more than a single element on source element " - + sourceElement.getName()); + + path + + " selects more than a single element on source element " + + sourceElement.getName()); } return sourcePathPointer.getValue(); } @@ -596,10 +596,10 @@ public final class SourcePath final SourceElement sourceElement, final String path, final boolean acceptEmpty) - throws GeneratorException + throws GeneratorException { final List<SourceElement> sourceElements - = SourcePath.getElements(sourceElement, path); + = SourcePath.getElements(sourceElement, path); if (sourceElements.isEmpty()) { if (acceptEmpty) @@ -610,18 +610,18 @@ public final class SourcePath { throw new GeneratorException( "Source element path " - + path - + " selects no element on source element " - + sourceElement.getName()); + + path + + " selects no element on source element " + + sourceElement.getName()); } } if (sourceElements.size() > 1) { throw new GeneratorException( "Source element path " - + path - + " selects more than a single element on source element " - + sourceElement.getName()); + + path + + " selects more than a single element on source element " + + sourceElement.getName()); } return sourceElements.get(0); } @@ -638,7 +638,7 @@ public final class SourcePath * @throws GeneratorException if the parent chain contains a closed loop. */ public static String getPathAsString(final SourceElement sourceElement) - throws GeneratorException + throws GeneratorException { final StringBuilder result = new StringBuilder(); getParentPath(sourceElement, new HashSet<SourceElement>(), result); @@ -662,7 +662,7 @@ public final class SourcePath final SourceElement toProcess, final Set<SourceElement> alreadyProcessed, final StringBuilder result) - throws GeneratorException + throws GeneratorException { final SourceElement parent = toProcess.getParent(); if (alreadyProcessed.contains(parent)) @@ -683,7 +683,7 @@ public final class SourcePath * An iterator of SourcePathPointers wrapping a Iterator of jxpath pointers. */ private static final class SourcePathPointerIterator - implements Iterator<SourcePathPointer> + implements Iterator<SourcePathPointer> { /** The wrapped pointer, not null. */ private final Iterator<?> jxpathPointerIterator; @@ -705,17 +705,20 @@ public final class SourcePath this.jxpathPointerIterator = jxpathPointerIterator; } + @Override public boolean hasNext() { return jxpathPointerIterator.hasNext(); } + @Override public SourcePathPointer next() { Pointer pointer = (Pointer) jxpathPointerIterator.next(); return new SourcePathPointer(pointer.getNode(), pointer.asPath()); } + @Override public void remove() { jxpathPointerIterator.remove(); Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/SourceProcessConfiguration.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/SourceProcessConfiguration.java?rev=1839288&r1=1839287&r2=1839288&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/SourceProcessConfiguration.java (original) +++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/SourceProcessConfiguration.java Mon Aug 27 09:48:33 2018 @@ -43,7 +43,7 @@ public class SourceProcessConfiguration /** The source transformers which are executed before transformation. */ private List<SourceTransformerDefinition> transformerDefinitions - = new ArrayList<SourceTransformerDefinition>(); + = new ArrayList<>(); /** The skip decider, or null if none exists. */ private SkipDecider skipDecider; @@ -73,9 +73,9 @@ public class SourceProcessConfiguration * <code>SkipDecider</code> interface. */ public void setSkipDecider( - String skipDecider, - UnitDescriptor unitDescriptor) - throws ConfigurationException + String skipDecider, + UnitDescriptor unitDescriptor) + throws ConfigurationException { if (skipDecider != null) { @@ -97,18 +97,18 @@ public class SourceProcessConfiguration * if the input should not be transformed before generation. */ public void setSourceTransformerDefinitions( - List<SourceTransformerDefinition> transformerDefinitions) + List<SourceTransformerDefinition> transformerDefinitions) { if (transformerDefinitions == null) { this.transformerDefinitions - = new ArrayList<SourceTransformerDefinition>(); + = new ArrayList<>(); } else { this.transformerDefinitions - = new ArrayList<SourceTransformerDefinition>( - transformerDefinitions); + = new ArrayList<>( + transformerDefinitions); } } Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/SourceProvider.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/SourceProvider.java?rev=1839288&r1=1839287&r2=1839288&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/SourceProvider.java (original) +++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/SourceProvider.java Mon Aug 27 09:48:33 2018 @@ -54,7 +54,7 @@ public abstract class SourceProvider imp public final synchronized void init( ConfigurationHandlers configurationHandlers, ControllerState controllerState) - throws ConfigurationException + throws ConfigurationException { if (initialized) { @@ -75,9 +75,9 @@ public abstract class SourceProvider imp * @throws ConfigurationException if resetting fails. */ public final synchronized void reset( - ConfigurationHandlers configurationHandlers, - ControllerState controllerState) - throws ConfigurationException + ConfigurationHandlers configurationHandlers, + ControllerState controllerState) + throws ConfigurationException { if (!initialized) { @@ -100,7 +100,7 @@ public abstract class SourceProvider imp protected abstract void initInternal( ConfigurationHandlers configurationHandlers, ControllerState controllerState) - throws ConfigurationException; + throws ConfigurationException; /** * Resets the sources provided by this SourceProvider. @@ -111,9 +111,9 @@ public abstract class SourceProvider imp * @throws ConfigurationException if resetting fails. */ protected abstract void resetInternal( - ConfigurationHandlers configurationHandlers, - ControllerState controllerState) - throws ConfigurationException; + ConfigurationHandlers configurationHandlers, + ControllerState controllerState) + throws ConfigurationException; /** * Returns whether <code>init()</code> was already called. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
