User Tools

Site Tools


Problem constructing authldap
laboratoare:tutorial-checkstyle
Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
laboratoare:tutorial-checkstyle [2017/09/28 18:56]
Mihai Burduselu [Introducere]
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 59: Line 56:
 Următorul cod reprezintă una din modalitățile de corecție ale warningurilor anterioare. Următorul cod reprezintă una din modalitățile de corecție ale warningurilor anterioare.
 <code java> <code java>
 +public class Dog {
 +    private String name;
 +
 +    public Dog(final String newName) {
 +        this.name = newName;
 +    }
 +
 +    /**
 +     * @param minutes How long this dog barks.
 +     */
 +    public void bark(final int minutes) {
 +        System.out.println("​My name is "
 +                + this.name
 +                + " and I am barking for "
 +                + minutes
 +                + " minutes."​);​
 +    }
 +}
  
 </​code>​ </​code>​
laboratoare/tutorial-checkstyle.1506614196.txt.gz · Last modified: 2017/09/28 18:56 by Mihai Burduselu