changeset 21:7cd98b5c3440 draft default tip

Fixed issue with virtual methods which were included in the report (which was wrong).
author Pavel Tisnovsky <ptisnovs@redhat.com>
date Thu, 23 Aug 2012 14:06:33 +0200
parents 50271ecf8de5
children
files ChangeLog src/PrintPublicMethods.java
diffstat 2 files changed, 13 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Mon Aug 20 17:32:13 2012 +0200
+++ b/ChangeLog	Thu Aug 23 14:06:33 2012 +0200
@@ -1,3 +1,9 @@
+2012-08-23  Pavel Tisnovsky  <ptisnovs@redhat.com>
+
+	* src/PrintPublicMethods.java:
+	Fixed issue with virtual methods which were included
+	in the report (which was wrong).
+
 2012-08-20  Pavel Tisnovsky  <ptisnovs@redhat.com>
 
 	* src/ReportGenerator.java:
--- a/src/PrintPublicMethods.java	Mon Aug 20 17:32:13 2012 +0200
+++ b/src/PrintPublicMethods.java	Thu Aug 23 14:06:33 2012 +0200
@@ -111,9 +111,13 @@
         final String[] prefixes = new String[] {"public", "final", "native", "synchronized", "static"};
         String methodNameString = methodName;
         // remove all prefixes
-        for (String prefix : prefixes) {
-            // remove one prefix
-            methodNameString = removePrefix(methodNameString, prefix);
+        for (int i = 0; i < prefixes.length; i++) {
+            // the prefixes can be read in semi-random order so we
+            // need to cycle through them several time
+            for (String prefix : prefixes) {
+                // remove one prefix
+                methodNameString = removePrefix(methodNameString, prefix);
+            }
         }
         // "throws" declaration should be removed too
         return removeThrowsFromDeclaration(methodNameString);