cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From andr...@apache.org
Subject svn commit: r821158 - in /cocoon/whiteboard/cocoon-links/cocoon-links-impl: pom.xml src/main/java/org/apache/cocoon/links/AttributeConfiguration.java
Date Fri, 02 Oct 2009 20:18:30 GMT
Author: andreas
Date: Fri Oct  2 20:18:30 2009
New Revision: 821158

URL: http://svn.apache.org/viewvc?rev=821158&view=rev
Log:
Implement hashCode and equals for AttributeConfiguration, set Java version to 1.5 for generics
support.

Modified:
    cocoon/whiteboard/cocoon-links/cocoon-links-impl/pom.xml
    cocoon/whiteboard/cocoon-links/cocoon-links-impl/src/main/java/org/apache/cocoon/links/AttributeConfiguration.java

Modified: cocoon/whiteboard/cocoon-links/cocoon-links-impl/pom.xml
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/cocoon-links/cocoon-links-impl/pom.xml?rev=821158&r1=821157&r2=821158&view=diff
==============================================================================
--- cocoon/whiteboard/cocoon-links/cocoon-links-impl/pom.xml (original)
+++ cocoon/whiteboard/cocoon-links/cocoon-links-impl/pom.xml Fri Oct  2 20:18:30 2009
@@ -33,6 +33,21 @@
   <artifactId>cocoon-links-impl</artifactId>
   <version>1.0.0-SNAPSHOT</version>
   <name>Cocoon Links Block Implementation</name>
+  
+  <build>
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-compiler-plugin</artifactId>
+          <configuration>
+            <source>1.5</source>
+            <target>1.5</target>
+          </configuration>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+  </build>
 
   <dependencies>
     <dependency>

Modified: cocoon/whiteboard/cocoon-links/cocoon-links-impl/src/main/java/org/apache/cocoon/links/AttributeConfiguration.java
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/cocoon-links/cocoon-links-impl/src/main/java/org/apache/cocoon/links/AttributeConfiguration.java?rev=821158&r1=821157&r2=821158&view=diff
==============================================================================
--- cocoon/whiteboard/cocoon-links/cocoon-links-impl/src/main/java/org/apache/cocoon/links/AttributeConfiguration.java
(original)
+++ cocoon/whiteboard/cocoon-links/cocoon-links-impl/src/main/java/org/apache/cocoon/links/AttributeConfiguration.java
Fri Oct  2 20:18:30 2009
@@ -57,9 +57,24 @@
     public String getElementLocalName() {
         return this.element;
     }
-    
+
     public String getAttributeName() {
         return this.attribute;
     }
 
+    @Override
+    public int hashCode() {
+        return getKey().hashCode();
+    }
+
+    @Override
+    public boolean equals(Object other) {
+        return other instanceof AttributeConfiguration
+                && ((AttributeConfiguration) other).getKey().equals(getKey());
+    }
+
+    protected String getKey() {
+        return this.namespace + ":" + this.element + ":" + this.attribute;
+    }
+
 }
\ No newline at end of file



Mime
View raw message