DarwinNE / FidoCadJ

FidoCadJ is a free user-friendly vector graphic editor for MacOSX, Linux, Windows and Android with a library of electronic symbols.
http://darwinne.github.io/FidoCadJ/
GNU General Public License v3.0
113 stars 40 forks source link

Check style warnings. #109

Closed DanteCpp closed 8 years ago

DanteCpp commented 8 years ago

Hi @DarwinNE,

Now running the checkstyle analysis we get just the following warnings:

Starting audit...
[WARN] src/net/sourceforge/fidocadj/librarymodel/LibraryModel.java:85: 'throws' have incorrect indentation level 4, expected level should be 8. [Indentation]
[WARN] src/net/sourceforge/fidocadj/librarymodel/LibraryModel.java:114: 'throws' have incorrect indentation level 4, expected level should be 8. [Indentation]
[WARN] src/net/sourceforge/fidocadj/librarymodel/LibraryModel.java:147: 'throws' have incorrect indentation level 4, expected level should be 8. [Indentation]
[WARN] src/net/sourceforge/fidocadj/librarymodel/LibraryModel.java:181: 'throws' have incorrect indentation level 4, expected level should be 8. [Indentation]
[WARN] src/net/sourceforge/fidocadj/librarymodel/LibraryModel.java:218: 'throws' have incorrect indentation level 4, expected level should be 8. [Indentation]
[WARN] src/net/sourceforge/fidocadj/librarymodel/LibraryModel.java:252: 'throws' have incorrect indentation level 4, expected level should be 8. [Indentation]
[WARN] src/net/sourceforge/fidocadj/librarymodel/LibraryModel.java:368: 'throws' have incorrect indentation level 4, expected level should be 8. [Indentation]
[WARN] src/net/sourceforge/fidocadj/librarymodel/LibraryModel.java:85: 'throws' have incorrect indentation level 4, expected level should be 8. [Indentation]
[WARN] src/net/sourceforge/fidocadj/librarymodel/LibraryModel.java:114: 'throws' have incorrect indentation level 4, expected level should be 8. [Indentation]
[WARN] src/net/sourceforge/fidocadj/librarymodel/LibraryModel.java:147: 'throws' have incorrect indentation level 4, expected level should be 8. [Indentation]
[WARN] src/net/sourceforge/fidocadj/librarymodel/LibraryModel.java:181: 'throws' have incorrect indentation level 4, expected level should be 8. [Indentation]
[WARN] src/net/sourceforge/fidocadj/librarymodel/LibraryModel.java:218: 'throws' have incorrect indentation level 4, expected level should be 8. [Indentation]
[WARN] src/net/sourceforge/fidocadj/librarymodel/LibraryModel.java:252: 'throws' have incorrect indentation level 4, expected level should be 8. [Indentation]
[WARN] src/net/sourceforge/fidocadj/librarymodel/LibraryModel.java:368: 'throws' have incorrect indentation level 4, expected level should be 8. [Indentation]
Audit done.

I do not understand how to fix it, the code look well tabulated, Maybe there is a bug in the checking rules.

Cheers, Dante.

DarwinNE commented 8 years ago

Hi @DanteCpp I tried to manually merge your pull request (there was a conflict).

It seems to work OK right now.

DarwinNE commented 8 years ago

@DanteCpp, I still have a question. I noticed that in your commit e9ad3553f6c7e181b6078b17b8f74e2e866fc632 there are some Checkstyle warnings that appear. However, at least on my machine I do not obtain them. Maybe I am using a Checkstyle version older than yours? (mine is 6.10)

EDIT: Ok, I see now the sense of your very first comment... EDIT2: I just manually checked the file and the warnings are relevant and may be corrected soon.

DanteCpp commented 8 years ago

Dear @DarwinNE,

I'm using the last version (7.1).

The warnings are about tabulation, but I can't understand how I should rightly tabulate the throws statement.

Cheers, Dante.

DarwinNE commented 8 years ago

Dear @DanteCpp the warning means that code such as:

    /**
     * Removes macro from library.
     * Notices LibraryListeners after removed.
     * @param macro MacroDesc to remove.
     * @throws IllegalLibraryAccessException If access standard library.
     */
    public void remove(MacroDesc macro)
    throws IllegalLibraryAccessException
    { 
        /*  ... */
    }

should be instead indented as follows:

    /**
     * Removes macro from library.
     * Notices LibraryListeners after removed.
     * @param macro MacroDesc to remove.
     * @throws IllegalLibraryAccessException If access standard library.
     */
    public void remove(MacroDesc macro)
        throws IllegalLibraryAccessException
    {
         /* ... */
    }

as it is done in such example:

    /** Called at the end of the export phase.
        @throws IOException when things goes horribly wrong, for example if
            the file in which the output is being done is not accessible.
    */
    public void exportEnd()
        throws IOException
    {
        /* ... */
    }

I can not run version 7.1 of Checkstyle right now, I need to update my Java runtime. I will however do that in a few days' time.

Cheers, D.

DarwinNE commented 8 years ago

Hi @DanteCpp I corrected the misplaced throws Can you please check the code with checkstyle 7.1?

Cheers, D.

DanteCpp commented 8 years ago

Hi @DarwinNE, the checkstyle analysis runs without warnings.

Cheers, Dante.

DarwinNE commented 8 years ago

Very cool, thanks!