camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dhira...@apache.org
Subject [1/4] camel git commit: CAMEL-8900: Fixed Javadoc parser missing first void method in API Component Framework
Date Thu, 25 Jun 2015 03:34:14 GMT
Repository: camel
Updated Branches:
  refs/heads/master 67513554a -> c22af7426


CAMEL-8900: Fixed Javadoc parser missing first void method in API Component Framework


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

Branch: refs/heads/master
Commit: cb71d6b3b7eb7920da818f7d94be36ee4138d728
Parents: 6751355
Author: Dhiraj Bokde <dhirajsb@yahoo.com>
Authored: Wed Jun 24 16:16:13 2015 -0700
Committer: Dhiraj Bokde <dhirajsb@yahoo.com>
Committed: Wed Jun 24 20:33:31 2015 -0700

----------------------------------------------------------------------
 .../src/main/java/org/apache/camel/maven/JavadocParser.java    | 5 +++--
 .../test/java/org/apache/camel/maven/JavadocParserTest.java    | 6 +++---
 2 files changed, 6 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/cb71d6b3/tooling/maven/camel-api-component-maven-plugin/src/main/java/org/apache/camel/maven/JavadocParser.java
----------------------------------------------------------------------
diff --git a/tooling/maven/camel-api-component-maven-plugin/src/main/java/org/apache/camel/maven/JavadocParser.java
b/tooling/maven/camel-api-component-maven-plugin/src/main/java/org/apache/camel/maven/JavadocParser.java
index 706e0b5..b6a1ea2 100644
--- a/tooling/maven/camel-api-component-maven-plugin/src/main/java/org/apache/camel/maven/JavadocParser.java
+++ b/tooling/maven/camel-api-component-maven-plugin/src/main/java/org/apache/camel/maven/JavadocParser.java
@@ -86,7 +86,6 @@ public class JavadocParser extends Parser {
 
                             final String hrefAttr = (String) attributes.getAttribute(HTML.Attribute.HREF);
                             if (hrefAttr != null && hrefAttr.contains(hrefPattern))
{
-
                                 // unescape HTML
                                 String methodSignature = hrefAttr.substring(hrefAttr.indexOf('#')
+ 1);
                                 final int firstHyphen = methodSignature.indexOf('-');
@@ -146,7 +145,9 @@ public class JavadocParser extends Parser {
             }
 
             parserState = ParserState.METHOD_SUMMARY;
-        } else if (parserState == ParserState.METHOD_SUMMARY && HTML.Tag.TABLE.equals(tag.getHTMLTag()))
{
+        } else if (parserState == ParserState.METHOD_SUMMARY
+            && !methods.isEmpty()
+            && HTML.Tag.TABLE.equals(tag.getHTMLTag())) {
             // end of method summary table
             parserState = ParserState.INIT;
         }

http://git-wip-us.apache.org/repos/asf/camel/blob/cb71d6b3/tooling/maven/camel-api-component-maven-plugin/src/test/java/org/apache/camel/maven/JavadocParserTest.java
----------------------------------------------------------------------
diff --git a/tooling/maven/camel-api-component-maven-plugin/src/test/java/org/apache/camel/maven/JavadocParserTest.java
b/tooling/maven/camel-api-component-maven-plugin/src/test/java/org/apache/camel/maven/JavadocParserTest.java
index 183ffbb..8ee9e1e 100644
--- a/tooling/maven/camel-api-component-maven-plugin/src/test/java/org/apache/camel/maven/JavadocParserTest.java
+++ b/tooling/maven/camel-api-component-maven-plugin/src/test/java/org/apache/camel/maven/JavadocParserTest.java
@@ -40,16 +40,16 @@ public class JavadocParserTest extends Assert {
 
         htmlParser.parse(new InputStreamReader(new URL(JAVA6_STRING).openStream(), "UTF-8"));
         assertNull("Java6 getErrorMessage", htmlParser.getErrorMessage());
-        assertFalse("Java6 getMethods", htmlParser.getMethods().isEmpty());
+        assertEquals("Java6 getMethods", 65, htmlParser.getMethods().size());
         htmlParser.reset();
 
         htmlParser.parse(new InputStreamReader(new URL(JAVA7_STRING).openStream(), "UTF-8"));
         assertNull("Java7 getErrorMessage", htmlParser.getErrorMessage());
-        assertFalse("Java7 getMethods", htmlParser.getMethods().isEmpty());
+        assertEquals("Java7 getMethods", 65, htmlParser.getMethods().size());
         htmlParser.reset();
 
         htmlParser.parse(new InputStreamReader(new URL(JAVA8_STRING).openStream(), "UTF-8"));
         assertNull("Java8 getErrorMessage", htmlParser.getErrorMessage());
-        assertFalse("Java8 getMethods", htmlParser.getMethods().isEmpty());
+        assertEquals("Java8 getMethods", 67, htmlParser.getMethods().size());
     }
 }


Mime
View raw message