Repository: any23
Updated Branches:
  refs/heads/master 2ad518bfc -> 30d701315


Fix generation of BNode name for microdata when 'itemid' is given
without a value. Was using the MD5 of "0" resulting in lots of BNodes
called 'nodecfcd208495d565ef66e7dff9f98764da'
Fix ToolRunnerTest to check for no tools.

Project: http://git-wip-us.apache.org/repos/asf/any23/repo
Commit: http://git-wip-us.apache.org/repos/asf/any23/commit/30d70131
Tree: http://git-wip-us.apache.org/repos/asf/any23/tree/30d70131
Diff: http://git-wip-us.apache.org/repos/asf/any23/diff/30d70131

Branch: refs/heads/master
Commit: 30d701315b98a3996052c26a78165ec6b5dfb6a9
Parents: 2ad518b
Author: tep <[email protected]>
Authored: Mon Sep 8 17:58:23 2014 +0200
Committer: tep <[email protected]>
Committed: Mon Sep 8 17:58:23 2014 +0200

----------------------------------------------------------------------
 .../apache/any23/extractor/microdata/ItemScope.java    | 13 ++++++-------
 .../test/java/org/apache/any23/cli/ToolRunnerTest.java |  1 +
 2 files changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/any23/blob/30d70131/core/src/main/java/org/apache/any23/extractor/microdata/ItemScope.java
----------------------------------------------------------------------
diff --git 
a/core/src/main/java/org/apache/any23/extractor/microdata/ItemScope.java 
b/core/src/main/java/org/apache/any23/extractor/microdata/ItemScope.java
index 7e5cf1c..6287eb3 100644
--- a/core/src/main/java/org/apache/any23/extractor/microdata/ItemScope.java
+++ b/core/src/main/java/org/apache/any23/extractor/microdata/ItemScope.java
@@ -184,13 +184,12 @@ public class ItemScope extends Item {
 
     @Override
     public int hashCode() {
-            return
-                (properties == null ? 1 : properties.hashCode()) *
-                (id == null         ? 1 : id.hashCode()) * 2 *
-                (refs == null       ? 1 : refs.hashCode()) * 3 *
-                (type == null       ? 1 : type.hashCode()) * 5 *
-                (itemId == null     ? 1 : itemId.hashCode());
-
+       int i = properties == null ? 0 : properties.hashCode();
+       i += id == null         ? 0 : id.hashCode();
+       i += refs == null       ? 0 : refs.hashCode();
+       i += type == null       ? 0 : type.hashCode();
+       i += itemId == null     ? 0 : itemId.hashCode();
+       return i;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/any23/blob/30d70131/core/src/test/java/org/apache/any23/cli/ToolRunnerTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/any23/cli/ToolRunnerTest.java 
b/core/src/test/java/org/apache/any23/cli/ToolRunnerTest.java
index c65edd2..881a782 100644
--- a/core/src/test/java/org/apache/any23/cli/ToolRunnerTest.java
+++ b/core/src/test/java/org/apache/any23/cli/ToolRunnerTest.java
@@ -46,6 +46,7 @@ public class ToolRunnerTest {
     @Test
     public void testGetToolsInClasspath() throws IOException {
         Iterator<Tool> tools = new ToolRunner().getToolsInClasspath();
+        assertTrue("No core tools have been detected", tools.hasNext());
         while (tools.hasNext()) {
             assertTrue("Some core tools have not been detected.", 
coreTools.contains(tools.next().getClass()));
         }

Reply via email to