This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
laboratoare:tutorial-checkstyle [2017/09/28 18:57] Mihai Burduselu [Rezolvare warninguri] |
laboratoare:tutorial-checkstyle [2017/10/02 11:18] (current) Tudor Paraschivescu |
||
---|---|---|---|
Line 1: | Line 1: | ||
=Tutorial checkstyle= | =Tutorial checkstyle= | ||
- | * Responsabil: todo | + | * Responsabil: [[michelcatalin@gmail.com|Mihai Burdușelu]] |
- | * Data publicării: todo | + | * Data publicării: 01.10.2017 |
- | * Data ultimei modificări: todo | + | * Data ultimei modificări: 02.10.2017 |
==Obiective== | ==Obiective== | ||
Line 17: | Line 17: | ||
- [[laboratoare:tutorial-checkstyle:eclipse]] | - [[laboratoare:tutorial-checkstyle:eclipse]] | ||
- | |||
- | - Utilizare checkstyle în terminal (în terminal Ubuntu sau în git bash pe Windows) | ||
==Exemple de warninguri semnalate de checkstyle== | ==Exemple de warninguri semnalate de checkstyle== | ||
Line 44: | Line 42: | ||
3. 'name' hides a field. [HiddenField] | 3. 'name' hides a field. [HiddenField] | ||
4. Parameter minutes should be final. [FinalParameters] | 4. Parameter minutes should be final. [FinalParameters] | ||
- | |||
5. Class 'Dog' looks like designed for extension (can be subclassed), but the method 'bark' does not have javadoc that explains how to do that safely. If class is not designed for extension consider making the class 'Dog' final or making the method 'bark' static/final/abstract/empty, or adding allowed annotation for the method. [DesignForExtension] | 5. Class 'Dog' looks like designed for extension (can be subclassed), but the method 'bark' does not have javadoc that explains how to do that safely. If class is not designed for extension consider making the class 'Dog' final or making the method 'bark' static/final/abstract/empty, or adding allowed annotation for the method. [DesignForExtension] | ||
</code> | </code> | ||
Line 66: | Line 63: | ||
} | } | ||
- | private void bark(final int minutes) { | + | /** |
+ | * @param minutes How long this dog barks. | ||
+ | */ | ||
+ | public void bark(final int minutes) { | ||
System.out.println("My name is " | System.out.println("My name is " | ||
+ this.name | + this.name |