code style improvements.
authorerik <erik@77661180-640e-0410-b3a8-9f9b13e6d0e0>
Sat, 17 Jul 2010 12:10:54 +0000 (12:10 +0000)
committererik <erik@77661180-640e-0410-b3a8-9f9b13e6d0e0>
Sat, 17 Jul 2010 12:10:54 +0000 (12:10 +0000)
22 files changed:
TODO.txt
support/cdi/.classpath
support/cdi/.settings/org.eclipse.jdt.core.prefs
system/general/src/main/java/org/wamblee/system/adapters/ConstructorConfiguration.java
system/general/src/main/java/org/wamblee/system/adapters/SetterConfiguration.java
system/general/src/main/java/org/wamblee/system/core/AbstractComponent.java
system/general/src/main/java/org/wamblee/system/core/DefaultScope.java
system/general/src/main/java/org/wamblee/system/core/ProvidedInterface.java
system/general/src/main/java/org/wamblee/system/graph/Graph.java
system/general/src/main/java/org/wamblee/system/graph/component/ConnectRequiredProvidedEdgeFilter.java
system/general/src/main/java/org/wamblee/system/graph/component/LinkVisitor.java
system/general/src/main/java/org/wamblee/system/graph/component/package-info.java
system/general/src/test/java/org/wamblee/system/adapters/ObjectAdapterTest.java
system/general/src/test/java/org/wamblee/system/container/ContainerTest.java
system/general/src/test/java/org/wamblee/system/core/Environment.java
system/general/src/test/java/org/wamblee/system/core/IntegerComponent.java
system/general/src/test/java/org/wamblee/system/core/StringComponent.java
system/general/src/test/java/org/wamblee/system/graph/component/ConnectExternalProvidedProvidedEdgeFilterTest.java
system/general/src/test/java/org/wamblee/system/graph/component/ConnectRequiredExternallyRequiredEdgeFilterTest.java
system/spring/src/main/java/org/wamblee/system/spring/PropertySetter.java
system/spring/src/main/java/org/wamblee/system/spring/component/DatasourceComponent.java
system/spring/src/main/java/org/wamblee/system/spring/component/HibernateComponent.java

index 9efb3863f1c1a07e9ea58ccf4a2f30fdbcff813b..24837472bbd047e56dd40376c2b0dd6f1d81a4f5 100644 (file)
--- a/TODO.txt
+++ b/TODO.txt
@@ -1,21 +1,17 @@
-* Styling of the site based on  http://svn.apache.org/repos/asf/maven/skins/tags/maven-stylus-skin-1.2
+* Add and test the JtaRequestCycle.
+* Rename packages under test to org.wamblee.test.general/persistence/jndi
+* Add JTA testing support to the test lib. 
 
 * DatabaseUtils: deletion of tables must be more generic
   First drop all constraints then drop all tables. 
   Or use JPA to drop the tables but that is a short-term solution 
-* Get rid of use of detached objects in security
-  - Use only basic types in UserAdministration
-  - Put API in separate package 
-* add cdi subproject
+
  
 * update mythtv project for java ee 6 
 * reimplement photos application using wicket
 
 * change tracking for all projects with changes plugin
 
-* complete presentation of all wamblee stuff on wamblee.org. 
-* maven sites for each subproject accessible through wamblee.org
 * overview pages for separate areas
 
 * create user mgt application
index 845a6b53b69e79772d9a575865e8bc6d749e6fa9..7c3d14f89b703a4e761aff556779976ec43c6db2 100644 (file)
@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
        <classpathentry kind="src" output="target/classes" path="src/main/java"/>
-       <classpathentry kind="src" output="target/classes" path="src/main/resources"/>
+       <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
        <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
-       <classpathentry kind="src" output="target/test-classes" path="src/test/resources"/>
+       <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
        <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
        <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
        <classpathentry kind="output" path="target/classes"/>
index dda55440b655773d03760f90fc2b6cb25c695a85..c3ed9b62f14697d35615f2639d3bcae6ba891e12 100644 (file)
@@ -1,4 +1,4 @@
-#Wed Jul 14 20:45:46 CEST 2010
+#Sat Jul 17 14:01:46 CEST 2010
 eclipse.preferences.version=1
 org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
 org.eclipse.jdt.core.compiler.compliance=1.6
index b0057b5b2727db289c125aab7c6111881595edb4..874d79516d5c841191782e8c1077bfeb3e731770 100644 (file)
@@ -12,7 +12,7 @@
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- */ 
+ */
 package org.wamblee.system.adapters;
 
 import org.wamblee.collections.CollectionFilter;
@@ -121,9 +121,8 @@ public class ConstructorConfiguration {
                 public boolean matches(Constructor<?> aObject) {
                     if (!publicOnly) {
                         return true;
-                    } else {
-                        return Modifier.isPublic(aObject.getModifiers());
                     }
+                    return Modifier.isPublic(aObject.getModifiers());
                 }
             });
 
index fffd828c0f1257135378da5e5dcb81297653e9a0..7c7adda30fb80d4a70bd6db98b6c011544460d94 100644 (file)
  */
 package org.wamblee.system.adapters;
 
-import org.wamblee.collections.CollectionFilter;
-
-import org.wamblee.conditions.Condition;
-import org.wamblee.conditions.FixedCondition;
-
-import org.wamblee.general.Pair;
-
-import org.wamblee.reflection.ReflectionUtils;
-
-import org.wamblee.system.core.DefaultProvidedInterface;
-import org.wamblee.system.core.DefaultRequiredInterface;
-import org.wamblee.system.core.ProvidedInterface;
-import org.wamblee.system.core.RequiredInterface;
-import org.wamblee.system.core.Scope;
-import org.wamblee.system.core.SystemAssemblyException;
-
-import java.awt.CompositeContext;
-
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.lang.reflect.Modifier;
-
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.Set;
+
+import org.wamblee.collections.CollectionFilter;
+import org.wamblee.conditions.Condition;
+import org.wamblee.reflection.ReflectionUtils;
+import org.wamblee.system.core.RequiredInterface;
+import org.wamblee.system.core.Scope;
+import org.wamblee.system.core.SystemAssemblyException;
 
 /**
  * Represents the configuration for exposing the setters of a class as required
@@ -221,15 +207,15 @@ public class SetterConfiguration {
         }
 
         if (result.size() > 1) {
-            StringBuffer setters = new StringBuffer();
+            StringBuffer settersString = new StringBuffer();
 
             for (Method method : result) {
-                setters.append((method.getName() + " "));
+                settersString.append((method.getName() + " "));
             }
 
             throw new IllegalArgumentException(
                 "Multiple setters found in class '" + clazz.getName() +
-                    " that accept type '" + aType.getName() + "': " + setters);
+                    " that accept type '" + aType.getName() + "': " + settersString);
         }
 
         Method method = result.get(0);
index 1bf835a8b6099a04e4cf98db5f5a38d5cd4e0dbd..c7145cdf20fb37fb02ba472221faf00c0f1f437f 100644 (file)
@@ -157,9 +157,9 @@ public abstract class AbstractComponent<Type> implements Component<Type> {
         if (remaining.get().size() > 0) {
             StringBuffer notProvided = new StringBuffer();
 
-            for (ProvidedInterface provided : remaining.get()) {
+            for (ProvidedInterface providedIntf : remaining.get()) {
                 notProvided.append("\nComponent " + getQualifiedName() +
-                    " did not start interface " + provided);
+                    " did not start interface " + providedIntf);
             }
 
             throw new SystemAssemblyException(notProvided.toString());
@@ -218,9 +218,9 @@ public abstract class AbstractComponent<Type> implements Component<Type> {
     }
 
     public ProvidedInterface findProvidedInterface(String aName) {
-        for (ProvidedInterface provided : getProvidedInterfaces()) {
-            if (provided.getName().equals(aName)) {
-                return provided;
+        for (ProvidedInterface providedIntf : getProvidedInterfaces()) {
+            if (providedIntf.getName().equals(aName)) {
+                return providedIntf;
             }
         }
 
@@ -228,9 +228,9 @@ public abstract class AbstractComponent<Type> implements Component<Type> {
     }
 
     public RequiredInterface findRequiredInterface(String aName) {
-        for (RequiredInterface required : getRequiredInterfaces()) {
-            if (required.getName().equals(aName)) {
-                return required;
+        for (RequiredInterface requiredIntf : getRequiredInterfaces()) {
+            if (requiredIntf.getName().equals(aName)) {
+                return requiredIntf;
             }
         }
 
index e0de67904ca787b98b3270b687df42be1e286543..d3f62a7b88404a3ae6612422ec8b28c4d5114094 100644 (file)
@@ -12,7 +12,7 @@
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- */ 
+ */
 package org.wamblee.system.core;
 
 import java.util.ArrayList;
@@ -132,8 +132,7 @@ public class DefaultScope implements Scope {
             }
 
             return null;
-        } else {
-            return providedIntf.getImplementation(aType);
         }
+        return providedIntf.getImplementation(aType);
     }
 }
index 8687511598219b2b37f677fbbac488df4deb0d02..b40011a51eeb2d24e6c40477ce70e625dfe06c48 100644 (file)
@@ -15,7 +15,6 @@
  */ 
 package org.wamblee.system.core;
 
-import java.util.Collection;
 
 /**
  * Represents an interface provided by a component. Different component objects
index 1fe3fcfd1f77c3f769ab2b90b267786771eda096..d01bc4056e6bbf8d49dc1b8d497fa70aa26ccd5c 100644 (file)
@@ -262,17 +262,17 @@ public class Graph {
      *            Visitor.
      */
     public void accept(Visitor aVisitor) {
-        List<Node> nodes = getNodes(); // copy to make sure the visitor can
+        List<Node> allNodes = getNodes(); // copy to make sure the visitor can
         // modify the
         // list of nodes as part of the loop.
 
-        List<Edge> edges = getEdges(); // copy ..... (see above).
+        List<Edge> allEdges = getEdges(); // copy ..... (see above).
 
-        for (Node node : nodes) {
+        for (Node node : allNodes) {
             aVisitor.visitNode(node);
         }
 
-        for (Edge edge : edges) {
+        for (Edge edge : allEdges) {
             aVisitor.visitEdge(edge);
         }
     }
index a2f918774d3029501c831ff1b8c00df9a39c2ad1..4984b7d805942a07c2a65fae5a5a2258a38dc199 100644 (file)
@@ -12,7 +12,7 @@
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- */ 
+ */
 package org.wamblee.system.graph.component;
 
 import org.wamblee.system.graph.Edge;
@@ -76,13 +76,11 @@ public class ConnectRequiredProvidedEdgeFilter implements EdgeFilter {
                     .getName()))) {
                 // to part matches also
                 return false;
-            } else {
-                // From matches and to doesn't so edgefilter is violated.
-                return true;
             }
-        } else {
-            // From part does not match, restriction does not apply.
-            return false;
+            // From matches and to doesn't so edgefilter is violated.
+            return true;
         }
+        // From part does not match, restriction does not apply.
+        return false;
     }
 }
index ca8eda3f6a03fd6c57e85872202ca989c6d908fe..79f021c5e34ef63638e0d8407625257d3ca758e5 100644 (file)
@@ -17,7 +17,6 @@ package org.wamblee.system.graph.component;
 
 import org.wamblee.system.core.ProvidedInterface;
 import org.wamblee.system.core.SystemAssemblyException;
-import org.wamblee.system.graph.DefaultEdge;
 import org.wamblee.system.graph.Edge;
 import org.wamblee.system.graph.Node;
 import org.wamblee.system.graph.Visitor;
index e906c60134692553f31214c498be43c1c3350945..d0651340dd0dc63ef1bfb2262a0a20fea836ad2b 100644 (file)
@@ -15,7 +15,4 @@
  */ 
 package org.wamblee.system.graph.component;
 
-import org.wamblee.system.core.Component;
-import org.wamblee.system.core.ProvidedInterface;
-import org.wamblee.system.core.RequiredInterface;
 
index 23c3bd9cbd3c265652a9be2912562fd898f8d8c1..a0e477cf0734fb0f18b06a10f5f9e50aad6cc289 100644 (file)
@@ -17,17 +17,11 @@ package org.wamblee.system.adapters;
 
 import org.wamblee.system.container.Container;
 import org.wamblee.system.core.Component;
-import org.wamblee.system.core.DefaultProvidedInterface;
 import org.wamblee.system.core.ProvidedInterface;
 import org.wamblee.system.core.RequiredInterface;
-import org.wamblee.system.core.RequiredInterfaceComparator;
 import org.wamblee.system.core.Scope;
-
 import org.wamblee.test.AssertionUtils;
 
-import java.util.Collections;
-import java.util.List;
-
 /**
  * 
  * @author $author$
index 2721c5115ec7289747112407214e9620f310c9bc..01f8a35f7c93b7685a109e638878849a2eb48a56 100644 (file)
  */ 
 package org.wamblee.system.container;
 
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
 import junit.framework.TestCase;
 
-import org.junit.internal.requests.IgnoredClassRunner;
 import org.wamblee.general.Pair;
-
 import org.wamblee.system.core.Component;
 import org.wamblee.system.core.DefaultProvidedInterface;
 import org.wamblee.system.core.DefaultRequiredInterface;
@@ -30,15 +32,9 @@ import org.wamblee.system.core.RequiredInterface;
 import org.wamblee.system.core.Scope;
 import org.wamblee.system.core.StringComponent;
 import org.wamblee.system.core.SystemAssemblyException;
-
 import org.wamblee.test.AssertionUtils;
 import org.wamblee.test.EventTracker;
 
-import java.io.Serializable;
-
-import java.util.ArrayList;
-import java.util.List;
-
 /**
  * 
  * @author $author$
index 6a39b645688b3f9fbaeb0e94a63d8d8390586593..901801bca0173a606dbb0c4b02b2ebd26fc73b71 100644 (file)
  */ 
 package org.wamblee.system.core;
 
-import org.wamblee.system.core.AbstractComponent;
-import org.wamblee.system.core.DefaultProvidedInterface;
-import org.wamblee.system.core.ProvidedInterface;
-import org.wamblee.system.core.RequiredInterface;
-
 import org.wamblee.test.EventTracker;
 
-import javax.sql.DataSource;
-
 /**
  * 
  * @author $author$
index c560d6e6149b5a7a627ee01fb7edc439fd424a9e..20b5a625c1a857515a8628bbce3573db27e3873f 100644 (file)
  */ 
 package org.wamblee.system.core;
 
-import org.wamblee.system.core.AbstractComponent;
-import org.wamblee.system.core.DefaultProvidedInterface;
-import org.wamblee.system.core.ProvidedInterface;
-import org.wamblee.system.core.RequiredInterface;
-
 import org.wamblee.test.EventTracker;
 
-import javax.sql.DataSource;
-
 /**
  * 
  * @author $author$
index e79a394d73b86f330ec5fdb2039091f8872787b0..46777c497f830fa55131059a34a0fbe409ea1faf 100644 (file)
  */ 
 package org.wamblee.system.core;
 
-import org.wamblee.system.core.AbstractComponent;
-import org.wamblee.system.core.DefaultProvidedInterface;
-import org.wamblee.system.core.ProvidedInterface;
-import org.wamblee.system.core.RequiredInterface;
-
 import org.wamblee.test.EventTracker;
 
-import javax.sql.DataSource;
-
 /**
  * 
  * @author $author$
index 0ba053b518b02c49f1c940e6889c0321f68969cf..1c5358fb8a1abb639bb196077cb174d99f6aedbc 100644 (file)
@@ -93,8 +93,8 @@ public class ConnectExternalProvidedProvidedEdgeFilterTest extends TestCase {
     public void testWrongEdgeType() {
         EdgeFilter filter = new ConnectExternalProvidedProvidedFilter(
             externalInterfaceName, internalComponentName, internalInterfaceName);
-        DefaultEdge edge = new DefaultEdge(new DefaultNode("x"),
+        DefaultEdge edge1 = new DefaultEdge(new DefaultNode("x"),
             new DefaultNode("y"));
-        assertFalse(filter.isViolated(edge));
+        assertFalse(filter.isViolated(edge1));
     }
 }
index 167d5caa8e02a1644236fcd71978ec701bad7bcb..bf92e0931e874b96f5e4db0a0b0734c7320ee862 100644 (file)
@@ -82,11 +82,11 @@ public class ConnectRequiredExternallyRequiredEdgeFilterTest extends TestCase {
     }
 
     public void testWrongEdgeType() {
-        DefaultEdge edge = new DefaultEdge(new DefaultNode("x"),
+        DefaultEdge edge1 = new DefaultEdge(new DefaultNode("x"),
             new DefaultNode("y"));
         EdgeFilter filter = new ConnectRequiredExternallyRequiredEdgeFilter(
             comp.getName(), comp.getRequiredInterfaces().get(0).getName(),
             container.getRequiredInterfaces().get(0).getName());
-        assertFalse(filter.isViolated(edge));
+        assertFalse(filter.isViolated(edge1));
     }
 }
index 5483968bddc277720df33c16f2a670b6bced9a09..7653dd0adbb66477f304de684ecf8560b8b7137d 100644 (file)
  */ 
 package org.wamblee.system.spring;
 
-import org.springframework.beans.BeansException;
-import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
-import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer;
-
 import java.util.Properties;
 
+import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer;
+
 /**
  * Bean that provides postprocessing of the bean factory based on a given set of
  * properties.
index 2b21a37bdc51701c266aa44729c261b922d3bda5..f0aa825ab37870ba01a0bd8180ac1e2e74cf2862 100644 (file)
  */ 
 package org.wamblee.system.spring.component;
 
-import org.springframework.core.io.ClassPathResource;
+import java.util.Properties;
 
-import org.springframework.jdbc.datasource.DriverManagerDataSource;
+import javax.sql.DataSource;
 
+import org.springframework.jdbc.datasource.DriverManagerDataSource;
 import org.wamblee.system.components.ORMappingConfig;
 import org.wamblee.system.components.ORMappingConfig.DatabaseType;
 import org.wamblee.system.core.AbstractComponent;
@@ -27,15 +28,6 @@ import org.wamblee.system.core.DefaultRequiredInterface;
 import org.wamblee.system.core.ProvidedInterface;
 import org.wamblee.system.core.RequiredInterface;
 import org.wamblee.system.core.Scope;
-import org.wamblee.system.spring.SpringComponent;
-
-import java.io.IOException;
-
-import java.util.Map;
-import java.util.Properties;
-import java.util.TreeMap;
-
-import javax.sql.DataSource;
 
 /**
  * 
@@ -57,7 +49,7 @@ public class DatasourceComponent extends AbstractComponent<DataSource> {
      * 
      * 
      */
-    public DatasourceComponent(String aName) throws IOException {
+    public DatasourceComponent(String aName) {
         super(aName);
 
         addRequiredInterface(PROPS);
index 3f1720949513b158417b39dd74023ca9808d8740..9d5bb83bf6e38e9b03ccad4958906f46b89f24c1 100644 (file)
  */ 
 package org.wamblee.system.spring.component;
 
-import org.hibernate.SessionFactory;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Properties;
 
+import javax.sql.DataSource;
+
+import org.hibernate.SessionFactory;
 import org.hibernate.dialect.DerbyDialect;
 import org.hibernate.dialect.MySQLInnoDBDialect;
-
 import org.springframework.orm.hibernate3.HibernateTemplate;
-
 import org.springframework.transaction.PlatformTransactionManager;
-
 import org.wamblee.persistence.hibernate.HibernateMappingFiles;
-
 import org.wamblee.system.components.ORMappingConfig;
 import org.wamblee.system.components.ORMappingConfig.DatabaseType;
 import org.wamblee.system.core.DefaultProvidedInterface;
@@ -35,14 +36,6 @@ import org.wamblee.system.core.RequiredInterface;
 import org.wamblee.system.core.Scope;
 import org.wamblee.system.spring.SpringComponent;
 
-import java.io.IOException;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Properties;
-
-import javax.sql.DataSource;
-
 /**
  * 
  * @author $author$
@@ -65,7 +58,7 @@ public class HibernateComponent extends SpringComponent {
      * 
      * 
      */
-    public HibernateComponent(String aName) throws IOException {
+    public HibernateComponent(String aName) {
         super(aName, new String[] { HIBERNATE_SPRING_CONFIG },
             createProvided(), createRequired());