Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#1 MetricsFilter does not take into account folders with space

v1.8
closed-accepted
nobody
None
5
2009-02-23
2008-09-05
Anonymous
No

Hello,

The method 'processClass' of the class 'gr.spinellis.ckjm.MetricsFilter' doesn't take into account that the argument 'clspec' could be a class file that has a directory which name contains a space. In that case the flow goes to the 'jar' condition when should go to the 'file' condition.

The original code is:

52 /**
53 * Load and parse the specified class.
54 * The class specification can be either a class file name, or
55 * a jarfile, followed by space, followed by a class file name.
56 */
57 static void processClass(ClassMetricsContainer cm, String clspec) {
58 int spc;
59 JavaClass jc = null;
60
61 if ((spc = clspec.indexOf(' ')) != -1) {

I have changed to:

57 static void processClass(ClassMetricsContainer cm, String clspec) {
58 int spc;
59 JavaClass jc = null;
60 File file = new File (clspec);
61 if ((! file.exists()) && ((spc = clspec.indexOf(' ')) != -1)) {

Regards,
Ernesto Botella Vélez.

Discussion

  • Nicolas  Dordet
    Nicolas Dordet
    2008-10-06

    Hi,

    Sorry to answer only now...
    My project is only the maven ckjm plugin.
    But you can contact Diomidis Spinellis (dds@aueb.gr), the author of ckjm.

    Thanks for your report

    Best Regards,
    Nico

     
  • Nicolas  Dordet
    Nicolas Dordet
    2009-02-23

    • milestone: --> v1.8
     
  • Nicolas  Dordet
    Nicolas Dordet
    2009-02-23

    The patch has -finally- been added (Revision: 140).
    Thanks to Ernesto Botella Vélez.

     
  • Nicolas  Dordet
    Nicolas Dordet
    2009-02-23

    • status: open --> closed
     
  • Nicolas  Dordet
    Nicolas Dordet
    2009-02-23

    • status: closed --> closed-accepted