paul-hammant / paranamer

Paranamer - access to parameter names in Java5, 6, 7, 8
Other
233 stars 37 forks source link

Update to QDox 2.0-M5 #29

Open puntogil opened 7 years ago

puntogil commented 7 years ago

Hi any plans to update QDox to 2.0-M5 ?

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running com.thoughtworks.paranamer.generator.OldQDoxParanamerTestCase
Tests run: 7, Failures: 0, Errors: 7, Skipped: 0, Time elapsed: 0.207 sec <<< FAILURE! - in com.thoughtworks.paranamer.generator.OldQDoxParanamerTestCase
testGenericClassGeneration(com.thoughtworks.paranamer.generator.OldQDoxParanamerTestCase)  Time elapsed: 0.103 sec  <<< ERROR!
java.io.FileNotFoundException: /builddir/build/BUILD/paranamer-cb6709646eed97c271d73f50ad750cc43c8e052a/paranamer-generator/./target/test-classes/com/thoughtworks/paranamer/generator/Monkey/Avocado.class (No such file or directory)
    at com.thoughtworks.paranamer.generator.OldQDoxParanamerTestCase.setUp(OldQDoxParanamerTestCase.java:54)
testGenerationWithInnerClass1(com.thoughtworks.paranamer.generator.OldQDoxParanamerTestCase)  Time elapsed: 0.008 sec  <<< ERROR!
java.io.FileNotFoundException: /builddir/build/BUILD/paranamer-cb6709646eed97c271d73f50ad750cc43c8e052a/paranamer-generator/./target/test-classes/com/thoughtworks/paranamer/generator/Monkey/Avocado.class (No such file or directory)
    at com.thoughtworks.paranamer.generator.OldQDoxParanamerTestCase.setUp(OldQDoxParanamerTestCase.java:54)
testGenerationWithInnerClass2(com.thoughtworks.paranamer.generator.OldQDoxParanamerTestCase)  Time elapsed: 0.008 sec  <<< ERROR!
java.io.FileNotFoundException: /builddir/build/BUILD/paranamer-cb6709646eed97c271d73f50ad750cc43c8e052a/paranamer-generator/./target/test-classes/com/thoughtworks/paranamer/generator/Monkey/Avocado.class (No such file or directory)
    at com.thoughtworks.paranamer.generator.OldQDoxParanamerTestCase.setUp(OldQDoxParanamerTestCase.java:54)
testSimpleClassGeneration(com.thoughtworks.paranamer.generator.OldQDoxParanamerTestCase)  Time elapsed: 0.007 sec  <<< ERROR!
java.io.FileNotFoundException: /builddir/build/BUILD/paranamer-cb6709646eed97c271d73f50ad750cc43c8e052a/paranamer-generator/./target/test-classes/com/thoughtworks/paranamer/generator/Monkey/Avocado.class (No such file or directory)
    at com.thoughtworks.paranamer.generator.OldQDoxParanamerTestCase.setUp(OldQDoxParanamerTestCase.java:54)
testGenerationWithClassMismatchingFilename(com.thoughtworks.paranamer.generator.OldQDoxParanamerTestCase)  Time elapsed: 0.007 sec  <<< ERROR!
java.io.FileNotFoundException: /builddir/build/BUILD/paranamer-cb6709646eed97c271d73f50ad750cc43c8e052a/paranamer-generator/./target/test-classes/com/thoughtworks/paranamer/generator/Monkey/Avocado.class (No such file or directory)
    at com.thoughtworks.paranamer.generator.OldQDoxParanamerTestCase.setUp(OldQDoxParanamerTestCase.java:54)
testGenerationWithMultipleClassesAtSameFile1(com.thoughtworks.paranamer.generator.OldQDoxParanamerTestCase)  Time elapsed: 0.01 sec  <<< ERROR!
java.io.FileNotFoundException: /builddir/build/BUILD/paranamer-cb6709646eed97c271d73f50ad750cc43c8e052a/paranamer-generator/./target/test-classes/com/thoughtworks/paranamer/generator/Monkey/Avocado.class (No such file or directory)
    at com.thoughtworks.paranamer.generator.OldQDoxParanamerTestCase.setUp(OldQDoxParanamerTestCase.java:54)
testGenerationWithMultipleClassesAtSameFile2(com.thoughtworks.paranamer.generator.OldQDoxParanamerTestCase)  Time elapsed: 0.038 sec  <<< ERROR!
java.io.FileNotFoundException: /builddir/build/BUILD/paranamer-cb6709646eed97c271d73f50ad750cc43c8e052a/paranamer-generator/./target/test-classes/com/thoughtworks/paranamer/generator/Monkey/Avocado.class (No such file or directory)
    at com.thoughtworks.paranamer.generator.OldQDoxParanamerTestCase.setUp(OldQDoxParanamerTestCase.java:54)
Running com.thoughtworks.paranamer.generator.QDoxParanamerTestCase
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0 sec <<< FAILURE! - in com.thoughtworks.paranamer.generator.QDoxParanamerTestCase
testFoo(com.thoughtworks.paranamer.generator.QDoxParanamerTestCase)  Time elapsed: 0 sec  <<< ERROR!
java.io.FileNotFoundException: /builddir/build/BUILD/paranamer-cb6709646eed97c271d73f50ad750cc43c8e052a/paranamer-generator/./target/test-classes/com/thoughtworks/paranamer/generator/Monkey/Avocado.class (No such file or directory)
    at com.thoughtworks.paranamer.generator.QDoxParanamerTestCase.setUp(QDoxParanamerTestCase.java:54)
Results :
Tests in error: 
  OldQDoxParanamerTestCase.setUp:54 ? FileNotFound /builddir/build/BUILD/paranam...
  OldQDoxParanamerTestCase.setUp:54 ? FileNotFound /builddir/build/BUILD/paranam...
  OldQDoxParanamerTestCase.setUp:54 ? FileNotFound /builddir/build/BUILD/paranam...
  OldQDoxParanamerTestCase.setUp:54 ? FileNotFound /builddir/build/BUILD/paranam...
  OldQDoxParanamerTestCase.setUp:54 ? FileNotFound /builddir/build/BUILD/paranam...
  OldQDoxParanamerTestCase.setUp:54 ? FileNotFound /builddir/build/BUILD/paranam...
  OldQDoxParanamerTestCase.setUp:54 ? FileNotFound /builddir/build/BUILD/paranam...
  QDoxParanamerTestCase.setUp:54 ? FileNotFound /builddir/build/BUILD/paranamer-...
Tests run: 8, Failures: 0, Errors: 8, Skipped: 0
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Skipping ParaNamer Parent
[INFO] This project has been banned from the build due to previous failures.
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] ParaNamer Parent ................................... SUCCESS [  0.001 s]
[INFO] ParaNamer Generator ................................ FAILURE [  1.664 s]
[INFO] ParaNamer Maven plugin ............................. SKIPPED

thanks in advance

regards

puntogil commented 7 years ago

Maybe this fix could help

--- a/paranamer-generator/src/java/com/thoughtworks/paranamer/generator/QdoxParanamerGenerator.java
+++ b/paranamer-generator/src/java/com/thoughtworks/paranamer/generator/QdoxParanamerGenerator.java
@@ -85,7 +85,7 @@ public class QdoxParanamerGenerator implements ParanamerGenerator {
            content.append(addConstructors(javaClass.getConstructors()));
            content.append(addMethods(javaClass.getMethods()));
             // TODO problem with inner classes
-            makeEnhancer().enhance(new File(outputPath, javaClass.getFullyQualifiedName().replace('.', File.separatorChar) + ".class"), content);
+            makeEnhancer().enhance(new File(outputPath, javaClass.getBinaryName().replace('.', File.separatorChar) + ".class"), content);

         }
     }
@@ -171,7 +171,7 @@ public class QdoxParanamerGenerator implements ParanamerGenerator {
         Iterator<JavaParameter> paramIter = parameters.iterator();
         while(paramIter.hasNext()) {
            JavaParameter param = paramIter.next();
-           sb.append(param.getType().getCanonicalName());
+           sb.append(param.getType().getCanonicalName().replaceAll("\\[\\]", ""));
            if(paramIter.hasNext())
            {
                sb.append(COMMA);